Browse Source

Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_his_scrm_java into openIm

# Conflicts:
#	fs-admin/src/main/java/com/fs/his/task/Task.java
#	fs-service/src/main/java/com/fs/core/utils/OrderCodeUtils.java
#	fs-service/src/main/java/com/fs/his/service/IFsStoreOrderService.java
#	fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java
15376779826 4 weeks ago
parent
commit
4dd78bf290
63 changed files with 1171 additions and 195 deletions
  1. 47 6
      fs-admin/src/main/java/com/fs/his/controller/FsStoreOrderController.java
  2. 7 1
      fs-admin/src/main/java/com/fs/his/task/Task.java
  3. 10 1
      fs-common/src/main/java/com/fs/common/core/domain/entity/SysRole.java
  4. 1 1
      fs-qw-voice/src/main/resources/application.yml
  5. 0 2
      fs-service/src/main/java/com/fs/company/service/impl/CompanyUserServiceImpl.java
  6. 6 0
      fs-service/src/main/java/com/fs/config/ai/AiHostProper.java
  7. 1 0
      fs-service/src/main/java/com/fs/core/utils/OrderCodeUtils.java
  8. 34 42
      fs-service/src/main/java/com/fs/course/service/impl/FsCourseFinishTempServiceImpl.java
  9. 1 1
      fs-service/src/main/java/com/fs/erp/service/impl/DfOrderServiceImpl.java
  10. 1 1
      fs-service/src/main/java/com/fs/fastgptApi/util/AudioUtils.java
  11. 3 0
      fs-service/src/main/java/com/fs/his/mapper/FsStoreOrderItemMapper.java
  12. 9 1
      fs-service/src/main/java/com/fs/his/mapper/FsStoreOrderMapper.java
  13. 2 0
      fs-service/src/main/java/com/fs/his/param/FsStoreOrderParam.java
  14. 10 0
      fs-service/src/main/java/com/fs/his/param/FsStoreOrderSalesParam.java
  15. 2 0
      fs-service/src/main/java/com/fs/his/service/IFsStoreOrderService.java
  16. 22 18
      fs-service/src/main/java/com/fs/his/service/impl/FsStoreAfterSalesServiceImpl.java
  17. 143 102
      fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java
  18. 3 1
      fs-service/src/main/java/com/fs/his/vo/FsStoreOrderExportVO.java
  19. 2 1
      fs-service/src/main/java/com/fs/his/vo/FsStoreOrderListVO.java
  20. 4 0
      fs-service/src/main/java/com/fs/his/vo/FsStoreOrderStatusExcelVO.java
  21. 19 0
      fs-service/src/main/java/com/fs/hisStore/param/FsStoreOrderRefundByProductParam.java
  22. 5 1
      fs-service/src/main/java/com/fs/sop/service/impl/QwSopLogsServiceImpl.java
  23. 7 6
      fs-service/src/main/java/com/fs/sop/service/impl/QwSopServiceImpl.java
  24. 0 2
      fs-service/src/main/java/com/fs/sop/service/impl/SopUserLogsServiceImpl.java
  25. 1 1
      fs-service/src/main/resources/application-config-druid-bjczwh.yml
  26. 1 0
      fs-service/src/main/resources/application-config-druid-bnkc.yml
  27. 94 0
      fs-service/src/main/resources/application-config-druid-cqtyt.yml
  28. 93 0
      fs-service/src/main/resources/application-config-druid-czt.yml
  29. 1 0
      fs-service/src/main/resources/application-config-druid-drk-test.yml
  30. 1 0
      fs-service/src/main/resources/application-config-druid-drk.yml
  31. 1 0
      fs-service/src/main/resources/application-config-druid-fby.yml
  32. 1 0
      fs-service/src/main/resources/application-config-druid-hcl.yml
  33. 1 0
      fs-service/src/main/resources/application-config-druid-hdt.yml
  34. 1 0
      fs-service/src/main/resources/application-config-druid-hst.yml
  35. 1 0
      fs-service/src/main/resources/application-config-druid-hyt.yml
  36. 1 0
      fs-service/src/main/resources/application-config-druid-hzyy.yml
  37. 1 0
      fs-service/src/main/resources/application-config-druid-jkj.yml
  38. 1 0
      fs-service/src/main/resources/application-config-druid-jnlzjk.yml
  39. 1 1
      fs-service/src/main/resources/application-config-druid-jnmy.yml
  40. 1 0
      fs-service/src/main/resources/application-config-druid-jzzx.yml
  41. 96 0
      fs-service/src/main/resources/application-config-druid-knt.yml
  42. 1 0
      fs-service/src/main/resources/application-config-druid-kyt.yml
  43. 1 0
      fs-service/src/main/resources/application-config-druid-nmgyt.yml
  44. 1 0
      fs-service/src/main/resources/application-config-druid-qdtst.yml
  45. 1 0
      fs-service/src/main/resources/application-config-druid-sft.yml
  46. 1 0
      fs-service/src/main/resources/application-config-druid-sxjz.yml
  47. 1 0
      fs-service/src/main/resources/application-config-druid-syysy.yml
  48. 1 0
      fs-service/src/main/resources/application-config-druid-whhm.yml
  49. 1 0
      fs-service/src/main/resources/application-config-druid-xfk.yml
  50. 1 0
      fs-service/src/main/resources/application-config-druid-xzt.yml
  51. 1 0
      fs-service/src/main/resources/application-config-druid-yjb.yml
  52. 1 0
      fs-service/src/main/resources/application-config-druid-yzt.yml
  53. 1 0
      fs-service/src/main/resources/application-config-druid-zsjk.yml
  54. 1 1
      fs-service/src/main/resources/application-config-myhk.yml
  55. 1 0
      fs-service/src/main/resources/application-config-zkzh.yml
  56. 159 0
      fs-service/src/main/resources/application-druid-cqtyt.yml
  57. 153 0
      fs-service/src/main/resources/application-druid-czt.yml
  58. 162 0
      fs-service/src/main/resources/application-druid-knt.yml
  59. 1 0
      fs-service/src/main/resources/application-druid-lmjy.yml
  60. 6 0
      fs-service/src/main/resources/mapper/his/FsStoreOrderItemMapper.xml
  61. 34 3
      fs-service/src/main/resources/mapper/his/FsStoreOrderMapper.xml
  62. 1 1
      fs-service/src/main/resources/mapper/qw/QwUserVoiceLogMapper.xml
  63. 5 1
      fs-service/src/main/resources/mapper/system/SysRoleMapper.xml

+ 47 - 6
fs-admin/src/main/java/com/fs/his/controller/FsStoreOrderController.java

@@ -11,10 +11,7 @@ import com.fs.common.core.domain.R;
 import com.fs.common.core.domain.entity.SysRole;
 import com.fs.common.core.domain.entity.SysUser;
 import com.fs.common.core.domain.model.LoginUser;
-import com.fs.common.utils.ParseUtils;
-import com.fs.common.utils.SecurityUtils;
-import com.fs.common.utils.ServletUtils;
-import com.fs.common.utils.StringUtils;
+import com.fs.common.utils.*;
 import com.fs.company.param.CompanyStoreOrderMoneyLogsListParam;
 import com.fs.company.service.ICompanyMoneyLogsService;
 import com.fs.company.vo.CompanyStoreOrderMoneyLogsVO;
@@ -35,6 +32,7 @@ import com.fs.his.dto.ExpressInfoDTO;
 import com.fs.his.dto.StoreOrderExpressExportDTO;
 import com.fs.his.dto.TracesDTO;
 import com.fs.his.enums.FsStoreOrderLogEnum;
+import com.fs.his.enums.FsStoreOrderStatusEnum;
 import com.fs.his.enums.ShipperCodeEnum;
 import com.fs.his.param.FsFollowMsgParam;
 import com.fs.his.param.FsStoreOrderParam;
@@ -364,7 +362,11 @@ public class FsStoreOrderController extends BaseController
             moneyLogsMap.setBusinessId(order.getOrderId());
             tuiMoneyLogs=moneyLogsService.selectCompanyStoreOrderMoneyLogsList(moneyLogsMap);
         }
-        return R.ok().put("data",order).put("tuiMoneyLogs",tuiMoneyLogs);
+        if ((CloudHostUtils.hasCloudHostName("金牛明医"))){
+            return R.ok().put("data",order).put("tuiMoneyLogs",tuiMoneyLogs).put("isUpdateRefund",1).put("isUpdatePayRemain",1);
+        } else {
+            return R.ok().put("data",order).put("tuiMoneyLogs",tuiMoneyLogs).put("isUpdateRefund",0).put("isUpdatePayRemain",0);
+        }
     }
 
     @GetMapping(value = "/queryPhone/{orderId}")
@@ -420,9 +422,40 @@ public class FsStoreOrderController extends BaseController
     @PutMapping
     public AjaxResult edit(@RequestBody FsStoreOrder fsStoreOrder)
     {
+        AjaxResult error = moneyCheck(fsStoreOrder);
+        if (error != null) return error;
         return toAjax(fsStoreOrderService.updateFsStoreOrder(fsStoreOrder));
     }
 
+    private AjaxResult moneyCheck(FsStoreOrder fsStoreOrder) {
+        BigDecimal payRemain = fsStoreOrder.getPayRemain();
+        BigDecimal payPrice = fsStoreOrder.getPayPrice();
+        if (payRemain != null && payPrice == null){
+            return AjaxResult.error("订单应收金额不正确!");
+        }
+        if (payRemain == null && payPrice != null){
+            return AjaxResult.error("订单物流代收金额不正确!");
+        }
+        if (payRemain != null && payPrice != null){
+            FsStoreOrder temp = fsStoreOrderService.selectFsStoreOrderByOrderId(fsStoreOrder.getOrderId());
+            if (!((Objects.equals(temp.getStatus(), FsStoreOrderStatusEnum.STATUS_2.getValue())
+                    || (Objects.equals(temp.getStatus(), FsStoreOrderStatusEnum.STATUS_1.getValue())))
+                    || (StringUtils.isNotBlank(temp.getExtendOrderId())))
+            ){
+
+                BigDecimal payMoney = temp.getPayMoney();
+                if (fsStoreOrder.getPayMoney()!=null){
+                    fsStoreOrder.setPayMoney(payMoney);
+                }
+                BigDecimal tempPayPrice = payMoney.add(payRemain);
+                if(0 != tempPayPrice.compareTo(fsStoreOrder.getPayPrice())){
+                    return AjaxResult.error("订单金额不正确!");
+                }
+            }
+        }
+        return null;
+    }
+
     /**
      * 修改订单
      */
@@ -583,7 +616,15 @@ public class FsStoreOrderController extends BaseController
     {
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         fsStoreOrder.setOperator(loginUser.getUser().getNickName());
-        return toAjax(fsStoreOrderService.afterSales(fsStoreOrder));
+        if (fsStoreOrder.getRefundAmount() != null){
+            if (fsStoreOrder.getRefundList()!=null && !fsStoreOrder.getRefundList().isEmpty()){
+                return toAjax(fsStoreOrderService.afterSalesByProduct(fsStoreOrder));
+            } else {
+                return AjaxResult.error("没有选择需要退款的商品!");
+            }
+        } else {
+            return toAjax(fsStoreOrderService.afterSales(fsStoreOrder));
+        }
     }
 
     /**

+ 7 - 1
fs-admin/src/main/java/com/fs/his/task/Task.java

@@ -66,6 +66,7 @@ import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Component;
 
 import java.util.*;
+import java.util.concurrent.CompletableFuture;
 import java.util.stream.Collectors;
 
 @Slf4j
@@ -586,9 +587,14 @@ public class Task {
         if (erpOrderService !=null && erpOrderService == dfOrderService){
             orders = fsStoreOrderMapper.selectShippedOrder();
             if(orders!=null&& !orders.isEmpty()){
+                List<CompletableFuture<Void>> futures = new ArrayList<>();
                 for(FsStoreOrder order:orders){
-                    erpOrderService.getOrderDeliveryStatus(order);
+                    CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
+                        erpOrderService.getOrderDeliveryStatus(order);
+                    });
+                    futures.add(future);
                 }
+                CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join();
             }
         }
     }

+ 10 - 1
fs-common/src/main/java/com/fs/common/core/domain/entity/SysRole.java

@@ -61,12 +61,21 @@ public class SysRole extends BaseEntity
 
     /** 是否可以查看手机全号 0否 1是 */
     private Integer isCheckPhone;
-
+    /** 是否可以查看地址全号 0否 1是 */
+    private Integer isCheckAddress;
     public SysRole()
     {
 
     }
 
+    public Integer getIsCheckAddress() {
+        return isCheckAddress;
+    }
+
+    public void setIsCheckAddress(Integer isCheckAddress) {
+        this.isCheckAddress = isCheckAddress;
+    }
+
     public SysRole(Long roleId)
     {
         this.roleId = roleId;

+ 1 - 1
fs-qw-voice/src/main/resources/application.yml

@@ -6,4 +6,4 @@ server:
 # Spring配置
 spring:
   profiles:
-    active: dev
+    active: druid-jnmy-test

+ 0 - 2
fs-service/src/main/java/com/fs/company/service/impl/CompanyUserServiceImpl.java

@@ -108,8 +108,6 @@ public class CompanyUserServiceImpl implements ICompanyUserService
     @Autowired
     private ICompanyService companyService;
 
-    @Autowired
-    private IQwExternalContactService qwExternalContactService;
 
     @Autowired
     private IQwUserService qwUserService;

+ 6 - 0
fs-service/src/main/java/com/fs/config/ai/AiHostProper.java

@@ -16,4 +16,10 @@ public class AiHostProper {
     @Value("${ipad.voiceApi}")
     private String voiceApi;
 
+
+    @Value("${ipad.commonApi}")
+    private String commonApi;
+
+
+
 }

+ 1 - 0
fs-service/src/main/java/com/fs/core/utils/OrderCodeUtils.java

@@ -53,6 +53,7 @@ public class OrderCodeUtils {
             return vo.getOrderCode();
         }
         else return null;
+        //return OrderCodeUtils.genOrderSn();
 
     }
 

+ 34 - 42
fs-service/src/main/java/com/fs/course/service/impl/FsCourseFinishTempServiceImpl.java

@@ -259,50 +259,15 @@ public class FsCourseFinishTempServiceImpl implements IFsCourseFinishTempService
 
             // 3. 检查是否需要更新
             boolean shouldUpdate = true;
-            int currentYear = Calendar.getInstance().get(Calendar.YEAR);
-
-            // Convert input dates to full YYYYMMDD format
-            String fullMonthDay = String.valueOf(currentYear) + monthDay; // becomes YYYYMMDD
-            String fullDayOfMonth = String.valueOf(currentYear) +
-                    String.format("%02d", Calendar.getInstance().get(Calendar.MONTH) + 1) +
-                    String.format("%02d", Integer.parseInt(dayOfMonth));
 
             for (String mark : allOldMarks) {
-                Matcher numMatcher = Pattern.compile("\\*(\\d{1,4})完").matcher(mark);
-                if (numMatcher.find()) {
-                    String numStr = numMatcher.group(1);
-                    String fullOldDate;
-
-                    if (numStr.length() <= 2) { // 处理 "*D完" 格式
-
-                        int day = Integer.parseInt(numStr);
-                        Calendar cal = Calendar.getInstance();
-                        int currentMonth = cal.get(Calendar.MONTH) + 1;
-                        int currentDay = cal.get(Calendar.DAY_OF_MONTH);
-                        int year = cal.get(Calendar.YEAR);
-
-                        // 获取上个月的最大天数
-                        int prevMonth = (currentMonth == 1) ? 12 : currentMonth - 1;
-                        int prevYear = (currentMonth == 1) ? year - 1 : year;
-                        cal.set(prevYear, prevMonth - 1, 1); // Calendar 月份是 0-based
-                        int maxDaysInPrevMonth = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
-
-                        // 如果 day > 上个月的天数,说明是上个月的日期
-                        if (day > maxDaysInPrevMonth || day > currentDay + 7) {
-                            currentMonth = prevMonth;
-                            year = prevYear;
-                        }
-
-                        fullOldDate = String.format("%04d%02d%02d", year, currentMonth, day);
-
-                        // 比较日期
-                        if (Integer.parseInt(fullOldDate) >= Integer.parseInt(fullMonthDay) ||
-                                Integer.parseInt(fullOldDate) >= Integer.parseInt(fullDayOfMonth)) {
-                            shouldUpdate = false;
-                            break;
-                        }
-                    }
 
+                String normalizedOldMark = normalizeMarkFormat(mark);
+                // 直接比较字符串是否相等
+                if (normalizedOldMark.equals(newNotes) ||
+                        normalizedOldMark.equals(newNotesDay)) {
+                    shouldUpdate = false;
+                    break;
                 }
             }
 
@@ -349,7 +314,7 @@ public class FsCourseFinishTempServiceImpl implements IFsCourseFinishTempService
 
                         break;
                     } else {
-                        if (attempt==2 && (qwResult.getErrcode() == 45033 || qwResult.getErrcode()== -1 || qwResult.getErrcode()== 60020)) {
+                        if (attempt==2 && (qwResult.getErrcode() == 45033 || qwResult.getErrcode()== -1 || qwResult.getErrcode()== 60020 )) {
                             QwCourseFinishRemarkRty remarkRty=new QwCourseFinishRemarkRty();
                             remarkRty.setQwUserId(externalContact.getUserId());
                             remarkRty.setCorpId(externalContact.getCorpId());
@@ -385,6 +350,33 @@ public class FsCourseFinishTempServiceImpl implements IFsCourseFinishTempService
 
     }
 
+    /**
+     * 标准化标记格式,将不同格式统一为标准格式
+     * 例如: "*5完" -> "*05完", "*305完" -> "*0305完" (如果是3位数字)
+     */
+    private String normalizeMarkFormat(String mark) {
+        Matcher matcher = Pattern.compile("\\*(\\d{1,4})完").matcher(mark);
+        if (matcher.find()) {
+            String digits = matcher.group(1);
+
+            // 根据数字长度进行标准化
+            switch (digits.length()) {
+                case 1: // "*D完" -> "*0D完"
+                    return "*0" + digits + "完";
+                case 2: // "*DD完" -> 保持不变
+                    return mark;
+                case 3: // "*DDD完" -> 可能是 "*MDD完" 或 "*DDM完",统一为4位
+                    // 假设是月日格式,补零到4位 "*0MDD完"
+                    return "*0" + digits + "完";
+                case 4: // "*MMDD完" -> 保持不变
+                    return mark;
+                default:
+                    return mark;
+            }
+        }
+        return mark;
+    }
+
 //    @Override
 //    public void updateFsCourseFinishTempByCompanyUserId() {
 //        List<FsCourseFinishTemp> fsCourseFinishTemps = fsCourseFinishTempMapper.selectFsCourseFinishTempByCompanyList();

+ 1 - 1
fs-service/src/main/java/com/fs/erp/service/impl/DfOrderServiceImpl.java

@@ -706,7 +706,7 @@ public class DfOrderServiceImpl implements IErpOrderService
                                             order.setDeliveryName(proCode);
                                             order.setDeliveryCode("SF");
                                             order.setStatus(3);
-                                            order.setDeliverySendTime(DateUtils.getNowDate());
+                                            order.setDeliverySendTime(DateUtils.getNowDate()); //更新发货时间
                                             fsStoreOrderMapper.updateFsStoreOrder(order);
                                             fsStoreOrderLogsService.create(order.getOrderId(), FsStoreOrderLogEnum.DELIVERY_GOODS.getValue(), FsStoreOrderLogEnum.DELIVERY_GOODS.getDesc());
                                             if (order.getCompanyId() != null && order.getCompanyId() > 0) {

+ 1 - 1
fs-service/src/main/java/com/fs/fastgptApi/util/AudioUtils.java

@@ -731,7 +731,7 @@ public class AudioUtils {
             URL url = new URL(fileUrl);
             HttpURLConnection connection = (HttpURLConnection) url.openConnection();
             // 设置Referer请求头
-            connection.setRequestProperty("Referer", "cos.his.cdwjyyh.com");
+//            connection.setRequestProperty("Referer", "cos.his.cdwjyyh.com");
             connection.setRequestMethod("GET");
             connection.connect();
 

+ 3 - 0
fs-service/src/main/java/com/fs/his/mapper/FsStoreOrderItemMapper.java

@@ -6,6 +6,7 @@ import com.fs.his.vo.FsStoreOrderItemExcelVO;
 import com.fs.his.vo.FsStoreOrderItemListDVO;
 import com.fs.his.vo.FsStoreOrderItemListUVO;
 import com.fs.his.vo.FsStoreOrderItemVO;
+import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
 /**
@@ -72,4 +73,6 @@ public interface FsStoreOrderItemMapper
     List<FsStoreOrderItemExcelVO> selectFsStoreOrderItemExcelVOListByOrderId(Long orderId);
     @Select("select product_id,json_info,num from fs_store_order_item where order_id=#{orderId}")
     List<FsStoreOrderItemListDVO> selectFsStoreOrderItemListDVOByOrderId(Long orderId);
+
+    List<FsStoreOrderItem> selectFsStoreOrderItemListByItemIds(@Param("itemIds") List<Long> itemIds);
 }

+ 9 - 1
fs-service/src/main/java/com/fs/his/mapper/FsStoreOrderMapper.java

@@ -664,7 +664,7 @@ public interface FsStoreOrderMapper
     List<FsStoreOrder> selectStoreOrderIdByFollow();
 
     @Select({"<script> " +
-            "select so.*,u.nick_name,u.phone,p.patient_name ,TIMESTAMPDIFF(YEAR, pat.birthday, CURDATE()) AS age,pat.sex ,p.prescribe_code,d.doctor_name,pat.relation,CONCAT(u.nick_name, '(',  LEFT(u.phone, 3),  '****',  RIGHT(u.phone, 4),  ')') AS `user`, c.company_name ,cu.nick_name as company_user_nick_name ,cts.name as schedule_name,st.store_name " +
+            "select so.*,u.nick_name,u.phone,p.patient_name ,TIMESTAMPDIFF(YEAR, pat.birthday, CURDATE()) AS age,pat.sex ,p.prescribe_code,d.doctor_name,pat.relation,CONCAT(u.nick_name, '(',  LEFT(u.phone, 3),  '****',  RIGHT(u.phone, 4),  ')') AS `user`, c.company_name ,cu.nick_name as company_user_nick_name ,cts.name as schedule_name,st.store_name , csc.name miniProgramName" +
             " from fs_store_order so  " +
             " LEFT JOIN fs_store st ON so.store_id =st.store_id" +
             " left join fs_user u on so.user_id=u.user_id  " +
@@ -674,9 +674,17 @@ public interface FsStoreOrderMapper
             " left join company_user cu on cu.user_id=so.company_user_id " +
             " left join company_tcm_schedule cts on cts.id = so.schedule_id " +
             " left join fs_patient pat on pat.patient_id = p.patient_id " +
+            "LEFT JOIN (\n" +
+            "        SELECT\n" +
+            "        sp.*,\n" +
+            "        ROW_NUMBER() OVER (PARTITION BY sp.pay_code ORDER BY sp.create_time DESC) as rn\n" +
+            "        FROM fs_store_payment sp\n" +
+            "        ) sp_latest ON sp_latest.business_code = so.order_code AND sp_latest.rn = 1\n" +
+            "        LEFT JOIN fs_course_play_source_config csc ON csc.appid = sp_latest.app_id" +
             " WHERE so.is_del=0 "+
             "            <if test=\"maps.packageSecondName != null and maps.packageSecondName != '' \"> and so.package_second_name like concat('%', #{maps.packageSecondName}, '%')</if>"+
             "            <if test=\"maps.storeId != null \"> and so.store_id = #{maps.storeId}</if>\n" +
+            "            <if test=\"maps.coursePlaySourceConfigId != null\"> and csc.id = #{maps.coursePlaySourceConfigId}</if>" +
             "            <if test=\"maps.source != null \"> and so.source = #{maps.source}</if>\n" +
             "            <if test=\"maps.orderCode != null  and maps.orderCode != ''\"> and so.order_code = #{maps.orderCode}</if>\n" +
             "            <if test=\"maps.prescribeCode != null  and maps.prescribeCode != ''\"> and p.prescribe_code = #{maps.prescribeCode}</if>\n" +

+ 2 - 0
fs-service/src/main/java/com/fs/his/param/FsStoreOrderParam.java

@@ -244,6 +244,8 @@ public class FsStoreOrderParam extends BaseEntity implements Serializable {
     //erp电话
     private String erpPhoneNumber;
 
+    //小程序id
+    private Long coursePlaySourceConfigId;
     //erp账户
     private String erpAccount;
 }

+ 10 - 0
fs-service/src/main/java/com/fs/his/param/FsStoreOrderSalesParam.java

@@ -1,7 +1,13 @@
 package com.fs.his.param;
 
+import com.fs.hisStore.param.FsStoreOrderRefundByProductParam;
+import com.fs.hisStore.param.FsStoreOrderRefundParam;
+import com.fs.tzBankPay.doman.RefundParam;
 import lombok.Data;
 
+import java.math.BigDecimal;
+import java.util.List;
+
 @Data
 public class FsStoreOrderSalesParam {
 
@@ -14,4 +20,8 @@ public class FsStoreOrderSalesParam {
     private String operator;
 
     private Long companyId;
+
+    private BigDecimal refundAmount;
+
+    private List<FsStoreOrderRefundByProductParam> refundList;
 }

+ 2 - 0
fs-service/src/main/java/com/fs/his/service/IFsStoreOrderService.java

@@ -267,6 +267,8 @@ public interface IFsStoreOrderService
 
     String selectFsStoreOrderProductStatistics(FsStoreOrderParam fsStoreOrder);
 
+    int afterSalesByProduct(FsStoreOrderSalesParam fsStoreOrder);
+
     void deliveryOrderScrm(String orderCode, String mailNo, String expressCode, String expressName);
 
     FsStoreOrderScrm selectFsStoreOrderScrmByOrderCode(String soId);

+ 22 - 18
fs-service/src/main/java/com/fs/his/service/impl/FsStoreAfterSalesServiceImpl.java

@@ -456,6 +456,9 @@ public class FsStoreAfterSalesServiceImpl implements IFsStoreAfterSalesService {
         }
         if (payments != null && payments.size() > 0) {
             FsStorePayment payment = payments.get(0);
+            if (reMoney.compareTo(payment.getPayMoney())>0) {
+                return 0; //退款金额不能大于实际支付金额
+            }
             String json = configService.selectConfigByKey("his.pay");
             if (payment.getPayMode().equals("wx")) {
                 WxPayConfig payConfig = new WxPayConfig();
@@ -481,7 +484,7 @@ public class FsStoreAfterSalesServiceImpl implements IFsStoreAfterSalesService {
                         paymentMap.setPaymentId(payment.getPaymentId());
                         paymentMap.setStatus(-1);
                         paymentMap.setRefundTime(DateUtils.getNowDate());
-                        paymentMap.setRefundMoney(payment.getPayMoney());
+                        paymentMap.setRefundMoney(reMoney);
                         fsStorePaymentMapper.updateFsStorePayment(paymentMap);
                     } else {
                         throw new CustomException("退款请求失败" + refundQueryResult.getReturnMsg());
@@ -492,7 +495,7 @@ public class FsStoreAfterSalesServiceImpl implements IFsStoreAfterSalesService {
             } else if (payment.getPayMode().equals("yb")) {
                 //易宝
                 RefundDTO refundDTO = new RefundDTO();
-                refundDTO.setRefundMoney(payment.getPayMoney().toString());
+                refundDTO.setRefundMoney(reMoney.toString());
                 refundDTO.setLowRefundNo(orderType + "-" + payment.getPayCode());
                 refundDTO.setUpOrderId(payment.getTradeNo());
                 com.fs.ybPay.domain.RefundResult result = payService.refund(refundDTO);
@@ -502,7 +505,7 @@ public class FsStoreAfterSalesServiceImpl implements IFsStoreAfterSalesService {
                     paymentMap.setPaymentId(payment.getPaymentId());
                     paymentMap.setStatus(-1);
                     paymentMap.setRefundTime(DateUtils.getNowDate());
-                    paymentMap.setRefundMoney(payment.getPayMoney());
+                    paymentMap.setRefundMoney(reMoney);
                     fsStorePaymentMapper.updateFsStorePayment(paymentMap);
                 } else {
                     throw new CustomException("退款请求失败" + result.getMessage());
@@ -518,7 +521,7 @@ public class FsStoreAfterSalesServiceImpl implements IFsStoreAfterSalesService {
                 SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
                 tzBankResult.setTrxSendTime(sdf.format(new Date()));
                 // 退款金额
-                tzBankResult.setRefundOrdTransAmt(payment.getPayMoney().doubleValue());
+                tzBankResult.setRefundOrdTransAmt(reMoney.doubleValue());
                 TzBankResult<RefundResult> result = tzBankService.refund(tzBankResult);
                 logger.info("订单退款返回结果:退款订单id:" + order.getOrderId() + result);
                 if (result.getBody().getRefundOrdStatus().equals("90") || result.getBody().getRefundOrdStatus().equals("60")) {
@@ -526,31 +529,32 @@ public class FsStoreAfterSalesServiceImpl implements IFsStoreAfterSalesService {
                     paymentMap.setPaymentId(payment.getPaymentId());
                     paymentMap.setStatus(-1);
                     paymentMap.setRefundTime(DateUtils.getNowDate());
-                    paymentMap.setRefundMoney(payment.getPayMoney());
+                    paymentMap.setRefundMoney(reMoney);
                     fsStorePaymentMapper.updateFsStorePayment(paymentMap);
                 } else {
                     throw new CustomException("退款请求失败" + result.getRetMsg());
                 }
             } else if (payment.getPayMode().equals("hf")) {
                 V2TradePaymentScanpayRefundRequest request = new V2TradePaymentScanpayRefundRequest();
-                request.setOrdAmt(payment.getPayMoney().toString());
+//                request.setOrdAmt(payment.getPayMoney().toString());
+                request.setOrdAmt(reMoney.toString());
                 request.setOrgReqDate(new SimpleDateFormat("yyyyMMdd").format(payment.getCreateTime()));
                 request.setReqSeqId("refund-" + payment.getPayCode());
                 Map<String, Object> extendInfoMap = new HashMap<>();
                 extendInfoMap.put("org_req_seq_id", orderType + "-" + payment.getPayCode());
                 request.setExtendInfo(extendInfoMap);
-                HuiFuRefundResult refund = huiFuService.refund(request);
-                logger.info("订单退款返回结果:退款订单id:" + order.getOrderId() + refund);
-                if ((refund.getResp_code().equals("00000000") || refund.getResp_code().equals("00000100")) && (refund.getTrans_stat().equals("S") || refund.getTrans_stat().equals("P"))) {
-                    FsStorePayment paymentMap = new FsStorePayment();
-                    paymentMap.setPaymentId(payment.getPaymentId());
-                    paymentMap.setStatus(-1);
-                    paymentMap.setRefundTime(DateUtils.getNowDate());
-                    paymentMap.setRefundMoney(payment.getPayMoney());
-                    fsStorePaymentMapper.updateFsStorePayment(paymentMap);
-                } else {
-                    throw new CustomException("退款请求失败" + refund.getResp_desc());
-                }
+//                HuiFuRefundResult refund = huiFuService.refund(request);
+//                logger.info("订单退款返回结果:退款订单id:" + order.getOrderId() + refund);
+//                if ((refund.getResp_code().equals("00000000") || refund.getResp_code().equals("00000100")) && (refund.getTrans_stat().equals("S") || refund.getTrans_stat().equals("P"))) {
+//                    FsStorePayment paymentMap = new FsStorePayment();
+//                    paymentMap.setPaymentId(payment.getPaymentId());
+//                    paymentMap.setStatus(-1);
+//                    paymentMap.setRefundTime(DateUtils.getNowDate());
+//                    paymentMap.setRefundMoney(payment.getPayMoney());
+//                    fsStorePaymentMapper.updateFsStorePayment(paymentMap);
+//                } else {
+//                    throw new CustomException("退款请求失败" + refund.getResp_desc());
+//                }
             }
             //管易作废
             if (StringUtils.isNotEmpty(fsStoreOrder.getExtendOrderId())) {

+ 143 - 102
fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java

@@ -49,8 +49,7 @@ 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.hisStore.service.IFsStoreOrderLogsScrmService;
-import com.fs.hisStore.service.IFsStoreOrderScrmService;
+import com.fs.hisStore.param.FsStoreOrderRefundByProductParam;
 import com.fs.hisapi.domain.ApiResponse;
 import com.fs.hisapi.param.CreateOrderParam;
 import com.fs.hisapi.param.RecipeDetailParam;
@@ -666,38 +665,28 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
 
     @Override
     public R createOrderByPackageOrder(FsPackageOrder packageOrder) {
-        logger.info("111111111111111");
-
-        logger.info("2222222222222");
+        if (packageOrder.getDoctorId() == null) {
+            Long doctorID = iFsDoctorService.selectFsDoctorDoctorByPackage();
+            packageOrder.setDoctorId(doctorID);
+        }
         FsPackage fsPackage = fsPackageMapper.selectFsPackageByPackageId(packageOrder.getPackageId());
         JSONArray objects = JSONUtil.parseArray(fsPackage.getProductJson());
         List<FsPackagePruductDTO> products = JSONUtil.toList(objects, FsPackagePruductDTO.class);
-        logger.info("3333333333333333333");
+
         Map<String, Object> packageJson = (Map) JSON.parse(packageOrder.getPackageJson());
-        logger.info("55555555555555555555");
         Integer packageSubType = (Integer) packageJson.get("packageSubType");
-        Integer productType = (Integer) packageJson.get("productType");
-        FsStoreOrder order = new FsStoreOrder();
-        Long prescribeId =null;
-        if (productType==1 || packageSubType==2){
-            if (packageOrder.getDoctorId() == null) {
-                Long doctorID = iFsDoctorService.selectFsDoctorDoctorByPackage();
-                packageOrder.setDoctorId(doctorID);
-            }
-            if (packageSubType == 3 ) {
-                inquiryOrderService.createOrderByPackageOrderStatus4(packageOrder);
-            }
-            prescribeId = fsPrescribeService.insertFsPrescribeByPackageOrder(packageOrder);
-            order.setPrescribeId(prescribeId);
+        if (packageSubType == 3) {
+            inquiryOrderService.createOrderByPackageOrderStatus4(packageOrder);
         }
+        Long prescribeId = fsPrescribeService.insertFsPrescribeByPackageOrder(packageOrder);
 
-
+        FsStoreOrder order = new FsStoreOrder();
         List<FsStoreOrderItem> items = new ArrayList<>();
         log.info("套餐包生成药品订单:{}", packageOrder.getOrderSn());
         order.setOrderCode(packageOrder.getOrderSn());
         order.setUserId(packageOrder.getUserId());
         order.setStoreId(fsPackage.getStoreId());
-
+        order.setPrescribeId(prescribeId);
         order.setStatus(2);
         order.setPayDelivery(packageOrder.getPayDelivery());
         order.setPayRemain(packageOrder.getPayRemain());
@@ -1222,7 +1211,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
 
         FsUser user = userService.selectFsUserByUserId(order.getUserId());
         Map<String, BigDecimal> data = new HashMap<>();
-        if (user != null ) {
+        if (user != null && StringUtils.isNotEmpty(user.getMaOpenId())) {
             if (param.getUserCouponId() != null && param.getUserCouponId() > 0l) {
                 FsUserCoupon userCoupon = userCouponService.selectFsUserCouponById(param.getUserCouponId());
                 if (userCoupon == null) {
@@ -1569,55 +1558,6 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
         }
 
     }
-    @Autowired
-    FsStoreOrderScrmMapper storeOrderScrmMapper;
-
-
-    @Autowired
-    IFsStoreOrderLogsScrmService iFsStoreOrderLogsScrmService;
-    @Override
-    public void deliveryOrderScrm(String orderCode, String deliveryId, String deliverCode, String deliverName) {
-        FsStoreOrderScrm order = fsStoreOrderMapper.selectFsStoreOrderScrmByOrderCode(orderCode);
-        if (order != null && order.getStatus() == 1) {
-            FsExpress express = expressService.selectFsExpressByOmsCode(deliverCode);
-            if (express != null) {
-                order.setDeliveryName(deliverName);
-                order.setDeliveryCode(express.getCode());
-            }
-            order.setStatus(2);
-            order.setDeliverySn(deliveryId);
-            order.setDeliverySendTime(DateUtils.getNowDate());
-            storeOrderScrmMapper.updateFsStoreOrder(order);
-            iFsStoreOrderLogsScrmService.create(order.getId(), FsStoreOrderLogEnum.DELIVERY_GOODS.getValue(), FsStoreOrderLogEnum.DELIVERY_GOODS.getDesc());
-            if (order.getCompanyId() != null && order.getCompanyId() > 0) {
-                companyService.subtractCompanyMoneyScrm(order);
-            }
-
-            FsStore store = fsStoreMapper.selectFsStoreByStoreId(order.getStoreId());
-            //订阅物流回调
-            String lastFourNumber = "";
-            if (order.getDeliveryCode().equals(ShipperCodeEnum.SF.getValue())) {
-                if (store != null && store.getSendPhone() != null) {
-                    lastFourNumber = store.getSendPhone();
-                } else {
-                    lastFourNumber = order.getUserPhone();
-                }
-                if (lastFourNumber.length() == 11) {
-                    lastFourNumber = StrUtil.sub(lastFourNumber, lastFourNumber.length(), -4);
-                }
-            }
-            expressService.subscribeEspress(order.getOrderCode(), order.getDeliveryCode(), order.getDeliverySn(), lastFourNumber);
-
-
-        }
-
-    }
-
-    @Override
-    public FsStoreOrderScrm selectFsStoreOrderScrmByOrderCode(String soId) {
-        return fsStoreOrderMapper.selectFsStoreOrderScrmByOrderCode(soId);
-    }
-
 
     @Override
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
@@ -1940,11 +1880,8 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
         erpOrder.setReceiver_address(erpOrder.getReceiver_address().replace("\n", ""));
 
         // 处方图片生成
-        String PrescribeImg=null;
-        if (order.getPrescribeId()!=null){
-            PrescribeImg = fsPrescribeService.PrescribeImg(order.getPrescribeId());
-        }
-        erpOrder.setSeller_memo(erpOrder.getSeller_memo() + "||" + PrescribeImg + "||");
+        String s = fsPrescribeService.PrescribeImg(order.getPrescribeId());
+        erpOrder.setSeller_memo(erpOrder.getSeller_memo() + "||" + s + "||");
         ErpOrderResponse response = erpOrderService.addOrder(erpOrder);
         log.info("ErpCreate:" + order.getOrderCode() + ":" + JSONUtil.toJsonStr(response));
         if (Boolean.TRUE.equals(response.getSuccess())) {
@@ -1961,8 +1898,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
         //写入日志
 
     }
-    @Autowired
-    IFsStoreOrderScrmService orderService;
+
     @Override
     public ExpressResultDTO updateDeliveryItem(ExpressNotifyDTO notifyDTO) {
         String data = URLDecoder.decode(notifyDTO.getRequestData(), Charset.forName("UTF-8"));
@@ -2046,27 +1982,6 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
 
                     }
                 }
-
-                List<FsStoreOrderScrm> orders2 = orderService.selectFsStoreOrderListByDeliveryId(dto.getLogisticCode());
-                if (orders != null) {
-                    for (FsStoreOrderScrm order : orders2) {
-                        logger.info("订单信息:" + JSONUtil.toJsonStr(order));
-                        logger.info("运单号:" + dto.getLogisticCode());
-                        if (order != null && order.getDeliveryStatus() != 3) {
-                            FsStoreOrderScrm map = new FsStoreOrderScrm();
-                            map.setDeliveryStatus(Integer.parseInt(dto.getState()));
-                            map.setId(order.getId());
-                            map.setDeliveryType(dto.getStateEx());
-                            orderService.updateFsStoreOrder(map);
-                            //如果是正常签收,更新订单状态
-                            if (dto.getState().equals("3") && (dto.getStateEx().equals("301") || dto.getStateEx().equals("302") || dto.getStateEx().equals("304") || dto.getStateEx().equals("311"))) {
-                                orderService.finishOrder(order.getId());
-                            }
-
-                        }
-                    }
-                }
-
             }
             return ExpressResultDTO.success(sysConfig.getKdnId().trim());
         }
@@ -2893,7 +2808,6 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
                         o.setReqSeqId("store-" + storePayment.getPayCode());
                         o.setTransAmt(storePayment.getPayMoney().toString());
                         o.setGoodsDesc("药品订单支付");
-                        o.setAppId(param.getAppId());
                         HuifuCreateOrderResult result = huiFuService.createOrder(o);
                         FsStorePayment mt = new FsStorePayment();
                         mt.setPaymentId(storePayment.getPaymentId());
@@ -3013,7 +2927,6 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
                         o.setReqSeqId("store-" + storePayment.getPayCode());
                         o.setTransAmt(storePayment.getPayMoney().toString());
                         o.setGoodsDesc("药品订单支付");
-                        o.setAppId(param.getAppId());
                         HuifuCreateOrderResult result = huiFuService.createOrder(o);
                         FsStorePayment mt = new FsStorePayment();
                         mt.setPaymentId(storePayment.getPaymentId());
@@ -3850,4 +3763,132 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
         return fsStoreOrderMapper.selectFsStoreOrderProductStatistics(fsStoreOrder);
     }
 
+    @Override
+    public int afterSalesByProduct(FsStoreOrderSalesParam param) {
+        FsStoreOrder order = fsStoreOrderMapper.selectFsStoreOrderByOrderId(param.getOrderId());
+        if (order.getStatus() < 0) {
+            throw new CustomException("订单不可提交售后");
+        }
+        //判断总退款金额是否小于等于实付金额
+        BigDecimal refundAmount = param.getRefundAmount();
+        if (refundAmount.compareTo(order.getPayMoney())>0){
+            throw new CustomException("退款金额不能大于实付金额");
+        }
+        List<FsStoreOrderRefundByProductParam> refundList = param.getRefundList();
+        List<Long> itemIds = refundList.stream().filter(item->item.getNum()>0).map(FsStoreOrderRefundByProductParam::getItemId).collect(Collectors.toList());
+        if (itemIds.isEmpty()){
+            throw new CustomException("没有选择需要退款的商品/选择退款商品数量不能为0");
+        }
+        List<FsStoreOrderItem> fsStoreOrderItems = fsStoreOrderItemMapper.selectFsStoreOrderItemListByItemIds(itemIds);
+        if (fsStoreOrderItems.size() != itemIds.size()){
+            throw new CustomException("所退商品明细不存在");
+        }
+        FsStoreAfterSales fsStoreAfterSales = new FsStoreAfterSales();
+        fsStoreAfterSales.setOrderId(order.getOrderId());
+        fsStoreAfterSales.setStoreId(order.getStoreId());
+        fsStoreAfterSales.setRefundAmount(refundAmount);
+        fsStoreAfterSales.setCreateTime(DateUtils.getNowDate());
+        if (order.getStatus() == 2 || order.getStatus() == 3) {
+            fsStoreAfterSales.setRefundType(0);
+        }
+        if (order.getStatus() == 4) {
+            FsStore fsStore = fsStoreMapper.selectFsStoreByStoreId(order.getStoreId());
+            fsStoreAfterSales.setRefundType(1);
+            fsStoreAfterSales.setPhoneNumber(fsStore.getRefundPhone());
+            fsStoreAfterSales.setAddress(fsStore.getRefundAddress());
+            fsStoreAfterSales.setConsignee(fsStore.getRefundConsignee());
+        }
+        fsStoreAfterSales.setStatus(0);
+        fsStoreAfterSales.setDeptId(order.getDeptId());
+        fsStoreAfterSales.setSalesStatus(0);
+        fsStoreAfterSales.setOrderStatus(order.getStatus());
+        fsStoreAfterSales.setUserId(order.getUserId());
+        fsStoreAfterSales.setCompanyId(order.getCompanyId());
+        fsStoreAfterSales.setCompanyUserId(order.getCompanyUserId());
+        fsStoreAfterSales.setIsDel(0);
+        fsStoreAfterSalesService.insertFsStoreAfterSales(fsStoreAfterSales);
+
+        for (FsStoreOrderItem fsStoreOrderItem : fsStoreOrderItems) {
+            for (FsStoreOrderRefundByProductParam fsStoreOrderRefundByProductParam : refundList) {
+                if (Objects.equals(fsStoreOrderRefundByProductParam.getItemId(), fsStoreOrderItem.getItemId())) {
+                    FsStoreAfterSalesItem item = new FsStoreAfterSalesItem();
+                    item.setAfterSalesId(fsStoreAfterSales.getId());
+                    item.setProductId(fsStoreOrderItem.getProductId());
+                    String jsonInfo = fsStoreOrderItem.getJsonInfo();
+                    FsProdItemDTO fsProdItemDTO = JSON.parseObject(jsonInfo, FsProdItemDTO.class);
+                    fsProdItemDTO.setPrice(fsStoreOrderRefundByProductParam.getMoney());
+                    fsProdItemDTO.setNum(fsStoreOrderRefundByProductParam.getNum());
+                    item.setJsonInfo(JSONUtil.toJsonStr(fsProdItemDTO));
+                    fsStoreAfterSalesItemMapper.insertFsStoreAfterSalesItem(item);
+                    break;
+                }
+            }
+        }
+        //增加操作日志
+        FsStoreAfterSalesLogs logs = new FsStoreAfterSalesLogs();
+        logs.setChangeTime(new DateTime());
+        logs.setChangeType(0);
+        logs.setStoreAfterSalesId(fsStoreAfterSales.getId());
+        logs.setOperator(param.getOperator());
+        logs.setCompanyId(param.getCompanyId());
+        logs.setChangeMessage("平台提交售后");
+        fsStoreAfterSalesLogsMapper.insertFsStoreAfterSalesLogs(logs);
+        //添加订单日志
+        fsStoreOrderLogsService.create(order.getOrderId(), FsStoreOrderLogEnum.REFUND_ORDER_PLATFORM.getValue(),
+                param.getOperator() + " " +FsStoreOrderLogEnum.REFUND_ORDER_PLATFORM.getDesc());
+        //判断是否开启erp
+        FsSysConfig sysConfig = configUtil.getSysConfig();
+        Integer erpOpen = sysConfig.getErpOpen();
+        if (erpOpen != null && erpOpen == 1) {
+            //判断erp类型
+            Integer erpType = sysConfig.getErpType();
+            if (erpType != null) {
+
+                IErpOrderService erpOrderService = null;
+                if (erpType == 1) {
+                    //管易
+                    erpOrderService = gyOrderService;
+                } else if (erpType == 2) {
+                    //旺店通
+                    erpOrderService = wdtOrderService;
+                } else if (erpType == 3) {
+                    //瀚智
+                    erpOrderService = hzOMSOrderService;
+                } else if (erpType == 4) {
+                    //瀚智
+                    erpOrderService = dfOrderService;
+                } else if (erpType == 5) {
+                    erpOrderService = jSTOrderService;
+                }else if (erpType == 6) {
+                    erpOrderService = k9OrderService;
+                }
+                if (erpOrderService != null && StringUtils.isNotEmpty(order.getExtendOrderId())) {
+                    if (!order.getExtendOrderId().equals("HIS")) {
+                        if (erpType != 3) {
+                            ErpRefundUpdateRequest request = new ErpRefundUpdateRequest();
+                            request.setTid(order.getOrderCode());
+                            request.setOid(order.getOrderCode());
+                            request.setRefund_state(1);
+                            erpOrderService.refundUpdate(request);
+                        } else {
+                            ErpRefundOrder erpRefundOrder = new ErpRefundOrder();
+                            erpRefundOrder.setOrderCode(order.getOrderCode());
+                            erpRefundOrder.setAfterSalesId(fsStoreAfterSales.getId());
+                            erpOrderService.refundOrder(erpRefundOrder);
+                        }
+                    }
+                }
+            }
+        }
+        order.setStatus(-1);
+        order.setRefundStatus(1 + "");
+        fsStoreOrderMapper.updateFsStoreOrder(order);
+        if (order.getPackageOrderId() != null) {
+            FsPackageOrder fsPackageOrder = fsPackageOrderMapper.selectFsPackageOrderByOrderId(order.getPackageOrderId());
+            fsPackageOrder.setRefundStatus(1);
+            fsPackageOrderMapper.updateFsPackageOrder(fsPackageOrder);
+        }
+        return 1;
+    }
+
 }

+ 3 - 1
fs-service/src/main/java/com/fs/his/vo/FsStoreOrderExportVO.java

@@ -222,7 +222,9 @@ public class FsStoreOrderExportVO implements Serializable
     private String age;
     @Excel(name = "性别", dictType = "sys_patient_sex")
     private String sex;
-
+    //小程序名称
+    @Excel(name = "小程序名称")
+    private String miniProgramName;
     @Excel(name = "订单来源" , dictType = "sys_order_source")
     private Integer source;
 }

+ 2 - 1
fs-service/src/main/java/com/fs/his/vo/FsStoreOrderListVO.java

@@ -53,7 +53,8 @@ public class FsStoreOrderListVO {
     private String orderPackageName;
 
     private String packageSecondName;
-
+    //小程序名称
+    private String miniProgramName;
     //收货人
     private String userName;
 

+ 4 - 0
fs-service/src/main/java/com/fs/his/vo/FsStoreOrderStatusExcelVO.java

@@ -3,6 +3,8 @@ package com.fs.his.vo;
 import com.fs.common.annotation.Excel;
 import lombok.Data;
 
+import java.math.BigDecimal;
+
 @Data
 public class FsStoreOrderStatusExcelVO {
 
@@ -12,6 +14,8 @@ public class FsStoreOrderStatusExcelVO {
     @Excel(name = "订单状态",dictType = "sys_order_status")
     private String status;
 
+    @Excel(name = "物流代收金额")
+    private BigDecimal payRemain;
 
     /** 物流状态 */
     @Excel(name = "物流状态",dictType = "sys_store_order_delivery_status")

+ 19 - 0
fs-service/src/main/java/com/fs/hisStore/param/FsStoreOrderRefundByProductParam.java

@@ -0,0 +1,19 @@
+package com.fs.hisStore.param;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+@Data
+public class FsStoreOrderRefundByProductParam implements Serializable
+{
+    private Long itemId; //订单明细id
+
+    private Integer num; //退款数量
+
+    private BigDecimal money; //退款单价
+
+
+}

+ 5 - 1
fs-service/src/main/java/com/fs/sop/service/impl/QwSopLogsServiceImpl.java

@@ -106,9 +106,13 @@ public class QwSopLogsServiceImpl extends ServiceImpl<QwSopLogsMapper, QwSopLogs
     @Autowired
     private SopUserLogsInfoMapper sopUserLogsInfoMapper;
 
-    @Autowired
     private AsyncSopTestService asyncSopTestService;
 
+    @Autowired
+    public void setAsyncSopTestService(@Lazy AsyncSopTestService asyncSopTestService){
+        this.asyncSopTestService = asyncSopTestService;
+    }
+
 
     @Lazy
     @Autowired

+ 7 - 6
fs-service/src/main/java/com/fs/sop/service/impl/QwSopServiceImpl.java

@@ -41,6 +41,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 
 import java.io.IOException;
@@ -92,9 +93,6 @@ public class QwSopServiceImpl implements IQwSopService
     @Autowired
     private SopUserLogsMapper sopUserLogsMapper;
 
-    @Autowired
-    private AsyncSopService asyncSopService;
-
 
     @Autowired
     private AsyncSopTestService asyncSopTestService;
@@ -109,14 +107,17 @@ public class QwSopServiceImpl implements IQwSopService
     private ISopUserLogsService sopUserLogsService;
     @Autowired
     private CompanyUserMapper companyUserMapper;
-    @Autowired
+
     private IQwSopTempVoiceService qwSopTempVoiceService;
+
+    @Autowired
+    public void setIQwSopTempVoiceService(@Lazy IQwSopTempVoiceService qwSopTempVoiceService) {
+        this.qwSopTempVoiceService = qwSopTempVoiceService;
+    }
     @Autowired
     private IQwSopTempDayService qwSopTempDayService;
     @Autowired
     private IQwSopTempRulesService qwSopTempRulesService;
-    @Autowired
-    private IQwSopTempContentService qwSopTempContentService;
 
     @Autowired
     private RocketMQTemplate rocketMQTemplate;

+ 0 - 2
fs-service/src/main/java/com/fs/sop/service/impl/SopUserLogsServiceImpl.java

@@ -98,8 +98,6 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
     @Autowired
     private IQwSopTempDayService qwSopTempDayService;
 
-    @Autowired
-    private ISopUserLogsService sopUserLogsService;
 
     @Autowired
     private ISysConfigService configService;

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

@@ -86,7 +86,7 @@ ipad:
   ipadUrl: http://ipad.cdwjyyh.com
   aiApi: 1212121212
   voiceApi:
-
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id:
   inquiry_temp_id:

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

@@ -85,6 +85,7 @@ ipad:
   ipadUrl: http://ipad.cdwjyyh.com
   aiApi: 1212121212
   voiceApi:
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id:
   inquiry_temp_id:

+ 94 - 0
fs-service/src/main/resources/application-config-druid-cqtyt.yml

@@ -0,0 +1,94 @@
+baidu:
+  token: 12313231232
+  back-domain: https://www.xxxx.com
+#配置
+logging:
+  level:
+    org.springframework.web: INFO
+    com.github.binarywang.demo.wx.cp: DEBUG
+    me.chanjar.weixin: DEBUG
+wx:
+  miniapp:
+    configs:
+      - appid:
+        secret:
+        token: Ncbnd7lJvkripVOpyTFAna6NAWCxCrvC
+        aesKey: HlEiBB55eaWUaeBVAQO3cWKWPYv1vOVQSq7nFNICw4E
+        msgDataFormat: JSON
+      - appid:
+        secret:
+        token: Ncbnd7lJvkripVOpyTFAna6NAWCxCrvC
+        aesKey: HlEiBB55eaWUaeBVAQO3cWKWPYv1vOVQSq7nFNICw4E
+        msgDataFormat: JSON
+  cp:
+    corpId: wwb2a1055fb6c9a7c2
+    appConfigs:
+      - agentId: 1000005
+        secret: ec7okROXJqkNafq66-L6aKNv0asTzQIG0CYrj3vyBbo
+        token: PPKOdAlCoMO
+        aesKey: PKvaxtpSv8NGpfTDm7VUHIK8Wok2ESyYX24qpXJAdMP
+  pay:
+    appId:  #微信公众号或者小程序等的appid
+    mchId:  #微信支付商户号
+    mchKey:  #微信支付商户密钥
+    subAppId:  #服务商模式下的子商户公众账号ID
+    subMchId:  #服务商模式下的子商户号
+    keyPath: c:\\cert\\apiclient_cert.p12 # p12证书的位置,可以指定绝对路径,也可以指定类路径(以classpath:开头)
+    notifyUrl: https://userapp.his.runtzh.com/app/wxpay/wxPayNotify
+  mp:
+    useRedis: false
+    redisConfig:
+      host: 127.0.0.1
+      port: 6379
+      timeout: 2000
+    configs:
+      - appId: wx616d84b7356534e1  # 第一个公众号的appid
+        secret: 38ba67a4b748b96a797c3d2d5aa85087 # 公众号的appsecret
+        token: PPKOdAlCoMO # 接口配置里的Token值
+        aesKey: Eswa6VjwtVMCcw03qZy6fWllgrv5aytIA1SZPEU0kU2 # 接口配置里的EncodingAESKey值
+  open:
+    appId: wxda2eb168e5b09e56
+    secret: dde09b45d0f6d5b0925965b964b6ab48
+aifabu:  #爱链接
+  appKey: 7b471be905ab17e00f3b858c6710dd117601d008
+watch:
+  watchUrl: watch.ylrzcloud.com/prod-api
+  #  account: tcloud
+  #  password: mdf-m2h_6yw2$hq
+  account1: ccif #866655060138751
+  password1: cp-t5or_6xw7$mt
+  account2: tcloud #rt500台
+  password2: mdf-m2h_6yw2$hq
+  account3: whr
+  password3: v9xsKuqn_$d2y
+
+fs :
+  commonApi: http://172.16.0.9:8010
+  h5CommonApi: http://192.168.0.18:7771
+nuonuo:
+  key: 10924508
+  secret: A2EB20764D304D16
+
+# 存储捅配置
+tencent_cloud_config:
+  secret_id: AKIDiMq9lDf2EOM9lIfqqfKo7FNgM5meD0sT
+  secret_key: u5SuS80342xzx8FRBukza9lVNHKNMSaB
+  bucket: cqtyt-1323137866
+  app_id: 1323137866
+  region: ap-chongqing
+  proxy: cqtyt
+cloud_host:
+  company_name: 重庆泰医堂
+  projectCode: CQTYT
+headerImg:
+  imgUrl: https
+ipad:
+  ipadUrl: http://qwipad.nmghysmytdyf.com
+  aiApi: http://127.0.0.1:3000/api
+  voiceApi:
+  commonApi:
+wx_miniapp_temp:
+  pay_order_temp_id: V
+  inquiry_temp_id: 9
+
+

+ 93 - 0
fs-service/src/main/resources/application-config-druid-czt.yml

@@ -0,0 +1,93 @@
+baidu:
+  token: 12313231232
+  back-domain: https://www.xxxx.com
+#配置
+logging:
+  level:
+    org.springframework.web: INFO
+    com.github.binarywang.demo.wx.cp: DEBUG
+    me.chanjar.weixin: DEBUG
+wx:
+  miniapp:
+    configs:
+      - appid: wxa6a215ad7353fd8a   #纯正堂药速通
+        secret: 4aa21869d9ed5bfc9477afb231a30f05 #纯正堂药速通
+        token: Ncbnd7lJvkripxxna6NAWCxCrvC
+        aesKey: HlEiBB55eaWUaeBVAQO3cWKWPYv1vOVQSq7nFNICw4E
+        msgDataFormat: JSON
+  cp:
+    corpId: wwa46ffb9ff6ac35b8 #企业ID北京存在文化
+    appConfigs:
+      - agentId: 1000070       #北京存在文化
+        secret: pu2EFz6gY2Fo2K-aRUxLPaAkKIaMJJRp8ES9JdpHkp4 #北京存在文化
+        token: PPKOdAlCoMO
+        aesKey: PKvaxtpSv8NGpfTDm7VUHIK8Wok2ESyYX24qpXJAdMP
+  pay:
+    appId:  #微信公众号或者小程序等的appid
+    mchId:  #微信支付商户号
+    mchKey:  #微信支付商户密钥
+    subAppId:  #服务商模式下的子商户公众账号ID
+    subMchId:  #服务商模式下的子商户号
+    keyPath: c:\\cert\\apiclient_cert.p12 # p12证书的位置,可以指定绝对路径,也可以指定类路径(以classpath:开头)
+    notifyUrl: https://userapp.his.runtzh.com/app/wxpay/wxPayNotify
+  mp:
+    useRedis: false
+    redisConfig:
+      host: 127.0.0.1
+      port: 6379
+      timeout: 2000
+    configs:
+      - appId: wx6d3706feab2b9926 # 第一个公众号的appid  //公众号名称:纯正堂大药房
+        secret: eedddc683062b258625f036a71d7cbc0 # 公众号的appsecret--纯正堂大药房
+        token: PPKOdAlCoMO # 接口配置里的Token值
+        aesKey: Eswa6VjwtVMCcw03qZy6fWllgrv5aytIA1SZPEU0kU2 # 接口配置里的EncodingAESKey值
+aifabu:  #爱链接
+  appKey: 7b471be905ab17e00f3b858c6710dd117601d008
+watch:
+  watchUrl: watch.ylrzcloud.com/prod-api
+  #  account: tcloud
+  #  password: mdf-m2h_6yw2$hq
+  account1: ccif #866655060138751
+  password1: cp-t5or_6xw7$mt
+  account2: tcloud #rt500台
+  password2: mdf-m2h_6yw2$hq
+  account3: whr
+  password3: v9xsKuqn_$d2y
+
+fs :
+  commonApi: http://127.0.0.1:7771
+  h5CommonApi: http://127.0.0.1:7771
+nuonuo:
+  key: 10924508
+  secret: A2EB20764D304D16
+
+# 存储捅配置
+tencent_cloud_config:
+  secret_id: AKIDiMq9lDf2EOM9lIfqqfKo7FNgM5meD0sT
+  secret_key: u5SuS80342xzx8FRBukza9lVNHKNMSaB
+  bucket: czt-1323137866
+  app_id: 1323137866
+  region: ap-chongqing
+  proxy: czt
+tmp_secret_config:
+  secret_id: AKIDCj7NSNAovtqeJpBau8GZ4CGB71thXIxX
+  secret_key: lTB5zwqqz7CNhzDOWivFWedgfTBgxgBT
+  bucket: fs-1319721001
+  app_id: 1319721001
+  region: ap-chongqing
+  proxy: fs
+cloud_host:
+  company_name: 纯正堂
+  projectCode: CZT
+headerImg:
+  imgUrl:
+
+ipad:
+  ipadUrl: http://ipad.cdwjyyh.com
+  aiApi: 1212121212
+
+wx_miniapp_temp:
+  pay_order_temp_id:
+  inquiry_temp_id:
+
+

+ 1 - 0
fs-service/src/main/resources/application-config-druid-drk-test.yml

@@ -85,6 +85,7 @@ ipad:
   ipadUrl: http://ipad.cdwjyyh.com
   aiApi: 1212121212
   voiceApi:
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id:
   inquiry_temp_id:

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

@@ -85,6 +85,7 @@ ipad:
   ipadUrl: http://ipad.cdwjyyh.com
   aiApi: 1212121212
   voiceApi:
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id:
   inquiry_temp_id:

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

@@ -106,6 +106,7 @@ ipad:
   ipadUrl: http://ipad.jiuzhouzaixian.com
   aiApi:
   voiceApi:
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id: VXEvKaGNPFuJmhWK9O_QPrTZxe9umDCukq-maI8Vdek
   inquiry_temp_id: 9POPYeqhI48LOPvq-Rfoklze7H-9SlunJKh10Qt4_2I

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

@@ -91,6 +91,7 @@ ipad:
   ipadUrl: http://ipad.cdwjyyh.com
   aiApi:
   voiceApi:
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id:
   inquiry_temp_id:

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

@@ -87,6 +87,7 @@ ipad:
 #  aiApi: http://152.136.202.157:3000/api
   aiApi: http://49.232.181.28:3000/api
   voiceApi:
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id:
   inquiry_temp_id:

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

@@ -83,6 +83,7 @@ ipad:
   ipadUrl: http://ipad.schstyl.cn
   aiApi:
   voiceApi:
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id:
   inquiry_temp_id:

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

@@ -78,6 +78,7 @@ ipad:
   ipadUrl:
   aiApi:
   voiceApi:
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id: -SjnK9K6cNKASa6AD9Q_c0YT7J1lPTEpPIpqbMJF8F0
   inquiry_temp_id: hwFXVh0AWqeasBsZpa0-urb3CrPeYEwBiy3P6AMMGFQ

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

@@ -91,6 +91,7 @@ ipad:
   ipadUrl: http://139.159.133.223:8667
   aiApi: http://1.95.196.10:3000/api
   voiceApi:
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id:
   inquiry_temp_id:

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

@@ -84,6 +84,7 @@ headerImg:
 ipad:
   ipadUrl: http://ipad.cdwjyyh.com
   voiceApi:
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id:
   inquiry_temp_id:

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

@@ -86,6 +86,7 @@ ipad:
   ipadUrl: http://ipadjnlzjk.ylrztop.com
   aiApi: http://49.232.181.28:3000/
   voiceApi:
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id:
   inquiry_temp_id:

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

@@ -87,7 +87,7 @@ headerImg:
 ipad:
   ipadUrl: http://qwipad.jnmyunl.com
   aiApi: http://49.232.181.28:3000/api
-  voiceApi: http://162.14.193.126:8009
+  voiceApi: http://139.186.176.122:8009
 wx_miniapp_temp:
   pay_order_temp_id: -SjnK9K6cNKASa6AD9Q_c0YT7J1lPTEpPIpqbMJF8F0
   inquiry_temp_id: hwFXVh0AWqeasBsZpa0-urb3CrPeYEwBiy3P6AMMGFQ

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

@@ -90,6 +90,7 @@ ipad:
   ipadUrl: http://ipad.jiuzhouzaixian.com
   aiApi: http://1.95.196.10:3000/api
   voiceApi:
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id: VXEvKaGNPFuJmhWK9O_QPrTZxe9umDCukq-maI8Vdek
   inquiry_temp_id: 9POPYeqhI48LOPvq-Rfoklze7H-9SlunJKh10Qt4_2I

+ 96 - 0
fs-service/src/main/resources/application-config-druid-knt.yml

@@ -0,0 +1,96 @@
+baidu:
+  token: 12313231232
+  back-domain: https://www.xxxx.com
+#配置
+logging:
+  level:
+    org.springframework.web: INFO
+    com.github.binarywang.demo.wx.cp: DEBUG
+    me.chanjar.weixin: DEBUG
+wx:
+  miniapp:
+    configs:
+      - appid:
+        secret:
+        token:
+        aesKey: HlEiBB55eaWUaeBVAQO3cWKWPYv1vOVQSq7nFNICw4E
+        msgDataFormat: JSON
+  cp:
+    corpId: wwb2a1055fb6c9a7c2
+    appConfigs:
+      - agentId: 1000005
+        secret: ec7okROXJqkNafq66-L6aKNv0asTzQIG0CYrj3vyBbo
+        token: PPKOdAlCoMO
+        aesKey: PKvaxtpSv8NGpfTDm7VUHIK8Wok2ESyYX24qpXJAdMP
+  pay:
+    appId: wx7cf96953a4be5181 #微信公众号或者小程序等的appid
+    mchId: 1611402045 #微信支付商户号
+    mchKey: 8cab128997a3547c1363b0898b877f38 #微信支付商户密钥
+    subAppId:  #服务商模式下的子商户公众账号ID
+    subMchId:  #服务商模式下的子商户号
+    keyPath: c:\\cert\\apiclient_cert.p12 # p12证书的位置,可以指定绝对路径,也可以指定类路径(以classpath:开头)
+    notifyUrl: https://userapp.his.runtzh.com/app/wxpay/wxPayNotify
+  mp:
+    useRedis: false
+    redisConfig:
+      host: 127.0.0.1
+      port: 6379
+      timeout: 2000
+    configs:
+      - appId: wx6ee517a8d8743f88  # 第一个公众号的appid
+        secret: 1fac75465a61f9259a0fe19795d9e80d # 公众号的appsecret
+        token: PPKOdAlCoMO # 接口配置里的Token值
+        aesKey: Eswa6VjwtVMCcw03qZy6fWllgrv5aytIA1SZPEU0kU2 # 接口配置里的EncodingAESKey值
+  open:
+    appId: wxda2eb168e5b09e56
+    secret: dde09b45d0f6d5b0925965b964b6ab48
+aifabu:  #爱链接
+  appKey: 7b471be905ab17e00f3b858c6710dd117601d008
+watch:
+  watchUrl: watch.ylrzcloud.com/prod-api
+  #  account: tcloud
+  #  password: mdf-m2h_6yw2$hq
+  account1: ccif #866655060138751
+  password1: cp-t5or_6xw7$mt
+  account2: tcloud #rt500台
+  password2: mdf-m2h_6yw2$hq
+  account3: whr
+  password3: v9xsKuqn_$d2y
+
+fs :
+  commonApi: http://192.168.0.18:7771
+  h5CommonApi: http://192.168.0.18:7771
+nuonuo:
+  key: 10924508
+  secret: A2EB20764D304D16
+
+# 存储捅配置
+tencent_cloud_config:
+  secret_id: AKIDiMq9lDf2EOM9lIfqqfKo7FNgM5meD0sT
+  secret_key: u5SuS80342xzx8FRBukza9lVNHKNMSaB
+  bucket: jnmy-1323137866
+  app_id: 1323137866
+  region: ap-chongqing
+  proxy: jnmy
+tmp_secret_config:
+  secret_id: AKIDCj7NSNAovtqeJpBau8GZ4CGB71thXIx
+  secret_key: lTB5zwqqz7CNhzDOWivFWedgfTBgxgB
+  bucket: fs-131972100
+  app_id: 1319721001
+  region: ap-chongqing
+  proxy: fs
+cloud_host:
+  company_name: 康年堂
+  projectCode: KNT
+headerImg:
+  imgUrl: https
+ipad:
+  ipadUrl: http://qwipad.jnmyunl.com
+  aiApi: http://49.232.181.28:3000/api
+  voiceApi: http://139.186.176.122:8009
+  commonApi:
+wx_miniapp_temp:
+  pay_order_temp_id: -SjnK9K6cNKASa6AD9Q_c0YT7J1lPTEpPIpqbMJF8F0
+  inquiry_temp_id: hwFXVh0AWqeasBsZpa0-urb3CrPeYEwBiy3P6AMMGFQ
+
+

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

@@ -83,6 +83,7 @@ ipad:
   ipadUrl: http://kytIpad.ylrzcloud.com
   aiApi:
   voiceApi:
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id:
   inquiry_temp_id:

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

@@ -86,6 +86,7 @@ ipad:
   ipadUrl: http://qwipad.nmghysmytdyf.com
   aiApi: http://127.0.0.1:3000/api
   voiceApi:
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id: V
   inquiry_temp_id: 9

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

@@ -91,6 +91,7 @@ ipad:
   ipadUrl:
   aiApi:
   voiceApi:
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id:
   inquiry_temp_id:

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

@@ -83,6 +83,7 @@ ipad:
   ipadUrl: http://qwipad.cqsft.vip
   aiApi:
   voiceApi:
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id: V
   inquiry_temp_id: 9

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

@@ -87,6 +87,7 @@ ipad:
   ipadUrl: http://ipad.xintaihl.cn
   aiApi: http://1.95.196.10:3000/api
   voiceApi:
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id:
   inquiry_temp_id:

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

@@ -83,6 +83,7 @@ ipad:
   ipadUrl: http://ipad.ysya.top
   aiApi: http://49.232.181.28:3000/api
   voiceApi:
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id:
   inquiry_temp_id:

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

@@ -85,6 +85,7 @@ ipad:
   ipadUrl: http://ipad.cdwjyyh.com
   aiApi: 1212121212
   voiceApi:
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id:
   inquiry_temp_id:

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

@@ -90,6 +90,7 @@ ipad:
   ipadUrl: http://ipad.cdwjyyh.com
   aiApi:
   voiceApi:
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id: VXEvKaGNPFuJmhWK9O_QPrTZxe9umDCukq-maI8Vdek
   inquiry_temp_id: 9POPYeqhI48LOPvq-Rfoklze7H-9SlunJKh10Qt4_2I

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

@@ -85,6 +85,7 @@ ipad:
   ipadUrl: http://ipad.cdwjyyh.com
   aiApi: 1212121212
   voiceApi:
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id:
   inquiry_temp_id:

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

@@ -86,6 +86,7 @@ ipad:
   ipadUrl: http://ipad.bjyjbao.com
   aiApi: http://152.136.202.157:3000/api
   voiceApi:
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id:
   inquiry_temp_id:

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

@@ -82,6 +82,7 @@ headerImg:
 ipad:
   ipadUrl: http://ipad.cdwjyyh.com
   voiceApi:
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id:
   inquiry_temp_id:

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

@@ -71,6 +71,7 @@ headerImg:
 ipad:
   ipadUrl: http://ipad.cdwjyyh.com
   voiceApi:
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id:
   inquiry_temp_id:

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

@@ -89,7 +89,7 @@ ipad:
 #  aiApi: http://152.136.202.157:3000/api
   aiApi: http://49.232.181.28:3000/api
   voiceApi:
-
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id: VXEvKaGNPFuJmhWK9O_QPrTZxe9umDCukq-maI8Vdek
   inquiry_temp_id: 9POPYeqhI48LOPvq-Rfoklze7H-9SlunJKh10Qt4_2I

+ 1 - 0
fs-service/src/main/resources/application-config-zkzh.yml

@@ -141,6 +141,7 @@ ipad:
   ipadUrl: http://qwipad.muyi88.com
   aiApi: http://152.136.202.157:3000/api
   voiceApi:
+  commonApi:
 wx_miniapp_temp:
   pay_order_temp_id: VXEvKaGNPFuJmhWK9O_QPrTZxe9umDCukq-maI8Vdek
   inquiry_temp_id: 9POPYeqhI48LOPvq-Rfoklze7H-9SlunJKh10Qt4_2I

+ 159 - 0
fs-service/src/main/resources/application-druid-cqtyt.yml

@@ -0,0 +1,159 @@
+# 数据源配置
+spring:
+    profiles:
+        include: config-druid-cqtyt,common
+    # redis 配置
+    redis:
+        # 地址
+        host: r-2zexagt5g4z7arviu5.redis.rds.aliyuncs.com
+        # 端口,默认为6379
+        port: 6379
+        # 数据库索引
+        database: 0
+        # 密码
+        password: Ylrz_c123232014^$
+        # 连接超时时间
+        timeout: 20s
+        lettuce:
+            pool:
+                # 连接池中的最小空闲连接
+                min-idle: 0
+                # 连接池中的最大空闲连接
+                max-idle: 8
+                # 连接池的最大数据库连接数
+                max-active: 8
+                # #连接池最大阻塞等待时间(使用负值表示没有限制)
+                max-wait: -1ms
+    datasource:
+        #        clickhouse:
+        #            type: com.alibaba.druid.pool.DruidDataSource
+        #            driverClassName: com.clickhouse.jdbc.ClickHouseDriver
+        #            url: jdbc:clickhouse://cc-2vc8zzo26w0l7m2l6.public.clickhouse.ads.aliyuncs.com/sop?compress=0&use_server_time_zone=true&use_client_time_zone=false&timezone=Asia/Shanghai
+        #            username: rt_2024
+        #            password: Yzx_19860213
+        #            initialSize: 10
+        #            maxActive: 100
+        #            minIdle: 10
+        #            maxWait: 6000
+        mysql:
+            type: com.alibaba.druid.pool.DruidDataSource
+            driverClassName: com.mysql.cj.jdbc.Driver
+            druid:
+                # 主库数据源
+                master:
+                    url: jdbc:mysql://pc-2zeq92ogn83eb1fsl.mysql.polardb.rds.aliyuncs.com:3306/fs_his?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                    username: tat_root01
+                    password: Ylrz_c123232014^$
+                # 从库数据源
+                slave:
+                    # 从数据源开关/默认关闭
+                    enabled: false
+                    url:
+                    username:
+                    password:
+                # 初始连接数
+                initialSize: 5
+                # 最小连接池数量
+                minIdle: 10
+                # 最大连接池数量
+                maxActive: 20
+                # 配置获取连接等待超时的时间
+                maxWait: 60000
+                # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+                timeBetweenEvictionRunsMillis: 60000
+                # 配置一个连接在池中最小生存的时间,单位是毫秒
+                minEvictableIdleTimeMillis: 300000
+                # 配置一个连接在池中最大生存的时间,单位是毫秒
+                maxEvictableIdleTimeMillis: 900000
+                # 配置检测连接是否有效
+                validationQuery: SELECT 1 FROM DUAL
+                testWhileIdle: true
+                testOnBorrow: false
+                testOnReturn: false
+                webStatFilter:
+                    enabled: true
+                statViewServlet:
+                    enabled: true
+                    # 设置白名单,不填则允许所有访问
+                    allow:
+                    url-pattern: /druid/*
+                    # 控制台管理用户名和密码
+                    login-username: fs
+                    login-password: 123456
+                filter:
+                    stat:
+                        enabled: true
+                        # 慢SQL记录
+                        log-slow-sql: true
+                        slow-sql-millis: 1000
+                        merge-sql: true
+                    wall:
+                        config:
+                            multi-statement-allow: true
+        sop:
+            type: com.alibaba.druid.pool.DruidDataSource
+            driverClassName: com.mysql.cj.jdbc.Driver
+            druid:
+                # 主库数据源
+                master:
+                    url: jdbc:mysql://pc-2zeq92ogn83eb1fsl.mysql.polardb.rds.aliyuncs.com:3306/fs_his_sop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                    username: tat_root01
+                    password: Ylrz_c123232014^$
+                read:
+                    url: jdbc:mysql://pc-2zeq92ogn83eb1fsl.rwlb.rds.aliyuncs.com:3306/fs_his_sop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                    username: tat_root01
+                    password: Ylrz_c123232014^$
+                # 初始连接数
+                initialSize: 5
+                # 最小连接池数量
+                minIdle: 10
+                # 最大连接池数量
+                maxActive: 20
+                # 配置获取连接等待超时的时间
+                maxWait: 60000
+                # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+                timeBetweenEvictionRunsMillis: 60000
+                # 配置一个连接在池中最小生存的时间,单位是毫秒
+                minEvictableIdleTimeMillis: 300000
+                # 配置一个连接在池中最大生存的时间,单位是毫秒
+                maxEvictableIdleTimeMillis: 900000
+                # 配置检测连接是否有效
+                validationQuery: SELECT 1 FROM DUAL
+                testWhileIdle: true
+                testOnBorrow: false
+                testOnReturn: false
+                webStatFilter:
+                    enabled: true
+                statViewServlet:
+                    enabled: true
+                    # 设置白名单,不填则允许所有访问
+                    allow:
+                    url-pattern: /druid/*
+                    # 控制台管理用户名和密码
+                    login-username: fs
+                    login-password: 123456
+                filter:
+                    stat:
+                        enabled: true
+                        # 慢SQL记录
+                        log-slow-sql: true
+                        slow-sql-millis: 1000
+                        merge-sql: true
+                    wall:
+                        config:
+                            multi-statement-allow: true
+rocketmq:
+    name-server: rmq-1243b25nj.rocketmq.gz.public.tencenttdmq.com:8080 # RocketMQ NameServer 地址
+    producer:
+        group: my-producer-group
+        access-key: ak1243b25nj17d4b2dc1a03 # 替换为实际的 accessKey
+        secret-key: sk08a7ea1f9f4b0237 # 替换为实际的 secretKey
+    consumer:
+        group: test-group
+        access-key: ak1243b25nj17d4b2dc1a03 # 替换为实际的 accessKey
+        secret-key: sk08a7ea1f9f4b0237 # 替换为实际的 secretKey
+openIM:
+    secret: openIM123
+    userID: imAdmin
+#是否为新商户,新商户不走mpOpenId
+isNewWxMerchant: true

+ 153 - 0
fs-service/src/main/resources/application-druid-czt.yml

@@ -0,0 +1,153 @@
+# 数据源配置
+spring:
+    profiles:
+        include: config-druid-czt,common
+    # redis 配置
+    redis:
+        host: 10.206.16.6
+        port: 6379
+        # 数据库索引
+        database: 0
+        # 密码
+        password:
+        # 连接超时时间
+        timeout: 10s
+        lettuce:
+            pool:
+                # 连接池中的最小空闲连接
+                min-idle: 0
+                # 连接池中的最大空闲连接
+                max-idle: 8
+                # 连接池的最大数据库连接数
+                max-active: 100
+                # #连接池最大阻塞等待时间(使用负值表示没有限制)
+                max-wait: -1ms
+    datasource:
+#        clickhouse:
+#            type: com.alibaba.druid.pool.DruidDataSource
+#            driverClassName: com.clickhouse.jdbc.ClickHouseDriver
+#            url: jdbc:clickhouse://1.14.104.71:8123/sop_test?compress=0&use_server_time_zone=true&use_client_time_zone=false&timezone=Asia/Shanghai
+#            username: rt_2024
+#            password: Yzx_19860213
+#            initialSize: 10
+#            maxActive: 100
+#            minIdle: 10
+#            maxWait: 6000
+        mysql:
+            type: com.alibaba.druid.pool.DruidDataSource
+            driverClassName: com.mysql.cj.jdbc.Driver
+            druid:
+                # 主库数据源
+                master:
+                  url: jdbc:mysql://10.206.0.11:3306/fs_his?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                  username: root
+                  password: Ylrz_1q2w3e4r5t6y
+                # 从库数据源
+                slave:
+                    # 从数据源开关/默认关闭
+                    enabled: false
+                    url:
+                    username:
+                    password:
+                # 初始连接数
+                initialSize: 5
+                # 最小连接池数量
+                minIdle: 10
+                # 最大连接池数量
+                maxActive: 20
+                # 配置获取连接等待超时的时间
+                maxWait: 60000
+                # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+                timeBetweenEvictionRunsMillis: 60000
+                # 配置一个连接在池中最小生存的时间,单位是毫秒
+                minEvictableIdleTimeMillis: 300000
+                # 配置一个连接在池中最大生存的时间,单位是毫秒
+                maxEvictableIdleTimeMillis: 900000
+                # 配置检测连接是否有效
+                validationQuery: SELECT 1 FROM DUAL
+                testWhileIdle: true
+                testOnBorrow: false
+                testOnReturn: false
+                webStatFilter:
+                    enabled: true
+                statViewServlet:
+                    enabled: true
+                    # 设置白名单,不填则允许所有访问
+                    allow:
+                    url-pattern: /druid/*
+                    # 控制台管理用户名和密码
+                    login-username: fs
+                    login-password: 123456
+                filter:
+                    stat:
+                        enabled: true
+                        # 慢SQL记录
+                        log-slow-sql: true
+                        slow-sql-millis: 1000
+                        merge-sql: true
+                    wall:
+                        config:
+                            multi-statement-allow: true
+        sop:
+            type: com.alibaba.druid.pool.DruidDataSource
+            driverClassName: com.mysql.cj.jdbc.Driver
+            druid:
+                # 主库数据源
+                master:
+                    url: jdbc:mysql://10.206.0.11:3306/fs_his_sop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                    username: root
+                    password: Ylrz_1q2w3e4r5t6y
+                # 初始连接数
+                initialSize: 5
+                # 最小连接池数量
+                minIdle: 10
+                # 最大连接池数量
+                maxActive: 20
+                # 配置获取连接等待超时的时间
+                maxWait: 60000
+                # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+                timeBetweenEvictionRunsMillis: 60000
+                # 配置一个连接在池中最小生存的时间,单位是毫秒
+                minEvictableIdleTimeMillis: 300000
+                # 配置一个连接在池中最大生存的时间,单位是毫秒
+                maxEvictableIdleTimeMillis: 900000
+                # 配置检测连接是否有效
+                validationQuery: SELECT 1 FROM DUAL
+                testWhileIdle: true
+                testOnBorrow: false
+                testOnReturn: false
+                webStatFilter:
+                    enabled: true
+                statViewServlet:
+                    enabled: true
+                    # 设置白名单,不填则允许所有访问
+                    allow:
+                    url-pattern: /druid/*
+                    # 控制台管理用户名和密码
+                    login-username: fs
+                    login-password: 123456
+                filter:
+                    stat:
+                        enabled: true
+                        # 慢SQL记录
+                        log-slow-sql: true
+                        slow-sql-millis: 1000
+                        merge-sql: true
+                    wall:
+                        config:
+                            multi-statement-allow: true
+rocketmq:
+    name-server: rmq-16xj8o92zp.rocketmq.cd.qcloud.tencenttdmq.com:8080
+    producer:
+        group: my-producer-group
+        access-key: ak16xj8o92zp984557f83ba2 # 替换为实际的 accessKey
+        secret-key: sk2ff1c6b15b74b888 # 替换为实际的 secretKey
+    consumer:
+        group: common-group
+        access-key: ak16xj8o92zp984557f83ba2 # 替换为实际的 accessKey
+        secret-key: sk2ff1c6b15b74b888 # 替换为实际的 secretKey
+openIM:
+    secret: openIM123
+    userID: imAdmin
+#是否为新商户,新商户不走mpOpenId
+isNewWxMerchant: true

+ 162 - 0
fs-service/src/main/resources/application-druid-knt.yml

@@ -0,0 +1,162 @@
+# 数据源配置
+spring:
+    profiles:
+        include: config-druid-knt,common
+    # redis 配置
+    redis:
+        # 地址
+        host: 192.168.0.131
+        # 端口,默认为6379
+        port: 6379
+        # 数据库索引
+        database: 1
+        # 密码
+        password: Ylrztek250218!3@.
+        # 连接超时时间
+        timeout: 20s
+        lettuce:
+            pool:
+                # 连接池中的最小空闲连接
+                min-idle: 0
+                # 连接池中的最大空闲连接
+                max-idle: 8
+                # 连接池的最大数据库连接数
+                max-active: 8
+                # #连接池最大阻塞等待时间(使用负值表示没有限制)
+                max-wait: -1ms
+    datasource:
+        #        clickhouse:
+        #            type: com.alibaba.druid.pool.DruidDataSource
+        #            driverClassName: com.clickhouse.jdbc.ClickHouseDriver
+        #            url: jdbc:clickhouse://cc-2vc8zzo26w0l7m2l6.public.clickhouse.ads.aliyuncs.com/sop?compress=0&use_server_time_zone=true&use_client_time_zone=false&timezone=Asia/Shanghai
+        #            username: rt_2024
+        #            password: Yzx_19860213
+        #            initialSize: 10
+        #            maxActive: 100
+        #            minIdle: 10
+        #            maxWait: 6000
+        mysql:
+            type: com.alibaba.druid.pool.DruidDataSource
+            driverClassName: com.mysql.cj.jdbc.Driver
+            druid:
+                # 主库数据源
+                master:
+                    url: jdbc:mysql://192.168.0.171:3306/fs_knt_his?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                    username: root
+                    password: Ylrztek250218!3@.
+                # 从库数据源
+                slave:
+                    # 从数据源开关/默认关闭
+                    enabled: false
+                    url:
+                    username:
+                    password:
+                # 初始连接数
+                initialSize: 5
+                # 最小连接池数量
+                minIdle: 10
+                # 最大连接池数量
+                maxActive: 20
+                # 配置获取连接等待超时的时间
+                maxWait: 60000
+                # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+                timeBetweenEvictionRunsMillis: 60000
+                # 配置一个连接在池中最小生存的时间,单位是毫秒
+                minEvictableIdleTimeMillis: 300000
+                # 配置一个连接在池中最大生存的时间,单位是毫秒
+                maxEvictableIdleTimeMillis: 900000
+                # 配置检测连接是否有效
+                validationQuery: SELECT 1 FROM DUAL
+                testWhileIdle: true
+                testOnBorrow: false
+                testOnReturn: false
+                webStatFilter:
+                    enabled: true
+                statViewServlet:
+                    enabled: true
+                    # 设置白名单,不填则允许所有访问
+                    allow:
+                    url-pattern: /druid/*
+                    # 控制台管理用户名和密码
+                    login-username: fs
+                    login-password: 123456
+                filter:
+                    stat:
+                        enabled: true
+                        # 慢SQL记录
+                        log-slow-sql: true
+                        slow-sql-millis: 1000
+                        merge-sql: true
+                    wall:
+                        config:
+                            multi-statement-allow: true
+        sop:
+            type: com.alibaba.druid.pool.DruidDataSource
+            driverClassName: com.mysql.cj.jdbc.Driver
+            druid:
+                # 主库数据源
+                master:
+                    url: jdbc:mysql://192.168.0.171:3306/sop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                    username: root
+                    password: Ylrztek250218!3@.
+                read:
+                    url: jdbc:mysql://192.168.0.171:3306/sop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                    username: root
+                    password: Ylrztek250218!3@.
+                # 初始连接数
+                initialSize: 5
+                # 最小连接池数量
+                minIdle: 10
+                # 最大连接池数量
+                maxActive: 20
+                # 配置获取连接等待超时的时间
+                maxWait: 60000
+                # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+                timeBetweenEvictionRunsMillis: 60000
+                # 配置一个连接在池中最小生存的时间,单位是毫秒
+                minEvictableIdleTimeMillis: 300000
+                # 配置一个连接在池中最大生存的时间,单位是毫秒
+                maxEvictableIdleTimeMillis: 900000
+                # 配置检测连接是否有效
+                validationQuery: SELECT 1 FROM DUAL
+                testWhileIdle: true
+                testOnBorrow: false
+                testOnReturn: false
+                webStatFilter:
+                    enabled: true
+                statViewServlet:
+                    enabled: true
+                    # 设置白名单,不填则允许所有访问
+                    allow:
+                    url-pattern: /druid/*
+                    # 控制台管理用户名和密码
+                    login-username: fs
+                    login-password: 123456
+                filter:
+                    stat:
+                        enabled: true
+                        # 慢SQL记录
+                        log-slow-sql: true
+                        slow-sql-millis: 1000
+                        merge-sql: true
+                    wall:
+                        config:
+                            multi-statement-allow: true
+rocketmq:
+    name-server: 192.168.0.176:8100 # RocketMQ NameServer 地址
+    producer:
+        group: my-producer-group
+        access-key: jnmyunl # 替换为实际的 accessKey
+        secret-key: 73a!ul~xQl@-6u1 # 替换为实际的 secretKey
+        tls-enable: false
+    consumer:
+        topic: course-finish-notes
+        group: course-finish-group
+        access-key: jnmyunl # 替换为实际的 accessKey
+        secret-key: 73a!ul~xQl@-6u1 # 替换为实际的 secretKey
+        tls-enable: false
+openIM:
+    secret: openIM123
+    userID: imAdmin
+#是否为新商户,新商户不走mpOpenId
+isNewWxMerchant: true

+ 1 - 0
fs-service/src/main/resources/application-druid-lmjy.yml

@@ -152,6 +152,7 @@ ipad:
     ipadUrl:
     aiApi:
     voiceApi:
+    commonApi:
 openIM:
     secret: openIM123
     userID: imAdmin

+ 6 - 0
fs-service/src/main/resources/mapper/his/FsStoreOrderItemMapper.xml

@@ -41,6 +41,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectFsStoreOrderItemVo"/>
         where item_id = #{itemId}
     </select>
+    <select id="selectFsStoreOrderItemListByItemIds" resultType="com.fs.his.domain.FsStoreOrderItem">
+        select * from fs_store_order_item where  item_id in
+        <foreach collection="itemIds" item="itemId" open="(" separator="," close=")">
+            #{itemId}
+        </foreach>
+    </select>
 
     <insert id="insertFsStoreOrderItem" parameterType="FsStoreOrderItem" useGeneratedKeys="true" keyProperty="itemId">
         insert into fs_store_order_item

+ 34 - 3
fs-service/src/main/resources/mapper/his/FsStoreOrderMapper.xml

@@ -710,13 +710,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
     <select id="selectFsStoreOrderListVO" resultType="com.fs.his.vo.FsStoreOrderListVO">
         select so.*,st.store_name,us.nick_name,us.phone,d.doctor_name,p.patient_name,p.prescribe_code,c.company_name,
-               cu.nick_name company_user_name
+               cu.nick_name company_user_name , csc.name miniProgramName
         FROM fs_store_order so LEFT JOIN fs_store st ON so.store_id =st.store_id
         LEFT JOIN fs_user us ON us.user_id=so.user_id
         LEFT JOIN fs_prescribe p ON p.prescribe_id =so.prescribe_id
         LEFT JOIN fs_doctor d ON so.doctor_id= d.doctor_id
         LEFT JOIN company c on c.company_id =so.company_id
         LEFT JOIN company_user cu on cu.user_id=so.company_user_id
+        LEFT JOIN (
+        SELECT
+        sp.*,
+        ROW_NUMBER() OVER (PARTITION BY sp.pay_code ORDER BY sp.create_time DESC) as rn
+        FROM fs_store_payment sp
+        ) sp_latest ON sp_latest.business_code = so.order_code AND sp_latest.rn = 1
+        LEFT JOIN fs_course_play_source_config csc ON csc.appid = sp_latest.app_id
         <where>
             <if test="maps.packageSecondName != null and maps.packageSecondName != ''">
                 and so.package_second_name like concat('%', #{maps.packageSecondName}, '%')
@@ -724,6 +731,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="maps.storeId != null">
                 and so.store_id = #{maps.storeId}
             </if>
+            <if test="maps.coursePlaySourceConfigId != null">
+                and csc.id = #{maps.coursePlaySourceConfigId}
+            </if>
             <if test="maps.orderCodes != null  and maps.orderCodes.size > 0">
                 and so.order_code in
                 <foreach collection="maps.orderCodes" item="orderCode" open="(" close=")" separator=",">
@@ -917,7 +927,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
     <select id="selectFsStoreOrderListVOByErpAccount" resultType="com.fs.his.vo.FsStoreOrderListVO">
         select so.*,st.store_name,us.nick_name,us.phone,d.doctor_name,p.patient_name,p.prescribe_code,c.company_name,
-        cu.nick_name company_user_name
+        cu.nick_name company_user_name , csc.name miniProgramName
         FROM fs_store_order so LEFT JOIN fs_store st ON so.store_id =st.store_id
         LEFT JOIN fs_user us ON us.user_id=so.user_id
         LEFT JOIN fs_prescribe p ON p.prescribe_id =so.prescribe_id
@@ -925,6 +935,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN company c on c.company_id =so.company_id
         LEFT JOIN company_user cu on cu.user_id=so.company_user_id
         LEFT JOIN fs_store_order_df df on df.order_id=so.order_id
+        LEFT JOIN (
+        SELECT
+        sp.*,
+        ROW_NUMBER() OVER (PARTITION BY sp.pay_code ORDER BY sp.create_time DESC) as rn
+        FROM fs_store_payment sp
+        ) sp_latest ON sp_latest.business_code = so.order_code AND sp_latest.rn = 1
+        LEFT JOIN fs_course_play_source_config csc ON csc.appid = sp_latest.app_id
         <where>
             <if test="maps.packageSecondName != null and maps.packageSecondName != ''">
                 and so.package_second_name like concat('%', #{maps.packageSecondName}, '%')
@@ -932,6 +949,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="maps.storeId != null">
                 and so.store_id = #{maps.storeId}
             </if>
+            <if test="maps.coursePlaySourceConfigId != null">
+                and csc.id = #{maps.coursePlaySourceConfigId}
+            </if>
             <if test="maps.orderCodes != null  and maps.orderCodes.size > 0">
                 and so.order_code in
                 <foreach collection="maps.orderCodes" item="orderCode" open="(" close=")" separator=",">
@@ -1354,7 +1374,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         c.company_name,
         cu.nick_name AS company_user_nick_name,
         cts.name AS schedule_name,
-        st.store_name,df.login_account as erp_account
+        st.store_name,df.login_account as erp_account,
+        csc.name miniProgramName
         FROM fs_store_order so
         LEFT JOIN fs_store st ON so.store_id = st.store_id
         LEFT JOIN fs_user u ON so.user_id = u.user_id
@@ -1365,12 +1386,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN company_tcm_schedule cts ON cts.id = so.schedule_id
         LEFT JOIN fs_patient pat ON pat.patient_id = p.patient_id
         LEFT JOIN fs_store_order_df df on df.order_id=so.order_id
+        LEFT JOIN (
+        SELECT
+        sp.*,
+        ROW_NUMBER() OVER (PARTITION BY sp.pay_code ORDER BY sp.create_time DESC) as rn
+        FROM fs_store_payment sp
+        ) sp_latest ON sp_latest.business_code = so.order_code AND sp_latest.rn = 1
+        LEFT JOIN fs_course_play_source_config csc ON csc.appid = sp_latest.app_id
         WHERE so.is_del = 0
 
         <!-- 动态条件 -->
         <if test="maps.packageSecondName != null and maps.packageSecondName != ''">
             AND so.package_second_name LIKE CONCAT('%', #{maps.packageSecondName}, '%')
         </if>
+        <if test="maps.coursePlaySourceConfigId != null">
+            and csc.id = #{maps.coursePlaySourceConfigId}
+        </if>
         <if test="maps.storeId != null">
             AND so.store_id = #{maps.storeId}
         </if>

+ 1 - 1
fs-service/src/main/resources/mapper/qw/QwUserVoiceLogMapper.xml

@@ -101,7 +101,7 @@
         where id = #{id}
     </select>
     <select id="selectQwUserVoiceLogTotalList" resultMap="QwUserVoiceLogVoTotalResult">
-        SELECT uvl.id, ext_id, uvl.qw_user_id, duration, title, uvl.status, uvl.corp_id,
+        SELECT uvl.id, ext_id, uvl.qw_user_id, title, uvl.status, uvl.corp_id,
                uvl.company_id, uvl.company_user_id, uvl.create_time,qec.`name`,qec.tag_ids tagIds,qu.qw_user_name,
         SUM(duration) duration,
         COUNT(CASE WHEN uvl.status=1 THEN 1 END) AS connectCount,

+ 5 - 1
fs-service/src/main/resources/mapper/system/SysRoleMapper.xml

@@ -20,11 +20,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<result property="updateTime"         column="update_time"           />
 		<result property="remark"             column="remark"                />
 		<result property="isCheckPhone"       column="is_check_phone"                />
+		<result property="isCheckAddress"     column="is_check_address"                />
 	</resultMap>
 
 	<sql id="selectRoleVo">
 	    select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly,
-            r.status, r.del_flag, r.create_time, r.remark,r.is_check_phone
+            r.status, r.del_flag, r.create_time, r.remark,r.is_check_phone,r.is_check_address
         from sys_role r
 	        left join sys_user_role ur on ur.role_id = r.role_id
 	        left join sys_user u on u.user_id = ur.user_id
@@ -116,6 +117,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="remark != null and remark != ''">remark,</if>
  			<if test="createBy != null and createBy != ''">create_by,</if>
  			<if test="isCheckPhone != null">is_check_phone,</if>
+		    <if test="isCheckAddress != null">is_check_address,</if>
  			create_time
  		)values(
  			<if test="roleId != null and roleId != 0">#{roleId},</if>
@@ -129,6 +131,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="remark != null and remark != ''">#{remark},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
  			<if test="isCheckPhone != null">#{isCheckPhone},</if>
+		   <if test="isCheckAddress != null">#{isCheckAddress},</if>
  			sysdate()
  		)
 	</insert>
@@ -146,6 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="remark != null">remark = #{remark},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  			<if test="isCheckPhone != null">is_check_phone = #{isCheckPhone},</if>
+ 		    <if test="isCheckAddress != null">is_check_address = #{isCheckAddress},</if>
  			update_time = sysdate()
  		</set>
  		where role_id = #{roleId}