Преглед изворни кода

Merge remote-tracking branch 'origin/master'

yfh пре 5 дана
родитељ
комит
e158725cb8
26 измењених фајлова са 765 додато и 35 уклоњено
  1. 2 1
      fs-admin/src/main/java/com/fs/his/controller/FsPackageOrderController.java
  2. 40 2
      fs-admin/src/main/java/com/fs/his/controller/FsStoreOrderController.java
  3. 28 0
      fs-admin/src/main/java/com/fs/his/controller/FsUserController.java
  4. 2 1
      fs-company/src/main/java/com/fs/company/controller/store/FsPackageOrderController.java
  5. 1 1
      fs-company/src/main/java/com/fs/company/controller/store/FsStoreOrderController.java
  6. 1 1
      fs-service/src/main/java/com/fs/aiTongueApi/config/AiTongueConfig.java
  7. 1 1
      fs-service/src/main/java/com/fs/course/service/impl/FsCourseFinishTempServiceImpl.java
  8. 1 2
      fs-service/src/main/java/com/fs/course/service/impl/FsUserWatchStatisticsServiceImpl.java
  9. 4 0
      fs-service/src/main/java/com/fs/his/config/StoreConfig.java
  10. 4 3
      fs-service/src/main/java/com/fs/his/domain/FsUser.java
  11. 6 1
      fs-service/src/main/java/com/fs/his/enums/FsStoreOrderLogEnum.java
  12. 5 0
      fs-service/src/main/java/com/fs/his/mapper/FsStoreOrderMapper.java
  13. 1 0
      fs-service/src/main/java/com/fs/his/param/FsStoreOrderSetErpPhoneParam.java
  14. 1 1
      fs-service/src/main/java/com/fs/his/service/IFsPackageOrderService.java
  15. 5 0
      fs-service/src/main/java/com/fs/his/service/IFsStoreOrderService.java
  16. 3 2
      fs-service/src/main/java/com/fs/his/service/impl/FsPackageOrderServiceImpl.java
  17. 2 0
      fs-service/src/main/java/com/fs/his/service/impl/FsStoreAfterSalesServiceImpl.java
  18. 18 1
      fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java
  19. 143 0
      fs-service/src/main/java/com/fs/his/utils/IdCardUtil.java
  20. 14 0
      fs-service/src/main/java/com/fs/his/vo/FsStoreOrderListAndStatisticsVo.java
  21. 1 1
      fs-service/src/main/resources/application-druid-jnmy-test.yml
  22. 9 6
      fs-service/src/main/resources/application-druid-jnmy.yml
  23. 392 0
      fs-service/src/main/resources/mapper/his/FsStoreOrderMapper.xml
  24. 1 0
      fs-store/src/main/java/com/fs/store/controller/store/FsStoreOrderController.java
  25. 78 9
      fs-user-app/src/main/java/com/fs/app/controller/PatientController.java
  26. 2 2
      fs-user-app/src/main/resources/application.yml

+ 2 - 1
fs-admin/src/main/java/com/fs/his/controller/FsPackageOrderController.java

@@ -193,7 +193,8 @@ public class FsPackageOrderController extends BaseController
     @GetMapping("storeRefund/{orderId}")
     public AjaxResult storeRefund(@PathVariable("orderId") Long orderId)
     {
-        return AjaxResult.success(fsPackageOrderService.PackageStoreOrderRefund(orderId));
+        String nickName = getLoginUser().getUser().getNickName();
+        return AjaxResult.success(fsPackageOrderService.PackageStoreOrderRefund(orderId,nickName));
     }
 
     /**

+ 40 - 2
fs-admin/src/main/java/com/fs/his/controller/FsStoreOrderController.java

@@ -1,9 +1,11 @@
 package com.fs.his.controller;
 
+import java.math.BigDecimal;
 import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 import cn.hutool.core.util.StrUtil;
@@ -35,6 +37,7 @@ import com.fs.his.domain.*;
 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.ShipperCodeEnum;
 import com.fs.his.param.FsFollowMsgParam;
 import com.fs.his.param.FsStoreOrderParam;
@@ -48,6 +51,7 @@ import com.fs.system.mapper.SysConfigMapper;
 import com.fs.system.service.ISysRoleService;
 import com.github.pagehelper.PageHelper;
 import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -120,11 +124,14 @@ public class FsStoreOrderController extends BaseController
 
     @Autowired
     private CloudHostProper cloudHostProper;
+
+    @Autowired
+    private IFsStoreOrderLogsService fsStoreOrderLogsService;
     /**
      * 查询订单列表
      */
     @PostMapping("/list")
-    public TableDataInfo list(@RequestBody FsStoreOrderParam fsStoreOrder)
+    public FsStoreOrderListAndStatisticsVo list(@RequestBody FsStoreOrderParam fsStoreOrder)
     {
         PageHelper.startPage(fsStoreOrder);
         if (fsStoreOrder.getUserPhoneMk()!=null&& !fsStoreOrder.getUserPhoneMk().isEmpty()){
@@ -151,7 +158,29 @@ public class FsStoreOrderController extends BaseController
             }
             dataTable.setMsg("jnmy");
         }
-        return dataTable;
+        FsStoreOrderListAndStatisticsVo vo = new FsStoreOrderListAndStatisticsVo();
+        BeanUtils.copyProperties(dataTable, vo);
+        if (dataTable.getTotal()>0){
+            Map<String,BigDecimal> statistics= fsStoreOrderService.selectFsStoreOrderStatistics(fsStoreOrder);
+            if (statistics != null && statistics.size() >= 3){
+                vo.setPayPriceTotal(statistics.get("pay_price").toString());
+                vo.setPayMoneyTotal(statistics.get("pay_money").toString());
+                vo.setPayRemainTotal(statistics.get("pay_remain").toString());
+            }else {
+                vo.setPayPriceTotal("0");
+                vo.setPayMoneyTotal("0");
+                vo.setPayRemainTotal("0");
+            }
+            //商品数量合计
+            String productStatistics= fsStoreOrderService.selectFsStoreOrderProductStatistics(fsStoreOrder);
+            if (StringUtils.isNotBlank(productStatistics)){
+                vo.setProductInfo(productStatistics);
+            } else {
+                vo.setProductInfo("");
+            }
+
+        }
+        return vo;
     }
 
     /**
@@ -598,6 +627,7 @@ public class FsStoreOrderController extends BaseController
     @PostMapping(value = "/batchCreateErpOrder")
     public R batchCreateErpOrder(@RequestBody FsStoreOrderSetErpPhoneParam param)
     {
+        String nickName = getLoginUser().getUser().getNickName();
         String loginAccount = param.getLoginAccount();
         if (StringUtils.isBlank(loginAccount)){
             return R.error("未选择推送erp账户");
@@ -629,8 +659,12 @@ public class FsStoreOrderController extends BaseController
                 FsStoreOrderDf temp = fsStoreOrderDfService.selectFsStoreOrderDfByOrderId(df.getOrderId());
                 if (temp == null){
                     fsStoreOrderDfService.insertFsStoreOrderDf(df);
+                    fsStoreOrderLogsService.create(orderId, FsStoreOrderLogEnum.SET_PUSH_ACCOUNT.getValue(),
+                            nickName + " " +FsStoreOrderLogEnum.SET_PUSH_ACCOUNT.getDesc() + ":" + df.getLoginAccount());
                 }
                 fsStoreOrderService.createOmsOrder(orderId);
+                fsStoreOrderLogsService.create(orderId, FsStoreOrderLogEnum.PUSH_ORDER_ERP.getValue(),
+                        nickName + " " +FsStoreOrderLogEnum.PUSH_ORDER_ERP.getDesc() + ":" + df.getLoginAccount());
             } catch (ParseException e) {
                 throw new RuntimeException(e);
             }
@@ -645,6 +679,7 @@ public class FsStoreOrderController extends BaseController
     @PostMapping(value = "/batchSetErpOrder")
     public R batchSetErpOrder(@RequestBody FsStoreOrderSetErpPhoneParam param)
     {
+        String nickName = getLoginUser().getUser().getNickName();
         String loginAccount = param.getLoginAccount();
         if (StringUtils.isBlank(loginAccount)){
             return R.error("未选择erp账户");
@@ -673,6 +708,8 @@ public class FsStoreOrderController extends BaseController
             } else {
                 fsStoreOrderDfService.insertFsStoreOrderDf(df);
             }
+            fsStoreOrderLogsService.create(orderId, FsStoreOrderLogEnum.SET_PUSH_ACCOUNT.getValue(),
+                    nickName + " " +FsStoreOrderLogEnum.SET_PUSH_ACCOUNT.getDesc() + ":" + df.getLoginAccount());
         });
         return R.ok();
     }
@@ -855,6 +892,7 @@ public class FsStoreOrderController extends BaseController
     @PostMapping("/editErpPhone")
     public AjaxResult editErpPhone(@RequestBody FsStoreOrderSetErpPhoneParam param)
     {
+        param.setOpeName(getLoginUser().getUser().getNickName());
         List<String> erpPhone = param.getErpPhone();
         if (erpPhone == null || erpPhone.isEmpty()) {
             return AjaxResult.error("请选择手机号");

+ 28 - 0
fs-admin/src/main/java/com/fs/his/controller/FsUserController.java

@@ -162,6 +162,34 @@ public class FsUserController extends BaseController
         return getDataTable(list);
     }
 
+    @PreAuthorize("@ss.hasPermi('his:user:export')")
+    @GetMapping("/exportListProject")
+    public AjaxResult exportListProject(FsUser fsUser)
+    {
+        if(StringUtils.isNotEmpty(fsUser.getPhone())){
+            fsUser.setPhone(encryptPhone(fsUser.getPhone()));
+        }
+        List<FsUserVO> list = fsUserService.selectFsUserVOListByProject(fsUser);
+        boolean checkPhone = isCheckPhone();
+        for (FsUserVO fsUserVO : list) {
+            if(fsUserVO.getPhone() != null&&fsUserVO.getPhone()!=""){
+                if (!checkPhone){
+                    if (fsUserVO.getPhone().length()>11){
+                        fsUserVO.setPhone(decryptPhoneMk(fsUserVO.getPhone()));
+                    }else {
+                        fsUserVO.setPhone(fsUserVO.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                    }
+                } else {
+                    if (fsUserVO.getPhone().length()>11) {
+                        fsUserVO.setPhone(decryptPhone(fsUserVO.getPhone()));
+                    }
+                }
+            }
+        }
+        ExcelUtil<FsUserVO> util = new ExcelUtil<FsUserVO>(FsUserVO.class);
+        return util.exportExcel(list, "项目会员数据");
+    }
+
     /**
      * 导出用户列表
      */

+ 2 - 1
fs-company/src/main/java/com/fs/company/controller/store/FsPackageOrderController.java

@@ -235,7 +235,8 @@ public class FsPackageOrderController extends BaseController
     @GetMapping("storeRefund/{orderId}")
     public AjaxResult storeRefund(@PathVariable("orderId") Long orderId)
     {
-        return AjaxResult.success(fsPackageOrderService.PackageStoreOrderRefund(orderId));
+        String nickName = getLoginUser().getUser().getNickName();
+        return AjaxResult.success(fsPackageOrderService.PackageStoreOrderRefund(orderId,nickName));
     }
 
 

+ 1 - 1
fs-company/src/main/java/com/fs/company/controller/store/FsStoreOrderController.java

@@ -390,7 +390,7 @@ public class FsStoreOrderController extends BaseController
         }
         LoginUser loginUser = SecurityUtils.getLoginUser();
         fsStoreOrder.setCompanyId(loginUser.getCompany().getCompanyId());
-        fsStoreOrder.setOperator(loginUser.getUser().getNickName());
+        fsStoreOrder.setOperator("销售端:" + loginUser.getUser().getNickName());
         return toAjax(fsStoreOrderService.afterSales(fsStoreOrder));
     }
 

+ 1 - 1
fs-service/src/main/java/com/fs/aiTongueApi/config/AiTongueConfig.java

@@ -4,7 +4,7 @@ public interface AiTongueConfig {
     String getFaceHistoryByIDUrl="https://api.aikanshe.com/agency/getHistoryByID";
     String quanxiUrl="https://api.aikanshe.com/agency/quanxi";
     String checkTongue="https://api.aikanshe.com/agency/checkTongue";
-    String appKey="";
+    String appKey="i5h5u6g59dw9x0o6yymd3tf5ea6gcdqi";
 
     String newCheckTongue="http://132.232.234.246:5056/api/detect";
 }

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

@@ -349,7 +349,7 @@ public class FsCourseFinishTempServiceImpl implements IFsCourseFinishTempService
 
                         break;
                     } else {
-                        if (attempt==2 && (qwResult.getErrcode() == 45033 || qwResult.getErrcode()== -1)) {
+                        if (attempt==2 && (qwResult.getErrcode() == 45033 || qwResult.getErrcode()== -1 || qwResult.getErrcode()== 60020)) {
                             QwCourseFinishRemarkRty remarkRty=new QwCourseFinishRemarkRty();
                             remarkRty.setQwUserId(externalContact.getUserId());
                             remarkRty.setCorpId(externalContact.getCorpId());

+ 1 - 2
fs-service/src/main/java/com/fs/course/service/impl/FsUserWatchStatisticsServiceImpl.java

@@ -141,9 +141,8 @@ public class FsUserWatchStatisticsServiceImpl extends ServiceImpl<FsUserWatchSta
         //获取公司的会员数量和今日新增会员数量
         List<FsUserWatchStatistics> userTotal = fsUserMapper.selectFsUserTotal();
         Map<String, FsUserWatchStatistics> userTotalMap;
-        if (userTotal != null && userTotal.size() > 0) {
+        if (userTotal != null && !userTotal.isEmpty()) {
             userTotalMap = userTotal.stream().collect(Collectors.toMap(FsUserWatchStatistics::getCompanyId, Function.identity()));
-
         } else {
             userTotalMap = null;
         }

+ 4 - 0
fs-service/src/main/java/com/fs/his/config/StoreConfig.java

@@ -18,5 +18,9 @@ public class StoreConfig implements Serializable {
     private String refundPhoneNumber;
     private String refundAddress;
     private Integer storeCall;
+    private Integer isIdVerification; //1开启三方身份认证 0不开启
+    private String API_URL;
+    private String HASHCODE;
+    private String SECRET_KEY;
 
 }

+ 4 - 3
fs-service/src/main/java/com/fs/his/domain/FsUser.java

@@ -22,6 +22,7 @@ public class FsUser extends BaseEntity
     private static final long serialVersionUID = 1L;
 
     /** 用户id */
+    @Excel(name = "ID", sort = 0)
     private Long userId;
     private String username;
     private String password;
@@ -35,7 +36,7 @@ public class FsUser extends BaseEntity
     private String nickName;
 
     /** 用户头像 */
-    @Excel(name = "用户头像")
+//    @Excel(name = "用户头像")
     private String avatar;
     private String remark;
 
@@ -73,11 +74,11 @@ public class FsUser extends BaseEntity
     private Long tuiUserCount;
 
     /** 微信小程序OPENID */
-    @Excel(name = "微信小程序OPENID")
+//    @Excel(name = "微信小程序OPENID")
     private String maOpenId;
 
     /** 微信公众号OPENID */
-    @Excel(name = "微信公众号OPENID")
+//    @Excel(name = "微信公众号OPENID")
     private String mpOpenId;
 
     /** 关联ID */

+ 6 - 1
fs-service/src/main/java/com/fs/his/enums/FsStoreOrderLogEnum.java

@@ -13,6 +13,7 @@ public enum FsStoreOrderLogEnum {
     REMOVE_ORDER("remove_order","删除订单"),
     EVAL_ORDER("order_eval","用户评价"),
     REFUND_ORDER_APPLY("apply_refund","用户申请退款"),
+    REFUND_ORDER_PLATFORM("REFUND_ORDER_PLATFORM","平台申请退款"),
     REFUND_ORDER_DF("refund_order_df","代服取消订单,申请退款"),
     TAKE_ORDER_DELIVERY("user_take_delivery","用户已收货"),
     PAY_ORDER_SUCCESS("pay_success","用户付款成功"),
@@ -30,7 +31,11 @@ public enum FsStoreOrderLogEnum {
     PLATFORM_REVIEW_SALES("PLATFORM_REVIEW_SALES","平台已审核"),
     WAREHOUSE_REVIEW_SALES("WAREHOUSE_REVIEW_SALES","仓库已审核"),
     FINANCE_REVIEW_SALES("FINANCE_REVIEW_SALES","财务已审核"),
-    PLATFORM_REVIEW_CANCEL("PLATFORM_REVIEW_CANCEL","平台已取消售后");
+    PLATFORM_REVIEW_CANCEL("PLATFORM_REVIEW_CANCEL","平台已取消售后"),
+
+    SET_PUSH_MOBILE("SET_PUSH_MOBILE","设置推送手机号"),
+    SET_PUSH_ACCOUNT("SET_PUSH_ACCOUNT","数据分拣"),
+    PUSH_ORDER_ERP("PUSH_ORDER_ERP","创建ERP");
     private String value;
     private String desc;
 

+ 5 - 0
fs-service/src/main/java/com/fs/his/mapper/FsStoreOrderMapper.java

@@ -1,5 +1,6 @@
 package com.fs.his.mapper;
 
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.Map;
 
@@ -1166,6 +1167,10 @@ public interface FsStoreOrderMapper
 
     List<FsStoreOrderErpExportVO> selectFsStoreOrderListErpVOByExport(@Param("maps")FsStoreOrderParam fsStoreOrder);
 
+    Map<String,BigDecimal> selectFsStoreOrderStatistics(@Param("maps") FsStoreOrderParam fsStoreOrder);
+
+    String selectFsStoreOrderProductStatistics(@Param("maps")FsStoreOrderParam fsStoreOrder);
+
 
     List<Report> selectOrderByCustomerIds(@Param("map") ReportParam param);
 }

+ 1 - 0
fs-service/src/main/java/com/fs/his/param/FsStoreOrderSetErpPhoneParam.java

@@ -9,4 +9,5 @@ public class FsStoreOrderSetErpPhoneParam extends FsStoreOrderParam{
     private List<String> erpPhone;
     private List<Long> orderIds;
     private String loginAccount;
+    private String opeName; //操作人
 }

+ 1 - 1
fs-service/src/main/java/com/fs/his/service/IFsPackageOrderService.java

@@ -94,7 +94,7 @@ public interface IFsPackageOrderService
 
     Integer PackageInquiryOrderRefund(Long orderId);
 
-    Integer PackageStoreOrderRefund(Long orderId);
+    Integer PackageStoreOrderRefund(Long orderId,String opeName);
 
     R payment(FsPackageOrderDoPayParam param);
 

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

@@ -1,5 +1,6 @@
 package com.fs.his.service;
 
+import java.math.BigDecimal;
 import java.text.ParseException;
 import java.util.List;
 import java.util.Map;
@@ -260,4 +261,8 @@ public interface IFsStoreOrderService
     String importOrderStatusData(List<FsStoreOrderStatusExcelVO> list);
 
     Long selectFsStoreOrderListVOByErpAccountByExportCount(FsStoreOrderParam param);
+
+    Map<String,BigDecimal> selectFsStoreOrderStatistics(FsStoreOrderParam fsStoreOrder);
+
+    String selectFsStoreOrderProductStatistics(FsStoreOrderParam fsStoreOrder);
 }

+ 3 - 2
fs-service/src/main/java/com/fs/his/service/impl/FsPackageOrderServiceImpl.java

@@ -846,7 +846,7 @@ public class FsPackageOrderServiceImpl implements IFsPackageOrderService
     }
 
     @Override
-    public Integer PackageStoreOrderRefund(Long orderId) {
+    public Integer PackageStoreOrderRefund(Long orderId,String opeName) {
         FsPackageOrder fsPackageOrder = fsPackageOrderMapper.selectFsPackageOrderByOrderId(orderId);
         if (fsPackageOrder.getStatus()!=2&&fsPackageOrder.getStatus()!=3){
             throw  new CustomException("非法操作");
@@ -857,6 +857,7 @@ public class FsPackageOrderServiceImpl implements IFsPackageOrderService
         }
         FsStoreOrderSalesParam fsStoreOrderSalesParam = new FsStoreOrderSalesParam();
         fsStoreOrderSalesParam.setOrderId(fsPackageOrder.getStoreOrderId());
+        fsStoreOrderSalesParam.setOperator(opeName);
         return fsStoreOrderService.afterSales(fsStoreOrderSalesParam);
     }
 
@@ -1029,7 +1030,7 @@ public class FsPackageOrderServiceImpl implements IFsPackageOrderService
             }
         }
         else{
-            return R.error("用户OPENID不存在");
+            return R.error(401,"用户OPENID不存在"); //触发前端重新登录
         }
         return R.error();
     }

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

@@ -719,6 +719,8 @@ public class FsStoreAfterSalesServiceImpl implements IFsStoreAfterSalesService {
         logs.setStoreAfterSalesId(storeAfterSales.getId());
         logs.setChangeMessage(FsStoreAfterSalesStatusEnum.STATUS_0.getDesc());
         fsStoreAfterSalesLogsMapper.insertFsStoreAfterSalesLogs(logs);
+        fsStoreOrderLogsService.create(order.getOrderId(), FsStoreOrderLogEnum.REFUND_ORDER_APPLY.getValue(),
+                FsStoreOrderLogEnum.REFUND_ORDER_APPLY.getDesc());
         if (order.getExtendOrderId() != null) {
             ErpRefundUpdateRequest request = new ErpRefundUpdateRequest();
             request.setTid(order.getOrderCode());

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

@@ -1606,6 +1606,9 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
         logs.setCompanyId(fsStoreOrderSalesParam.getCompanyId());
         logs.setChangeMessage("平台提交售后");
         fsStoreAfterSalesLogsMapper.insertFsStoreAfterSalesLogs(logs);
+        //添加订单日志
+        fsStoreOrderLogsService.create(order.getOrderId(), FsStoreOrderLogEnum.REFUND_ORDER_PLATFORM.getValue(),
+                fsStoreOrderSalesParam.getOperator() + " " +FsStoreOrderLogEnum.REFUND_ORDER_PLATFORM.getDesc());
         //判断是否开启erp
         FsSysConfig sysConfig = configUtil.getSysConfig();
         Integer erpOpen = sysConfig.getErpOpen();
@@ -2311,7 +2314,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
             order.setStatus(4);
             fsStoreOrderMapper.updateFsStoreOrder(order);
             fsStoreOrderLogsService.create(order.getOrderId(), FsStoreOrderLogEnum.FINISH_ORDER.getValue(),
-                    FsStoreOrderLogEnum.FINISH_ORDER.getDesc());
+                    "用户"+FsStoreOrderLogEnum.FINISH_ORDER.getDesc());
             return R.ok("操作成功");
         } else {
             return R.error("非法操作");
@@ -3290,6 +3293,8 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
                 map.put("orderId", orderIds.get(i).toString());
                 map.put("erpPhone", erpPhones.get(i));
                 maps.add(map);
+                fsStoreOrderLogsService.create(orderIds.get(i), FsStoreOrderLogEnum.SET_PUSH_MOBILE.getValue(),
+                        param.getOpeName() + " " +FsStoreOrderLogEnum.SET_PUSH_MOBILE.getDesc() + ":" + erpPhones.get(i));
             }
         } else {
             //2.手机号小于orderIds长度
@@ -3309,6 +3314,8 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
                     map.put("erpPhone", erpPhone);
                     maps.add(map);
                     orderIndex++;
+                    fsStoreOrderLogsService.create(orderIds.get(i), FsStoreOrderLogEnum.SET_PUSH_MOBILE.getValue(),
+                            param.getOpeName() + " " +FsStoreOrderLogEnum.SET_PUSH_MOBILE.getDesc() + ":" + erpPhone);
                 }
             }
         }
@@ -3688,4 +3695,14 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
         return fsStoreOrderMapper.selectFsStoreOrderListVOByErpAccountByExportCount(param);
     }
 
+    @Override
+    public Map<String,BigDecimal> selectFsStoreOrderStatistics(FsStoreOrderParam fsStoreOrder) {
+        return fsStoreOrderMapper.selectFsStoreOrderStatistics(fsStoreOrder);
+    }
+
+    @Override
+    public String selectFsStoreOrderProductStatistics(FsStoreOrderParam fsStoreOrder) {
+        return fsStoreOrderMapper.selectFsStoreOrderProductStatistics(fsStoreOrder);
+    }
+
 }

+ 143 - 0
fs-service/src/main/java/com/fs/his/utils/IdCardUtil.java

@@ -0,0 +1,143 @@
+package com.fs.his.utils;
+
+import cn.hutool.crypto.digest.DigestUtil;
+import cn.hutool.http.HttpRequest;
+import cn.hutool.http.HttpResponse;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fs.common.utils.DateUtils;
+import com.fs.common.utils.StringUtils;
+import com.fs.his.config.StoreConfig;
+import com.fs.system.service.ISysConfigService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.nio.charset.StandardCharsets;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * 三方身份验证
+ */
+@Service
+public class IdCardUtil {
+    @Autowired
+    private static ISysConfigService configService;
+
+    /**
+     * 身份证信息隐藏 中间
+     * @param idCard   身份证信息
+     * @return  隐藏后信息
+     */
+    public static String hiddenIdCard(String idCard) {
+        if (StringUtils.isBlank(idCard)) {
+            return idCard;
+        }
+
+        return idCard.replaceAll("(\\d{4})\\d{10}(\\w{4})", "$1**********$2");
+    }
+
+    private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
+
+
+    private static String generateSign(String hashcode, String passname, String pid, String mobile,String secretKey) {
+        String date = new SimpleDateFormat("yyyyMMdd").format(new Date());
+        String raw = null;
+        if (StringUtils.isNotBlank(mobile)){
+            raw = hashcode + mobile + passname + secretKey + date;
+        } else {
+            raw = hashcode + passname + pid + secretKey + date;
+        }
+        return DigestUtil.md5Hex(raw.getBytes(StandardCharsets.UTF_8));
+    }
+
+    /**
+     * 检查身份证与姓名是否匹配
+     *
+     * @param passname 姓名
+     * @param pid      身份证号
+     * @return true 表示一致,false 表示不一致
+     */
+    public static boolean isMatchById(StoreConfig storeConfig,String passname, String pid) {
+        if (storeConfig == null) {
+            return false;
+        }
+        String API_URL = storeConfig.getAPI_URL() + "/HrmApi/Idverify";
+        String HASHCODE = storeConfig.getHASHCODE();
+        String SECRET_KEY = storeConfig.getSECRET_KEY();
+        try {
+            String sign = generateSign(HASHCODE, passname, pid,null, SECRET_KEY);
+            String bodyJson = String.format(
+                    "{\"passname\":\"%s\",\"pid\":\"%s\",\"hashcode\":\"%s\",\"sign\":\"%s\"}",
+                    passname, pid, HASHCODE, sign
+            );
+
+            HttpResponse response = HttpRequest.post(API_URL)
+                    .body(bodyJson)
+                    .header("Content-Type", "application/json;charset=UTF-8")
+                    .timeout(5000)
+                    .execute();
+
+            if (response.getStatus() != 200) {
+                throw new RuntimeException("HTTP请求失败,状态码:" + response.getStatus());
+            }
+
+            JsonNode root = OBJECT_MAPPER.readTree(response.body());
+            JsonNode errorRes = root.get("errorRes");
+            String errTransCode = root.get("err_TransCode").asText();
+            System.out.println(DateUtils.getNowDate());
+            System.out.println("流水号"+errTransCode);
+            if (errorRes != null && "200".equals(errorRes.get("err_code").asText())) {
+                return true; // 一致
+            }
+            return false; // 不一致或接口异常
+        } catch (Exception e) {
+            throw new RuntimeException("匹配请求异常", e);
+        }
+    }
+
+    /**
+     * 检查身份证与姓名是否匹配
+     *
+     * @param passname 姓名
+     * @param mobile      身份证号
+     * @return true 表示一致,false 表示不一致
+     */
+    public static boolean isMatchByMobile(StoreConfig storeConfig,String passname, String mobile) {
+        if (storeConfig == null) {
+            return false;
+        }
+        String API_URL = storeConfig.getAPI_URL() + "/HrmApi/mobile2everify";
+        String HASHCODE = storeConfig.getHASHCODE();
+        String SECRET_KEY = storeConfig.getSECRET_KEY();
+        try {
+            String sign = generateSign(HASHCODE, passname, null,mobile, SECRET_KEY);
+            String bodyJson = String.format(
+                    "{\"passname\":\"%s\",\"mobile\":\"%s\",\"hashcode\":\"%s\",\"sign\":\"%s\"}",
+                    passname, mobile, HASHCODE, sign
+            );
+
+            HttpResponse response = HttpRequest.post(API_URL)
+                    .body(bodyJson)
+                    .header("Content-Type", "application/json;charset=UTF-8")
+                    .timeout(5000)
+                    .execute();
+
+            if (response.getStatus() != 200) {
+                throw new RuntimeException("HTTP请求失败,状态码:" + response.getStatus());
+            }
+
+            JsonNode root = OBJECT_MAPPER.readTree(response.body());
+            JsonNode errorRes = root.get("errorRes");
+            String errTransCode = root.get("err_TransCode").asText();
+            System.out.println(DateUtils.getNowDate());
+            System.out.println("流水号"+errTransCode);
+            if (errorRes != null && "200".equals(errorRes.get("err_code").asText())) {
+                return true; // 一致
+            }
+            return false; // 不一致或接口异常
+        } catch (Exception e) {
+            throw new RuntimeException("匹配请求异常", e);
+        }
+    }
+}

+ 14 - 0
fs-service/src/main/java/com/fs/his/vo/FsStoreOrderListAndStatisticsVo.java

@@ -0,0 +1,14 @@
+package com.fs.his.vo;
+
+import com.fs.common.core.page.TableDataInfo;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class FsStoreOrderListAndStatisticsVo extends TableDataInfo{
+    private String payPriceTotal;
+    private String payMoneyTotal;
+    private String payRemainTotal;
+    private String productInfo;
+}

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

@@ -41,7 +41,7 @@ spring:
             druid:
                 # 主库数据源
                 master:
-                    url: jdbc:mysql://120.46.174.121:2345/fs_his?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                    url: jdbc:mysql://120.46.174.121:2345/fs_his_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                     username: root
                     password: Ylrztek250218!3@.
                 # 从库数据源

+ 9 - 6
fs-service/src/main/resources/application-druid-jnmy.yml

@@ -139,15 +139,18 @@ spring:
                         config:
                             multi-statement-allow: true
 rocketmq:
-    name-server: rmq-1243b25nj.rocketmq.gz.public.tencenttdmq.com:8080 # RocketMQ NameServer 地址
+    name-server: 192.168.0.176:8100 # RocketMQ NameServer 地址
     producer:
         group: my-producer-group
-        access-key: ak1243b25nj17d4b2dc1a03 # 替换为实际的 accessKey
-        secret-key: sk08a7ea1f9f4b0237 # 替换为实际的 secretKey
+        access-key: jnmyunl # 替换为实际的 accessKey
+        secret-key: 73a!ul~xQl@-6u1 # 替换为实际的 secretKey
+        tls-enable: false
     consumer:
-        group: test-group
-        access-key: ak1243b25nj17d4b2dc1a03 # 替换为实际的 accessKey
-        secret-key: sk08a7ea1f9f4b0237 # 替换为实际的 secretKey
+        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

+ 392 - 0
fs-service/src/main/resources/mapper/his/FsStoreOrderMapper.xml

@@ -1598,6 +1598,398 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LIMIT 30000
 
 
+    </select>
+    <select id="selectFsStoreOrderStatistics" resultType="java.util.Map">
+        select sum(so.pay_price) pay_price,sum(so.pay_money) pay_money,sum(so.pay_remain) pay_remain
+        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_user cu on cu.user_id=so.company_user_id
+        LEFT JOIN fs_store_order_df df on df.order_id=so.order_id
+        <where>
+            <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>
+            <if test="maps.orderCodes != null  and maps.orderCodes.size > 0">
+                and so.order_code in
+                <foreach collection="maps.orderCodes" item="orderCode" open="(" close=")" separator=",">
+                    #{orderCode}
+                </foreach>
+            </if>
+            <if test="maps.orderCode != null  and maps.orderCode != ''">
+                and so.order_code = #{maps.orderCode}
+            </if>
+            <if test="maps.prescribeCode != null  and maps.prescribeCode != ''">
+                and p.prescribe_code = #{maps.prescribeCode}
+            </if>
+            <if test="maps.userName != null  and maps.userName != ''">
+                and so.user_name like concat('%', #{maps.userName}, '%')
+            </if>
+            <if test="maps.userPhone != null  and maps.userPhone != ''">
+                and so.user_phone = #{maps.userPhone}
+            </if>
+            <if test="maps.userId != null ">
+                and so.user_id = #{maps.userId}
+            </if>
+            <if test="maps.isFirst != null">
+                and so.is_first = #{maps.isFirst}
+            </if>
+            <if test="maps.status != null and maps.status != 6">
+                and so.status = #{maps.status}
+            </if>
+            <if test="maps.status == 6">
+                and so.`status`= 2
+                and (
+                so.store_id in (select store_id from fs_store where delivery_type=2 or delivery_type=1)
+                )
+                and  (so.extend_order_id is null or  so.extend_order_id like '')
+            </if>
+            <if test="maps.source != null">
+                and so.source = #{maps.source}
+            </if>
+            <if test="maps.deliverySn != null  and maps.deliverySn != ''">
+                and so.delivery_sn = #{maps.deliverySn}
+            </if>
+            <if test="maps.prescribeId != null">
+                and so.prescribe_id = #{maps.prescribeId}
+            </if>
+            <if test="maps.companyUserId != null">
+                and so.company_user_id = #{maps.companyUserId}
+            </if>
+            <if test="maps.sTime != null">
+                and DATE(so.create_time) &gt;= DATE(#{maps.sTime})
+            </if>
+            <if test="maps.eTime != null">
+                and DATE(so.create_time) &lt;= DATE(#{maps.eTime})
+            </if>
+            <if test="maps.paysTime != null">
+                and DATE(so.pay_time) &gt;= DATE(#{maps.paysTime})
+            </if>
+            <if test="maps.payeTime != null">
+                and DATE(so.pay_time) &lt;= DATE(#{maps.payeTime})
+            </if>
+            <if test="maps.orderCreateType != null">
+                and so.order_create_type = #{maps.orderCreateType}
+            </if>
+            <if test="maps.patientName != null">
+                and p.patient_name like concat('%', #{maps.patientName}, '%')
+            </if>
+            <if test="maps.doctorName != null">
+                and d.doctor_name like concat('%', #{maps.doctorName}, '%')
+            </if>
+            <if test="maps.orderType != null">
+                and so.order_type = #{maps.orderType}
+            </if>
+            <if test="maps.deliverySendsTime != null">
+                and DATE(so.delivery_send_time) &gt;= DATE(#{maps.deliverySendsTime})
+            </if>
+            <if test="maps.deliverySendeTime != null">
+                and DATE(so.delivery_send_time) &lt;= DATE(#{maps.deliverySendeTime})
+            </if>
+            <if test="maps.deliveryImportsTime != null">
+                and DATE(so.delivery_import_time) &gt;= DATE(#{maps.deliveryImportsTime})
+            </if>
+            <if test="maps.deliveryImporteTime != null">
+                and DATE(so.delivery_import_time) &lt;= DATE(#{maps.deliveryImporteTime})
+            </if>
+            <if test="maps.tuisTime != null">
+                and DATE(so.tui_money_time) &gt;= DATE(#{maps.tuisTime})
+            </if>
+            <if test="maps.tuieTime != null">
+                and DATE(so.tui_money_time) &lt;= DATE(#{maps.tuieTime})
+            </if>
+            <if test="maps.companyUserNickName != null and  maps.companyUserNickName !=''">
+                and cu.nick_name like concat( #{maps.companyUserNickName}, '%')
+            </if>
+            <if test="maps.companyIds != null and  maps.companyIds.size >0">
+                and so.company_id in
+                <foreach collection="maps.companyIds" item="companyId" open="(" close=")" separator=",">
+                    #{companyId}
+                </foreach>
+            </if>
+            <if test="maps.companyId != null and  maps.companyId != -1">
+                and so.company_id =#{maps.companyId}
+            </if>
+            <if test="maps.companyId == -1">
+                and so.company_id is null
+            </if>
+            <if test="maps.deliveryStatus != null">
+                and so.delivery_status =#{maps.deliveryStatus}
+            </if>
+            <if test="maps.customerId != null">
+                and so.customer_id =#{maps.customerId}
+            </if>
+            <if test="maps.deliveryPayStatus != null">
+                and so.delivery_pay_status =#{maps.deliveryPayStatus}
+            </if>
+            <if test="maps.tuiMoneyStatus != null">
+                and so.tui_money_status =#{maps.tuiMoneyStatus}
+            </if>
+            <if test="maps.deptId != null">
+                AND (so.dept_id = #{maps.deptId} OR so.dept_id IN ( SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors) ))
+            </if>
+            <if test="maps.packageName != null and maps.packageName != ''">
+                and so.package_name like concat('%', #{maps.packageName}, '%')
+            </if>
+            <if test="maps.payType != null">
+                and so.pay_type IN
+                <foreach collection="maps.payType.split(',')" item="item" index="index" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="maps.scheduleId != null  and  maps.scheduleId != -1">
+                and so.schedule_id IN
+                <foreach collection="maps.scheduleId.split(',')" item="item" index="index" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="maps.scheduleId == -1">
+                and so.schedule_id is null
+            </if>
+            <if test="maps.orderBuyType != null and maps.orderBuyType != -1">
+                and so.order_buy_type IN
+                <foreach collection="maps.orderBuyType.split(',')" item="item" index="index" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="maps.orderBuyType == -1">
+                and so.order_buy_type is null
+            </if>
+            <if test="maps.orderChannel == -1">
+                and so.order_channel is null
+            </if>
+            <if test="maps.orderChannel != null and maps.orderChannel != -1">
+                and so.order_channel IN
+                <foreach collection="maps.orderChannel.split(',')" item="item" index="index" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="maps.qwSubject == -1">
+                and so.qw_subject is null
+            </if>
+            <if test="maps.qwSubject != null and maps.qwSubject != -1">
+                and so.qw_subject IN
+                <foreach collection="maps.qwSubject.split(',')" item="item" index="index" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="maps.erpPhoneNumber != null and maps.erpPhoneNumber != ''">
+                and so.erp_phone like concat(#{maps.erpPhoneNumber},'%')
+            </if>
+            <if test="maps.erpAccount != null and maps.erpAccount != '未分拣' and maps.erpAccount != ''">
+                and df.login_account like #{maps.erpAccount}
+            </if>
+            <if test="maps.erpAccount == '未分拣'">
+                and ( df.login_account is null or df.login_account like '')
+            </if>
+
+        </where>
+        ${maps.params.dataScope}
+    </select>
+    <select id="selectFsStoreOrderProductStatistics" resultType="java.lang.String">
+        SELECT GROUP_CONCAT(
+        CONCAT(product_name, ':', product_num)
+        ORDER BY product_name
+        SEPARATOR '   '
+        ) AS product_num_list
+        FROM (
+        SELECT sp.product_name,SUM(IF(soi.num IS NULL,0,soi.num)) product_num FROM fs_store_product sp
+        INNER JOIN fs_store_order_item soi ON soi.product_id = sp.product_id
+        INNER JOIN fs_store_order so ON soi.order_id = so.order_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_user cu on cu.user_id=so.company_user_id
+        LEFT JOIN fs_store_order_df df on df.order_id=so.order_id
+        <where>
+            <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>
+            <if test="maps.orderCodes != null  and maps.orderCodes.size > 0">
+                and so.order_code in
+                <foreach collection="maps.orderCodes" item="orderCode" open="(" close=")" separator=",">
+                    #{orderCode}
+                </foreach>
+            </if>
+            <if test="maps.orderCode != null  and maps.orderCode != ''">
+                and so.order_code = #{maps.orderCode}
+            </if>
+            <if test="maps.prescribeCode != null  and maps.prescribeCode != ''">
+                and p.prescribe_code = #{maps.prescribeCode}
+            </if>
+            <if test="maps.userName != null  and maps.userName != ''">
+                and so.user_name like concat('%', #{maps.userName}, '%')
+            </if>
+            <if test="maps.userPhone != null  and maps.userPhone != ''">
+                and so.user_phone = #{maps.userPhone}
+            </if>
+            <if test="maps.userId != null ">
+                and so.user_id = #{maps.userId}
+            </if>
+            <if test="maps.isFirst != null">
+                and so.is_first = #{maps.isFirst}
+            </if>
+            <if test="maps.status != null and maps.status != 6">
+                and so.status = #{maps.status}
+            </if>
+            <if test="maps.status == 6">
+                and so.`status`= 2
+                and (
+                so.store_id in (select store_id from fs_store where delivery_type=2 or delivery_type=1)
+                )
+                and  (so.extend_order_id is null or  so.extend_order_id like '')
+            </if>
+            <if test="maps.source != null">
+                and so.source = #{maps.source}
+            </if>
+            <if test="maps.deliverySn != null  and maps.deliverySn != ''">
+                and so.delivery_sn = #{maps.deliverySn}
+            </if>
+            <if test="maps.prescribeId != null">
+                and so.prescribe_id = #{maps.prescribeId}
+            </if>
+            <if test="maps.companyUserId != null">
+                and so.company_user_id = #{maps.companyUserId}
+            </if>
+            <if test="maps.sTime != null">
+                and DATE(so.create_time) &gt;= DATE(#{maps.sTime})
+            </if>
+            <if test="maps.eTime != null">
+                and DATE(so.create_time) &lt;= DATE(#{maps.eTime})
+            </if>
+            <if test="maps.paysTime != null">
+                and DATE(so.pay_time) &gt;= DATE(#{maps.paysTime})
+            </if>
+            <if test="maps.payeTime != null">
+                and DATE(so.pay_time) &lt;= DATE(#{maps.payeTime})
+            </if>
+            <if test="maps.orderCreateType != null">
+                and so.order_create_type = #{maps.orderCreateType}
+            </if>
+            <if test="maps.patientName != null">
+                and p.patient_name like concat('%', #{maps.patientName}, '%')
+            </if>
+            <if test="maps.doctorName != null">
+                and d.doctor_name like concat('%', #{maps.doctorName}, '%')
+            </if>
+            <if test="maps.orderType != null">
+                and so.order_type = #{maps.orderType}
+            </if>
+            <if test="maps.deliverySendsTime != null">
+                and DATE(so.delivery_send_time) &gt;= DATE(#{maps.deliverySendsTime})
+            </if>
+            <if test="maps.deliverySendeTime != null">
+                and DATE(so.delivery_send_time) &lt;= DATE(#{maps.deliverySendeTime})
+            </if>
+            <if test="maps.deliveryImportsTime != null">
+                and DATE(so.delivery_import_time) &gt;= DATE(#{maps.deliveryImportsTime})
+            </if>
+            <if test="maps.deliveryImporteTime != null">
+                and DATE(so.delivery_import_time) &lt;= DATE(#{maps.deliveryImporteTime})
+            </if>
+            <if test="maps.tuisTime != null">
+                and DATE(so.tui_money_time) &gt;= DATE(#{maps.tuisTime})
+            </if>
+            <if test="maps.tuieTime != null">
+                and DATE(so.tui_money_time) &lt;= DATE(#{maps.tuieTime})
+            </if>
+            <if test="maps.companyUserNickName != null and  maps.companyUserNickName !=''">
+                and cu.nick_name like concat( #{maps.companyUserNickName}, '%')
+            </if>
+            <if test="maps.companyIds != null and  maps.companyIds.size >0">
+                and so.company_id in
+                <foreach collection="maps.companyIds" item="companyId" open="(" close=")" separator=",">
+                    #{companyId}
+                </foreach>
+            </if>
+            <if test="maps.companyId != null and  maps.companyId != -1">
+                and so.company_id =#{maps.companyId}
+            </if>
+            <if test="maps.companyId == -1">
+                and so.company_id is null
+            </if>
+            <if test="maps.deliveryStatus != null">
+                and so.delivery_status =#{maps.deliveryStatus}
+            </if>
+            <if test="maps.customerId != null">
+                and so.customer_id =#{maps.customerId}
+            </if>
+            <if test="maps.deliveryPayStatus != null">
+                and so.delivery_pay_status =#{maps.deliveryPayStatus}
+            </if>
+            <if test="maps.tuiMoneyStatus != null">
+                and so.tui_money_status =#{maps.tuiMoneyStatus}
+            </if>
+            <if test="maps.deptId != null">
+                AND (so.dept_id = #{maps.deptId} OR so.dept_id IN ( SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors) ))
+            </if>
+            <if test="maps.packageName != null and maps.packageName != ''">
+                and so.package_name like concat('%', #{maps.packageName}, '%')
+            </if>
+            <if test="maps.payType != null">
+                and so.pay_type IN
+                <foreach collection="maps.payType.split(',')" item="item" index="index" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="maps.scheduleId != null  and  maps.scheduleId != -1">
+                and so.schedule_id IN
+                <foreach collection="maps.scheduleId.split(',')" item="item" index="index" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="maps.scheduleId == -1">
+                and so.schedule_id is null
+            </if>
+            <if test="maps.orderBuyType != null and maps.orderBuyType != -1">
+                and so.order_buy_type IN
+                <foreach collection="maps.orderBuyType.split(',')" item="item" index="index" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="maps.orderBuyType == -1">
+                and so.order_buy_type is null
+            </if>
+            <if test="maps.orderChannel == -1">
+                and so.order_channel is null
+            </if>
+            <if test="maps.orderChannel != null and maps.orderChannel != -1">
+                and so.order_channel IN
+                <foreach collection="maps.orderChannel.split(',')" item="item" index="index" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="maps.qwSubject == -1">
+                and so.qw_subject is null
+            </if>
+            <if test="maps.qwSubject != null and maps.qwSubject != -1">
+                and so.qw_subject IN
+                <foreach collection="maps.qwSubject.split(',')" item="item" index="index" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="maps.erpPhoneNumber != null and maps.erpPhoneNumber != ''">
+                and so.erp_phone like concat(#{maps.erpPhoneNumber},'%')
+            </if>
+            <if test="maps.erpAccount != null and maps.erpAccount != '未分拣' and maps.erpAccount != ''">
+                and df.login_account like #{maps.erpAccount}
+            </if>
+            <if test="maps.erpAccount == '未分拣'">
+                and ( df.login_account is null or df.login_account like '')
+            </if>
+
+        </where>
+        ${maps.params.dataScope} GROUP BY sp.product_id
+        ) AS t
+
+
     </select>
 
 

+ 1 - 0
fs-store/src/main/java/com/fs/store/controller/store/FsStoreOrderController.java

@@ -281,6 +281,7 @@ public class FsStoreOrderController extends BaseController
     @PutMapping("/afterSales")
     public AjaxResult afterSales(@RequestBody FsStoreOrderSalesParam fsStoreOrder)
     {
+        fsStoreOrder.setOperator("店铺");
         return toAjax(fsStoreOrderService.afterSales(fsStoreOrder));
     }
 

+ 78 - 9
fs-user-app/src/main/java/com/fs/app/controller/PatientController.java

@@ -2,16 +2,21 @@ package com.fs.app.controller;
 
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.json.JSONUtil;
 import com.fs.app.annotation.Login;
 import com.fs.app.param.FsPatientAddEditParam;
 import com.fs.common.annotation.RepeatSubmit;
 import com.fs.common.core.domain.R;
 import com.fs.common.exception.CustomException;
+import com.fs.common.utils.StringUtils;
+import com.fs.his.config.StoreConfig;
 import com.fs.his.domain.FsPatient;
 import com.fs.his.enums.FsUserIntegralLogTypeEnum;
 import com.fs.his.param.FsUserAddIntegralTemplateParam;
 import com.fs.his.service.IFsPatientService;
 import com.fs.his.service.IFsUserIntegralLogsService;
+import com.fs.his.utils.IdCardUtil;
+import com.fs.system.service.ISysConfigService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -38,6 +43,8 @@ public class PatientController extends  AppBaseController {
     private IFsPatientService patientService;
     @Autowired
     private IFsUserIntegralLogsService userIntegralLogsService;
+    @Autowired
+    private ISysConfigService configService;
 
     @Login
     @ApiOperation("获取病人列表")
@@ -77,15 +84,32 @@ public class PatientController extends  AppBaseController {
     @ApiOperation("添加病人")
     @PostMapping("/addPatient")
     public R addPatient(@Valid @RequestBody FsPatientAddEditParam param, HttpServletRequest request){
+        String json = configService.selectConfigByKey("his.store");
+        StoreConfig storeConfig = JSONUtil.toBean(json, StoreConfig.class);
+        Integer isIdVerification = storeConfig.getIsIdVerification();
 
         String idCardNumber = param.getIdCard(); // 替换为要验证的身份证号码
-        if (idCardNumber == null || idCardNumber.length() != 18) {
+        String mobile = param.getMobile();
+        if (idCardNumber == null || idCardNumber.trim().isEmpty()) {
             return R.error("身份证号码不合法");
         }
-        String regex = "\\d{17}[0-9Xx]";
-        if (!Pattern.matches(regex, idCardNumber)) {
-            return   R.error("身份证号码不合法");
+        if (idCardNumber.length() != 18) {
+            //大陆身份证是18位
+            if (isIdVerification != 1) {
+                return R.error("身份证号码不合法");
+            } else {
+                //非大陆身份校验需要手机号 手机号只支持大陆的办理的手机号
+                if (StringUtils.isBlank(mobile)){
+                    R.error("手机号不能为空");
+                }
+            }
+        } else {
+            String regex = "\\d{17}[0-9Xx]";
+            if (!Pattern.matches(regex, idCardNumber)) {
+                return   R.error("身份证号码不合法");
+            }
         }
+
         if (param.getPatientName().length()<2||param.getPatientName().length()>30||!param.getPatientName().matches("^[\u4e00-\u9fa5]+$")) {
             return   R.error("就诊人名称不合法");
         }
@@ -127,6 +151,19 @@ public class PatientController extends  AppBaseController {
             return   R.error("身份证校验错误");
         }
 
+        //三方校验
+        if (isIdVerification == 1){
+            boolean match = true;
+            if (idCardNumber.length() != 18) {
+                match = IdCardUtil.isMatchByMobile(storeConfig,param.getPatientName(), mobile);
+            } else {
+                match = IdCardUtil.isMatchById(storeConfig,param.getPatientName(), param.getIdCard());
+            }
+            if (!match){
+                return R.error("身份证校验错误");
+            }
+        }
+
         FsPatient patient=new FsPatient();
         BeanUtil.copyProperties(param, patient);
         patient.setUserId(Long.parseLong(getUserId()));
@@ -148,14 +185,32 @@ public class PatientController extends  AppBaseController {
     @ApiOperation("编辑病人")
     @PostMapping("/editPatient")
     public R editPatient(@Valid @RequestBody FsPatientAddEditParam param, HttpServletRequest request){
+        String json = configService.selectConfigByKey("his.store");
+        StoreConfig storeConfig = JSONUtil.toBean(json, StoreConfig.class);
+        Integer isIdVerification = storeConfig.getIsIdVerification();
+        String mobile = param.getMobile();
+
         String idCardNumber = param.getIdCard(); // 替换为要验证的身份证号码
-        if (idCardNumber == null || idCardNumber.length() != 18) {
-            throw new CustomException("身份证号码不合法");
+        if (idCardNumber == null || idCardNumber.trim().isEmpty()) {
+            return R.error("身份证号码不合法");
         }
-        String regex = "\\d{17}[0-9Xx]";
-        if (!Pattern.matches(regex, idCardNumber)) {
-            throw new CustomException("身份证号码不合法");
+        if (idCardNumber.length() != 18) {
+            //大陆身份证是18位
+            if (isIdVerification != 1) {
+                return R.error("身份证号码不合法");
+            } else {
+                //非大陆身份校验需要手机号 手机号只支持大陆的办理的手机号
+                if (StringUtils.isBlank(mobile)){
+                    R.error("手机号不能为空");
+                }
+            }
+        } else {
+            String regex = "\\d{17}[0-9Xx]";
+            if (!Pattern.matches(regex, idCardNumber)) {
+                return   R.error("身份证号码不合法");
+            }
         }
+
         if (param.getPatientName().length()<2||param.getPatientName().length()>30||!param.getPatientName().matches("^[\u4e00-\u9fa5]+$")) {
             return   R.error("就诊人名称不合法");
         }
@@ -191,6 +246,20 @@ public class PatientController extends  AppBaseController {
 //        if (age2 > 200) {
 //            throw new CustomException("年龄超过200岁");
 //        }
+
+        //三方校验
+        if (isIdVerification == 1){
+            boolean match = true;
+            if (idCardNumber.length() != 18) {
+                match = IdCardUtil.isMatchByMobile(storeConfig,param.getPatientName(), mobile);
+            } else {
+                match = IdCardUtil.isMatchById(storeConfig,param.getPatientName(), param.getIdCard());
+            }
+            if (!match){
+                return R.error("身份证校验错误");
+            }
+        }
+
         FsPatient patient=new FsPatient();
         BeanUtil.copyProperties(param, patient);
         patientService.updateFsPatient(patient);

+ 2 - 2
fs-user-app/src/main/resources/application.yml

@@ -6,10 +6,10 @@ server:
 # Spring配置
 spring:
   profiles:
-    active: dev
+#    active: dev
 #    active: druid-jzzx
 #    active: druid-yzt
 #    active: druid-hdt
 #    active: druid-sxjz
 #    active: druid-yzt
-#    active: druid-fcky-test
+    active: druid-jnmy-test