Browse Source

fhy迁移到多分支,取消fhy单项目,方便代码同步

xdd 2 months ago
parent
commit
fe9465d591
85 changed files with 4569 additions and 1171 deletions
  1. 3 3
      deploy.sh
  2. 43 0
      fs-admin/src/main/java/com/fs/core/config/LogInterceptor.java
  3. 35 0
      fs-admin/src/main/java/com/fs/core/config/MyThreadPoolTaskExecutor.java
  4. 4 1
      fs-admin/src/main/java/com/fs/core/config/ResourcesConfig.java
  5. 1 1
      fs-admin/src/main/java/com/fs/core/config/ThreadPoolConfig.java
  6. 22 4
      fs-admin/src/main/java/com/fs/core/util/ThreadMdcUtil.java
  7. 32 3
      fs-admin/src/main/java/com/fs/store/controller/FsStoreHealthOrderController.java
  8. 35 0
      fs-admin/src/main/java/com/fs/store/controller/FsStoreOrderController.java
  9. 5 2
      fs-admin/src/main/java/com/fs/store/controller/FsTestReportController.java
  10. 25 0
      fs-admin/src/main/java/com/fs/task/PrescribeTask.java
  11. 2 2
      fs-admin/src/main/resources/application-dev.yml
  12. 16 0
      fs-admin/src/test/java/com/fs/company/controller/CompanyControllerTest.java
  13. 2 2
      fs-api/src/main/resources/application-dev.yml
  14. 3 0
      fs-common/src/main/java/com/fs/common/config/FSSysConfig.java
  15. 73 0
      fs-common/src/main/java/com/fs/common/dto/PersonIdentityDTO.java
  16. 76 0
      fs-common/src/main/java/com/fs/common/utils/ParseUtils.java
  17. 2 2
      fs-company/src/main/resources/application-dev.yml
  18. 5 0
      fs-service-system/pom.xml
  19. 1 0
      fs-service-system/src/main/java/com/fs/pay/pay/service/impl/PayApiServiceImpl.java
  20. 543 0
      fs-service-system/src/main/java/com/fs/store/domain/FsInquiryOrder.java
  21. 43 0
      fs-service-system/src/main/java/com/fs/store/domain/FsInquiryOrderMsg.java
  22. 0 8
      fs-service-system/src/main/java/com/fs/store/domain/FsPayConfig.java
  23. 66 307
      fs-service-system/src/main/java/com/fs/store/domain/FsPrescribe.java
  24. 35 156
      fs-service-system/src/main/java/com/fs/store/domain/FsPrescribeDrug.java
  25. 47 0
      fs-service-system/src/main/java/com/fs/store/domain/FsStoreOrderLogs.java
  26. 22 187
      fs-service-system/src/main/java/com/fs/store/domain/FsStoreProductAttrValue.java
  27. 8 298
      fs-service-system/src/main/java/com/fs/store/domain/FsUser.java
  28. 62 0
      fs-service-system/src/main/java/com/fs/store/domain/RemainingClaimLimitLog.java
  29. 15 0
      fs-service-system/src/main/java/com/fs/store/dto/FsPrescribeUsageDTO.java
  30. 14 0
      fs-service-system/src/main/java/com/fs/store/dto/FsStoreCartDTO.java
  31. 48 0
      fs-service-system/src/main/java/com/fs/store/dto/MedicalRecordDTO.java
  32. 443 0
      fs-service-system/src/main/java/com/fs/store/mapper/FsInquiryOrderMapper.java
  33. 16 8
      fs-service-system/src/main/java/com/fs/store/mapper/FsPatientMapper.java
  34. 26 9
      fs-service-system/src/main/java/com/fs/store/mapper/FsPrescribeMapper.java
  35. 5 1
      fs-service-system/src/main/java/com/fs/store/mapper/FsStoreCartMapper.java
  36. 1 1
      fs-service-system/src/main/java/com/fs/store/mapper/FsStoreOrderItemMapper.java
  37. 8 1
      fs-service-system/src/main/java/com/fs/store/mapper/FsStoreProductMapper.java
  38. 1 1
      fs-service-system/src/main/java/com/fs/store/mapper/FsTestReportMapper.java
  39. 1 0
      fs-service-system/src/main/java/com/fs/store/mapper/FsUserMapper.java
  40. 9 0
      fs-service-system/src/main/java/com/fs/store/mapper/FsWarehousesMapper.java
  41. 52 0
      fs-service-system/src/main/java/com/fs/store/mapper/RemainingClaimLimitLogMapper.java
  42. 15 0
      fs-service-system/src/main/java/com/fs/store/param/BaseParam.java
  43. 24 0
      fs-service-system/src/main/java/com/fs/store/param/FsInquiryOrderListPDParam.java
  44. 12 0
      fs-service-system/src/main/java/com/fs/store/param/FsInquiryOrderListUParam.java
  45. 153 0
      fs-service-system/src/main/java/com/fs/store/param/FsInquiryOrderParam.java
  46. 1 0
      fs-service-system/src/main/java/com/fs/store/param/FsPatientAddEditParam.java
  47. 67 0
      fs-service-system/src/main/java/com/fs/store/param/PrescribeXyImgParam.java
  48. 83 0
      fs-service-system/src/main/java/com/fs/store/param/PrescribeZyImgParam.java
  49. 20 11
      fs-service-system/src/main/java/com/fs/store/service/IFsPrescribeService.java
  50. 306 0
      fs-service-system/src/main/java/com/fs/store/service/MedicalRecordService.java
  51. 444 96
      fs-service-system/src/main/java/com/fs/store/service/impl/FsPrescribeServiceImpl.java
  52. 31 4
      fs-service-system/src/main/java/com/fs/store/service/impl/FsStoreAfterSalesServiceImpl.java
  53. 78 1
      fs-service-system/src/main/java/com/fs/store/service/impl/FsStoreOrderServiceImpl.java
  54. 20 2
      fs-service-system/src/main/java/com/fs/store/service/impl/FsStoreProductServiceImpl.java
  55. 2 2
      fs-service-system/src/main/java/com/fs/store/service/impl/PrescribeServiceImpl.java
  56. 61 0
      fs-service-system/src/main/java/com/fs/store/vo/FsInquiryFeedbackExportListVO.java
  57. 140 0
      fs-service-system/src/main/java/com/fs/store/vo/FsInquiryOrderExeclListVO.java
  58. 16 0
      fs-service-system/src/main/java/com/fs/store/vo/FsInquiryOrderListDParam.java
  59. 35 0
      fs-service-system/src/main/java/com/fs/store/vo/FsInquiryOrderListDVO.java
  60. 43 0
      fs-service-system/src/main/java/com/fs/store/vo/FsInquiryOrderListPDVO.java
  61. 37 0
      fs-service-system/src/main/java/com/fs/store/vo/FsInquiryOrderListUVO.java
  62. 130 0
      fs-service-system/src/main/java/com/fs/store/vo/FsInquiryOrderListVO.java
  63. 137 0
      fs-service-system/src/main/java/com/fs/store/vo/FsInquiryOrderVO.java
  64. 151 0
      fs-service-system/src/main/java/com/fs/store/vo/FsPackageOrderVO.java
  65. 104 29
      fs-service-system/src/main/java/com/fs/store/vo/FsPrescribeVO.java
  66. 12 0
      fs-service-system/src/main/java/com/fs/store/vo/FsStoreCartQueryVO.java
  67. 7 0
      fs-service-system/src/main/java/com/fs/store/vo/FsStoreOrderItemExportVO.java
  68. 16 0
      fs-service-system/src/main/java/com/fs/store/vo/FsStoreProductExportVO.java
  69. 5 0
      fs-service-system/src/main/java/com/fs/store/vo/FsUserListVO.java
  70. 9 6
      fs-service-system/src/main/resources/application-config.yml
  71. 320 0
      fs-service-system/src/main/resources/mapper/store/FsInquiryOrderMapper.xml
  72. 14 8
      fs-service-system/src/main/resources/mapper/store/FsPrescribeMapper.xml
  73. 13 1
      fs-service-system/src/main/resources/mapper/store/FsStoreProductAttrValueMapper.xml
  74. 1 2
      fs-service-system/src/main/resources/mapper/store/FsStoreProductMapper.xml
  75. 5 1
      fs-service-system/src/main/resources/mapper/store/FsUserMapper.xml
  76. 25 5
      fs-user-app/src/main/java/com/fs/app/controller/PatientController.java
  77. 2 0
      fs-user-app/src/main/java/com/fs/app/controller/WxUserController.java
  78. 11 0
      fs-user-app/src/main/java/com/fs/app/exception/FSExceptionHandler.java
  79. 43 0
      fs-user-app/src/main/java/com/fs/core/config/LogInterceptor.java
  80. 35 0
      fs-user-app/src/main/java/com/fs/core/config/MyThreadPoolTaskExecutor.java
  81. 7 2
      fs-user-app/src/main/java/com/fs/core/config/ResourcesConfig.java
  82. 2 2
      fs-user-app/src/main/java/com/fs/core/config/ThreadPoolConfig.java
  83. 79 0
      fs-user-app/src/main/java/com/fs/core/util/ThreadMdcUtil.java
  84. 2 2
      fs-user-app/src/main/resources/application-dev.yml
  85. 1 0
      fs-user-app/src/main/resources/static/nDOivNIU3j.txt

+ 3 - 3
deploy.sh

@@ -2,7 +2,7 @@
 
 # 设置远程服务器信息
 REMOTE_USER="root"  # 远程服务器用户名,根据你的实际情况修改
-REMOTE_HOST="111.230.193.88" # 远程服务器地址
+REMOTE_HOST="47.108.133.107" # 远程服务器地址
 REMOTE_BASE_DIR="/home/software"  # 远程服务器上的部署目录,根据你的目录结构修改
 
 # 本地 JAR 包路径  -- 根据你提供的目录结构修改
@@ -54,7 +54,7 @@ deploy_jar() {
 # 主要部署流程
 
 # 部署 fs-admin
-#deploy_jar "$LOCAL_FS_ADMIN_JAR" "fs-admin"
+deploy_jar "$LOCAL_FS_ADMIN_JAR" "fs-admin"
 
 # 部署 fs-company
 #deploy_jar "$LOCAL_FS_COMPANY_JAR" "fs-company"
@@ -64,7 +64,7 @@ deploy_jar() {
 #deploy_jar "$LOCAL_FS_API_JAR" "fs-api"
 
 #deploy_jar "$LOCAL_FS_USER_APP_JAR" "fs-api"
-deploy_jar "$LOCAL_FS_SYNC_JAR" "fs-sync"
+#deploy_jar "$LOCAL_FS_SYNC_JAR" "fs-sync"
 
 echo "Deployment completed."
 

+ 43 - 0
fs-admin/src/main/java/com/fs/core/config/LogInterceptor.java

@@ -0,0 +1,43 @@
+package com.fs.core.config;
+
+
+
+import org.slf4j.MDC;
+import org.springframework.stereotype.Component;
+import org.springframework.util.StringUtils;
+import org.springframework.web.servlet.HandlerInterceptor;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.UUID;
+
+
+/**
+ * @description: 日志拦截器
+ * @author: xdd
+ * @date: 2025/3/13
+ */
+@Component
+public class LogInterceptor implements HandlerInterceptor {
+
+    private static final String traceId = "traceId";
+
+    @Override
+    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
+        String tid = UUID.randomUUID().toString().replace("-", "");
+        //可以考虑让客户端传入链路ID,但需保证一定的复杂度唯一性;如果没使用默认UUID自动生成
+        if (!StringUtils.isEmpty(request.getHeader("traceId"))) {
+            tid = request.getHeader("traceId");
+        }
+        MDC.put(traceId, tid);
+        return true;
+    }
+
+    @Override
+    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler,
+                                Exception ex) {
+        // 请求处理完成后,清除MDC中的traceId,以免造成内存泄漏
+        MDC.remove(traceId);
+    }
+
+}

+ 35 - 0
fs-admin/src/main/java/com/fs/core/config/MyThreadPoolTaskExecutor.java

@@ -0,0 +1,35 @@
+package com.fs.core.config;
+
+import com.fs.core.util.ThreadMdcUtil;
+import org.slf4j.MDC;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+
+import java.util.concurrent.Callable;
+import java.util.concurrent.Future;
+
+/**
+ * @description:
+ * @author: xdd
+ * @date: 2025/3/13
+ */
+public final class MyThreadPoolTaskExecutor extends ThreadPoolTaskExecutor {
+    public MyThreadPoolTaskExecutor() {
+        super();
+    }
+
+    @Override
+    public void execute(Runnable task) {
+        super.execute(ThreadMdcUtil.wrap(task, MDC.getCopyOfContextMap()));
+    }
+
+
+    @Override
+    public <T> Future<T> submit(Callable<T> task) {
+        return super.submit(ThreadMdcUtil.wrap(task, MDC.getCopyOfContextMap()));
+    }
+
+    @Override
+    public Future<?> submit(Runnable task) {
+        return super.submit(ThreadMdcUtil.wrap(task, MDC.getCopyOfContextMap()));
+    }
+}

+ 4 - 1
fs-admin/src/main/java/com/fs/core/config/ResourcesConfig.java

@@ -45,7 +45,10 @@ public class ResourcesConfig implements WebMvcConfigurer
     @Override
     public void addInterceptors(InterceptorRegistry registry)
     {
-        registry.addInterceptor(repeatSubmitInterceptor).addPathPatterns("/**");
+        registry.addInterceptor(repeatSubmitInterceptor)
+                .addPathPatterns("/**");
+        registry.addInterceptor(logInterceptor)
+                .addPathPatterns("/**");
         registry.addInterceptor(logInterceptor)
                 .addPathPatterns("/**");
     }

+ 1 - 1
fs-admin/src/main/java/com/fs/core/config/ThreadPoolConfig.java

@@ -32,7 +32,7 @@ public class ThreadPoolConfig
     @Bean(name = "threadPoolTaskExecutor")
     public ThreadPoolTaskExecutor threadPoolTaskExecutor()
     {
-        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
+        ThreadPoolTaskExecutor executor = new MyThreadPoolTaskExecutor();
         executor.setMaxPoolSize(maxPoolSize);
         executor.setCorePoolSize(corePoolSize);
         executor.setQueueCapacity(queueCapacity);

+ 22 - 4
fs-admin/src/main/java/com/fs/core/util/ThreadMdcUtil.java

@@ -1,5 +1,11 @@
 package com.fs.core.util;
 
+/**
+ * @description:
+ * @author: xdd
+ * @date: 2025/3/13
+ * @Description:
+ */
 
 import org.slf4j.MDC;
 
@@ -8,14 +14,12 @@ import java.util.UUID;
 import java.util.concurrent.Callable;
 
 /**
- * @description:
- * @author: xdd
- * @date: 2025/3/13
  * @Description:
  */
 public final class ThreadMdcUtil {
     private static final String traceId = "traceId";
 
+    // 获取唯一性标识
     public static String generateTraceId() {
         return UUID.randomUUID().toString().replace("-", "");
     }
@@ -26,6 +30,14 @@ public final class ThreadMdcUtil {
         }
     }
 
+    /**
+     * 用于父线程向线程池中提交任务时,将自身MDC中的数据复制给子线程
+     *
+     * @param callable
+     * @param context
+     * @param <T>
+     * @return
+     */
     public static<T> Callable<T> wrap(final Callable<T> callable, final Map<String, String> context) {
         return () -> {
             if (context == null) {
@@ -42,7 +54,13 @@ public final class ThreadMdcUtil {
         };
     }
 
-
+    /**
+     * 用于父线程向线程池中提交任务时,将自身MDC中的数据复制给子线程
+     *
+     * @param runnable
+     * @param context
+     * @return
+     */
     public static Runnable wrap(final Runnable runnable, final Map<String, String> context) {
         return () -> {
             if (context == null) {

+ 32 - 3
fs-admin/src/main/java/com/fs/store/controller/FsStoreHealthOrderController.java

@@ -16,9 +16,15 @@ import com.fs.erp.service.IErpOrderService;
 import com.fs.store.cache.IFsStoreProductCacheService;
 import com.fs.store.cache.IFsWarehouseCacheService;
 import com.fs.store.cache.impl.FsWarehouseCacheServiceImpl;
+import com.fs.store.domain.FsPatient;
+import com.fs.store.domain.FsPrescribe;
 import com.fs.store.domain.FsStoreProduct;
 import com.fs.store.domain.FsWarehouses;
 import com.fs.store.dto.StoreOrderProductDTO;
+import com.fs.store.mapper.FsPatientMapper;
+import com.fs.store.mapper.FsPrescribeMapper;
+import com.fs.store.mapper.FsStoreProductMapper;
+import com.fs.store.mapper.FsWarehousesMapper;
 import com.fs.store.param.FsStoreOrderParam;
 import com.fs.store.service.*;
 import com.fs.store.vo.FsStoreOrderExportVO;
@@ -31,6 +37,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.List;
+import java.util.Map;
 
 @RestController
 @RequestMapping("/store/storeOrder")
@@ -43,6 +50,14 @@ public class FsStoreHealthOrderController extends BaseController {
     @Autowired
     private IFsStoreProductCacheService fsStoreProductCacheService;
 
+    @Autowired
+    private FsWarehousesMapper warehousesMapper;
+
+    @Autowired
+    private FsPrescribeMapper fsPrescribeMapper;
+
+    @Autowired
+    private FsPatientMapper fsPatientMapper;
     /**
      * 查询健康商城订单列表
      */
@@ -146,14 +161,28 @@ public class FsStoreHealthOrderController extends BaseController {
         }
         param.setIsHealth("1");
         List<FsStoreOrderItemExportVO> list = orderItemService.selectFsStoreOrderItemListExportVO(param);
+        Map<Long, FsWarehouses> longFsWarehousesMap = warehousesMapper.queryAllWarehouses();
+        Map<Long, FsPrescribe> orderMapping = fsPrescribeMapper.queryOrderMapping();
+        Map<Long, FsPatient> patientMapping = fsPatientMapper.queryAllMapping();
         //对手机号脱敏
         if (list != null) {
             for (FsStoreOrderItemExportVO vo : list) {
                 // 设置仓库名称
                 if(ObjectUtil.isNotNull(vo.getProductId())){
-                    String warehouseCode = fsStoreProductCacheService.getWarehouseCodeByProductId(vo.getProductId());
-                    if(StringUtils.isNotBlank(warehouseCode)){
-                        vo.setWarehouseCode(warehouseCode);
+                    FsWarehouses fsWarehouses = longFsWarehousesMap.get(vo.getProductId());
+                    if(ObjectUtil.isNotNull(fsWarehouses)){
+                        vo.setWarehouseCode(fsWarehouses.getWarehouseCode());
+                    }
+                }
+                // 设置患者姓名和身份证号码
+                if(ObjectUtil.isNotNull(vo.getOrderId())) {
+                    FsPrescribe fsPrescribe = orderMapping.get(vo.getOrderId());
+                    if(ObjectUtil.isNotNull(fsPrescribe)){
+                        FsPatient fsPatient = patientMapping.get(fsPrescribe.getPatientId());
+                        if(ObjectUtil.isNotNull(fsPatient)){
+                            vo.setPatientName(fsPatient.getPatientName());
+                            vo.setIdCard(fsPatient.getIdCard());
+                        }
                     }
                 }
                 if (vo.getUserPhone() != null) {

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

@@ -2,6 +2,7 @@ package com.fs.store.controller;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.ObjectUtil;
@@ -25,6 +26,8 @@ import com.fs.store.cache.IFsStoreProductCacheService;
 import com.fs.store.domain.*;
 import com.fs.store.dto.*;
 import com.fs.store.enums.ShipperCodeEnum;
+import com.fs.store.mapper.FsPatientMapper;
+import com.fs.store.mapper.FsPrescribeMapper;
 import com.fs.store.mapper.FsStoreOrderMapper;
 import com.fs.store.mapper.FsWarehousesMapper;
 import com.fs.store.param.*;
@@ -86,6 +89,17 @@ public class FsStoreOrderController extends BaseController {
 
     @Autowired
     private FsStoreOrderMapper fsStoreOrderMapper;
+
+
+    @Autowired
+    private FsWarehousesMapper warehousesMapper;
+
+    @Autowired
+    private FsPrescribeMapper fsPrescribeMapper;
+
+    @Autowired
+    private FsPatientMapper fsPatientMapper;
+
     /**
      * 查询订单列表
      */
@@ -252,9 +266,30 @@ public class FsStoreOrderController extends BaseController {
         }
         param.setNotHealth(1);
         List<FsStoreOrderItemExportVO> list = orderItemService.selectFsStoreOrderItemListExportVO(param);
+        Map<Long, FsWarehouses> longFsWarehousesMap = warehousesMapper.queryAllWarehouses();
+        Map<Long, FsPrescribe> orderMapping = fsPrescribeMapper.queryOrderMapping();
+        Map<Long, FsPatient> patientMapping = fsPatientMapper.queryAllMapping();
         //对手机号脱敏
         if (list != null) {
             for (FsStoreOrderItemExportVO vo : list) {
+                // 设置仓库名称
+                if(ObjectUtil.isNotNull(vo.getProductId())){
+                    FsWarehouses fsWarehouses = longFsWarehousesMap.get(vo.getProductId());
+                    if(ObjectUtil.isNotNull(fsWarehouses)){
+                        vo.setWarehouseCode(fsWarehouses.getWarehouseCode());
+                    }
+                }
+                // 设置患者姓名和身份证号码
+                if(ObjectUtil.isNotNull(vo.getOrderId())) {
+                    FsPrescribe fsPrescribe = orderMapping.get(vo.getOrderId());
+                    if(ObjectUtil.isNotNull(fsPrescribe)){
+                        FsPatient fsPatient = patientMapping.get(fsPrescribe.getPatientId());
+                        if(ObjectUtil.isNotNull(fsPatient)){
+                            vo.setPatientName(fsPatient.getPatientName());
+                            vo.setIdCard(fsPatient.getIdCard());
+                        }
+                    }
+                }
                 if (vo.getUserPhone() != null) {
                     String phone = vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{1})", "$1****$2");
                     vo.setUserPhone(phone);

+ 5 - 2
fs-admin/src/main/java/com/fs/store/controller/FsTestReportController.java

@@ -11,6 +11,7 @@ import com.fs.store.param.FsTestReportParam;
 import com.fs.store.service.IFsTestReportService;
 import com.fs.store.vo.FsTestReportListVO;
 import com.fs.store.vo.FsTestReportVO;
+import com.hc.openapi.tool.util.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
@@ -40,7 +41,9 @@ public class FsTestReportController extends BaseController
         startPage();
         List<FsTestReportListVO> list = fsTestReportService.selectFsTestReportListVO(fsTestReport);
         for (FsTestReportListVO vo : list) {
-            vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+            if(StringUtils.isNotBlank(vo.getPhone())) {
+                vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+            }
         }
         return getDataTable(list);
     }
@@ -69,7 +72,7 @@ public class FsTestReportController extends BaseController
         if (fsTestReportVO.getPhone()!=null){
             fsTestReportVO.setPhone(fsTestReportVO.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
         }
-        return AjaxResult.success();
+        return AjaxResult.success(fsTestReportVO);
     }
 
     /**

+ 25 - 0
fs-admin/src/main/java/com/fs/task/PrescribeTask.java

@@ -0,0 +1,25 @@
+package com.fs.task;
+
+import com.fs.common.annotation.QuartzRunnable;
+import com.fs.store.service.IFsPrescribeService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Slf4j
+@Service("prescribeTask")
+public class PrescribeTask {
+
+    @Autowired
+    private IFsPrescribeService fsPrescribeService;
+
+
+    /**
+     * 生成处方和病历单图片
+     */
+    @QuartzRunnable(name="生成处方和病历单图片")
+    public void generatePrescribeImg(){
+        fsPrescribeService.generateDealImg();
+    }
+
+}

+ 2 - 2
fs-admin/src/main/resources/application-dev.yml

@@ -29,9 +29,9 @@ spring:
         druid:
             # 主库数据源
             master:
-                url: jdbc:mysql://172.16.0.31:3306/fs_fhjx_hospital?allowMultiQueries=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                url: jdbc:mysql://gz-cdb-of55khc9.sql.tencentcdb.com:23620/fs_ffy_hospital?allowMultiQueries=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                 username: root
-                password: Ylrz_1q2w3e4r5t6y
+                password: Rtyy_2023
             # 从库数据源
             slave:
                 # 从数据源开关/默认关闭

+ 16 - 0
fs-admin/src/test/java/com/fs/company/controller/CompanyControllerTest.java

@@ -11,6 +11,7 @@ import com.fs.pay.pay.util.PayUtil;
 import com.fs.store.domain.FsStoreOrder;
 import com.fs.store.param.FsStoreOrderExpressEditParam;
 import com.fs.store.service.IFsStoreOrderService;
+import com.fs.store.service.MedicalRecordService;
 import com.fs.wx.dto.*;
 import com.fs.wx.service.OrderQueryService;
 import com.fs.wx.service.ShippingService;
@@ -59,6 +60,21 @@ public class CompanyControllerTest {
         fsStoreOrderService.syncExpress(param);
     }
 
+    @Autowired
+    private IFsPrescribeService fsPrescribeService;
+
+    @Autowired
+    private MedicalRecordService medicalRecordService;
+
+    @Test
+    public void test6(){
+//        MedicalRecordDTO medicalRecordDTO = new MedicalRecordDTO();
+    }
+    @Test
+    public void test5(){
+       fsPrescribeService.generateDealImg();
+    }
+
     @Test
     public void test4() throws ParseException {
         FsStoreOrder order=fsStoreOrderService.selectFsStoreOrderByOrderCode("1935899736686985216");

+ 2 - 2
fs-api/src/main/resources/application-dev.yml

@@ -27,9 +27,9 @@ spring:
         druid:
             # 主库数据源
             master:
-                url: jdbc:mysql://172.16.0.31:3306/fs_fhjx_hospital?allowMultiQueries=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                url: jdbc:mysql://gz-cdb-of55khc9.sql.tencentcdb.com:23620/fs_ffy_hospital?allowMultiQueries=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                 username: root
-                password: Ylrz_1q2w3e4r5t6y
+                password: Rtyy_2023
             # 从库数据源
             slave:
                 # 从数据源开关/默认关闭

+ 3 - 0
fs-common/src/main/java/com/fs/common/config/FSSysConfig.java

@@ -32,6 +32,9 @@ public class FSSysConfig
     String accessKeyID;
     String accessKeySecret;
     String callbackUrl;
+    String doctorSignImgUrl;
+    String drugDoctorSignImgUrl;
+    String prescribeTemplateImgPath;
     //erp接口
     Integer erpOpen;//是否开启ERP
     String erpAppKey;

+ 73 - 0
fs-common/src/main/java/com/fs/common/dto/PersonIdentityDTO.java

@@ -0,0 +1,73 @@
+package com.fs.common.dto;
+
+import lombok.Data;
+import lombok.Builder;
+import lombok.NoArgsConstructor;
+import lombok.AllArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.time.DateUtils;
+
+import java.io.Serializable;
+import java.text.ParseException;
+import java.util.Date;
+
+/**
+ * 个人身份信息DTO
+ *
+ * @author xdd
+ * @since 2025-02-27
+ * @version 1.0
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class PersonIdentityDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 身份证号
+     */
+    private String idcard;
+
+    /**
+     * 验证结果
+     * 验证结果代码(1-一致,2-不一致)
+     */
+    private String res;
+
+    /**
+     * 验证描述
+     */
+    private String description;
+
+    /**
+     * 性别
+     */
+    private String sex;
+
+    /**
+     * 出生日期
+     * 格式:YYYYMMDD
+     */
+    private String birthday;
+
+    public Date getBirthdayDate() throws ParseException {
+        if(StringUtils.isBlank(birthday)) {
+            return null;
+        }
+        return DateUtils.parseDate(birthday,"yyyyMMdd");
+    }
+
+    /**
+     * 户籍地址
+     */
+    private String address;
+
+}

+ 76 - 0
fs-common/src/main/java/com/fs/common/utils/ParseUtils.java

@@ -1,6 +1,18 @@
 package com.fs.common.utils;
+import cn.hutool.http.HttpRequest;
+import cn.hutool.http.HttpResponse;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
+import com.alibaba.fastjson.JSON;
+import com.fs.common.dto.PersonIdentityDTO;
+import lombok.extern.slf4j.Slf4j;
 
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
 
+@Slf4j
 public class ParseUtils {
 
     public static String parsePhone(String phone) {
@@ -30,4 +42,68 @@ public class ParseUtils {
         }
 
     }
+
+    public static void main(String[] args) {
+        PersonIdentityDTO dto = validateIdCard("向董董", "513022199804185613");
+        log.info(dto.toString());
+    }
+
+    /**
+     * 校验身份证和姓名是否一致
+     * @param name 姓名
+     * @param idCard 身份证
+     * @return 1一致,否则抛出异常
+     */
+    public static PersonIdentityDTO validateIdCard(String name,String idCard){
+        return checkIdCardAndName("10b395a78f4b43c2be8f8d2d59d16c1f", name, idCard);
+    }
+    /**
+     * 使用 Hutool 工具包进行身份二要素实名认证
+     * <p>
+     * 业务逻辑:
+     * 1. 调用 API,获取 JSON 响应。
+     * 2. 解析 JSON,检查外层 'code' 字段。
+     * 3. 如果 'code' 不为 "0",抛出包含 'message' 信息的 RuntimeException。
+     * 4. 如果 'code' 为 "0",检查内层 'result.res' 字段。
+     * 5. 如果 'result.res' 为 "1",方法返回字符串 "1"。
+     * 6. 如果 'result.res' 不为 "1",抛出包含 'result.description' 信息的 RuntimeException。
+     *
+     * @param appCode 你的阿里云市场 AppCode
+     * @param name    待校验的姓名
+     * @param idcard  待校验的身份证号
+     * @return 如果校验成功且信息一致,返回 "1"
+     * @throws RuntimeException 当 API 返回错误或校验结果不一致时抛出
+     */
+    private static PersonIdentityDTO checkIdCardAndName(String appCode, String name, String idcard) {
+        String url = "https://eid.shumaidata.com/eid/checkbody";
+        Map<String, Object> params = new HashMap<>();
+        params.put("idcard", idcard);
+        params.put("name", name);
+        String body = HttpRequest.post(url)
+                .header("Authorization", "APPCODE " + appCode)
+                .form(params)
+                .timeout(10000)
+                .execute()
+                .body(); // 获取响应体
+        System.out.println("API 原始返回: " + body);
+        JSONObject responseJson = JSONUtil.parseObj(body);
+        String code = responseJson.getStr("code");
+        if (!"0".equals(code)) {
+            String message = responseJson.getStr("message", "未知错误");
+            throw new RuntimeException(message);
+        }
+        JSONObject resultObj = responseJson.getJSONObject("result");
+        if (resultObj == null || resultObj.isEmpty()) {
+            throw new RuntimeException("API调用成功,但返回的result内容为空");
+        }
+        String res = resultObj.getStr("res");
+        if ("1".equals(res)) {
+            PersonIdentityDTO dto = JSON.parseObject(resultObj.toString(), PersonIdentityDTO.class);
+            return dto;
+        } else {
+            // 核验结果不一致或无记录, 抛出 description
+            String description = resultObj.getStr("description", "核验不一致或无此记录");
+            throw new RuntimeException("校验结果:"+description+",请检查身份证信息是否正确!");
+        }
+    }
 }

+ 2 - 2
fs-company/src/main/resources/application-dev.yml

@@ -40,9 +40,9 @@ spring:
         druid:
             # 主库数据源
             master:
-                url: jdbc:mysql://172.16.0.31:3306/fs_fhjx_hospital?allowMultiQueries=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                url: jdbc:mysql://gz-cdb-of55khc9.sql.tencentcdb.com:23620/fs_ffy_hospital?allowMultiQueries=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                 username: root
-                password: Ylrz_1q2w3e4r5t6y
+                password: Rtyy_2023
             # 从库数据源
             slave:
                 # 从数据源开关/默认关闭

+ 5 - 0
fs-service-system/pom.xml

@@ -174,5 +174,10 @@
             <groupId>com.github.ben-manes.caffeine</groupId>
             <artifactId>caffeine</artifactId>
         </dependency>
+        <dependency>
+            <groupId>net.coobird</groupId>
+            <artifactId>thumbnailator</artifactId>
+            <version>0.4.19</version>
+        </dependency>
     </dependencies>
 </project>

+ 1 - 0
fs-service-system/src/main/java/com/fs/pay/pay/service/impl/PayApiServiceImpl.java

@@ -2,6 +2,7 @@ package com.fs.pay.pay.service.impl;
 
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.parser.ParserConfig;
 import com.fs.common.utils.spring.SpringUtils;
 import com.fs.huifuPay.sdk.opps.core.config.MerConfig;
 import com.fs.pay.pay.config.PayConfig;

+ 543 - 0
fs-service-system/src/main/java/com/fs/store/domain/FsInquiryOrder.java

@@ -0,0 +1,543 @@
+package com.fs.store.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+import com.vdurmont.emoji.EmojiParser;
+import org.apache.commons.lang3.StringUtils;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 问诊订单对象 fs_inquiry_order
+ *
+ * @author fs
+ * @date 2023-09-15
+ */
+public class FsInquiryOrder extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** ID */
+    private Long orderId;
+
+    /** 订单号 */
+    @Excel(name = "订单号")
+    private String orderSn;
+
+    /** 问诊标题 */
+    @Excel(name = "问诊标题")
+    private String title;
+
+    /** 病例组图 */
+    @Excel(name = "病例组图")
+    private String imgs;
+
+    /** 会员ID */
+    @Excel(name = "会员ID")
+    private Long userId;
+
+    /** 病人ID */
+    @Excel(name = "病人ID")
+    private Long patientId;
+
+    /** 订单类型 1图文 2语音 */
+    @Excel(name = "订单类型 1图文 2语音")
+    private Integer orderType;
+
+    /** 订单金额 */
+    @Excel(name = "订单金额")
+    private BigDecimal money;
+
+    /** 支付金额 */
+    @Excel(name = "支付金额")
+    private BigDecimal payMoney;
+
+    /** 支付类型 1微信支付 */
+    @Excel(name = "支付类型 1微信支付")
+    private Integer payType;
+
+    /** 是否支付 */
+    @Excel(name = "是否支付")
+    private Integer isPay;
+
+    /** 医生ID */
+    @Excel(name = "医生ID")
+    private Long doctorId;
+
+    /** 支付时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date payTime;
+
+    /** 状态 1待支付 2已支付 3已完成  -1已关闭 -2已退款 */
+    @Excel(name = "状态 1待支付 2已支付 3已完成  -1已关闭 -2已退款")
+    private Integer status;
+
+    /** 问诊开始时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "问诊开始时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date startTime;
+
+    /** 结束时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date finishTime;
+
+    /** 是否评价 */
+    @Excel(name = "是否评价")
+    private Integer isPing;
+
+    /** 科室ID */
+    @Excel(name = "科室ID")
+    private Long departmentId;
+
+    /** 问诊类型  1专家 2极速 3开药问诊 */
+    @Excel(name = "问诊类型  1专家 2极速 3开药问诊")
+    private Integer inquiryType;
+
+    /** 问诊子类型 1凯蒙名医 2健康草本 3御君方 3不良反应 */
+    @Excel(name = "问诊子类型 1凯蒙名医 2健康草本 3御君方 3不良反应")
+    private Integer inquirySubType;
+
+    /** 患者信息 */
+    @Excel(name = "患者信息")
+    private String patientJson;
+
+    /** $column.columnComment */
+    @Excel(name = "患者信息")
+    private Integer isReceive;
+
+    /** 支付订单号 */
+    @Excel(name = "支付订单号")
+    private String tradeNo;
+
+    /** 是否审核 */
+    @Excel(name = "是否审核")
+    private Integer isAudit;
+
+    /** 审核人 */
+    @Excel(name = "审核人")
+    private Long auditUserId;
+
+    /** 审核时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date auditTime;
+
+    private Long userCouponId;
+
+    private BigDecimal discountMoney;
+
+    private Long packageOrderId;
+    private String doctorRemark;
+
+    private Long companyId;
+    private Long companyUserId;
+    private Long deptId;
+    private BigDecimal companyDeductMoney;
+
+    private String companyUserRemark; //销售备注
+
+    private Integer isSendSms; //是否发送短信
+    private Integer source;//订单来源
+
+    private Long triageUserId;
+
+    public Long getTriageUserId() {
+        return triageUserId;
+    }
+
+    public void setTriageUserId(Long triageUserId) {
+        this.triageUserId = triageUserId;
+    }
+
+    public Integer getSource() {
+        return source;
+    }
+
+    public void setSource(Integer source) {
+        this.source = source;
+    }
+
+    public String getDoctorRemark() {
+        return doctorRemark;
+    }
+
+    public void setDoctorRemark(String doctorRemark) {
+        this.doctorRemark = doctorRemark;
+    }
+
+    public Integer getIsSendSms() {
+        return isSendSms;
+    }
+
+    public void setIsSendSms(Integer isSendSms) {
+        this.isSendSms = isSendSms;
+    }
+
+    public String getCompanyUserRemark() {
+        return companyUserRemark;
+    }
+
+    public void setCompanyUserRemark(String companyUserRemark) {
+        this.companyUserRemark = companyUserRemark;
+    }
+
+    public Long getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(Long deptId) {
+        this.deptId = deptId;
+    }
+
+    public BigDecimal getCompanyDeductMoney() {
+        return companyDeductMoney;
+    }
+
+    public void setCompanyDeductMoney(BigDecimal companyDeductMoney) {
+        this.companyDeductMoney = companyDeductMoney;
+    }
+
+    public Long getCompanyId() {
+        return companyId;
+    }
+
+    public void setCompanyId(Long companyId) {
+        this.companyId = companyId;
+    }
+
+    public Long getCompanyUserId() {
+        return companyUserId;
+    }
+
+    public void setCompanyUserId(Long companyUserId) {
+        this.companyUserId = companyUserId;
+    }
+
+    public Long getPackageOrderId() {
+        return packageOrderId;
+    }
+
+    public void setPackageOrderId(Long packageOrderId) {
+        this.packageOrderId = packageOrderId;
+    }
+
+    public Long getUserCouponId() {
+        return userCouponId;
+    }
+
+    public void setUserCouponId(Long userCouponId) {
+        this.userCouponId = userCouponId;
+    }
+
+    public BigDecimal getDiscountMoney() {
+        return discountMoney;
+    }
+
+    public void setDiscountMoney(BigDecimal discountMoney) {
+        this.discountMoney = discountMoney;
+    }
+
+    public void setOrderId(Long orderId)
+    {
+        this.orderId = orderId;
+    }
+
+    public Long getOrderId()
+    {
+        return orderId;
+    }
+    public void setOrderSn(String orderSn)
+    {
+        this.orderSn = orderSn;
+    }
+
+    public String getOrderSn()
+    {
+        return orderSn;
+    }
+    public void setTitle(String title)
+    {
+        if(StringUtils.isNotEmpty(title)){
+            this.title= EmojiParser.parseToHtmlDecimal(title);
+        }
+        else{
+            this.title= title;
+        }
+    }
+
+    public String getTitle()
+    {
+        if(StringUtils.isNotEmpty(title)){
+            return EmojiParser.parseToUnicode(title);
+        }
+        else{
+            return title;
+        }
+    }
+    public void setImgs(String imgs)
+    {
+        this.imgs = imgs;
+    }
+
+    public String getImgs()
+    {
+        return imgs;
+    }
+    public void setUserId(Long userId)
+    {
+        this.userId = userId;
+    }
+
+    public Long getUserId()
+    {
+        return userId;
+    }
+    public void setPatientId(Long patientId)
+    {
+        this.patientId = patientId;
+    }
+
+    public Long getPatientId()
+    {
+        return patientId;
+    }
+    public void setOrderType(Integer orderType)
+    {
+        this.orderType = orderType;
+    }
+
+    public Integer getOrderType()
+    {
+        return orderType;
+    }
+    public void setMoney(BigDecimal money)
+    {
+        this.money = money;
+    }
+
+    public BigDecimal getMoney()
+    {
+        return money;
+    }
+    public void setPayMoney(BigDecimal payMoney)
+    {
+        this.payMoney = payMoney;
+    }
+
+    public BigDecimal getPayMoney()
+    {
+        return payMoney;
+    }
+    public void setPayType(Integer payType)
+    {
+        this.payType = payType;
+    }
+
+    public Integer getPayType()
+    {
+        return payType;
+    }
+    public void setIsPay(Integer isPay)
+    {
+        this.isPay = isPay;
+    }
+
+    public Integer getIsPay()
+    {
+        return isPay;
+    }
+    public void setDoctorId(Long doctorId)
+    {
+        this.doctorId = doctorId;
+    }
+
+    public Long getDoctorId()
+    {
+        return doctorId;
+    }
+    public void setPayTime(Date payTime)
+    {
+        this.payTime = payTime;
+    }
+
+    public Date getPayTime()
+    {
+        return payTime;
+    }
+    public void setStatus(Integer status)
+    {
+        this.status = status;
+    }
+
+    public Integer getStatus()
+    {
+        return status;
+    }
+    public void setStartTime(Date startTime)
+    {
+        this.startTime = startTime;
+    }
+
+    public Date getStartTime()
+    {
+        return startTime;
+    }
+    public void setFinishTime(Date finishTime)
+    {
+        this.finishTime = finishTime;
+    }
+
+    public Date getFinishTime()
+    {
+        return finishTime;
+    }
+    public void setIsPing(Integer isPing)
+    {
+        this.isPing = isPing;
+    }
+
+    public Integer getIsPing()
+    {
+        return isPing;
+    }
+    public void setDepartmentId(Long departmentId)
+    {
+        this.departmentId = departmentId;
+    }
+
+    public Long getDepartmentId()
+    {
+        return departmentId;
+    }
+    public void setInquiryType(Integer inquiryType)
+    {
+        this.inquiryType = inquiryType;
+    }
+
+    public Integer getInquiryType()
+    {
+        return inquiryType;
+    }
+    public void setInquirySubType(Integer inquirySubType)
+    {
+        this.inquirySubType = inquirySubType;
+    }
+
+    public Integer getInquirySubType()
+    {
+        return inquirySubType;
+    }
+    public void setPatientJson(String patientJson)
+    {
+        if(StringUtils.isNotEmpty(patientJson)){
+            this.patientJson= EmojiParser.parseToHtmlDecimal(patientJson);
+        }
+        else{
+            this.patientJson= patientJson;
+        }
+
+    }
+
+    public String getPatientJson()
+    {
+        if(StringUtils.isNotEmpty(patientJson)){
+            return EmojiParser.parseToUnicode(patientJson);
+        }
+        else{
+            return patientJson;
+        }
+    }
+    public void setIsReceive(Integer isReceive)
+    {
+        this.isReceive = isReceive;
+    }
+
+    public Integer getIsReceive()
+    {
+        return isReceive;
+    }
+    public void setTradeNo(String tradeNo)
+    {
+        this.tradeNo = tradeNo;
+    }
+
+    public String getTradeNo()
+    {
+        return tradeNo;
+    }
+    public void setIsAudit(Integer isAudit)
+    {
+        this.isAudit = isAudit;
+    }
+
+    public Integer getIsAudit()
+    {
+        return isAudit;
+    }
+    public void setAuditUserId(Long auditUserId)
+    {
+        this.auditUserId = auditUserId;
+    }
+
+    public Long getAuditUserId()
+    {
+        return auditUserId;
+    }
+    public void setAuditTime(Date auditTime)
+    {
+        this.auditTime = auditTime;
+    }
+
+    public Date getAuditTime()
+    {
+        return auditTime;
+    }
+
+    @Override
+    public String toString() {
+        return "FsInquiryOrder{" +
+                "orderId=" + orderId +
+                ", orderSn='" + orderSn + '\'' +
+                ", title='" + title + '\'' +
+                ", imgs='" + imgs + '\'' +
+                ", userId=" + userId +
+                ", patientId=" + patientId +
+                ", orderType=" + orderType +
+                ", money=" + money +
+                ", payMoney=" + payMoney +
+                ", payType=" + payType +
+                ", isPay=" + isPay +
+                ", doctorId=" + doctorId +
+                ", payTime=" + payTime +
+                ", status=" + status +
+                ", startTime=" + startTime +
+                ", finishTime=" + finishTime +
+                ", isPing=" + isPing +
+                ", departmentId=" + departmentId +
+                ", inquiryType=" + inquiryType +
+                ", inquirySubType=" + inquirySubType +
+                ", patientJson='" + patientJson + '\'' +
+                ", isReceive=" + isReceive +
+                ", tradeNo='" + tradeNo + '\'' +
+                ", isAudit=" + isAudit +
+                ", auditUserId=" + auditUserId +
+                ", auditTime=" + auditTime +
+                ", userCouponId=" + userCouponId +
+                ", discountMoney=" + discountMoney +
+                ", packageOrderId=" + packageOrderId +
+                ", doctorRemark='" + doctorRemark + '\'' +
+                ", companyId=" + companyId +
+                ", companyUserId=" + companyUserId +
+                ", deptId=" + deptId +
+                ", companyDeductMoney=" + companyDeductMoney +
+                ", companyUserRemark='" + companyUserRemark + '\'' +
+                ", isSendSms=" + isSendSms +
+                ", source=" + source +
+                ", triageUserId=" + triageUserId +
+                '}';
+    }
+}

+ 43 - 0
fs-service-system/src/main/java/com/fs/store/domain/FsInquiryOrderMsg.java

@@ -0,0 +1,43 @@
+package com.fs.store.domain;
+
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 图文订单对象 fs_inquiry_order_msg
+ *
+ * @author fs
+ * @date 2023-06-12
+ */
+@Data
+public class FsInquiryOrderMsg extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** ID */
+    private Long msgId;
+
+    /** 消息类型 1会员消息 2医生消息 */
+    @Excel(name = "消息类型 1会员消息 2医生消息")
+    private String msgType;
+
+    /** 会员ID */
+    @Excel(name = "会员ID")
+    private String fromAccount;
+
+    /** 医生ID */
+    @Excel(name = "医生ID")
+    private String toAccount;
+
+    /** 消息内容 */
+    @Excel(name = "消息内容")
+    private String content;
+
+    /** 订单ID */
+    @Excel(name = "订单ID")
+    private Long orderId;
+
+    private String msgKey;
+    private Integer msgContentType;
+}

+ 0 - 8
fs-service-system/src/main/java/com/fs/store/domain/FsPayConfig.java

@@ -65,14 +65,6 @@ public class FsPayConfig {
      */
     private String uuid;
 
-    /**
-     * 应用 ID
-     * <p>
-     * 示例值: "wx19c8813ffc33d1cb"
-     * </p>
-     */
-    private String appid;
-
     /**
      * 平台商户号
      */

+ 66 - 307
fs-service-system/src/main/java/com/fs/store/domain/FsPrescribe.java

@@ -4,15 +4,19 @@ import java.util.Date;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
 /**
  * 处方对象 fs_prescribe
- * 
+ *
  * @author fs
  * @date 2022-03-15
  */
+@EqualsAndHashCode(callSuper = true)
+@Data
 public class FsPrescribe extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
@@ -20,12 +24,16 @@ public class FsPrescribe extends BaseEntity
     /** id */
     private Long prescribeId;
 
-    /** 处方类型 1订单 2问诊 */
-    @Excel(name = "处方类型 1订单 2问诊")
+    /** 处方类型 1问诊 2订单 */
+    @Excel(name = "处方类型 1西药 2中药")
     private Integer prescribeType;
 
     /** 订单ID */
     @Excel(name = "订单ID")
+    private Long inquiryOrderId;
+
+    /** 店铺订单ID */
+    @Excel(name = "店铺订单ID")
     private Long orderId;
 
     /** 用户ID */
@@ -115,6 +123,9 @@ public class FsPrescribe extends BaseEntity
     @Excel(name = "拒绝原因")
     private String auditReason;
 
+    @Excel(name = "审核医师")
+    private String auditDoctor = "谢彩云";
+
 
     /** 诊断 */
     @Excel(name = "诊断")
@@ -126,7 +137,7 @@ public class FsPrescribe extends BaseEntity
 
     /** 医生名称 */
     @Excel(name = "医生名称")
-    private String doctorName;
+    private String doctorName = "谭清娥";
 
     /** 科室名称 */
     @Excel(name = "科室名称")
@@ -134,307 +145,55 @@ public class FsPrescribe extends BaseEntity
 
     private Integer status;
 
-    public String getAuditReason() {
-        return auditReason;
-    }
-
-    public void setAuditReason(String auditReason) {
-        this.auditReason = auditReason;
-    }
-
-    public Integer getStatus() {
-        return status;
-    }
-
-    public void setStatus(Integer status) {
-        this.status = status;
-    }
-
-    public void setPrescribeId(Long prescribeId)
-    {
-        this.prescribeId = prescribeId;
-    }
-
-    public Long getPrescribeId() 
-    {
-        return prescribeId;
-    }
-    public void setPrescribeType(Integer prescribeType) 
-    {
-        this.prescribeType = prescribeType;
-    }
-
-    public Integer getPrescribeType() 
-    {
-        return prescribeType;
-    }
-    public void setOrderId(Long orderId) 
-    {
-        this.orderId = orderId;
-    }
-
-    public Long getOrderId() 
-    {
-        return orderId;
-    }
-    public void setUserId(Long userId) 
-    {
-        this.userId = userId;
-    }
-
-    public Long getUserId() 
-    {
-        return userId;
-    }
-    public void setPatientId(Long patientId) 
-    {
-        this.patientId = patientId;
-    }
-
-    public Long getPatientId() 
-    {
-        return patientId;
-    }
-    public void setRpId(String rpId) 
-    {
-        this.rpId = rpId;
-    }
-
-    public String getRpId() 
-    {
-        return rpId;
-    }
-    public void setPharmacyCode(String pharmacyCode) 
-    {
-        this.pharmacyCode = pharmacyCode;
-    }
-
-    public String getPharmacyCode() 
-    {
-        return pharmacyCode;
-    }
-    public void setPharmacyName(String pharmacyName) 
-    {
-        this.pharmacyName = pharmacyName;
-    }
-
-    public String getPharmacyName() 
-    {
-        return pharmacyName;
-    }
-    public void setChiefComplaint(String chiefComplaint) 
-    {
-        this.chiefComplaint = chiefComplaint;
-    }
-
-    public String getChiefComplaint() 
-    {
-        return chiefComplaint;
-    }
-    public void setNowIllness(String nowIllness) 
-    {
-        this.nowIllness = nowIllness;
-    }
-
-    public String getNowIllness() 
-    {
-        return nowIllness;
-    }
-    public void setHistoryIllness(String historyIllness) 
-    {
-        this.historyIllness = historyIllness;
-    }
-
-    public String getHistoryIllness() 
-    {
-        return historyIllness;
-    }
-    public void setPatientAge(String patientAge) 
-    {
-        this.patientAge = patientAge;
-    }
-
-    public String getPatientAge() 
-    {
-        return patientAge;
-    }
-    public void setPatientName(String patientName) 
-    {
-        this.patientName = patientName;
-    }
-
-    public String getPatientName() 
-    {
-        return patientName;
-    }
-    public void setWeight(String weight) 
-    {
-        this.weight = weight;
-    }
-
-    public String getWeight() 
-    {
-        return weight;
-    }
-    public void setIsHistoryAllergic(String isHistoryAllergic) 
-    {
-        this.isHistoryAllergic = isHistoryAllergic;
-    }
-
-    public String getIsHistoryAllergic() 
-    {
-        return isHistoryAllergic;
-    }
-    public void setHistoryAllergic(String historyAllergic) 
-    {
-        this.historyAllergic = historyAllergic;
-    }
-
-    public String getHistoryAllergic() 
-    {
-        return historyAllergic;
-    }
-    public void setLiverUnusual(String liverUnusual) 
-    {
-        this.liverUnusual = liverUnusual;
-    }
-
-    public String getLiverUnusual() 
-    {
-        return liverUnusual;
-    }
-    public void setRenalUnusual(String renalUnusual) 
-    {
-        this.renalUnusual = renalUnusual;
-    }
-
-    public String getRenalUnusual() 
-    {
-        return renalUnusual;
-    }
-    public void setLactationFlag(String lactationFlag) 
-    {
-        this.lactationFlag = lactationFlag;
-    }
-
-    public String getLactationFlag() 
-    {
-        return lactationFlag;
-    }
-    public void setPatientTel(String patientTel) 
-    {
-        this.patientTel = patientTel;
-    }
-
-    public String getPatientTel() 
-    {
-        return patientTel;
-    }
-    public void setPatientGender(String patientGender) 
-    {
-        this.patientGender = patientGender;
-    }
-
-    public String getPatientGender() 
-    {
-        return patientGender;
-    }
-    public void setRecordPic(String recordPic) 
-    {
-        this.recordPic = recordPic;
-    }
-
-    public String getRecordPic() 
-    {
-        return recordPic;
-    }
-    public void setRpUrl(String rpUrl) 
-    {
-        this.rpUrl = rpUrl;
-    }
-
-    public String getRpUrl() 
-    {
-        return rpUrl;
-    }
-    public void setRpCreateTime(Date rpCreateTime) 
-    {
-        this.rpCreateTime = rpCreateTime;
-    }
-
-    public Date getRpCreateTime() 
-    {
-        return rpCreateTime;
-    }
-    public void setDiagnose(String diagnose) 
-    {
-        this.diagnose = diagnose;
-    }
-
-    public String getDiagnose() 
-    {
-        return diagnose;
-    }
-    public void setDrugs(String drugs) 
-    {
-        this.drugs = drugs;
-    }
-
-    public String getDrugs() 
-    {
-        return drugs;
-    }
-    public void setDoctorName(String doctorName) 
-    {
-        this.doctorName = doctorName;
-    }
-
-    public String getDoctorName() 
-    {
-        return doctorName;
-    }
-    public void setDoctorId(String doctorId) 
-    {
-        this.doctorId = doctorId;
-    }
-
-    public String getDoctorId() 
-    {
-        return doctorId;
-    }
-
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("prescribeId", getPrescribeId())
-            .append("prescribeType", getPrescribeType())
-            .append("orderId", getOrderId())
-            .append("userId", getUserId())
-            .append("patientId", getPatientId())
-            .append("rpId", getRpId())
-            .append("pharmacyCode", getPharmacyCode())
-            .append("pharmacyName", getPharmacyName())
-            .append("chiefComplaint", getChiefComplaint())
-            .append("nowIllness", getNowIllness())
-            .append("historyIllness", getHistoryIllness())
-            .append("patientAge", getPatientAge())
-            .append("patientName", getPatientName())
-            .append("weight", getWeight())
-            .append("isHistoryAllergic", getIsHistoryAllergic())
-            .append("historyAllergic", getHistoryAllergic())
-            .append("liverUnusual", getLiverUnusual())
-            .append("renalUnusual", getRenalUnusual())
-            .append("lactationFlag", getLactationFlag())
-            .append("patientTel", getPatientTel())
-            .append("patientGender", getPatientGender())
-            .append("recordPic", getRecordPic())
-            .append("rpUrl", getRpUrl())
-            .append("rpCreateTime", getRpCreateTime())
-            .append("diagnose", getDiagnose())
-            .append("drugs", getDrugs())
-            .append("doctorName", getDoctorName())
-            .append("doctorId", getDoctorId())
-            .append("createTime", getCreateTime())
-            .toString();
-    }
+    @Excel(name = "使用方法")
+    private String usageJson;
+
+    /** 审核时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date auditTime;
+
+    @Excel(name = "病人生日")
+    private String patientBirthday;
+    @Excel(name = "备注")
+    private String remark;
+    @Excel(name = "店铺id")
+    private Long storeId;
+
+    @Excel(name = "开方医生id")
+    private Long prescribeDoctorId;
+
+    @Excel(name = "开方医生签名")
+    private String doctorSignUrl;
+
+    @Excel(name = "处方医生签名")
+    private String prescribeDoctorSignUrl;
+
+    @Excel(name = "药师签名")
+    private String drugDoctorSignUrl;
+
+    @Excel(name = "0颗粒1膏方")
+    private Integer recipeType;
+    private String prescribeCodeUrl;
+    private String prescribeImgStoreUrl;
+
+    private String medicalRecordUrl;
+
+
+    private Integer cycle;
+
+
+
+    private String icdCode;
+
+    public Integer source;
+
+    /**
+     * 生成状态 1已支付 0 未生成 2已生成
+     */
+    private Integer generateStatus;
+    /**
+     * 失败原因
+     */
+    private String failMsg;
 }

+ 35 - 156
fs-service-system/src/main/java/com/fs/store/domain/FsPrescribeDrug.java

@@ -2,15 +2,21 @@ package com.fs.store.domain;
 
 import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
+import java.math.BigDecimal;
+
 /**
  * 处方药品对象 fs_prescribe_drug
- * 
+ *
  * @author fs
- * @date 2022-03-15
+ * @date 2023-06-13
  */
+@EqualsAndHashCode(callSuper = true)
+@Data
 public class FsPrescribeDrug extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
@@ -18,17 +24,17 @@ public class FsPrescribeDrug extends BaseEntity
     /** ID */
     private Long drugId;
 
-    /** $column.columnComment */
-    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    /** 处方ID */
+    @Excel(name = "处方ID")
     private Long prescribeId;
 
     /** 药品名称 */
     @Excel(name = "药品名称")
-    private String drugCommonName;
+    private String drugName;
 
     /** 规格 */
     @Excel(name = "规格")
-    private String drugSpecification;
+    private String drugSpec;
 
     /** 使⽤⽅法 */
     @Excel(name = "使⽤⽅法")
@@ -50,13 +56,17 @@ public class FsPrescribeDrug extends BaseEntity
     @Excel(name = "天数")
     private String usageDays;
 
+    @Excel(name = "药品单价")
+    private BigDecimal drugPrice;
+
     /** 药品数量 */
     @Excel(name = "药品数量")
-    private String saleAmount;
+    private Long drugNum;
 
     /** 药品数量单位 */
     @Excel(name = "药品数量单位")
-    private String saleUnit;
+    private String drugUnit;
+
 
     /** 药品说明书 */
     @Excel(name = "药品说明书")
@@ -68,152 +78,21 @@ public class FsPrescribeDrug extends BaseEntity
 
     /** 产品ID */
     @Excel(name = "产品ID")
-    private Integer productId;
-
-    public void setDrugId(Long drugId) 
-    {
-        this.drugId = drugId;
-    }
-
-    public Long getDrugId() 
-    {
-        return drugId;
-    }
-    public void setPrescribeId(Long prescribeId) 
-    {
-        this.prescribeId = prescribeId;
-    }
-
-    public Long getPrescribeId() 
-    {
-        return prescribeId;
-    }
-    public void setDrugCommonName(String drugCommonName) 
-    {
-        this.drugCommonName = drugCommonName;
-    }
-
-    public String getDrugCommonName() 
-    {
-        return drugCommonName;
-    }
-    public void setDrugSpecification(String drugSpecification) 
-    {
-        this.drugSpecification = drugSpecification;
-    }
-
-    public String getDrugSpecification() 
-    {
-        return drugSpecification;
-    }
-    public void setUsageMethod(String usageMethod) 
-    {
-        this.usageMethod = usageMethod;
-    }
-
-    public String getUsageMethod() 
-    {
-        return usageMethod;
-    }
-    public void setUsageFrequencyUnit(String usageFrequencyUnit) 
-    {
-        this.usageFrequencyUnit = usageFrequencyUnit;
-    }
-
-    public String getUsageFrequencyUnit() 
-    {
-        return usageFrequencyUnit;
-    }
-    public void setUsagePerUseCount(String usagePerUseCount) 
-    {
-        this.usagePerUseCount = usagePerUseCount;
-    }
-
-    public String getUsagePerUseCount() 
-    {
-        return usagePerUseCount;
-    }
-    public void setUsagePerUseUnit(String usagePerUseUnit) 
-    {
-        this.usagePerUseUnit = usagePerUseUnit;
-    }
-
-    public String getUsagePerUseUnit() 
-    {
-        return usagePerUseUnit;
-    }
-    public void setUsageDays(String usageDays) 
-    {
-        this.usageDays = usageDays;
-    }
-
-    public String getUsageDays() 
-    {
-        return usageDays;
-    }
-    public void setSaleAmount(String saleAmount) 
-    {
-        this.saleAmount = saleAmount;
-    }
-
-    public String getSaleAmount() 
-    {
-        return saleAmount;
-    }
-    public void setSaleUnit(String saleUnit) 
-    {
-        this.saleUnit = saleUnit;
-    }
-
-    public String getSaleUnit() 
-    {
-        return saleUnit;
-    }
-    public void setInstructions(String instructions) 
-    {
-        this.instructions = instructions;
-    }
-
-    public String getInstructions() 
-    {
-        return instructions;
-    }
-    public void setApprovalNumber(String approvalNumber) 
-    {
-        this.approvalNumber = approvalNumber;
-    }
-
-    public String getApprovalNumber() 
-    {
-        return approvalNumber;
-    }
-    public void setProductId(Integer productId) 
-    {
-        this.productId = productId;
-    }
-
-    public Integer getProductId() 
-    {
-        return productId;
-    }
-
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("drugId", getDrugId())
-            .append("prescribeId", getPrescribeId())
-            .append("drugCommonName", getDrugCommonName())
-            .append("drugSpecification", getDrugSpecification())
-            .append("usageMethod", getUsageMethod())
-            .append("usageFrequencyUnit", getUsageFrequencyUnit())
-            .append("usagePerUseCount", getUsagePerUseCount())
-            .append("usagePerUseUnit", getUsagePerUseUnit())
-            .append("usageDays", getUsageDays())
-            .append("saleAmount", getSaleAmount())
-            .append("saleUnit", getSaleUnit())
-            .append("instructions", getInstructions())
-            .append("approvalNumber", getApprovalNumber())
-            .append("productId", getProductId())
-            .toString();
-    }
+    private Long productId;
+
+    /** 药品图片 */
+    @Excel(name = "药品图片")
+    private String drugImgUrl;
+
+    private Long productAttrValueId;
+
+    private String remark;
+
+    private Integer drugType;
+
+    private Integer isDrug;
+
+    private String barCode;
+    private String prescribeCode;
+
 }

+ 47 - 0
fs-service-system/src/main/java/com/fs/store/domain/FsStoreOrderLogs.java

@@ -0,0 +1,47 @@
+package com.fs.store.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 订单操作记录对象 fs_store_order_logs
+ *
+ * @author fs
+ * @date 2023-06-13
+ */
+@Data
+public class FsStoreOrderLogs extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long logsId;
+
+    /** 订单id */
+    @Excel(name = "订单id")
+    private Long orderId;
+
+    /** 操作类型 */
+    @Excel(name = "操作类型")
+    private String changeType;
+
+    /** 操作备注 */
+    @Excel(name = "操作备注")
+    private String changeMessage;
+
+    /** 操作时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date changeTime;
+
+    /** 操作员 */
+    @Excel(name = "操作员")
+    private String operator;
+
+
+
+}

+ 22 - 187
fs-service-system/src/main/java/com/fs/store/domain/FsStoreProductAttrValue.java

@@ -5,6 +5,9 @@ import java.util.Map;
 
 import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
@@ -14,6 +17,9 @@ import org.apache.commons.lang3.builder.ToStringStyle;
  * @author fs
  * @date 2022-03-15
  */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@ToString
 public class FsStoreProductAttrValue extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
@@ -56,6 +62,22 @@ public class FsStoreProductAttrValue extends BaseEntity
     @Excel(name = "组合条码")
     private String groupBarCode;
 
+    /**
+     * 服用方法
+     */
+    @Excel(name = "服用方法")
+    private String usageMethod;
+    /**
+     * 一日几次
+     */
+    @Excel(name = "一日几次")
+    private String frequency;
+    /**
+     * 用药数量
+     */
+    @Excel(name = "用药数量")
+    private String dosage;
+
     /** 原价 */
     @Excel(name = "原价")
     private BigDecimal otPrice;
@@ -88,192 +110,5 @@ public class FsStoreProductAttrValue extends BaseEntity
 
     private Map<String, String> detail;
 
-    public BigDecimal getBrokerageThree() {
-        return brokerageThree;
-    }
-
-    public void setBrokerageThree(BigDecimal brokerageThree) {
-        this.brokerageThree = brokerageThree;
-    }
-
-    public String getGroupBarCode() {
-        return groupBarCode;
-    }
-
-    public void setGroupBarCode(String groupBarCode) {
-        this.groupBarCode = groupBarCode;
-    }
-
-    public BigDecimal getAgentPrice() {
-        return agentPrice;
-    }
-
-    public void setAgentPrice(BigDecimal agentPrice) {
-        this.agentPrice = agentPrice;
-    }
-
-    public Map<String, String> getDetail() {
-        return detail;
-    }
-
-    public void setDetail(Map<String, String> detail) {
-        this.detail = detail;
-    }
-
-    public void setId(Long id)
-    {
-        this.id = id;
-    }
-
-    public Long getId()
-    {
-        return id;
-    }
-    public void setProductId(Long productId)
-    {
-        this.productId = productId;
-    }
-
-    public Long getProductId()
-    {
-        return productId;
-    }
-    public void setSku(String sku)
-    {
-        this.sku = sku;
-    }
-
-    public String getSku()
-    {
-        return sku;
-    }
-    public void setStock(Integer stock)
-    {
-        this.stock = stock;
-    }
-
-    public Integer getStock()
-    {
-        return stock;
-    }
-    public void setSales(Integer sales)
-    {
-        this.sales = sales;
-    }
-
-    public Integer getSales()
-    {
-        return sales;
-    }
-    public void setPrice(BigDecimal price)
-    {
-        this.price = price;
-    }
-
-    public BigDecimal getPrice()
-    {
-        return price;
-    }
-    public void setImage(String image)
-    {
-        this.image = image;
-    }
-
-    public String getImage()
-    {
-        return image;
-    }
-    public void setCost(BigDecimal cost)
-    {
-        this.cost = cost;
-    }
-
-    public BigDecimal getCost()
-    {
-        return cost;
-    }
-    public void setBarCode(String barCode)
-    {
-        this.barCode = barCode;
-    }
-
-    public String getBarCode()
-    {
-        return barCode;
-    }
-    public void setOtPrice(BigDecimal otPrice)
-    {
-        this.otPrice = otPrice;
-    }
-
-    public BigDecimal getOtPrice()
-    {
-        return otPrice;
-    }
-    public void setWeight(BigDecimal weight)
-    {
-        this.weight = weight;
-    }
-
-    public BigDecimal getWeight()
-    {
-        return weight;
-    }
-    public void setVolume(BigDecimal volume)
-    {
-        this.volume = volume;
-    }
-
-    public BigDecimal getVolume()
-    {
-        return volume;
-    }
-    public void setBrokerage(BigDecimal brokerage)
-    {
-        this.brokerage = brokerage;
-    }
-
-    public BigDecimal getBrokerage()
-    {
-        return brokerage;
-    }
-    public void setBrokerageTwo(BigDecimal brokerageTwo)
-    {
-        this.brokerageTwo = brokerageTwo;
-    }
-
-    public BigDecimal getBrokerageTwo()
-    {
-        return brokerageTwo;
-    }
-    public void setIntegral(Integer integral)
-    {
-        this.integral = integral;
-    }
-
-    public Integer getIntegral()
-    {
-        return integral;
-    }
 
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("productId", getProductId())
-            .append("sku", getSku())
-            .append("stock", getStock())
-            .append("sales", getSales())
-            .append("price", getPrice())
-            .append("image", getImage())
-            .append("cost", getCost())
-            .append("barCode", getBarCode())
-            .append("otPrice", getOtPrice())
-            .append("weight", getWeight())
-            .append("volume", getVolume())
-            .append("brokerage", getBrokerage())
-            .append("brokerageTwo", getBrokerageTwo())
-            .append("integral", getIntegral())
-            .toString();
-    }
 }

+ 8 - 298
fs-service-system/src/main/java/com/fs/store/domain/FsUser.java

@@ -6,6 +6,8 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.BaseEntity;
 import com.vdurmont.emoji.EmojiParser;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
 import org.apache.commons.lang3.StringUtils;
 
 /**
@@ -14,6 +16,8 @@ import org.apache.commons.lang3.StringUtils;
  * @author fs
  * @date 2022-03-15
  */
+@EqualsAndHashCode(callSuper = true)
+@Data
 public class FsUser extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
@@ -124,150 +128,11 @@ public class FsUser extends BaseEntity
 
     private String userCode;
 
-    public String getUserCode() {
-        return userCode;
-    }
-
-    public void setUserCode(String userCode) {
-        this.userCode = userCode;
-    }
-
-    public String getMaOpenId() {
-        return maOpenId;
-    }
-
-    public void setMaOpenId(String maOpenId) {
-        this.maOpenId = maOpenId;
-    }
-
-    public String getMpOpenId() {
-        return mpOpenId;
-    }
-
-    public void setMpOpenId(String mpOpenId) {
-        this.mpOpenId = mpOpenId;
-    }
-
-    public String getUnionId() {
-        return unionId;
-    }
-
-    public void setUnionId(String unionId) {
-        this.unionId = unionId;
-    }
-
-    public Date getRegisterDate() {
-        return registerDate;
-    }
-
-    public void setRegisterDate(Date registerDate) {
-        this.registerDate = registerDate;
-    }
-
-    public String getRegisterCode() {
-        return registerCode;
-    }
-
-    public void setRegisterCode(String registerCode) {
-        this.registerCode = registerCode;
-    }
-
-    public String getSource() {
-        return source;
-    }
-
-    public void setSource(String source) {
-        this.source = source;
-    }
-
-    public Long getCompanyId() {
-        return companyId;
-    }
-
-    public void setCompanyId(Long companyId) {
-        this.companyId = companyId;
-    }
-
-    public Long getCompanyUserId() {
-        return companyUserId;
-    }
-
-    public void setCompanyUserId(Long companyUserId) {
-        this.companyUserId = companyUserId;
-    }
-
-    public Integer getIsWeixinAuth() {
-        return isWeixinAuth;
-    }
-
-    public void setIsWeixinAuth(Integer isWeixinAuth) {
-        this.isWeixinAuth = isWeixinAuth;
-    }
-
-    public void setUserId(Long userId)
-    {
-        this.userId = userId;
-    }
-
-    public Long getUserId()
-    {
-        return userId;
-    }
-    public void setUsername(String username)
-    {
-        this.username = username;
-    }
-
-    public String getUsername()
-    {
-        return username;
-    }
-    public void setPassword(String password)
-    {
-        this.password = password;
-    }
-
-    public String getPassword()
-    {
-        return password;
-    }
-    public void setRealName(String realName)
-    {
-        this.realName = realName;
-    }
-
-    public String getRealName()
-    {
-        return realName;
-    }
-    public void setBirthday(Long birthday)
-    {
-        this.birthday = birthday;
-    }
-
-    public Long getBirthday()
-    {
-        return birthday;
-    }
-    public void setIdCard(String idCard)
-    {
-        this.idCard = idCard;
-    }
-
-    public String getIdCard()
-    {
-        return idCard;
-    }
 
-    @Override
-    public String getRemark() {
-        return remark;
-    }
-
-    @Override
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
+    /**
+     * 剩余理赔额度
+     */
+    private BigDecimal remainingClaimLimit;
 
     public void setNickname(String nickname)
     {
@@ -288,160 +153,5 @@ public class FsUser extends BaseEntity
             return nickname;
         }
     }
-    public void setAvatar(String avatar)
-    {
-        this.avatar = avatar;
-    }
-
-    public String getAvatar()
-    {
-        return avatar;
-    }
-    public void setPhone(String phone)
-    {
-        this.phone = phone;
-    }
-
-    public String getPhone()
-    {
-        return phone;
-    }
-    public void setLastIp(String lastIp)
-    {
-        this.lastIp = lastIp;
-    }
-
-    public String getLastIp()
-    {
-        return lastIp;
-    }
-    public void setNowMoney(BigDecimal nowMoney)
-    {
-        this.nowMoney = nowMoney;
-    }
-
-    public BigDecimal getNowMoney()
-    {
-        return nowMoney;
-    }
-    public void setBrokeragePrice(BigDecimal brokeragePrice)
-    {
-        this.brokeragePrice = brokeragePrice;
-    }
-
-    public BigDecimal getBrokeragePrice()
-    {
-        return brokeragePrice;
-    }
-    public void setIntegral(BigDecimal integral)
-    {
-        this.integral = integral;
-    }
-
-    public BigDecimal getIntegral()
-    {
-        return integral;
-    }
-    public void setSignNum(Long signNum)
-    {
-        this.signNum = signNum;
-    }
-
-    public Long getSignNum()
-    {
-        return signNum;
-    }
-    public void setStatus(Integer status)
-    {
-        this.status = status;
-    }
-
-    public Integer getStatus()
-    {
-        return status;
-    }
-    public void setLevel(Integer level)
-    {
-        this.level = level;
-    }
-
-    public Integer getLevel()
-    {
-        return level;
-    }
-    public void setSpreadUserId(Long spreadUserId)
-    {
-        this.spreadUserId = spreadUserId;
-    }
-
-    public Long getSpreadUserId()
-    {
-        return spreadUserId;
-    }
-    public void setSpreadTime(Date spreadTime)
-    {
-        this.spreadTime = spreadTime;
-    }
-
-    public Date getSpreadTime()
-    {
-        return spreadTime;
-    }
-    public void setUserType(String userType)
-    {
-        this.userType = userType;
-    }
-
-    public String getUserType()
-    {
-        return userType;
-    }
-    public void setIsPromoter(Integer isPromoter)
-    {
-        this.isPromoter = isPromoter;
-    }
-
-    public Integer getIsPromoter()
-    {
-        return isPromoter;
-    }
-    public void setPayCount(Long payCount)
-    {
-        this.payCount = payCount;
-    }
-
-    public Long getPayCount()
-    {
-        return payCount;
-    }
-    public void setSpreadCount(Long spreadCount)
-    {
-        this.spreadCount = spreadCount;
-    }
-
-    public Long getSpreadCount()
-    {
-        return spreadCount;
-    }
-    public void setAddres(String addres)
-    {
-        this.addres = addres;
-    }
-
-    public String getAddres()
-    {
-        return addres;
-    }
-
-    public void setIsDel(Integer isDel)
-    {
-        this.isDel = isDel;
-    }
-
-    public Integer getIsDel()
-    {
-        return isDel;
-    }
-
 
 }

+ 62 - 0
fs-service-system/src/main/java/com/fs/store/domain/RemainingClaimLimitLog.java

@@ -0,0 +1,62 @@
+package com.fs.store.domain;
+
+import lombok.Data;
+import lombok.Builder;
+import lombok.NoArgsConstructor;
+import lombok.AllArgsConstructor;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 剩余理赔限额日志表
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class RemainingClaimLimitLog implements Cloneable{
+    /**
+     * 主键ID
+     */
+    private Integer id;
+
+    /**
+     * 订单id
+     */
+    private Long orderId;
+
+    /**
+     * 订单金额
+     */
+    private BigDecimal orderMoney;
+
+    /**
+     * 金额
+     */
+    private BigDecimal money;
+
+    /**
+     * 用户id
+     */
+    private Long userId;
+
+    /**
+     * 0购买 1退款
+     */
+    private Integer status;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    @Override
+    public RemainingClaimLimitLog clone() {
+        try {
+            RemainingClaimLimitLog clone = (RemainingClaimLimitLog) super.clone();
+            return clone;
+        } catch (CloneNotSupportedException e) {
+            throw new AssertionError();
+        }
+    }
+}

+ 15 - 0
fs-service-system/src/main/java/com/fs/store/dto/FsPrescribeUsageDTO.java

@@ -0,0 +1,15 @@
+package com.fs.store.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class FsPrescribeUsageDTO implements Serializable {
+
+    Long counts;//数量
+    String usageFrequencyUnit;//用药频率
+    String usagePerUseCount;//单次用量
+    String usageMethod;//用药方法
+    String remark;
+}

+ 14 - 0
fs-service-system/src/main/java/com/fs/store/dto/FsStoreCartDTO.java

@@ -1,5 +1,6 @@
 package com.fs.store.dto;
 
+import com.fs.common.annotation.Excel;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -39,4 +40,17 @@ import java.math.BigDecimal;
      * 仓库代码
      */
     private String warehouseCode;
+
+    /**
+     * 服用方法
+     */
+    private String usageMethod;
+    /**
+     * 一日几次
+     */
+    private String frequency;
+    /**
+     * 用药数量
+     */
+    private String dosage;
 }

+ 48 - 0
fs-service-system/src/main/java/com/fs/store/dto/MedicalRecordDTO.java

@@ -0,0 +1,48 @@
+package com.fs.store.dto;
+
+import com.fs.store.domain.FsPrescribeDrug;
+import lombok.Data;
+import java.util.Date;
+import java.util.List;
+import java.util.Random;
+
+@Data
+public class MedicalRecordDTO {
+
+    // 头部信息
+    private Date visitDate;           // 就诊日期
+    private String outpatientNo;      // 门诊号
+    private String department;        // 科别
+    private String paymentType;       // 付款类型
+
+    // 患者基本信息
+    private String patientName;       // 姓名
+    private String gender;            // 性别
+    private Integer age;              // 年龄
+    private String height;            // 身高
+    private String weight;            // 体重
+    private String phone;             // 联系电话
+    private String address;           // 单位或地址
+
+    // 病情信息
+    private String chiefComplaint;    // 主诉
+    private String presentIllness;    // 现病史
+    private String pastHistory;       // 既往史
+    private String allergyHistory;    // 过敏史
+
+    // 检查信息
+    private String vitalSigns;        // 生命体征
+    private String auxiliaryExam;     // 辅助检查
+
+    // 诊疗信息
+    private String diagnosis;         // 诊断
+    private String medicalAdvice;     // 医嘱
+    private String healthEducation;   // 健康教育
+    private String treatmentPlan;     // 处理意见
+    private String prescription;      // 处方1
+
+    // 医生信息
+    private String doctorName;        // 医生签名
+
+    List<FsPrescribeDrug> drugList;
+}

+ 443 - 0
fs-service-system/src/main/java/com/fs/store/mapper/FsInquiryOrderMapper.java

@@ -0,0 +1,443 @@
+package com.fs.store.mapper;
+
+import com.fs.common.annotation.DataSource;
+import com.fs.common.enums.DataSourceType;
+import com.fs.store.domain.FsInquiryOrder;
+import com.fs.store.domain.FsInquiryOrderMsg;
+import com.fs.store.domain.FsStoreOrderLogs;
+import com.fs.store.param.FsInquiryOrderListPDParam;
+import com.fs.store.param.FsInquiryOrderListUParam;
+import com.fs.store.param.FsInquiryOrderParam;
+import com.fs.store.vo.*;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * 问诊订单Mapper接口
+ *
+ * @author fs
+ * @date 2023-06-12
+ */
+@Repository
+public interface FsInquiryOrderMapper
+{
+    /**
+     * 查询问诊订单
+     *
+     * @param orderId 问诊订单主键
+     * @return 问诊订单
+     */
+    public FsInquiryOrder selectFsInquiryOrderByOrderId(Long orderId);
+
+    /**
+     * 查询问诊订单列表
+     *
+     * @param fsInquiryOrder 问诊订单
+     * @return 问诊订单集合
+     */
+    public List<FsInquiryOrder> selectFsInquiryOrderList(FsInquiryOrder fsInquiryOrder);
+
+    /**
+     * 新增问诊订单
+     *
+     * @param fsInquiryOrder 问诊订单
+     * @return 结果
+     */
+    public int insertFsInquiryOrder(FsInquiryOrder fsInquiryOrder);
+
+    /**
+     * 修改问诊订单
+     *
+     * @param fsInquiryOrder 问诊订单
+     * @return 结果
+     */
+    public int updateFsInquiryOrder(FsInquiryOrder fsInquiryOrder);
+
+    /**
+     * 删除问诊订单
+     *
+     * @param orderId 问诊订单主键
+     * @return 结果
+     */
+    public int deleteFsInquiryOrderByOrderId(Long orderId);
+
+    /**
+     * 批量删除问诊订单
+     *
+     * @param orderIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteFsInquiryOrderByOrderIds(Long[] orderIds);
+
+    @Select({"<script> " +
+            "select io.*,dc.doctor_name,dc.account as doctor_account,det.dept_name,c.company_name,cu.nick_name company_user_name ," +
+            "io.patient_json->>'$.patientName'as  patient_name,syu.nick_name user_name" +
+            " from fs_inquiry_order io " +
+            " LEFT JOIN fs_doctor dc ON io.doctor_id =dc.doctor_id" +
+            " LEFT JOIN fs_department det ON det.dept_id =io.department_id  " +
+            "LEFT JOIN sys_user syu ON syu.user_id =io.audit_user_id " +
+            " LEFT JOIN company c ON c.company_id= io.company_id " +
+            "LEFT JOIN company_user cu ON cu.user_id=io.company_user_id  "+
+            "            <if test=\"maps.phone != null  and maps.phone != ''\"> LEFT JOIN fs_user fu ON fu.user_id=io.user_id</if>\n" +
+            " where 1=1 " +
+            "            <if test=\"maps.orderSn != null  and maps.orderSn != ''\"> and io.order_sn = #{maps.orderSn}</if>\n" +
+            "            <if test=\"maps.title != null  and maps.title != ''\"> and io.title = #{maps.title}</if>\n" +
+            "            <if test=\"maps.userId != null \"> and io.user_id = #{maps.userId}</if>\n" +
+            "            <if test=\"maps.doctorName != null \">  and dc.doctor_name like concat('%', #{maps.doctorName}, '%')</if>\n" +
+            "            <if test=\"maps.patientId != null \"> and io.patient_id = #{maps.patientId}</if>\n" +
+            "            <if test=\"maps.patientName != null \"> and io.patient_json like concat('%',#{maps.patientName},'%')</if>\n" +
+            "            <if test=\"maps.orderType != null \"> and io.order_type = #{maps.orderType}</if>\n" +
+            "            <if test=\"maps.payType != null \"> and io.pay_type = #{maps.payType}</if>\n" +
+            "            <if test=\"maps.isPay != null \"> and io.is_pay = #{maps.isPay}</if>\n" +
+            "            <if test=\"maps.doctorId != null \"> and io.doctor_id = #{maps.doctorId}</if>\n" +
+            "            <if test=\"maps.status != null \"> and io.status = #{maps.status}</if>\n" +
+            "            <if test=\"maps.sTime != null \">  and io.start_time &gt;= DATE_FORMAT(#{maps.sTime},'%Y-%m-%d 00:00:00') </if>\n" +
+            "            <if test=\"maps.eTime != null \">  and io.start_time &lt;= DATE_FORMAT(#{maps.eTime},'%Y-%m-%d 23:59:59') </if>\n" +
+            "            <if test=\"maps.fsTime != null \">  and io.finish_time &gt;= DATE_FORMAT(#{maps.fsTime},'%Y-%m-%d 00:00:00') </if>\n" +
+            "            <if test=\"maps.feTime != null \">  and io.finish_time &lt;= DATE_FORMAT(#{maps.feTime},'%Y-%m-%d 23:59:59') </if>\n" +
+            "            <if test=\"maps.isPing != null \"> and io.is_ping = #{maps.isPing}</if>\n" +
+            "            <if test=\"maps.departmentId != null \"> and io.department_id = #{maps.departmentId}</if>\n" +
+            "            <if test=\"maps.inquiryType != null \"> and io.inquiry_type = #{maps.inquiryType}</if>\n" +
+            "            <if test=\"maps.phone != null  and maps.phone != ''\"> and fu.phone = #{maps.phone}</if>\n" +
+            "            <if test=\"maps.companyId != null  \"> and io.company_id = #{maps.companyId}</if>\n" +
+            "            <if test=\"maps.companyUserId != null  \"> and io.company_user_id = #{maps.companyUserId}</if>\n" +
+            "            <if test=\"maps.companyUserName != null  \"> and cu.user_name = #{maps.companyUserName}</if>\n" +
+            "            <if test=\"maps.inquirySubType != null  \"> and io.inquiry_sub_type = #{maps.inquirySubType}</if>\n" +
+            "            <if test = 'maps.createTimeList != null    '>  AND date_format(io.create_time,'%y%m%d') &gt;= date_format(#{maps.createTimeList[0]},'%y%m%d') AND date_format(io.create_time,'%y%m%d') &lt;= date_format(#{maps.createTimeList[1]},'%y%m%d') </if>" +
+            "            <if test = 'maps.payTimeList != null    '>  AND date_format(io.pay_time,'%y%m%d') &gt;= date_format(#{maps.payTimeList[0]},'%y%m%d')  AND date_format(io.pay_time,'%y%m%d') &lt;= date_format(#{maps.payTimeList[1]},'%y%m%d') </if>" +
+            "            <if test = 'maps.deptId != null    '>  AND (io.dept_id = #{maps.deptId} OR io.dept_id IN ( SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors) )) </if>" +
+            "            <if test = 'maps.inquirySubType != null    '> and io.inquiry_sub_type =#{maps.inquirySubType} </if>" +
+            "            <if test = 'maps.doctorAccount != null    '> and dc.account =#{maps.doctorAccount} </if>" +
+            "            <if test = 'maps.companyUserNickName != null and  maps.companyUserNickName !=  \"\" '>  and cu.nick_name like concat( #{maps.companyUserNickName}, '%') </if>" +
+            " order by io.order_id desc" +
+            "</script>"})
+    @DataSource(DataSourceType.SLAVE)
+    List<FsInquiryOrderListVO> selectFsInquiryOrderVOList(@Param("maps") FsInquiryOrderParam fsInquiryOrder);
+    @Select("select io.*,dc.doctor_name,det.dept_name,op.ping_star,op.ping_content, io.patient_json->>'$.patientName'as  patient_name,syu.nick_name user_name,fuc.send_user_id,send.nick_name sendName  from fs_inquiry_order io  LEFT JOIN fs_doctor dc ON io.doctor_id =dc.doctor_id LEFT JOIN fs_department det ON det.dept_id =io.department_id LEFT JOIN fs_inquiry_order_ping op ON op.order_id=io.order_id LEFT JOIN sys_user syu ON syu.user_id =io.audit_user_id LEFT JOIN fs_user_coupon fuc ON io.user_coupon_id=fuc.id LEFT JOIN sys_user send ON send.user_id=fuc.send_user_id " +
+            " where io.order_id=#{orderId}")
+    FsInquiryOrderVO selectFsInquiryOrderVOByOrderId(Long orderId);
+
+    @Select("SELECT * FROM  fs_inquiry_order_msg WHERE order_id =#{orderId}")
+    List<FsInquiryOrderMsg> selectFsInquiryOrderMsgByOrderId(Long orderId);
+    @Select({"<script> " +
+            "select o.*,d.doctor_name,d.avatar,dt.dept_name  from fs_inquiry_order o left join fs_doctor d on d.doctor_id=o.doctor_id  LEFT JOIN fs_department dt ON d.dept_id =dt.dept_id  " +
+            "where 1=1  " +
+            "<if test = 'maps.userId != null     '> " +
+            "and o.user_id = #{maps.userId} " +
+            "</if>" +
+            "<if test = 'maps.companyUserId != null     '> " +
+            "and o.company_user_id = #{maps.companyUserId} " +
+            "</if>" +
+            "<if test = 'maps.inquiryType != null and maps.inquiryType>0   '> " +
+            "and o.inquiry_type = #{maps.inquiryType} " +
+            "</if>" +
+            " order by o.create_time desc "+
+            "</script>"})
+    List<FsInquiryOrderListUVO> selectFsInquiryOrderListUVO(@Param("maps") FsInquiryOrderListUParam param);
+    @Select("SELECT * FROM  fs_inquiry_order WHERE order_sn =#{orderSn}")
+    FsInquiryOrder selectFsInquiryOrderByOrderSn(String orderSn);
+    @Select({"<script> " +
+            "select o.*,u.avatar  from fs_inquiry_order o left join fs_user u on u.user_id=o.user_id   " +
+            "where o.is_audit=1  " +
+            "<if test = 'maps.keyword != null   and maps.keyword!=\"\"   '> " +
+            "and ( o.order_sn like CONCAT('%',#{maps.keyword},'%') || o.patient_json->>'$.patientName' like CONCAT('%',#{maps.keyword},'%') || o.patient_json->>'$.mobile' like CONCAT('%',#{maps.keyword},'%')   ) " +
+            "</if>" +
+            "<if test = 'maps.isReceive != null   and maps.isReceive==0 and  maps.isAccept != null   and maps.isAccept==1 and maps.isSelf!=null and maps.isSelf==1   '> " +
+            "and o.is_receive = #{maps.isReceive} and (o.inquiry_type=1 or o.inquiry_type=2) " +
+            "</if>" +
+            "<if test = 'maps.isReceive != null   and maps.isReceive==0 and maps.isAccept != null   and maps.isAccept==1 and maps.isSelf!=null and maps.isSelf==0   '> " +
+            "and o.is_receive = #{maps.isReceive} and (o.inquiry_type=1 or o.inquiry_type=3)  " +
+            "</if>" +
+            "<if test = 'maps.isReceive != null   and maps.isReceive==0 and maps.isAccept != null   and maps.isAccept==0    '> " +
+            "and o.is_receive = #{maps.isReceive} and 1=0   " +
+            "</if>" +
+            "<if test = 'maps.isReceive != null   and maps.isReceive==1   '> " +
+            "and o.is_receive = #{maps.isReceive} and o.doctor_id = #{maps.doctorId} " +
+            "</if>" +
+            "<if test = 'maps.status != null and maps.status != 0   '> " +
+            "and o.status = #{maps.status} " +
+            "</if>" +
+            " order by o.create_time desc "+
+            "</script>"})
+    List<FsInquiryOrderListDVO> selectFsInquiryOrderListDVO(@Param("maps") FsInquiryOrderListDParam param);
+    @Select({"<script> " +
+            "select o.*,u.avatar,c.company_name,c.company_id as companyId,cu.nick_name nickName  from fs_inquiry_order o left join fs_user u on u.user_id=o.user_id LEFT JOIN company c ON c.company_id=o.company_id LEFT JOIN  company_user cu on o.company_user_id = cu.user_id   " +
+            "where o.is_audit=1  " +
+            "<if test = 'maps.keyword != null   and maps.keyword!=\"\"   '> " +
+            "and ( o.order_sn like CONCAT('%',#{maps.keyword},'%') || o.patient_json->>'$.patientName' like CONCAT('%',#{maps.keyword},'%') || o.patient_json->>'$.mobile' like CONCAT('%',#{maps.keyword},'%')   ) " +
+            "</if>" +
+            "<if test = 'maps.phone != null   and maps.phone!=\"\"   '> " +
+            "and ( o.patient_json->>'$.mobile' like CONCAT('%',#{maps.phone},'%') ) " +
+            "</if>" +
+            "<if test = 'maps.companyId != null '> " +
+            "and  o.company_id = #{maps.companyId}  " +
+            "</if>" +
+            "<if test = 'maps.userId != null '> " +
+            "and  o.user_id = #{maps.userId}  " +
+            "</if>" +
+            "<if test = 'maps.companyUserNickName != null and maps.companyUserNickName!=\"\" '> " +
+            "and  cu.nick_name = #{maps.companyUserNickName}  " +
+            "</if>" +
+            " <if test=\"maps.sTime != null \">  and DATE(o.start_time) &gt;= DATE(#{maps.sTime})</if>\n" +
+            " <if test=\"maps.eTime != null \">  and DATE(o.start_time) &lt;= DATE(#{maps.eTime})</if>\n" +
+            "<if test = 'maps.isReceive != null   and maps.isReceive==0 and  maps.isAccept != null   and maps.isAccept==1 and maps.isSelf!=null and maps.isSelf==1   '> " +
+            "and o.is_receive = #{maps.isReceive} and (o.inquiry_type=1 or o.inquiry_type=2) " +
+            "</if>" +
+            "<if test = 'maps.isReceive != null   and maps.isReceive==0 and maps.isAccept != null   and maps.isAccept==1 and maps.isSelf!=null and maps.isSelf==0   '> " +
+            "and o.is_receive = #{maps.isReceive} and (o.inquiry_type=1 or o.inquiry_type=3)  " +
+            "</if>" +
+            "<if test = 'maps.isReceive != null   and maps.isReceive==0 and maps.isAccept != null   and maps.isAccept==0    '> " +
+            "and o.is_receive = #{maps.isReceive} and 1=0   " +
+            "</if>" +
+            "<if test = 'maps.isReceive != null   and maps.isReceive==1   '> " +
+            "and o.is_receive = #{maps.isReceive}  " +
+            "</if>" +
+            "<if test = 'maps.doctorId != null and maps.doctorId != 0   '> " +
+            "and o.doctor_id = #{maps.doctorId} " +
+            "</if>" +
+            "<if test = 'maps.status != null and maps.status != 0   '> " +
+            "and o.status = #{maps.status} " +
+            "</if>" +
+            " order by o.create_time desc "+
+            "</script>"})
+    List<FsInquiryOrderListPDVO> selectFsInquiryOrderListPDVO(@Param("maps") FsInquiryOrderListPDParam param);
+
+    @Select("select ifnull(count(1),0) from fs_inquiry_order where status=3 and doctor_id=#{doctorId} and user_id=#{userId}")
+    int checkAcceptOrder(@Param("doctorId") Long doctorId,@Param("userId") Long userId);
+    @Select("select ifnull(count(1),0) from fs_inquiry_order where status=2 and is_audit=1 and doctor_id=#{doctorId}    ")
+    Integer getDoctorDoReceiveOrder(@Param("doctorId")String doctorId);
+    @Select("SELECT * FROM fs_inquiry_order_logs WHERE order_id =#{orderId}")
+    List<FsStoreOrderLogs> selectFsInquiryOrderLogsList(String orderId);
+    @Select({"<script> " +
+            "select io.*,dc.doctor_name,dc.account,det.dept_name,c.company_name,cu.nick_name company_user_name ," +
+            "io.patient_json->>'$.patientName'as  patient_name,syu.nick_name user_name," +
+//            "fuc.send_user_id," +
+//            "send.nick_name sendName," +
+            "IF(fdr.report_id IS NULL, 0, 1) AS isDrugReport " +
+            " from fs_inquiry_order io  LEFT JOIN fs_doctor dc ON io.doctor_id =dc.doctor_id " +
+            " LEFT JOIN fs_department det ON det.dept_id =io.department_id  " +
+            " LEFT JOIN sys_user syu ON syu.user_id =io.audit_user_id" +
+//            " LEFT JOIN fs_user_coupon fuc ON io.user_coupon_id=fuc.id" +
+//            " LEFT JOIN sys_user send ON send.user_id=fuc.send_user_id" +
+            " LEFT JOIN company c ON c.company_id= io.company_id" +
+            " LEFT JOIN company_user cu ON cu.user_id=io.company_user_id" +
+            " LEFT JOIN fs_inquiry_order_report fdr ON fdr.order_id=io.order_id "+
+            "            <if test=\"maps.phone != null  and maps.phone != ''\"> LEFT JOIN fs_user fu ON fu.user_id=io.user_id</if>\n" +
+            " where 1=1 " +
+            "            <if test=\"maps.orderSn != null  and maps.orderSn != ''\"> and io.order_sn = #{maps.orderSn}</if>\n" +
+            "            <if test=\"maps.title != null  and maps.title != ''\"> and io.title = #{maps.title}</if>\n" +
+            "            <if test=\"maps.userId != null \"> and io.user_id = #{maps.userId}</if>\n" +
+            "            <if test=\"maps.doctorName != null \">  and dc.doctor_name like concat('%', #{maps.doctorName}, '%')</if>\n" +
+            "            <if test=\"maps.patientId != null \"> and io.patient_id = #{maps.patientId}</if>\n" +
+            "            <if test=\"maps.patientName != null \"> and io.patient_json like concat('%',#{maps.patientName},'%')</if>\n" +
+            "            <if test=\"maps.orderType != null \"> and io.order_type = #{maps.orderType}</if>\n" +
+            "            <if test=\"maps.payType != null \"> and io.pay_type = #{maps.payType}</if>\n" +
+            "            <if test=\"maps.isPay != null \"> and io.is_pay = #{maps.isPay}</if>\n" +
+            "            <if test=\"maps.doctorId != null \"> and io.doctor_id = #{maps.doctorId}</if>\n" +
+            "            <if test=\"maps.status != null \"> and io.status = #{maps.status}</if>\n" +
+            "            <if test=\"maps.sTime != null \">  and io.start_time &gt;= DATE_FORMAT(#{maps.sTime},'%Y-%m-%d 00:00:00')</if>\n" +
+            "            <if test=\"maps.eTime != null \">  and io.start_time &lt;= DATE_FORMAT(#{maps.eTime},'%Y-%m-%d 23:59:59')</if>\n" +
+            "            <if test=\"maps.fsTime != null \">  and io.finish_time &gt;= DATE_FORMAT(#{maps.fsTime},'%Y-%m-%d 00:00:00')</if>\n" +
+            "            <if test=\"maps.feTime != null \">  and io.finish_time &lt;= DATE_FORMAT(#{maps.feTime},'%Y-%m-%d 23:59:59')</if>\n" +
+            "            <if test=\"maps.isPing != null \"> and io.is_ping = #{maps.isPing}</if>\n" +
+            "            <if test=\"maps.departmentId != null \"> and io.department_id = #{maps.departmentId}</if>\n" +
+            "            <if test=\"maps.inquiryType != null \"> and io.inquiry_type = #{maps.inquiryType}</if>\n" +
+//            "            <if test=\"maps.sendName != null \"> and send.nick_name like concat( #{maps.sendName}, '%')</if>\n" +
+            "            <if test=\"maps.phone != null  and maps.phone != ''\"> and fu.phone = #{maps.phone}</if>\n" +
+            "            <if test=\"maps.companyId != null  \"> and io.company_id = #{maps.companyId}</if>\n" +
+            "            <if test=\"maps.companyUserId != null  \"> and io.company_user_id = #{maps.companyUserId}</if>\n" +
+            "            <if test = 'maps.createTimeList != null    '>  AND date_format(io.create_time,'%y%m%d') &gt;= date_format(#{maps.createTimeList[0]},'%y%m%d')  AND date_format(io.create_time,'%y%m%d') &lt;= date_format(#{maps.createTimeList[1]},'%y%m%d') </if>" +
+            "            <if test = 'maps.payTimeList != null    '>  AND date_format(io.pay_time,'%y%m%d') &gt;= date_format(#{maps.payTimeList[0]},'%y%m%d')  AND date_format(io.pay_time,'%y%m%d') &lt;= date_format(#{maps.payTimeList[1]},'%y%m%d') </if>" +
+            "            <if test = 'maps.inquirySubType != null   '> and io.inquiry_sub_type =#{maps.inquirySubType} </if>" +
+            "            <if test = 'maps.deptId != null    '>  AND (io.dept_id = #{maps.deptId} OR io.dept_id IN ( SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors) )) </if>" +
+            "            <if test = 'maps.doctorAccount != null    '> and dc.account =#{maps.doctorAccount} </if>" +
+            "            <if test = 'maps.companyUserNickName != null and  maps.companyUserNickName !=  \"\" '> and cu.nick_name like concat( #{maps.companyUserNickName}, '%') </if>" +
+            "<if test='maps.lastOrderId != null '> and io.order_id &lt; #{maps.lastOrderId}</if>"+
+            " order by io.order_id desc" +
+            " <if test='maps.limitSqlStr != null and maps.limitSqlStr != \"\"' >  ${maps.limitSqlStr}  </if>" +
+            "</script>"})
+    @DataSource(DataSourceType.SLAVE)
+    List<FsInquiryOrderExeclListVO> selectFsInquiryOrderExcelListVO(@Param("maps") FsInquiryOrderParam fsInquiryOrder);
+
+
+    @Select({"<script> " +
+            "select io.*,dc.doctor_name,c.company_name,cu.nick_name company_user_name ,io.patient_json->>'$.patientName'as  patient_name," +
+            "io.patient_json->>'$.mobile'as  patient_tel  " +
+            "from fs_inquiry_order io " +
+            " LEFT JOIN fs_doctor dc ON io.doctor_id =dc.doctor_id  " +
+            "LEFT JOIN company c ON c.company_id= io.company_id " +
+            "LEFT JOIN company_user cu ON cu.user_id=io.company_user_id "+
+            "            <if test=\"maps.phone != null  and maps.phone != ''\"> LEFT JOIN fs_user fu ON fu.user_id=io.user_id</if>\n" +
+            " where 1=1 " +
+            "            <if test=\"maps.orderSn != null  and maps.orderSn != ''\"> and io.order_sn = #{maps.orderSn}</if>\n" +
+            "            <if test=\"maps.title != null  and maps.title != ''\"> and io.title = #{maps.title}</if>\n" +
+            "            <if test=\"maps.userId != null \"> and io.user_id = #{maps.userId}</if>\n" +
+            "            <if test=\"maps.doctorName != null \">  and dc.doctor_name like concat('%', #{maps.doctorName}, '%')</if>\n" +
+            "            <if test=\"maps.patientId != null \"> and io.patient_id = #{maps.patientId}</if>\n" +
+            "            <if test=\"maps.patientName != null \"> and io.patient_json like concat('%',#{maps.patientName},'%')</if>\n" +
+            "            <if test=\"maps.orderType != null \"> and io.order_type = #{maps.orderType}</if>\n" +
+            "            <if test=\"maps.payType != null \"> and io.pay_type = #{maps.payType}</if>\n" +
+            "            <if test=\"maps.isPay != null \"> and io.is_pay = #{maps.isPay}</if>\n" +
+            "            <if test=\"maps.doctorId != null \"> and io.doctor_id = #{maps.doctorId}</if>\n" +
+            "            <if test=\"maps.status != null \"> and io.status = #{maps.status}</if>\n" +
+            "            <if test=\"maps.sTime != null \">  and io.start_time &gt;= DATE_FORMAT(#{maps.sTime},'%Y-%m-%d 00:00:00') </if>\n" +
+            "            <if test=\"maps.eTime != null \">  and io.start_time &lt;= DATE_FORMAT(#{maps.eTime},'%Y-%m-%d 23:59:59') </if>\n" +
+            "            <if test=\"maps.finishTime != null \"> and (io.finish_time &gt;= DATE_FORMAT(#{maps.finishTime},'%Y-%m-%d 00:00:00') and io.finish_time &lt;= DATE_FORMAT(#{maps.finishTime},'%Y-%m-%d 23:59:59')) </if>\n" +
+            "            <if test=\"maps.isPing != null \"> and io.is_ping = #{maps.isPing}</if>\n" +
+            "            <if test=\"maps.departmentId != null \"> and io.department_id = #{maps.departmentId}</if>\n" +
+            "            <if test=\"maps.inquiryType != null \"> and io.inquiry_type = #{maps.inquiryType}</if>\n" +
+            "            <if test=\"maps.sendName != null \"> and send.nick_name like concat( #{maps.sendName}, '%')</if>\n" +
+            "            <if test=\"maps.phone != null  and maps.phone != ''\"> and fu.phone = #{maps.phone}</if>\n" +
+            "            <if test=\"maps.companyId != null  \"> and io.company_id = #{maps.companyId}</if>\n" +
+            "            <if test=\"maps.companyUserId != null  \"> and io.company_user_id = #{maps.companyUserId}</if>\n" +
+            "<if test = 'maps.createTimeList != null    '> " +
+            " AND date_format(io.create_time,'%y%m%d') &gt;= date_format(#{maps.createTimeList[0]},'%y%m%d') " +
+            " AND date_format(io.create_time,'%y%m%d') &lt;= date_format(#{maps.createTimeList[1]},'%y%m%d') " +
+            "</if>" +
+            "<if test = 'maps.payTimeList != null    '> " +
+            " AND date_format(io.pay_time,'%y%m%d') &gt;= date_format(#{maps.payTimeList[0]},'%y%m%d') " +
+            " AND date_format(io.pay_time,'%y%m%d') &lt;= date_format(#{maps.payTimeList[1]},'%y%m%d') " +
+            "</if>" +
+            "<if test = 'maps.inquirySubType != null    '> " +
+            "and io.inquiry_sub_type =#{maps.inquirySubType} " +
+            "</if>" +
+            "<if test = 'maps.deptId != null    '> " +
+            "  AND (io.dept_id = #{maps.deptId} OR io.dept_id IN ( SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors) )) " +
+            "</if>" +
+            "<if test = 'maps.doctorAccount != null    '> " +
+            "and dc.account =#{maps.doctorAccount} " +
+            "</if>" +
+            " <if test = 'maps.companyUserNickName != null and  maps.companyUserNickName !=  \"\" '> " +
+            " and cu.nick_name like concat( #{maps.companyUserNickName}, '%') " +
+            "</if>" +
+            "<if test='maps.lastOrderId !=null '> and io.order_id &lt;  #{maps.lastOrderId}  </if>" +
+            " order by io.order_id desc" +
+            " <if test='maps.limitSqlStr != null and maps.limitSqlStr != \"\"' >  ${maps.limitSqlStr}  </if>" +
+            "</script>"})
+    @DataSource(DataSourceType.SLAVE)
+    List<FsInquiryFeedbackExportListVO> selectFsInquiryFeedbackExportListVO(@Param("maps") FsInquiryOrderParam fsInquiryOrder);
+
+
+    @Select("select *  from fs_inquiry_order where patient_json LIKE '%https://htj-1258038825.cos.ap-beijing.myqcloud.com%' order by order_id desc ")
+    List<FsInquiryOrder> selectFsInquiryOrderListByUpdate();
+    @Select("select * from fs_inquiry_order where order_type=2 AND inquiry_sub_type=3 and patient_json LIKE \"%未就诊%\"")
+    List<FsInquiryOrder> selectFsInquiryOrderByOrderIdSub3();
+
+    @Select("select * from fs_inquiry_order where status = 3 and (inquiry_type = 1 or inquiry_type = 3)  AND TIMESTAMPDIFF(HOUR, start_time, NOW()) >= 48  ")
+    List<FsInquiryOrder> selectFsInquiryOrderByFinish();
+
+    @Select("select * from fs_inquiry_order where status = 3 and (inquiry_type = 1 or inquiry_type = 3) and is_send_sms = 0 and  TIMESTAMPDIFF(HOUR, start_time, NOW()) > 36  AND TIMESTAMPDIFF(HOUR, start_time, NOW()) < 48 ")
+    List<FsInquiryOrder> selectFsInquiryOrderBySendSms();
+    @Select("select patient_json->>'$.tongueImages'as  patient_name from fs_inquiry_order where inquiry_type=2 and title !='服务问诊' AND patient_json->>'$.tongueImages' !='' and create_time>'2024-08-27'")
+    List<String> selectTongueImages();
+
+
+    @Select("select order_sn from fs_inquiry_order where order_id=#{orderId}")
+    String selectFsInquiryOrderSnByOrderId(long orderId);
+
+    @Select({"<script> " +
+            "select count(1)  from fs_inquiry_order io " +
+            " LEFT JOIN fs_doctor dc ON io.doctor_id =dc.doctor_id" +
+            " LEFT JOIN fs_department det ON det.dept_id =io.department_id " +
+            " LEFT JOIN sys_user syu ON syu.user_id =io.audit_user_id " +
+//            "LEFT JOIN fs_user_coupon fuc ON io.user_coupon_id=fuc.id" +
+//            " LEFT JOIN sys_user send ON send.user_id=fuc.send_user_id " +
+            "LEFT JOIN company c ON c.company_id= io.company_id " +
+            "LEFT JOIN company_user cu ON cu.user_id=io.company_user_id " +
+            "LEFT JOIN fs_inquiry_order_report fdr ON fdr.order_id=io.order_id "+
+            "            <if test=\"maps.phone != null  and maps.phone != ''\"> LEFT JOIN fs_user fu ON fu.user_id=io.user_id</if>\n" +
+            " where 1=1 " +
+            "            <if test=\"maps.orderSn != null  and maps.orderSn != ''\"> and io.order_sn = #{maps.orderSn}</if>\n" +
+            "            <if test=\"maps.title != null  and maps.title != ''\"> and io.title = #{maps.title}</if>\n" +
+            "            <if test=\"maps.userId != null \"> and io.user_id = #{maps.userId}</if>\n" +
+            "            <if test=\"maps.doctorName != null \">  and dc.doctor_name like concat('%', #{maps.doctorName}, '%')</if>\n" +
+            "            <if test=\"maps.patientId != null \"> and io.patient_id = #{maps.patientId}</if>\n" +
+            "            <if test=\"maps.patientName != null \"> and io.patient_json like concat('%',#{maps.patientName},'%')</if>\n" +
+            "            <if test=\"maps.orderType != null \"> and io.order_type = #{maps.orderType}</if>\n" +
+            "            <if test=\"maps.payType != null \"> and io.pay_type = #{maps.payType}</if>\n" +
+            "            <if test=\"maps.isPay != null \"> and io.is_pay = #{maps.isPay}</if>\n" +
+            "            <if test=\"maps.doctorId != null \"> and io.doctor_id = #{maps.doctorId}</if>\n" +
+            "            <if test=\"maps.status != null \"> and io.status = #{maps.status}</if>\n" +
+            "            <if test=\"maps.sTime != null \">  and io.start_time &gt;= DATE_FORMAT(#{maps.sTime},'%Y-%m-%d 00:00:00')</if>\n" +
+            "            <if test=\"maps.eTime != null \">  and io.start_time &lt;= DATE_FORMAT(#{maps.eTime},'%Y-%m-%d 23:59:59') </if>\n" +
+            "            <if test=\"maps.finishTime != null \"> and (io.finish_time &gt;= DATE_FORMAT(#{maps.finishTime},'%Y-%m-%d 00:00:00') and io.finish_time &lt;= DATE_FORMAT(#{maps.finishTime},'%Y-%m-%d 23:59:59') )</if>\n" +
+            "            <if test=\"maps.isPing != null \"> and io.is_ping = #{maps.isPing}</if>\n" +
+            "            <if test=\"maps.departmentId != null \"> and io.department_id = #{maps.departmentId}</if>\n" +
+            "            <if test=\"maps.inquiryType != null \"> and io.inquiry_type = #{maps.inquiryType}</if>\n" +
+//            "            <if test=\"maps.sendName != null \"> and send.nick_name like concat( #{maps.sendName}, '%')</if>\n" +
+            "            <if test=\"maps.phone != null  and maps.phone != ''\"> and fu.phone = #{maps.phone}</if>\n" +
+            "            <if test=\"maps.companyId != null  \"> and io.company_id = #{maps.companyId}</if>\n" +
+            "            <if test=\"maps.companyUserId != null  \"> and io.company_user_id = #{maps.companyUserId}</if>\n" +
+            "            <if test = 'maps.createTimeList != null    '>  AND date_format(io.create_time,'%y%m%d') &gt;= date_format(#{maps.createTimeList[0]},'%y%m%d')  AND date_format(io.create_time,'%y%m%d') &lt;= date_format(#{maps.createTimeList[1]},'%y%m%d') </if>" +
+            "            <if test = 'maps.payTimeList != null    '>  AND date_format(io.pay_time,'%y%m%d') &gt;= date_format(#{maps.payTimeList[0]},'%y%m%d')  AND date_format(io.pay_time,'%y%m%d') &lt;= date_format(#{maps.payTimeList[1]},'%y%m%d') </if>" +
+            "            <if test = 'maps.inquirySubType != null   '> and io.inquiry_sub_type =#{maps.inquirySubType} </if>" +
+            "            <if test = 'maps.deptId != null    '>  AND (io.dept_id = #{maps.deptId} OR io.dept_id IN ( SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors) )) </if>" +
+            "            <if test = 'maps.doctorAccount != null    '> and dc.account =#{maps.doctorAccount} </if>" +
+            "            <if test = 'maps.companyUserNickName != null and  maps.companyUserNickName !=  \"\" '> and cu.nick_name like concat( #{maps.companyUserNickName}, '%') </if>" +
+            " order by io.order_id desc" +
+            "</script>"})
+    @DataSource(DataSourceType.SLAVE)
+    Long selectFsInquiryOrderExcelListVOCount(@Param("maps") FsInquiryOrderParam fsInquiryOrder);
+    @Select({"<script> " +
+            "select count(1)  from fs_inquiry_order io " +
+            " LEFT JOIN fs_doctor dc ON io.doctor_id =dc.doctor_id " +
+            " LEFT JOIN company c ON c.company_id= io.company_id " +
+            "LEFT JOIN company_user cu ON cu.user_id=io.company_user_id "+
+            "            <if test=\"maps.phone != null  and maps.phone != ''\"> LEFT JOIN fs_user fu ON fu.user_id=io.user_id</if>\n" +
+            " where 1=1 " +
+            "            <if test=\"maps.orderSn != null  and maps.orderSn != ''\"> and io.order_sn = #{maps.orderSn}</if>\n" +
+            "            <if test=\"maps.title != null  and maps.title != ''\"> and io.title = #{maps.title}</if>\n" +
+            "            <if test=\"maps.userId != null \"> and io.user_id = #{maps.userId}</if>\n" +
+            "            <if test=\"maps.doctorName != null \">  and dc.doctor_name like concat('%', #{maps.doctorName}, '%')</if>\n" +
+            "            <if test=\"maps.patientId != null \"> and io.patient_id = #{maps.patientId}</if>\n" +
+            "            <if test=\"maps.patientName != null \"> and io.patient_json like concat('%',#{maps.patientName},'%')</if>\n" +
+            "            <if test=\"maps.orderType != null \"> and io.order_type = #{maps.orderType}</if>\n" +
+            "            <if test=\"maps.payType != null \"> and io.pay_type = #{maps.payType}</if>\n" +
+            "            <if test=\"maps.isPay != null \"> and io.is_pay = #{maps.isPay}</if>\n" +
+            "            <if test=\"maps.doctorId != null \"> and io.doctor_id = #{maps.doctorId}</if>\n" +
+            "            <if test=\"maps.status != null \"> and io.status = #{maps.status}</if>\n" +
+            "            <if test=\"maps.sTime != null \">  and io.start_time &gt;= DATE_FORMAT(#{maps.sTime},'%Y-%m-%d 00:00:00') </if>\n" +
+            "            <if test=\"maps.eTime != null \">  and io.start_time &lt;= DATE_FORMAT(#{maps.eTime},'%Y-%m-%d 23:59:59')</if>\n" +
+            "            <if test=\"maps.finishTime != null \"> and (io.finish_time &gt;= DATE_FORMAT(#{maps.finishTime},'%Y-%m-%d 00:00:00') and io.finish_time &lt;= DATE_FORMAT(#{maps.finishTime},'%Y-%m-%d 23:59:59') )</if>\n" +
+            "            <if test=\"maps.isPing != null \"> and io.is_ping = #{maps.isPing}</if>\n" +
+            "            <if test=\"maps.departmentId != null \"> and io.department_id = #{maps.departmentId}</if>\n" +
+            "            <if test=\"maps.inquiryType != null \"> and io.inquiry_type = #{maps.inquiryType}</if>\n" +
+            "            <if test=\"maps.sendName != null \"> and send.nick_name like concat( #{maps.sendName}, '%')</if>\n" +
+            "            <if test=\"maps.phone != null  and maps.phone != ''\"> and fu.phone = #{maps.phone}</if>\n" +
+            "            <if test=\"maps.companyId != null  \"> and io.company_id = #{maps.companyId}</if>\n" +
+            "            <if test=\"maps.companyUserId != null  \"> and io.company_user_id = #{maps.companyUserId}</if>\n" +
+            "<if test = 'maps.createTimeList != null    '> " +
+            " AND date_format(io.create_time,'%y%m%d') &gt;= date_format(#{maps.createTimeList[0]},'%y%m%d') " +
+            " AND date_format(io.create_time,'%y%m%d') &lt;= date_format(#{maps.createTimeList[1]},'%y%m%d') " +
+            "</if>" +
+            "<if test = 'maps.payTimeList != null    '> " +
+            " AND date_format(io.pay_time,'%y%m%d') &gt;= date_format(#{maps.payTimeList[0]},'%y%m%d') " +
+            " AND date_format(io.pay_time,'%y%m%d') &lt;= date_format(#{maps.payTimeList[1]},'%y%m%d') " +
+            "</if>" +
+            "<if test = 'maps.inquirySubType != null    '> " +
+            "and io.inquiry_sub_type =#{maps.inquirySubType} " +
+            "</if>" +
+            "<if test = 'maps.deptId != null    '> " +
+            "  AND (io.dept_id = #{maps.deptId} OR io.dept_id IN ( SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors) )) " +
+            "</if>" +
+            "<if test = 'maps.doctorAccount != null    '> " +
+            "and dc.account =#{maps.doctorAccount} " +
+            "</if>" +
+            " <if test = 'maps.companyUserNickName != null and  maps.companyUserNickName !=  \"\" '> " +
+            " and cu.nick_name like concat( #{maps.companyUserNickName}, '%') " +
+            "</if>" +
+            " order by io.order_id desc" +
+            "</script>"})
+    @DataSource(DataSourceType.SLAVE)
+    Long selectFsInquiryFeedbackExportListVOCount(@Param("maps") FsInquiryOrderParam fsInquiryOrder);
+
+    int revokeFsInquiryOrder(FsInquiryOrder fsInquiryOrder);
+
+    @Select("select order_id,patient_json  from fs_inquiry_order where order_id > #{orderId} ORDER BY order_id asc  limit 500")
+    List<FsInquiryOrder> selectFsInquiryOrderPhoneList(FsInquiryOrder order);
+
+    FsPackageOrderVO selectOrderMsgByPackageOrderId(@Param("packageOrderId") Long packageOrderId);
+}

+ 16 - 8
fs-service-system/src/main/java/com/fs/store/mapper/FsPatientMapper.java

@@ -1,22 +1,25 @@
 package com.fs.store.mapper;
 
 import java.util.List;
+import java.util.Map;
+
 import com.fs.store.domain.FsPatient;
 import com.fs.store.param.FsPatientParam;
+import org.apache.ibatis.annotations.MapKey;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
 /**
  * 病人Mapper接口
- * 
+ *
  * @author fs
  * @date 2022-03-23
  */
-public interface FsPatientMapper 
+public interface FsPatientMapper
 {
     /**
      * 查询病人
-     * 
+     *
      * @param patientId 病人ID
      * @return 病人
      */
@@ -24,7 +27,7 @@ public interface FsPatientMapper
 
     /**
      * 查询病人列表
-     * 
+     *
      * @param fsPatient 病人
      * @return 病人集合
      */
@@ -32,7 +35,7 @@ public interface FsPatientMapper
 
     /**
      * 新增病人
-     * 
+     *
      * @param fsPatient 病人
      * @return 结果
      */
@@ -40,7 +43,7 @@ public interface FsPatientMapper
 
     /**
      * 修改病人
-     * 
+     *
      * @param fsPatient 病人
      * @return 结果
      */
@@ -48,7 +51,7 @@ public interface FsPatientMapper
 
     /**
      * 删除病人
-     * 
+     *
      * @param patientId 病人ID
      * @return 结果
      */
@@ -56,7 +59,7 @@ public interface FsPatientMapper
 
     /**
      * 批量删除病人
-     * 
+     *
      * @param patientIds 需要删除的数据ID
      * @return 结果
      */
@@ -75,4 +78,9 @@ public interface FsPatientMapper
             " order by patient_id desc "+
             "</script>"})
     List<FsPatient> selectFsPatientListByDoctor(@Param("maps")FsPatientParam param);
+
+    @Select("select patient_id,patient_name,id_card from fs_patient")
+    @MapKey("patientId")
+    Map<Long, FsPatient> queryAllMapping();
+
 }

+ 26 - 9
fs-service-system/src/main/java/com/fs/store/mapper/FsPrescribeMapper.java

@@ -1,24 +1,30 @@
 package com.fs.store.mapper;
 
 import java.util.List;
+import java.util.Map;
+
 import com.fs.store.domain.FsPrescribe;
 import com.fs.store.param.FsPrescribeQueryParam;
 import com.fs.store.param.FsPrescribeVOParam;
 import com.fs.store.vo.FsPrescribeVO;
+import org.apache.ibatis.annotations.MapKey;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
 /**
  * 处方Mapper接口
- * 
+ *
  * @author fs
  * @date 2022-03-15
  */
-public interface FsPrescribeMapper 
+public interface FsPrescribeMapper
 {
+
+    @Select("select so.*,ffff.doctor_name prescribeDoctorName, us.nick_name ,dc.doctor_name,dp.doctor_name doctor_drug_name,fso.order_code,fso.`status` order_status,fse.store_name FROM fs_prescribe so  LEFT JOIN fs_user us ON us.user_id=so.user_id LEFT JOIN fs_doctor dc ON dc.doctor_id = so.doctor_id LEFT JOIN fs_doctor dp ON dp.doctor_id =so.drug_doctor_id LEFT JOIN fs_store_order fso ON fso.order_id = so.store_order_id LEFT JOIN fs_store fse ON fse.store_id = so.store_id  LEFT JOIN fs_doctor ffff ON ffff.doctor_id=so.prescribe_doctor_id  where so.prescribe_id=#{prescribeId}")
+    FsPrescribeVO selectFsPrescribeByPrescribeIdVO(Long prescribeId);
     /**
      * 查询处方
-     * 
+     *
      * @param prescribeId 处方ID
      * @return 处方
      */
@@ -26,7 +32,7 @@ public interface FsPrescribeMapper
 
     /**
      * 查询处方列表
-     * 
+     *
      * @param fsPrescribe 处方
      * @return 处方集合
      */
@@ -34,7 +40,7 @@ public interface FsPrescribeMapper
 
     /**
      * 新增处方
-     * 
+     *
      * @param fsPrescribe 处方
      * @return 结果
      */
@@ -42,7 +48,7 @@ public interface FsPrescribeMapper
 
     /**
      * 修改处方
-     * 
+     *
      * @param fsPrescribe 处方
      * @return 结果
      */
@@ -50,7 +56,7 @@ public interface FsPrescribeMapper
 
     /**
      * 删除处方
-     * 
+     *
      * @param prescribeId 处方ID
      * @return 结果
      */
@@ -58,7 +64,7 @@ public interface FsPrescribeMapper
 
     /**
      * 批量删除处方
-     * 
+     *
      * @param prescribeIds 需要删除的数据ID
      * @return 结果
      */
@@ -82,7 +88,7 @@ public interface FsPrescribeMapper
     FsPrescribe selectFsPrescribeByOrderId(Long orderId);
     @Select({"<script> " +
             "select p.*,u.nickname as user_nickname,u.phone as user_phone,o.order_code from fs_prescribe p left join fs_store_order o on o.id=p.order_id left join fs_user u on u.user_id=p.user_id  " +
-            "where 1=1 " +
+            "where p.generate_status in (1,2)" +
             "<if test = 'maps.rpId != null and maps.rpId!=\"\"    '> " +
             "and p.rp_id =#{maps.rpId} " +
             "</if>" +
@@ -95,4 +101,15 @@ public interface FsPrescribeMapper
             " order by p.create_time desc "+
             "</script>"})
     List<FsPrescribeVO> selectFsPrescribeListVO(@Param("maps") FsPrescribeVOParam fsPrescribe);
+
+    /**
+     * 获取已开方 且  已支付 处方图片为null的数据
+     * @return
+     */
+    @Select("select * from fs_prescribe where status=1 and ifnull(generate_status,0)=1")
+    List<FsPrescribe> selectPenddingData();
+
+    @Select("select order_id,patient_id from fs_prescribe")
+    @MapKey("orderId")
+    Map<Long, FsPrescribe> queryOrderMapping();
 }

+ 5 - 1
fs-service-system/src/main/java/com/fs/store/mapper/FsStoreCartMapper.java

@@ -73,7 +73,11 @@ public interface FsStoreCartMapper
            "<foreach collection='array' item='id' open='(' separator=',' close=')'>#{id}</foreach>"+
             "</script>"})
     int delCart(Long[] ids);
-    @Select("select c.*,p.cate_id,p.product_name,p.warehouse_id as warehouse_id,p.warehouse_code as warehouse_code,p.image as product_image,p.temp_id,p.product_type,v.price,v.sku as product_attr_name,v.image as product_attr_image,v.stock,v.cost,v.integral,v.weight,v.volume,v.bar_code,v.group_bar_code,v.brokerage,v.brokerage_two,v.brokerage_three from fs_store_cart c left join fs_store_product p on p.product_id=c.product_id left join fs_store_product_attr_value v on v.id=c.product_attr_value_id where find_in_set(c.id,#{ids})")
+    @Select("select c.*,p.cate_id,p.product_name,p.warehouse_id as warehouse_id,p.warehouse_code as warehouse_code,p.image as product_image,p.temp_id,p.product_type,v.price,v.sku as product_attr_name,v.image as product_attr_image,v.stock,v.cost,v.integral,v.weight,v.volume,v.bar_code,v.group_bar_code,v.brokerage,v.brokerage_two,v.brokerage_three," +
+            "  v.usage_method,\n" +
+            "  v.frequency,\n" +
+            "  v.dosage"+
+            " from fs_store_cart c left join fs_store_product p on p.product_id=c.product_id left join fs_store_product_attr_value v on v.id=c.product_attr_value_id where find_in_set(c.id,#{ids})")
     List<FsStoreCartQueryVO> selectFsStoreCartListByIds(String ids);
     @Update("update  fs_store_cart set is_pay=1 where find_in_set(id,#{cartIds})")
     void updateIsPay(String cartIds);

+ 1 - 1
fs-service-system/src/main/java/com/fs/store/mapper/FsStoreOrderItemMapper.java

@@ -71,7 +71,7 @@ public interface FsStoreOrderItemMapper
     List<FsStoreOrderItemVO> selectMyFsStoreOrderItemListByOrderId(Long id);
 
     @Select({"<script> " +
-            "select i.*,o.user_id,o.status,p.cate_id, o.real_name,o.user_phone,o.user_address,o.create_time,o.pay_time,o.delivery_sn,o.delivery_name,o.delivery_id, c.company_name ,cu.nick_name as company_user_nick_name ,cu.phonenumber as company_usere_phonenumber,o.upload_time ,CASE WHEN o.certificates IS NULL OR o.certificates = '' THEN 0 ELSE 1 END AS is_upload   " +
+            "select i.*,o.user_id,o.status,p.cate_id,o.id as order_id, o.real_name,o.user_phone,o.user_address,o.create_time,o.pay_time,o.delivery_sn,o.delivery_name,o.delivery_id, c.company_name ,cu.nick_name as company_user_nick_name ,cu.phonenumber as company_usere_phonenumber,o.upload_time ,CASE WHEN o.certificates IS NULL OR o.certificates = '' THEN 0 ELSE 1 END AS is_upload   " +
             " ,p.title as package_name,deliver.deliver_id as delivery_code,cts.name as scheduleName from fs_store_order_item i left join fs_store_order o on o.id=i.order_id left join fs_user u on o.user_id=u.user_id  " +
             " left join fs_store_product_package p on o.package_id=p.package_id " +
             " left join company c on c.company_id=o.company_id " +

+ 8 - 1
fs-service-system/src/main/java/com/fs/store/mapper/FsStoreProductMapper.java

@@ -6,6 +6,8 @@ import java.util.Map;
 import com.fs.store.domain.FsStoreProduct;
 import com.fs.store.param.FsStoreProductQueryParam;
 import com.fs.store.vo.*;
+import io.lettuce.core.dynamic.annotation.Key;
+import org.apache.ibatis.annotations.MapKey;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.Update;
@@ -198,7 +200,7 @@ public interface FsStoreProductMapper
             " p.vip_price, p.ot_price, p.postage,p.unit_name,p.sort,p.sales,p.is_show,p.is_hot,p.is_benefit,p.is_best,p.is_new,p.description," +
             " p.create_time,p.update_time,p.is_postage,p.is_del,p.give_integral, p.cost,p.is_good,p.browse,p.code_path,p.temp_id,p.spec_type,p.is_integral,p.integral," +
             " p.product_type,p.prescribe_code,p.prescribe_spec,p.prescribe_factory,p.prescribe_name,ave.sku,ave.stock,ave.price,ave.bar_code,ave.group_bar_code,ave.weight,ave.volume," +
-            "ave.brokerage,ave.brokerage_two,ave.brokerage_three,ave.agent_price,p.warehouse_code  FROM fs_store_product p " +
+            "ave.brokerage,ave.brokerage_two,ave.brokerage_three,ave.agent_price,p.warehouse_code,ave.usage_method as usageMethod,ave.frequency as frequency,ave.dosage as dosage  FROM fs_store_product p " +
             "  LEFT JOIN fs_store_product_attr_value ave on p.product_id=ave.product_id WHERE  p.product_id is not null " +
             "</script>"})
     List<FsStoreProductExportVO> selectFsStoreProductExportList(@Param("maps")FsStoreProduct fsStoreProduct);
@@ -216,4 +218,9 @@ public interface FsStoreProductMapper
             " on sp.warehouse_code=fw.warehouse_code ")
     Map<Long,FsStoreProduct> selectAllProductMappingInfo();
 
+    @Select("select product_id,product_type from fs_store_product")
+    @MapKey("productId")
+    Map<Long, FsStoreProduct> selectAllProductTypeMapping();
+
+
 }

+ 1 - 1
fs-service-system/src/main/java/com/fs/store/mapper/FsTestReportMapper.java

@@ -75,7 +75,7 @@ public interface FsTestReportMapper
             "</script>"})
     List<FsTestReportListVO> selectFsTestReportListVO(FsTestReportParam fsTestReport);
 
-    @Select("select tr.*,t.`name`,u.nick_name,u.phone FROM fs_test_report tr LEFT JOIN fs_test_temp t ON t.temp_id=tr.temp_id LEFT JOIN fs_user u ON u.user_id=tr.user_id where tr.report_id =#{reportId}")
+    @Select("select tr.*,t.`name`,u.nickname,u.phone FROM fs_test_report tr LEFT JOIN fs_test_temp t ON t.temp_id=tr.temp_id LEFT JOIN fs_user u ON u.user_id=tr.user_id where tr.report_id =#{reportId}")
     FsTestReportVO selectFsTestReportByReportIdVO(Long reportId);
 
 

+ 1 - 0
fs-service-system/src/main/java/com/fs/store/mapper/FsUserMapper.java

@@ -29,6 +29,7 @@ public interface FsUserMapper
      */
     public FsUser selectFsUserById(Long userId);
 
+
     /**
      * 查询用户列表
      *

+ 9 - 0
fs-service-system/src/main/java/com/fs/store/mapper/FsWarehousesMapper.java

@@ -69,4 +69,13 @@ public interface FsWarehousesMapper
 
     @Select("select erp from fs_warehouses where warehouse_code=#{warehouseCode} limit 1")
     String selectErpByCode(@Param("warehouseCode") String warehouseCode);
+
+
+    @Select("select id,warehouse_code from fs_warehouses")
+    @MapKey("id")
+    Map<Long,FsWarehouses> queryAllWarehouses();
+
+    @Select("select id,warehouse_code from fs_warehouses")
+    @MapKey("warehouseCode")
+    Map<String,FsWarehouses> queryWarehouseCodeMapping();
 }

+ 52 - 0
fs-service-system/src/main/java/com/fs/store/mapper/RemainingClaimLimitLogMapper.java

@@ -0,0 +1,52 @@
+package com.fs.store.mapper;
+
+import com.fs.store.domain.RemainingClaimLimitLog;
+import org.apache.ibatis.annotations.*;
+
+import java.util.List;
+
+/**
+ * 剩余理赔限额日志Mapper
+ */
+@Mapper
+public interface RemainingClaimLimitLogMapper {
+
+    /**
+     * 根据ID查询
+     */
+    @Select("SELECT * FROM fs_remaining_claim_limit_log WHERE id = #{id}")
+    RemainingClaimLimitLog selectById(Integer id);
+
+    /**
+     * 根据订单ID查询
+     */
+    @Select("SELECT * FROM fs_remaining_claim_limit_log WHERE order_id = #{orderId} and user_id=#{userId} and status=0 limit 1")
+    RemainingClaimLimitLog selectByOrderId(@Param("orderId") Long orderId, @Param("userId") Long userId);
+
+    /**
+     * 根据用户ID查询
+     */
+    @Select("SELECT * FROM fs_remaining_claim_limit_log WHERE user_id = #{userId}")
+    List<RemainingClaimLimitLog> selectByUserId(Integer userId);
+
+    /**
+     * 插入记录
+     */
+    @Insert("INSERT INTO fs_remaining_claim_limit_log(order_id, order_money, money, user_id, status, create_time) " +
+            "VALUES(#{orderId}, #{orderMoney}, #{money}, #{userId}, #{status}, #{createTime})")
+    @Options(useGeneratedKeys = true, keyProperty = "id")
+    int insert(RemainingClaimLimitLog record);
+
+    /**
+     * 更新记录
+     */
+    @Update("UPDATE fs_remaining_claim_limit_log SET " +
+            "order_id = #{orderId}, " +
+            "order_money = #{orderMoney}, " +
+            "money = #{money}, " +
+            "user_id = #{userId}, " +
+            "status = #{status}, " +
+            "create_time = #{createTime} " +
+            "WHERE id = #{id}")
+    int update(RemainingClaimLimitLog record);
+}

+ 15 - 0
fs-service-system/src/main/java/com/fs/store/param/BaseParam.java

@@ -0,0 +1,15 @@
+package com.fs.store.param;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class BaseParam implements Serializable {
+    @ApiModelProperty(value = "页码,默认为1")
+    private Integer pageNum =1;
+    @ApiModelProperty(value = "页大小,默认为10")
+    private Integer pageSize = 10;
+    private String keyword;
+}

+ 24 - 0
fs-service-system/src/main/java/com/fs/store/param/FsInquiryOrderListPDParam.java

@@ -0,0 +1,24 @@
+package com.fs.store.param;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class FsInquiryOrderListPDParam extends BaseParam implements Serializable {
+    Long doctorId;
+    Integer isSelf;//是否自营
+    Integer isAccept;//是否可抢单
+    Integer inquiryType;
+    Integer status;
+    Integer isReceive;
+
+    String phone;//电话
+    private Long companyId;
+    private String companyUserNickName;
+    /** 问诊开始时间 */
+    Long userId;
+    private String eTime;
+    private String sTime;
+
+}

+ 12 - 0
fs-service-system/src/main/java/com/fs/store/param/FsInquiryOrderListUParam.java

@@ -0,0 +1,12 @@
+package com.fs.store.param;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class FsInquiryOrderListUParam extends BaseParam implements Serializable {
+    Long userId;
+    Integer inquiryType;
+    Long companyUserId;
+}

+ 153 - 0
fs-service-system/src/main/java/com/fs/store/param/FsInquiryOrderParam.java

@@ -0,0 +1,153 @@
+package com.fs.store.param;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+public class FsInquiryOrderParam {
+    private Long orderId;
+
+    /** 订单号 */
+    @Excel(name = "订单号")
+    private String orderSn;
+
+    /** 问诊标题 */
+    @Excel(name = "问诊标题")
+    private String title;
+
+    /** 病例组图 */
+    @Excel(name = "病例组图")
+    private String imgs;
+
+    /** 会员ID */
+    @Excel(name = "会员ID")
+    private Long userId;
+
+    /** 病人ID */
+    @Excel(name = "病人ID")
+    private Long patientId;
+
+    @Excel(name = "病人名称")
+    private String patientName;
+    @Excel(name = "电话")
+    private String phone;
+    /** 订单类型 1图文 2语音 */
+    @Excel(name = "订单类型 1图文 2语音")
+    private Integer orderType;
+
+    /** 订单金额 */
+    @Excel(name = "订单金额")
+    private BigDecimal money;
+
+    /** 支付金额 */
+    @Excel(name = "支付金额")
+    private BigDecimal payMoney;
+
+    /** 支付类型 1微信支付 */
+    @Excel(name = "支付类型 1微信支付")
+    private Integer payType;
+
+    /** 是否支付 */
+    @Excel(name = "是否支付")
+    private Integer isPay;
+
+    /** 医生ID */
+    @Excel(name = "医生ID")
+    private Long doctorId;
+
+    /** 医生ID */
+    @Excel(name = "医生")
+    private String doctorName;
+    private String sendName;
+    /** 医生ID */
+    @Excel(name = "医生")
+    private String patientJson;
+    /** 支付时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date payTime;
+
+    /** 状态 0待支付 1已支付 2已完成  -1已关闭 -2已退款 */
+    @Excel(name = "状态 0待支付 1已支付 2已完成  -1已关闭 -2已退款")
+    private Integer status;
+
+    /** 问诊开始时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "问诊开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date startTime;
+
+    /** 问诊开始时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date sTime;
+
+    /** 问诊开始时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date eTime;
+
+    /** 结束时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date finishTime;
+
+    /** 问诊结束时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date fsTime;
+
+    /** 问诊结束时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date feTime;
+    /** 是否评价 */
+    @Excel(name = "是否评价")
+    private Integer isPing;
+
+
+    /** 科室ID */
+    @Excel(name = "科室ID")
+    private Long departmentId;
+    @Excel(name = "科室ID")
+    private String deptName;
+    /** 问诊类型 */
+    @Excel(name = "问诊类型")
+    private Integer inquiryType;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    /** 更新时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /** 评价内容 */
+    String pingContent;
+    /** 评分 */
+    Integer pingStar;
+
+    private Long companyId;
+    private Long companyUserId;
+    private String companyUserName;
+    private String createTimeRange;
+    private Integer inquirySubType;
+    private String[] createTimeList;
+
+    private String payTimeRange;
+
+    private String[] payTimeList;
+
+    //部门id
+    private Long deptId;
+    //公司员工昵称
+    private String companyUserNickName;
+
+    private String doctorAccount;
+
+    private Long taskId;//任务ID
+    //导出分页
+    private String limitSqlStr;
+
+    private Long lastOrderId;
+}

+ 1 - 0
fs-service-system/src/main/java/com/fs/store/param/FsPatientAddEditParam.java

@@ -35,4 +35,5 @@ public class FsPatientAddEditParam implements Serializable
     @NotNull(message = "性别不能为空")
     private Integer gender;
 
+
 }

+ 67 - 0
fs-service-system/src/main/java/com/fs/store/param/PrescribeXyImgParam.java

@@ -0,0 +1,67 @@
+package com.fs.store.param;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import com.fs.store.domain.FsPrescribeDrug;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class PrescribeXyImgParam {
+
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date time;
+
+    /** 订单ID */
+    @Excel(name = "处方ID")
+    private String prescribeId;
+
+    /** 患者姓名 */
+    @Excel(name = "患者姓名")
+    private String patientName;
+
+    /** 患者性别*/
+    @Excel(name = "患者性别(传数字,1男 2⼥)")
+    private String patientGender;
+    /** 患者年龄 */
+    @Excel(name = "患者年龄")
+    private String patientAge;
+    /** 门诊id号 */
+    private String outpatientId;
+    /** 床号 */
+    private String bedId;
+    /** 过敏史 */
+    private String historyAllergic;
+
+    /** 诊断 */
+    @Excel(name = "诊断")
+    private String diagnose;
+    /** 订单 */
+    private List<FsPrescribeDrug> prescribeDrug;
+
+    /** 医生ID */
+    @Excel(name = "医生名称")
+    private String doctorName;
+
+    /** 订单总价 */
+    @Excel(name = "订单总价")
+    private BigDecimal totalPrice;
+
+    /** 审核药师 */
+    private String auditDoctor;
+    /** 调配员 */
+    private String Dispatcher;
+    /** 发药 */
+    private String checkDoctor;
+
+    private String url;
+
+    private String drugDoctorUrl;
+
+    @Excel(name = "医嘱")
+    private String remark;
+}

+ 83 - 0
fs-service-system/src/main/java/com/fs/store/param/PrescribeZyImgParam.java

@@ -0,0 +1,83 @@
+package com.fs.store.param;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import com.fs.store.domain.FsPrescribeDrug;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class PrescribeZyImgParam {
+    /** 处方类型 1问诊 2订单 */
+    @Excel(name = "处方类型 1问诊 2订单")
+    private Integer prescribeType;
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date time;
+
+    /** 订单ID */
+    @Excel(name = "订单ID")
+    private String prescribeId;
+
+    /** 患者姓名 */
+    @Excel(name = "患者姓名")
+    private String patientName;
+
+    /** 患者性别(传数字,1男 2⼥) */
+    @Excel(name = "患者性别(传数字,1男 2⼥)")
+    private String patientGender;
+    /** 患者年龄 */
+    @Excel(name = "患者年龄")
+    private String patientAge;
+    /** 患者电话 */
+    @Excel(name = "患者电话")
+    private String patientTel;
+
+    /** 收货人 */
+    @Excel(name = "收货人")
+    private String userName;
+
+    /** 收货人电话 */
+    @Excel(name = "收货人电话")
+    private String userPhone;
+
+    /** 详细地址 */
+    @Excel(name = "详细地址")
+    private String userAddress;
+
+    /** 诊断 */
+    @Excel(name = "诊断")
+    private String diagnose;
+    /** 订单 */
+    private List<FsPrescribeDrug> prescribeDrug;
+
+
+    /** 吃法 */
+    @Excel(name = "吃法")
+    private String eat;
+
+    /** 医嘱 */
+    @Excel(name = "医嘱")
+    private String remark;
+    @Excel(name = "服用频率")
+    private String usageFrequencyUnit;
+    /** 医生ID */
+    @Excel(name = "医生名称")
+    private String doctorName;
+
+    private String prescribeDoctorName;
+    private String url;
+    /** 复核 */
+    private String check;
+
+    private String drugDoctorUrl;
+    /** 剂数 */
+    @Excel(name = "剂数")
+    private String size ;
+    /** 订单总价 */
+    @Excel(name = "订单总价")
+    private BigDecimal totalPrice;
+}

+ 20 - 11
fs-service-system/src/main/java/com/fs/store/service/IFsPrescribeService.java

@@ -4,22 +4,20 @@ import java.util.List;
 
 import com.fs.common.core.domain.R;
 import com.fs.store.domain.FsPrescribe;
-import com.fs.store.param.FsPrescribeParam;
-import com.fs.store.param.FsPrescribeQueryParam;
-import com.fs.store.param.FsPrescribeVOParam;
+import com.fs.store.param.*;
 import com.fs.store.vo.FsPrescribeVO;
 
 /**
  * 处方Service接口
- * 
+ *
  * @author fs
  * @date 2022-03-15
  */
-public interface IFsPrescribeService 
+public interface IFsPrescribeService
 {
     /**
      * 查询处方
-     * 
+     *
      * @param prescribeId 处方ID
      * @return 处方
      */
@@ -27,7 +25,7 @@ public interface IFsPrescribeService
 
     /**
      * 查询处方列表
-     * 
+     *
      * @param fsPrescribe 处方
      * @return 处方集合
      */
@@ -35,7 +33,7 @@ public interface IFsPrescribeService
 
     /**
      * 新增处方
-     * 
+     *
      * @param fsPrescribe 处方
      * @return 结果
      */
@@ -43,7 +41,7 @@ public interface IFsPrescribeService
 
     /**
      * 修改处方
-     * 
+     *
      * @param fsPrescribe 处方
      * @return 结果
      */
@@ -51,7 +49,7 @@ public interface IFsPrescribeService
 
     /**
      * 批量删除处方
-     * 
+     *
      * @param prescribeIds 需要删除的处方ID
      * @return 结果
      */
@@ -59,7 +57,7 @@ public interface IFsPrescribeService
 
     /**
      * 删除处方信息
-     * 
+     *
      * @param prescribeId 处方ID
      * @return 结果
      */
@@ -74,4 +72,15 @@ public interface IFsPrescribeService
     List<FsPrescribeVO> selectFsPrescribeListVO(FsPrescribeVOParam fsPrescribe);
 
     FsPrescribe selectFsPrescribeByOrderId(Long id);
+
+    String prescribeImg(Long prescribeId);
+
+    String getFsPrescribeZyImg(PrescribeZyImgParam o);
+
+    String getFsPrescribeXyImg(PrescribeXyImgParam o);
+
+    /**
+     * 生成处方图片和病历单
+     */
+    void generateDealImg();
 }

+ 306 - 0
fs-service-system/src/main/java/com/fs/store/service/MedicalRecordService.java

@@ -0,0 +1,306 @@
+package com.fs.store.service;
+
+import com.fs.common.config.FSSysConfig;
+import com.fs.store.dto.MedicalRecordDTO;
+import com.fs.system.oss.CloudStorageService;
+import com.fs.system.oss.OSSFactory;
+import lombok.extern.slf4j.Slf4j;
+import net.coobird.thumbnailator.Thumbnails;
+import net.coobird.thumbnailator.resizers.configurations.Antialiasing;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.imageio.ImageIO;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.io.*;
+import java.net.URL;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+@Service
+@Slf4j
+public class MedicalRecordService {
+    @Autowired
+    private FSSysConfig fsSysConfig;
+    /**
+     * 生成病历单图片并上传到OSS
+     * @param dto 病历单数据
+     * @return OSS图片URL
+     */
+    public String generateMedicalRecord(MedicalRecordDTO dto) {
+        try {
+            // 创建图片
+            BufferedImage image = createMedicalRecordImage(dto);
+
+            // 转换为字节流
+            ByteArrayOutputStream os = new ByteArrayOutputStream();
+            ImageIO.write(image, "png", os);
+
+            // 上传到OSS
+            InputStream inputStream = new ByteArrayInputStream(os.toByteArray());
+            CloudStorageService storage = OSSFactory.build();
+            String url = storage.uploadSuffix(inputStream, ".jpg");
+
+            log.info("病历单生成成功,URL: {}", url);
+            return url;
+
+        } catch (Exception e) {
+            log.error("生成病历单失败", e);
+            throw new RuntimeException("生成病历单失败", e);
+        }
+    }
+
+    /**
+     * 创建病历单图片
+     */
+    private BufferedImage createMedicalRecordImage(MedicalRecordDTO dto) {
+        // 创建A4大小的图片 (210mm x 297mm, 72dpi)
+        int width = 595;  // A4宽度
+        int height = 842; // A4高度
+
+        BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
+        Graphics2D g2d = image.createGraphics();
+
+        // 设置抗锯齿,提高文字清晰度
+        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+        g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+
+        // 填充白色背景
+        g2d.setColor(Color.WHITE);
+        g2d.fillRect(0, 0, width, height);
+
+        // 设置黑色画笔
+        g2d.setColor(Color.BLACK);
+
+        // 绘制标题
+        Font titleFont = new Font("黑体", Font.PLAIN,20);
+        g2d.setFont(titleFont);
+        drawCenteredString(g2d, "成都御君方互联网医院电子病历", width, 40);
+
+        // 设置内容字体
+        Font labelFont = new Font("黑体", Font.PLAIN, 12);
+        Font contentFont = new Font("黑体", Font.PLAIN, 12);
+
+        // 起始坐标
+        int leftMargin = 50;
+        int rightMargin = width - 50;
+        int yPos = 80;
+        int lineHeight = 25;
+        int columnWidth = (rightMargin - leftMargin) / 2;
+
+        // 绘制日期和基本信息行
+        g2d.setFont(labelFont);
+        g2d.drawString("就诊日期:", leftMargin, yPos);
+        g2d.setFont(contentFont);
+        g2d.drawString(formatDate(dto.getVisitDate()), leftMargin + 70, yPos);
+
+        g2d.setFont(labelFont);
+        g2d.drawString("科别:", leftMargin + columnWidth, yPos);
+        g2d.setFont(contentFont);
+        g2d.drawString(dto.getDepartment() != null ? dto.getDepartment() : "", leftMargin + columnWidth + 40, yPos);
+
+        yPos += lineHeight;
+
+        // 门诊号和付款类型
+        g2d.setFont(labelFont);
+        g2d.drawString("门诊号:", leftMargin, yPos);
+        g2d.setFont(contentFont);
+        g2d.drawString(dto.getOutpatientNo() != null ? dto.getOutpatientNo() : "", leftMargin + 55, yPos);
+
+        g2d.setFont(labelFont);
+        g2d.drawString("付款类型:", leftMargin + columnWidth, yPos);
+        g2d.setFont(contentFont);
+        g2d.drawString(dto.getPaymentType() != null ? dto.getPaymentType() : "", leftMargin + columnWidth + 65, yPos);
+
+        yPos += lineHeight+30;
+
+        // 患者基本信息
+        drawPatientInfo(g2d, dto, leftMargin, rightMargin, yPos, lineHeight, labelFont, contentFont);
+        yPos += lineHeight * 3;
+
+        // 分隔线
+        g2d.drawLine(leftMargin, yPos, rightMargin, yPos);
+        yPos += 30;
+
+        // 病情信息
+        yPos = drawSection(g2d, "主诉:", dto.getChiefComplaint(), leftMargin, rightMargin, yPos, labelFont, contentFont);
+        yPos = drawSection(g2d, "现病史:", dto.getPresentIllness(), leftMargin, rightMargin, yPos, labelFont, contentFont);
+        yPos = drawSection(g2d, "既往史:", dto.getPastHistory(), leftMargin, rightMargin, yPos, labelFont, contentFont);
+        yPos = drawSection(g2d, "过敏史:", dto.getAllergyHistory(), leftMargin, rightMargin, yPos, labelFont, contentFont);
+        yPos = drawSection(g2d, "生命体征:", dto.getVitalSigns(), leftMargin, rightMargin, yPos, labelFont, contentFont);
+        yPos = drawSection(g2d, "辅助检查:", dto.getAuxiliaryExam(), leftMargin, rightMargin, yPos, labelFont, contentFont);
+        yPos = drawSection(g2d, "诊断:", dto.getDiagnosis(), leftMargin, rightMargin, yPos, labelFont, contentFont);
+        yPos = drawSection(g2d, "医嘱:", dto.getMedicalAdvice(), leftMargin, rightMargin, yPos, labelFont, contentFont);
+        yPos = drawSection(g2d, "健康教育:", dto.getHealthEducation(), leftMargin, rightMargin, yPos, labelFont, contentFont);
+        yPos = drawSection(g2d, "处理意见:", dto.getTreatmentPlan(), leftMargin, rightMargin, yPos, labelFont, contentFont);
+        yPos = drawSection(g2d, "处方1:", dto.getPrescription(), leftMargin, rightMargin, yPos, labelFont, contentFont);
+
+        // 医生签名
+        yPos += 60;
+        g2d.setFont(labelFont);
+        g2d.drawString("医生签名:", rightMargin - 200, yPos);
+
+        try{
+            URL imageUrl = new URL(fsSysConfig.getDoctorSignImgUrl());
+            BufferedImage scaledImg = Thumbnails.of(imageUrl)
+                    .size(120, 55)
+                    .outputQuality(1.0)
+                    .antialiasing(Antialiasing.ON)
+                    .asBufferedImage();
+            g2d.drawImage(scaledImg, rightMargin - 150, yPos-25, null);
+
+        }catch (Exception e) {
+            e.printStackTrace();
+        }
+
+
+        // 底部日期
+        g2d.setFont(labelFont);
+        g2d.drawString("就诊日期:", leftMargin, yPos);
+        g2d.setFont(contentFont);
+        g2d.drawString(formatDate(dto.getVisitDate()), leftMargin + 70, yPos);
+
+        g2d.dispose();
+        return image;
+    }
+
+    /**
+     * 绘制患者基本信息
+     */
+    private void drawPatientInfo(Graphics2D g2d, MedicalRecordDTO dto, int leftMargin, int rightMargin,
+                                int yPos, int lineHeight, Font labelFont, Font contentFont) {
+        int columnWidth = (rightMargin - leftMargin) / 3;
+
+        // 第一行:姓名、性别、年龄
+        g2d.setFont(labelFont);
+        g2d.drawString("姓名:", leftMargin, yPos);
+        g2d.setFont(contentFont);
+        g2d.drawString(dto.getPatientName() != null ? dto.getPatientName() : "", leftMargin + 40, yPos);
+
+        g2d.setFont(labelFont);
+        g2d.drawString("性别:", leftMargin + columnWidth, yPos);
+        g2d.setFont(contentFont);
+        g2d.drawString(dto.getGender() != null ? dto.getGender() : "", leftMargin + columnWidth + 40, yPos);
+
+        g2d.setFont(labelFont);
+        g2d.drawString("年龄:", leftMargin + columnWidth * 2, yPos);
+        g2d.setFont(contentFont);
+        g2d.drawString(dto.getAge() != null ? dto.getAge() + "岁" : "", leftMargin + columnWidth * 2 + 40, yPos);
+
+        // 第二行:身高、体重、联系电话
+        yPos += lineHeight;
+        g2d.setFont(labelFont);
+        g2d.drawString("身高/体重:", leftMargin, yPos);
+        g2d.setFont(contentFont);
+        String heightWeight = (dto.getHeight() != null ? dto.getHeight() : "") + "/" +
+                            (dto.getWeight() != null ? dto.getWeight() : "");
+        g2d.drawString(heightWeight, leftMargin + 75, yPos);
+
+        g2d.setFont(labelFont);
+        g2d.drawString("联系电话:", leftMargin + columnWidth, yPos);
+        g2d.setFont(contentFont);
+        g2d.drawString(dto.getPhone() != null ? dto.getPhone() : "", leftMargin + columnWidth + 65, yPos);
+
+        // 第三行:单位或地址
+        yPos += lineHeight;
+        g2d.setFont(labelFont);
+        g2d.drawString("单位或地址:", leftMargin, yPos);
+        g2d.setFont(contentFont);
+        g2d.drawString(dto.getAddress() != null ? dto.getAddress() : "", leftMargin + 85, yPos);
+    }
+
+    /**
+     * 绘制文本段落(支持自动换行)
+     */
+    private int drawSection(Graphics2D g2d, String label, String content, int leftMargin, int rightMargin,
+                           int yPos, Font labelFont, Font contentFont) {
+        g2d.setFont(labelFont);
+        g2d.drawString(label, leftMargin, yPos);
+
+        if (content == null || content.isEmpty()) {
+            return yPos + 25;
+        }
+
+        g2d.setFont(contentFont);
+        FontMetrics fm = g2d.getFontMetrics();
+        int labelWidth = fm.stringWidth(label);
+        int contentX = leftMargin + labelWidth;
+        int maxWidth = rightMargin - contentX - 10;
+
+        // 自动换行处理
+        String[] lines = wrapText(content, fm, maxWidth);
+        for (int i = 0; i < lines.length; i++) {
+            if (i == 0) {
+                g2d.drawString(lines[i], contentX, yPos);
+            } else {
+                yPos += 20;
+                g2d.drawString(lines[i], leftMargin + 20, yPos);
+            }
+        }
+
+        return yPos + 25;
+    }
+
+    /**
+     * 文本自动换行
+     */
+    private String[] wrapText(String text, FontMetrics fm, int maxWidth) {
+        java.util.List<String> lines = new java.util.ArrayList<>();
+
+        // 先处理制表符,将 \t 替换为4个空格(可根据需要调整)
+        text = text.replace("\t", "    ");
+
+        // 按换行符分割,保留原有的换行
+        String[] paragraphs = text.split("\n", -1);
+
+        for (String paragraph : paragraphs) {
+            if (paragraph.isEmpty()) {
+                lines.add(""); // 保留空行
+                continue;
+            }
+
+            // 对每个段落进行宽度换行处理
+            StringBuilder line = new StringBuilder();
+            String[] chars = paragraph.split("");
+
+            for (String ch : chars) {
+                String testLine = line.toString() + ch;
+                if (fm.stringWidth(testLine) > maxWidth) {
+                    if (line.length() > 0) {
+                        lines.add(line.toString());
+                        line = new StringBuilder(ch);
+                    }
+                } else {
+                    line.append(ch);
+                }
+            }
+
+            if (line.length() > 0) {
+                lines.add(line.toString());
+            }
+        }
+
+        return lines.toArray(new String[0]);
+    }
+
+    /**
+     * 居中绘制文字
+     */
+    private void drawCenteredString(Graphics2D g2d, String text, int width, int y) {
+        FontMetrics fm = g2d.getFontMetrics();
+        int x = (width - fm.stringWidth(text)) / 2;
+        g2d.drawString(text, x, y);
+    }
+
+    /**
+     * 格式化日期
+     */
+    private String formatDate(Date date) {
+        if (date == null) {
+            return "";
+        }
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
+        return sdf.format(date);
+    }
+}

+ 444 - 96
fs-service-system/src/main/java/com/fs/store/service/impl/FsPrescribeServiceImpl.java

@@ -1,54 +1,67 @@
 package com.fs.store.service.impl;
 
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.io.*;
+import java.net.URL;
 import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
+import java.util.*;
 import java.util.List;
 
+import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.fastjson.JSONObject;
 import com.fs.common.config.FSSysConfig;
 import com.fs.common.core.domain.R;
 import com.fs.common.exception.CustomException;
 import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.OrderUtils;
+import com.fs.common.utils.ParseUtils;
 import com.fs.common.utils.StringUtils;
-import com.fs.store.bean.Drug;
-import com.fs.store.bean.DrugV2;
-import com.fs.store.bean.Prescribe;
-import com.fs.store.bean.PrescribeV2;
 import com.fs.store.domain.*;
+import com.fs.store.dto.FsStoreCartDTO;
+import com.fs.store.dto.MedicalRecordDTO;
+import com.fs.store.mapper.FsStoreProductMapper;
 import com.fs.store.param.*;
 import com.fs.store.service.*;
 import com.fs.store.vo.FsPrescribeVO;
+import com.fs.system.oss.CloudStorageService;
+import com.fs.system.oss.OSSFactory;
+import com.hc.openapi.tool.fastjson.JSON;
+import lombok.extern.slf4j.Slf4j;
+import net.coobird.thumbnailator.Thumbnails;
+import net.coobird.thumbnailator.resizers.configurations.Antialiasing;
+import org.apache.commons.lang.exception.ExceptionUtils;
+import org.apache.http.util.Asserts;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.fs.store.mapper.FsPrescribeMapper;
 
+import javax.imageio.ImageIO;
+
 /**
  * 处方Service业务层处理
  *
  * @author fs
  * @date 2022-03-15
  */
+@Slf4j
 @Service
 public class FsPrescribeServiceImpl implements IFsPrescribeService
 {
     @Autowired
-    IPrescribeService prescribeService;
-    @Autowired
-    FsPrescribeMapper fsPrescribeMapper;
+    private FsPrescribeMapper fsPrescribeMapper;
     @Autowired
-    IFsStoreOrderService orderService;
+    private IFsStoreOrderService orderService;
     @Autowired
-    IFsPatientService patientService;
+    private IFsPatientService patientService;
     @Autowired
-    IFsUserService userService;
+    private MedicalRecordService medicalRecordService;
     @Autowired
-    FSSysConfig fsSysConfig;
+    private IFsStoreOrderService fsStoreOrderService;
     @Autowired
-    IFsStoreOrderItemService orderItemService;
+    private FSSysConfig fsSysConfig;
     @Autowired
-    IFsStoreProductService productService;
-
+    private FsStoreProductMapper fsStoreProductMapper;
     /**
      * 查询处方
      *
@@ -124,13 +137,13 @@ public class FsPrescribeServiceImpl implements IFsPrescribeService
 
     @Override
     public R doPrescribe(long userId, FsPrescribeParam param) {
+        if(param.getPatientId() == null) {
+            throw new CustomException("患者必须选择!");
+        }
         FsStoreOrder order=orderService.selectFsStoreOrderById(param.getOrderId());
         if(order==null){
             throw  new CustomException("订单不存在");
         }
-//      if(order.getStatus()!=1){
-//           throw  new CustomException("未支付订单不能开处方");
-//      }
         FsPrescribe checkPrescribe=fsPrescribeMapper.selectFsPrescribeByOrderId(order.getId());
         if(checkPrescribe!=null){
             throw  new CustomException("已提交处方申请,正在开方...");
@@ -138,85 +151,36 @@ public class FsPrescribeServiceImpl implements IFsPrescribeService
         FsStoreOrderItem orderItemMap=new FsStoreOrderItem();
         orderItemMap.setOrderId(order.getId());
         orderItemMap.setIsPrescribe(1);
-        List<FsStoreOrderItem> items= orderItemService.selectFsStoreOrderItemList(orderItemMap);
         String rpId=OrderUtils.getOrderNo();
         FsPatient patient=patientService.selectFsPatientById(param.getPatientId());
-        FsUser user=userService.selectFsUserById(userId);
-        PrescribeV2Param prescribeParam=new PrescribeV2Param();
-        PrescribeV2 prescribe=new PrescribeV2();
-        prescribe.setDrugType("01");
-        prescribe.setOnlyId(rpId);
-        prescribe.setDrugstoreName("零利润药房");
-        prescribe.setPatientName(patient.getPatientName());
-        prescribe.setPatientAge(DateUtils.getAge(patient.getBirthday()));
-//        prescribe.setPatientTel(user.getPhone());
-        prescribe.setPatientSex(patient.getGender());
-        prescribe.setPatientAllergy(param.getIsAllergic()?1:0);
-        prescribe.setLiverUnusual(param.getIsLiver()?1:0);
-        prescribe.setRenalUnusual(param.getIsRenal()?1:0);
-        prescribe.setLactationFlag(param.getIsLactation()?1:0);
-        prescribe.setChiefComplaint(param.getChiefComplaint());
-        prescribe.setNowIllness(param.getNowIllness());
-        prescribe.setHistoryIllness(param.getHistoryIllness());
-        if(StringUtils.isNotEmpty(param.getRecordPic())){
-            prescribe.setRecordPic(param.getRecordPic().split(","));
-        }
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        Date now = new Date();
-        prescribe.setCreateTime(sdf.format(now));
-        prescribe.setPictureType("png");
-//        prescribe.setLactationFlag("否");
-        prescribe.setCallbackUrl(fsSysConfig.getCallbackUrl());
-
-        List<DrugV2> drug_list=new ArrayList<>();
-        for(FsStoreOrderItem item:items){
-            FsStoreProduct product=productService.selectFsStoreProductById(item.getProductId());
-            DrugV2 drug=new DrugV2();
-            drug.setDrugCommonName(product.getPrescribeName());
-            drug.setDrugSpecification(product.getPrescribeSpec());
-            drug.setSaleAmount(item.getNum().toString());
-            drug.setSaleUnit(product.getUnitName());
-            drug.setApprovalNumber(product.getPrescribeCode());
-            drug.setDrugCode(product.getProductId());
-            drug_list.add(drug);
-            prescribe.setDrugList(drug_list);
-            prescribeParam.setData(prescribe);
-        }
-        R response=prescribeService.doPrescribeV2(prescribeParam);
-        if(response.get("code").equals(200)){
-            FsPrescribe fsPrescribe=new FsPrescribe();
-            fsPrescribe.setRpId(rpId);
-            fsPrescribe.setUserId(userId);
-            fsPrescribe.setPatientId(patient.getPatientId());
-            fsPrescribe.setPharmacyCode("00001");
-            fsPrescribe.setPharmacyName("零利润药房");
-            fsPrescribe.setStatus(0);
-            fsPrescribe.setPrescribeType(1);
-            fsPrescribe.setOrderId(order.getId());
-            fsPrescribe.setCreateTime(new Date());
-            fsPrescribe.setPatientGender(patient.getGender().toString());
-            fsPrescribe.setPatientName(patient.getPatientName());
-            fsPrescribe.setIsHistoryAllergic(param.getIsAllergic()?"是":"否");
-            fsPrescribe.setLiverUnusual(param.getIsLiver()?"是":"否");
-            fsPrescribe.setLactationFlag(param.getIsLactation()?"是":"否");
-            fsPrescribe.setRenalUnusual(param.getIsRenal()?"是":"否");
-            fsPrescribe.setChiefComplaint(param.getChiefComplaint());
-            fsPrescribe.setNowIllness(param.getNowIllness());
-            fsPrescribe.setHistoryIllness(param.getHistoryIllness());
-            fsPrescribe.setRecordPic(param.getRecordPic());
-            fsPrescribe.setPatientAge(String.valueOf( DateUtils.getAge(patient.getBirthday())));
-            fsPrescribeMapper.insertFsPrescribe(fsPrescribe);
-
-            FsStoreOrder orderMap=new FsStoreOrder();
-            orderMap.setId(order.getId());
-            orderMap.setPrescribeId(fsPrescribe.getPrescribeId());
-            orderService.updateFsStoreOrder(orderMap);
-            return R.ok("操作成功").put("order",order);
-
-        }
-        else{
-            return R.error(response.get("msg").toString());
-        }
+        FsPrescribe fsPrescribe=new FsPrescribe();
+        fsPrescribe.setRpId(rpId);
+        fsPrescribe.setUserId(userId);
+        fsPrescribe.setPatientId(patient.getPatientId());
+        fsPrescribe.setPharmacyCode("00001");
+        fsPrescribe.setPharmacyName("零利润药房");
+        fsPrescribe.setStatus(0);
+        fsPrescribe.setPrescribeType(1);
+        fsPrescribe.setOrderId(order.getId());
+        fsPrescribe.setCreateTime(new Date());
+        fsPrescribe.setPatientGender(patient.getGender().toString());
+        fsPrescribe.setPatientName(patient.getPatientName());
+        fsPrescribe.setIsHistoryAllergic(param.getIsAllergic()?"是":"否");
+        fsPrescribe.setLiverUnusual(param.getIsLiver()?"是":"否");
+        fsPrescribe.setLactationFlag(param.getIsLactation()?"是":"否");
+        fsPrescribe.setRenalUnusual(param.getIsRenal()?"是":"否");
+        fsPrescribe.setChiefComplaint(param.getChiefComplaint());
+        fsPrescribe.setNowIllness(param.getNowIllness());
+        fsPrescribe.setHistoryIllness(param.getHistoryIllness());
+        fsPrescribe.setRecordPic(param.getRecordPic());
+        fsPrescribe.setPatientAge(String.valueOf( DateUtils.getAge(patient.getBirthday())));
+        fsPrescribeMapper.insertFsPrescribe(fsPrescribe);
+
+        FsStoreOrder orderMap=new FsStoreOrder();
+        orderMap.setId(order.getId());
+        orderMap.setPrescribeId(fsPrescribe.getPrescribeId());
+        orderService.updateFsStoreOrder(orderMap);
+        return R.ok("操作成功").put("order",order);
     }
 
     @Override
@@ -239,4 +203,388 @@ public class FsPrescribeServiceImpl implements IFsPrescribeService
     public FsPrescribe selectFsPrescribeByOrderId(Long id) {
         return fsPrescribeMapper.selectFsPrescribeByOrderId(id);
     }
+
+    @Override
+    public String prescribeImg(Long prescribeId) {
+
+        FsPrescribe fsPrescribe = fsPrescribeMapper.selectFsPrescribeById(prescribeId);
+
+        Asserts.notNull(fsPrescribe, String.format("该处方 %d 无法找到!",prescribeId));
+
+        Long orderId = fsPrescribe.getOrderId();
+
+        Asserts.notNull(orderId,String.format("该处方 %d 对应订单号 %d 不存在!",prescribeId,orderId));
+
+        FsStoreOrder fsStoreOrder = orderService.selectFsStoreOrderById(orderId);
+
+        Asserts.notNull(fsStoreOrder,String.format("该处方 %d 对应订单号 %d 不存在!",prescribeId,orderId));
+
+        PrescribeXyImgParam param = new PrescribeXyImgParam();
+
+        param.setPrescribeId(String.valueOf(prescribeId));
+
+        // 门诊ID号
+        param.setOutpatientId(String.valueOf(prescribeId));
+        // 科别
+        param.setBedId("全科");
+        // 过敏史
+        param.setHistoryAllergic(fsPrescribe.getHistoryAllergic());
+        // 诊断
+        param.setDiagnose(fsPrescribe.getDiagnose());
+        // 开具日期
+        param.setTime(new Date());
+        // 药品目录
+        String itemJson = fsStoreOrder.getItemJson();
+        List<FsStoreOrderItem> fsStoreCartDTOS = JSONObject.parseArray(itemJson, FsStoreOrderItem.class);
+        List<FsPrescribeDrug> fsPrescribeDrugList = new ArrayList<>();
+        Map<Long,FsStoreProduct> allProductTypeMapping = fsStoreProductMapper.selectAllProductTypeMapping();
+        for (FsStoreOrderItem item : fsStoreCartDTOS) {
+            FsStoreProduct fsStoreProduct = allProductTypeMapping.get(item.getProductId());
+            if(fsStoreProduct != null) {
+                Integer productType = fsStoreProduct.getProductType();
+                Set<Integer> includeSet = new HashSet<>();
+                includeSet.add(1);
+                includeSet.add(2);
+                includeSet.add(4);
+
+                // 只对非处方、处方药、器械 进行开方
+                if(!includeSet.contains(productType)) {
+                    continue;
+                }
+            }
+            FsStoreCartDTO cartDTO = JSON.parseObject(item.getJsonInfo(),FsStoreCartDTO.class);
+            FsPrescribeDrug fsPrescribeDrug = new FsPrescribeDrug();
+            fsPrescribeDrug.setDrugName(cartDTO.getProductName());
+
+            // 使⽤⽅法
+            fsPrescribeDrug.setUsageMethod(cartDTO.getUsageMethod());
+            // 药品频次
+            fsPrescribeDrug.setUsageFrequencyUnit(String.format("每日 %s 次",cartDTO.getFrequency()));
+            // 用药数量
+            fsPrescribeDrug.setUsagePerUseCount(String.format("每次 %s ",cartDTO.getDosage()));
+            fsPrescribeDrug.setDrugNum(Long.valueOf(item.getNum()));
+            fsPrescribeDrugList.add(fsPrescribeDrug);
+        }
+        param.setPrescribeDrug(fsPrescribeDrugList);
+
+        param.setPatientName(fsPrescribe.getPatientName());
+        param.setPatientGender(fsPrescribe.getPatientGender());
+        param.setPatientAge(fsPrescribe.getPatientAge());
+
+        // 医生名称
+        param.setDoctorName(fsPrescribe.getDoctorName());
+        // 订单总价
+        param.setTotalPrice(fsStoreOrder.getPayMoney());
+        param.setAuditDoctor(fsPrescribe.getAuditDoctor());
+        param.setDrugDoctorUrl(fsSysConfig.getDrugDoctorSignImgUrl());
+        param.setUrl(fsSysConfig.getDoctorSignImgUrl());
+        return getFsPrescribeXyImg(param);
+    }
+
+
+    @Override
+    public String getFsPrescribeZyImg(PrescribeZyImgParam o) {
+        File mb = new File("C:\\fs\\zycf.jpg");
+        if (!mb.exists()) {
+            // 创建目录
+            throw  new CustomException("模板文件不存在");
+        }
+        BufferedImage image = null;
+        try {
+            image = ImageIO.read(mb);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        // 创建画笔(image为上一步的图片对象)
+        Graphics2D pen = image.createGraphics();
+        pen.setColor(Color.black);
+        //处理字体 高清加边缘模糊
+        pen.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
+                RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+        pen.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+        pen.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
+        pen.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED);
+        pen.setFont(new Font("黑体", Font.PLAIN, 21));
+        // 将date对象格式化为字符串
+
+        penDrawString(pen,new SimpleDateFormat("yyyy-MM-dd").format(o.getTime()), 730, 290);
+        penDrawString(pen,o.getPrescribeId(),1030,290);
+        penDrawString(pen,o.getPatientName(),136,372);
+        penDrawString(pen,o.getPatientGender().equals("1")?"男":o.getPatientGender().equals("2")?"女":o.getPatientGender(),420,372);
+        penDrawString(pen,o.getPatientAge(),690,372);
+        penDrawString(pen,o.getPatientTel(),970,372);
+        String address= o.getUserName()+"      "+o.getUserPhone()+"     "+o.getUserAddress();
+        penDrawString(pen,address,180,445);
+        penDrawString(pen,o.getDiagnose(),180,515);
+        List<FsPrescribeDrug> Drug = o.getPrescribeDrug();
+        int size=Drug.size();
+
+        for (int i = 0; i < size/3.0; i++) {
+            if (i*3<size){
+                pen.drawString(Drug.get(i*3).getDrugName(),145,680+i*50);
+            }
+            if (i*3+1<size){
+                pen.drawString(Drug.get(i*3+1).getDrugName(),510,680+i*50);
+            }
+            if (i*3+2<size){
+                pen.drawString(Drug.get(i*3+2).getDrugName(),875,680+i*50);
+            }
+        }
+        penDrawString(pen,o.getEat(),110,1195);
+        penDrawString(pen,o.getUsageFrequencyUnit(),135,1240);
+        penDrawString(pen,o.getRemark(),110,1288);
+
+        if (o.getUrl()!=null){
+            try {
+                URL imageUrl = new URL(o.getUrl());
+                BufferedImage img = ImageIO.read(imageUrl);
+                pen.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
+                pen.drawImage(img, 130, 1420, 127, 60, null);
+            } catch (Exception e) {
+                throw new CustomException("获取医生签名图片失败");
+            }
+
+        }else {
+            penDrawString(pen,o.getPrescribeDoctorName(),152,1450);
+        }
+        if (o.getDrugDoctorUrl()!=null){
+            try {
+                URL   imageUrl3 = new URL(o.getDrugDoctorUrl());
+                BufferedImage img3 = ImageIO.read(imageUrl3);
+                pen.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
+                pen.drawImage(img3, 370, 1345, 127, 60, null);
+            } catch (Exception e) {
+                throw new CustomException("获取药师签名图片失败");
+            }
+        }
+        penDrawString(pen,o.getSize(),620,1378);
+        if (o.getTotalPrice()!=null){
+            penDrawString(pen,o.getTotalPrice().toString(),370,1452);
+            penDrawString(pen,o.getTotalPrice().toString(),620,1452);
+        }
+        ByteArrayOutputStream os = new ByteArrayOutputStream();
+        try {
+            ImageIO.write(image, "png", os);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        InputStream inputStream = new ByteArrayInputStream(os.toByteArray());
+        CloudStorageService storage = OSSFactory.build();
+        String url = storage.uploadSuffix(inputStream, ".jpg");
+        return url;
+    }
+
+    @Override
+    public String getFsPrescribeXyImg(PrescribeXyImgParam o) {
+        File mb = new File(fsSysConfig.getPrescribeTemplateImgPath());
+        if (!mb.exists()) {
+            // 创建目录
+            throw  new CustomException("模板文件不存在");
+        }
+        BufferedImage image = null;
+        try {
+            image = ImageIO.read(mb);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        // 创建画笔(image为上一步的图片对象)
+        Graphics2D pen = image.createGraphics();
+        pen.setColor(Color.black);
+        //处理字体 高清加边缘模糊
+        pen.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
+                RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+        pen.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+        pen.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
+        pen.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED);
+        pen.setFont(new Font("黑体", Font.PLAIN, 14));
+        penDrawString(pen,o.getPrescribeId(),448,145);
+        penDrawString(pen,o.getPatientName(),60,178);
+        if (o.getPatientGender().equals("1")){
+            penDrawString(pen,"√",255,178);
+        }else if(o.getPatientGender().equals("2")){
+            penDrawString(pen,"√",298,178);
+        }
+        penDrawString(pen,o.getPatientAge(),400,178);
+        penDrawString(pen,o.getOutpatientId(),92,205);
+        penDrawString(pen,o.getBedId(),400,205);
+        penDrawString(pen,o.getHistoryAllergic(),95,230);
+        penDrawString(pen,o.getDiagnose(),95,257);
+        penDrawString(pen,new SimpleDateFormat("yyyy-MM-dd").format(o.getTime()),400,257);
+        List<FsPrescribeDrug> Drug = o.getPrescribeDrug();
+        int size=Drug.size();
+        for (int i = 0; i < size; i++) {
+            FsPrescribeDrug d = Drug.get(i);
+            String drugName = d.getDrugName();
+            if (drugName.length()>30){
+                drugName = drugName.substring(0, 30)+"...";
+            }
+
+            String drugSpec = (d.getDrugSpec() != null) ? d.getDrugSpec() : "   ";
+
+            penDrawString(pen,i+1+","+drugName+"    "+drugSpec+"    "+d.getDrugNum(),35,305+i*40);
+            String usageMethod = (d.getUsageMethod() != null) ? d.getUsageMethod() : "   ";
+            String usageFrequencyUnit = (d.getUsageFrequencyUnit() != null) ? d.getUsageFrequencyUnit() : "   ";
+            String usagePerUseCount = (d.getUsagePerUseCount() != null) ? d.getUsagePerUseCount() : "   ";
+
+            penDrawString(pen," Sig:          "+usageMethod+"     "+usageFrequencyUnit+"     "+usagePerUseCount,35,325+i*40);
+        }
+        penDrawString(pen,"本页完",277,325+size*40);
+
+        penDrawString(pen,o.getRemark(),62,651);
+        if (o.getUrl()!=null){
+            try {
+                URL imageUrl = new URL(o.getUrl());
+                BufferedImage scaledImg = Thumbnails.of(imageUrl)
+                        .size(120, 55)
+                        .outputQuality(1.0)
+                        .antialiasing(Antialiasing.ON)
+                        .asBufferedImage();
+                pen.drawImage(scaledImg, 65, 688, null);
+            } catch (Exception e) {
+                throw new CustomException("获取签名图片失败");
+            }
+        }else {
+            penDrawString(pen,o.getDoctorName(),63,716);
+        }
+
+        penDrawString(pen,o.getTotalPrice().toString(),375,717);
+        if (o.getDrugDoctorUrl()!=null){
+            try {
+                URL   imageUrl = new URL(o.getDrugDoctorUrl());
+                BufferedImage scaledImg = Thumbnails.of(imageUrl)
+                        .size(120, 55)
+                        .outputQuality(1.0)
+                        .antialiasing(Antialiasing.ON)
+                        .asBufferedImage();
+
+                pen.drawImage(scaledImg, 90, 730, null);
+            } catch (Exception e) {
+                throw new CustomException("获取药师签名图片失败");
+            }
+        }
+        penDrawString(pen,o.getDispatcher(),357,757);
+        penDrawString(pen,o.getCheckDoctor(),135,796);
+
+
+        ByteArrayOutputStream os = new ByteArrayOutputStream();
+        try {
+            ImageIO.write(image, "png", os);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        InputStream inputStream = new ByteArrayInputStream(os.toByteArray());
+        CloudStorageService storage = OSSFactory.build();
+        return storage.uploadSuffix(inputStream, ".jpg");
+    }
+
+    @Override
+    public void generateDealImg() {
+        // 获取待处理数据
+        List<FsPrescribe> list = fsPrescribeMapper.selectPenddingData();
+        Map<Long,FsStoreProduct> allProductTypeMapping = fsStoreProductMapper.selectAllProductTypeMapping();
+
+        for (FsPrescribe fsPrescribe : list) {
+            String rpUrl = null;
+            try{
+                rpUrl = this.prescribeImg(fsPrescribe.getPrescribeId());
+            }catch (Exception e) {
+                log.error("生成处方失败!原因:{}",e.getMessage(),e);
+                fsPrescribe.setFailMsg(ExceptionUtils.getFullStackTrace(e));
+            }
+            // 生成处方图片
+            log.info("rpUrl: {}",rpUrl);
+
+            fsPrescribe.setRpUrl(rpUrl);
+            // 生成病历图片
+            MedicalRecordDTO medicalRecordDTO = new MedicalRecordDTO();
+            medicalRecordDTO.setVisitDate(new Date());
+            medicalRecordDTO.setOutpatientNo(String.valueOf(fsPrescribe.getPrescribeId()));
+            medicalRecordDTO.setDepartment("全科");
+            medicalRecordDTO.setPaymentType("自费缴费");
+
+            medicalRecordDTO.setPatientName(fsPrescribe.getPatientName());
+            if(StringUtils.isNotBlank(fsPrescribe.getPatientGender())){
+                if("1".equals(fsPrescribe.getPatientGender())){
+                    medicalRecordDTO.setGender("男");
+                } else {
+                    medicalRecordDTO.setGender("女");
+                }
+            }
+            medicalRecordDTO.setAge(Integer.valueOf(fsPrescribe.getPatientAge()));
+            medicalRecordDTO.setHeight("-");
+            medicalRecordDTO.setWeight("-");
+
+            FsStoreOrder fsStoreOrder = fsStoreOrderService.selectFsStoreOrderById(fsPrescribe.getOrderId());
+            if(ObjectUtil.isNotNull(fsStoreOrder)) {
+                medicalRecordDTO.setAddress(ParseUtils.parseAddress(fsStoreOrder.getUserAddress()));
+                medicalRecordDTO.setPhone(ParseUtils.parsePhone(fsStoreOrder.getUserPhone()));
+
+                // 药品目录
+                String itemJson = fsStoreOrder.getItemJson();
+                List<FsStoreOrderItem> fsStoreCartDTOS = JSONObject.parseArray(itemJson, FsStoreOrderItem.class);
+                List<FsPrescribeDrug> fsPrescribeDrugList = new ArrayList<>();
+                StringBuilder prescription = new StringBuilder();
+
+                int i=1;
+                prescription.append("\n");
+                for (FsStoreOrderItem item : fsStoreCartDTOS) {
+                    FsStoreProduct fsStoreProduct = allProductTypeMapping.get(item.getProductId());
+                    if(fsStoreProduct != null) {
+                        Integer productType = fsStoreProduct.getProductType();
+                        Set<Integer> includeSet = new HashSet<>();
+                        includeSet.add(1);
+                        includeSet.add(2);
+                        includeSet.add(4);
+
+                        // 只对非处方、处方药、器械 进行开方
+                        if(!includeSet.contains(productType)) {
+                            continue;
+                        }
+                    }
+                    FsStoreCartDTO cartDTO = JSON.parseObject(item.getJsonInfo(),FsStoreCartDTO.class);
+
+                    prescription.append(i++).append(".").append(cartDTO.getProductName())
+                                    .append("\t\t\t").append(item.getNum())
+                                    .append("\n")
+                                    .append("Sig:\t\t\t").append(cartDTO.getUsageMethod())
+                            .append("\t").append(String.format("每日 %s 次",cartDTO.getFrequency()))
+                                    .append("\t").append(String.format("每次 %s ",cartDTO.getDosage()))
+                                    .append("\n");
+                }
+                medicalRecordDTO.setPrescription(prescription.toString());
+                medicalRecordDTO.setDrugList(fsPrescribeDrugList);
+            }
+
+            medicalRecordDTO.setChiefComplaint(fsPrescribe.getChiefComplaint());
+            medicalRecordDTO.setPresentIllness(fsPrescribe.getNowIllness());
+            medicalRecordDTO.setPastHistory(fsPrescribe.getHistoryIllness());
+            medicalRecordDTO.setAllergyHistory(fsPrescribe.getHistoryAllergic());
+
+            medicalRecordDTO.setVitalSigns("");
+            medicalRecordDTO.setAuxiliaryExam("");
+            medicalRecordDTO.setDiagnosis(fsPrescribe.getDiagnose());
+            medicalRecordDTO.setMedicalAdvice("请遵照医嘱用药,如有不适,请及时就医!");
+            medicalRecordDTO.setTreatmentPlan("");
+            medicalRecordDTO.setHealthEducation("");
+            String medicalUrl = null;
+            try{
+
+
+                medicalUrl = medicalRecordService.generateMedicalRecord(medicalRecordDTO);
+            }catch (Exception e){
+                log.error("生成病历单图片失败!原因:{}",e.getMessage(),e);
+                fsPrescribe.setFailMsg(fsPrescribe.getFailMsg()+"\n"+ ExceptionUtils.getFullStackTrace(e));
+            }
+
+            fsPrescribe.setMedicalRecordUrl(medicalUrl);
+            fsPrescribe.setGenerateStatus(2);
+            fsPrescribeMapper.updateFsPrescribe(fsPrescribe);
+        }
+    }
+
+    public void penDrawString( Graphics2D pen,String value,int x,int y){
+        if (value!=null){
+            pen.drawString(value,x,y);
+        }
+    }
 }

+ 31 - 4
fs-service-system/src/main/java/com/fs/store/service/impl/FsStoreAfterSalesServiceImpl.java

@@ -33,8 +33,7 @@ import com.fs.huifuPay.domain.HuiFuRefundResult;
 import com.fs.huifuPay.dto.*;
 import com.fs.huifuPay.sdk.opps.core.request.V2TradePaymentScanpayRefundRequest;
 import com.fs.huifuPay.service.HuiFuService;
-import com.fs.store.mapper.FsStoreDeliversMapper;
-import com.fs.store.mapper.FsWarehousesMapper;
+import com.fs.store.mapper.*;
 import com.fs.system.config.SnowflakeUtils;
 import com.fs.tzBank.TzBankService;
 import com.fs.pay.pay.domain.RefundResult;
@@ -45,7 +44,6 @@ import com.fs.store.dto.StoreOrderProductDTO;
 import com.fs.store.enums.AfterSalesStatusEnum;
 import com.fs.store.enums.AfterStatusEnum;
 import com.fs.store.enums.OrderInfoEnum;
-import com.fs.store.mapper.FsStoreOrderItemMapper;
 import com.fs.store.param.*;
 import com.fs.store.service.*;
 import com.fs.store.vo.FsStoreAfterSalesQueryVO;
@@ -62,7 +60,6 @@ import org.springframework.aop.framework.AopContext;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
 import org.springframework.stereotype.Service;
-import com.fs.store.mapper.FsStoreAfterSalesMapper;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
@@ -213,6 +210,7 @@ public class FsStoreAfterSalesServiceImpl implements IFsStoreAfterSalesService
         notAllowRefundStatusSet.add(-2);
         notAllowRefundStatusSet.add(-3);
         notAllowRefundStatusSet.add(0);
+        notAllowRefundStatusSet.add(2);
         notAllowRefundStatusSet.add(3);
         if(notAllowRefundStatusSet.contains(order.getStatus())){
             throw new CustomException("该订单不可申请售后");
@@ -605,6 +603,11 @@ public class FsStoreAfterSalesServiceImpl implements IFsStoreAfterSalesService
         IFsStoreAfterSalesService fsStoreAfterSalesService = (IFsStoreAfterSalesService) AopContext.currentProxy();
         return fsStoreAfterSalesService.refundStoreMoney(param);
     }
+
+    @Autowired
+    private FsUserMapper fsUserMapper;
+    @Autowired
+    private RemainingClaimLimitLogMapper remainingClaimLimitLogMapper;
     @Override
     @Transactional(rollbackFor = Throwable.class,propagation = Propagation.REQUIRED)
     public R refundStoreMoney(FsStoreAfterSalesRefundParam param){
@@ -760,6 +763,30 @@ public class FsStoreAfterSalesServiceImpl implements IFsStoreAfterSalesService
             userService.subTuiMoney(order);
         }
 
+        // 理赔额度金额加回去
+        Long userId = order.getUserId();
+        FsUser fsUser = fsUserMapper.selectFsUserByIdForUpdate(userId);
+        RemainingClaimLimitLog log = remainingClaimLimitLogMapper.selectByOrderId(order.getId(),userId);
+        if(log == null){
+            throw new RuntimeException(String.format("当前用户的订单购买记录没有找到!订单id:%d 用户:%d",order.getId(),userId));
+        }
+
+        if(fsUser.getRemainingClaimLimit() != null) {
+            if(log.getMoney() != null) {
+                fsUser.setRemainingClaimLimit(fsUser.getRemainingClaimLimit().add(log.getMoney()));
+                fsUserMapper.updateFsUser(fsUser);
+
+                RemainingClaimLimitLog remainingClaimLimitLog = new RemainingClaimLimitLog();
+                remainingClaimLimitLog.setId(null);
+                remainingClaimLimitLog.setStatus(1);
+                remainingClaimLimitLog.setOrderId(order.getId());
+                remainingClaimLimitLog.setUserId(order.getUserId());
+                remainingClaimLimitLog.setOrderMoney(order.getPayMoney());
+                remainingClaimLimitLog.setMoney(log.getMoney());
+                remainingClaimLimitLog.setCreateTime(new Date());
+                remainingClaimLimitLogMapper.insert(remainingClaimLimitLog);
+            }
+        }
 
         return R.ok();
     }

+ 78 - 1
fs-service-system/src/main/java/com/fs/store/service/impl/FsStoreOrderServiceImpl.java

@@ -268,6 +268,9 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
     @Autowired
     private FsWarehousesMapper fsWarehousesMapper;
 
+    @Autowired
+    private FsUserMapper fsUserMapper;
+
 
     @Autowired
     private FsUserMapper fsUserMapper;
@@ -957,6 +960,10 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
                 fsStoreCartDTO.setWarehouseCode(vo.getWarehouseCode());
                 fsStoreCartDTO.setWarehouseId(vo.getWarehouseId());
 
+                fsStoreCartDTO.setUsageMethod(vo.getUsageMethod());
+                fsStoreCartDTO.setFrequency(vo.getFrequency());
+                fsStoreCartDTO.setDosage(vo.getDosage());
+
                 if(StringUtils.isEmpty(vo.getProductAttrImage())){
                     fsStoreCartDTO.setImage(vo.getProductImage());
                 }
@@ -1683,6 +1690,11 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
                 fsStoreCartDTO.setNum(vo.getCartNum());
                 fsStoreCartDTO.setBarCode(vo.getBarCode());
                 fsStoreCartDTO.setGroupBarCode(vo.getGroupBarCode());
+
+                fsStoreCartDTO.setDosage(vo.getDosage());
+                fsStoreCartDTO.setUsageMethod(vo.getUsageMethod());
+                fsStoreCartDTO.setFrequency(vo.getFrequency());
+
                 if(StringUtils.isEmpty(vo.getProductAttrImage())){
                     fsStoreCartDTO.setImage(vo.getProductImage());
                 }
@@ -1831,10 +1843,12 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
         return fsStoreOrderMapper.selectDeliverPendingData();
     }
 
+    @Autowired
+    private RemainingClaimLimitLogMapper remainingClaimLimitLogMapper;
     @Override
     @Transactional(rollbackFor = Throwable.class,propagation = Propagation.REQUIRED)
     //类型1支付回调 类型2货到付款
-    public synchronized String  payConfirm(Integer type,Long orderId,String payCode,String tradeNo,String bankTransactionId,String bankSerialNo) {
+    public synchronized String payConfirm(Integer type,Long orderId,String payCode,String tradeNo,String bankTransactionId,String bankSerialNo) {
         //支付订单
         try {
             FsStoreOrder order=null;
@@ -1910,10 +1924,46 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
             else if(order.getIsPrescribe().equals(1)){
                 //是否已开方
                 FsPrescribe prescribe=prescribeService.selectFsPrescribeByOrderId(order.getId());
+
                 if(prescribe!=null&&prescribe.getStatus()==1){
                     createOmsOrder(order.getId());
                 }
             }
+            FsPrescribe prescribe=prescribeService.selectFsPrescribeByOrderId(order.getId());
+            if(prescribe != null) {
+                prescribe.setGenerateStatus(1);
+                prescribeService.updateFsPrescribe(prescribe);
+            }
+
+            // 保险剩余额度处理
+            // 如果 保险剩余额度处理 >= 订单金额
+            // 保险剩余额度处理 -= 订单金额
+            // 否则
+            // 保险剩余额度处理=0
+            FsUser fsUser = fsUserMapper.selectFsUserByIdForUpdate(order.getUserId());
+            if (fsUser == null) {
+                throw new RuntimeException("用户不存在");
+            }
+            int i = fsUser.getRemainingClaimLimit().compareTo(order.getPayMoney());
+            BigDecimal money;
+            if(i>=0) {
+                fsUser.setRemainingClaimLimit(fsUser.getRemainingClaimLimit().subtract(order.getPayMoney()));
+                money = order.getPayMoney();
+            } else {
+                fsUser.setRemainingClaimLimit(BigDecimal.ZERO);
+                money = BigDecimal.ZERO;
+            }
+            RemainingClaimLimitLog log = new RemainingClaimLimitLog();
+            log.setOrderId(order.getId());
+            log.setOrderMoney(order.getPayMoney());
+            log.setMoney(money);
+            log.setStatus(0);
+            log.setUserId(order.getUserId());
+            log.setCreateTime(new Date());
+
+            remainingClaimLimitLogMapper.insert(log);
+
+            fsUserMapper.updateFsUser(fsUser);
         }
         catch (Exception e){
             logger.error("payConfirm: {} ",e.getMessage(),e);
@@ -2443,6 +2493,33 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
                     best.refundOrder(payProcessContext);
                 }
             }
+
+
+            // 理赔额度金额加回去
+            Long userId = order.getUserId();
+            FsUser fsUser = fsUserMapper.selectFsUserByIdForUpdate(userId);
+            RemainingClaimLimitLog log = remainingClaimLimitLogMapper.selectByOrderId(order.getId(),userId);
+            if(log == null){
+                throw new RuntimeException(String.format("当前用户的订单购买记录没有找到!订单id:%d 用户:%d",order.getId(),userId));
+            }
+
+            if(fsUser.getRemainingClaimLimit() != null) {
+                if(log.getMoney() != null) {
+                    fsUser.setRemainingClaimLimit(fsUser.getRemainingClaimLimit().add(log.getMoney()));
+                    fsUserMapper.updateFsUser(fsUser);
+
+                    RemainingClaimLimitLog remainingClaimLimitLog = new RemainingClaimLimitLog();
+                    remainingClaimLimitLog.setId(null);
+                    remainingClaimLimitLog.setStatus(1);
+                    remainingClaimLimitLog.setOrderId(order.getId());
+                    remainingClaimLimitLog.setUserId(order.getUserId());
+                    remainingClaimLimitLog.setOrderMoney(order.getPayMoney());
+                    remainingClaimLimitLog.setMoney(log.getMoney());
+                    remainingClaimLimitLog.setCreateTime(new Date());
+                    remainingClaimLimitLogMapper.insert(remainingClaimLimitLog);
+                }
+            }
+
         }
         orderStatusService.create(order.getId(), OrderLogEnum.REFUND_ORDER_SUCCESS.getValue(),
                 OrderLogEnum.REFUND_ORDER_SUCCESS.getDesc());

+ 20 - 2
fs-service-system/src/main/java/com/fs/store/service/impl/FsStoreProductServiceImpl.java

@@ -55,6 +55,9 @@ public class FsStoreProductServiceImpl implements IFsStoreProductService
     private FsStoreProductPackageMapper fsStoreProductPackageMapper;
     @Autowired
     private FsStoreProductGroupMapper fsStoreProductGroupMapper;
+
+    @Autowired
+    private FsWarehousesMapper fsWarehousesMapper;
     /**
      * 查询商品
      *
@@ -205,6 +208,9 @@ public class FsStoreProductServiceImpl implements IFsStoreProductService
             valueMap.put("brokerageTwo", 0);
             valueMap.put("brokerageThree", 0);
             valueMap.put("integral", 0);
+            valueMap.put("usageMethod", "");
+            valueMap.put("frequency", 0);
+            valueMap.put("dosage", 0);
             if (productId > 0) {
                 FsStoreProductAttrValue attrValueMap=new FsStoreProductAttrValue();
                 attrValueMap.setProductId(productId);
@@ -227,6 +233,9 @@ public class FsStoreProductServiceImpl implements IFsStoreProductService
                     valueMap.put("brokerageTwo", values.get(0).getBrokerageTwo());
                     valueMap.put("brokerageThree", values.get(0).getBrokerageThree());
                     valueMap.put("integral", values.get(0).getIntegral());
+                    valueMap.put("usageMethod", values.get(0).getUsageMethod());
+                    valueMap.put("frequency", values.get(0).getFrequency());
+                    valueMap.put("dosage", values.get(0).getDosage());
                 }
             }
             valueMapList.add(ObjectUtil.clone(valueMap));
@@ -632,8 +641,7 @@ public class FsStoreProductServiceImpl implements IFsStoreProductService
     public List<FsStoreProductExportVO> selectFsStoreProductExportList(FsStoreProduct fsStoreProduct) {
         return fsStoreProductMapper.selectFsStoreProductExportList(fsStoreProduct);
     }
-    @Autowired
-    private FsWarehousesMapper fsWarehousesMapper;
+
     @Override
     public String importStoreProduct(List<FsStoreProductExportVO> list, boolean updateSupport) {
         if (com.fs.common.utils.StringUtils.isNull(list) || list.size() == 0)
@@ -706,6 +714,16 @@ public class FsStoreProductServiceImpl implements IFsStoreProductService
                 p.setBrokerageTwo(productVO.getBrokerageTwo());
                 p.setBrokerageThree(productVO.getBrokerageThree());
                 p.setAgentPrice(productVO.getAgentPrice());
+
+                if(productVO.getUsageMethod()!=null){
+                    p.setUsageMethod(productVO.getUsageMethod());
+                }
+                if(productVO.getFrequency() != null) {
+                    p.setFrequency(productVO.getFrequency());
+                }
+                if(productVO.getDosage() != null) {
+                    p.setDosage(productVO.getDosage());
+                }
                 fsStoreProductAttrValueMapper.insertFsStoreProductAttrValue(p);
 
                 fsStoreProductAttrMapper.clear(product.getProductId());

+ 2 - 2
fs-service-system/src/main/java/com/fs/store/service/impl/PrescribeServiceImpl.java

@@ -21,8 +21,8 @@ import java.util.Locale;
 
 /**
  * 参数配置 服务层实现
- * 
- 
+ *
+
  */
 @Slf4j
 @Service

+ 61 - 0
fs-service-system/src/main/java/com/fs/store/vo/FsInquiryFeedbackExportListVO.java

@@ -0,0 +1,61 @@
+package com.fs.store.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class FsInquiryFeedbackExportListVO {
+
+    private Long orderId;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "问诊日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date startTime;
+
+
+    @Excel(name = "问诊号")
+    private String orderSn;
+
+    /** 用户id */
+    @Excel(name = "会员号")
+    private String userId;
+
+    @Excel(name = "医生名称")
+    private String  doctorName;
+
+    /** 患者姓名 */
+    @Excel(name = "患者姓名")
+    private String patientName;
+//    /** 患者年龄 */
+//    @Excel(name = "患者年龄")
+//    private String patientAge;
+
+
+    @Excel(name = "患者联系方式")
+    private String patientTel;
+
+
+    /** 诊断 */
+    @Excel(name = "病例内容")
+    private String title;
+
+    @Excel(name = "反馈内容")
+    private String feedbackContent;
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "反馈时间",width = 30, dateFormat = "yyyy-MM-dd")
+    private Date feedbackTime;
+
+    @Excel(name = "操作人")
+
+    private String companyUserName;
+    @Excel(name = "服务团队")
+    private String companyName;
+
+    @Excel(name = "备注")
+    private String remark;
+
+
+}

+ 140 - 0
fs-service-system/src/main/java/com/fs/store/vo/FsInquiryOrderExeclListVO.java

@@ -0,0 +1,140 @@
+package com.fs.store.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+public class FsInquiryOrderExeclListVO {
+
+    /** ID */
+    private Long orderId;
+
+    /** 订单号 */
+    @Excel(name = "订单号")
+    private String orderSn;
+
+    /** 问诊标题 */
+    @Excel(name = "问诊标题")
+    private String title;
+
+    /** 病例组图 */
+    private String imgs;
+
+    /** 会员ID */
+    private Long userId;
+
+    /** 病人ID */
+    private Long patientId;
+
+    @Excel(name = "病人名称")
+    private String patientName;
+    /** 订单类型 1图文 2语音 */
+    @Excel(name = "订单类型",dictType = "sys_inquiry_order_type")
+    private Integer orderType;
+
+    /** 订单金额 */
+    @Excel(name = "订单金额")
+    private BigDecimal money;
+
+    /** 支付金额 */
+    @Excel(name = "支付金额")
+    private BigDecimal payMoney;
+    /** 支付类型 1微信支付 */
+    @Excel(name = "支付类型 1微信支付")
+    private Integer payType;
+
+    /** 是否支付 */
+    @Excel(name = "是否支付")
+    private Integer isPay;
+    /** 医生ID */
+    private Long doctorId;
+    /** 医生ID */
+    @Excel(name = "医生")
+    private String doctorName;
+
+    @Excel(name = "医生账号")
+    private String account;
+    private String patientJson;
+//    @Excel(name = "优惠劵发送人")
+    private String sendName;
+    /** 支付时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date payTime;
+
+    /** 状态 0待支付 1已支付 2已完成  -1已关闭 -2已退款 */
+    @Excel(name = "状态",dictType="sys_inquiry_status")
+    private Integer status;
+
+    /** 问诊开始时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "问诊开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date startTime;
+
+    /** 结束时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date finishTime;
+
+    /** 是否评价 */
+    @Excel(name = "是否评价")
+    private Integer isPing;
+    /** 是否审核 */
+    @Excel(name = "是否审核")
+    private Integer isAudit;
+
+//    /** 审核人 */
+//    @Excel(name = "审核人")
+//    private Long auditUserId;
+    @Excel(name = "导医 ")
+    private String userName;
+    /** 审核时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date auditTime;
+
+    private Long userCouponId;
+
+    private BigDecimal discountMoney;
+    /** 科室ID */
+    @Excel(name = "科室ID")
+    private Long departmentId;
+    @Excel(name = "科室ID")
+    private String deptName;
+    /** 问诊类型 */
+    @Excel(name = "问诊类型" ,dictType="sys_inquiry_type")
+    private Integer inquiryType;
+
+    private Integer inquirySubType;
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    /** 更新时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+    /** 评价内容 */
+    String pingContent;
+
+    String replyContent;
+    /** 评分 */
+    Integer pingStar;
+
+    private Long packageOrderId;
+
+    private Long companyId;
+    private Long companyUserId;
+    @Excel(name = "导医2")
+    private String companyUserName;
+    @Excel(name = "技术主体")
+    private String companyName;
+    @Excel(name = "技术主体抵扣金额")
+    private BigDecimal companyDeductMoney;
+
+    @Excel(name = "是否开具问诊报告",dictType = "sys_company_or")
+    private Integer isDrugReport;
+}

+ 16 - 0
fs-service-system/src/main/java/com/fs/store/vo/FsInquiryOrderListDParam.java

@@ -0,0 +1,16 @@
+package com.fs.store.vo;
+
+import com.fs.store.param.BaseParam;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class FsInquiryOrderListDParam extends BaseParam implements Serializable {
+    Long doctorId;
+    Integer isSelf;//是否自营
+    Integer isAccept;//是否可抢单
+    Integer inquiryType;
+    Integer status;
+    Integer isReceive;
+}

+ 35 - 0
fs-service-system/src/main/java/com/fs/store/vo/FsInquiryOrderListDVO.java

@@ -0,0 +1,35 @@
+package com.fs.store.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class FsInquiryOrderListDVO implements Serializable {
+
+
+    private Long orderId;
+
+    private String title;
+
+    private Integer orderType;
+
+    private Integer status;
+
+    private Integer inquiryType;
+
+    private Integer isPing;
+
+    private Long userId;
+
+    private String avatar;
+
+    private String patientJson;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+
+}

+ 43 - 0
fs-service-system/src/main/java/com/fs/store/vo/FsInquiryOrderListPDVO.java

@@ -0,0 +1,43 @@
+package com.fs.store.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class FsInquiryOrderListPDVO implements Serializable {
+    private Long orderId;
+
+    private String title;
+
+    private Integer orderType;
+
+    private Integer status;
+
+    private Integer inquiryType;
+
+    private Integer isPing;
+
+    private Long userId;
+
+    private String avatar;
+
+    private String patientJson;
+    private String doctorId;
+    private String nickName;
+    private String orderSn;
+    private String companyName;
+    private String companyId;
+    private String inquirySubType;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date startTime;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date finishTime;
+
+
+}

+ 37 - 0
fs-service-system/src/main/java/com/fs/store/vo/FsInquiryOrderListUVO.java

@@ -0,0 +1,37 @@
+package com.fs.store.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class FsInquiryOrderListUVO implements Serializable {
+
+
+    private Long orderId;
+
+    private String title;
+
+    private Integer orderType;
+
+    private Integer status;
+
+    private Integer inquiryType;
+
+    private Integer isPing;
+
+    private Long doctorId;
+
+    private String doctorName;
+
+    private String deptName;
+
+    private String avatar;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+
+}

+ 130 - 0
fs-service-system/src/main/java/com/fs/store/vo/FsInquiryOrderListVO.java

@@ -0,0 +1,130 @@
+package com.fs.store.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+public class FsInquiryOrderListVO {
+    /** ID */
+    private Long orderId;
+
+    /** 订单号 */
+    @Excel(name = "订单号")
+    private String orderSn;
+
+    /** 问诊标题 */
+    @Excel(name = "问诊标题")
+    private String title;
+
+    /** 会员ID */
+    @Excel(name = "会员ID")
+    private Long userId;
+
+    /** 病人ID */
+    @Excel(name = "病人ID")
+    private Long patientId;
+
+    @Excel(name = "病人名称")
+    private String patientName;
+
+    /** 订单类型 1图文 2语音 */
+    @Excel(name = "订单类型 1图文 2语音")
+    private Integer orderType;
+
+    /** 订单金额 */
+    @Excel(name = "订单金额")
+    private BigDecimal money;
+
+    /** 支付金额 */
+    @Excel(name = "支付金额")
+    private BigDecimal payMoney;
+
+    /** 支付类型 1微信支付 */
+    @Excel(name = "支付类型 1微信支付")
+    private Integer payType;
+
+    /** 是否支付 */
+    @Excel(name = "是否支付")
+    private Integer isPay;
+
+    /** 医生ID */
+    @Excel(name = "医生ID")
+    private Long doctorId;
+
+    /** 医生ID */
+    @Excel(name = "医生")
+    private String doctorName;
+
+    private String sendName;
+    /** 支付时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date payTime;
+
+    /** 状态 0待支付 1已支付 2已完成  -1已关闭 -2已退款 */
+    @Excel(name = "状态 0待支付 1已支付 2已完成  -1已关闭 -2已退款")
+    private Integer status;
+
+    /** 问诊开始时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "问诊开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date startTime;
+
+    /** 结束时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date finishTime;
+
+    /** 是否评价 */
+    @Excel(name = "是否评价")
+    private Integer isPing;
+    /** 是否审核 */
+    @Excel(name = "是否审核")
+    private Integer isAudit;
+
+    /** 审核人 */
+    @Excel(name = "审核人")
+    private Long auditUserId;
+
+    private String userName;
+
+    /** 审核时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date auditTime;
+
+    private Long userCouponId;
+
+    private BigDecimal discountMoney;
+    /** 科室ID */
+    @Excel(name = "科室ID")
+    private Long departmentId;
+    @Excel(name = "科室ID")
+    private String deptName;
+    /** 问诊类型 */
+    @Excel(name = "问诊类型")
+    private Integer inquiryType;
+
+    private Integer inquirySubType;
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    /** 更新时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+    private Long packageOrderId;
+    private Long companyId;
+    private Long companyUserId;
+    @Excel(name = "员工")
+    private String companyUserName;
+    @Excel(name = "公司")
+    private String companyName;
+    @Excel(name = "公司抵扣金额")
+    private BigDecimal companyDeductMoney;
+    private String doctorAccount;
+}

+ 137 - 0
fs-service-system/src/main/java/com/fs/store/vo/FsInquiryOrderVO.java

@@ -0,0 +1,137 @@
+package com.fs.store.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+public class FsInquiryOrderVO implements Serializable {
+    /** ID */
+    private Long orderId;
+
+    /** 订单号 */
+    @Excel(name = "订单号")
+    private String orderSn;
+
+    /** 问诊标题 */
+    @Excel(name = "问诊标题")
+    private String title;
+
+    /** 病例组图 */
+    @Excel(name = "病例组图")
+    private String imgs;
+
+    /** 会员ID */
+    @Excel(name = "会员ID")
+    private Long userId;
+
+    /** 病人ID */
+    @Excel(name = "病人ID")
+    private Long patientId;
+
+    @Excel(name = "病人名称")
+    private String patientName;
+
+    /** 订单类型 1图文 2语音 */
+    @Excel(name = "订单类型 1图文 2语音")
+    private Integer orderType;
+
+    /** 订单金额 */
+    @Excel(name = "订单金额")
+    private BigDecimal money;
+
+    /** 支付金额 */
+    @Excel(name = "支付金额")
+    private BigDecimal payMoney;
+
+    /** 支付类型 1微信支付 */
+    @Excel(name = "支付类型 1微信支付")
+    private Integer payType;
+
+    /** 是否支付 */
+    @Excel(name = "是否支付")
+    private Integer isPay;
+
+    /** 医生ID */
+    @Excel(name = "医生ID")
+    private Long doctorId;
+
+    /** 医生ID */
+    @Excel(name = "医生")
+    private String doctorName;
+    private String  prescribeDoctorName;
+
+    private String patientJson;
+
+    private String sendName;
+    /** 支付时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date payTime;
+
+    /** 状态 0待支付 1已支付 2已完成  -1已关闭 -2已退款 */
+    @Excel(name = "状态 0待支付 1已支付 2已完成  -1已关闭 -2已退款")
+    private Integer status;
+
+    /** 问诊开始时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "问诊开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date startTime;
+
+    /** 结束时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date finishTime;
+
+    /** 是否评价 */
+    @Excel(name = "是否评价")
+    private Integer isPing;
+    /** 是否审核 */
+    @Excel(name = "是否审核")
+    private Integer isAudit;
+
+    /** 审核人 */
+    @Excel(name = "审核人")
+    private Long auditUserId;
+    private String userName;
+    /** 审核时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date auditTime;
+
+    private Long userCouponId;
+
+    private BigDecimal discountMoney;
+    /** 科室ID */
+    @Excel(name = "科室ID")
+    private Long departmentId;
+    @Excel(name = "科室名称")
+    private String deptName;
+    /** 问诊类型 */
+    @Excel(name = "问诊类型")
+    private Integer inquiryType;
+    private Integer inquirySubType;
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    /** 更新时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+    /** 评价内容 */
+    String pingContent;
+
+    String replyContent;
+    /** 评分 */
+    Integer pingStar;
+
+    private Long packageOrderId;
+
+    private Long companyUserId;
+
+    private String companyUserRemark;
+}

+ 151 - 0
fs-service-system/src/main/java/com/fs/store/vo/FsPackageOrderVO.java

@@ -0,0 +1,151 @@
+package com.fs.store.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+public class FsPackageOrderVO {
+    private Long orderId;
+
+    /** 订单号 */
+    @Excel(name = "订单号")
+    private String orderSn;
+
+    /** 用户ID */
+    @Excel(name = "用户ID")
+    private Long userId;
+    @Excel(name = "用户昵称")
+    private String nickName;
+    @Excel(name = "电话")
+    private String phone;
+    @Excel(name = "医生名称")
+    private String doctorName;
+
+    /** 医生ID */
+    @Excel(name = "医生ID")
+    private Long doctorId;
+
+    /** 套餐ID */
+    @Excel(name = "套餐ID")
+    private Long packageId;
+
+    /** 套餐名称 */
+    @Excel(name = "套餐名称")
+    private String packageName;
+
+    /** 支付金额 */
+    @Excel(name = "支付金额")
+    private BigDecimal payMoney;
+
+    /** 是否支付 */
+    @Excel(name = "是否支付")
+    private Integer isPay;
+
+    /** 天数 */
+    @Excel(name = "天数")
+    private Long days;
+
+    /** 状态 */
+    @Excel(name = "状态")
+    private Integer status;
+
+    /** 开始时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date startTime;
+
+    /** 结束时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date finishTime;
+
+    @Excel(name = "json")
+    private String formJson;
+
+    @Excel(name = "公司ID")
+    private Long companyId;
+
+    @Excel(name = "公司用户ID")
+    private Long companyUserId;
+
+    @Excel(name = "问诊订单ID")
+    private Long inquiryOrderId;
+
+    @Excel(name = "商品订单ID")
+    private Long storeOrderId;
+
+    @Excel(name = "套餐包数据")
+    private String packageJson;
+
+    @Excel(name = "患者数据")
+    private String patientJson;
+
+    private String patientName;
+
+    @Excel(name = "退款图片")
+    private String refundImg;
+
+    @Excel(name = "退款用户说明")
+    private String refundExplain;
+
+    @Excel(name = "不退款的理由")
+    private String refundReason;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "退款时间")
+    private Date refundTime;
+
+    @Excel(name = "退款金额")
+    private BigDecimal refundMoney;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "支付时间")
+    private Date payTime;
+
+    @Excel(name = "退款状态")
+    private Integer refundStatus;
+
+    @Excel(name = "套餐价格")
+    private BigDecimal totalPrice;
+    @Excel(name = "地址")
+    private String addressJson;
+    @Excel(name = "付款类型")
+    private String payType;
+    @Excel(name = "备注")
+    private String remark;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    @Excel(name = "店铺id")
+    private Long storeId;
+    @Excel(name = "公司名称")
+    private String companyName;
+    @Excel(name = "公司用户名称")
+    private String companyUserName;
+    @Excel(name = "实际支付金额")
+    private BigDecimal payPrice;
+    @Excel(name = "剩余金额")
+    private BigDecimal payRemain;
+    @Excel(name = "邮费")
+    private BigDecimal payDelivery;
+    @Excel(name = "优惠金额")
+    private BigDecimal discountMoney;
+    @Excel(name = "随访次数")
+    private Integer followNum;
+    @Excel(name = "已随访次数")
+    private Integer followCount;
+    private Integer inquiryRefundStatus;
+    private Integer storeRefundStatus;
+    private Integer packageSubType;
+    private BigDecimal inquiryPrice;
+    private BigDecimal productPrice;
+    private BigDecimal prescribePrice;
+    //别名
+    private String secondName;
+    private Integer source;
+}

+ 104 - 29
fs-service-system/src/main/java/com/fs/store/vo/FsPrescribeVO.java

@@ -1,111 +1,186 @@
 package com.fs.store.vo;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
 import lombok.Data;
 
 import java.io.Serializable;
 import java.util.Date;
 
 @Data
-public class FsPrescribeVO implements Serializable
-{
-
+public class FsPrescribeVO implements Serializable {
     /** id */
     private Long prescribeId;
 
-    /** 处方类型 1订单 2问诊 */
+    /** 处方类型 1问诊 2订单 */
+    @Excel(name = "处方类型 1西药 2中药")
     private Integer prescribeType;
 
     /** 订单ID */
-    private Long orderId;
+    @Excel(name = "订单ID")
+    private Long inquiryOrderId;
+
+    /**
+     * 处方单Id
+     */
+    @Excel(name = "处方单ID")
+    private String rpId;
 
+    /** 订单id **/
+    @Excel(name = "订单ID")
+    private Long orderId;
+    /** 用户id */
+    @Excel(name = "用户昵称")
+    private String nickName;
+    /** 店铺ID */
+    @Excel(name = "店铺名称")
+    private String  storeName;
+    @Excel(name = "医生名称")
+    private String  doctorName;
+    @Excel(name = "药师名称")
+    private String  doctorDrugName;
+
+    @Excel(name = "主述")
+    private String chiefComplaint;
     /** 用户ID */
+    @Excel(name = "用户ID")
     private Long userId;
 
     /** 患者ID */
+    @Excel(name = "患者ID")
     private Long patientId;
 
     /** 处⽅单ID(唯⼀ID) */
-    private String rpId;
-
-    /** 门店标识 */
-    private String pharmacyCode;
-
-    /** ⻔店名称 */
-    private String pharmacyName;
+    @Excel(name = "处⽅单ID")
+    private String prescribeCode;
 
     /** 病情描述(主诉) */
-    private String chiefComplaint;
+    @Excel(name = "病情描述(主诉)")
+    private String patientDescs;
 
     /** 现病史 */
+    @Excel(name = "现病史")
     private String nowIllness;
 
     /** 既往史 */
+    @Excel(name = "既往史")
     private String historyIllness;
 
     /** 患者年龄 */
+    @Excel(name = "患者年龄")
     private String patientAge;
 
     /** 患者姓名 */
+    @Excel(name = "患者姓名")
     private String patientName;
 
     /** 体重 */
+    @Excel(name = "体重")
     private String weight;
 
     /** 是否有过敏史(传值:是/否) */
+    @Excel(name = "是否有过敏史")
     private String isHistoryAllergic;
 
     /** 过敏史 */
+    @Excel(name = "过敏史")
     private String historyAllergic;
 
     /** 肝功能是否异常(传值:是/否) */
+    @Excel(name = "肝功能是否异常")
     private String liverUnusual;
 
     /** 肾功能是否异常(传值:是/否) */
+    @Excel(name = "肾功能是否异常")
     private String renalUnusual;
 
     /** 是否是备孕/怀孕/哺乳期(传值:是 */
-    private String lactationFlag;
+    @Excel(name = "是否是备孕/怀孕/哺乳期")
+    private String isLactation;
 
     /** 患者电话 */
+    @Excel(name = "患者电话")
     private String patientTel;
 
     /** 患者性别(传数字,1男 2⼥) */
+    @Excel(name = "患者性别(传数字,1男 2⼥)")
     private String patientGender;
 
     /** 复诊凭证 */
+    @Excel(name = "复诊凭证")
     private String recordPic;
 
-    /** 处方图片地址 */
-    private String rpUrl;
+    @Excel(name = "身份证")
+    private String idCard;
 
-    /** 处⽅开具时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private Date rpCreateTime;
+    /** 处方图片地址 */
+    @Excel(name = "处方图片地址")
+    private String prescribeImgUrl;
+    private String prescribeImgStoreUrl;
 
+    /** 拒绝原因 */
+    @Excel(name = "拒绝原因")
     private String auditReason;
 
     /** 诊断 */
+    @Excel(name = "诊断")
     private String diagnose;
 
-    /** 药品列表 JSON */
-    private String drugs;
-
-    /** 医生名称 */
-    private String doctorName;
+    /** 医生ID */
+    @Excel(name = "医生ID")
+    private Long doctorId;
 
-    /** 科室名称 */
-    private String doctorId;
+    /** 医生ID */
+    @Excel(name = "药师ID")
+    private Long drugDoctorId;
+    @Excel(name = "0颗粒1膏方")
+    private Integer recipeType;
 
+    /** 状态 0未开 1已开 */
+    @Excel(name = "状态 0未开 1已开")
     private Integer status;
+    private String prescribeDoctorName;
+    @Excel(name = "使用方法")
+    private String usageJson;
+    @Excel(name = "病人生日")
+    private String patientBirthday;
+    /** 审核时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date auditTime;
+    @Excel(name = "备注")
+    private String remark;
+    @Excel(name = "店铺id")
+    private Long storeId;
 
+    @Excel(name = "医生id")
+    private Long prescribeDoctorId;
 
-    private String orderCode;
+    @Excel(name = "开方医生签名")
+    private String doctorSignUrl;
 
-    private String userNickname;
+    @Excel(name = "处方医生签名")
+    private String prescribeDoctorSignUrl;
 
-    private String userPhone;
+    @Excel(name = "药师签名")
+    private String drugDoctorSignUrl;
+
+    @Excel(name = "药品订单状态",dictType="sys_order_status")
+    private String orderStatus;
+
+    @Excel(name = "药品订单编号")
+    private String orderCode;
 
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date createTime;
+    /** 更新时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+    private String prescribeCodeUrl;
+    private String icdCode;
+    private String userPhone;
+
+    private String medicalRecordUrl;
+    private String rpUrl;
+
 }

+ 12 - 0
fs-service-system/src/main/java/com/fs/store/vo/FsStoreCartQueryVO.java

@@ -72,4 +72,16 @@ import java.math.BigDecimal;
      */
     private String warehouseCode;
 
+    /**
+     * 服用方法
+     */
+    private String usageMethod;
+    /**
+     * 一日几次
+     */
+    private String frequency;
+    /**
+     * 用药数量
+     */
+    private String dosage;
 }

+ 7 - 0
fs-service-system/src/main/java/com/fs/store/vo/FsStoreOrderItemExportVO.java

@@ -18,6 +18,8 @@ public class FsStoreOrderItemExportVO implements Serializable
     @Excel(name = "订单号")
     private String orderCode;
 
+    private Long orderId;
+
     @Excel(name = "订单状态", dictType = "store_order_status")
     private String status;
 
@@ -111,4 +113,9 @@ public class FsStoreOrderItemExportVO implements Serializable
      */
     private Long productId;
 
+    @Excel(name = "患者姓名")
+    private String patientName;
+
+    @Excel(name = "身份证号码")
+    private String idCard;
 }

+ 16 - 0
fs-service-system/src/main/java/com/fs/store/vo/FsStoreProductExportVO.java

@@ -195,4 +195,20 @@ public class FsStoreProductExportVO implements Serializable {
      */
     @Excel(name = "仓库代码")
     private String warehouseCode;
+
+    /**
+     * 服用方法
+     */
+    @Excel(name = "服用方法")
+    private String usageMethod;
+    /**
+     * 一日几次
+     */
+    @Excel(name = "一日几次")
+    private String frequency;
+    /**
+     * 用药数量
+     */
+    @Excel(name = "用药数量")
+    private String dosage;
 }

+ 5 - 0
fs-service-system/src/main/java/com/fs/store/vo/FsUserListVO.java

@@ -135,4 +135,9 @@ public class FsUserListVO implements Serializable
     private Date createTime;
 
     private String spreadPhone;
+
+    /**
+     * 剩余理赔额度
+     */
+    private BigDecimal remainingClaimLimit;
 }

+ 9 - 6
fs-service-system/src/main/resources/application-config.yml

@@ -1,6 +1,6 @@
 #配置
 fsConfig:
-  omsCode: "wjdh.SF.0235493583"
+  omsCode: "CDYJFYD.400011111705_241230"
   #快递鸟
   kdnId: 1881217
   kdnKeyId: a43fee18-3ea9-4eff-99c0-7e94618d7a57
@@ -14,7 +14,7 @@ fsConfig:
   erpSessionKey: 9caae15474cb443ea22235e7bb86016b
   erpSecret: 96f774dbd60847b59a16f92fd963a0c8
   erpUrl: http://v2.api.guanyierp.com/rest/erp_open
-  erpShopCode: "0080"
+  erpShopCode: "0083"
 
   #第三方支付配置
   payOpen: 1
@@ -42,7 +42,10 @@ fsConfig:
   accessKeyID: 1734570804
   accessKeySecret: 8791c9bdb0b14e23866c631786f76fac
   callbackUrl: https://api.yjf.runtzh.com/app/prescribe/presribeNotify
-  # 处方接口g
+  # 处方接口
+  doctorSignImgUrl: "https://cos.his.cdwjyyh.com/fs/20241015/8b3d143c5f9a4d56a210daece01cf037.png"
+  drugDoctorSignImgUrl: "https://cos.his.cdwjyyh.com/fs/20250621/c61b68fe9e114bbfa07387b8fbb76e8a.png"
+  prescribeTemplateImgPath: "/home/software/fs-admin/config/xycf.jpg"
 #  prescribeUrl: https://app3.nxk520.com/platform-shenfang/nethosp/webservice/jsonapi
 #  actId: uporder
 #  appId: 1661496555
@@ -72,14 +75,14 @@ wx:
     configs:
 #      - appid: wx36b87a0820734de8
 #        secret: 52700f5c811ed902a53ee3a358b29135
-      - appid: wx19c8813ffc33d1cb
-        secret: 38caf1e4f67c1d65061176d6157522a9
+      - appid: wx7e374e2a71074b62
+        secret: 6edca5ea6b0bb5d97ea4a7c145db6af3
         token: Ncbnd7lJvkripVOpyTFAna6NAWCxCrvC
         aesKey: HlEiBB55eaWUaeBVAQO3cWKWPYv1vOVQSq7nFNICw4E
         msgDataFormat: JSON
         account: 37519015371852
   pay:
-    appId: wx19c8813ffc33d1cb #微信公众号或者小程序等的appid
+    appId: wx9015ef29afa2d959 #微信公众号或者小程序等的appid
     mchId: 1560230251 #微信支付商户号
     mchKey: dltcx057ngdbukiuwn83621khh07ewmn #微信支付商户密钥
     subAppId:  #服务商模式下的子商户公众账号ID

+ 320 - 0
fs-service-system/src/main/resources/mapper/store/FsInquiryOrderMapper.xml

@@ -0,0 +1,320 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fs.store.mapper.FsInquiryOrderMapper">
+
+    <resultMap type="FsInquiryOrder" id="FsInquiryOrderResult">
+        <result property="orderId"    column="order_id"    />
+        <result property="orderSn"    column="order_sn"    />
+        <result property="title"    column="title"    />
+        <result property="imgs"    column="imgs"    />
+        <result property="userId"    column="user_id"    />
+        <result property="patientId"    column="patient_id"    />
+        <result property="orderType"    column="order_type"    />
+        <result property="money"    column="money"    />
+        <result property="payMoney"    column="pay_money"    />
+        <result property="payType"    column="pay_type"    />
+        <result property="isPay"    column="is_pay"    />
+        <result property="doctorId"    column="doctor_id"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="payTime"    column="pay_time"    />
+        <result property="status"    column="status"    />
+        <result property="startTime"    column="start_time"    />
+        <result property="finishTime"    column="finish_time"    />
+        <result property="remark"    column="remark"    />
+        <result property="isPing"    column="is_ping"    />
+        <result property="departmentId"    column="department_id"    />
+        <result property="inquiryType"    column="inquiry_type"    />
+        <result property="inquirySubType"    column="inquiry_sub_type"    />
+        <result property="patientJson"    column="patient_json"    />
+        <result property="isReceive"    column="is_receive"    />
+        <result property="tradeNo"    column="trade_no"    />
+        <result property="isAudit"    column="is_audit"    />
+        <result property="auditUserId"    column="audit_user_id"    />
+        <result property="auditTime"    column="audit_time"    />
+        <result property="userCouponId"    column="user_coupon_id"    />
+        <result property="discountMoney"    column="discount_money"    />
+        <result property="packageOrderId"    column="package_order_id"    />
+        <result property="companyId"    column="company_id"    />
+        <result property="companyUserId"    column="company_user_id"    />
+        <result property="companyDeductMoney"    column="company_deduct_money"    />
+        <result property="deptId"    column="dept_id"    />
+        <result property="companyUserRemark"    column="company_user_remark"    />
+        <result property="isSendSms"    column="is_send_sms"    />
+        <result property="doctorRemark"    column="doctor_remark"    />
+        <result property="source"    column="source"    />
+        <result property="triageUserId"    column="triage_user_id"    />
+    </resultMap>
+
+    <sql id="selectFsInquiryOrderVo">
+        select order_id,doctor_remark,source,triage_user_id, user_coupon_id,dept_id,company_deduct_money,company_id,company_user_id,company_user_remark,is_send_sms,package_order_id,discount_money, order_sn, title, imgs, user_id, patient_id, order_type, money, pay_money, pay_type, is_pay, doctor_id, create_time, pay_time, status, start_time, finish_time, remark, is_ping, department_id, inquiry_type, inquiry_sub_type, patient_json, is_receive, trade_no, is_audit, audit_user_id, audit_time from fs_inquiry_order
+    </sql>
+
+    <select id="selectFsInquiryOrderList" parameterType="FsInquiryOrder" resultMap="FsInquiryOrderResult">
+        <include refid="selectFsInquiryOrderVo"/>
+        <where>
+            <if test="orderSn != null  and orderSn != ''"> and order_sn = #{orderSn}</if>
+            <if test="title != null  and title != ''"> and title = #{title}</if>
+            <if test="imgs != null  and imgs != ''"> and imgs = #{imgs}</if>
+            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="patientId != null "> and patient_id = #{patientId}</if>
+            <if test="orderType != null "> and order_type = #{orderType}</if>
+            <if test="money != null "> and money = #{money}</if>
+            <if test="payMoney != null "> and pay_money = #{payMoney}</if>
+            <if test="payType != null "> and pay_type = #{payType}</if>
+            <if test="isPay != null "> and is_pay = #{isPay}</if>
+            <if test="doctorId != null "> and doctor_id = #{doctorId}</if>
+            <if test="payTime != null "> and pay_time = #{payTime}</if>
+            <if test="status != null "> and status = #{status}</if>
+            <if test="startTime != null "> and start_time = #{startTime}</if>
+            <if test="finishTime != null "> and finish_time = #{finishTime}</if>
+            <if test="isPing != null "> and is_ping = #{isPing}</if>
+            <if test="departmentId != null "> and department_id = #{departmentId}</if>
+            <if test="inquiryType != null "> and inquiry_type = #{inquiryType}</if>
+            <if test="inquirySubType != null "> and inquiry_sub_type = #{inquirySubType}</if>
+            <if test="patientJson != null  and patientJson != ''"> and patient_json = #{patientJson}</if>
+            <if test="isReceive != null "> and is_receive = #{isReceive}</if>
+            <if test="tradeNo != null  and tradeNo != ''"> and trade_no = #{tradeNo}</if>
+            <if test="isAudit != null "> and is_audit = #{isAudit}</if>
+            <if test="auditUserId != null "> and audit_user_id = #{auditUserId}</if>
+            <if test="auditTime != null "> and audit_time = #{auditTime}</if>
+            <if test="isSendSms != null "> and is_send_sms = #{isSendSms}</if>
+        </where>
+    </select>
+
+    <select id="selectFsInquiryOrderByOrderId" parameterType="Long" resultMap="FsInquiryOrderResult">
+        <include refid="selectFsInquiryOrderVo"/>
+        where order_id = #{orderId}
+    </select>
+
+    <insert id="insertFsInquiryOrder" parameterType="FsInquiryOrder" useGeneratedKeys="true" keyProperty="orderId">
+        insert into fs_inquiry_order
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="orderSn != null">order_sn,</if>
+            <if test="title != null">title,</if>
+            <if test="imgs != null">imgs,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="patientId != null">patient_id,</if>
+            <if test="orderType != null">order_type,</if>
+            <if test="money != null">money,</if>
+            <if test="payMoney != null">pay_money,</if>
+            <if test="payType != null">pay_type,</if>
+            <if test="isPay != null">is_pay,</if>
+            <if test="doctorId != null">doctor_id,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="payTime != null">pay_time,</if>
+            <if test="status != null">status,</if>
+            <if test="startTime != null">start_time,</if>
+            <if test="finishTime != null">finish_time,</if>
+            <if test="remark != null">remark,</if>
+            <if test="isPing != null">is_ping,</if>
+            <if test="departmentId != null">department_id,</if>
+            <if test="inquiryType != null">inquiry_type,</if>
+            <if test="inquirySubType != null">inquiry_sub_type,</if>
+            <if test="patientJson != null">patient_json,</if>
+            <if test="isReceive != null">is_receive,</if>
+            <if test="tradeNo != null">trade_no,</if>
+            <if test="isAudit != null">is_audit,</if>
+            <if test="auditUserId != null">audit_user_id,</if>
+            <if test="auditTime != null">audit_time,</if>
+            <if test="userCouponId != null">user_coupon_id,</if>
+            <if test="discountMoney != null">discount_money,</if>
+            <if test="packageOrderId != null">package_order_id,</if>
+            <if test="companyId != null">company_id,</if>
+            <if test="companyUserId != null">company_user_id,</if>
+            <if test="companyDeductMoney != null">company_deduct_money,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="companyUserRemark != null">company_user_remark,</if>
+            <if test="isSendSms != null">is_send_sms,</if>
+            <if test="doctorRemark != null">doctor_remark,</if>
+            <if test="source != null">source,</if>
+            <if test="triageUserId != null">triage_user_id,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="orderSn != null">#{orderSn},</if>
+            <if test="title != null">#{title},</if>
+            <if test="imgs != null">#{imgs},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="patientId != null">#{patientId},</if>
+            <if test="orderType != null">#{orderType},</if>
+            <if test="money != null">#{money},</if>
+            <if test="payMoney != null">#{payMoney},</if>
+            <if test="payType != null">#{payType},</if>
+            <if test="isPay != null">#{isPay},</if>
+            <if test="doctorId != null">#{doctorId},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="payTime != null">#{payTime},</if>
+            <if test="status != null">#{status},</if>
+            <if test="startTime != null">#{startTime},</if>
+            <if test="finishTime != null">#{finishTime},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="isPing != null">#{isPing},</if>
+            <if test="departmentId != null">#{departmentId},</if>
+            <if test="inquiryType != null">#{inquiryType},</if>
+            <if test="inquirySubType != null">#{inquirySubType},</if>
+            <if test="patientJson != null">#{patientJson},</if>
+            <if test="isReceive != null">#{isReceive},</if>
+            <if test="tradeNo != null">#{tradeNo},</if>
+            <if test="isAudit != null">#{isAudit},</if>
+            <if test="auditUserId != null">#{auditUserId},</if>
+            <if test="auditTime != null">#{auditTime},</if>
+            <if test="userCouponId != null">#{userCouponId},</if>
+            <if test="discountMoney != null">#{discountMoney},</if>
+            <if test="packageOrderId != null">#{packageOrderId},</if>
+            <if test="companyId != null">#{companyId},</if>
+            <if test="companyUserId != null">#{companyUserId},</if>
+            <if test="companyDeductMoney != null">#{companyDeductMoney},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="companyUserRemark != null">#{companyUserRemark},</if>
+            <if test="isSendSms != null">#{isSendSms},</if>
+            <if test="doctorRemark != null">#{doctorRemark},</if>
+            <if test="source != null">#{source},</if>
+            <if test="triageUserId != null">#{triageUserId},</if>
+         </trim>
+    </insert>
+
+    <update id="updateFsInquiryOrder" parameterType="FsInquiryOrder">
+        update fs_inquiry_order
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="orderSn != null">order_sn = #{orderSn},</if>
+            <if test="title != null">title = #{title},</if>
+            <if test="imgs != null">imgs = #{imgs},</if>
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="patientId != null">patient_id = #{patientId},</if>
+            <if test="orderType != null">order_type = #{orderType},</if>
+            <if test="money != null">money = #{money},</if>
+            <if test="payMoney != null">pay_money = #{payMoney},</if>
+            <if test="payType != null">pay_type = #{payType},</if>
+            <if test="isPay != null">is_pay = #{isPay},</if>
+            <if test="doctorId != null">doctor_id = #{doctorId},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="payTime != null">pay_time = #{payTime},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="startTime != null">start_time = #{startTime},</if>
+            <if test="finishTime != null">finish_time = #{finishTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="isPing != null">is_ping = #{isPing},</if>
+            <if test="departmentId != null">department_id = #{departmentId},</if>
+            <if test="inquiryType != null">inquiry_type = #{inquiryType},</if>
+            <if test="inquirySubType != null">inquiry_sub_type = #{inquirySubType},</if>
+            <if test="patientJson != null">patient_json = #{patientJson},</if>
+            <if test="isReceive != null">is_receive = #{isReceive},</if>
+            <if test="tradeNo != null">trade_no = #{tradeNo},</if>
+            <if test="isAudit != null">is_audit = #{isAudit},</if>
+            <if test="auditUserId != null">audit_user_id = #{auditUserId},</if>
+            <if test="auditTime != null">audit_time = #{auditTime},</if>
+            <if test="userCouponId != null">user_coupon_id = #{userCouponId},</if>
+            <if test="discountMoney != null">discount_money = #{discountMoney},</if>
+            <if test="packageOrderId != null">package_order_id = #{packageOrderId},</if>
+            <if test="companyId != null">company_id = #{companyId},</if>
+            <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
+            <if test="companyDeductMoney != null">company_deduct_money = #{companyDeductMoney},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="companyUserRemark != null">company_user_remark = #{companyUserRemark},</if>
+            <if test="isSendSms != null">is_send_sms = #{isSendSms},</if>
+            <if test="doctorRemark != null">doctor_remark = #{doctorRemark},</if>
+            <if test="source != null">source = #{source},</if>
+            <if test="triageUserId != null">triage_user_id = #{triageUserId},</if>
+        </trim>
+        where order_id = #{orderId}
+    </update>
+
+
+    <update id="revokeFsInquiryOrder" parameterType="FsInquiryOrder">
+        update fs_inquiry_order
+        <trim prefix="SET" suffixOverrides=",">
+            audit_time = #{auditTime},
+            audit_user_id = #{auditUserId},
+            <if test="orderSn != null">order_sn = #{orderSn},</if>
+            <if test="title != null">title = #{title},</if>
+            <if test="imgs != null">imgs = #{imgs},</if>
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="patientId != null">patient_id = #{patientId},</if>
+            <if test="orderType != null">order_type = #{orderType},</if>
+            <if test="money != null">money = #{money},</if>
+            <if test="payMoney != null">pay_money = #{payMoney},</if>
+            <if test="payType != null">pay_type = #{payType},</if>
+            <if test="isPay != null">is_pay = #{isPay},</if>
+            <if test="doctorId != null">doctor_id = #{doctorId},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="payTime != null">pay_time = #{payTime},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="startTime != null">start_time = #{startTime},</if>
+            <if test="finishTime != null">finish_time = #{finishTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="isPing != null">is_ping = #{isPing},</if>
+            <if test="departmentId != null">department_id = #{departmentId},</if>
+            <if test="inquiryType != null">inquiry_type = #{inquiryType},</if>
+            <if test="inquirySubType != null">inquiry_sub_type = #{inquirySubType},</if>
+            <if test="patientJson != null">patient_json = #{patientJson},</if>
+            <if test="isReceive != null">is_receive = #{isReceive},</if>
+            <if test="tradeNo != null">trade_no = #{tradeNo},</if>
+            <if test="isAudit != null">is_audit = #{isAudit},</if>
+            <if test="userCouponId != null">user_coupon_id = #{userCouponId},</if>
+            <if test="discountMoney != null">discount_money = #{discountMoney},</if>
+            <if test="packageOrderId != null">package_order_id = #{packageOrderId},</if>
+            <if test="companyId != null">company_id = #{companyId},</if>
+            <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
+            <if test="companyDeductMoney != null">company_deduct_money = #{companyDeductMoney},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="companyUserRemark != null">company_user_remark = #{companyUserRemark},</if>
+            <if test="isSendSms != null">is_send_sms = #{isSendSms},</if>
+            <if test="doctorRemark != null">doctor_remark = #{doctorRemark},</if>
+            <if test="source != null">source = #{source},</if>
+            <if test="triageUserId != null">triage_user_id = #{triageUserId},</if>
+        </trim>
+        where order_id = #{orderId}
+    </update>
+    <delete id="deleteFsInquiryOrderByOrderId" parameterType="Long">
+        delete from fs_inquiry_order where order_id = #{orderId}
+    </delete>
+
+    <delete id="deleteFsInquiryOrderByOrderIds" parameterType="String">
+        delete from fs_inquiry_order where order_id in
+        <foreach item="orderId" collection="array" open="(" separator="," close=")">
+            #{orderId}
+        </foreach>
+    </delete>
+
+    <select id="selectFsInquiryOrderVOList_COUNT" parameterType="com.fs.store.vo.FsInquiryOrderListVO" resultType="Long">
+    select count(1) from fs_inquiry_order   io
+        <if test="maps.doctorName != null or maps.doctorAccount != null"> LEFT JOIN fs_doctor dc ON io.doctor_id = dc.doctor_id  </if>
+        <if test="maps.phone != null and maps.phone != ''"> LEFT JOIN fs_user fu ON fu.user_id=io.user_id</if>
+        <if test="maps.companyUserName != null or (maps.companyUserNickName != null and maps.companyUserNickName != '') "> LEFT JOIN company_user cu ON cu.user_id = io.company_user_id </if>
+        where 1=1
+        <if test="maps.orderSn != null and maps.orderSn != ''"> and io.order_sn = #{maps.orderSn}</if>
+        <if test="maps.title != null and maps.title != ''"> and io.title = #{maps.title}</if>
+        <if test="maps.userId != null"> and io.user_id = #{maps.userId}</if>
+        <if test="maps.doctorName != null"> and dc.doctor_name like concat('%', #{maps.doctorName}, '%')</if>
+        <if test="maps.patientId != null"> and io.patient_id = #{maps.patientId}</if>
+        <if test="maps.patientName != null"> and io.patient_json like concat('%',#{maps.patientName},'%')</if>
+        <if test="maps.orderType != null"> and io.order_type = #{maps.orderType}</if>
+        <if test="maps.payType != null"> and io.pay_type = #{maps.payType}</if>
+        <if test="maps.isPay != null"> and io.is_pay = #{maps.isPay}</if>
+        <if test="maps.doctorId != null"> and io.doctor_id = #{maps.doctorId}</if>
+        <if test="maps.status != null"> and io.status = #{maps.status}</if>
+        <if test="maps.sTime != null"> and DATE(io.start_time) &gt;= DATE(#{maps.sTime})</if>
+        <if test="maps.eTime != null"> and DATE(io.start_time) &lt;= DATE(#{maps.eTime})</if>
+        <if test="maps.fsTime != null"> and DATE(io.finish_time) &gt;= DATE(#{maps.fsTime})</if>
+        <if test="maps.feTime != null"> and DATE(io.finish_time) &lt;= DATE(#{maps.feTime})</if>
+        <if test="maps.isPing != null"> and io.is_ping = #{maps.isPing}</if>
+        <if test="maps.departmentId != null"> and io.department_id = #{maps.departmentId}</if>
+        <if test="maps.inquiryType != null"> and io.inquiry_type = #{maps.inquiryType}</if>
+        <if test="maps.phone != null and maps.phone != ''"> and fu.phone = #{maps.phone}</if>
+        <if test="maps.companyId != null"> and io.company_id = #{maps.companyId}</if>
+        <if test="maps.companyUserId != null"> and io.company_user_id = #{maps.companyUserId}</if>
+        <if test="maps.companyUserName != null"> and cu.user_name = #{maps.companyUserName}</if>
+        <if test="maps.inquirySubType != null"> and io.inquiry_sub_type = #{maps.inquirySubType}</if>
+        <if test="maps.createTimeList != null"> and date_format(io.create_time,'%y%m%d') &gt;= date_format(#{maps.createTimeList[0]},'%y%m%d') AND date_format(io.create_time,'%y%m%d') &lt;= date_format(#{maps.createTimeList[1]},'%y%m%d')</if>
+        <if test="maps.payTimeList != null"> and date_format(io.pay_time,'%y%m%d') &gt;= date_format(#{maps.payTimeList[0]},'%y%m%d') AND date_format(io.pay_time,'%y%m%d') &lt;= date_format(#{maps.payTimeList[1]},'%y%m%d')</if>
+        <if test="maps.deptId != null"> AND (io.dept_id = #{maps.deptId} OR io.dept_id IN (SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors)))</if>
+        <if test="maps.inquirySubType != null"> and io.inquiry_sub_type = #{maps.inquirySubType}</if>
+        <if test="maps.doctorAccount != null"> and dc.account = #{maps.doctorAccount}</if>
+        <if test="maps.companyUserNickName != null and maps.companyUserNickName != ''"> and cu.nick_name like concat( #{maps.companyUserNickName}, '%')</if>
+    </select>
+    <select id="selectOrderMsgByPackageOrderId" resultType="com.fs.store.vo.FsPackageOrderVO">
+        select order_id orderId,form_json formJson from fs_package_order where order_id = #{packageOrderId} limit 1
+    </select>
+
+</mapper>

+ 14 - 8
fs-service-system/src/main/resources/mapper/store/FsPrescribeMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.fs.store.mapper.FsPrescribeMapper">
-    
+
     <resultMap type="FsPrescribe" id="FsPrescribeResult">
         <result property="prescribeId"    column="prescribe_id"    />
         <result property="prescribeType"    column="prescribe_type"    />
@@ -36,15 +36,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="doctorId"    column="doctor_id"    />
         <result property="createTime"    column="create_time"    />
         <result property="status"    column="status"    />
+        <result property="medicalRecordUrl"    column="medical_record_url"    />
     </resultMap>
 
     <sql id="selectFsPrescribeVo">
-        select prescribe_id, prescribe_type, order_id, user_id, patient_id, rp_id, pharmacy_code, pharmacy_name, chief_complaint, now_illness, history_illness, patient_age, patient_name, weight, is_history_allergic, history_allergic, liver_unusual, renal_unusual, lactation_flag, patient_tel, patient_gender, record_pic, rp_url, rp_create_time,audit_reason, diagnose, drugs, doctor_name, doctor_id, create_time,status from fs_prescribe
+        select prescribe_id, prescribe_type, order_id, user_id, patient_id, rp_id, pharmacy_code, pharmacy_name, chief_complaint, now_illness, history_illness, patient_age, patient_name, weight, is_history_allergic, history_allergic, liver_unusual, renal_unusual, lactation_flag, patient_tel, patient_gender, record_pic, rp_url, rp_create_time,audit_reason, diagnose, drugs, doctor_name, doctor_id, create_time,status,medical_record_url,generate_status,fail_msg from fs_prescribe
     </sql>
 
     <select id="selectFsPrescribeList" parameterType="FsPrescribe" resultMap="FsPrescribeResult">
         <include refid="selectFsPrescribeVo"/>
-        <where>  
+        <where>
             <if test="prescribeType != null "> and prescribe_type = #{prescribeType}</if>
             <if test="orderId != null "> and order_id = #{orderId}</if>
             <if test="userId != null "> and user_id = #{userId}</if>
@@ -75,12 +76,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="status != null  and status != ''"> and status = #{status}</if>
         </where>
     </select>
-    
+
     <select id="selectFsPrescribeById" parameterType="Long" resultMap="FsPrescribeResult">
         <include refid="selectFsPrescribeVo"/>
         where prescribe_id = #{prescribeId}
     </select>
-        
+
     <insert id="insertFsPrescribe" parameterType="FsPrescribe" useGeneratedKeys="true" keyProperty="prescribeId">
         insert into fs_prescribe
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -114,6 +115,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="doctorId != null">doctor_id,</if>
             <if test="createTime != null">create_time,</if>
             <if test="status != null">status,</if>
+            <if test="medicalRecordUrl != null">medical_record_url,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="prescribeType != null">#{prescribeType},</if>
@@ -146,6 +148,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="doctorId != null">#{doctorId},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="status != null">#{status},</if>
+            <if test="medicalRecordUrl != null">#{medicalRecordUrl},</if>
          </trim>
     </insert>
 
@@ -182,6 +185,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="doctorId != null">doctor_id = #{doctorId},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="status != null">status = #{status},</if>
+            <if test="medicalRecordUrl != null">medical_record_url = #{medicalRecordUrl},</if>
+            <if test="generateStatus != null">generate_status = #{generateStatus},</if>
+            <if test="failMsg != null">fail_msg = #{failMsg},</if>
         </trim>
         where prescribe_id = #{prescribeId}
     </update>
@@ -191,10 +197,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteFsPrescribeByIds" parameterType="String">
-        delete from fs_prescribe where prescribe_id in 
+        delete from fs_prescribe where prescribe_id in
         <foreach item="prescribeId" collection="array" open="(" separator="," close=")">
             #{prescribeId}
         </foreach>
     </delete>
-    
-</mapper>
+
+</mapper>

+ 13 - 1
fs-service-system/src/main/resources/mapper/store/FsStoreProductAttrValueMapper.xml

@@ -23,10 +23,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="brokerageTwo"    column="brokerage_two"    />
         <result property="brokerageThree"    column="brokerage_three"    />
         <result property="integral"    column="integral"    />
+        <result property="usageMethod"    column="usage_method"    />
+        <result property="frequency"    column="frequency"    />
+        <result property="dosage"    column="dosage"    />
     </resultMap>
 
     <sql id="selectFsStoreProductAttrValueVo">
-        select id, product_id, sku, stock, sales, price, image, cost,agent_price, bar_code,group_bar_code, ot_price, weight, volume, brokerage, brokerage_two,brokerage_three, integral from fs_store_product_attr_value
+        select id, product_id, sku, stock, sales, price, image, cost,agent_price, bar_code,group_bar_code, ot_price, weight, volume, brokerage, brokerage_two,brokerage_three, integral,usage_method,frequency,dosage from fs_store_product_attr_value
     </sql>
 
     <select id="selectFsStoreProductAttrValueList" parameterType="FsStoreProductAttrValue" resultMap="FsStoreProductAttrValueResult">
@@ -76,6 +79,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="brokerageTwo != null">brokerage_two,</if>
             <if test="brokerageThree != null">brokerage_three,</if>
             <if test="integral != null">integral,</if>
+            <if test="usageMethod != null">usage_method,</if>
+            <if test="frequency != null">frequency,</if>
+            <if test="dosage != null">dosage,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="productId != null">#{productId},</if>
@@ -95,6 +101,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="brokerageTwo != null">#{brokerageTwo},</if>
             <if test="brokerageThree != null">#{brokerageThree},</if>
             <if test="integral != null">#{integral},</if>
+            <if test="usageMethod != null">#{usageMethod},</if>
+            <if test="frequency != null">#{frequency},</if>
+            <if test="dosage != null">#{dosage},</if>
          </trim>
     </insert>
 
@@ -118,6 +127,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="brokerageTwo != null">brokerage_two = #{brokerageTwo},</if>
             <if test="brokerageThree != null">brokerage_three = #{brokerageThree},</if>
             <if test="integral != null">integral = #{integral},</if>
+            <if test="usageMethod != null">usage_method = #{usageMethod},</if>
+            <if test="frequency != null">frequency = #{frequency},</if>
+            <if test="dosage != null">dosage = #{dosage},</if>
         </trim>
         where id = #{id}
     </update>

+ 1 - 2
fs-service-system/src/main/resources/mapper/store/FsStoreProductMapper.xml

@@ -50,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectFsStoreProductVo">
-        select product_id, image, slider_image, product_name, product_info, keyword, bar_code, cate_id, price, vip_price, ot_price, postage, unit_name, sort, sales, stock, is_show, is_hot, is_benefit, is_best, is_new, description, create_time, update_time, is_postage, is_del, give_integral, cost, is_good, browse, code_path, temp_id, spec_type, is_integral, integral, product_type, prescribe_code, prescribe_spec, prescribe_factory, prescribe_name,is_display,tui_cate_id,warehouse_id,warehouse_code from fs_store_product
+        select product_id, image, slider_image, product_name, product_info, keyword, bar_code, cate_id, price, vip_price, ot_price, postage, unit_name, sort, sales, stock, is_show, is_hot, is_benefit, is_best, is_new, description, create_time, update_time, is_postage, is_del, give_integral, cost, is_good, browse, code_path, temp_id, spec_type, is_integral, integral, product_type, prescribe_code, prescribe_spec, prescribe_factory, prescribe_name,is_display,tui_cate_id,warehouse_id,warehouse_code,usage_method,frequency,dosage from fs_store_product
     </sql>
 
     <select id="selectFsStoreProductList" parameterType="FsStoreProduct" resultMap="FsStoreProductResult">
@@ -243,7 +243,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isDisplay != null">is_display = #{isDisplay},</if>
             <if test="tuiCateId != null">tui_cate_id = #{tuiCateId},</if>
             <if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
-            <if test="warehouseCode != null">warehouse_code = #{warehouseCode},</if>
         </trim>
         where product_id = #{productId}
     </update>

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

@@ -41,10 +41,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="registerCode"    column="register_code"    />
         <result property="source"    column="source"    />
         <result property="userCode"    column="user_code"    />
+        <result property="remainingClaimLimit"    column="remaining_claim_limit"    />
     </resultMap>
 
     <sql id="selectFsUserVo">
-        select user_id, username, password, real_name, birthday, id_card, remark, nickname, avatar, phone, create_time, update_time, last_ip, now_money, brokerage_price, integral, sign_num, status, level, spread_user_id, spread_time, user_type, is_promoter, pay_count, spread_count, addres,ma_open_id,mp_open_id,union_id, is_del,is_weixin_auth,company_id,company_user_id,register_date,register_code,source,user_code from fs_user
+        select user_id, username, password, real_name, birthday, id_card, remark, nickname, avatar, phone, create_time, update_time, last_ip, now_money, brokerage_price, integral, sign_num, status, level, spread_user_id, spread_time, user_type, is_promoter, pay_count, spread_count, addres,ma_open_id,mp_open_id,union_id, is_del,is_weixin_auth,company_id,company_user_id,register_date,register_code,source,user_code,remaining_claim_limit from fs_user
     </sql>
 
     <select id="selectFsUserList" parameterType="FsUser" resultMap="FsUserResult">
@@ -148,6 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="registerCode != null">register_code,</if>
             <if test="source != null">source,</if>
             <if test="userCode != null">user_code,</if>
+            <if test="remainingClaimLimit != null">remaining_claim_limit,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="username != null">#{username},</if>
@@ -186,6 +188,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="registerCode != null">#{registerCode},</if>
             <if test="source != null">#{source},</if>
             <if test="userCode != null">#{userCode},</if>
+            <if test="remainingClaimLimit != null">#{remainingClaimLimit},</if>
          </trim>
     </insert>
 
@@ -228,6 +231,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="registerCode != null">register_code = #{registerCode},</if>
             <if test="source != null">source = #{source},</if>
             <if test="userCode != null">user_code = #{userCode},</if>
+            <if test="remainingClaimLimit != null">remaining_claim_limit = #{remainingClaimLimit},</if>
         </trim>
         where user_id = #{userId}
     </update>

+ 25 - 5
fs-user-app/src/main/java/com/fs/app/controller/PatientController.java

@@ -3,7 +3,10 @@ package com.fs.app.controller;
 
 import cn.hutool.core.bean.BeanUtil;
 import com.fs.app.annotation.Login;
+import com.fs.app.exception.FSException;
 import com.fs.common.core.domain.R;
+import com.fs.common.dto.PersonIdentityDTO;
+import com.fs.common.utils.ParseUtils;
 import com.fs.store.domain.FsPatient;
 import com.fs.store.param.FsPatientAddEditParam;
 import com.fs.store.service.IFsPatientService;
@@ -14,6 +17,8 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.validation.Valid;
+import java.text.ParseException;
+import java.util.Date;
 import java.util.List;
 
 
@@ -55,15 +60,21 @@ public class PatientController extends  AppBaseController {
     @Login
     @ApiOperation("添加病人")
     @PostMapping("/addPatient")
-    public R addPatient(@Valid @RequestBody FsPatientAddEditParam param){
-        if(param.getBirthday()==null){
-            return R.error("生日不能为空");
-        }
+    public R addPatient(@Valid @RequestBody FsPatientAddEditParam param) throws ParseException {
+        // 身份证二要素验证
+        PersonIdentityDTO dto = ParseUtils.validateIdCard(param.getPatientName(), param.getIdCard());
+
         param.setUserId(Long.parseLong(getUserId()));
         FsPatient patient=new FsPatient();
         BeanUtil.copyProperties(param, patient);
+        if(dto == null) {
+            throw new FSException("身份证二要素验证失败!");
+        }
+        patient.setBirthday(dto.getBirthdayDate());
         patient.setIsDel(0);
         patient.setStatus(1);
+        patient.setCreateTime(new Date());
+        patient.setUpdateTime(new Date());
         patientService.insertFsPatient(patient);
         return R.ok("操作成功");
     }
@@ -71,9 +82,18 @@ public class PatientController extends  AppBaseController {
     @Login
     @ApiOperation("编辑病人")
     @PostMapping("/editPatient")
-    public R editPatient(@Valid @RequestBody FsPatientAddEditParam param){
+    public R editPatient(@Valid @RequestBody FsPatientAddEditParam param) throws ParseException {
+        // 身份证二要素验证
+        PersonIdentityDTO dto = ParseUtils.validateIdCard(param.getPatientName(), param.getIdCard());
+
         FsPatient patient=new FsPatient();
         BeanUtil.copyProperties(param, patient);
+
+        if(dto == null) {
+            throw new FSException("身份证二要素验证失败!");
+        }
+        patient.setBirthday(dto.getBirthdayDate());
+
         patientService.updateFsPatient(patient);
         return R.ok("操作成功");
     }

+ 2 - 0
fs-user-app/src/main/java/com/fs/app/controller/WxUserController.java

@@ -58,6 +58,7 @@ public class WxUserController extends AppBaseController{
             return R.error("code不存在");
         }
         final WxMaService wxService = WxMaConfiguration.getMaService(maProperties.getConfigs().get(0).getAppid());
+
         try {
             WxMaJscode2SessionResult session = wxService.getUserService().getSessionInfo(param.getCode());
             this.logger.info(session.getSessionKey());
@@ -77,6 +78,7 @@ public class WxUserController extends AppBaseController{
                         userMap.setUserId(checkPhone.getUserId());
                         userMap.setUpdateTime(new DateTime());
                         userMap.setLastIp(ip);
+                        userMap.setPhone(phoneNoInfo.getPhoneNumber());
                         userService.updateFsUser(userMap);
                     }
                     else{

+ 11 - 0
fs-user-app/src/main/java/com/fs/app/exception/FSExceptionHandler.java

@@ -37,6 +37,17 @@ public class FSExceptionHandler {
 
 		return r;
 	}
+	/**
+	 * 处理自定义异常
+	 */
+	@ExceptionHandler(RuntimeException.class)
+	public R handleRuntimeException(RuntimeException e){
+		R r = new R();
+		r.put("code", 500);
+		r.put("msg", e.getMessage());
+
+		return r;
+	}
 
 	@ExceptionHandler(NoHandlerFoundException.class)
 	public R handlerNoFoundException(Exception e) {

+ 43 - 0
fs-user-app/src/main/java/com/fs/core/config/LogInterceptor.java

@@ -0,0 +1,43 @@
+package com.fs.core.config;
+
+
+
+import org.slf4j.MDC;
+import org.springframework.stereotype.Component;
+import org.springframework.util.StringUtils;
+import org.springframework.web.servlet.HandlerInterceptor;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.UUID;
+
+
+/**
+ * @description: 日志拦截器
+ * @author: xdd
+ * @date: 2025/3/13
+ */
+@Component
+public class LogInterceptor implements HandlerInterceptor {
+
+    private static final String traceId = "traceId";
+
+    @Override
+    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
+        String tid = UUID.randomUUID().toString().replace("-", "");
+        //可以考虑让客户端传入链路ID,但需保证一定的复杂度唯一性;如果没使用默认UUID自动生成
+        if (!StringUtils.isEmpty(request.getHeader("traceId"))) {
+            tid = request.getHeader("traceId");
+        }
+        MDC.put(traceId, tid);
+        return true;
+    }
+
+    @Override
+    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler,
+                                Exception ex) {
+        // 请求处理完成后,清除MDC中的traceId,以免造成内存泄漏
+        MDC.remove(traceId);
+    }
+
+}

+ 35 - 0
fs-user-app/src/main/java/com/fs/core/config/MyThreadPoolTaskExecutor.java

@@ -0,0 +1,35 @@
+package com.fs.core.config;
+
+import com.fs.core.util.ThreadMdcUtil;
+import org.slf4j.MDC;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+
+import java.util.concurrent.Callable;
+import java.util.concurrent.Future;
+
+/**
+ * @description:
+ * @author: xdd
+ * @date: 2025/3/13
+ */
+public final class MyThreadPoolTaskExecutor extends ThreadPoolTaskExecutor {
+    public MyThreadPoolTaskExecutor() {
+        super();
+    }
+
+    @Override
+    public void execute(Runnable task) {
+        super.execute(ThreadMdcUtil.wrap(task, MDC.getCopyOfContextMap()));
+    }
+
+
+    @Override
+    public <T> Future<T> submit(Callable<T> task) {
+        return super.submit(ThreadMdcUtil.wrap(task, MDC.getCopyOfContextMap()));
+    }
+
+    @Override
+    public Future<?> submit(Runnable task) {
+        return super.submit(ThreadMdcUtil.wrap(task, MDC.getCopyOfContextMap()));
+    }
+}

+ 7 - 2
fs-user-app/src/main/java/com/fs/core/config/ResourcesConfig.java

@@ -15,7 +15,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
 /**
  * 通用配置
- * 
+ *
 
  */
 @Configuration
@@ -24,6 +24,9 @@ public class ResourcesConfig implements WebMvcConfigurer
     @Autowired
     private RepeatSubmitInterceptor repeatSubmitInterceptor;
 
+    @Autowired
+    private LogInterceptor logInterceptor;
+
     @Override
     public void addResourceHandlers(ResourceHandlerRegistry registry)
     {
@@ -42,6 +45,8 @@ public class ResourcesConfig implements WebMvcConfigurer
     public void addInterceptors(InterceptorRegistry registry)
     {
         registry.addInterceptor(repeatSubmitInterceptor).addPathPatterns("/**");
+        registry.addInterceptor(logInterceptor)
+                .addPathPatterns("/**");
     }
 
     /**
@@ -63,4 +68,4 @@ public class ResourcesConfig implements WebMvcConfigurer
         source.registerCorsConfiguration("/**", config);
         return new CorsFilter(source);
     }
-}
+}

+ 2 - 2
fs-user-app/src/main/java/com/fs/core/config/ThreadPoolConfig.java

@@ -13,7 +13,7 @@ import java.util.concurrent.ThreadPoolExecutor;
 /**
  * 线程池配置
  *
- 
+
  **/
 @Configuration
 public class ThreadPoolConfig
@@ -33,7 +33,7 @@ public class ThreadPoolConfig
     @Bean(name = "threadPoolTaskExecutor")
     public ThreadPoolTaskExecutor threadPoolTaskExecutor()
     {
-        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
+        ThreadPoolTaskExecutor executor = new MyThreadPoolTaskExecutor();
         executor.setMaxPoolSize(maxPoolSize);
         executor.setCorePoolSize(corePoolSize);
         executor.setQueueCapacity(queueCapacity);

+ 79 - 0
fs-user-app/src/main/java/com/fs/core/util/ThreadMdcUtil.java

@@ -0,0 +1,79 @@
+package com.fs.core.util;
+
+/**
+ * @description:
+ * @author: xdd
+ * @date: 2025/3/13
+ * @Description:
+ */
+
+import org.slf4j.MDC;
+
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.Callable;
+
+/**
+ * @Description:
+ */
+public final class ThreadMdcUtil {
+    private static final String traceId = "traceId";
+
+    // 获取唯一性标识
+    public static String generateTraceId() {
+        return UUID.randomUUID().toString().replace("-", "");
+    }
+
+    public static void setTraceIdIfAbsent() {
+        if (MDC.get(traceId) == null) {
+            MDC.put(traceId, generateTraceId());
+        }
+    }
+
+    /**
+     * 用于父线程向线程池中提交任务时,将自身MDC中的数据复制给子线程
+     *
+     * @param callable
+     * @param context
+     * @param <T>
+     * @return
+     */
+    public static<T> Callable<T> wrap(final Callable<T> callable, final Map<String, String> context) {
+        return () -> {
+            if (context == null) {
+                MDC.clear();
+            } else {
+                MDC.setContextMap(context);
+            }
+            setTraceIdIfAbsent();
+            try {
+                return callable.call();
+            } finally {
+                MDC.clear();
+            }
+        };
+    }
+
+    /**
+     * 用于父线程向线程池中提交任务时,将自身MDC中的数据复制给子线程
+     *
+     * @param runnable
+     * @param context
+     * @return
+     */
+    public static Runnable wrap(final Runnable runnable, final Map<String, String> context) {
+        return () -> {
+            if (context == null) {
+                MDC.clear();
+            } else {
+                MDC.setContextMap(context);
+            }
+            setTraceIdIfAbsent();
+            try {
+                runnable.run();
+            } finally {
+                MDC.clear();
+            }
+        };
+    }
+}

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

@@ -27,9 +27,9 @@ spring:
         druid:
             # 主库数据源
             master:
-                url: jdbc:mysql://172.16.0.31:3306/fs_fhjx_hospital?allowMultiQueries=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+              url: jdbc:mysql://gz-cdb-of55khc9.sql.tencentcdb.com:23620/fs_ffy_hospital?allowMultiQueries=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                 username: root
-                password: Ylrz_1q2w3e4r5t6y
+                password: Rtyy_2023
             # 从库数据源
             slave:
                 # 从数据源开关/默认关闭

+ 1 - 0
fs-user-app/src/main/resources/static/nDOivNIU3j.txt

@@ -0,0 +1 @@
+0cd8b9a715fcf7f5bd3bdd6e6226802d