Browse Source

1、app红包多商户配置回调地址处理

yys 3 ngày trước cách đây
mục cha
commit
8fab8c50cb

+ 5 - 0
fs-service/src/main/java/com/fs/his/config/AppRedPacketConfig.java

@@ -46,4 +46,9 @@ public class AppRedPacketConfig {
     private String publicKeyPath;
 
     private String notifyUrl;
+
+    /**
+     * 总回调地址
+     */
+    private String notifyUrlScrm;
 }

+ 9 - 2
fs-service/src/main/java/com/fs/his/service/impl/FsStorePaymentServiceImpl.java

@@ -1951,16 +1951,23 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
         //组合返回参数
         String json;
         R result = new R();
+        boolean fromRedis = true; // 标记是否从Redis获取
         json = redisCache.getCacheObject("sys_config:redPacket.config.new");
         if (StringUtil.isNullOrEmpty(json) || json.isEmpty()) {
+            fromRedis = false;
             json = configService.selectConfigByKey("his.AppRedPacket");
         }
-//        String json = configService.selectConfigByKey("his.AppRedPacket");
         AppRedPacketConfig config = JSONUtil.toBean(json, AppRedPacketConfig.class);
+
+        // 如果是从Redis获取的配置(即没进入上面的if),则设置NotifyUrl为Scrm的地址
+        if (fromRedis) {
+            config.setNotifyUrl(config.getNotifyUrlScrm());
+        }
+
         if (config.getIsNew() != null && config.getIsNew() == 1) {
             result = sendRedPacketV3(param, config);
         } else {
-            result= sendRedPacketLegacy(param, config);
+            result = sendRedPacketLegacy(param, config);
         }
         if (result.getMsg().equals("商家余额不足") && param.getRedPacketMode() == 1) {
             redisCache.incr("sys_config:redPacket.config.newCount",1L);