Explorar el Código

feat:商城生成二维码和获取调整-添加销售(鸿森堂)

caoliqin hace 1 semana
padre
commit
d355d64933

+ 24 - 17
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStorePaymentScrmServiceImpl.java

@@ -17,6 +17,7 @@ import com.fs.common.annotation.DataScope;
 import com.fs.common.config.FSSysConfig;
 import com.fs.common.core.domain.R;
 import com.fs.common.core.redis.RedisCache;
+import com.fs.common.utils.CloudHostUtils;
 import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.company.domain.Company;
@@ -802,22 +803,24 @@ public class FsStorePaymentScrmServiceImpl implements IFsStorePaymentScrmService
         }
         byte[] file;
         try {
-
-            file = wxMaService.getQrcodeService().createWxaCodeBytes(
-                    "pages_user/user/pay?companyId="+param.getCompanyId(),
-                    "release",
-                    430,
-                    true,
-                    null,
-                    true);
-
-//            file = wxMaService.getQrcodeService().createWxaCodeBytes(
-//                    "pages_user/user/pay?"+scene,
-//                    "release",
-//                    430,
-//                    true,
-//                    null,
-//                    true);
+            if(CloudHostUtils.hasCloudHostName("鸿森堂")){
+                file = wxMaService.getQrcodeService().createWxaCodeBytes(
+                        "pages_user/user/pay?" + scene,
+                        "release",
+                        430,
+                        true,
+                        null,
+                        true);
+            } else {
+                file = wxMaService.getQrcodeService().createWxaCodeBytes(
+                        "pages_user/user/pay?companyId=" + param.getCompanyId(),
+                        "release",
+                        430,
+                        true,
+                        null,
+                        true);
+            }
+            logger.info("生成的二维码参数:{}", "pages_user/user/pay?" + scene);
 
 
             // 上传图片到存储桶
@@ -831,7 +834,11 @@ public class FsStorePaymentScrmServiceImpl implements IFsStorePaymentScrmService
                 logger.error("生成图片失败:{}",e.getMessage(),e);
                 return R.error("生成图片失败");
             }
-            redisCache.setCacheObject("company-wxa-code:"+param.getCompanyId()+":"+param.getAppId(),url);
+            if(CloudHostUtils.hasCloudHostName("鸿森堂")){
+                redisCache.setCacheObject("company-wxa-code:" + param.getCompanyId() + ":" + param.getAppId() + ":" + param.getCompanyUserId(), url);
+            } else {
+                redisCache.setCacheObject("company-wxa-code:" + param.getCompanyId() + ":" + param.getAppId(), url);
+            }
             // 返回成功信息
             return R.ok().put("url",url);
 

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

@@ -15,6 +15,7 @@ import com.fs.common.core.domain.R;
 import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.core.redis.RedisCache;
 import com.fs.common.exception.CustomException;
+import com.fs.common.utils.CloudHostUtils;
 import com.fs.common.utils.ServletUtils;
 import com.fs.common.utils.sign.Md5Utils;
 import com.fs.company.domain.Company;
@@ -259,7 +260,7 @@ public class CompanyUserScrmController extends AppBaseController {
 
     @ApiOperation("获取公司收款码")
     @GetMapping("/getCompanyWxaCodeByPayment")
-    public R getCompanyWxaCodeByPayment(@RequestParam("companyId")Long companyId,@RequestParam(value = "appId", required = false) String appId,HttpServletRequest request){
+    public R getCompanyWxaCodeByPayment(@RequestParam("companyId")Long companyId,@RequestParam(value = "appId", required = false) String appId, @RequestParam(required = false) Long companyUserId, HttpServletRequest request){
 
         String json = configService.selectConfigByKey("his.pay");
         PayConfigDTO payConfigDTO = JSONUtil.toBean(json, PayConfigDTO.class);
@@ -267,7 +268,12 @@ public class CompanyUserScrmController extends AppBaseController {
             appId = payConfigDTO.getAppId();
         }
         //获取用户码
-        String WxaCode = redisCache.getCacheObject("company-wxa-code:"+companyId+":"+appId);
+        String WxaCode;
+        if(CloudHostUtils.hasCloudHostName("鸿森堂")) {
+            WxaCode = redisCache.getCacheObject("company-wxa-code:" + companyId + ":" + appId + ":" + companyUserId);
+        } else {
+            WxaCode = redisCache.getCacheObject("company-wxa-code:" + companyId + ":" + appId);
+        }
         return R.ok().put("data",WxaCode);
     }