三七 vor 3 Wochen
Ursprung
Commit
da2ce6ed22

+ 6 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsStorePaymentServiceImpl.java

@@ -20,6 +20,7 @@ import com.fs.common.annotation.DataScope;
 import com.fs.common.annotation.Log;
 import com.fs.common.core.domain.AjaxResult;
 import com.fs.common.core.domain.R;
+import com.fs.common.core.redis.RedisCache;
 import com.fs.common.exception.CustomException;
 import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.ServletUtils;
@@ -181,6 +182,9 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
     @Autowired
     private CloudHostProper cloudHostProper;
 
+    @Autowired
+    private RedisCache redisCache;
+
     @Autowired
     private RedisTemplate<String,BigDecimal> redisTemplate;
 
@@ -1368,6 +1372,8 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
                 logger.error("生成图片失败:{}",e.getMessage(),e);
                 return R.error("生成图片失败");
             }
+
+            redisCache.setCacheObject("company-wxa-code:"+param.getCompanyId()+":appId"+param.getAppId(),url);
             // 返回成功信息
             return R.ok().put("url",url);
 

+ 12 - 2
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStorePaymentScrmServiceImpl.java

@@ -801,6 +801,7 @@ public class FsStorePaymentScrmServiceImpl implements IFsStorePaymentScrmService
         }
         byte[] file;
         try {
+
             file = wxMaService.getQrcodeService().createWxaCodeBytes(
                     "pages_user/user/pay?companyId="+param.getCompanyId(),
                     "release",
@@ -809,6 +810,15 @@ public class FsStorePaymentScrmServiceImpl implements IFsStorePaymentScrmService
                     null,
                     true);
 
+//            file = wxMaService.getQrcodeService().createWxaCodeBytes(
+//                    "pages_user/user/pay?"+scene,
+//                    "release",
+//                    430,
+//                    true,
+//                    null,
+//                    true);
+
+
             // 上传图片到存储桶
             String suffix = ".png";
             CloudStorageService storage = OSSFactory.build();
@@ -820,7 +830,7 @@ public class FsStorePaymentScrmServiceImpl implements IFsStorePaymentScrmService
                 logger.error("生成图片失败:{}",e.getMessage(),e);
                 return R.error("生成图片失败");
             }
-            redisCache.setCacheObject("company-wxa-code:"+param.getCompanyId(),url);
+            redisCache.setCacheObject("company-wxa-code:"+param.getCompanyId()+":appId"+param.getAppId(),url);
             // 返回成功信息
             return R.ok().put("url",url);
 
@@ -854,7 +864,6 @@ public class FsStorePaymentScrmServiceImpl implements IFsStorePaymentScrmService
             }
         }
 
-
         //生成支付流水
         String orderSn = IdUtil.getSnowflake(0, 0).nextIdStr();
         FsStorePaymentScrm storePayment=new FsStorePaymentScrm();
@@ -881,6 +890,7 @@ public class FsStorePaymentScrmServiceImpl implements IFsStorePaymentScrmService
         o.setReqSeqId("payment-"+storePayment.getPayCode());
         o.setTransAmt(storePayment.getPayMoney().toString());
         o.setGoodsDesc("商城订单支付");
+        o.setAppId(param.getAppId());
         HuifuCreateOrderResult result = huiFuService.createOrder(o);
         if(result.getResp_code()!=null&&(result.getResp_code().equals("00000000")||result.getResp_code().equals("00000100"))){
             FsStorePaymentScrm mt=new FsStorePaymentScrm();

+ 2 - 2
fs-user-app/src/main/java/com/fs/app/controller/CompanyUserController.java

@@ -198,9 +198,9 @@ public class CompanyUserController extends  AppBaseController {
 
     @ApiOperation("获取公司收款码")
     @GetMapping("/getCompanyWxaCodeByPayment")
-    public R getCompanyWxaCodeByPayment(@RequestParam("companyId")Long companyId,HttpServletRequest request){
+    public R getCompanyWxaCodeByPayment(@RequestParam("companyId")Long companyId,@RequestParam("appId")String appId,HttpServletRequest request){
         //获取用户码
-        String WxaCode = redisCache.getCacheObject("company-wxa-code:"+companyId);
+        String WxaCode = redisCache.getCacheObject("company-wxa-code:"+companyId+":"+appId);
         return R.ok().put("data",WxaCode);
     }
 

+ 2 - 2
fs-user-app/src/main/java/com/fs/app/controller/store/CompanyUserScrmController.java

@@ -176,9 +176,9 @@ public class CompanyUserScrmController extends AppBaseController {
 
     @ApiOperation("获取公司收款码")
     @GetMapping("/getCompanyWxaCodeByPayment")
-    public R getCompanyWxaCodeByPayment(@RequestParam("companyId")Long companyId,HttpServletRequest request){
+    public R getCompanyWxaCodeByPayment(@RequestParam("companyId")Long companyId,@RequestParam("appId")Long appId,HttpServletRequest request){
         //获取用户码
-        String WxaCode = redisCache.getCacheObject("company-wxa-code:"+companyId);
+        String WxaCode = redisCache.getCacheObject("company-wxa-code:"+companyId+":"+appId);
         return R.ok().put("data",WxaCode);
     }