2 Commity e38c82a12c ... 6c61e502af

Autor SHA1 Wiadomość Data
  xgb 6c61e502af 新增应用 app 红包记录查询 3 dni temu
  xgb 15bd98dca3 缓存获取 有bug 影响到了更新 2 tygodni temu

+ 2 - 2
fs-admin/src/main/java/com/fs/his/task/CompanyBalanceTask.java

@@ -138,9 +138,9 @@ public class CompanyBalanceTask {
      * @Author xgb
      * @Date 2025/12/25 10:31
      */
-    public void checkMchTransferStatusByBatchID(String batchId,String companyIdStr) {
+    public void checkMchTransferStatusByBatchID(String batchId,String companyIdStr,String appId) {
         Long companyId=Long.parseLong(companyIdStr);
-        R result=companyService.checkMchTransferStatusByBatchID(batchId,companyId);
+        R result=companyService.checkMchTransferStatusByBatchID(batchId,companyId,appId);
         log.info("查询商户转账结果:{}",result);
     }
 

+ 2 - 2
fs-company/src/main/java/com/fs/company/controller/common/CommonController.java

@@ -195,11 +195,11 @@ public class CommonController
     }
 
     @GetMapping("common/test3")
-    public R test2(String companyIdStr,String outBatchNo) throws Exception
+    public R test2(String companyIdStr,String outBatchNo ,String appId) throws Exception
     {
         // 默认是前两天时间
         Long companyId=Long.parseLong(companyIdStr);
-        R result=companyService.checkMchTransferStatusByBatchID(outBatchNo,companyId);
+        R result=companyService.checkMchTransferStatusByBatchID(outBatchNo,companyId,appId);
         log.info("查询商户转账结果:{}",result);
         return R.ok();
     }

+ 1 - 2
fs-service/src/main/java/com/fs/company/service/ICompanyService.java

@@ -2,7 +2,6 @@ package com.fs.company.service;
 
 import java.math.BigDecimal;
 import java.time.LocalTime;
-import java.util.Date;
 import java.util.List;
 
 import com.fs.common.core.domain.R;
@@ -201,7 +200,7 @@ public interface ICompanyService
 
     String checkMchTransferStatus(String outBatchNo,Long companyId);
 
-    R checkMchTransferStatusByBatchID(String batchId, Long companyId);
+    R checkMchTransferStatusByBatchID(String batchId, Long companyId, String appId);
 
     void deleteRedPacketLogBatch();
 }

+ 16 - 4
fs-service/src/main/java/com/fs/company/service/impl/CompanyServiceImpl.java

@@ -23,11 +23,12 @@ import com.fs.company.param.CompanyLiveShowParam;
 import com.fs.company.param.CompanyParam;
 import com.fs.company.service.*;
 import com.fs.company.vo.*;
+import com.fs.course.config.AppConfig;
 import com.fs.course.config.CourseConfig;
 import com.fs.course.config.RedPacketConfig;
 import com.fs.course.domain.FsCourseRedPacketLog;
 import com.fs.course.mapper.FsCourseRedPacketLogMapper;
-import com.fs.course.service.IFsCourseRedPacketLogService;
+import com.fs.his.config.AppRedPacketConfig;
 import com.fs.his.config.StoreConfig;
 import com.fs.his.domain.FsInquiryOrder;
 import com.fs.his.domain.FsStoreOrder;
@@ -275,7 +276,7 @@ public class CompanyServiceImpl implements ICompanyService
     }
 
     @Override
-    public R checkMchTransferStatusByBatchID(String batchId, Long companyId) {
+    public R checkMchTransferStatusByBatchID(String batchId, Long companyId, String appId) {
         // 获取配置信息
         CourseConfig courseConfig = JSONUtil.toBean(configService.selectConfigByKey("course.config"), CourseConfig.class);
 
@@ -301,7 +302,18 @@ public class CompanyServiceImpl implements ICompanyService
 
         //创建微信订单
         WxPayConfig payConfig = new WxPayConfig();
-        BeanUtils.copyProperties(config,payConfig);
+        // 如果是应用app
+        String appJson = configService.selectConfigByKey("app.config");
+        AppConfig app = JSONUtil.toBean(appJson, AppConfig.class);
+        if(StringUtils.equals(app.getAppId(),appId)){
+            json = configService.selectConfigByKey("his.AppRedPacket");
+            AppRedPacketConfig appRedPacketConfig = JSONUtil.toBean(json, AppRedPacketConfig.class);
+            BeanUtils.copyProperties(appRedPacketConfig,payConfig);
+        }else {
+            BeanUtils.copyProperties(config,payConfig);
+        }
+
+
         WxPayService wxPayService = new WxPayServiceImpl();
         wxPayService.setConfig(payConfig);
         TransferService transferService=wxPayService.getTransferService();
@@ -1890,7 +1902,7 @@ public class CompanyServiceImpl implements ICompanyService
             }
 
             if(!StringUtils.isEmpty(redLogs.getBatchId())){
-                R result=checkMchTransferStatusByBatchID(redLogs.getBatchId(),redLogs.getCompanyId());
+                R result=checkMchTransferStatusByBatchID(redLogs.getBatchId(),redLogs.getCompanyId(),redLogs.getAppId());
                 if("200".equals(String.valueOf(result.get("code")))){
                     FsCourseRedPacketLog update = new FsCourseRedPacketLog();
                     update.setUpdateTime(new Date());

+ 17 - 0
fs-service/src/main/java/com/fs/course/config/AppConfig.java

@@ -0,0 +1,17 @@
+package com.fs.course.config;
+
+import lombok.Data;
+
+/**
+ * @description: App 应用配置
+ * @author: Xgb
+ * @createDate: 2026/2/24
+ * @version: 1.0
+ */
+@Data
+public class AppConfig {
+    // 应用的appId
+    private String appId;
+    // 舌诊开关
+    private Integer tongueFlag;
+}

+ 13 - 1
fs-service/src/main/java/com/fs/course/service/impl/FsCourseRedPacketLogServiceImpl.java

@@ -21,6 +21,7 @@ import com.fs.company.mapper.CompanyMapper;
 import com.fs.company.mapper.CompanyMoneyLogsMapper;
 import com.fs.company.mapper.CompanyRedPacketBalanceLogsMapper;
 import com.fs.company.service.ICompanyConfigService;
+import com.fs.course.config.AppConfig;
 import com.fs.course.config.CourseConfig;
 import com.fs.course.config.RedPacketConfig;
 import com.fs.course.domain.FsCourseWatchLog;
@@ -28,6 +29,7 @@ import com.fs.course.mapper.FsCourseWatchLogMapper;
 import com.fs.course.param.FsCourseRedPacketLogParam;
 import com.fs.course.vo.FsCourseRedPacketLogListPVO;
 import com.fs.course.vo.FsCourseRedPacketLogListVO;
+import com.fs.his.config.AppRedPacketConfig;
 import com.fs.his.domain.FsUser;
 import com.fs.his.mapper.FsUserMapper;
 import com.fs.his.param.WxSendRedPacketParam;
@@ -534,7 +536,17 @@ public class FsCourseRedPacketLogServiceImpl implements IFsCourseRedPacketLogSer
 
         //创建微信订单
         WxPayConfig payConfig = new WxPayConfig();
-        BeanUtils.copyProperties(config,payConfig);
+        // 如果是应用app
+        String appJson = configService.selectConfigByKey("app.config");
+        AppConfig app = JSONUtil.toBean(appJson, AppConfig.class);
+        if(StringUtils.equals(app.getAppId(),log.getAppId())){
+            json = configService.selectConfigByKey("his.AppRedPacket");
+            AppRedPacketConfig appRedPacketConfig = JSONUtil.toBean(json, AppRedPacketConfig.class);
+            BeanUtils.copyProperties(appRedPacketConfig,payConfig);
+        }else {
+            BeanUtils.copyProperties(config,payConfig);
+        }
+
         WxPayService wxPayService = new WxPayServiceImpl();
         wxPayService.setConfig(payConfig);
         TransferService transferService=wxPayService.getTransferService();

+ 5 - 12
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreProductScrmServiceImpl.java

@@ -102,7 +102,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
 
     @Autowired
     private ConfigUtil configUtil;
-    
+
     @Autowired
     private com.fs.system.service.ISysConfigService configService;
 
@@ -183,14 +183,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
      */
     @Override
     public FsStoreProductScrm selectFsStoreProductById(Long productId){
-        String key = "fs:product:id:" + productId;
-        FsStoreProductScrm scrm = redisCacheT.getCacheObject(key);
-        if(scrm != null){
-            return scrm;
-        }
-        scrm = fsStoreProductMapper.selectFsStoreProductById(productId);
-        redisCacheT.setCacheObject(key, scrm);
-        return scrm;
+        return fsStoreProductMapper.selectFsStoreProductById(productId);
     }
 
     /**
@@ -1071,7 +1064,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
             String productName = product != null ? product.getProductName() : "商品";
             throw new CustomException(productName + "库存不足,当前库存:" + (productStock != null ? productStock : 0) + ",需要数量:" + cartNum);
         }
-        
+
         // 如果有规格,检查规格库存
         if (productAttrValueId != null) {
             Integer attrStock = fsStoreProductAttrValueMapper.selectProductAttrStockForUpdate(productAttrValueId);
@@ -1082,7 +1075,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
             }
         }
     }
-    
+
     @Override
     public void decProductStock(Long productId, Long productAttrValueId, Integer cartNum) {
         // 检查配置是否开启库存检查
@@ -1098,7 +1091,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
         } catch (Exception e) {
             log.error("检查库存配置失败", e);
         }
-        
+
         //处理属性sku
         fsStoreProductAttrValueMapper.decProductAttrStock(productAttrValueId,cartNum);
         fsStoreProductMapper.decProductAttrStock(productId,cartNum);