Browse Source

Merge remote-tracking branch 'origin/ScrmStore'

yfh 2 weeks ago
parent
commit
ced61bcf45
24 changed files with 385 additions and 124 deletions
  1. 61 6
      fs-admin/src/main/java/com/fs/hisStore/FsStoreHealthOrderScrmController.java
  2. 2 2
      fs-admin/src/main/java/com/fs/hisStore/FsStoreOrderScrmController.java
  3. 22 0
      fs-service/src/main/java/com/fs/course/dto/FsOrderDeliveryNoteDTO.java
  4. 38 18
      fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java
  5. 38 4
      fs-service/src/main/java/com/fs/his/utils/ConfigUtil.java
  6. 12 0
      fs-service/src/main/java/com/fs/hisStore/config/AgreementConfig.java
  7. 6 0
      fs-service/src/main/java/com/fs/hisStore/domain/FsStoreOrderScrm.java
  8. 4 0
      fs-service/src/main/java/com/fs/hisStore/mapper/FsStorePaymentScrmMapper.java
  9. 1 1
      fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreProductScrmMapper.java
  10. 2 2
      fs-service/src/main/java/com/fs/hisStore/param/LoginMpWxParam.java
  11. 8 0
      fs-service/src/main/java/com/fs/hisStore/service/IFsStoreOrderScrmService.java
  12. 16 5
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreAfterSalesScrmServiceImpl.java
  13. 18 3
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderScrmServiceImpl.java
  14. 3 2
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreProductScrmServiceImpl.java
  15. 13 0
      fs-service/src/main/java/com/fs/huifuPay/sdk/opps/core/request/V2TradePaymentScanpayRefundRequest.java
  16. 11 39
      fs-service/src/main/java/com/fs/watch/utils/MyHttpUtils.java
  17. 38 25
      fs-service/src/main/resources/application-config-dev.yml
  18. 1 1
      fs-service/src/main/resources/application-config-druid-bjczwh.yml
  19. 12 5
      fs-service/src/main/resources/application-config-druid-yjb.yml
  20. 1 1
      fs-service/src/main/resources/application-dev.yml
  21. 12 0
      fs-service/src/main/resources/mapper/hisStore/FsStoreOrderScrmMapper.xml
  22. 7 0
      fs-user-app/src/main/java/com/fs/app/controller/store/CommonScrmController.java
  23. 51 5
      fs-user-app/src/main/java/com/fs/app/controller/store/H5ScrmController.java
  24. 8 5
      fs-user-app/src/main/java/com/fs/app/controller/store/WxUserScrmController.java

+ 61 - 6
fs-admin/src/main/java/com/fs/hisStore/FsStoreHealthOrderScrmController.java

@@ -6,11 +6,13 @@ import com.alibaba.fastjson.JSONObject;
 import com.fs.common.annotation.Log;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
 import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
 import com.fs.common.utils.StringUtils;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.company.service.ICompanyMoneyLogsService;
+import com.fs.course.dto.FsOrderDeliveryNoteDTO;
 import com.fs.erp.service.IErpOrderService;
 import com.fs.his.service.IFsUserService;
 import com.fs.hisStore.dto.StoreOrderProductDTO;
@@ -21,9 +23,8 @@ import com.fs.hisStore.vo.FsStoreOrderItemExportVO;
 import com.fs.hisStore.vo.FsStoreOrderVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.util.List;
 
@@ -51,6 +52,12 @@ public class FsStoreHealthOrderScrmController extends BaseController {
     @Autowired
     private ICompanyMoneyLogsService moneyLogsService;
 
+    // 允许的文件扩展名
+    private static final String[] ALLOWED_EXCEL_EXTENSIONS = {".xlsx", ".xls"};
+
+    // 最大文件大小(5MB)
+    private static final long MAX_FILE_SIZE = 5 * 1024 * 1024; // 5MB
+
     /**
      * 查询健康商城订单列表
      */
@@ -91,7 +98,7 @@ public class FsStoreHealthOrderScrmController extends BaseController {
     @Log(title = "健康商城订单", businessType = BusinessType.EXPORT)
     @GetMapping("/healthExport")
     public AjaxResult export1(FsStoreOrderParam param) {
-        if (param.getBeginTime().equals("") && param.getEndTime().equals("")){
+        if ("".equals(param.getBeginTime()) && "".equals(param.getEndTime())){
             param.setBeginTime(null);
             param.setEndTime(null);
         }
@@ -130,10 +137,10 @@ public class FsStoreHealthOrderScrmController extends BaseController {
 
 
     @PreAuthorize("@ss.hasPermi('store:healthStoreOrder:exportItems')")
-    @Log(title = "健康商城订单明细导出", businessType = BusinessType.EXPORT)
+    @Log(title = "商城订单明细导出", businessType = BusinessType.EXPORT)
     @GetMapping("/healthExportItems")
     public AjaxResult exportItems1(FsStoreOrderParam param) {
-        if (param.getBeginTime().equals("") && param.getEndTime().equals("")){
+        if ("".equals(param.getBeginTime()) && "".equals(param.getEndTime())){
             param.setBeginTime(null);
             param.setEndTime(null);
         }
@@ -173,4 +180,52 @@ public class FsStoreHealthOrderScrmController extends BaseController {
         ExcelUtil<FsStoreOrderItemExportVO> util = new ExcelUtil<FsStoreOrderItemExportVO>(FsStoreOrderItemExportVO.class);
         return util.exportExcel(list, "订单明细数据");
     }
+
+    //订单发货批量导入
+    @Log(title = "发货同步导入", businessType = BusinessType.IMPORT)
+    @PostMapping("/importDeliveryNoteExpress")
+    public R importDeliveryNoteExpress(@RequestParam("file") MultipartFile file, @RequestParam("miniAppId") String miniAppId) {
+        // 1. 检查文件是否为空
+        if (file.isEmpty()) {
+            return R.error("上传的文件不能为空");
+        }
+        // 2. 检查文件大小
+        if (file.getSize() > MAX_FILE_SIZE) {
+            return R.error("文件大小不能超过5MB");
+        }
+        // 3. 检查文件扩展名
+        String fileName = file.getOriginalFilename();
+        if (fileName == null || !isValidExcelFile(fileName)) {
+            return R.error("请上传Excel文件(.xlsx或.xls格式)");
+        }
+
+        ExcelUtil<FsOrderDeliveryNoteDTO> util=new ExcelUtil<>(FsOrderDeliveryNoteDTO.class);
+        try {
+            List<FsOrderDeliveryNoteDTO> dtoList = util.importExcel(file.getInputStream());
+            if(!dtoList.isEmpty()){
+                fsStoreOrderService.importDeliveryNoteExpress(dtoList,miniAppId);
+            }else {
+                R.error("操作失败,导入数据不能小于1条!");
+            }
+        }catch (Exception e){
+            e.getStackTrace();
+        }
+        return R.ok();
+    }
+
+    @GetMapping("/importDeliveryNoteExpressTemplate")
+    public AjaxResult importTemplate() {
+        ExcelUtil<FsOrderDeliveryNoteDTO> util = new ExcelUtil<>(FsOrderDeliveryNoteDTO.class);
+        return util.importTemplateExcel("订单发货导入模板");
+    }
+
+    // 检查文件是否为有效的Excel文件
+    private boolean isValidExcelFile(String fileName) {
+        for (String ext : ALLOWED_EXCEL_EXTENSIONS) {
+            if (fileName.toLowerCase().endsWith(ext)) {
+                return true;
+            }
+        }
+        return false;
+    }
 }

+ 2 - 2
fs-admin/src/main/java/com/fs/hisStore/FsStoreOrderScrmController.java

@@ -217,7 +217,7 @@ public class FsStoreOrderScrmController extends BaseController {
     @Log(title = "订单", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(FsStoreOrderParam param) {
-        if (param.getBeginTime().equals("") && param.getEndTime().equals("")){
+        if ("".equals(param.getBeginTime()) && "".equals(param.getEndTime())){
             param.setBeginTime(null);
             param.setEndTime(null);
         }
@@ -262,7 +262,7 @@ public class FsStoreOrderScrmController extends BaseController {
     @Log(title = "订单明细导出", businessType = BusinessType.EXPORT)
     @GetMapping("/exportItems")
     public AjaxResult exportItems(FsStoreOrderParam param) {
-        if (param.getBeginTime().equals("") && param.getEndTime().equals("")){
+        if ("".equals(param.getBeginTime()) && "".equals(param.getEndTime())){
             param.setBeginTime(null);
             param.setEndTime(null);
         }

+ 22 - 0
fs-service/src/main/java/com/fs/course/dto/FsOrderDeliveryNoteDTO.java

@@ -0,0 +1,22 @@
+package com.fs.course.dto;
+
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+/**
+ * 订单发货下载模板
+ * **/
+@Data
+public class FsOrderDeliveryNoteDTO {
+    /**
+     * 系统订单号
+     * **/
+    @Excel(name = "系统订单号(必填)",width = 40,sort = 1)
+    private String orderNumber;
+
+    /**
+     * 发货状态
+     * **/
+    @Excel(name = "系统订单号(2 待收货 3 交易完成)填写对应数字",width = 50,sort = 2)
+    private Integer deliveryNoteStatus;
+}

+ 38 - 18
fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java

@@ -45,6 +45,10 @@ import com.fs.his.service.*;
 import com.fs.his.utils.ConfigUtil;
 import com.fs.his.utils.PhoneUtil;
 import com.fs.his.vo.*;
+import com.fs.hisStore.domain.FsStoreOrderScrm;
+import com.fs.hisStore.domain.FsStorePaymentScrm;
+import com.fs.hisStore.mapper.FsStoreOrderScrmMapper;
+import com.fs.hisStore.mapper.FsStorePaymentScrmMapper;
 import com.fs.hisapi.domain.ApiResponse;
 import com.fs.hisapi.param.CreateOrderParam;
 import com.fs.hisapi.param.RecipeDetailParam;
@@ -132,6 +136,10 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
     private HuiFuService huiFuService;
     @Autowired
     private FsStoreOrderMapper fsStoreOrderMapper;
+
+    @Autowired
+    private FsStoreOrderScrmMapper fsStoreOrderScrmMapper;
+
     @Autowired
     private FsStoreOrderItemMapper fsStoreOrderItemMapper;
     @Autowired
@@ -151,6 +159,9 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
     private IFsStorePaymentService storePaymentService;
     @Autowired
     private FsStorePaymentMapper fsStorePaymentMapper;
+
+    @Autowired
+    private FsStorePaymentScrmMapper fsStorePaymentScrmMapper;
     @Autowired
     private IFsExpressService expressService;
     @Autowired
@@ -1388,14 +1399,14 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
     @Transactional(rollbackFor = Throwable.class, propagation = Propagation.REQUIRED)
     public R payConfirm(String orderCode, String payCode, String tradeNo, String payType, Integer type) {
         try {
-            FsStoreOrder order = null;
+            FsStoreOrderScrm order = null;
             if (type.equals(1)) {
 
-                FsStorePayment storePayment = fsStorePaymentMapper.selectFsStorePaymentByPaymentCode(payCode);
+                FsStorePaymentScrm storePayment = fsStorePaymentScrmMapper.selectFsStorePaymentByPaymentCode(payCode);
                 if (storePayment != null) {
                     if (storePayment.getStatus().equals(0)) {
                         log.info(payCode + "待支付");
-                        FsStorePayment paymentMap = new FsStorePayment();
+                        FsStorePaymentScrm paymentMap = new FsStorePaymentScrm();
                         paymentMap.setPaymentId(storePayment.getPaymentId());
                         paymentMap.setStatus(1);
                         paymentMap.setPayTime(new Date());
@@ -1412,33 +1423,42 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
                             paymentMap.setBankSerialNo(orderResult.getBankOrderId());
                             paymentMap.setBankTransactionId(orderResult.getBankTrxId());
                         }
-                        fsStorePaymentMapper.updateFsStorePayment(paymentMap);
+                        fsStorePaymentScrmMapper.updateFsStorePayment(paymentMap);
                         log.info(payCode + "已支付");
-                        order = fsStoreOrderMapper.selectFsStoreOrderByOrderId(Long.parseLong(storePayment.getBusinessId()));
+                        order = fsStoreOrderScrmMapper.selectFsStoreOrderById(Long.parseLong(storePayment.getBusinessOrderId()));
                     }
                 } else {
                     log.info(payCode + "支付单号不存在");
                     return R.error("支付单号不存在");
                 }
             } else if (type.equals(2)) {
-                order = fsStoreOrderMapper.selectFsStoreOrderByOrderCode(orderCode);
+                order = fsStoreOrderScrmMapper.selectFsStoreOrderByOrderCode(orderCode);
             }
-            if (order != null && !order.getStatus().equals(FsStoreOrderStatusEnum.STATUS_1.getValue())) {
+//            if (order != null && !order.getStatus().equals(FsStoreOrderStatusEnum.STATUS_1.getValue())) {
+//                log.info(payCode + "订单号不为待支付回退");
+//                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+//                return R.error();
+//            }
+
+            //orderScrm迁移的表待支付状态码为:0
+            if (order != null && !order.getStatus().equals(0)) {//判断订单状态是否待支付
                 log.info(payCode + "订单号不为待支付回退");
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return R.error();
             }
-            if (order != null && !order.getIsPay().equals(0)) {
+
+            if (order != null && !order.getPaid().equals(0)) {
                 log.info(payCode + "订单号支付不为待支付回退");
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return R.error();
             }
-            fsStoreOrderLogsService.create(order.getOrderId(), FsStoreOrderLogEnum.PAY_ORDER_SUCCESS.getValue(),
+            fsStoreOrderLogsService.create(order.getId(), FsStoreOrderLogEnum.PAY_ORDER_SUCCESS.getValue(),
                     FsStoreOrderLogEnum.PAY_ORDER_SUCCESS.getDesc());
-            FsStoreOrder storeOrder = new FsStoreOrder();
-            storeOrder.setOrderId(order.getOrderId());
-            storeOrder.setIsPay(1);
-            storeOrder.setStatus(2);
+            FsStoreOrderScrm storeOrder = new FsStoreOrderScrm();
+            storeOrder.setId(order.getId());
+            storeOrder.setPaid(1);
+//            storeOrder.setStatus(2);
+            storeOrder.setStatus(1);//代发货
             storeOrder.setPrescribePrice(order.getTotalPrice());
             SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("his.store");
             Map<String, Object> config = (Map<String, Object>) JSON.parse(sysConfig.getConfigValue());
@@ -1451,20 +1471,20 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
             } else {
                 storeOrder.setFollowDoctorId(iFsDoctorService.selectFollowDoctorDoctorByPackage());
             }
-            if (order.getCycle() >= followRate) {
+            if (order.getCycle() != null && order.getCycle() >= followRate) {
                 Calendar calendar = Calendar.getInstance();
                 calendar.setTime(new Date());
                 calendar.add(Calendar.DAY_OF_MONTH, followRate);
                 storeOrder.setFollowTime(calendar.getTime());
             }
             storeOrder.setPayTime(new Date());
-            fsStoreOrderMapper.updateFsStoreOrder(storeOrder);
+            fsStoreOrderScrmMapper.updateFsStoreOrder(storeOrder);
             //更新优惠券状态
-            if (order.getUserCouponId() != null && order.getUserCouponId() > 0) {
-                FsUserCoupon userCoupon = userCouponService.selectFsUserCouponById(order.getUserCouponId());
+            if (order.getCouponId() != null && order.getCouponId() > 0) {
+                FsUserCoupon userCoupon = userCouponService.selectFsUserCouponById(order.getCouponId());
                 if (userCoupon != null && userCoupon.getStatus().equals(0)) {
                     userCoupon.setUseTime(new Date());
-                    userCoupon.setBusinessId(order.getOrderId());
+                    userCoupon.setBusinessId(order.getId());
                     userCoupon.setBusinessType(2);
                     userCoupon.setStatus(1);
                     userCouponService.updateFsUserCoupon(userCoupon);

+ 38 - 4
fs-service/src/main/java/com/fs/his/utils/ConfigUtil.java

@@ -33,7 +33,7 @@ public class ConfigUtil {
 
     public FsErpConfig getErpConfig(){
         if (this.fsErpConfig==null){
-            SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("erp.config");
+            SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("his.config");
             String configValue = sysConfig.getConfigValue();
             FsErpConfig config = JSON.parseObject(configValue, FsErpConfig.class);
             this.fsErpConfig=config;
@@ -43,7 +43,7 @@ public class ConfigUtil {
         }
     }
 
-    public <T> T generateConfigByKey(String key, Class<T> clazz){
+    public <T> T generateStructConfigByKey(String key, Class<T> clazz){
         SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey(key);
         String configValue = sysConfig.getConfigValue();
         if(configValue != null && configValue.trim().startsWith("[")){
@@ -57,12 +57,17 @@ public class ConfigUtil {
     }
 
     public JSONObject generateConfigByKey(String key){
+        int index = 0;
+        return generateConfigByKeyIndexed(key,index);
+    }
+
+    public JSONObject generateConfigByKeyIndexed(String key,int index){
         SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey(key);
         String configValue = sysConfig.getConfigValue();
         if(configValue != null && configValue.trim().startsWith("[")){
             JSONArray array = JSON.parseArray(configValue);
-            if (array.size() > 0) {
-                return array.getJSONObject(0); // 取第一个元素
+            if (array.size() >= index+1) {
+                return array.getJSONObject(index);
             }
             return new JSONObject();
         }
@@ -70,4 +75,33 @@ public class ConfigUtil {
     }
 
 
+    public JSONObject generateConfigMiniByKey(String key, String appId) {
+
+        SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey(key);
+        if (sysConfig == null) {
+            throw new RuntimeException("未找到key为[" + key + "]的配置");
+        }
+
+        String configValue = sysConfig.getConfigValue();
+        if (configValue == null || configValue.trim().isEmpty()) {
+            throw new RuntimeException("key为[" + key + "]的配置值为空");
+        }
+
+        if (configValue.trim().startsWith("[")) {
+            JSONArray array = JSON.parseArray(configValue);
+
+            return array.stream()
+                    .map(obj -> (JSONObject) obj)
+                    .filter(json -> appId.equals(json.getString("appid")))
+                    .findFirst()
+                    .orElseThrow(() -> new RuntimeException("未找到与appId[" + appId + "]匹配的配置"));
+        }
+
+        JSONObject jsonObject = JSONObject.parseObject(configValue);
+        if (!appId.equals(jsonObject.getString("appId"))) {
+            throw new RuntimeException("配置的appId与当前appId[" + appId + "]不匹配");
+        }
+        return jsonObject;
+    }
+
 }

+ 12 - 0
fs-service/src/main/java/com/fs/hisStore/config/AgreementConfig.java

@@ -8,4 +8,16 @@ import java.io.Serializable;
 public class AgreementConfig implements Serializable {
     String userAgreement;
     String privacyPolicy;
+    //医生注册协议
+    String doctorRegister;
+    //医生多机构备案协议
+    String doctorFiling;
+    //用户协议
+    String userRegister;
+    //隐私协议
+    String userPrivacy;
+    //健康客服协议
+    String userHealth;
+    //会员服务协议
+    String vipService;
 }

+ 6 - 0
fs-service/src/main/java/com/fs/hisStore/domain/FsStoreOrderScrm.java

@@ -268,4 +268,10 @@ public class FsStoreOrderScrm extends BaseEntity
 
     private Integer orderMedium; //媒体来源
 
+    //------------新增字段---------------
+    private BigDecimal prescribePrice;//处方定价
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date followTime;//下次随访日期
+    private Long followDoctorId;//随访医生id
+    private Integer cycle; //用药周期
 }

+ 4 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsStorePaymentScrmMapper.java

@@ -4,6 +4,7 @@ import java.util.List;
 import java.util.Map;
 
 import com.alibaba.fastjson.JSONObject;
+import com.fs.his.domain.FsStorePayment;
 import com.fs.hisStore.domain.FsStorePaymentScrm;
 import com.fs.hisStore.param.FsStorePaymentParam;
 import com.fs.hisStore.param.FsStoreStatisticsParam;
@@ -345,4 +346,7 @@ public interface FsStorePaymentScrmMapper
 
     @Select("select * from fs_store_payment_scrm where trade_no=#{tradeNo}")
     FsStorePaymentScrm selectFsStorePaymentByTradeNo(String tradeNo);
+
+    @Select("select * from fs_store_payment_scrm where pay_code=#{payCode}")
+    FsStorePaymentScrm selectFsStorePaymentByPaymentCode(String payCode);
 }

+ 1 - 1
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreProductScrmMapper.java

@@ -134,7 +134,7 @@ public interface FsStoreProductScrmMapper
             "and p.cate_id =#{maps.cateId}  " +
             "</if>" +
             "<if test = 'maps.defaultOrder != null and maps.defaultOrder==\"desc\"  '> " +
-            "order by p.sort desc " +
+            "order by p.sort desc,product_id desc" +
             "</if>" +
             "<if test = 'maps.priceOrder != null and maps.priceOrder==\"desc\"   '> " +
             "order by p.price desc " +

+ 2 - 2
fs-service/src/main/java/com/fs/hisStore/param/LoginMpWxParam.java

@@ -23,6 +23,6 @@ public class LoginMpWxParam implements Serializable {
     private String signature;
 
     private String userCode;
-
-
+    //小程序APPID
+    private String appId;
 }

+ 8 - 0
fs-service/src/main/java/com/fs/hisStore/service/IFsStoreOrderScrmService.java

@@ -10,6 +10,7 @@ import com.fs.api.param.OrderListParam;
 import com.fs.api.vo.OrderListVO;
 import com.fs.common.core.domain.R;
 import com.fs.company.domain.CompanyUser;
+import com.fs.course.dto.FsOrderDeliveryNoteDTO;
 import com.fs.erp.domain.ErpOrder;
 import com.fs.hisStore.domain.FsStoreOrderScrm;
 import com.fs.hisStore.dto.ExpressNotifyDTO;
@@ -239,4 +240,11 @@ public interface IFsStoreOrderScrmService
     R updateSalesOrderMoneyByProduct(FsStoreOrderMoneyByProductParam param);
 
     List<FsStoreProductCountsVO> selectFsStoreProductCountsByDept(Map<String, Object> map, Long deptId);
+
+    /**
+     * 批量导入更新微信订单发货状态
+     * @param dtoList 订单数据
+     * @param miniAppId 小程序Id
+     * **/
+    void importDeliveryNoteExpress(List<FsOrderDeliveryNoteDTO> dtoList,String miniAppId);
 }

+ 16 - 5
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreAfterSalesScrmServiceImpl.java

@@ -16,6 +16,8 @@ import com.fs.core.config.WxPayProperties;
 import com.fs.erp.dto.BaseResponse;
 import com.fs.erp.dto.ErpRefundUpdateRequest;
 import com.fs.erp.service.IErpOrderService;
+import com.fs.his.utils.ConfigUtil;
+import com.fs.hisStore.enums.SysConfigEnum;
 import com.fs.hisStore.param.*;
 import com.fs.huifuPay.domain.HuiFuRefundResult;
 import com.fs.huifuPay.sdk.opps.core.request.V2TradePaymentScanpayRefundRequest;
@@ -106,6 +108,9 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
     @Autowired
     private WxPayProperties wxPayProperties;
 
+    @Autowired
+    private ConfigUtil configUtil;
+
 
     /**
      * 查询售后记录
@@ -191,7 +196,9 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
         if(order.getStatus()==0){
             return R.error("未支付订单不能申请售后");
         }
-        if(StringUtils.isEmpty(order.getExtendOrderId())){
+        if("1".equals(configUtil.generateConfigByKey(SysConfigEnum.HIS_CONFIG.getKey()).getString("erpOpen"))
+                && StringUtils.isEmpty(order.getExtendOrderId())){
+            logger.info("erpOpen:{}",configUtil.generateConfigByKey(SysConfigEnum.HIS_CONFIG.getKey()).getString("erpOpen"));
             return R.error("仓库未生成订单,暂时不能申请退款,请联系客服");
         }
         if(order.getStatus()== OrderInfoEnum.STATUS_NE3.getValue()){
@@ -581,11 +588,11 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
         if(order.getPayMoney().compareTo(BigDecimal.ZERO)==1){
             List<FsStorePaymentScrm> payments=paymentService.selectFsStorePaymentByOrderId(order.getId());
             if(payments!=null){
+                String json = configService.selectConfigByKey("store.pay");
+                FsPayConfigScrm fsPayConfig = JSON.parseObject(json, FsPayConfigScrm.class);
                 for(FsStorePaymentScrm payment:payments){
                     if (payment.getPayMode()==null||payment.getPayMode().equals("wx")){
                         WxPayConfig payConfig = new WxPayConfig();
-                        String json = configService.selectConfigByKey("store.pay");
-                        FsPayConfigScrm fsPayConfig = JSON.parseObject(json, FsPayConfigScrm.class);
                         payConfig.setAppId(fsPayConfig.getAppId());
                         payConfig.setMchId(fsPayConfig.getWxMchId());
                         payConfig.setMchKey(fsPayConfig.getWxMchKey());
@@ -618,6 +625,8 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
                     }else if (payment.getPayMode()!=null&&payment.getPayMode().equals("hf")){
                         V2TradePaymentScanpayRefundRequest request = new V2TradePaymentScanpayRefundRequest();
                         DecimalFormat df = new DecimalFormat("0.00");
+                        request.setOrgHfSeqId(payment.getTradeNo());
+                        request.setHuifuId(fsPayConfig.getHuifuId());
                         request.setOrdAmt(df.format(refundAmount));
                         request.setOrgReqDate(new SimpleDateFormat("yyyyMMdd").format(payment.getCreateTime()));
                         request.setReqSeqId("refund-"+payment.getPayCode());
@@ -753,7 +762,7 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
             StoreConfig config=JSONUtil.toBean(json,StoreConfig.class);
             FsStoreOrderScrm order=orderService.selectFsStoreOrderByOrderCode(storeAfterSales.getOrderCode());
             if(order.getStoreHouseCode()!=null){
-                if(order.getStoreHouseCode().equals("CQDS001")){
+                if(order.getStoreHouseCode().equals("CK01")){
                     storeAfterSales.setConsignee(config.getRefundConsignee());
                     storeAfterSales.setPhoneNumber(config.getRefundPhoneNumber());
                     storeAfterSales.setAddress(config.getRefundAddress());
@@ -851,7 +860,9 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
         if(order.getStatus()==0){
             return R.error("未支付订单不能申请售后");
         }
-        if(StringUtils.isEmpty(order.getExtendOrderId())){
+        if("1".equals(configUtil.generateConfigByKey(SysConfigEnum.HIS_CONFIG.getKey()).getString("erpOpen"))
+                && StringUtils.isEmpty(order.getExtendOrderId())){
+            logger.info("erpOpen:{}",configUtil.generateConfigByKey(SysConfigEnum.HIS_CONFIG.getKey()).getString("erpOpen"));
             return R.error("仓库未生成订单,暂时不能申请退款,请联系客服");
         }
         if(order.getStatus()== OrderInfoEnum.STATUS_NE3.getValue()){

+ 18 - 3
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderScrmServiceImpl.java

@@ -1,5 +1,6 @@
 package com.fs.hisStore.service.impl;
 
+import cn.binarywang.wx.miniapp.api.WxMaService;
 import cn.hutool.core.net.URLDecoder;
 import cn.hutool.core.util.IdUtil;
 import cn.hutool.core.util.NumberUtil;
@@ -31,7 +32,9 @@ import com.fs.company.mapper.CompanyMoneyLogsMapper;
 import com.fs.company.service.ICompanyDeptService;
 import com.fs.company.service.ICompanyService;
 import com.fs.company.service.ICompanyUserService;
+import com.fs.core.config.WxMaConfiguration;
 import com.fs.core.config.WxPayProperties;
+import com.fs.course.dto.FsOrderDeliveryNoteDTO;
 import com.fs.erp.domain.*;
 import com.fs.erp.dto.*;
 import com.fs.erp.mapper.FsErpFinishPushMapper;
@@ -1530,7 +1533,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService
     @Override
     public R createOmsOrder(Long orderId) throws ParseException {
         FsStoreOrderScrm order=fsStoreOrderMapper.selectFsStoreOrderById(orderId);
-        FsSysConfig erpConfig = configUtil.generateConfigByKey(SysConfigEnum.HIS_CONFIG.getKey(), FsSysConfig.class);
+        FsSysConfig erpConfig = configUtil.generateStructConfigByKey(SysConfigEnum.HIS_CONFIG.getKey(), FsSysConfig.class);
         List<Long> noErpCompany = erpConfig.getNoErpCompany();
         if (noErpCompany != null && noErpCompany.contains(order.getCompanyId())) {
             log.info("订单:{},相关公司不推送erp", order.getOrderCode());
@@ -1563,7 +1566,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService
 
     @Override
     public ErpOrder getErpOrder(FsStoreOrderScrm order) throws ParseException {
-        FsSysConfig erpConfig = configUtil.generateConfigByKey("his.config",FsSysConfig.class);
+        FsSysConfig erpConfig = configUtil.generateStructConfigByKey("his.config",FsSysConfig.class);
         ErpOrder erpOrder=new ErpOrder();
         if (order.getCompanyId()!=null){
             erpOrder.setVip_code(order.getUserId().toString()+ order.getCompanyId().toString());
@@ -1815,7 +1818,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService
     @Transactional
     public R refundOrderMoney(Long orderId) {
         IErpOrderService erpOrderService = getErpService();
-        FsErpConfig erpConfig = configUtil.generateConfigByKey("his.config", FsErpConfig.class);
+        FsErpConfig erpConfig = configUtil.generateStructConfigByKey("his.config", FsErpConfig.class);
         FsStoreOrderScrm order = fsStoreOrderMapper.selectFsStoreOrderById(orderId);
         if(order.getStatus()==-2){
             return R.error("已退款");
@@ -2934,4 +2937,16 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService
 
         return vos;
     }
+
+    @Override
+    public void importDeliveryNoteExpress(List<FsOrderDeliveryNoteDTO> dtoList, String miniAppId) {
+       try {
+           //获取微信token逻辑
+           final WxMaService wxService = WxMaConfiguration.getMaService(miniAppId);
+           String token = wxService.getAccessToken();
+           System.out.println("获取到的token------------->:"+token);
+       }catch (Exception e){
+           e.getStackTrace();
+       }
+    }
 }

+ 3 - 2
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreProductScrmServiceImpl.java

@@ -551,11 +551,12 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
                 .orElse(val);
 
         //取最小积分
-        Integer minIntegral = values
+        /*Integer minIntegral = values
                 .stream()
                 .map(FsStoreProductAttrValueScrm::getIntegral)
                 .min(Comparator.naturalOrder())
-                .orElse(0);
+                .orElse(0);*/
+        Integer minIntegral = 0;
 
         BigDecimal minOtPrice = values
                 .stream()

+ 13 - 0
fs-service/src/main/java/com/fs/huifuPay/sdk/opps/core/request/V2TradePaymentScanpayRefundRequest.java

@@ -37,6 +37,12 @@ public class V2TradePaymentScanpayRefundRequest extends BaseRequest {
     @JSONField(name = "org_req_date")
     private String orgReqDate;
 
+    /**
+     *全局流水号
+     * **/
+    @JSONField(name = "org_hf_seq_id")
+    private String orgHfSeqId;
+
     @Override
     public FunctionCodeEnum getFunctionCode() {
         return FunctionCodeEnum.V2_TRADE_PAYMENT_SCANPAY_REFUND;
@@ -93,4 +99,11 @@ public class V2TradePaymentScanpayRefundRequest extends BaseRequest {
         this.orgReqDate = orgReqDate;
     }
 
+    public String getOrgHfSeqId() {
+        return orgHfSeqId;
+    }
+
+    public void setOrgHfSeqId(String orgHfSeqId) {
+        this.orgHfSeqId = orgHfSeqId;
+    }
 }

+ 11 - 39
fs-service/src/main/java/com/fs/watch/utils/MyHttpUtils.java

@@ -173,8 +173,7 @@ public class MyHttpUtils {
         //创建post方式请求对象
         HttpPost httpPost = new HttpPost(path);
         //创建httpclient对象
-        CloseableHttpClient httpClient = HttpClients.createDefault();
-        try {
+        try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
             Map<String, Object> resMap = getObjectMap(params, httpPost, httpClient);
             if ((int) resMap.get("ReturnCode") == 0) {
                 return JSONObject.parseObject(resMap.get("Data").toString(), HashMap.class);
@@ -182,15 +181,9 @@ public class MyHttpUtils {
                 return null;
             }
         } catch (Exception e) {
-
-        } finally {
-            //释放连接
-            try {
-                httpClient.close();
-            } catch (Exception e) {
-
-            }
+            System.out.println(e.getMessage());
         }
+        //释放连接
         return null;
     }
 
@@ -201,8 +194,7 @@ public class MyHttpUtils {
         //创建post方式请求对象
         HttpPost httpPost = new HttpPost(path);
         //创建httpclient对象
-        CloseableHttpClient httpClient = HttpClients.createDefault();
-        try {
+        try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
             Map<String, Object> resMap = getObjectMap(params, httpPost, httpClient);
             if ((int) resMap.get("ReturnCode") == 0) {
                 if (resMap.get("Data") == null) {
@@ -214,14 +206,8 @@ public class MyHttpUtils {
             }
         } catch (Exception e) {
             System.out.println(e.getMessage());
-        } finally {
-            //释放连接
-            try {
-                httpClient.close();
-            } catch (Exception e) {
-
-            }
         }
+        //释放连接
         return null;
     }
 
@@ -233,8 +219,7 @@ public class MyHttpUtils {
         //创建post方式请求对象
         HttpPost httpPost = new HttpPost(path);
         //创建httpclient对象
-        CloseableHttpClient httpClient = HttpClients.createDefault();
-        try {
+        try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
             BasicResponseHandler handler = new BasicResponseHandler();
             //设置请求格式
             String jsonData = JSONObject.toJSONString(params);
@@ -247,15 +232,9 @@ public class MyHttpUtils {
             Map<String, Object> resMap = JSONObject.parseObject(result, HashMap.class);
             return resMap;
         } catch (Exception e) {
-
-        } finally {
-            //释放连接
-            try {
-                httpClient.close();
-            } catch (Exception e) {
-
-            }
+            System.out.println(e.getMessage());
         }
+        //释放连接
         return null;
     }
 
@@ -265,8 +244,7 @@ public class MyHttpUtils {
         //创建post方式请求对象
         HttpDelete httpDelete = new HttpDelete(path);
         // 创建HTTP客户端
-        CloseableHttpClient httpClient = HttpClients.createDefault();
-        try {
+        try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
 //            BasicResponseHandler handler = new BasicResponseHandler();
 //            //设置请求格式
 //            String jsonData = JSONObject.toJSONString(params);
@@ -281,15 +259,9 @@ public class MyHttpUtils {
             result.put("message", responseBody.get("msg"));
             return result;
         } catch (Exception e) {
-
-        } finally {
-            //释放连接
-            try {
-                httpClient.close();
-            } catch (Exception e) {
-
-            }
+            System.out.println(e.getMessage());
         }
+        //释放连接
         return null;
     }
 

+ 38 - 25
fs-service/src/main/resources/application-config-dev.yml

@@ -10,26 +10,31 @@ logging:
 wx:
   miniapp:
     configs:
-      - appid: wx4115995705bb0ea0   #中康智慧
-        secret: 58910ae743005c396012b029c7def579
-        token: Ncbnd7lJvkripVOpyTFAna6NAWCxCrvC
-        aesKey: HlEiBB55eaWUaeBVAQO3cWKWPYv1vOVQSq7nFNICw4E
-        msgDataFormat: JSON
-      - appid: wxedde588767b358b1   #中康未来智慧药房
-        secret: 928d2961c81610d8f64b019597212fcd
-        token: Ncbnd7lJvkripVOpyTFAna6NAWCxCrvC
-        aesKey: HlEiBB55eaWUaeBVAQO3cWKWPYv1vOVQSq7nFNICw4E
-        msgDataFormat: JSON
-      - appid: wxa73f0d48f1f2f66c   #金康健
-        secret: 93d342d00b2d7126a044408fb7082798
-        token: Ncbnd7lJvkripVOpyTFAna6NAWCxCrvC
-        aesKey: HlEiBB55eaWUaeBVAQO3cWKWPYv1vOVQSq7nFNICw4E
-        msgDataFormat: JSON
-      - appid: wx29d26f63f836be7f  #中康智慧商城APP
-        secret: a85bfaf0d8e243817f265a321684f6ec
+      - appid: wx29d26f63f836be7f
+        secret: 7542db9774355a89b1adce24defb6013
         token: Ncbnd7lJvkripVOpyTFAna6NAWCxCrvC
         aesKey: HlEiBB55eaWUaeBVAQO3cWKWPYv1vOVQSq7nFNICw4E
         msgDataFormat: JSON
+#      - appid: wx4115995705bb0ea0   #中康智慧
+#        secret: 58910ae743005c396012b029c7def579
+#        token: Ncbnd7lJvkripVOpyTFAna6NAWCxCrvC
+#        aesKey: HlEiBB55eaWUaeBVAQO3cWKWPYv1vOVQSq7nFNICw4E
+#        msgDataFormat: JSON
+#      - appid: wxedde588767b358b1   #中康未来智慧药房
+#        secret: 928d2961c81610d8f64b019597212fcd
+#        token: Ncbnd7lJvkripVOpyTFAna6NAWCxCrvC
+#        aesKey: HlEiBB55eaWUaeBVAQO3cWKWPYv1vOVQSq7nFNICw4E
+#        msgDataFormat: JSON
+#      - appid: wxa73f0d48f1f2f66c   #金康健
+#        secret: 93d342d00b2d7126a044408fb7082798
+#        token: Ncbnd7lJvkripVOpyTFAna6NAWCxCrvC
+#        aesKey: HlEiBB55eaWUaeBVAQO3cWKWPYv1vOVQSq7nFNICw4E
+#        msgDataFormat: JSON
+#      - appid: wx29d26f63f836be7f  #中康智慧商城APP
+#        secret: a85bfaf0d8e243817f265a321684f6ec
+#        token: Ncbnd7lJvkripVOpyTFAna6NAWCxCrvC
+#        aesKey: HlEiBB55eaWUaeBVAQO3cWKWPYv1vOVQSq7nFNICw4E
+#        msgDataFormat: JSON
   cp:
     corpId: wwb2a1055fb6c9a7c2
     appConfigs:
@@ -52,16 +57,16 @@ wx:
       port: 6379
       timeout: 2000
     configs:
-      - appId: wx894a6220c608f5c1 # 第一个公众号的appid  //公众号名称:成都九州在线互联网医院
-        secret: dabd5168d58c66e97be1ab1eee346b20 # 公众号的appsecret
+      - appId: wx93ce67750e3cfba3 # 第一个公众号的appid  //公众号名称:云联融智
+        secret: c172884087264160563bfe5775ca0f6f # 公众号的appsecret
         token: PPKOdAlCoMO # 接口配置里的Token值
         aesKey: Eswa6VjwtVMCcw03qZy6fWllgrv5aytIA1SZPEU0kU2 # 接口配置里的EncodingAESKey值
 aifabu:  #爱链接
   appKey: 7b471be905ab17e00f3b858c6710dd117601d008
 watch:
   watchUrl: watch.ylrzcloud.com/prod-api
-#  account: tcloud
-#  password: mdf-m2h_6yw2$hq
+  #  account: tcloud
+  #  password: mdf-m2h_6yw2$hq
   account1: ccif #866655060138751
   password1: cp-t5or_6xw7$mt
   account2: tcloud #rt500台
@@ -76,16 +81,24 @@ nuonuo:
   key: 10924508
   secret: A2EB20764D304D16
 
+# 存储捅配置
 # 存储捅配置
 tencent_cloud_config:
   secret_id: AKIDiMq9lDf2EOM9lIfqqfKo7FNgM5meD0sT
   secret_key: u5SuS80342xzx8FRBukza9lVNHKNMSaB
-  bucket: 1323137866
+  bucket: jkj-1323137866
   app_id: 1323137866
-  region: chongqing
-  proxy: hzyy
+  region: ap-chongqing
+  proxy: jkj
+tmp_secret_config:
+  secret_id: AKIDCj7NSNAovtqeJpBau8GZ4CGB71thXIxX
+  secret_key: lTB5zwqqz7CNhzDOWivFWedgfTBgxgBT
+  bucket: fs-1319721001
+  app_id: 1319721001
+  region: ap-chongqing
+  proxy: fs
 cloud_host:
-  company_name: 润天
+  company_name: 金康健
 headerImg:
   imgUrl: https://jz-cos-1356808054.cos.ap-chengdu.myqcloud.com/fs/20250515/0877754b59814ea8a428fa3697b20e68.png
 ipad:

+ 1 - 1
fs-service/src/main/resources/application-config-druid-bjczwh.yml

@@ -11,7 +11,7 @@ wx:
   miniapp:
     configs:
       - appid: wx94951f52d3ac5e25   #北京存在文化
-        secret: 66afb05ae462ea8f0f9f3da81e6b74e4 #北京存在文化
+        secret: bfe27b20c6e3c4232a1d4ef36228e84b #北京存在文化
         token: Ncbnd7lJvkripxxna6NAWCxCrvC
         aesKey: HlEiBB55eaWUaeBVAQO3cWKWPYv1vOVQSq7nFNICw4E
         msgDataFormat: JSON

+ 12 - 5
fs-service/src/main/resources/application-config-druid-yjb.yml

@@ -10,8 +10,8 @@ logging:
 wx:
   miniapp:
     configs:
-      - appid: wx76cb55db092a41ae   #医健保
-        secret: c737a27415946994e977d665d87643b3
+      - appid: wx9e61312fe7ac85c4   #医健宝
+        secret: 63f9c2240dd09d8beff004112181e731
         token: Ncbnd7lJvkripVOpyTFAna6NAWCxCrvC
         aesKey: HlEiBB55eaWUaeBVAQO3cWKWPYv1vOVQSq7nFNICw4E
         msgDataFormat: JSON
@@ -37,8 +37,8 @@ wx:
       port: 6379
       timeout: 2000
     configs:
-      - appId: wx090c5f399d65456e # 第一个公众号的appid  //公众号名称:德瑞康
-        secret: dc70e963077d80cf61280aea6b7c52b7 # 公众号的appsecret--德瑞康
+      - appId: wx10c1004ec0596fbf # 第一个公众号的appid  //公众号名称:医健宝
+        secret: 7f4519ff3a287171214b66226b47acb1 # 公众号的appsecret--医健宝
         token: PPKOdAlCoMO # 接口配置里的Token值
         aesKey: Eswa6VjwtVMCcw03qZy6fWllgrv5aytIA1SZPEU0kU2 # 接口配置里的EncodingAESKey值
 aifabu:  #爱链接
@@ -77,11 +77,12 @@ tmp_secret_config:
   region: ap-chongqing
   proxy: fs
 cloud_host:
-  company_name: 襄之棠
+  company_name: 医健宝
 headerImg:
   imgUrl: https://drk-1363981074.cos.ap-chongqing.myqcloud.com/fs/logo/30d7a0d1ec31e5ac16c6e96d5ca76ad.png
 ipad:
   ipadUrl: http://ipad.cdwjyyh.com
+  aiApi: http://152.136.202.157:3000/api
 wx_miniapp_temp:
   pay_order_temp_id:
   inquiry_temp_id:
@@ -89,3 +90,9 @@ openIM:
   secret: openIM123
   userID: imAdmin
 
+# 聚水潭API配置
+jst:
+  app_key: 871348458a964548a72bf8124cf917a4 #聚水潭2025-08-15
+  app_secret: 5b7d9369dbcd414db45089bc047ebe1a #聚水潭2025-08-15
+  authorization_code: 999999
+  shop_code: "18849902"

+ 1 - 1
fs-service/src/main/resources/application-dev.yml

@@ -43,7 +43,7 @@ spring:
             druid:
                 # 主库数据源
                 master:
-                    url: jdbc:mysql://139.186.77.83:3306/zk_target_db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                    url: jdbc:mysql://139.186.77.83:3306/ylrz_his_scrm?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                     username: Rtroot
                     password: Rtroot
                 # 初始连接数

+ 12 - 0
fs-service/src/main/resources/mapper/hisStore/FsStoreOrderScrmMapper.xml

@@ -244,6 +244,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="orderVisit != null">order_visit,</if>
             <if test="serviceFee != null">service_fee,</if>
             <if test="orderMedium != null">order_medium,</if>
+            <if test="prescribePrice != null">prescribe_price,</if>
+            <if test="followTime != null">follow_time,</if>
+            <if test="followDoctorId != null">follow_doctor_id,</if>
+            <if test="cycle != null">cycle,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="orderCode != null and orderCode != ''">#{orderCode},</if>
@@ -326,6 +330,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="orderVisit != null">#{orderVisit},</if>
             <if test="serviceFee != null">#{serviceFee},</if>
             <if test="orderMedium != null">#{orderMedium},</if>
+            <if test="prescribePrice != null">#{prescribePrice},</if>
+            <if test="followTime != null">#{followTime},</if>
+            <if test="followDoctorId != null">#{followDoctorId},</if>
+            <if test="cycle != null">#{cycle},</if>
          </trim>
     </insert>
 
@@ -414,6 +422,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="orderVisit != null">order_visit = #{orderVisit},</if>
             <if test="serviceFee != null">service_fee = #{serviceFee},</if>
             <if test="orderMedium != null">order_medium = #{orderMedium},</if>
+            <if test="prescribePrice != null">prescribe_price = #{prescribePrice},</if>
+            <if test="followTime != null">follow_time = #{followTime},</if>
+            <if test="followDoctorId != null">follow_doctor_id = #{followDoctorId},</if>
+            <if test="cycle != null">cycle = #{cycle},</if>
         </trim>
         where id = #{id}
     </update>

+ 7 - 0
fs-user-app/src/main/java/com/fs/app/controller/store/CommonScrmController.java

@@ -3,6 +3,7 @@ package com.fs.app.controller.store;
 
 import cn.hutool.core.net.URLDecoder;
 import cn.hutool.json.JSONUtil;
+import com.alibaba.fastjson.JSONObject;
 import com.fs.app.annotation.Login;
 import com.fs.app.controller.AppBaseController;
 import com.fs.app.param.SignParam;
@@ -24,6 +25,7 @@ import com.fs.hisStore.domain.FsStoreOrderScrm;
 import com.fs.hisStore.dto.ExpressDataDTO;
 import com.fs.hisStore.dto.ExpressInfoDTO;
 import com.fs.hisStore.dto.ExpressNotifyDTO;
+import com.fs.hisStore.enums.SysConfigEnum;
 import com.fs.hisStore.service.*;
 import com.fs.pay.pay.dto.OrderQueryDTO;
 import com.fs.pay.service.IPayService;
@@ -396,6 +398,11 @@ public class CommonScrmController extends AppBaseController {
     public R getStoreConfig() {
         String config = configService.selectConfigByKey("store.config");
         StoreConfig storeConfig = JSONUtil.toBean(config, StoreConfig.class);
+        //资质证书
+        String certs = configUtil.generateConfigByKey(SysConfigEnum.HIS_CERTS.getKey()).getString("certs");
+        storeConfig.setCerts(certs);
+        //退款商家
+        configUtil.generateConfigByKey(SysConfigEnum.HIS_CONFIG.getKey());
         return R.ok().put("data", storeConfig);
 
     }

+ 51 - 5
fs-user-app/src/main/java/com/fs/app/controller/store/H5ScrmController.java

@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.servlet.ModelAndView;
 
 @Controller
-@RequestMapping(value="/h5")
+@RequestMapping(value="/store/h5")
 public class H5ScrmController
 {
 
@@ -22,22 +22,68 @@ public class H5ScrmController
     public ModelAndView userAgreement( )
     {
 
-        String json=configService.selectConfigByKey("store.agreement");
+        String json=configService.selectConfigByKey("his.agreementConfig");
         AgreementConfig config= JSONUtil.toBean(json, AgreementConfig.class);
 
         ModelAndView mv=new ModelAndView();
-        mv.addObject("userAgreement", config.getUserAgreement());
+        mv.addObject("userAgreement", config.getUserRegister());
         mv.setViewName("userAgreement");
+        //return R.ok().put("userAgreement", config.getUserRegister());
         return mv;
     }
     @GetMapping("/privacyPolicy")
     public ModelAndView privacyPolicy( )
     {
-        String json=configService.selectConfigByKey("store.agreement");
+        String json=configService.selectConfigByKey("his.agreementConfig");
         AgreementConfig config= JSONUtil.toBean(json, AgreementConfig.class);
         ModelAndView mv=new ModelAndView();
-        mv.addObject("privacyPolicy", config.getPrivacyPolicy());
+        mv.addObject("privacyPolicy", config.getUserPrivacy());
         mv.setViewName("privacyPolicy");
+        //return R.ok().put("privacyPolicy", config.getUserPrivacy());
+        return mv;
+    }
+    @GetMapping("/doctorRegister")
+    public ModelAndView doctorRegister( )
+    {
+        String json=configService.selectConfigByKey("his.agreementConfig");
+        AgreementConfig config= JSONUtil.toBean(json, AgreementConfig.class);
+        ModelAndView mv=new ModelAndView();
+        mv.addObject("doctorRegister", config.getDoctorRegister());
+        mv.setViewName("doctorRegister");
+        //return R.ok().put("doctorRegister", config.getDoctorRegister());
+        return mv;
+    }
+    @GetMapping("/doctorFiling")
+    public ModelAndView doctorFiling( )
+    {
+        String json=configService.selectConfigByKey("his.agreementConfig");
+        AgreementConfig config= JSONUtil.toBean(json, AgreementConfig.class);
+        ModelAndView mv=new ModelAndView();
+        mv.addObject("doctorFiling", config.getDoctorFiling());
+        mv.setViewName("doctorFiling");
+        //return R.ok().put("doctorFiling", config.getDoctorFiling());
+        return mv;
+    }
+    @GetMapping("/userHealth")
+    public ModelAndView userHealth( )
+    {
+        String json=configService.selectConfigByKey("his.agreementConfig");
+        AgreementConfig config= JSONUtil.toBean(json, AgreementConfig.class);
+        ModelAndView mv=new ModelAndView();
+        mv.addObject("userHealth", config.getUserHealth());
+        mv.setViewName("userHealth");
+        //return R.ok().put("userHealth", config.getUserHealth());
+        return mv;
+    }
+    @GetMapping("/vipService")
+    public ModelAndView vipService( )
+    {
+        String json=configService.selectConfigByKey("his.agreementConfig");
+        AgreementConfig config= JSONUtil.toBean(json, AgreementConfig.class);
+        ModelAndView mv=new ModelAndView();
+        mv.addObject("vipService", config.getVipService());
+        mv.setViewName("vipService");
+        //return R.ok().put("vipService", config.getVipService());
         return mv;
     }
 

+ 8 - 5
fs-user-app/src/main/java/com/fs/app/controller/store/WxUserScrmController.java

@@ -5,8 +5,6 @@ import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
 import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
 import cn.binarywang.wx.miniapp.bean.WxMaUserInfo;
 import cn.hutool.core.date.DateTime;
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
 import com.fs.app.annotation.Login;
 import com.fs.app.controller.AppBaseController;
 import com.fs.app.utils.JwtUtils;
@@ -260,9 +258,14 @@ public class WxUserScrmController extends AppBaseController {
         if (StringUtils.isBlank(param.getCode())) {
             return R.error("code不存在");
         }
-        final WxMaService wxService = WxMaConfiguration.getMaService(
-                configUtil.generateConfigByKey(SysConfigEnum.COURSE_MA_CONFIG.getKey()).getString("appid")
-        );
+        String courseMa_appId;
+        if(StringUtils.isNotEmpty(param.getAppId())){
+            courseMa_appId = configUtil.generateConfigMiniByKey(SysConfigEnum.COURSE_MA_CONFIG.getKey(),param.getAppId()).getString("appid");
+        }else{
+            courseMa_appId = configUtil.generateConfigByKey(SysConfigEnum.COURSE_MA_CONFIG.getKey()).getString("appid");
+        }
+
+        final WxMaService wxService = WxMaConfiguration.getMaService(courseMa_appId);
         try {
             WxMaJscode2SessionResult session = wxService.getUserService().getSessionInfo(param.getCode());
             // 解密