Browse Source

Merge remote-tracking branch 'origin/ScrmStores'

# Conflicts:
#	fs-service/src/main/java/com/fs/hisStore/domain/FsStoreOrderScrm.java
#	fs-service/src/main/java/com/fs/hisStore/mapper/FsStorePaymentScrmMapper.java
#	fs-service/src/main/java/com/fs/hisStore/service/IFsStoreOrderScrmService.java
#	fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderScrmServiceImpl.java
yfh 2 weeks ago
parent
commit
b0a02fad46
100 changed files with 9804 additions and 1318 deletions
  1. 7 4
      fs-admin/src/main/java/com/fs/hisStore/FsStoreProductScrmController.java
  2. 134 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreScrmController.java
  3. 50 0
      fs-admin/src/main/java/com/fs/hisStore/SysOperlogScrmController.java
  4. 17 2
      fs-common/src/main/java/com/fs/common/annotation/Log.java
  5. 69 9
      fs-framework/src/main/java/com/fs/framework/aspectj/LogAspect.java
  6. 26 3
      fs-framework/src/main/java/com/fs/framework/manager/factory/AsyncFactory.java
  7. 6 0
      fs-service/src/main/java/com/fs/company/service/ICompanyService.java
  8. 76 0
      fs-service/src/main/java/com/fs/company/service/impl/CompanyServiceImpl.java
  9. 5 0
      fs-service/src/main/java/com/fs/his/service/IFsUserWatchService.java
  10. 62 2
      fs-service/src/main/java/com/fs/his/service/impl/FsUserWatchServiceImpl.java
  11. 9 48
      fs-service/src/main/java/com/fs/hisStore/domain/FsMaterialGroupScrm.java
  12. 9 79
      fs-service/src/main/java/com/fs/hisStore/domain/FsMaterialScrm.java
  13. 158 0
      fs-service/src/main/java/com/fs/hisStore/domain/FsPackageOrderScrm.java
  14. 109 0
      fs-service/src/main/java/com/fs/hisStore/domain/FsPackageScrm.java
  15. 42 149
      fs-service/src/main/java/com/fs/hisStore/domain/FsPrescribeDrugScrm.java
  16. 76 304
      fs-service/src/main/java/com/fs/hisStore/domain/FsPrescribeScrm.java
  17. 133 0
      fs-service/src/main/java/com/fs/hisStore/domain/FsStoreAfterSalesLogsScrm.java
  18. 23 219
      fs-service/src/main/java/com/fs/hisStore/domain/FsStoreAfterSalesScrm.java
  19. 125 0
      fs-service/src/main/java/com/fs/hisStore/domain/FsStoreBillScrm.java
  20. 83 0
      fs-service/src/main/java/com/fs/hisStore/domain/FsStoreExtractScrm.java
  21. 156 0
      fs-service/src/main/java/com/fs/hisStore/domain/FsStoreOrderBillLogScrm.java
  22. 16 82
      fs-service/src/main/java/com/fs/hisStore/domain/FsStoreOrderItemScrm.java
  23. 47 0
      fs-service/src/main/java/com/fs/hisStore/domain/FsStoreOrderLogsScrm.java
  24. 82 5
      fs-service/src/main/java/com/fs/hisStore/domain/FsStoreOrderScrm.java
  25. 15 190
      fs-service/src/main/java/com/fs/hisStore/domain/FsStorePaymentScrm.java
  26. 9 185
      fs-service/src/main/java/com/fs/hisStore/domain/FsStoreProductAttrValueScrm.java
  27. 55 0
      fs-service/src/main/java/com/fs/hisStore/domain/FsStoreProductScrm.java
  28. 110 0
      fs-service/src/main/java/com/fs/hisStore/domain/FsStoreScrm.java
  29. 87 0
      fs-service/src/main/java/com/fs/hisStore/domain/StoreLoginUserScrm.java
  30. 96 0
      fs-service/src/main/java/com/fs/hisStore/domain/SysOperLogScrm.java
  31. 21 0
      fs-service/src/main/java/com/fs/hisStore/dto/DateComparisonConfigDTO.java
  32. 880 0
      fs-service/src/main/java/com/fs/hisStore/mapper/FsDataScrmMapper.java
  33. 63 0
      fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreAfterSalesLogsScrmMapper.java
  34. 71 0
      fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreAfterSalesScrmMapper.java
  35. 83 0
      fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreBillScrmMapper.java
  36. 89 0
      fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreExtractScrmMapper.java
  37. 62 0
      fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreOrderBillLogScrmMapper.java
  38. 5 0
      fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreOrderItemScrmMapper.java
  39. 62 0
      fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreOrderLogsScrmMapper.java
  40. 152 0
      fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreOrderScrmMapper.java
  41. 3 0
      fs-service/src/main/java/com/fs/hisStore/mapper/FsStorePaymentScrmMapper.java
  42. 8 0
      fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreProductAttrValueScrmMapper.java
  43. 27 0
      fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreProductCategoryScrmMapper.java
  44. 70 0
      fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreProductScrmMapper.java
  45. 73 0
      fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreScrmMapper.java
  46. 49 0
      fs-service/src/main/java/com/fs/hisStore/mapper/SysOperLogScrmMapper.java
  47. 128 2
      fs-service/src/main/java/com/fs/hisStore/param/FsPrescribeParam.java
  48. 2 0
      fs-service/src/main/java/com/fs/hisStore/param/FsStoreOrderParam.java
  49. 2 0
      fs-service/src/main/java/com/fs/hisStore/param/FsStoreProductAddEditParam.java
  50. 68 0
      fs-service/src/main/java/com/fs/hisStore/param/PrescribeXyImgParam.java
  51. 84 0
      fs-service/src/main/java/com/fs/hisStore/param/PrescribeZyImgParam.java
  52. 41 0
      fs-service/src/main/java/com/fs/hisStore/service/IFsDataScrmService.java
  53. 63 0
      fs-service/src/main/java/com/fs/hisStore/service/IFsMaterialGroupScrmStoreService.java
  54. 62 0
      fs-service/src/main/java/com/fs/hisStore/service/IFsMaterialScrmStoreService.java
  55. 107 0
      fs-service/src/main/java/com/fs/hisStore/service/IFsPrescribeScrmStoreService.java
  56. 22 0
      fs-service/src/main/java/com/fs/hisStore/service/IFsStoreAfterSalesScrmService.java
  57. 68 0
      fs-service/src/main/java/com/fs/hisStore/service/IFsStoreBillScrmService.java
  58. 66 0
      fs-service/src/main/java/com/fs/hisStore/service/IFsStoreExtractScrmService.java
  59. 76 0
      fs-service/src/main/java/com/fs/hisStore/service/IFsStoreOrderBillLogScrmService.java
  60. 4 0
      fs-service/src/main/java/com/fs/hisStore/service/IFsStoreOrderItemScrmService.java
  61. 64 0
      fs-service/src/main/java/com/fs/hisStore/service/IFsStoreOrderLogsScrmService.java
  62. 36 0
      fs-service/src/main/java/com/fs/hisStore/service/IFsStoreOrderScrmService.java
  63. 25 8
      fs-service/src/main/java/com/fs/hisStore/service/IFsStoreProductCategoryScrmService.java
  64. 19 0
      fs-service/src/main/java/com/fs/hisStore/service/IFsStoreProductScrmService.java
  65. 76 0
      fs-service/src/main/java/com/fs/hisStore/service/IFsStoreScrmService.java
  66. 49 0
      fs-service/src/main/java/com/fs/hisStore/service/ISysOperLogScrmService.java
  67. 98 0
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsMaterialGroupScrmStoreServiceImpl.java
  68. 99 0
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsMaterialScrmStoreServiceImpl.java
  69. 2 2
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsPrescribeScrmServiceImpl.java
  70. 957 0
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsPrescribeScrmStoreServiceImpl.java
  71. 450 5
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreAfterSalesScrmServiceImpl.java
  72. 103 0
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreBillScrmServiceImpl.java
  73. 136 0
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreExtractScrmServiceImpl.java
  74. 267 0
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderBillLogScrmServiceImpl.java
  75. 7 0
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderItemScrmServiceImpl.java
  76. 105 0
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderLogsScrmServiceImpl.java
  77. 648 10
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderScrmServiceImpl.java
  78. 81 0
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreProductCategoryScrmServiceImpl.java
  79. 197 1
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreProductScrmServiceImpl.java
  80. 149 0
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreScrmServiceImpl.java
  81. 219 0
      fs-service/src/main/java/com/fs/hisStore/service/impl/IFsDataScrmServiceImpl.java
  82. 77 0
      fs-service/src/main/java/com/fs/hisStore/service/impl/SysOperLogScrmServiceImpl.java
  83. 56 0
      fs-service/src/main/java/com/fs/hisStore/vo/FsStoreProductCategoryVO.java
  84. 51 0
      fs-service/src/main/java/com/fs/hisStore/vo/FsStoreProductCategorysVO.java
  85. 85 2
      fs-service/src/main/java/com/fs/task/MallStoreTask.java
  86. 82 0
      fs-service/src/main/resources/mapper/hisStore/FsStoreAfterSalesLogsScrmMapper.xml
  87. 89 0
      fs-service/src/main/resources/mapper/hisStore/FsStoreBillScrmMapper.xml
  88. 129 0
      fs-service/src/main/resources/mapper/hisStore/FsStoreExtractScrmMapper.xml
  89. 76 0
      fs-service/src/main/resources/mapper/hisStore/FsStoreOrderLogsScrmMapper.xml
  90. 5 0
      fs-service/src/main/resources/mapper/hisStore/FsStoreProductScrmMapper.xml
  91. 170 0
      fs-service/src/main/resources/mapper/hisStore/FsStoreScrmMapper.xml
  92. 79 0
      fs-service/src/main/resources/mapper/hisStore/SysOperLogScrmMapper.xml
  93. 49 6
      fs-store/src/main/java/com/fs/framework/config/SecurityConfig.java
  94. 9 1
      fs-store/src/main/java/com/fs/framework/security/filter/JwtAuthenticationTokenFilter.java
  95. 51 0
      fs-store/src/main/java/com/fs/framework/security/handle/LogoutSuccessScrmHandlerImpl.java
  96. 122 0
      fs-store/src/main/java/com/fs/framework/service/LoginServiceScrm.java
  97. 105 0
      fs-store/src/main/java/com/fs/framework/service/TokenService.java
  98. 233 0
      fs-store/src/main/java/com/fs/framework/service/TokenServiceScrm.java
  99. 61 0
      fs-store/src/main/java/com/fs/framework/service/UserDetailsScrmServiceImpl.java
  100. 85 0
      fs-store/src/main/java/com/fs/hisStore/controller/store/DataScrmController.java

+ 7 - 4
fs-admin/src/main/java/com/fs/hisStore/FsStoreProductScrmController.java

@@ -60,6 +60,7 @@ public class FsStoreProductScrmController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('store:storeProduct:list')")
     @PostMapping("/batchModify")
+    @Log(title = "商品管理", businessType = BusinessType.UPDATE,isStoreLog = true,logParam = {"商品","批量修改商品信息"})
     public R batchModify(@RequestBody ModifyMoreDTO modifyMoreDTO){
         fsStoreProductService.batchModify(modifyMoreDTO);
         return R.ok();
@@ -86,7 +87,7 @@ public class FsStoreProductScrmController extends BaseController
      * 导出商品列表
      */
     @PreAuthorize("@ss.hasPermi('store:storeProduct:export')")
-    @Log(title = "商品", businessType = BusinessType.EXPORT)
+    @Log(title = "商品管理", businessType = BusinessType.EXPORT, isStoreLog = true,logParam = {"商品","导出商品信息"})
     @GetMapping("/export")
     public AjaxResult export(FsStoreProductScrm fsStoreProduct)
     {
@@ -96,7 +97,7 @@ public class FsStoreProductScrmController extends BaseController
     }
 
 
-    @Log(title = "商品导入", businessType = BusinessType.IMPORT)
+    @Log(title = "商品管理", businessType = BusinessType.IMPORT,isStoreLog = true,logParam = {"商品","商品导入"})
     @PreAuthorize("@ss.hasPermi('store:storeProduct:import')")
     @PostMapping("/importData")
     public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
@@ -128,7 +129,8 @@ public class FsStoreProductScrmController extends BaseController
     }
 
     @PreAuthorize("@ss.hasPermi('store:storeProduct:add')")
-    @Log(title = "商品", businessType = BusinessType.INSERT)
+    @Log(title = "商品管理", businessType = BusinessType.INSERT, businessTypeExpression = "#p0.getProductId()>0? T(com.fs.common.enums.BusinessType).UPDATE: T(com.fs.common.enums.BusinessType).INSERT"
+            , isStoreLog = true, logParamExpression = "#p0.getProductId()>0? new String[]{'商品','修改商品'}: new String[]{'商品','新增商品'}")
     @PostMapping(value = "/addOrEdit")
     public R addOrEdit(@RequestBody FsStoreProductAddEditParam fsStoreProduct)
     {
@@ -149,7 +151,8 @@ public class FsStoreProductScrmController extends BaseController
      * 删除商品
      */
     @PreAuthorize("@ss.hasPermi('store:storeProduct:remove')")
-    @Log(title = "商品", businessType = BusinessType.DELETE)
+    @Log(title = "商品管理", businessType = BusinessType.DELETE,isStoreLog = true,
+            logParamExpression ="#p0.length>1?new String[]{'商品','批量删除商品信息'}: new String[]{'商品','删除商品信息'}" )
 	@DeleteMapping("/{productIds}")
     public AjaxResult remove(@PathVariable Long[] productIds)
     {

+ 134 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreScrmController.java

@@ -0,0 +1,134 @@
+package com.fs.hisStore;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.ParseUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.hisStore.domain.FsStoreScrm;
+import com.fs.his.param.FsStoreAuditParam;
+import com.fs.hisStore.service.IFsStoreScrmService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 店铺管理Controller
+ *
+ * @author fs
+ * @date 2023-06-15
+ */
+@RestController
+@RequestMapping("/store/his/store")
+public class FsStoreScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreScrmService fsStoreService;
+
+    /**
+     * 查询店铺管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('his:store:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreScrm fsStore)
+    {
+        startPage();
+        List<FsStoreScrm> list = fsStoreService.selectFsStoreList(fsStore);
+        for (FsStoreScrm store : list) {
+            store.setPhone(ParseUtils.parsePhone(store.getPhone()));
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出店铺管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('his:store:export')")
+    @Log(title = "店铺管理", businessType = BusinessType.EXPORT,logParam = {"店铺","导出店铺信息"},isStoreLog = true)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreScrm fsStore)
+    {
+        List<FsStoreScrm> list = fsStoreService.selectFsStoreList(fsStore);
+        for (FsStoreScrm store : list) {
+            store.setPhone(ParseUtils.parsePhone(store.getPhone()));
+        }
+        ExcelUtil<FsStoreScrm> util = new ExcelUtil<FsStoreScrm>(FsStoreScrm.class);
+        return util.exportExcel(list, "店铺管理数据");
+    }
+
+    /**
+     * 获取店铺管理详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('his:store:query')")
+    @GetMapping(value = "/{storeId}")
+    public AjaxResult getInfo(@PathVariable("storeId") Long storeId)
+    {
+        FsStoreScrm fsStore = fsStoreService.selectFsStoreByStoreId(storeId);
+        fsStore.setPhone(ParseUtils.parsePhone(fsStore.getPhone()));
+        return AjaxResult.success(fsStore);
+    }
+
+    /**
+     * 新增店铺管理
+     */
+    @PreAuthorize("@ss.hasPermi('his:store:add')")
+    @Log(title = "店铺管理", businessType = BusinessType.INSERT,logParam = {"店铺","新增店铺信息"},isStoreLog = true)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreScrm fsStore)
+    {
+        return toAjax(fsStoreService.insertFsStore(fsStore));
+    }
+
+    /**
+     * 修改店铺管理
+     */
+    @PreAuthorize("@ss.hasPermi('his:store:edit')")
+    @Log(title = "店铺管理", businessType = BusinessType.UPDATE,logParam = {"店铺","修改店铺信息"},isStoreLog = true)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreScrm fsStore)
+    {
+
+        if (fsStore.getPhone()!=null&&fsStore.getPhone().contains("*")){
+            fsStore.setPhone(null);
+        }
+        return toAjax(fsStoreService.updateFsStore(fsStore));
+    }
+
+    /**
+     * 删除店铺管理
+     */
+    @PreAuthorize("@ss.hasPermi('his:store:remove')")
+    @Log(title = "店铺管理", businessType = BusinessType.DELETE,logParam = {"店铺","删除店铺信息"},isStoreLog = true)
+	@DeleteMapping("/{storeIds}")
+    public AjaxResult remove(@PathVariable Long[] storeIds)
+    {
+        return toAjax(fsStoreService.deleteFsStoreByStoreIds(storeIds));
+    }
+
+    /**
+     * 店铺审核
+     */
+    @PreAuthorize("@ss.hasPermi('his:store:audit')")
+    @Log(title = "店铺审核", businessType = BusinessType.UPDATE,logParam = {"店铺","店铺审核"},isStoreLog = true)
+    @PutMapping("/audit")
+    public AjaxResult audit(@RequestBody FsStoreAuditParam fsStore)
+    {
+        return toAjax(fsStoreService.updateFsStoreAudit(fsStore));
+    }
+
+    /**
+     * 重置店铺密码
+     * */
+    @PreAuthorize("@ss.hasPermi('his:store:refresh')")
+    @Log(title = "店铺管理", businessType = BusinessType.UPDATE,logParam = {"店铺","重置店铺密码"},isStoreLog = true)
+    @PutMapping("/refresh/{storeId}")
+    public AjaxResult refresh(Long storeId)
+    {
+        return toAjax(fsStoreService.refreshFsStore(storeId));
+    }
+
+}

+ 50 - 0
fs-admin/src/main/java/com/fs/hisStore/SysOperlogScrmController.java

@@ -0,0 +1,50 @@
+package com.fs.hisStore;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.hisStore.service.ISysOperLogScrmService;
+import com.fs.hisStore.domain.SysOperLogScrm;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 操作日志记录
+ *
+
+ */
+@RestController
+@RequestMapping("/store/operlogScrm")
+public class SysOperlogScrmController extends BaseController
+{
+    private final ISysOperLogScrmService operLogService;
+
+    public SysOperlogScrmController(ISysOperLogScrmService operLogService) {
+        this.operLogService = operLogService;
+    }
+
+    @PreAuthorize("@ss.hasPermi('his:storeLog:export')")
+    @GetMapping("/list")
+    public TableDataInfo list(SysOperLogScrm operLog)
+    {
+        startPage();
+        List<SysOperLogScrm> list = operLogService.selectOperLogList(operLog);
+        return getDataTable(list);
+    }
+
+    @Log(title = "操作日志", businessType = BusinessType.EXPORT)
+    @PreAuthorize("@ss.hasPermi('his:storeLog:export')")
+    @GetMapping("/export")
+    public AjaxResult export(SysOperLogScrm operLog)
+    {
+        List<SysOperLogScrm> list = operLogService.selectOperLogList(operLog);
+        ExcelUtil<SysOperLogScrm> util = new ExcelUtil<>(SysOperLogScrm.class);
+        return util.exportExcel(list, "操作日志");
+    }
+
+}

+ 17 - 2
fs-common/src/main/java/com/fs/common/annotation/Log.java

@@ -7,10 +7,11 @@ import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 import com.fs.common.enums.BusinessType;
 import com.fs.common.enums.OperatorType;
+import com.fs.common.utils.StringUtils;
 
 /**
  * 自定义操作日志记录注解
- * 
+ *
 
  *
  */
@@ -20,7 +21,7 @@ import com.fs.common.enums.OperatorType;
 public @interface Log
 {
     /**
-     * 模块 
+     * 模块
      */
     public String title() default "";
 
@@ -38,4 +39,18 @@ public @interface Log
      * 是否保存请求的参数
      */
     public boolean isSaveRequestData() default true;
+
+    /**
+     * 是否商城日志
+     */
+    public boolean isStoreLog() default false;
+
+    /**
+     * 商城日志传参
+     * */
+    public String[] logParam() default {};
+
+    String businessTypeExpression() default "";
+
+    String logParamExpression() default "";
 }

+ 69 - 9
fs-framework/src/main/java/com/fs/framework/aspectj/LogAspect.java

@@ -6,15 +6,22 @@ import java.util.Iterator;
 import java.util.Map;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.bean.BeanUtils;
+import com.fs.framework.web.domain.server.Sys;
+import com.fs.hisStore.domain.SysOperLogScrm;
 import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.ProceedingJoinPoint;
 import org.aspectj.lang.Signature;
-import org.aspectj.lang.annotation.AfterReturning;
-import org.aspectj.lang.annotation.AfterThrowing;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.annotation.*;
 import org.aspectj.lang.reflect.MethodSignature;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.expression.EvaluationContext;
+import org.springframework.expression.ExpressionParser;
+import org.springframework.expression.spel.standard.SpelExpressionParser;
+import org.springframework.expression.spel.support.StandardEvaluationContext;
 import org.springframework.stereotype.Component;
 import org.springframework.validation.BindingResult;
 import org.springframework.web.multipart.MultipartFile;
@@ -34,7 +41,7 @@ import com.fs.system.domain.SysOperLog;
 
 /**
  * 操作日志记录处理
- * 
+ *
 
  */
 @Aspect
@@ -62,7 +69,7 @@ public class LogAspect
 
     /**
      * 拦截异常操作
-     * 
+     *
      * @param joinPoint 切点
      * @param e 异常
      */
@@ -116,6 +123,12 @@ public class LogAspect
             getControllerMethodDescription(joinPoint, controllerLog, operLog);
             // 保存数据库
             AsyncManager.me().execute(AsyncFactory.recordOper(operLog));
+            if(controllerLog.isStoreLog()){
+                SysOperLogScrm operLogScrm = new SysOperLogScrm();
+                BeanUtils.copyProperties(operLog, operLogScrm);
+                resolveParam((ProceedingJoinPoint)joinPoint,operLogScrm);
+                AsyncManager.me().execute(AsyncFactory.recordOperScrm(operLogScrm));
+            }
         }
         catch (Exception exp)
         {
@@ -123,12 +136,14 @@ public class LogAspect
             log.error("==前置通知异常==");
             log.error("异常信息:{}", exp.getMessage());
             exp.printStackTrace();
+        } catch (Throwable ex) {
+            throw new RuntimeException(ex);
         }
     }
 
     /**
      * 获取注解中对方法的描述信息 用于Controller层注解
-     * 
+     *
      * @param log 日志
      * @param operLog 操作日志
      * @throws Exception
@@ -151,7 +166,7 @@ public class LogAspect
 
     /**
      * 获取请求的参数,放到log中
-     * 
+     *
      * @param operLog 操作日志
      * @throws Exception 异常
      */
@@ -208,7 +223,7 @@ public class LogAspect
 
     /**
      * 判断是否需要过滤的对象。
-     * 
+     *
      * @param o 对象信息。
      * @return 如果是需要过滤的对象,则返回true;否则返回false。
      */
@@ -240,4 +255,49 @@ public class LogAspect
         return o instanceof MultipartFile || o instanceof HttpServletRequest || o instanceof HttpServletResponse
                 || o instanceof BindingResult;
     }
+
+    private final ExpressionParser parser = new SpelExpressionParser();
+
+    public void resolveParam(ProceedingJoinPoint joinPoint, SysOperLogScrm operLog) throws Throwable {
+        // 1. 获取注解实例
+        Method method = ((MethodSignature) joinPoint.getSignature()).getMethod();
+        Log annotation = method.getAnnotation(Log.class);
+
+        // 2. 准备简单上下文
+        StandardEvaluationContext context = new StandardEvaluationContext();
+        Object[] args = joinPoint.getArgs();
+        String[] paramNames = ((MethodSignature) joinPoint.getSignature()).getParameterNames();
+
+        // 设置参数名称和值到上下文
+        for (int i = 0; i < args.length; i++) {
+            context.setVariable("p" + i, args[i]); // 支持 #p0,#p1...
+            if (paramNames != null && i < paramNames.length) {
+                context.setVariable(paramNames[i], args[i]); // 支持参数名引用
+            }
+        }
+
+        // 3. 处理动态 businessType
+        BusinessType businessType = annotation.businessType();
+        if (!annotation.businessTypeExpression().isEmpty()) {
+            try {
+                businessType = parser.parseExpression(annotation.businessTypeExpression())
+                        .getValue(context, BusinessType.class);
+            } catch (Exception e) {
+                log.warn("解析 businessType 表达式失败,使用默认值: {}", e.getMessage());
+            }
+        }
+        // 4. 处理动态 logParam
+        String[] logParam = annotation.logParam();
+        if (!annotation.logParamExpression().isEmpty()) {
+            try {
+                logParam = parser.parseExpression(annotation.logParamExpression())
+                        .getValue(context, String[].class);
+            }catch (Exception e){
+                log.warn("解析 logParam 表达式失败,使用默认值: {}", e.getMessage());
+            }
+        }
+        operLog.setBusinessType(businessType.ordinal());
+        operLog.setMainType(logParam[0]);
+        operLog.setDes(logParam[1]);
+    }
 }

+ 26 - 3
fs-framework/src/main/java/com/fs/framework/manager/factory/AsyncFactory.java

@@ -1,6 +1,9 @@
 package com.fs.framework.manager.factory;
 
 import java.util.TimerTask;
+
+import com.fs.hisStore.domain.SysOperLogScrm;
+import com.fs.hisStore.service.ISysOperLogScrmService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import com.fs.common.constant.Constants;
@@ -18,7 +21,7 @@ import eu.bitwalker.useragentutils.UserAgent;
 
 /**
  * 异步工厂(产生任务用)
- * 
+ *
 
  */
 public class AsyncFactory
@@ -27,7 +30,7 @@ public class AsyncFactory
 
     /**
      * 记录登录信息
-     * 
+     *
      * @param username 用户名
      * @param status 状态
      * @param message 消息
@@ -82,7 +85,7 @@ public class AsyncFactory
 
     /**
      * 操作日志记录
-     * 
+     *
      * @param operLog 操作日志信息
      * @return 任务task
      */
@@ -99,4 +102,24 @@ public class AsyncFactory
             }
         };
     }
+
+    /**
+     * 操作日志记录
+     *
+     * @param operLog 操作日志信息
+     * @return 任务task
+     */
+    public static TimerTask recordOperScrm(final SysOperLogScrm operLog)
+    {
+        return new TimerTask()
+        {
+            @Override
+            public void run()
+            {
+                // 远程查询操作地点
+                operLog.setOperLocation(AddressUtils.getRealAddressByIP(operLog.getOperIp()));
+                SpringUtils.getBean(ISysOperLogScrmService.class).insertOperlog(operLog);
+            }
+        };
+    }
 }

+ 6 - 0
fs-service/src/main/java/com/fs/company/service/ICompanyService.java

@@ -124,9 +124,15 @@ public interface ICompanyService
 
     void subtractCompanyMoney(FsStoreOrder order);
 
+    @Transactional
+    void subtractCompanyMoneyScrm(FsStoreOrderScrm order);
+
     void inquirySubtractCompanyMoney(FsInquiryOrder order);
     void refundCompanyMoney(FsStoreOrder order);
 
+    @Transactional
+    void refundCompanyMoneyScrm(FsStoreOrderScrm order);
+
     Company selectCompanyByIdForUpdate(Long companyId);
 
     public void subtractCompanyMoney(BigDecimal money, Long companyId);

+ 76 - 0
fs-service/src/main/java/com/fs/company/service/impl/CompanyServiceImpl.java

@@ -681,6 +681,36 @@ public class CompanyServiceImpl implements ICompanyService
         }
     }
 
+    @Override
+    @Transactional
+    public void subtractCompanyMoneyScrm(FsStoreOrderScrm order) {
+
+        if(order.getCompanyId()!=null&&order.getCompanyId()>0){
+            Company company=companyMapper.selectCompanyByIdForUpdate(order.getCompanyId());
+            if(company!=null){
+                SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("his.store");
+                StoreConfig fsPayConfig = new Gson().fromJson(sysConfig.getConfigValue(), StoreConfig.class);
+                Integer DeductMoneyRate = fsPayConfig.getDeductMoneyRate();
+                BigDecimal money = BigDecimal.ZERO;
+                if (DeductMoneyRate != null && DeductMoneyRate > 0) {
+                    money = order.getPrescribePrice().multiply(new BigDecimal(DeductMoneyRate).multiply(new BigDecimal("0.01")));
+                }
+                logger.info("扣除成本:"+order.getOrderCode()+":"+money);
+                company.setMoney(company.getMoney().subtract(money));
+                companyMapper.updateCompany(company);
+                CompanyMoneyLogs log=new CompanyMoneyLogs();
+                log.setCompanyId(company.getCompanyId());
+                log.setRemark("发货扣除成本");
+                log.setMoney(money.multiply(new BigDecimal(-1)));
+                log.setLogsType(5);
+                log.setBalance(company.getMoney());
+                log.setCreateTime(new Date());
+                log.setBusinessId(order.getId().toString());
+                moneyLogsMapper.insertCompanyMoneyLogs(log);
+            }
+        }
+    }
+
     @Override
     @Transactional
     public void inquirySubtractCompanyMoney(FsInquiryOrder order) {
@@ -1207,6 +1237,52 @@ public class CompanyServiceImpl implements ICompanyService
         }
     }
 
+    @Override
+    @Transactional
+    public void refundCompanyMoneyScrm(FsStoreOrderScrm order) {
+        if(order.getCompanyId()!=null&&order.getCompanyId()>0){
+            Company company=companyMapper.selectCompanyByIdForUpdate(order.getCompanyId());
+            if(company!=null){
+                List<CompanyMoneyLogs> companyMoneyLogs = moneyLogsMapper.selectCompanyMoneyByOrderId(order.getId());
+                for (CompanyMoneyLogs logs : companyMoneyLogs) {
+                    if (logs.getLogsType()==3){
+                        if (order.getTuiMoneyStatus()!=null&&order.getTuiMoneyStatus()==0){
+                            continue;
+                        }
+                        BigDecimal money = logs.getMoney().multiply(new BigDecimal(-1));
+                        logger.info("退款佣金扣除:"+company.getCompanyId()+":"+money);
+                        company.setMoney(company.getMoney().subtract(logs.getMoney()));
+                        companyMapper.updateCompany(company);
+                        CompanyMoneyLogs log=new CompanyMoneyLogs();
+                        log.setCompanyId(company.getCompanyId());
+                        log.setRemark("退款佣金扣除");
+                        log.setMoney(money);
+                        log.setLogsType(4);
+                        log.setBalance(company.getMoney());
+                        log.setCreateTime(new Date());
+                        log.setBusinessId(order.getId().toString());
+                        moneyLogsMapper.insertCompanyMoneyLogs(log);
+                    }else if(logs.getLogsType()==5){
+                        BigDecimal money = logs.getMoney().multiply(new BigDecimal(-1));
+                        logger.info("退款成本返还:"+company.getCompanyId()+":"+money);
+                        company.setMoney(company.getMoney().add(money));
+                        companyMapper.updateCompany(company);
+                        CompanyMoneyLogs log=new CompanyMoneyLogs();
+                        log.setCompanyId(company.getCompanyId());
+                        log.setRemark("退款成本返还");
+                        log.setMoney(money);
+                        log.setLogsType(6);
+                        log.setBalance(company.getMoney());
+                        log.setCreateTime(new Date());
+                        log.setBusinessId(order.getId().toString());
+                        moneyLogsMapper.insertCompanyMoneyLogs(log);
+                    }
+                }
+
+            }
+        }
+    }
+
     @Override
     public Company selectCompanyByIdForUpdate(Long companyId) {
         return companyMapper.selectCompanyByIdForUpdate(companyId);

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

@@ -4,6 +4,8 @@ import java.util.List;
 
 import com.fs.his.domain.FsStoreOrder;
 import com.fs.his.domain.FsUserWatch;
+import com.fs.hisStore.domain.FsStoreOrderScrm;
+import org.springframework.scheduling.annotation.Async;
 
 /**
  * 用户腕Service接口
@@ -65,6 +67,9 @@ public interface IFsUserWatchService
 
     void addUserWatch(FsStoreOrder order);
 
+    @Async
+    void addUserWatchScrm(FsStoreOrderScrm order);
+
     /**
      * 根据userId查询最新得一条记录
      * @param userId 用户id

+ 62 - 2
fs-service/src/main/java/com/fs/his/service/impl/FsUserWatchServiceImpl.java

@@ -13,14 +13,13 @@ import com.fs.his.domain.FsStoreOrder;
 import com.fs.his.domain.FsStoreOrderItem;
 import com.fs.his.dto.FsPackagePruductDTO;
 import com.fs.his.dto.FsStoreOrderItemDTO;
-import com.fs.his.mapper.FsStoreMapper;
 import com.fs.his.mapper.FsStoreOrderItemMapper;
 import com.fs.his.service.IFsPackageOrderService;
+import com.fs.hisStore.domain.FsStoreOrderScrm;
 import com.fs.watch.domain.WatchFsUser;
 import com.fs.watch.domain.WatchMedicationTask;
 import com.fs.watch.service.WatchMedicationTaskService;
 import com.fs.watch.service.WatchUserService;
-import com.fs.wx.utils.JsonUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.scheduling.annotation.Async;
@@ -184,6 +183,67 @@ public class FsUserWatchServiceImpl implements IFsUserWatchService
         }
     }
 
+    @Async
+    @Override
+    public void addUserWatchScrm(FsStoreOrderScrm order) {
+
+        List<FsStoreOrderItem> fsStoreOrderItems = fsStoreOrderItemMapper.selectFsStoreOrderItemListByOrderId(order.getId());
+        for (FsStoreOrderItem fsStoreOrderItem : fsStoreOrderItems) {
+            String jsonInfo = fsStoreOrderItem.getJsonInfo();
+            FsStoreOrderItemDTO fsStoreOrderItemDTO = JSON.parseObject(jsonInfo, FsStoreOrderItemDTO.class);
+            //腕表条码
+            if ("1014704".equals(fsStoreOrderItemDTO.getBarCode())){
+                FsUserWatch fsUserWatch = new FsUserWatch();
+                fsUserWatch.setUserId(order.getUserId());
+                fsUserWatch.setCompanyId(order.getCompanyId());
+                fsUserWatch.setCompanyUserId(order.getCompanyUserId());
+                fsUserWatch.setDoctorId(order.getDoctorId());
+                fsUserWatch.setStoreOrderId(order.getId());
+                fsUserWatch.setStatus(1);//已发货
+                fsUserWatch.setCreateTime(DateUtils.getNowDate());
+                fsUserWatchMapper.insertFsUserWatch(fsUserWatch);
+            }
+
+            //2.新增用药提醒任务
+            //2.1判断该用户是否已经绑腕表
+            WatchFsUser watchFsUser = watchUserService.selectWatchFsUserById(order.getUserId());
+            if (watchFsUser !=null && StringUtils.isNotBlank(watchFsUser.getDeviceId())){
+                //已绑定则新增用药提醒任务
+                //2.2判断是否包含套餐 ,只有套餐有用法
+                if (order.getPackageOrderId()!=null) {
+                    //查询是否含有改套餐订单以及套餐信息
+                    FsPackage fsPackage = fsPackageOrderService.selectFsPackageByOrderId(order.getPackageOrderId());
+                    if (fsPackage!=null && StringUtils.isNotBlank(fsPackage.getProductJson())){
+                        List<FsPackagePruductDTO> fsPackageProductDTOS = JSONObject.parseArray(fsPackage.getProductJson(), FsPackagePruductDTO.class);
+                        if (fsPackageProductDTOS!=null && !fsPackageProductDTOS.isEmpty()){
+                            //添加任务
+                            ArrayList<WatchMedicationTask> tasks = new ArrayList<>();
+                            for (FsPackagePruductDTO dto : fsPackageProductDTOS) {
+                                if(dto.getUsageFrequencyUnit()!=null){
+                                    WatchMedicationTask watchMedicationTask = new WatchMedicationTask();
+                                    watchMedicationTask.setPackageOrderId(order.getPackageOrderId());
+                                    watchMedicationTask.setPackageId(fsPackage.getPackageId());
+                                    watchMedicationTask.setProductId(dto.getProductId());
+                                    watchMedicationTask.setProductName(dto.getProductName());
+                                    watchMedicationTask.setUsageFrequencyUnit(dto.getUsageFrequencyUnit());
+                                    //默认提醒三天
+                                    watchMedicationTask.setRequiredNum(dto.getUsageFrequencyUnit()*3);
+                                    watchMedicationTask.setActualNum(0);
+                                    watchMedicationTask.setCreateTime(new Date());
+                                    watchMedicationTask.setUserId(order.getUserId());
+                                    watchMedicationTask.setStatus(0);
+                                    tasks.add(watchMedicationTask);
+                                }
+                            }
+                            watchMedicationTaskService.insertList(tasks);
+                        }
+                    }
+                }
+            }
+
+        }
+    }
+
     /**
      * 根据userId查询最新得一条记录
      * @param userId 用户id

+ 9 - 48
fs-service/src/main/java/com/fs/hisStore/domain/FsMaterialGroupScrm.java

@@ -3,16 +3,20 @@ package com.fs.hisStore.domain;
 import com.baomidou.mybatisplus.annotation.TableName;
 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_material_group
- * 
+ *
  * @author fs
  * @date 2022-03-15
  */
-@TableName("fs_material_group")
+@EqualsAndHashCode(callSuper = true)
+@TableName("fs_material_group_scrm")
+@Data
 public class FsMaterialGroupScrm extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
@@ -32,52 +36,9 @@ public class FsMaterialGroupScrm extends BaseEntity
     @Excel(name = "创建者ID")
     private Integer isDel;
 
-    public void setGroupId(Long groupId) 
-    {
-        this.groupId = groupId;
-    }
+    /** 店铺id */
+    @Excel(name = "店铺id")
+    private Long storeId;
 
-    public Long getGroupId() 
-    {
-        return groupId;
-    }
-    public void setName(String name) 
-    {
-        this.name = name;
-    }
 
-    public String getName() 
-    {
-        return name;
-    }
-    public void setCreateUserId(Long createUserId) 
-    {
-        this.createUserId = createUserId;
-    }
-
-    public Long getCreateUserId() 
-    {
-        return createUserId;
-    }
-    public void setIsDel(Integer isDel) 
-    {
-        this.isDel = isDel;
-    }
-
-    public Integer getIsDel() 
-    {
-        return isDel;
-    }
-
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("groupId", getGroupId())
-            .append("name", getName())
-            .append("createTime", getCreateTime())
-            .append("updateTime", getUpdateTime())
-            .append("createUserId", getCreateUserId())
-            .append("isDel", getIsDel())
-            .toString();
-    }
 }

+ 9 - 79
fs-service/src/main/java/com/fs/hisStore/domain/FsMaterialScrm.java

@@ -3,16 +3,20 @@ package com.fs.hisStore.domain;
 import com.baomidou.mybatisplus.annotation.TableName;
 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_material
- * 
+ *
  * @author fs
  * @date 2022-03-15
  */
-@TableName("fs_material")
+@EqualsAndHashCode(callSuper = true)
+@TableName("fs_material_scrm")
+@Data
 public class FsMaterialScrm extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
@@ -44,82 +48,8 @@ public class FsMaterialScrm extends BaseEntity
     @Excel(name = "创建者ID")
     private Long createUserId;
 
-    public void setMaterialId(Long materialId) 
-    {
-        this.materialId = materialId;
-    }
+    /** 店铺ID */
+    @Excel(name = "店铺ID")
+    private Long storeId;
 
-    public Long getMaterialId() 
-    {
-        return materialId;
-    }
-    public void setType(String type) 
-    {
-        this.type = type;
-    }
-
-    public String getType() 
-    {
-        return type;
-    }
-    public void setGroupId(Long groupId) 
-    {
-        this.groupId = groupId;
-    }
-
-    public Long getGroupId() 
-    {
-        return groupId;
-    }
-    public void setName(String name) 
-    {
-        this.name = name;
-    }
-
-    public String getName() 
-    {
-        return name;
-    }
-    public void setUrl(String url) 
-    {
-        this.url = url;
-    }
-
-    public String getUrl() 
-    {
-        return url;
-    }
-    public void setIsDel(Integer isDel) 
-    {
-        this.isDel = isDel;
-    }
-
-    public Integer getIsDel() 
-    {
-        return isDel;
-    }
-    public void setCreateUserId(Long createUserId) 
-    {
-        this.createUserId = createUserId;
-    }
-
-    public Long getCreateUserId() 
-    {
-        return createUserId;
-    }
-
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
-            .append("materialId", getMaterialId())
-            .append("type", getType())
-            .append("groupId", getGroupId())
-            .append("name", getName())
-            .append("url", getUrl())
-            .append("isDel", getIsDel())
-            .append("createUserId", getCreateUserId())
-            .append("createTime", getCreateTime())
-            .append("updateTime", getUpdateTime())
-            .toString();
-    }
 }

+ 158 - 0
fs-service/src/main/java/com/fs/hisStore/domain/FsPackageOrderScrm.java

@@ -0,0 +1,158 @@
+package com.fs.hisStore.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.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 套餐订单对象 fs_package_order
+ *
+ * @author fs
+ * @date 2023-08-25
+ */
+@Data
+public class FsPackageOrderScrm extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** ID */
+    private Long orderId;
+
+    /** 订单号 */
+    @Excel(name = "订单号")
+    private String orderSn;
+
+    /** 用户ID */
+    @Excel(name = "用户ID")
+    private Long userId;
+
+    /** 医生ID */
+    @Excel(name = "医生ID")
+    private Long doctorId;
+
+    /** 套餐ID */
+    @Excel(name = "套餐ID")
+    private Long packageId;
+
+    /** 套餐名称 */
+    @Excel(name = "套餐名称")
+    private String packageName;
+
+    /** 套餐名称 */
+    @Excel(name = "套餐别名")
+    private String packageSecondName;
+
+    /** 支付金额 */
+    @Excel(name = "支付金额")
+    private BigDecimal payMoney;
+
+    /** 是否支付 */
+    @Excel(name = "是否支付")
+    private Integer isPay;
+
+    /** 天数 */
+    @Excel(name = "天数")
+    private Integer 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;
+
+    @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 Integer payType;
+    @Excel(name = "备注")
+    private String remark;
+    @Excel(name = "店铺id")
+    private Long storeId;
+    @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 BigDecimal productCostPrice;
+    private BigDecimal inquiryCostPrice;
+    private BigDecimal totalCostPrice;
+    private BigDecimal costDiscountMoney;
+    private Integer cycle;
+    private Integer packageSubType;
+    private Long followTempId;
+    private Integer followRate;
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date followTime;
+    private Long followDoctorId;
+    private BigDecimal prescribePrice;
+    private Long deptId;
+    private String doctorRemark;
+
+    private Long userCouponId;
+    private String icdCode;
+    private Integer source;
+}

+ 109 - 0
fs-service/src/main/java/com/fs/hisStore/domain/FsPackageScrm.java

@@ -0,0 +1,109 @@
+package com.fs.hisStore.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.math.BigDecimal;
+
+/**
+ * 套餐包对象 fs_package
+ *
+ * @author fs
+ * @date 2023-08-25
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@TableName("fs_package")
+public class FsPackageScrm extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** ID */
+    private Long packageId;
+    /** 套餐包名称 */
+    @Excel(name = "套餐包名称")
+    private String packageName;
+
+    @Excel(name = "别名")
+    private String secondName;
+
+    /** 排序号 */
+    @Excel(name = "排序号")
+    private Integer sort;
+    /** 价格配置 */
+    @Excel(name = "价格配置")
+    private String productJson;
+    /** 状态 */
+    @Excel(name = "状态")
+    private Integer status;
+    private Integer isDel;
+    @Excel(name = "套餐类型")
+    private Integer packageType; // 套餐类型,1医生包2企业包
+    @Excel(name = "支付方式")
+    private String payType; // 支付方式,1全款支付 2物流代收 3货到付款
+    @Excel(name = "服用方法")
+    private String describeJson; // 描述JSON
+    @Excel(name = "限购次数")
+    private Integer num; // 限购次数
+    @Excel(name = "套餐详情")
+    private String desc; // 套餐详情,放产品详情图片
+    @Excel(name = "是否展示")
+    private Integer isShow; // 是否展示
+    @Excel(name = "子套餐类型")
+    private Integer packageSubType; // 子套餐
+    @Excel(name = "总价")
+    private BigDecimal price; // 总价 xx元/天
+    @Excel(name = "标签")
+    private String tags; // 标签
+    @Excel(name = "销量")
+    private Integer sales; // 销量
+    @Excel(name = "疾病类别")
+    private Integer diseaseType; // 病类别
+    @Excel(name = "商品类别")
+    private Integer productType; //商品类别
+    @Excel(name = "套餐价")
+    private BigDecimal totalPrice;
+    @Excel(name = "周期")
+    private Integer cycle;
+    @Excel(name = "签约时长")
+    private Integer duration;
+    @Excel(name = "封面图")
+    private String imgUrl;
+
+    @Excel(name = "轮播图")
+    private String images;
+
+    @Excel(name = "店铺id")
+    private Long storeId;
+    @Excel(name = "制作类型")
+    private Integer recipeType;
+    @Excel(name = "剂数")
+    private Integer counts;
+    @Excel(name = "每日几次")
+    private String usageFrequencyUnit;
+    @Excel(name = "私域疗法类型")
+    private Integer privateType;
+    @Excel(name = "随访次数")
+    private Integer followNum;
+    @Excel(name = "方解")
+    private String explain;
+    @Excel(name = "功效")
+    private String indication;
+    @Excel(name = "用药数量")
+    private String usagePerUseCount;
+    private BigDecimal productCostPrice;
+    private BigDecimal inquiryCostPrice;
+    private BigDecimal totalCostPrice;
+    @Excel(name = "模板id")
+    private Long followTempId;
+    @Excel(name = "医嘱")
+    private String doctorRemark;
+    private String icdCode;
+    @Excel(name = "描述")
+    private String description;
+    /** 节气 */
+    private Long solarTerm;
+}

+ 42 - 149
fs-service/src/main/java/com/fs/hisStore/domain/FsPrescribeDrugScrm.java

@@ -4,8 +4,10 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.BaseEntity;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.math.BigDecimal;
 
 /**
  * 处方药品对象 fs_prescribe_drug
@@ -13,7 +15,9 @@ import org.apache.commons.lang3.builder.ToStringStyle;
  * @author fs
  * @date 2022-03-15
  */
-@TableName("fs_prescribe_drug")
+@EqualsAndHashCode(callSuper = true)
+@TableName("fs_prescribe_drug_scrm")
+@Data
 public class FsPrescribeDrugScrm extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
@@ -77,150 +81,39 @@ public class FsPrescribeDrugScrm extends BaseEntity
     @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();
-    }
+
+    /** 药品名称 */
+    @Excel(name = "药品名称")
+    private String drugName;
+
+    /** 规格 */
+    @Excel(name = "规格")
+    private String drugSpec;
+
+
+    @Excel(name = "药品单价")
+    private BigDecimal drugPrice;
+
+    /** 药品数量 */
+    @Excel(name = "药品数量")
+    private Long drugNum;
+
+    /** 药品数量单位 */
+    @Excel(name = "药品数量单位")
+    private String drugUnit;
+
+    /** 药品图片 */
+    @Excel(name = "药品图片")
+    private String drugImgUrl;
+
+    private Long productAttrValueId;
+
+    private String remark;
+
+    private Integer drugType;
+
+    private Integer isDrug;
+
+    private String barCode;
+    private String prescribeCode;
 }

+ 76 - 304
fs-service/src/main/java/com/fs/hisStore/domain/FsPrescribeScrm.java

@@ -12,7 +12,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
 
 /**
  * 处方对象 fs_prescribe
- * 
+ *
  * @author fs
  * @date 2022-03-15
  */
@@ -139,307 +139,79 @@ public class FsPrescribeScrm 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();
-    }
+
+    /** 订单ID */
+    @Excel(name = "订单ID")
+    private Long inquiryOrderId;
+
+    /** 店铺订单ID */
+    @Excel(name = "店铺订单ID")
+    private Long storeOrderId;
+
+
+    /** 处⽅单ID(唯⼀ID) */
+    @Excel(name = "处⽅单ID")
+    private String prescribeCode;
+
+    /** 病情描述(主诉) */
+    @Excel(name = "病情描述(主诉)")
+    private String patientDescs;
+
+
+    /** 是否是备孕/怀孕/哺乳期(传值:是 */
+    @Excel(name = "是否是备孕/怀孕/哺乳期")
+    private String isLactation;
+
+
+    /** 处方图片地址 */
+    @Excel(name = "处方图片地址")
+    private String prescribeImgUrl;
+
+
+
+    /** 医生ID */
+    @Excel(name = "药师ID")
+    private Long drugDoctorId;
+
+
+    @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 Integer cycle;
+
+
+
+    private String icdCode;
+
+    public Integer source;
 }

+ 133 - 0
fs-service/src/main/java/com/fs/hisStore/domain/FsStoreAfterSalesLogsScrm.java

@@ -0,0 +1,133 @@
+package com.fs.hisStore.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.Date;
+
+/**
+ * 售后订单操作对象 fs_store_after_sales_logs
+ *
+ * @author fs
+ * @date 2023-06-13
+ */
+public class FsStoreAfterSalesLogsScrm extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long logsId;
+
+    /** 售后id */
+    @Excel(name = "售后id")
+    private Long storeAfterSalesId;
+
+    /** 操作类型 */
+    @Excel(name = "操作类型")
+    private Integer 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;
+
+    private Long companyId;
+
+    private Long storeId;
+
+    public Long getCompanyId() {
+        return companyId;
+    }
+
+    public void setCompanyId(Long companyId) {
+        this.companyId = companyId;
+    }
+
+    public Long getStoreId() {
+        return storeId;
+    }
+
+    public void setStoreId(Long storeId) {
+        this.storeId = storeId;
+    }
+
+    public void setLogsId(Long logsId)
+    {
+        this.logsId = logsId;
+    }
+
+    public Long getLogsId()
+    {
+        return logsId;
+    }
+    public void setStoreAfterSalesId(Long storeAfterSalesId)
+    {
+        this.storeAfterSalesId = storeAfterSalesId;
+    }
+
+    public Long getStoreAfterSalesId()
+    {
+        return storeAfterSalesId;
+    }
+    public void setChangeType(Integer changeType)
+    {
+        this.changeType = changeType;
+    }
+
+    public Integer getChangeType()
+    {
+        return changeType;
+    }
+    public void setChangeMessage(String changeMessage)
+    {
+        this.changeMessage = changeMessage;
+    }
+
+    public String getChangeMessage()
+    {
+        return changeMessage;
+    }
+    public void setChangeTime(Date changeTime)
+    {
+        this.changeTime = changeTime;
+    }
+
+    public Date getChangeTime()
+    {
+        return changeTime;
+    }
+    public void setOperator(String operator)
+    {
+        this.operator = operator;
+    }
+
+    public String getOperator()
+    {
+        return operator;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+            .append("logsId", getLogsId())
+            .append("storeAfterSalesId", getStoreAfterSalesId())
+            .append("changeType", getChangeType())
+            .append("changeMessage", getChangeMessage())
+            .append("changeTime", getChangeTime())
+            .append("operator", getOperator())
+            .append("companyId", getCompanyId())
+            .append("storeId", getStoreId())
+            .toString();
+    }
+}

+ 23 - 219
fs-service/src/main/java/com/fs/hisStore/domain/FsStoreAfterSalesScrm.java

@@ -2,9 +2,12 @@ package com.fs.hisStore.domain;
 
 import java.math.BigDecimal;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
 
 /**
  * 售后记录对象 fs_store_after_sales
@@ -12,6 +15,8 @@ import com.fs.common.core.domain.BaseEntity;
  * @author fs
  * @date 2022-03-15
  */
+@EqualsAndHashCode(callSuper = true)
+@Data
 public class FsStoreAfterSalesScrm extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
@@ -109,231 +114,30 @@ public class FsStoreAfterSalesScrm extends BaseEntity
     @JsonIgnore
     private String endTime;
 
-    @Override
-    public String getBeginTime() {
-        return beginTime;
-    }
+    @TableField(exist = false)
+    private String createTimeRange;
 
-    @Override
-    public void setBeginTime(String beginTime) {
-        this.beginTime = beginTime;
-    }
+    @TableField(exist = false)
+    private String[] createTimeList;
 
-    @Override
-    public String getEndTime() {
-        return endTime;
-    }
-
-    @Override
-    public void setEndTime(String endTime) {
-        this.endTime = endTime;
-    }
+    /** 店铺ID */
+    @Excel(name = "店铺ID")
+    private Long storeId;
 
-    public String getConsigneePhone() {
-        return consigneePhone;
-    }
+    /** 订单ID */
+    @Excel(name = "订单ID")
+    private Long orderId;
 
-    public void setConsigneePhone(String consigneePhone) {
-        this.consigneePhone = consigneePhone;
-    }
-
-    public Integer getDeliveryStatus() {
-        return deliveryStatus;
-    }
-
-    public void setDeliveryStatus(Integer deliveryStatus) {
-        this.deliveryStatus = deliveryStatus;
-    }
-
-    public String getCompanyUserNickName() {
-        return companyUserNickName;
-    }
-
-    public void setCompanyUserNickName(String companyUserNickName) {
-        this.companyUserNickName = companyUserNickName;
-    }
-
-    public Integer getIsPackage() {
-        return isPackage;
-    }
-
-    public void setIsPackage(Integer isPackage) {
-        this.isPackage = isPackage;
-    }
-
-    public String getPackageJson() {
-        return packageJson;
-    }
-
-    public void setPackageJson(String packageJson) {
-        this.packageJson = packageJson;
-    }
-
-    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 static long getSerialVersionUID() {
-        return serialVersionUID;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getOrderCode() {
-        return orderCode;
-    }
-
-    public void setOrderCode(String orderCode) {
-        this.orderCode = orderCode;
-    }
-
-    public BigDecimal getRefundAmount() {
-        return refundAmount;
-    }
-
-    public void setRefundAmount(BigDecimal refundAmount) {
-        this.refundAmount = refundAmount;
-    }
-
-    public Integer getServiceType() {
-        return serviceType;
-    }
-
-    public void setServiceType(Integer serviceType) {
-        this.serviceType = serviceType;
-    }
-
-    public String getReasons() {
-        return reasons;
-    }
-
-    public void setReasons(String reasons) {
-        this.reasons = reasons;
-    }
-
-    public String getExplains() {
-        return explains;
-    }
-
-    public void setExplains(String explains) {
-        this.explains = explains;
-    }
-
-    public String getExplainImg() {
-        return explainImg;
-    }
-
-    public void setExplainImg(String explainImg) {
-        this.explainImg = explainImg;
-    }
-
-    public String getShipperCode() {
-        return shipperCode;
-    }
-
-    public void setShipperCode(String shipperCode) {
-        this.shipperCode = shipperCode;
-    }
-
-    public String getDeliverySn() {
-        return deliverySn;
-    }
-
-    public void setDeliverySn(String deliverySn) {
-        this.deliverySn = deliverySn;
-    }
-
-    public String getDeliveryName() {
-        return deliveryName;
-    }
-
-    public void setDeliveryName(String deliveryName) {
-        this.deliveryName = deliveryName;
-    }
-
-    public Integer getStatus() {
-        return status;
-    }
-
-    public void setStatus(Integer status) {
-        this.status = status;
-    }
-
-    public Integer getSalesStatus() {
-        return salesStatus;
-    }
-
-    public void setSalesStatus(Integer salesStatus) {
-        this.salesStatus = salesStatus;
-    }
-
-    public Integer getOrderStatus() {
-        return orderStatus;
-    }
-
-    public void setOrderStatus(Integer orderStatus) {
-        this.orderStatus = orderStatus;
-    }
-
-    public Integer getIsDel() {
-        return isDel;
-    }
-
-    public void setIsDel(Integer isDel) {
-        this.isDel = isDel;
-    }
-
-    public Long getUserId() {
-        return userId;
-    }
-
-    public void setUserId(Long userId) {
-        this.userId = userId;
-    }
-
-    public String getConsignee() {
-        return consignee;
-    }
-
-    public void setConsignee(String consignee) {
-        this.consignee = consignee;
-    }
-
-    public String getPhoneNumber() {
-        return phoneNumber;
-    }
-
-    public void setPhoneNumber(String phoneNumber) {
-        this.phoneNumber = phoneNumber;
-    }
+    /** 服务类型0仅退款1退货退款 */
+    @Excel(name = "服务类型0仅退款1退货退款")
+    private Integer refundType;
 
-    public String getAddress() {
-        return address;
-    }
+    /** 物流公司编码 */
+    @Excel(name = "物流公司编码")
+    private String deliveryCode;
 
-    public void setAddress(String address) {
-        this.address = address;
-    }
+    private String operator;
 
-    public Long getDeptId() {return deptId;}
+    private String remark;
 
-    public void setDeptId(Long deptId) {this.deptId = deptId;}
 }

+ 125 - 0
fs-service/src/main/java/com/fs/hisStore/domain/FsStoreBillScrm.java

@@ -0,0 +1,125 @@
+package com.fs.hisStore.domain;
+
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.math.BigDecimal;
+
+/**
+ * 店铺帐单记录对象 fs_store_bill
+ *
+ * @author fs
+ * @date 2023-06-25
+ */
+public class FsStoreBillScrm extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** ID */
+    private Long billId;
+
+    /** 店铺ID */
+    @Excel(name = "店铺ID")
+    private Long storeId;
+
+    /** 标题 */
+    @Excel(name = "标题")
+    private String title;
+
+    /** 金额 */
+    @Excel(name = "金额")
+    private BigDecimal money;
+
+    /** 余额 */
+    @Excel(name = "余额")
+    private BigDecimal balance;
+
+    /** 类型 */
+    @Excel(name = "类型")
+    private Integer billType;
+
+    /** 关联ID */
+    @Excel(name = "关联ID")
+    private String businessId;
+
+    public void setBillId(Long billId)
+    {
+        this.billId = billId;
+    }
+
+    public Long getBillId()
+    {
+        return billId;
+    }
+    public void setStoreId(Long storeId)
+    {
+        this.storeId = storeId;
+    }
+
+    public Long getStoreId()
+    {
+        return storeId;
+    }
+    public void setTitle(String title)
+    {
+        this.title = title;
+    }
+
+    public String getTitle()
+    {
+        return title;
+    }
+    public void setMoney(BigDecimal money)
+    {
+        this.money = money;
+    }
+
+    public BigDecimal getMoney()
+    {
+        return money;
+    }
+    public void setBalance(BigDecimal balance)
+    {
+        this.balance = balance;
+    }
+
+    public BigDecimal getBalance()
+    {
+        return balance;
+    }
+    public void setBillType(Integer billType)
+    {
+        this.billType = billType;
+    }
+
+    public Integer getBillType()
+    {
+        return billType;
+    }
+    public void setBusinessId(String businessId)
+    {
+        this.businessId = businessId;
+    }
+
+    public String getBusinessId()
+    {
+        return businessId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+            .append("billId", getBillId())
+            .append("storeId", getStoreId())
+            .append("title", getTitle())
+            .append("money", getMoney())
+            .append("balance", getBalance())
+            .append("billType", getBillType())
+            .append("remark", getRemark())
+            .append("createTime", getCreateTime())
+            .append("businessId", getBusinessId())
+            .toString();
+    }
+}

+ 83 - 0
fs-service/src/main/java/com/fs/hisStore/domain/FsStoreExtractScrm.java

@@ -0,0 +1,83 @@
+package com.fs.hisStore.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.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 店铺提现管理对象 fs_store_extract
+ *
+ * @author fs
+ * @date 2023-06-25
+ */
+@Data
+public class FsStoreExtractScrm extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long extractId;
+
+    /** 店铺ID */
+    @Excel(name = "店铺ID")
+    private Long storeId;
+
+    /** 名称 */
+    @Excel(name = "名称")
+    private String realName;
+
+    /** bank = 银行卡 alipay = 支付宝wx=微信 */
+    @Excel(name = "bank = 银行卡 alipay = 支付宝wx=微信")
+    private String extractType;
+
+    /** 银行卡 */
+    @Excel(name = "银行卡")
+    private String bankCode;
+
+    /** 开户地址 */
+    @Excel(name = "开户地址")
+    private String bankAddress;
+
+    /** 支付宝账号 */
+    @Excel(name = "支付宝账号")
+    private String alipayCode;
+
+    /** 提现金额 */
+    @Excel(name = "提现金额")
+    private BigDecimal extractPrice;
+
+    /** $column.columnComment */
+    @Excel(name = "提现金额")
+    private String mark;
+
+    /** $column.columnComment */
+    @Excel(name = "提现金额")
+    private BigDecimal balance;
+
+    /** 无效原因 */
+    @Excel(name = "无效原因")
+    private String failMsg;
+
+    /** $column.columnComment */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "无效原因", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date failTime;
+
+    /** -1 未通过 0 审核中 1 已提现 */
+    @Excel(name = "-1 未通过 0 审核中 1 已提现")
+    private Long status;
+
+    /** 微信号 */
+    @Excel(name = "微信号")
+    private String wechat;
+
+    /** $column.columnComment */
+    @Excel(name = "微信号")
+    private Integer isDel;
+
+
+}

+ 156 - 0
fs-service/src/main/java/com/fs/hisStore/domain/FsStoreOrderBillLogScrm.java

@@ -0,0 +1,156 @@
+package com.fs.hisStore.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntityTow;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+/**
+ * 订单开票记录对象 fs_store_order_bill_log
+ *
+ * @author fs
+ * @date 2025-01-07
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class FsStoreOrderBillLogScrm extends BaseEntityTow {
+    private static final long serialVersionUID = 1L;
+
+    /** 订单ID */
+    @Excel(name = "订单ID")
+    private Long orderId;
+    @Excel(name = "药品订单号")
+    private String orderCode;
+
+    /** 开票类型0企业1个人 */
+    @Excel(name = "开票类型", readConverterExp = "0=企业,1=个人")
+    private Integer billType;
+
+    /** 开票订单号 */
+    @Excel(name = "开票订单号")
+    private String orderNo;
+
+    /** 开票流水号 */
+    private String serialNo;
+
+    /** 开票流水号 */
+    private String redNo;
+
+    /** 发票代码 */
+    private String invoiceCode;
+
+    /** 是否上传API,0是1否 */
+    private Integer uploadApi;
+
+    /** 发票号码 */
+    @Excel(name = "发票号码")
+    private String invoiceNo;
+
+    /** 红字确认单编号 */
+    @Excel(name = "红字确认单编号")
+    private String billNo;
+
+    /** 红字确认单uuid */
+    @Excel(name = "红字确认单uuid")
+    private String billUuid;
+
+    /** 冲红订单号 */
+    private String redOrderNo;
+
+    /** 数电票号码 */
+    private String allElectronicInvoiceNumbe;
+
+    /** 发票种类 */
+    @Excel(name = "发票种类")
+    private String invoiceKind;
+
+    /** 开票金额 */
+    @Excel(name = "开票金额")
+    private BigDecimal orderAmount;
+
+    /** 购方名称 */
+    @Excel(name = "购方名称")
+    private String payerName;
+
+    /** 购方税号 */
+    @Excel(name = "购方税号")
+    private String payerTaxNo;
+
+    /** 购方地址 */
+    private String address;
+
+    /** 购方电话 */
+    private String telephone;
+
+    /** 冲红原因 1:销货退回;2:开票有误;3:服务中止;4:发生销售折让 */
+    @Excel(name = "冲红原因", readConverterExp = "1=销货退回,2=开票有误,3=服务中止,4=发生销售折让")
+    private Integer redReason;
+
+    /** 含底图纸票pdf地址 */
+    private String paperPdfUrl;
+
+    /** 冲红时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "冲红时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime redTime;
+
+    /** 开票时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "开票时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime invoiceTime;
+
+    @Excel(name = "发票图片")
+    private String imgUrls;
+    /** 发票图片地址 */
+    private String pictureUrl;
+
+    /** 发票pdf地址 */
+    @Excel(name = "发票pdf")
+    private String pdfUrl;
+
+    /** 失败原因 */
+    @Excel(name = "失败原因")
+    private String failCause;
+
+    /** 发票状态描述 */
+    @Excel(name = "发票状态描述")
+    private String statusMsg;
+
+    /** 开票状态0未开始1冲红中2 :开票完成( 最终状 态),其他状态分别为: 20:开票中; 21:开票成功签章中;22:开票失败;24: 开票成功签章失败;3:发票已作废 31: 发票作废中 备注:22、24状态时,无需再查询,请确认开票失败原因以及签章失败原因; 注:请以该状态码区分发票状态 */
+    @Excel(name = "开票状态", readConverterExp = "2=开票完成,20=开票中,21=开票成功签章中,22=开票失败,24=开票成功签章失败,3=发票已作废,31=发票作废中")
+    private Integer status;
+    /** : 01 无需确认 02 销方录入待购方确认 03 购方录入待销方确认 04 购销双方已确认 05 作废(销方录入购方否认) 06 作废(购方录入销方否认) 07 作废(超72小时未确认) 08 作废(发起方已撤销) 09 作废(确认后撤销) 15 申请中 16 申请失败 */
+    @Excel(name = "红字确认单状态", readConverterExp = "01=冲红")
+    private String redStatus;
+
+
+    private String json;
+
+
+
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @TableField(exist = false)
+    private LocalDate sBillTime;
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @TableField(exist = false)
+    private LocalDate eBillTime;
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @TableField(exist = false)
+    private LocalDate sRedTime;
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @TableField(exist = false)
+    private LocalDate eRedTime;
+    @TableField(exist = false)
+    private Long companyId;
+    @TableField(exist = false)
+    private Long companyUserId;
+
+}

+ 16 - 82
fs-service/src/main/java/com/fs/hisStore/domain/FsStoreOrderItemScrm.java

@@ -2,13 +2,17 @@ package com.fs.hisStore.domain;
 
 import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
 
 /**
  * 订单详情对象 fs_store_order_item
- * 
+ *
  * @author fs
  * @date 2022-03-21
  */
+@EqualsAndHashCode(callSuper = true)
+@Data
 public class FsStoreOrderItemScrm extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
@@ -43,87 +47,17 @@ public class FsStoreOrderItemScrm extends BaseEntity
 
     private Integer isPrescribe;
 
-    public Integer getIsPrescribe() {
-        return isPrescribe;
-    }
-
-    public void setIsPrescribe(Integer isPrescribe) {
-        this.isPrescribe = isPrescribe;
-    }
-
-    public void setItemId(Long itemId)
-    {
-        this.itemId = itemId;
-    }
-
-    public Long getItemId() 
-    {
-        return itemId;
-    }
-    public void setOrderId(Long orderId) 
-    {
-        this.orderId = orderId;
-    }
-
-    public Long getOrderId() 
-    {
-        return orderId;
-    }
-    public void setOrderCode(String orderCode) 
-    {
-        this.orderCode = orderCode;
-    }
-
-    public String getOrderCode() 
-    {
-        return orderCode;
-    }
-    public void setCartId(Long cartId) 
-    {
-        this.cartId = cartId;
-    }
-
-    public Long getCartId() 
-    {
-        return cartId;
-    }
-    public void setProductId(Long productId) 
-    {
-        this.productId = productId;
-    }
-
-    public Long getProductId() 
-    {
-        return productId;
-    }
-
-    public void setJsonInfo(String jsonInfo) 
-    {
-        this.jsonInfo = jsonInfo;
-    }
-
-    public String getJsonInfo() 
-    {
-        return jsonInfo;
-    }
-    public void setNum(Integer num)
-    {
-        this.num = num;
-    }
-
-    public Integer getNum()
-    {
-        return num;
-    }
-    public void setIsAfterSales(Integer isAfterSales) 
-    {
-        this.isAfterSales = isAfterSales;
-    }
-
-    public Integer getIsAfterSales() 
-    {
-        return isAfterSales;
-    }
+    /** 商品规格ID */
+    @Excel(name = "商品规格ID")
+    private Long productAttrValueId;
+
+    /** 店铺ID */
+    @Excel(name = "店铺ID")
+    private Long storeId;
+
+    private Integer isGift;
+
+    private Integer isDrug;
 
 
 }

+ 47 - 0
fs-service/src/main/java/com/fs/hisStore/domain/FsStoreOrderLogsScrm.java

@@ -0,0 +1,47 @@
+package com.fs.hisStore.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 FsStoreOrderLogsScrm 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;
+
+
+
+}

+ 82 - 5
fs-service/src/main/java/com/fs/hisStore/domain/FsStoreOrderScrm.java

@@ -268,10 +268,87 @@ public class FsStoreOrderScrm extends BaseEntity
 
     private Integer orderMedium; //媒体来源
 
-    //------------新增字段---------------
-    private BigDecimal prescribePrice;//处方定价
+
+    @Excel(name = "医生ID")
+    private Long doctorId;
+
+    /** 支付状态 待支付 1已支付 */
+    @Excel(name = "支付状态 待支付 1已支付")
+    private Integer isPay;
+
+    /** 退款图片 */
+    @Excel(name = "退款图片")
+    private String refundImg;
+
+    /** 退款用户说明 */
+    @Excel(name = "退款用户说明")
+    private String refundExplain;
+
+    /** 退款时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "退款时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date refundTime;
+
+    /** 退款金额 */
+    @Excel(name = "退款金额")
+    private BigDecimal refundMoney;
+
+    /** 快递公司编号 */
+    @Excel(name = "快递公司编号")
+    private String deliveryCode;
+
+    /** 成本价 */
+    @Excel(name = "成本价")
+    private BigDecimal costPrice;
+
+    private BigDecimal discountMoney;
+
+    private Long userCouponId;
+
+    private Long inquiryOrderId;
+
+    private Long packageOrderId;
+
+    private String remark;
+
+    private Integer isAfterSales;
+
+    private BigDecimal prescribePrice;
+
+
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private Date followTime;//下次随访日期
-    private Long followDoctorId;//随访医生id
-    private Integer cycle; //用药周期
+    private Date followTime;
+
+    private Long followDoctorId;
+    private Integer cycle;
+    private Integer followNum;
+
+
+    private Long orderBuyType;//购买类型,同药品商城的订单订单类型
+    private String channel;//公众号/渠道
+
+    private String orderChannel;//订单渠道
+
+    private String qwSubject;
+
+    private String packageName;
+
+    private String packageSecondName;
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date followEndTime;
+
+    private Integer followStatus;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date deliveryUpdateTime;
+
+    private Integer isFirst;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date tuiMoneyTime;
+
+    private Integer source;
+    private BigDecimal billPrice;
+    private String erpPhone;
+
 }

+ 15 - 190
fs-service/src/main/java/com/fs/hisStore/domain/FsStorePaymentScrm.java

@@ -5,6 +5,8 @@ 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;
 
 /**
  * 支付明细对象 fs_store_payment
@@ -12,6 +14,8 @@ import com.fs.common.core.domain.BaseEntity;
  * @author fs
  * @date 2022-06-20
  */
+@EqualsAndHashCode(callSuper = true)
+@Data
 public class FsStorePaymentScrm extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
@@ -82,199 +86,20 @@ public class FsStorePaymentScrm extends BaseEntity
 
     private Integer isPayRemain;
 
-    public String getPayMode() {
-        return payMode;
-    }
-
-    public void setPayMode(String payMode) {
-        this.payMode = payMode;
-    }
-
-    public Integer getIsPayRemain() {
-        return isPayRemain;
-    }
-
-    public void setIsPayRemain(Integer isPayRemain) {
-        this.isPayRemain = isPayRemain;
-    }
-
-    public Long getOrderId() {
-        return orderId;
-    }
-
-    public void setOrderId(Long orderId) {
-        this.orderId = orderId;
-    }
-
-    public BigDecimal getRefundMoney() {
-        return refundMoney;
-    }
-
-    public void setRefundMoney(BigDecimal refundMoney) {
-        this.refundMoney = refundMoney;
-    }
-
-    public Date getRefundTime() {
-        return refundTime;
-    }
-
-    public void setRefundTime(Date refundTime) {
-        this.refundTime = refundTime;
-    }
-
-    public String getBankTransactionId() {
-        return bankTransactionId;
-    }
-
-    public void setBankTransactionId(String bankTransactionId) {
-        this.bankTransactionId = bankTransactionId;
-    }
-
-    public String getBankSerialNo() {
-        return bankSerialNo;
-    }
-
-    public void setBankSerialNo(String bankSerialNo) {
-        this.bankSerialNo = bankSerialNo;
-    }
-
-    public static long getSerialVersionUID() {
-        return serialVersionUID;
-    }
-
-    public Long getDeptId() {
-        return deptId;
-    }
-
-    public void setDeptId(Long deptId) {
-        this.deptId = deptId;
-    }
-
-    @Override
-    public String getRemark() {
-        return remark;
-    }
-
-    @Override
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
-
-    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 void setPaymentId(Long paymentId)
-    {
-        this.paymentId = paymentId;
-    }
-
-    public Long getPaymentId()
-    {
-        return paymentId;
-    }
-    public void setPayCode(String payCode)
-    {
-        this.payCode = payCode;
-    }
-
-    public String getPayCode()
-    {
-        return payCode;
-    }
-    public void setPayTypeCode(String payTypeCode)
-    {
-        this.payTypeCode = payTypeCode;
-    }
-
-    public String getPayTypeCode()
-    {
-        return payTypeCode;
-    }
-    public void setPayMoney(BigDecimal payMoney)
-    {
-        this.payMoney = payMoney;
-    }
-
-    public BigDecimal getPayMoney()
-    {
-        return payMoney;
-    }
-    public void setPayTime(Date payTime)
-    {
-        this.payTime = payTime;
-    }
-
-    public Date getPayTime()
-    {
-        return payTime;
-    }
-    public void setTradeNo(String tradeNo)
-    {
-        this.tradeNo = tradeNo;
-    }
-
-    public String getTradeNo()
-    {
-        return tradeNo;
-    }
-    public void setUserId(Long userId)
-    {
-        this.userId = userId;
-    }
-
-    public Long getUserId()
-    {
-        return userId;
-    }
-    public void setOpenId(String openId)
-    {
-        this.openId = openId;
-    }
-
-    public String getOpenId()
-    {
-        return openId;
-    }
-    public void setBusinessType(Integer businessType)
-    {
-        this.businessType = businessType;
-    }
+    /** 关联业务ID */
+    @Excel(name = "关联业务ID")
+    private String businessId;
 
-    public Integer getBusinessType()
-    {
-        return businessType;
-    }
-    public void setBusinessOrderId(String businessOrderId)
-    {
-        this.businessOrderId = businessOrderId;
-    }
+    /** 店铺ID */
+    @Excel(name = "店铺ID")
+    private Long storeId;
 
-    public String getBusinessOrderId()
-    {
-        return businessOrderId;
-    }
-    public void setStatus(Integer status)
-    {
-        this.status = status;
-    }
+    private String businessCode;
 
-    public Integer getStatus()
-    {
-        return status;
-    }
+    private Integer shareStatus;
+    private String shareCode;
+    private BigDecimal shareMoney;
+    private Integer isShare;
 
 
 }

+ 9 - 185
fs-service/src/main/java/com/fs/hisStore/domain/FsStoreProductAttrValueScrm.java

@@ -5,6 +5,8 @@ import java.util.Map;
 
 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;
 
@@ -14,6 +16,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
  * @author fs
  * @date 2022-03-15
  */
+@EqualsAndHashCode(callSuper = true)
+@Data
 public class FsStoreProductAttrValueScrm extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
@@ -88,192 +92,12 @@ public class FsStoreProductAttrValueScrm extends BaseEntity
 
     private Map<String, String> detail;
 
-    public BigDecimal getBrokerageThree() {
-        return brokerageThree;
-    }
 
-    public void setBrokerageThree(BigDecimal brokerageThree) {
-        this.brokerageThree = brokerageThree;
-    }
+    @Excel(name = "医生佣金")
+    private BigDecimal doctorBrokerage;
 
-    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();
-    }
+    /** 需要多少积分兑换 */
+    @Excel(name = "需要多少积分兑换")
+    private Integer giveIntegral;
 }

+ 55 - 0
fs-service/src/main/java/com/fs/hisStore/domain/FsStoreProductScrm.java

@@ -183,4 +183,59 @@ public class FsStoreProductScrm extends BaseEntity
     /** 指定企业 */
     private String companyIds;
 
+    private Long storeId;
+
+    /**
+     * 商品图片
+     */
+    @Excel(name = "商品图片")
+    private String imgUrl;
+
+    /**
+     * 轮播图
+     */
+    @Excel(name = "轮播图")
+    private String images;
+
+    /**
+     * 商品介绍
+     */
+    @Excel(name = "商品介绍")
+    private String productIntroduce;
+
+    /**
+     * 产品描述
+     */
+    @Excel(name = "产品描述")
+    private String desc;
+    /**
+     * 成本价
+     */
+    @Excel(name = "成本价")
+    private BigDecimal costPrice;
+
+    /**
+     * 浏览量
+     */
+    @Excel(name = "浏览量")
+    private Long views;
+
+    /**
+     * 产品二维码地址(用户小程序海报)
+     */
+    @Excel(name = "产品二维码地址(用户小程序海报)")
+    private String codeUrl;
+    /**
+     * 商品类型:1非处方 2处方
+     */
+    @Excel(name = "是否为处方药:1非处方 2处方")
+    private Integer isPrescribe;
+
+
+    /** 品牌 */
+    @Excel(name = "品牌")
+    private String brand;
+
+    private Integer isDrug;
+
 }

+ 110 - 0
fs-service/src/main/java/com/fs/hisStore/domain/FsStoreScrm.java

@@ -0,0 +1,110 @@
+package com.fs.hisStore.domain;
+
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.math.BigDecimal;
+
+/**
+ * 店铺管理对象 fs_store
+ *
+ * @author fs
+ * @date 2023-06-15
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class FsStoreScrm extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** ID */
+    private Long storeId;
+
+    /** 所属城市ids */
+    private String cityIds;
+
+    /** 店铺名称 */
+    @Excel(name = "店铺名称")
+    private String storeName;
+
+    /** 店铺介绍 */
+    @Excel(name = "店铺介绍")
+    private String descs;
+
+    /** 店铺LOGO */
+    @Excel(name = "店铺LOGO")
+    private String logoUrl;
+
+    /** 地址 */
+    @Excel(name = "地址")
+    private String address;
+
+    /** 经度 */
+    private String lng;
+
+    /** 维度 */
+    private String lat;
+
+    /** 店铺电话 */
+    @Excel(name = "店铺电话")
+    private String phone;
+
+    /** 资质证书 */
+    @Excel(name = "资质证书")
+    private String licenseImages;
+
+    /** 商品总数 */
+    @Excel(name = "商品总数")
+    private Long productCount;
+
+    /** 状态 */
+    @Excel(name = "状态")
+    private Integer status;
+
+    /** 销量 */
+    @Excel(name = "销量")
+    private Long salesCount;
+
+    /** 余额 */
+    @Excel(name = "余额")
+    private BigDecimal balance;
+
+    /** 累计金额 */
+    @Excel(name = "累计金额")
+    private BigDecimal totalMoney;
+
+    /** 审核状态 */
+    @Excel(name = "审核状态")
+    private Integer isAudit;
+
+    /** 登录帐号 */
+    @Excel(name = "登录帐号")
+    private String account;
+
+    /** 登录密码 */
+    @Excel(name = "登录密码")
+    private String password;
+
+    /** 配送方式 1=配送 ,2=到店自提 */
+    private String shippingType;
+
+
+    private Integer brokerageType;
+
+    private Integer brokerageRate;
+
+
+    private String fullName;
+
+
+    private String refundPhone;
+    private String refundAddress;
+    private String refundConsignee;
+
+    private Integer deliveryType;
+
+    private String sendPhone;
+
+}

+ 87 - 0
fs-service/src/main/java/com/fs/hisStore/domain/StoreLoginUserScrm.java

@@ -0,0 +1,87 @@
+package com.fs.hisStore.domain;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fs.his.domain.FsStore;
+import lombok.Data;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.userdetails.UserDetails;
+
+import java.util.Collection;
+
+@Data
+public class StoreLoginUserScrm implements UserDetails {
+
+    private static final long serialVersionUID = 1L;
+
+    FsStoreScrm fsStore;
+    /**
+     * 用户唯一标识
+     */
+    private  String token;
+
+    private Long loginTime;
+
+    /**
+     * 过期时间
+     */
+    private Long expireTime;
+
+    /**
+     * 登录IP地址
+     */
+    private String ipaddr;
+
+    /**
+     * 登录地点
+     */
+    private String loginLocation;
+
+    /**
+     * 浏览器类型
+     */
+    private  String browser;
+
+    /**
+     * 操作系统
+     */
+    private  String os;
+
+    private Long storeId;
+
+
+
+    @Override
+    public Collection<? extends GrantedAuthority> getAuthorities() {
+        return null;
+    }
+
+    @Override
+    public String getPassword() {
+        return fsStore.getPassword();
+    }
+
+    @Override
+    public String getUsername() {
+        return fsStore.getStoreName();
+    }
+    @JsonIgnore
+    @Override
+    public boolean isAccountNonExpired() {
+        return true;
+    }
+    @JsonIgnore
+    @Override
+    public boolean isAccountNonLocked() {
+        return true;
+    }
+    @JsonIgnore
+    @Override
+    public boolean isCredentialsNonExpired() {
+        return true;
+    }
+    @JsonIgnore
+    @Override
+    public boolean isEnabled() {
+        return true;
+    }
+}

+ 96 - 0
fs-service/src/main/java/com/fs/hisStore/domain/SysOperLogScrm.java

@@ -0,0 +1,96 @@
+package com.fs.hisStore.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import com.fs.common.annotation.Excel.ColumnType;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 操作日志记录表 oper_log
+ *
+
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class SysOperLogScrm extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 日志主键 */
+    @Excel(name = "操作序号", cellType = ColumnType.NUMERIC)
+    private Long operId;
+
+    /** 操作模块 */
+    @Excel(name = "操作模块")
+    private String title;
+
+    /** 业务类型(0其它 1新增 2修改 3删除) */
+    @Excel(name = "业务类型", readConverterExp = "0=其它,1=新增,2=修改,3=删除,4=导出,5=导入")
+    private Integer businessType;
+
+    /** 业务类型数组 */
+    private Integer[] businessTypes;
+
+    /** 请求方法 */
+    @Excel(name = "请求方法")
+    private String method;
+
+    /** 请求方式 */
+    @Excel(name = "请求方式")
+    private String requestMethod;
+
+    /** 操作类别(0其它 1后台用户 2手机端用户) */
+    @Excel(name = "操作类别", readConverterExp = "0=其它,1=后台用户,2=手机端用户")
+    private Integer operatorType;
+
+    /** 操作人员 */
+    @Excel(name = "操作人员")
+    private String operName;
+
+    /** 部门名称 */
+    @Excel(name = "部门名称")
+    private String deptName;
+
+    /** 请求url */
+    @Excel(name = "请求地址")
+    private String operUrl;
+
+    /** 操作地址 */
+    @Excel(name = "操作地址")
+    private String operIp;
+
+    /** 操作地点 */
+    @Excel(name = "操作地点")
+    private String operLocation;
+
+    /** 请求参数 */
+    @Excel(name = "请求参数")
+    private String operParam;
+
+    /** 返回参数 */
+    @Excel(name = "返回参数")
+    private String jsonResult;
+
+    /** 操作状态(0正常 1异常) */
+    @Excel(name = "状态", readConverterExp = "0=正常,1=异常")
+    private Integer status;
+
+    /** 错误消息 */
+    @Excel(name = "错误消息")
+    private String errorMsg;
+
+    /** 操作时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date operTime;
+
+    @Excel(name = "主要类型", readConverterExp = "0=店铺,1=商品")
+    private String mainType;
+
+    @Excel(name = "描述")
+    private String des;
+}

+ 21 - 0
fs-service/src/main/java/com/fs/hisStore/dto/DateComparisonConfigDTO.java

@@ -0,0 +1,21 @@
+package com.fs.hisStore.dto;
+
+import lombok.Builder;
+import lombok.Data;
+
+@Data
+@Builder
+public class DateComparisonConfigDTO {
+    //table_name, date_column,user_column,phone_column,inAdvance,remindWords,platform,cert_type,is_do_invalid,invalid_expression,status_column
+    private String tableName;
+    private String dateColumn;
+    private String userColumn;
+    private Integer inAdvance;
+    private String phoneColumn;
+    private String remindWords;
+    private String platform;
+    private String certType;
+    private String isDoInvalid;
+    private String invalidExpression;
+    private String statusColumn;
+}

+ 880 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsDataScrmMapper.java

@@ -0,0 +1,880 @@
+package com.fs.hisStore.mapper;
+
+import com.fs.his.dto.DataDTO;
+import com.fs.his.dto.inquiryOrderChartDTO;
+import com.fs.his.vo.ChartDaVO;
+import com.fs.his.vo.ChartDataVO;
+import com.fs.his.vo.ChartProdVO;
+import com.fs.his.vo.DoctorChartVO;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+
+public interface FsDataScrmMapper {
+
+
+    @Select("SELECT t1.month AS label,\n" +
+            "       IFNULL(ROUND(SUM(fs_store_order_scrm.pay_money)), 0) AS value,\n" +
+            "       COUNT(fs_store_order_scrm.id) AS info\n" +
+            "FROM\n" +
+            "  (SELECT DATE_FORMAT(DATE_SUB(NOW(), INTERVAL n MONTH), '%Y-%m') AS month\n" +
+            "   FROM (\n" +
+            "         SELECT 0 n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL\n" +
+            "         SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL\n" +
+            "         SELECT 10 UNION ALL SELECT 11\n" +
+            "        ) AS months) AS t1\n" +
+            "  LEFT JOIN (\n" +
+            "             SELECT DATE_FORMAT(create_time, '%Y-%m') AS month,\n" +
+            "                    pay_money,\n" +
+            "                    id\n" +
+            "             FROM fs_store_order_scrm \n" +
+            "             WHERE create_time BETWEEN DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 11 MONTH), '%Y-%m-01') AND LAST_DAY(NOW())\n" +
+            "\t\t\t\t\t\t AND refund_status=0 \n" +
+            "            ) AS fs_store_order_scrm ON t1.month = fs_store_order_scrm.month\n" +
+            "GROUP BY t1.month\n" +
+            "ORDER BY t1.month ASC;")
+    List<ChartDataVO> getOrderChartData();
+
+
+    @Select("SELECT t1.month AS label,\n" +
+            "       IFNULL(ROUND(SUM(fs_store_order_scrm.pay_money)), 0) AS value,\n" +
+            "       COUNT(fs_store_order_scrm.id) AS info\n" +
+            "FROM\n" +
+            "  (SELECT DATE_FORMAT(DATE_SUB(NOW(), INTERVAL n MONTH), '%Y-%m') AS month\n" +
+            "   FROM (\n" +
+            "         SELECT 0 n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL\n" +
+            "         SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL\n" +
+            "         SELECT 10 UNION ALL SELECT 11\n" +
+            "        ) AS months) AS t1\n" +
+            "  LEFT JOIN (\n" +
+            "             SELECT DATE_FORMAT(create_time, '%Y-%m') AS month,\n" +
+            "                    pay_money,\n" +
+            "                    id\n" +
+            "             FROM fs_store_order_scrm \n" +
+            "             WHERE create_time BETWEEN DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 11 MONTH), '%Y-%m-01') AND LAST_DAY(NOW()) And store_id =#{storeId}\n" +
+            "\t\t\t\t\t\t AND refund_status=0 \n" +
+            "            ) AS fs_store_order_scrm ON t1.month = fs_store_order_scrm.month\n" +
+            "GROUP BY t1.month\n" +
+            "ORDER BY t1.month ASC;")
+    List<ChartDataVO> getStoreOrderChartData(Long storeId);
+
+    @Select("SELECT COUNT(*) FROM fs_store_order_scrm WHERE refund_status =0 AND `status`!=0 ")
+    Long allOrderNum();
+
+    @Select("SELECT COUNT(*) FROM fs_store_order_scrm WHERE refund_status =0 AND `status`!=0  And DATE(create_time) = CURDATE()")
+    Long todayOrderNum();
+
+    @Select("SELECT ROUND(SUM(pay_money)) FROM fs_store_order_scrm WHERE refund_status =0 AND `status`!=0 ")
+    Long allOrderMoney();
+
+    @Select("SELECT CAST(ROUND(COALESCE(SUM(pay_money), 0),0) AS UNSIGNED) AS today_total FROM fs_store_order_scrm WHERE DATE(create_time) = CURDATE() and refund_status =0 AND `status`!=0 \n")
+    Long todayOrderMoney();
+
+
+    @Select("SELECT COUNT(*) FROM fs_inquiry_order ")
+    Long allInquiryOrderNum();
+
+    @Select("SELECT COUNT(*) AS order_count FROM fs_inquiry_order WHERE DATE(create_time) = CURDATE()")
+    Long todayInquiryOrderNum();
+
+    @Select("select COUNT(*) FROM fs_doctor WHERE doctor_type=1")
+    Long getDoctor();
+
+    @Select("select COUNT(*) FROM fs_doctor WHERE doctor_type=2")
+    Long getMedicinePe();
+
+    @Select("SELECT COUNT(*) FROM fs_patient WHERE is_del=0")
+    Long getPatient();
+
+    @Select("SELECT fs_doctor.doctor_name AS name, COUNT(fs_inquiry_order.doctor_id) AS score\n" +
+            "FROM fs_inquiry_order\n" +
+            "JOIN fs_doctor ON fs_inquiry_order.doctor_id = fs_doctor.doctor_id\n" +
+            "GROUP BY fs_doctor.doctor_name\n" +
+            "ORDER BY score DESC limit 10")
+    List<DoctorChartVO> doctorChartData();
+
+@Select("SELECT fs_doctor.doctor_name AS name, COUNT(fs_inquiry_order.doctor_id) AS score\n" +
+        "FROM fs_inquiry_order\n" +
+        "JOIN fs_doctor ON fs_inquiry_order.doctor_id = fs_doctor.doctor_id\n" +
+        "WHERE YEAR(fs_inquiry_order.create_time) = YEAR(CURRENT_DATE())\n" +
+        "GROUP BY fs_doctor.doctor_name\n" +
+        "ORDER BY score DESC\n" +
+        "LIMIT 10;")
+    List<DoctorChartVO> doctorYearData();
+@Select("SELECT fs_doctor.doctor_name AS name, COUNT(fs_inquiry_order.doctor_id) AS score\n" +
+        "FROM fs_inquiry_order\n" +
+        "JOIN fs_doctor ON fs_inquiry_order.doctor_id = fs_doctor.doctor_id\n" +
+        "WHERE YEAR(fs_inquiry_order.create_time) = YEAR(CURRENT_DATE())\n" +
+        "  AND MONTH(fs_inquiry_order.create_time) = MONTH(CURRENT_DATE())\n" +
+        "GROUP BY fs_doctor.doctor_name\n" +
+        "ORDER BY score DESC\n" +
+        "LIMIT 10;")
+    List<DoctorChartVO> doctorMonData();
+@Select("SELECT fs_doctor.doctor_name AS name, COUNT(fs_inquiry_order.doctor_id) AS score\n" +
+        "FROM fs_inquiry_order\n" +
+        "JOIN fs_doctor ON fs_inquiry_order.doctor_id = fs_doctor.doctor_id\n" +
+        "WHERE YEARWEEK(fs_inquiry_order.create_time) = YEARWEEK(CURRENT_DATE())\n" +
+        "GROUP BY fs_doctor.doctor_name\n" +
+        "ORDER BY score DESC\n" +
+        "LIMIT 10;")
+    List<DoctorChartVO> doctorWeekData();
+@Select("SELECT fs_doctor.doctor_name AS name, COUNT(fs_inquiry_order.doctor_id) AS score\n" +
+        "FROM fs_inquiry_order\n" +
+        "JOIN fs_doctor ON fs_inquiry_order.doctor_id = fs_doctor.doctor_id\n" +
+        "WHERE DATE(fs_inquiry_order.create_time) = DATE(CURRENT_DATE())\n" +
+        "GROUP BY fs_doctor.doctor_name\n" +
+        "ORDER BY score DESC\n" +
+        "LIMIT 10;")
+    List<DoctorChartVO> doctorDayData();
+@Select({"<script> " +
+        "SELECT label,value, info FROM (\n" +
+        "\n" +
+        "SELECT \n" +
+        "    t1.hour AS label, \n" +
+        "    IFNULL(ROUND(SUM(fs_store_order_scrm.pay_money)), 0) AS value, \n" +
+        "    COUNT(fs_store_order_scrm.id) AS info \n" +
+        "FROM \n" +
+        "    (SELECT DATE_FORMAT(timestamp, '%Y-%m-%d %H') AS hour \n" +
+        "     FROM (\n" +
+        "           SELECT TIMESTAMP(DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 24 HOUR), '%Y-%m-%d %H')) + INTERVAL n HOUR AS timestamp \n" +
+        "           FROM (\n" +
+        "                 SELECT 0 n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL\n" +
+        "                 SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL\n" +
+        "                 SELECT 10 UNION ALL SELECT 11 UNION ALL SELECT 12 UNION ALL SELECT 13 UNION ALL SELECT 14 UNION ALL \n" +
+        "                 SELECT 15 UNION ALL SELECT 16 UNION ALL SELECT 17 UNION ALL SELECT 18 UNION ALL SELECT 19 UNION ALL\n" +
+        "                 SELECT 20 UNION ALL SELECT 21 UNION ALL SELECT 22 UNION ALL SELECT 23\n" +
+        "                ) AS hours\n" +
+        "          ) AS t) AS t1 \n" +
+        "    LEFT JOIN \n" +
+        "        fs_store_order_scrm ON DATE_FORMAT(fs_store_order_scrm.create_time, '%Y-%m-%d %H') = t1.hour \n" +
+        "WHERE \n" +
+        "    fs_store_order_scrm.create_time IS NULL \n" +
+        "    OR fs_store_order_scrm.create_time &lt;  NOW() <if test = 'storeId != null'> and store_id=#{storeId} </if>\n" +
+
+        "GROUP BY \n" +
+        "    t1.hour \n" +
+        "ORDER BY \n" +
+        "    t1.hour ASC) t WHERE DATE_FORMAT(label,'%Y-%m-%d')=DATE_FORMAT(NOW(),'%Y-%m-%d')"+
+        "</script>"})
+    List<ChartDataVO> getTodaystoreOrderChart(Long storeId);
+@Select({"<script> " +"SELECT \n" +
+        "    t1.hour AS label, \n" +
+        "    IFNULL(ROUND(SUM(fs_store_order_scrm.pay_money)), 0) AS value, \n" +
+        "    COUNT(fs_store_order_scrm.id) AS info \n" +
+        "FROM \n" +
+        "    (SELECT DATE_FORMAT(timestamp, '%Y-%m-%d %H') AS hour \n" +
+        "     FROM (\n" +
+        "           SELECT TIMESTAMP(DATE_FORMAT(CURDATE() - INTERVAL 1 DAY, '%Y-%m-%d %H')) + INTERVAL n HOUR AS timestamp \n" +
+        "           FROM (\n" +
+        "                 SELECT 0 n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL\n" +
+        "                 SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL\n" +
+        "                 SELECT 10 UNION ALL SELECT 11 UNION ALL SELECT 12 UNION ALL SELECT 13 UNION ALL SELECT 14 UNION ALL \n" +
+        "                 SELECT 15 UNION ALL SELECT 16 UNION ALL SELECT 17 UNION ALL SELECT 18 UNION ALL SELECT 19 UNION ALL\n" +
+        "                 SELECT 20 UNION ALL SELECT 21 UNION ALL SELECT 22 UNION ALL SELECT 23\n" +
+        "                ) AS hours\n" +
+        "          ) AS t) AS t1 \n" +
+        "    LEFT JOIN \n" +
+        "        fs_store_order_scrm ON DATE_FORMAT(fs_store_order_scrm.create_time, '%Y-%m-%d %H') = t1.hour \n" +
+        "WHERE \n" +
+        "    fs_store_order_scrm.create_time >= CURDATE() - INTERVAL 1 DAY \n" +
+        "    AND fs_store_order_scrm.create_time &lt; CURDATE() <if test = 'storeId != null'> and store_id=#{storeId} </if>\n" +
+        "    OR fs_store_order_scrm.create_time IS NULL \n" +
+        "GROUP BY \n" +
+        "    t1.hour \n" +
+        "ORDER BY \n" +
+        "    t1.hour ASC "+"</script>"})
+    List<ChartDataVO> getYesterdaystoreOrderChart(Long storeId);
+    @Select({"<script> " +"SELECT \n" +
+            "    DATE_FORMAT(t1.create_time, '%Y-%m-%d') AS label, \n" +
+            "    IFNULL(COUNT(fs_store_order_scrm.id), 0) AS info, \n" +
+            "    IFNULL(ROUND(SUM(fs_store_order_scrm.pay_money)), 0) AS value\n" +
+            "FROM \n" +
+            "    (\n" +
+            "        SELECT \n" +
+            "            DATE_FORMAT(DATE_ADD(NOW(), INTERVAL 2-DAYOFWEEK(NOW()) DAY), '%Y-%m-%d 00:00:00') + INTERVAL t.n DAY AS create_time \n" +
+            "        FROM \n" +
+            "            (SELECT 0 n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6) t\n" +
+            "    ) AS t1 \n" +
+            "LEFT JOIN \n" +
+            "    fs_store_order_scrm ON DATE(fs_store_order_scrm.create_time) = DATE(t1.create_time) \n" +
+            "WHERE \n" +
+            "    1=1 <if test = 'storeId != null'> and store_id=#{storeId} </if>" +
+            "GROUP BY \n" +
+            "    label \n" +
+            "ORDER BY \n" +
+            "    label ASC\n"
+            +"</script>"})
+    List<ChartDataVO> getWeekstoreOrderChart(Long storeId);
+
+    @Select({"<script> " +"SELECT \n" +
+            "    DATE_FORMAT(t1.create_time, '%Y-%m-%d') AS label, \n" +
+            "    IFNULL(COUNT(fs_store_order_scrm.id), 0) AS info, \n" +
+            "    IFNULL(ROUND(SUM(fs_store_order_scrm.pay_money)), 0) AS value\n" +
+            "FROM \n" +
+            "    (\n" +
+            "        SELECT \n" +
+            "            DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -5-DAYOFWEEK(NOW()) DAY), '%Y-%m-%d 00:00:00') + INTERVAL t.n DAY AS create_time \n" +
+            "        FROM \n" +
+            "            (SELECT 0 n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6) t\n" +
+            "    ) AS t1 \n" +
+            "LEFT JOIN \n" +
+            "    fs_store_order_scrm ON DATE(fs_store_order_scrm.create_time) = DATE(t1.create_time) \n" +
+            "WHERE \n" +
+            "    1=1 <if test = 'storeId != null'> and store_id=#{storeId} </if>\n" +
+            "GROUP BY \n" +
+            "    label \n" +
+            "ORDER BY \n" +
+            "    label ASC "+"</script>"})
+    List<ChartDataVO> getLastWeekstoreOrderChart(Long storeId);
+@Select({"<script> " +"SELECT\n" +
+        "  DATE_FORMAT(date_table.date, '%Y-%m-%d') AS label,\n" +
+        "  IFNULL(ROUND(SUM(fs_store_order_scrm.pay_money), 0), 0) AS value,\n" +
+        "  IFNULL(COUNT(fs_store_order_scrm.id), 0) AS info\n" +
+        "FROM\n" +
+        "  (SELECT \n" +
+        "     LAST_DAY(CURDATE() - INTERVAL 1 MONTH) + INTERVAL 1 DAY - INTERVAL (a.a + (10 * b.a) + (100 * c.a)) DAY as date\n" +
+        "   FROM \n" +
+        "     (SELECT 0 as a UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 \n" +
+        "      UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7\n" +
+        "      UNION ALL SELECT 8 UNION ALL SELECT 9) as a \n" +
+        "   CROSS JOIN \n" +
+        "     (SELECT 0 as a UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 \n" +
+        "      UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7\n" +
+        "      UNION ALL SELECT 8 UNION ALL SELECT 9) as b \n" +
+        "   CROSS JOIN \n" +
+        "     (SELECT 0 as a UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 \n" +
+        "      UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7\n" +
+        "      UNION ALL SELECT 8 UNION ALL SELECT 9) as c \n" +
+        "   WHERE \n" +
+        "     (a.a + (10 * b.a) + (100 * c.a)) &lt;= DAY(LAST_DAY(CURDATE() - INTERVAL 1 MONTH))) date_table\n" +
+        "LEFT JOIN \n" +
+        "  fs_store_order_scrm \n" +
+        "ON \n" +
+        "  DATE(fs_store_order_scrm.create_time) = DATE(date_table.date)\n" +
+        "  AND MONTH(fs_store_order_scrm.create_time) = MONTH(CURDATE() - INTERVAL 1 MONTH) <if test = 'storeId != null'> and store_id=#{storeId} </if>\n" +
+        "GROUP BY \n" +
+        "  DATE(date_table.date) ORDER BY label "+"</script>"})
+    List<ChartDataVO> getLastMonstoreOrderChart(Long storeId);
+
+@Select({"<script> " +"SELECT\n" +
+        "  DATE_FORMAT(date_table.date, '%Y-%m-%d') AS label,\n" +
+        "  IFNULL(ROUND(SUM(fs_store_order_scrm.pay_money), 0), 0) AS value,\n" +
+        "  IFNULL(COUNT(fs_store_order_scrm.id), 0) AS info\n" +
+        "FROM\n" +
+        "  (SELECT \n" +
+        "     CURDATE() - INTERVAL (a.a + (10 * b.a) + (100 * c.a)) DAY as date\n" +
+        "   FROM \n" +
+        "     (SELECT 0 as a UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 \n" +
+        "      UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7\n" +
+        "      UNION ALL SELECT 8 UNION ALL SELECT 9) as a \n" +
+        "   CROSS JOIN \n" +
+        "     (SELECT 0 as a UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 \n" +
+        "      UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7\n" +
+        "      UNION ALL SELECT 8 UNION ALL SELECT 9) as b \n" +
+        "   CROSS JOIN \n" +
+        "     (SELECT 0 as a UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 \n" +
+        "      UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7\n" +
+        "      UNION ALL SELECT 8 UNION ALL SELECT 9) as c \n" +
+        "   WHERE \n" +
+        "     (a.a + (10 * b.a) + (100 * c.a)) &lt;= DAY(CURDATE()) - 1) date_table\n" +
+        "LEFT JOIN \n" +
+        "  fs_store_order_scrm \n" +
+        "ON \n" +
+        "  DATE(fs_store_order_scrm.create_time) = DATE(date_table.date)\n" +
+        "  AND DATE(fs_store_order_scrm.create_time) &lt; CURDATE() <if test = 'storeId != null'> and store_id=#{storeId} </if>\n" +
+        "GROUP BY \n" +
+        "  DATE(date_table.date) ORDER BY label" +"</script>"})
+    List<ChartDataVO> getMonstoreOrderChart(Long storeId);
+
+    @Select({"<script> " +"SELECT label,value,info FROM(\n" +
+            "SELECT t1.month AS label,\n" +
+            "       IFNULL(ROUND(SUM(fs_store_order_scrm.pay_money)), 0) AS value,\n" +
+            "       COUNT(fs_store_order_scrm.id) AS info\n" +
+            "FROM\n" +
+            "  (SELECT DATE_FORMAT(DATE_SUB(NOW(), INTERVAL n MONTH), '%Y-%m') AS month\n" +
+            "   FROM (\n" +
+            "         SELECT 0 n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL\n" +
+            "         SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL\n" +
+            "         SELECT 10 UNION ALL SELECT 11\n" +
+            "        ) AS months) AS t1\n" +
+            "  LEFT JOIN (\n" +
+            "             SELECT DATE_FORMAT(create_time, '%Y-%m') AS month,\n" +
+            "                    pay_money,\n" +
+            "                    id\n" +
+            "             FROM fs_store_order_scrm\n" +
+            "             WHERE create_time BETWEEN DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 11 MONTH), '%Y-%m-01') AND LAST_DAY(NOW()) <if test = 'storeId != null'> and store_id=#{storeId} </if>\n" +
+            "            ) AS fs_store_order_scrm ON t1.month = fs_store_order_scrm.month\n" +
+            "GROUP BY t1.month\n" +
+            "ORDER BY t1.month ASC\n" +
+            ")t  WHERE t.label>=DATE_FORMAT(NOW(),'%Y')" +"</script>"})
+    List<ChartDataVO> getYearstoreOrderChart(Long storeId);
+    @Select({"<script> " +"SELECT t1.month AS label,\n" +
+            "       IFNULL(ROUND(SUM(fs_store_order_scrm.pay_money)), 0) AS value,\n" +
+            "       COUNT(fs_store_order_scrm.id) AS info\n" +
+            "FROM\n" +
+            "  (SELECT DATE_FORMAT(DATE_SUB(DATE_SUB(DATE_FORMAT(NOW(), '%Y-%01-01'), INTERVAL 1 DAY), INTERVAL n MONTH), '%Y-%m') AS month\n" +
+            "   FROM (\n" +
+            "         SELECT 0 n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL\n" +
+            "         SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL\n" +
+            "         SELECT 10 UNION ALL SELECT 11\n" +
+            "        ) AS months) AS t1\n" +
+            "  LEFT JOIN (\n" +
+            "             SELECT DATE_FORMAT(create_time, '%Y-%m') AS month,\n" +
+            "                    pay_money,\n" +
+            "                    id\n" +
+            "             FROM fs_store_order_scrm\n" +
+            "              <if test = 'storeId != null'> where store_id=#{storeId} </if>" +
+            "            ) AS fs_store_order_scrm ON t1.month = fs_store_order_scrm.month\n" +
+            "GROUP BY t1.month\n" +
+            "ORDER BY t1.month ASC" +"</script>"})
+    List<ChartDataVO> getLastYearstoreOrderChart(Long storeId);
+
+
+
+
+    @Select({"<script> " +
+            "SELECT label,value, info FROM (\n" +
+            "\n" +
+            "SELECT \n" +
+            "    t1.hour AS label, \n" +
+            "    IFNULL(ROUND(SUM(fs_inquiry_order.pay_money)), 0) AS info, \n" +
+            "    COUNT(fs_inquiry_order.order_id) AS value \n" +
+            "FROM \n" +
+            "    (SELECT DATE_FORMAT(timestamp, '%Y-%m-%d %H') AS hour \n" +
+            "     FROM (\n" +
+            "           SELECT TIMESTAMP(DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 24 HOUR), '%Y-%m-%d %H')) + INTERVAL n HOUR AS timestamp \n" +
+            "           FROM (\n" +
+            "                 SELECT 0 n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL\n" +
+            "                 SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL\n" +
+            "                 SELECT 10 UNION ALL SELECT 11 UNION ALL SELECT 12 UNION ALL SELECT 13 UNION ALL SELECT 14 UNION ALL \n" +
+            "                 SELECT 15 UNION ALL SELECT 16 UNION ALL SELECT 17 UNION ALL SELECT 18 UNION ALL SELECT 19 UNION ALL\n" +
+            "                 SELECT 20 UNION ALL SELECT 21 UNION ALL SELECT 22 UNION ALL SELECT 23\n" +
+            "                ) AS hours\n" +
+            "          ) AS t) AS t1 \n" +
+            "    LEFT JOIN \n" +
+            "        fs_inquiry_order ON DATE_FORMAT(fs_inquiry_order.create_time, '%Y-%m-%d %H') = t1.hour and status>0 \n" +
+            "WHERE \n" +
+            "    fs_inquiry_order.create_time IS NULL \n" +
+            "    OR fs_inquiry_order.create_time &lt;  NOW() <if test = 'doctorId != null'> and doctor_id=#{doctorId} </if>\n " +
+
+            "GROUP BY \n" +
+            "    t1.hour \n" +
+            "ORDER BY \n" +
+            "    t1.hour ASC) t WHERE DATE_FORMAT(label,'%Y-%m-%d')=DATE_FORMAT(NOW(),'%Y-%m-%d')"+
+            "</script>"})
+    List<ChartDataVO> getTodayinquiryOrderChart(Long doctorId);
+    @Select({"<script> " +"SELECT \n" +
+            "    t1.hour AS label, \n" +
+            "    IFNULL(ROUND(SUM(fs_inquiry_order.pay_money)), 0) AS info, \n" +
+            "    COUNT(fs_inquiry_order.order_id) AS value \n" +
+            "FROM \n" +
+            "    (SELECT DATE_FORMAT(timestamp, '%Y-%m-%d %H') AS hour \n" +
+            "     FROM (\n" +
+            "           SELECT TIMESTAMP(DATE_FORMAT(CURDATE() - INTERVAL 1 DAY, '%Y-%m-%d %H')) + INTERVAL n HOUR AS timestamp \n" +
+            "           FROM (\n" +
+            "                 SELECT 0 n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL\n" +
+            "                 SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL\n" +
+            "                 SELECT 10 UNION ALL SELECT 11 UNION ALL SELECT 12 UNION ALL SELECT 13 UNION ALL SELECT 14 UNION ALL \n" +
+            "                 SELECT 15 UNION ALL SELECT 16 UNION ALL SELECT 17 UNION ALL SELECT 18 UNION ALL SELECT 19 UNION ALL\n" +
+            "                 SELECT 20 UNION ALL SELECT 21 UNION ALL SELECT 22 UNION ALL SELECT 23\n" +
+            "                ) AS hours\n" +
+            "          ) AS t) AS t1 \n" +
+            "    LEFT JOIN \n" +
+            "        fs_inquiry_order ON DATE_FORMAT(fs_inquiry_order.create_time, '%Y-%m-%d %H') = t1.hour \n" +
+            "WHERE \n" +
+            "    fs_inquiry_order.create_time >= CURDATE() - INTERVAL 1 DAY \n" +
+            "    AND fs_inquiry_order.create_time &lt; CURDATE() <if test = 'doctorId != null'> and doctor_id=#{doctorId} </if>\n" +
+            "    OR fs_inquiry_order.create_time IS NULL \n" +
+            "GROUP BY \n" +
+            "    t1.hour \n" +
+            "ORDER BY \n" +
+            "    t1.hour ASC "+"</script>"})
+    List<ChartDataVO> getYesterdayinquiryOrderChart(Long doctorId);
+    @Select({"<script> " +"SELECT \n" +
+            "    DATE_FORMAT(t1.create_time, '%Y-%m-%d') AS label, \n" +
+            "    IFNULL(COUNT(fs_inquiry_order.order_id), 0) AS value, \n" +
+            "    IFNULL(ROUND(SUM(fs_inquiry_order.pay_money)), 0) AS info\n" +
+            "FROM \n" +
+            "    (\n" +
+            "        SELECT \n" +
+            "            DATE_FORMAT(DATE_ADD(NOW(), INTERVAL 2-DAYOFWEEK(NOW()) DAY), '%Y-%m-%d 00:00:00') + INTERVAL t.n DAY AS create_time \n" +
+            "        FROM \n" +
+            "            (SELECT 0 n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6) t\n" +
+            "    ) AS t1 \n" +
+            "LEFT JOIN \n" +
+            "    fs_inquiry_order ON DATE(fs_inquiry_order.create_time) = DATE(t1.create_time) \n" +
+            "WHERE \n" +
+            "    1=1 <if test = 'doctorId != null'> and doctor_id=#{doctorId} </if>" +
+            "GROUP BY \n" +
+            "    label \n" +
+            "ORDER BY \n" +
+            "    label ASC\n"
+            +"</script>"})
+    List<ChartDataVO> getWeekinquiryOrderChart(Long doctorId);
+
+    @Select({"<script> " +"SELECT \n" +
+            "    DATE_FORMAT(t1.create_time, '%Y-%m-%d') AS label, \n" +
+            "    IFNULL(COUNT(fs_inquiry_order.order_id), 0) AS value, \n" +
+            "    IFNULL(ROUND(SUM(fs_inquiry_order.pay_money)), 0) AS info\n" +
+            "FROM \n" +
+            "    (\n" +
+            "        SELECT \n" +
+            "            DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -5-DAYOFWEEK(NOW()) DAY), '%Y-%m-%d 00:00:00') + INTERVAL t.n DAY AS create_time \n" +
+            "        FROM \n" +
+            "            (SELECT 0 n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6) t\n" +
+            "    ) AS t1 \n" +
+            "LEFT JOIN \n" +
+            "    fs_inquiry_order ON DATE(fs_inquiry_order.create_time) = DATE(t1.create_time) \n" +
+            "WHERE \n" +
+            "    1=1 <if test = 'doctorId != null'> and doctor_id=#{doctorId} </if>\n" +
+            "GROUP BY \n" +
+            "    label \n" +
+            "ORDER BY \n" +
+            "    label ASC "+"</script>"})
+    List<ChartDataVO> getLastWeekinquiryOrderChart(Long doctorId);
+    @Select({"<script> " +"SELECT\n" +
+            "  DATE_FORMAT(date_table.date, '%Y-%m-%d') AS label,\n" +
+            "  IFNULL(ROUND(SUM(fs_inquiry_order.pay_money), 0), 0) AS info,\n" +
+            "  IFNULL(COUNT(fs_inquiry_order.order_id), 0) AS value\n" +
+            "FROM\n" +
+            "  (SELECT \n" +
+            "     LAST_DAY(CURDATE() - INTERVAL 1 MONTH) + INTERVAL 1 DAY - INTERVAL (a.a + (10 * b.a) + (100 * c.a)) DAY as date\n" +
+            "   FROM \n" +
+            "     (SELECT 0 as a UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 \n" +
+            "      UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7\n" +
+            "      UNION ALL SELECT 8 UNION ALL SELECT 9) as a \n" +
+            "   CROSS JOIN \n" +
+            "     (SELECT 0 as a UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 \n" +
+            "      UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7\n" +
+            "      UNION ALL SELECT 8 UNION ALL SELECT 9) as b \n" +
+            "   CROSS JOIN \n" +
+            "     (SELECT 0 as a UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 \n" +
+            "      UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7\n" +
+            "      UNION ALL SELECT 8 UNION ALL SELECT 9) as c \n" +
+            "   WHERE \n" +
+            "     (a.a + (10 * b.a) + (100 * c.a)) &lt;= DAY(LAST_DAY(CURDATE() - INTERVAL 1 MONTH))) date_table\n" +
+            "LEFT JOIN \n" +
+            "  fs_inquiry_order \n" +
+            "ON \n" +
+            "  DATE(fs_inquiry_order.create_time) = DATE(date_table.date)\n" +
+            "  AND MONTH(fs_inquiry_order.create_time) = MONTH(CURDATE() - INTERVAL 1 MONTH) <if test = 'doctorId != null'> and doctor_id=#{doctorId} </if>\n" +
+            "GROUP BY \n" +
+            "  DATE(date_table.date) ORDER BY label "+"</script>"})
+    List<ChartDataVO> getLastMoninquiryOrderChart(Long doctorId);
+    @Select({"<script> " +"SELECT\n" +
+            "  DATE_FORMAT(date_table.date, '%Y-%m-%d') AS label,\n" +
+            "  IFNULL(ROUND(SUM(fs_inquiry_order.pay_money), 0), 0) AS info,\n" +
+            "  IFNULL(COUNT(fs_inquiry_order.order_id), 0) AS value\n" +
+            "FROM\n" +
+            "  (SELECT \n" +
+            "     CURDATE() - INTERVAL (a.a + (10 * b.a) + (100 * c.a)) DAY as date\n" +
+            "   FROM \n" +
+            "     (SELECT 0 as a UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 \n" +
+            "      UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7\n" +
+            "      UNION ALL SELECT 8 UNION ALL SELECT 9) as a \n" +
+            "   CROSS JOIN \n" +
+            "     (SELECT 0 as a UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 \n" +
+            "      UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7\n" +
+            "      UNION ALL SELECT 8 UNION ALL SELECT 9) as b \n" +
+            "   CROSS JOIN \n" +
+            "     (SELECT 0 as a UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 \n" +
+            "      UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7\n" +
+            "      UNION ALL SELECT 8 UNION ALL SELECT 9) as c \n" +
+            "   WHERE \n" +
+            "     (a.a + (10 * b.a) + (100 * c.a)) &lt;= DAY(CURDATE()) - 1) date_table\n" +
+            "LEFT JOIN \n" +
+            "  fs_inquiry_order \n" +
+            "ON \n" +
+            "  DATE(fs_inquiry_order.create_time) = DATE(date_table.date)\n" +
+            "  AND DATE(fs_inquiry_order.create_time) &lt; CURDATE() <if test = 'doctorId != null'> and doctor_id=#{doctorId} </if>\n" +
+            "GROUP BY \n" +
+            "  DATE(date_table.date) ORDER BY label" +"</script>"})
+    List<ChartDataVO> getMoninquiryOrderChart(Long doctorId);
+    @Select({"<script> " +"SELECT label,value,info FROM(\n" +
+            "SELECT t1.month AS label,\n" +
+            "       IFNULL(ROUND(SUM(fs_inquiry_order.pay_money)), 0) AS info,\n" +
+            "       COUNT(fs_inquiry_order.order_id) AS value\n" +
+            "FROM\n" +
+            "  (SELECT DATE_FORMAT(DATE_SUB(NOW(), INTERVAL n MONTH), '%Y-%m') AS month\n" +
+            "   FROM (\n" +
+            "         SELECT 0 n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL\n" +
+            "         SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL\n" +
+            "         SELECT 10 UNION ALL SELECT 11\n" +
+            "        ) AS months) AS t1\n" +
+            "  LEFT JOIN (\n" +
+            "             SELECT DATE_FORMAT(create_time, '%Y-%m') AS month,\n" +
+            "                    pay_money,\n" +
+            "                    order_id\n" +
+            "             FROM fs_inquiry_order\n" +
+            "             WHERE create_time BETWEEN DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 11 MONTH), '%Y-%m-01') AND LAST_DAY(NOW()) and `status`>0 <if test = 'doctorId != null'> and doctor_id=#{doctorId} </if>\n" +
+            "            ) AS fs_inquiry_order ON t1.month = fs_inquiry_order.month\n" +
+            "GROUP BY t1.month\n" +
+            "ORDER BY t1.month ASC\n" +
+            ")t  WHERE t.label>=DATE_FORMAT(NOW(),'%Y')" +"</script>"})
+    List<ChartDataVO> getYearinquiryOrderChart(Long doctorId);
+    @Select({"<script> " +"SELECT t1.month AS label,\n" +
+            "       IFNULL(ROUND(SUM(fs_inquiry_order.pay_money)), 0) AS info,\n" +
+            "       COUNT(fs_inquiry_order.order_id) AS value\n" +
+            "FROM\n" +
+            "  (SELECT DATE_FORMAT(DATE_SUB(DATE_SUB(DATE_FORMAT(NOW(), '%Y-%01-01'), INTERVAL 1 DAY), INTERVAL n MONTH), '%Y-%m') AS month\n" +
+            "   FROM (\n" +
+            "         SELECT 0 n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL\n" +
+            "         SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL\n" +
+            "         SELECT 10 UNION ALL SELECT 11\n" +
+            "        ) AS months) AS t1\n" +
+            "  LEFT JOIN (\n" +
+            "             SELECT DATE_FORMAT(create_time, '%Y-%m') AS month,\n" +
+            "                    pay_money,\n" +
+            "                    order_id\n" +
+            "             FROM fs_inquiry_order\n" +
+            "              <if test = 'doctorId != null'> where doctor_id=#{doctorId} </if>" +
+            "            ) AS fs_inquiry_order ON t1.month = fs_inquiry_order.month\n" +
+            "GROUP BY t1.month\n" +
+            "ORDER BY t1.month ASC" +"</script>"})
+    List<ChartDataVO> getLastYearinquiryOrderChart(Long doctorId);
+
+    @Select({"<script> " +"SELECT label,value,info FROM(\n" +
+            "SELECT t1.month AS label,\n" +
+            "       IFNULL(ROUND(SUM(fs_store_order_scrm.pay_money)), 0) AS value,\n" +
+            "       COUNT(fs_store_order_scrm.id) AS info\n" +
+            "FROM\n" +
+            "  (SELECT DATE_FORMAT(DATE_SUB(NOW(), INTERVAL n MONTH), '%Y-%m') AS month\n" +
+            "   FROM (\n" +
+            "         SELECT 0 n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL\n" +
+            "         SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL\n" +
+            "         SELECT 10 UNION ALL SELECT 11\n" +
+            "        ) AS months) AS t1\n" +
+            "  LEFT JOIN (\n" +
+            "             SELECT DATE_FORMAT(create_time, '%Y-%m') AS month,\n" +
+            "                    pay_money,\n" +
+            "                    id\n" +
+            "             FROM fs_store_order_scrm\n" +
+            "             WHERE create_time BETWEEN DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 11 MONTH), '%Y-%m-01') AND LAST_DAY(NOW()) <if test = 'storeId != null'> and store_id=#{storeId} </if>\n" +
+            "            ) AS fs_store_order_scrm ON t1.month = fs_store_order_scrm.month\n" +
+            "GROUP BY t1.month\n" +
+            "ORDER BY t1.month ASC\n" +
+            ")t  WHERE t.label>=DATE_FORMAT(NOW(),'%Y') and QUARTER(CONCAT(t.label,\"-01\"))=QUARTER(NOW())" +"</script>"})
+    List<ChartDataVO> getquarterstoreOrderChart(Long storeId);
+    @Select({"<script> " +"SELECT label,value,info FROM(\n" +
+            "SELECT t1.month AS label,\n" +
+            "       IFNULL(ROUND(SUM(fs_store_order_scrm.pay_money)), 0) AS value,\n" +
+            "       COUNT(fs_store_order_scrm.id) AS info\n" +
+            "FROM\n" +
+            "  (SELECT DATE_FORMAT(DATE_SUB(NOW(), INTERVAL n MONTH), '%Y-%m') AS month\n" +
+            "   FROM (\n" +
+            "         SELECT 0 n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL\n" +
+            "         SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL\n" +
+            "         SELECT 10 UNION ALL SELECT 11\n" +
+            "        ) AS months) AS t1\n" +
+            "  LEFT JOIN (\n" +
+            "             SELECT DATE_FORMAT(create_time, '%Y-%m') AS month,\n" +
+            "                    pay_money,\n" +
+            "                    id\n" +
+            "             FROM fs_store_order_scrm\n" +
+            "             WHERE create_time BETWEEN DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 11 MONTH), '%Y-%m-01') AND LAST_DAY(NOW()) <if test = 'storeId != null'> and store_id=#{storeId} </if>\n" +
+            "            ) AS fs_store_order_scrm ON t1.month = fs_store_order_scrm.month\n" +
+            "GROUP BY t1.month\n" +
+            "ORDER BY t1.month ASC\n" +
+            ")t  WHERE t.label>=DATE_FORMAT(NOW(),'%Y') and QUARTER(CONCAT(t.label,\"-01\"))=QUARTER(NOW())-1" +"</script>"})
+    List<ChartDataVO> getLastquarterstoreOrderChart(Long storeId);
+
+    @Select({"<script> " +"SELECT label,value,info FROM(\n" +
+            "SELECT t1.month AS label,\n" +
+            "       IFNULL(ROUND(SUM(fs_inquiry_order.pay_money)), 0) AS info,\n" +
+            "       COUNT(fs_inquiry_order.order_id) AS value\n" +
+            "FROM\n" +
+            "  (SELECT DATE_FORMAT(DATE_SUB(NOW(), INTERVAL n MONTH), '%Y-%m') AS month\n" +
+            "   FROM (\n" +
+            "         SELECT 0 n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL\n" +
+            "         SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL\n" +
+            "         SELECT 10 UNION ALL SELECT 11\n" +
+            "        ) AS months) AS t1\n" +
+            "  LEFT JOIN (\n" +
+            "             SELECT DATE_FORMAT(create_time, '%Y-%m') AS month,\n" +
+            "                    pay_money,\n" +
+            "                    order_id\n" +
+            "             FROM fs_inquiry_order\n" +
+            "             WHERE create_time BETWEEN DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 11 MONTH), '%Y-%m-01') AND LAST_DAY(NOW()) <if test = 'doctorId != null'> and doctor_id=#{doctorId} </if>\n" +
+            "            ) AS fs_inquiry_order ON t1.month = fs_inquiry_order.month\n" +
+            "GROUP BY t1.month\n" +
+            "ORDER BY t1.month ASC\n" +
+            ")t  WHERE t.label>=DATE_FORMAT(NOW(),'%Y') and QUARTER(CONCAT(t.label,\"-01\"))=QUARTER(NOW())-1" +"</script>"})
+    List<ChartDataVO> getLastquarterinquiryOrderChart(Long doctorId);
+
+    @Select({"<script> " +"SELECT label,value,info FROM(\n" +
+            "SELECT t1.month AS label,\n" +
+            "       IFNULL(ROUND(SUM(fs_inquiry_order.pay_money)), 0) AS info,\n" +
+            "       COUNT(fs_inquiry_order.order_id) AS value\n" +
+            "FROM\n" +
+            "  (SELECT DATE_FORMAT(DATE_SUB(NOW(), INTERVAL n MONTH), '%Y-%m') AS month\n" +
+            "   FROM (\n" +
+            "         SELECT 0 n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL\n" +
+            "         SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL\n" +
+            "         SELECT 10 UNION ALL SELECT 11\n" +
+            "        ) AS months) AS t1\n" +
+            "  LEFT JOIN (\n" +
+            "             SELECT DATE_FORMAT(create_time, '%Y-%m') AS month,\n" +
+            "                    pay_money,\n" +
+            "                    order_id\n" +
+            "             FROM fs_inquiry_order\n" +
+            "             WHERE create_time BETWEEN DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 11 MONTH), '%Y-%m-01') AND LAST_DAY(NOW()) <if test = 'doctorId != null'> and doctor_id=#{doctorId} </if>\n" +
+            "            ) AS fs_inquiry_order ON t1.month = fs_inquiry_order.month\n" +
+            "GROUP BY t1.month\n" +
+            "ORDER BY t1.month ASC\n" +
+            ")t  WHERE t.label>=DATE_FORMAT(NOW(),'%Y') and QUARTER(CONCAT(t.label,\"-01\"))=QUARTER(NOW())" +"</script>"})
+    List<ChartDataVO> getquarterinquiryOrderChart(Long doctorId);
+
+    @Select({"<script> " +"SELECT t1.month AS label,\n" +
+            "       IFNULL(ROUND(SUM(fs_store_order_scrm.pay_money)), 0) AS value,\n" +
+            "       COUNT(fs_store_order_scrm.id) AS info\n" +
+            "FROM\n" +
+            "  (SELECT DATE_FORMAT(DATE_SUB(NOW(), INTERVAL n MONTH), '%Y-%m') AS month\n" +
+            "   FROM (\n" +
+            "         SELECT 0 n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL\n" +
+            "         SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL\n" +
+            "         SELECT 10 UNION ALL SELECT 11\n" +
+            "        ) AS months) AS t1\n" +
+            "  LEFT JOIN (\n" +
+            "             SELECT DATE_FORMAT(create_time, '%Y-%m') AS month,\n" +
+            "                    pay_money,\n" +
+            "                    id\n" +
+            "             FROM fs_store_order_scrm \n" +
+            "             WHERE create_time BETWEEN DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 11 MONTH), '%Y-%m-01') AND LAST_DAY(NOW())\n" +
+            "\t\t\t\t\t\t AND refund_status=0 <if test = 'storeId != null'> and store_id=#{storeId} </if>\n" +
+            "            ) AS fs_store_order_scrm ON t1.month = fs_store_order_scrm.month\n" +
+            "GROUP BY t1.month\n" +
+            "ORDER BY t1.month ASC;" +"</script>"})
+    List<ChartDataVO> getOrderChartstoreIdData(Long storeId);
+    @Select({"<script> " +
+            "SELECT COUNT(o.id) count,SUM(o.pay_money) money,fs.store_name name FROM fs_store_order_scrm o LEFT JOIN  fs_store_scrm fs ON o.store_id =fs.store_id   WHERE 1=1 " +
+            "<if test = 'maps.storeId != null'> " +
+            "and o.store_id = #{maps.storeId} " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==1 '> " +
+            "and TO_DAYS(o.create_time) = TO_DAYS(NOW()) " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==2 '> " +
+            "and TO_DAYS(NOW()) - TO_DAYS(o.create_time) &lt;= 1 " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==3 '> " +
+            "and YEARWEEK(DATE_FORMAT(o.create_time,'%Y-%m-%d')) = YEARWEEK(NOW()) " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==4 '> " +
+            "and YEARWEEK(DATE_FORMAT(o.create_time,'%Y-%m-%d')) = YEARWEEK(NOW())-1 " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==5 '> " +
+            "and DATE_FORMAT(o.create_time,'%Y%m') = DATE_FORMAT(CURDATE(),'%Y%m') " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==6 '> " +
+            "and PERIOD_DIFF(DATE_FORMAT(NOW(),'%Y%m'),DATE_FORMAT(o.create_time,'%Y%m')) = 1 " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==7 '> " +
+            "and QUARTER(o.create_time) = QUARTER(NOW()) " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==8 '> " +
+            "and QUARTER(o.create_time) = QUARTER(DATE_SUB(NOW(),INTERVAL 1 QUARTER)) " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==9 '> " +
+            "and YEAR(o.create_time)=YEAR(NOW()) " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==10 '> " +
+            "and  YEAR(o.create_time) = YEAR(DATE_SUB(NOW(),INTERVAL 1 YEAR))" +
+            "</if>" +
+            "GROUP BY o.store_id"+
+            "</script>"})
+    List<ChartDaVO> getStoreDate(@Param("maps") DataDTO dto);
+    @Select({"<script> " +
+            "SELECT COUNT(o.order_id) count,SUM(o.pay_money) money,d.doctor_name name FROM fs_inquiry_order o LEFT JOIN fs_doctor d ON d.doctor_id = o.doctor_id   WHERE o.status>0 " +
+            "<if test = 'maps.doctorId != null'> " +
+            "and o.doctor_id = #{maps.doctorId} " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==1 '> " +
+            "and TO_DAYS(o.create_time) = TO_DAYS(NOW()) " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==2 '> " +
+            "and TO_DAYS(NOW()) - TO_DAYS(o.create_time) &lt;= 1 " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==3 '> " +
+            "and YEARWEEK(DATE_FORMAT(o.create_time,'%Y-%m-%d')) = YEARWEEK(NOW()) " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==4 '> " +
+            "and YEARWEEK(DATE_FORMAT(o.create_time,'%Y-%m-%d')) = YEARWEEK(NOW())-1 " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==5 '> " +
+            "and DATE_FORMAT(o.create_time,'%Y%m') = DATE_FORMAT(CURDATE(),'%Y%m') " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==6 '> " +
+            "and PERIOD_DIFF(DATE_FORMAT(NOW(),'%Y%m'),DATE_FORMAT(o.create_time,'%Y%m')) = 1 " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==7 '> " +
+            "and QUARTER(o.create_time) = QUARTER(NOW()) " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==8 '> " +
+            "and QUARTER(o.create_time) = QUARTER(DATE_SUB(NOW(),INTERVAL 1 QUARTER)) " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==9 '> " +
+            "and YEAR(o.create_time)=YEAR(NOW()) " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==10 '> " +
+            "and  YEAR(o.create_time) = YEAR(DATE_SUB(NOW(),INTERVAL 1 YEAR))" +
+            "</if>" +
+            "GROUP BY o.doctor_id"+
+            "</script>"})
+    List<ChartDaVO> getInquiryOrderChartInq(@Param("maps") inquiryOrderChartDTO dto);
+
+
+
+    @Select({"<script> " +
+            "SELECT ANY_VALUE(x.product_id) product_id,SUM(x.num) num, ANY_VALUE(p.product_name) product_name,ANY_VALUE(p.price) price,ANY_VALUE(p.bar_code) as barCode FROM fs_store_order_item_scrm x LEFT JOIN fs_store_product_scrm p ON p.product_id=x.product_id WHERE order_id IN (SELECT order_id FROM fs_store_order_scrm WHERE `status`>1 " +
+            "<if test = 'maps.storeId != null'> " +
+            "and store_id = #{maps.storeId} " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==1 '> " +
+            "and TO_DAYS(create_time) = TO_DAYS(NOW()) " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==2 '> " +
+            "and TO_DAYS(NOW()) - TO_DAYS(create_time) &lt;= 1 " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==3 '> " +
+            "and YEARWEEK(DATE_FORMAT(create_time,'%Y-%m-%d')) = YEARWEEK(NOW()) " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==4 '> " +
+            "and YEARWEEK(DATE_FORMAT(create_time,'%Y-%m-%d')) = YEARWEEK(NOW())-1 " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==5 '> " +
+            "and DATE_FORMAT(create_time,'%Y%m') = DATE_FORMAT(CURDATE(),'%Y%m') " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==6 '> " +
+            "and PERIOD_DIFF(DATE_FORMAT(NOW(),'%Y%m'),DATE_FORMAT(create_time,'%Y%m')) = 1 " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==7 '> " +
+            "and QUARTER(create_time) = QUARTER(NOW()) " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==8 '> " +
+            "and QUARTER(create_time) = QUARTER(DATE_SUB(NOW(),INTERVAL 1 QUARTER)) " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==9 '> " +
+            "and YEAR(create_time)=YEAR(NOW()) " +
+            "</if>" +
+            "<if test = 'maps.type != null and maps.type ==10 '> " +
+            "and  YEAR(create_time) = YEAR(DATE_SUB(NOW(),INTERVAL 1 YEAR))" +
+            "</if>" +
+            ") \n" +
+            "GROUP BY x.product_id  ORDER BY num desc"+
+            "</script>"})
+    List<ChartProdVO> ChartProdVO(@Param("maps") DataDTO dto);
+
+
+    @Select("select COUNT(product_id) FROM fs_store_product_scrm WHERE store_id=#{id}")
+    Long getStore(Long id);
+    @Select("select COUNT(product_id) FROM fs_store_product_scrm WHERE store_id=#{id} AND is_show=0")
+    Long getAStore(Long id);
+    @Select("select COUNT(id) FROM fs_store_order_scrm WHERE store_id=#{id} AND `status`!=-3 AND `status`!=-2")
+    Long getOrder(Long id);
+    @Select("select SUM(sales) FROM fs_store_product_scrm WHERE store_id=#{id}")
+    Long getYsStore(Long id);
+    @Select("select COUNT(id) FROM fs_store_order_scrm WHERE store_id=#{id} AND `status`=1")
+    Long getSendStore(Long id);
+    @Select("select COUNT(id) FROM fs_store_order_scrm WHERE store_id=#{id} AND `status`=2")
+    Long getGetStore(Long id);
+    @Select({"<script> " +
+            "SELECT SUM(x.num) score,ANY_VALUE(p.product_name) name FROM fs_store_order_item_scrm x LEFT JOIN fs_store_product_scrm p ON p.product_id=x.product_id WHERE order_id IN (SELECT order_id FROM fs_store_order_scrm WHERE 1=1 " +
+            "<if test = 'storeId != null'> " +
+            "and store_id = #{storeId} " +
+            "</if>" +
+            "<if test = 'type != null and type ==1 '> " +
+            "and TO_DAYS(create_time) = TO_DAYS(NOW()) " +
+            "</if>" +
+            "<if test = 'type != null and type ==2 '> " +
+            "and TO_DAYS(NOW()) - TO_DAYS(create_time) &lt;= 1 " +
+            "</if>" +
+            "<if test = 'type != null and type ==3 '> " +
+            "and YEARWEEK(DATE_FORMAT(create_time,'%Y-%m-%d')) = YEARWEEK(NOW()) " +
+            "</if>" +
+            "<if test = 'type != null and type ==4 '> " +
+            "and YEARWEEK(DATE_FORMAT(create_time,'%Y-%m-%d')) = YEARWEEK(NOW())-1 " +
+            "</if>" +
+            "<if test = 'type != null and type ==5 '> " +
+            "and DATE_FORMAT(create_time,'%Y%m') = DATE_FORMAT(CURDATE(),'%Y%m') " +
+            "</if>" +
+            "<if test = 'type != null and type ==6 '> " +
+            "and PERIOD_DIFF(DATE_FORMAT(NOW(),'%Y%m'),DATE_FORMAT(create_time,'%Y%m')) = 1 " +
+            "</if>" +
+            "<if test = 'type != null and type ==7 '> " +
+            "and QUARTER(create_time) = QUARTER(NOW()) " +
+            "</if>" +
+            "<if test = 'type != null and type ==8 '> " +
+            "and QUARTER(create_time) = QUARTER(DATE_SUB(NOW(),INTERVAL 1 QUARTER)) " +
+            "</if>" +
+            "<if test = 'type != null and type ==9 '> " +
+            "and YEAR(create_time)=YEAR(NOW()) " +
+            "</if>" +
+            "<if test = 'type != null and type ==10 '> " +
+            "and  YEAR(create_time) = YEAR(DATE_SUB(NOW(),INTERVAL 1 YEAR))" +
+            "</if>" +
+            ") \n" +
+            "GROUP BY x.product_id  ORDER BY score desc limit 10"+
+            "</script>"})
+    List<DoctorChartVO> ChartStoreProdVo(@Param("type") Integer type, @Param("storeId") Long storeId);
+    @Select("SELECT COUNT(user_id) FROM fs_user")
+    Long getUserNum();
+    @Select("SELECT COUNT(user_id) FROM fs_user WHERE DATE(create_time) = CURDATE()")
+    Long getTodayUserNum();
+
+    @Select("SELECT t1.month AS label,\n" +
+            "                   IFNULL(ROUND(SUM(fs_inquiry_order.pay_money)), 0) AS value,\n" +
+            "                   COUNT(fs_inquiry_order.order_id) AS info\n" +
+            "            FROM\n" +
+            "              (SELECT DATE_FORMAT(DATE_SUB(NOW(), INTERVAL n MONTH), '%Y-%m') AS month\n" +
+            "               FROM (\n" +
+            "                     SELECT 0 n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL\n" +
+            "                     SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL\n" +
+            "                     SELECT 10 UNION ALL SELECT 11\n" +
+            "                    ) AS months) AS t1\n" +
+            "              LEFT JOIN (\n" +
+            "                         SELECT DATE_FORMAT(create_time, '%Y-%m') AS month,\n" +
+            "                                pay_money,\n" +
+            "                              order_id\n" +
+            "                        FROM fs_inquiry_order \n" +
+            "                        WHERE create_time BETWEEN DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 11 MONTH), '%Y-%m-01') AND LAST_DAY(NOW())\n" +
+            "            AND `status`>0\n" +
+            "                        ) AS fs_inquiry_order ON t1.month = fs_inquiry_order.month\n" +
+            "            GROUP BY t1.month\n" +
+            "            ORDER BY t1.month ASC;")
+    List<ChartDataVO> getInquiryOrderChartData();
+    @Select("select COUNT(*) FROM fs_doctor WHERE doctor_type=1 and DATE(create_time) = CURDATE()")
+    Long getTodayDoctor();
+    @Select("select COUNT(*) FROM fs_doctor WHERE doctor_type=2 and DATE(create_time) = CURDATE()")
+    Long getTodayMedicinePe();
+    @Select("select COUNT(*) FROM fs_store_product_scrm")
+    Long getStoreProdNum();
+    @Select("select COUNT(*) FROM fs_store_product_scrm WHERE  DATE(create_time) = CURDATE()")
+    Long getTodayStoreProdNum();
+
+    @Select("SELECT t1.month AS label,\n" +
+            "                   IFNULL(ROUND(SUM(fs_inquiry_order.pay_money)), 0) AS value,\n" +
+            "                   COUNT(fs_inquiry_order.order_id) AS info\n" +
+            "            FROM\n" +
+            "              (SELECT DATE_FORMAT(DATE_SUB(NOW(), INTERVAL n MONTH), '%Y-%m') AS month\n" +
+            "               FROM (\n" +
+            "                     SELECT 0 n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL\n" +
+            "                     SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL\n" +
+            "                     SELECT 10 UNION ALL SELECT 11\n" +
+            "                    ) AS months) AS t1\n" +
+            "              LEFT JOIN (\n" +
+            "                         SELECT DATE_FORMAT(create_time, '%Y-%m') AS month,\n" +
+            "                                pay_money,\n" +
+            "                              order_id\n" +
+            "                        FROM fs_inquiry_order \n" +
+            "                        WHERE create_time BETWEEN DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 11 MONTH), '%Y-%m-01') AND LAST_DAY(NOW())\n" +
+            "            AND `status`>0 \n" +
+            "            AND doctor_id=#{doctorId} \n" +
+            "                        ) AS fs_inquiry_order ON t1.month = fs_inquiry_order.month\n" +
+            "            GROUP BY t1.month\n" +
+            "            ORDER BY t1.month ASC;")
+    List<ChartDataVO> getDoctorInquiryOrderChartData(Long doctorId);
+
+    @Select("select COUNT(*) FROM fs_inquiry_order WHERE doctor_id=#{doctorId} and   `status`>0  and   DATE(create_time) = CURDATE()")
+    Long getDoctorInquiryCount(Long doctorId);
+}

+ 63 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreAfterSalesLogsScrmMapper.java

@@ -0,0 +1,63 @@
+package com.fs.hisStore.mapper;
+
+
+import com.fs.hisStore.domain.FsStoreAfterSalesLogsScrm;
+
+import java.util.List;
+
+/**
+ * 售后订单操作Mapper接口
+ *
+ * @author fs
+ * @date 2023-12-27
+ */
+public interface FsStoreAfterSalesLogsScrmMapper
+{
+    /**
+     * 查询售后订单操作
+     *
+     * @param logsId 售后订单操作主键
+     * @return 售后订单操作
+     */
+    public FsStoreAfterSalesLogsScrm selectFsStoreAfterSalesLogsByLogsId(Long logsId);
+
+    /**
+     * 查询售后订单操作列表
+     *
+     * @param fsStoreAfterSalesLogs 售后订单操作
+     * @return 售后订单操作集合
+     */
+    public List<FsStoreAfterSalesLogsScrm> selectFsStoreAfterSalesLogsList(FsStoreAfterSalesLogsScrm fsStoreAfterSalesLogs);
+
+    /**
+     * 新增售后订单操作
+     *
+     * @param fsStoreAfterSalesLogs 售后订单操作
+     * @return 结果
+     */
+    public int insertFsStoreAfterSalesLogs(FsStoreAfterSalesLogsScrm fsStoreAfterSalesLogs);
+
+    /**
+     * 修改售后订单操作
+     *
+     * @param fsStoreAfterSalesLogs 售后订单操作
+     * @return 结果
+     */
+    public int updateFsStoreAfterSalesLogs(FsStoreAfterSalesLogsScrm fsStoreAfterSalesLogs);
+
+    /**
+     * 删除售后订单操作
+     *
+     * @param logsId 售后订单操作主键
+     * @return 结果
+     */
+    public int deleteFsStoreAfterSalesLogsByLogsId(Long logsId);
+
+    /**
+     * 批量删除售后订单操作
+     *
+     * @param logsIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteFsStoreAfterSalesLogsByLogsIds(Long[] logsIds);
+}

+ 71 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreAfterSalesScrmMapper.java

@@ -1,6 +1,11 @@
 package com.fs.hisStore.mapper;
 
 import java.util.List;
+
+import com.fs.his.param.FsStoreAfterSalesParam;
+import com.fs.his.vo.FsStoreAfterSalesExcelVO;
+import com.fs.his.vo.FsStoreAfterSalesLogsVO;
+import com.fs.hisStore.domain.FsStoreAfterSalesItemScrm;
 import com.fs.hisStore.domain.FsStoreAfterSalesScrm;
 import com.fs.hisStore.param.FsStoreAfterSalesQueryParam;
 import com.fs.hisStore.vo.FsStoreAfterSalesQueryVO;
@@ -153,4 +158,70 @@ public interface FsStoreAfterSalesScrmMapper
 
     @Update("update fs_store_after_sales_scrm set delivery_sn =#{deliverySn},delivery_name = #{deliveryName},status = #{status} where id = #{id}")
     int updateDeliveryById(FsStoreAfterSalesScrm fsStoreAfterSales);
+
+    @Select({"<script> " +
+            "select so.*,st.store_name,us.nick_name,us.phone,fso.order_code,fso.delivery_sn as delivery_id,fpo.package_name ,c.company_name,cu.nick_name as company_user_nick_name FROM fs_store_after_sales_scrm so " +
+            " LEFT JOIN fs_store_scrm st ON so.store_id =st.store_id " +
+            " LEFT JOIN fs_user us ON us.user_id=so.user_id " +
+            " LEFT JOIN fs_store_order_scrm fso ON fso.order_code=so.order_code  "+
+            " left join company c on so.company_id = c.company_id " +
+            " left join fs_package_order fpo on fso.order_code = fpo.order_sn " +
+            " left join company_user cu on so.company_user_id = cu.user_id   WHERE so.is_del=0 "+
+            "    <if test=\"maps.storeId != null \"> and so.store_id = #{maps.storeId}</if>\n" +
+            "    <if test=\"maps.refundAmount != null \"> and so.refund_amount = #{maps.refundAmount}</if>\n" +
+            "    <if test=\"maps.refundType != null \"> and so.refund_type = #{maps.refundType}</if>\n" +
+            "    <if test=\"maps.reasons != null  and maps.reasons != ''\"> and so.reasons = #{maps.reasons}</if>\n" +
+            "    <if test=\"maps.explains != null  and maps.explains != ''\"> and so.explains = #{maps.explains}</if>\n" +
+            "    <if test=\"maps.deliveryCode != null  and maps.deliveryCode != ''\"> and so.delivery_code = #{maps.deliveryCode}</if>\n" +
+            "    <if test=\"maps.deliverySn != null  and maps.deliverySn != ''\"> and so.delivery_sn = #{maps.deliverySn}</if>\n" +
+            "    <if test=\"maps.deliveryName != null  and maps.deliveryName != ''\"> and so.delivery_name like concat('%', #{maps.deliveryName}, '%')</if>\n" +
+            "    <if test=\"maps.status != null \"> and so.status = #{maps.status}</if>\n" +
+            "    <if test=\"maps.salesStatus != null \"> and so.sales_status = #{maps.salesStatus}</if>\n" +
+            "    <if test=\"maps.phone != null \"> and us.phone = #{maps.phone}</if>\n" +
+            "    <if test=\"maps.orderStatus != null \"> and so.order_status = #{maps.orderStatus}</if>\n" +
+            "    <if test=\"maps.isDel != null  and isDel != ''\"> and so.is_del = #{maps.isDel}</if>\n" +
+            "    <if test=\"maps.userId != null \"> and so.user_id = #{maps.userId}</if>\n" +
+            "<if test = 'maps.createTimeList != null    '> " +
+            " AND date_format(so.create_time,'%y%m%d') &gt;= date_format(#{maps.createTimeList[0]},'%y%m%d') " +
+            " AND date_format(so.create_time,'%y%m%d') &lt;= date_format(#{maps.createTimeList[1]},'%y%m%d') " +
+            "</if>" +
+            "<if test = 'maps.companyUserNickName != null and  maps.companyUserNickName !=  \"\" '> " +
+            " and cu.nick_name like concat(#{maps.companyUserNickName}, '%') " +
+            "</if>" +
+            "    <if test=\"maps.consignee != null  and maps.consignee != ''\"> and so.consignee = #{maps.consignee}</if>\n" +
+            "    <if test=\"maps.phoneNumber != null  and maps.phoneNumber != ''\"> and so.phone_number = #{maps.phoneNumber}</if>\n" +
+            "    <if test=\"maps.address != null  and maps.address != ''\"> and so.address = #{maps.address}</if>\n" +
+            "<if test = 'maps.companyId != null  and   maps.companyId != \"-1\" '> " +
+            "and so.company_id =#{maps.companyId} " +
+            "</if>" +
+            "<if test = ' maps.companyId == \"-1\" '> " +
+            "and so.company_id is null " +
+            "</if>" +
+            "    <if test=\"maps.companyUserId != null \"> and so.company_user_id = #{maps.companyUserId}</if>\n" +
+            "    <if test=\"maps.isPackage != null \"> and so.is_package = #{maps.isPackage}</if>"+
+            "    <if test=\"maps.orderCode != null \"> and fso.order_code= #{maps.orderCode}</if>"+
+            "<if test = 'maps.deptId != null    '> " +
+            "  AND (so.dept_id = #{maps.deptId} OR so.dept_id IN ( SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors) )) " +
+            "</if>" +
+            " order by so.id desc "+
+            "</script>"})
+    List<FsStoreAfterSalesExcelVO> selectFsStoreAfterSalesExcelListVO(@Param("maps") FsStoreAfterSalesParam fsStoreAfterSales);
+
+    @Select("select so.*,st.store_name,us.nick_name,us.phone,fso.order_code " +
+            "FROM fs_store_after_sales_scrm so " +
+            "LEFT JOIN fs_store_scrm st ON so.store_id =st.store_id " +
+            "LEFT JOIN fs_user us ON us.user_id=so.user_id " +
+            "LEFT JOIN fs_store_order_scrm fso ON fso.id=so.order_code " +
+            "WHERE so.id=#{id} ")
+    FsStoreAfterSalesVO selectFsStoreAfterSalesVOById(Long id);
+
+    @Select("select * FROM fs_store_after_sales_item_scrm WHERE store_after_sales_id =#{id}")
+    List<FsStoreAfterSalesItemScrm> selectFsStoreAfterSalesItemById(Long id);
+
+    @Select("select a.*,c.company_name,s.store_name FROM fs_store_after_sales_logs_scrm a left join company c on c.company_id = a.company_id " +
+            " left join fs_store_scrm s on s.store_id = a.store_id WHERE a.store_after_sales_id =#{id}")
+    List<FsStoreAfterSalesLogsVO> selectFsStoreAfterSalesLogById(Long id);
+
+    @Select(" SELECT id FROM fs_store_order_scrm WHERE order_code =#{id}")
+    Long selectFsOrderIdByCode(Long id);
 }

+ 83 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreBillScrmMapper.java

@@ -0,0 +1,83 @@
+package com.fs.hisStore.mapper;
+
+import com.fs.hisStore.domain.FsStoreBillScrm;
+import com.fs.his.param.FsStoreBillParam;
+import com.fs.his.vo.FsStoreBillVO;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+
+/**
+ * 店铺帐单记录Mapper接口
+ *
+ * @author fs
+ * @date 2023-06-25
+ */
+public interface FsStoreBillScrmMapper
+{
+    /**
+     * 查询店铺帐单记录
+     *
+     * @param billId 店铺帐单记录主键
+     * @return 店铺帐单记录
+     */
+    public FsStoreBillScrm selectFsStoreBillByBillId(Long billId);
+
+    /**
+     * 查询店铺帐单记录列表
+     *
+     * @param fsStoreBill 店铺帐单记录
+     * @return 店铺帐单记录集合
+     */
+    public List<FsStoreBillScrm> selectFsStoreBillList(FsStoreBillScrm fsStoreBill);
+
+    /**
+     * 新增店铺帐单记录
+     *
+     * @param fsStoreBill 店铺帐单记录
+     * @return 结果
+     */
+    public int insertFsStoreBill(FsStoreBillScrm fsStoreBill);
+
+    /**
+     * 修改店铺帐单记录
+     *
+     * @param fsStoreBill 店铺帐单记录
+     * @return 结果
+     */
+    public int updateFsStoreBill(FsStoreBillScrm fsStoreBill);
+
+    /**
+     * 删除店铺帐单记录
+     *
+     * @param billId 店铺帐单记录主键
+     * @return 结果
+     */
+    public int deleteFsStoreBillByBillId(Long billId);
+
+    /**
+     * 批量删除店铺帐单记录
+     *
+     * @param billIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteFsStoreBillByBillIds(Long[] billIds);
+
+    @Select({"<script> " +
+                "select sb.*,fs.store_name name from fs_store_bill_scrm sb LEFT JOIN fs_store_scrm fs ON fs.store_id=sb.store_id "+
+            "<where>  \n" +
+            "            <if test=\"billId != null \"> and sb.bill_id = #{billId}</if>\n" +
+            "            <if test=\"storeId != null \"> and sb.store_id = #{storeId}</if>\n" +
+            "            <if test=\"title != null  and title != ''\"> and sb.title = #{title}</if>\n" +
+            "            <if test=\"money != null \"> and sb.money = #{money}</if>\n" +
+            "            <if test=\"storeName != null \"> and  fs.store_name like concat('%', #{storeName}, '%')</if>\n" +
+            "            <if test=\"balance != null \"> and sb.balance = #{balance}</if>\n" +
+            "            <if test=\"billType != null \"> and sb.bill_type = #{billType}</if>\n" +
+            "            <if test=\"businessId != null  and businessId != ''\"> and sb.business_id = #{businessId}</if>\n" +
+            "            <if test=\"sTime != null \">  and DATE(sb.create_time) &gt;= DATE(#{sTime})</if>\n" +
+            "            <if test=\"eTime != null \">  and DATE(sb.create_time) &lt;= DATE(#{eTime})</if>\n" +
+            "        </where>"+
+            "order by sb.bill_id desc "+
+            "</script>"})
+    List<FsStoreBillVO> selectFsStoreBillListVO(FsStoreBillParam fsStoreBill);
+}

+ 89 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreExtractScrmMapper.java

@@ -0,0 +1,89 @@
+package com.fs.hisStore.mapper;
+
+import com.fs.hisStore.domain.FsStoreExtractScrm;
+import com.fs.his.vo.FsStoreExtractVO;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+
+/**
+ * 店铺提现管理Mapper接口
+ *
+ * @author fs
+ * @date 2023-06-25
+ */
+public interface FsStoreExtractScrmMapper
+{
+    /**
+     * 查询店铺提现管理
+     *
+     * @param extractId 店铺提现管理主键
+     * @return 店铺提现管理
+     */
+    public FsStoreExtractScrm selectFsStoreExtractByExtractId(String extractId);
+
+    /**
+     * 查询店铺提现管理列表
+     *
+     * @param fsStoreExtract 店铺提现管理
+     * @return 店铺提现管理集合
+     */
+    public List<FsStoreExtractScrm> selectFsStoreExtractList(FsStoreExtractScrm fsStoreExtract);
+
+    /**
+     * 新增店铺提现管理
+     *
+     * @param fsStoreExtract 店铺提现管理
+     * @return 结果
+     */
+    public int insertFsStoreExtract(FsStoreExtractScrm fsStoreExtract);
+
+    /**
+     * 修改店铺提现管理
+     *
+     * @param fsStoreExtract 店铺提现管理
+     * @return 结果
+     */
+    public int updateFsStoreExtract(FsStoreExtractScrm fsStoreExtract);
+
+    /**
+     * 删除店铺提现管理
+     *
+     * @param extractId 店铺提现管理主键
+     * @return 结果
+     */
+    public int deleteFsStoreExtractByExtractId(String extractId);
+
+    /**
+     * 批量删除店铺提现管理
+     *
+     * @param extractIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteFsStoreExtractByExtractIds(String[] extractIds);
+
+    @Select({"<script> " +
+            "select se.*,fs.store_name name from fs_store_extract se LEFT JOIN fs_store fs ON fs.store_id= se.store_id"+
+            "<where>  \n" +
+            "            <if test=\"storeId != null  and storeId != ''\"> and se.store_id = #{storeId}</if>\n" +
+            "            <if test=\"realName != null  and realName != ''\"> and se.real_name like concat('%', #{realName}, '%')</if>\n" +
+            "            <if test=\"extractType != null  and extractType != ''\"> and se.extract_type = #{extractType}</if>\n" +
+            "            <if test=\"bankCode != null  and bankCode != ''\"> and se.bank_code = #{bankCode}</if>\n" +
+            "            <if test=\"bankAddress != null  and bankAddress != ''\"> and se.bank_address = #{bankAddress}</if>\n" +
+            "            <if test=\"alipayCode != null  and alipayCode != ''\"> and se.alipay_code = #{alipayCode}</if>\n" +
+            "            <if test=\"extractPrice != null \"> and se.extract_price = #{extractPrice}</if>\n" +
+            "            <if test=\"mark != null  and mark != ''\"> and se.mark = #{mark}</if>\n" +
+            "            <if test=\"balance != null \"> and se.balance = #{balance}</if>\n" +
+            "            <if test=\"failMsg != null  and failMsg != ''\"> and se.fail_msg = #{failMsg}</if>\n" +
+            "            <if test=\"failTime != null \"> and  DATE(se.fail_time)= #{failTime}</if>\n" +
+            "            <if test=\"status != null \"> and se.status = #{status}</if>\n" +
+            "            <if test=\"createTime != null \"> and  DATE(se.create_time) = #{createTime}</if>"+
+            "            <if test=\"wechat != null  and wechat != ''\"> and se.wechat = #{wechat}</if>\n" +
+            "            <if test=\"isDel != null \"> and se.is_del = #{isDel}</if>\n" +
+            "            <if test=\"beginTime != null \">  and DATE(se.create_time) &gt;= DATE(#{beginTime})</if>\n" +
+            "            <if test=\"endTime != null \">  and DATE(se.create_time) &lt;= DATE(#{endTime})</if>\n" +
+            "        </where>"+
+            " order by extract_id desc"+
+            "</script>"})
+    List<FsStoreExtractVO> selectFsStoreExtractListVO(FsStoreExtractScrm fsStoreExtract);
+}

+ 62 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreOrderBillLogScrmMapper.java

@@ -0,0 +1,62 @@
+package com.fs.hisStore.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.hisStore.domain.FsStoreOrderBillLogScrm;
+
+import java.util.List;
+
+/**
+ * 订单开票记录Mapper接口
+ *
+ * @author fs
+ * @date 2025-01-07
+ */
+public interface FsStoreOrderBillLogScrmMapper extends BaseMapper<FsStoreOrderBillLogScrm> {
+    /**
+     * 查询订单开票记录
+     *
+     * @param id 订单开票记录主键
+     * @return 订单开票记录
+     */
+    public FsStoreOrderBillLogScrm selectFsStoreOrderBillLogById(Long id);
+
+    /**
+     * 查询订单开票记录列表
+     *
+     * @param fsStoreOrderBillLog 订单开票记录
+     * @return 订单开票记录集合
+     */
+    public List<FsStoreOrderBillLogScrm> selectFsStoreOrderBillLogList(FsStoreOrderBillLogScrm fsStoreOrderBillLog);
+
+    /**
+     * 新增订单开票记录
+     *
+     * @param fsStoreOrderBillLog 订单开票记录
+     * @return 结果
+     */
+    public int insertFsStoreOrderBillLog(FsStoreOrderBillLogScrm fsStoreOrderBillLog);
+
+    /**
+     * 修改订单开票记录
+     *
+     * @param fsStoreOrderBillLog 订单开票记录
+     * @return 结果
+     */
+    public int updateFsStoreOrderBillLog(FsStoreOrderBillLogScrm fsStoreOrderBillLog);
+
+    /**
+     * 删除订单开票记录
+     *
+     * @param id 订单开票记录主键
+     * @return 结果
+     */
+    public int deleteFsStoreOrderBillLogById(Long id);
+
+    /**
+     * 批量删除订单开票记录
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteFsStoreOrderBillLogByIds(Long[] ids);
+}

+ 5 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreOrderItemScrmMapper.java

@@ -1,6 +1,8 @@
 package com.fs.hisStore.mapper;
 
 import java.util.List;
+
+import com.fs.his.vo.FsStoreOrderItemListDVO;
 import com.fs.hisStore.domain.FsStoreOrderItemScrm;
 import com.fs.hisStore.param.FsStoreOrderParam;
 import com.fs.hisStore.vo.FsStoreOrderItemExportVO;
@@ -224,4 +226,7 @@ public interface FsStoreOrderItemScrmMapper
 
     @Update("update fs_store_order_item_scrm set json_info=#{jsonInfo} where order_id=#{orderId} ")
     int updateJsonInfo(FsStoreOrderItemScrm fsStoreOrderItem);
+
+    @Select("select product_id,json_info,num from fs_store_order_item_scrm where order_id=#{orderId}")
+    List<FsStoreOrderItemListDVO> selectFsStoreOrderItemListDVOByOrderId(Long orderId);
 }

+ 62 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreOrderLogsScrmMapper.java

@@ -0,0 +1,62 @@
+package com.fs.hisStore.mapper;
+
+import com.fs.hisStore.domain.FsStoreOrderLogsScrm;
+
+import java.util.List;
+
+/**
+ * 订单操作记录Mapper接口
+ *
+ * @author fs
+ * @date 2023-06-13
+ */
+public interface FsStoreOrderLogsScrmMapper
+{
+    /**
+     * 查询订单操作记录
+     *
+     * @param logsId 订单操作记录主键
+     * @return 订单操作记录
+     */
+    public FsStoreOrderLogsScrm selectFsStoreOrderLogsByLogsId(String logsId);
+
+    /**
+     * 查询订单操作记录列表
+     *
+     * @param fsStoreOrderLogs 订单操作记录
+     * @return 订单操作记录集合
+     */
+    public List<FsStoreOrderLogsScrm> selectFsStoreOrderLogsList(FsStoreOrderLogsScrm fsStoreOrderLogs);
+
+    /**
+     * 新增订单操作记录
+     *
+     * @param fsStoreOrderLogs 订单操作记录
+     * @return 结果
+     */
+    public int insertFsStoreOrderLogs(FsStoreOrderLogsScrm fsStoreOrderLogs);
+
+    /**
+     * 修改订单操作记录
+     *
+     * @param fsStoreOrderLogs 订单操作记录
+     * @return 结果
+     */
+    public int updateFsStoreOrderLogs(FsStoreOrderLogsScrm fsStoreOrderLogs);
+
+    /**
+     * 删除订单操作记录
+     *
+     * @param logsId 订单操作记录主键
+     * @return 结果
+     */
+    public int deleteFsStoreOrderLogsByLogsId(String logsId);
+
+    /**
+     * 批量删除订单操作记录
+     *
+     * @param logsIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteFsStoreOrderLogsByLogsIds(String[] logsIds);
+}

+ 152 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreOrderScrmMapper.java

@@ -8,6 +8,8 @@ import com.alibaba.fastjson.JSONObject;
 import com.fs.api.param.OrderListParam;
 import com.fs.api.vo.OrderListVO;
 import com.fs.company.param.CompanyStatisticsParam;
+import com.fs.his.domain.FsStoreOrder;
+import com.fs.his.vo.FsStoreOrderExcelVO;
 import com.fs.hisStore.domain.FsStoreOrderScrm;
 import com.fs.hisStore.domain.FsStoreOrderItemScrm;
 import com.fs.hisStore.domain.ReportScrm;
@@ -1057,4 +1059,154 @@ public interface FsStoreOrderScrmMapper
     FsStoreOrderScrm selectLastByCustomerId(@Param("customerId")Long customerId);
 
     List<Map<String, Object>> selectFsStoreProductCountsByDept(Map<String, Object> map);
+
+    @Select({"<script> " +
+            "select so.*,st.store_name,us.nick_name,us.phone,d.doctor_name,p.patient_name,p.prescribe_code,c.company_name,cu.nick_name company_user_name,cts.name as schedule_name,po.product_cost_price total_cost_money,po.inquiry_cost_price inquiry_money,po.total_cost_price,po.cost_discount_money inquiryDiscountMoney, total_money,p.diagnose " +
+            " FROM fs_store_order_scrm so LEFT JOIN fs_store_scrm st ON so.store_id =st.store_id " +
+            " LEFT JOIN fs_user us ON us.user_id=so.user_id " +
+            " LEFT JOIN fs_prescribe p ON p.prescribe_id =so.prescribe_id " +
+            " LEFT JOIN fs_doctor d ON p.doctor_id= d.doctor_id  " +
+            " LEFT JOIN company c on c.company_id =so.company_id " +
+            " LEFT JOIN company_user cu on cu.user_id=so.company_user_id  " +
+            " left join company_tcm_schedule cts on cts.id = so.schedule_id " +
+            " left join fs_package_order po on po.order_id = so.package_order_id " +
+            " WHERE so.is_del=0 "+
+            "            <if test=\"maps.packageSecondName != null and maps.packageSecondName != '' \"> and so.package_second_name like concat('%', #{maps.packageSecondName}, '%')</if>"+
+            "            <if test=\"maps.storeId != null \"> and so.store_id = #{maps.storeId}</if>\n" +
+            "            <if test=\"maps.orderCode != null  and maps.orderCode != ''\"> and so.order_code = #{maps.orderCode}</if>\n" +
+            "            <if test=\"maps.prescribeCode != null  and maps.prescribeCode != ''\"> and p.prescribe_code = #{maps.prescribeCode}</if>\n" +
+            "            <if test=\"maps.userName != null  and maps.userName != ''\"> and so.user_name like concat('%', #{maps.userName}, '%')</if>\n" +
+            "            <if test=\"maps.userPhone != null  and maps.userPhone != ''\"> and so.user_phone = #{maps.userPhone}</if>\n" +
+            "            <if test=\"maps.totalNum != null  and maps.totalNum != ''\"> and so.total_num = #{maps.totalNum}</if>\n" +
+            "            <if test=\"maps.totalPrice != null \"> and so.total_price = #{maps.totalPrice}</if>\n" +
+            "            <if test=\"maps.status != null \"> and so.status = #{maps.status}</if>\n" +
+            "            <if test=\"maps.source != null \"> and so.source = #{maps.source}</if>\n" +
+            "            <if test=\"maps.refundStatus != null  and maps.refundStatus != ''\"> and so.refund_status = #{maps.refundStatus}</if>\n" +
+            "            <if test=\"maps.refundExplain != null  and maps.refundExplain != ''\"> and so.refund_explain = #{maps.refundExplain}</if>\n" +
+            "            <if test=\"maps.deliverySn != null  and maps.deliverySn != ''\"> and so.delivery_sn = #{maps.deliverySn}</if>\n" +
+            "            <if test=\"maps.shippingType != null \"> and so.shipping_type = #{maps.shippingType}</if>\n" +
+            "            <if test=\"maps.isChannel != null  and maps.isChannel != ''\"> and so.is_channel = #{maps.isChannel}</if>\n" +
+            "            <if test=\"maps.isPrescribe != null \"> and so.is_prescribe = #{maps.isPrescribe}</if>\n" +
+            "            <if test=\"maps.prescribeId != null \"> and so.prescribe_id = #{maps.prescribeId}</if>\n" +
+            "            <if test=\"maps.companyUserId != null \"> and so.company_user_id = #{maps.companyUserId}</if>\n" +
+            "            <if test=\"maps.sTime != null \">  and DATE(so.create_time) &gt;= DATE(#{maps.sTime})</if>\n" +
+            "            <if test=\"maps.eTime != null \">  and DATE(so.create_time) &lt;= DATE(#{maps.eTime})</if>\n" +
+            "            <if test=\"maps.paysTime != null \">  and DATE(so.pay_time) &gt;= DATE(#{maps.paysTime})</if>\n" +
+            "            <if test=\"maps.payeTime != null \">  and DATE(so.pay_time) &lt;= DATE(#{maps.payeTime})</if>\n" +
+            "            <if test=\"maps.orderCreateType != null \"> and so.order_create_type = #{maps.orderCreateType}</if>"+
+            "            <if test=\"maps.patientName != null \"> and p.patient_name like concat('%', #{maps.patientName}, '%')</if>"+
+            "            <if test=\"maps.doctorName != null \"> and d.doctor_name like concat('%', #{maps.doctorName}, '%')</if>"+
+            "            <if test=\"maps.orderType != null \"> and so.order_type = #{maps.orderType}</if>"+
+            "            <if test=\"maps.deliverySendsTime != null \">  and DATE(so.delivery_send_time) &gt;= DATE(#{maps.deliverySendsTime})</if>\n" +
+            "            <if test=\"maps.deliverySendeTime != null \">  and DATE(so.delivery_send_time) &lt;= DATE(#{maps.deliverySendeTime})</if>\n" +
+            "            <if test=\"maps.deliveryImportsTime != null \">  and DATE(so.delivery_import_time) &gt;= DATE(#{maps.deliveryImportsTime})</if>\n" +
+            "            <if test=\"maps.deliveryImporteTime != null \">  and DATE(so.delivery_import_time) &lt;= DATE(#{maps.deliveryImporteTime})</if>\n" +
+            "            <if test=\"maps.tuisTime != null \">  and DATE(so.tui_money_time) &gt;= DATE(#{maps.tuisTime})</if>\n" +
+            "            <if test=\"maps.tuieTime != null \">  and DATE(so.tui_money_time) &lt;= DATE(#{maps.tuieTime})</if>\n" +
+            "            <if test=\"maps.companyUserNickName != null and  maps.companyUserNickName !='' \"> and cu.nick_name like concat( #{maps.companyUserNickName}, '%')"+
+            "</if>" +
+            "<if test = 'maps.companyId != null  and   maps.companyId != \"-1\" '> " +
+            "and so.company_id =#{maps.companyId} " +
+            "</if>" +
+            "<if test = ' maps.companyId == \"-1\" '> " +
+            "and so.company_id is null " +
+            "</if>" +
+            "<if test=\"maps.userId != null  \"> and so.user_id = #{maps.userId}</if>\n" +
+            "<if test = 'maps.deliveryStatus != null    '> " +
+            "and so.delivery_status =#{maps.deliveryStatus} " +
+            "</if>" +
+            "<if test = 'maps.deliveryPayStatus != null    '> " +
+            "and so.delivery_pay_status =#{maps.deliveryPayStatus} " +
+            "</if>" +
+            "<if test = 'maps.tuiMoneyStatus != null    '> " +
+            "and so.tui_money_status =#{maps.tuiMoneyStatus} " +
+            "</if>" +
+            "<if test = 'maps.deptId != null    '> " +
+            "  AND (so.dept_id = #{maps.deptId} OR so.dept_id IN ( SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors) )) " +
+            "</if>" +
+            "<if test=\"maps.packageName != null and maps.packageName != '' \"> and so.package_name like concat('%', #{maps.packageName}, '%')</if> " +
+            "<if test = 'maps.payType != null      '> " +
+            "and so.pay_type IN " +
+            "<foreach collection=\"maps.payType.split(',')\"  item='item' index='index'  open='(' separator=',' close=')'> #{item} </foreach>"+
+            "</if>" +
+            "<if test = 'maps.scheduleId != null  and  maps.scheduleId != \"-1\"   '> " +
+            "and so.schedule_id IN " +
+            "<foreach collection=\"maps.scheduleId.split(',')\"  item='item' index='index'  open='(' separator=',' close=')'> #{item} </foreach>"+
+            "</if>" +
+            "<if test = 'maps.scheduleId == \"-1\"   '> " +
+            "and so.schedule_id is null " +
+            "</if>" +
+            "<if test = 'maps.orderBuyType != null  and  maps.orderBuyType != \"-1\"   '> " +
+            "and so.order_buy_type IN " +
+            "<foreach collection=\"maps.orderBuyType.split(',')\"  item='item' index='index'  open='(' separator=',' close=')'> #{item} </foreach>"+
+            "</if>" +
+            "<if test = 'maps.orderBuyType == \"-1\"   '> " +
+            "and so.order_buy_type is null " +
+            "</if>" +
+            "<if test = 'maps.orderChannel != null  and  maps.orderChannel != \"-1\"   '> " +
+            "and so.order_channel IN " +
+            "<foreach collection=\"maps.orderChannel.split(',')\"  item='item' index='index'  open='(' separator=',' close=')'> #{item} </foreach>"+
+            "</if>" +
+            "<if test = 'maps.orderChannel == \"-1\"   '> " +
+            "and so.order_channel is null " +
+            "</if>" +
+            "<if test = 'maps.qwSubject != null  and  maps.qwSubject != \"-1\"   '> " +
+            "and so.qw_subject IN " +
+            "<foreach collection=\"maps.qwSubject.split(',')\"  item='item' index='index'  open='(' separator=',' close=')'> #{item} </foreach>"+
+            "</if>" +
+            "<if test = 'maps.qwSubject == \"-1\"   '> " +
+            "and so.qw_subject is null " +
+            "</if>" +
+            " ${maps.params.dataScope} "+
+            " ORDER BY so.order_id desc " +
+            " limit 30000 "+
+            "</script>"})
+    List<FsStoreOrderExcelVO> selectFsStoreOrderExcelListVO(@Param("maps")FsStoreOrderParam fsStoreOrder);
+
+    @Update({"<script> " +
+            " update fs_store_order_scrm "+
+            "<trim prefix=\"SET\" suffixOverrides=\",\">\n" +
+            "            <if test=\"storeId != null\">store_id = #{storeId},</if>\n" +
+            "            <if test=\"userId != null and userId != ''\">user_id = #{userId},</if>\n" +
+            "            <if test=\"userName != null and userName != ''\">user_name = #{userName},</if>\n" +
+            "            <if test=\"userPhone != null and userPhone != ''\">user_phone = #{userPhone},</if>\n" +
+            "            <if test=\"userAddress != null and userAddress != ''\">user_address = #{userAddress},</if>\n" +
+            "            <if test=\"cartId != null and cartId != ''\">cart_id = #{cartId},</if>\n" +
+            "            <if test=\"totalNum != null and totalNum != ''\">total_num = #{totalNum},</if>\n" +
+            "            <if test=\"totalPrice != null\">total_price = #{totalPrice},</if>\n" +
+            "            <if test=\"payPrice != null\">pay_price = #{payPrice},</if>\n" +
+            "            <if test=\"payMoney != null\">pay_money = #{payMoney},</if>\n" +
+            "            <if test=\"isPay != null and isPay != ''\">is_pay = #{isPay},</if>\n" +
+            "            <if test=\"payTime != null\">pay_time = #{payTime},</if>\n" +
+            "            <if test=\"payType != null and payType != ''\">pay_type = #{payType},</if>\n" +
+            "            <if test=\"createTime != null\">create_time = #{createTime},</if>\n" +
+            "            <if test=\"updateTime != null\">update_time = #{updateTime},</if>\n" +
+            "            <if test=\"status != null\">status = #{status},</if>\n" +
+            "            <if test=\"refundStatus != null\">refund_status = #{refundStatus},</if>\n" +
+            "            <if test=\"refundImg != null\">refund_img = #{refundImg},</if>\n" +
+            "            <if test=\"refundExplain != null\">refund_explain = #{refundExplain},</if>\n" +
+            "            <if test=\"refundTime != null\">refund_time = #{refundTime},</if>\n" +
+            "            <if test=\"refundReason != null\">refund_reason = #{refundReason},</if>\n" +
+            "            <if test=\"refundMoney != null\">refund_money = #{refundMoney},</if>\n" +
+            "            <if test=\"deliveryCode != null\">delivery_code = #{deliveryCode},</if>\n" +
+            "            <if test=\"deliveryName != null\">delivery_name = #{deliveryName},</if>\n" +
+            "            <if test=\"deliverySn != null\">delivery_sn = #{deliverySn},</if>\n" +
+            "            <if test=\"remark != null\">remark = #{remark},</if>\n" +
+            "            <if test=\"isDel != null\">is_del = #{isDel},</if>\n" +
+            "            <if test=\"costPrice != null\">cost_price = #{costPrice},</if>\n" +
+            "            <if test=\"verifyCode != null\">verify_code = #{verifyCode},</if>\n" +
+            "            <if test=\"shippingType != null\">shipping_type = #{shippingType},</if>\n" +
+            "            <if test=\"isChannel != null\">is_channel = #{isChannel},</if>\n" +
+            "            <if test=\"isPrescribe != null\">is_prescribe = #{isPrescribe},</if>\n" +
+            "            <if test=\"prescribeId != null\">prescribe_id = #{prescribeId},</if>\n" +
+            "            <if test=\"finishTime != null\">finish_time = #{finishTime},</if>\n" +
+            "            <if test=\"deliveryTime != null\">delivery_time = #{deliveryTime},</if>\n" +
+            "            <if test=\"tuiMoney != null\">tui_money = #{tuiMoney},</if>\n" +
+            "            <if test=\"tuiMoneyStatus != null\">tui_money_status = #{tuiMoneyStatus},</if>\n" +
+            "            <if test=\"tuiUserId != null\">tui_user_id = #{tuiUserId},</if>\n" +
+            "            <if test=\"orderCreateType != null\">order_create_type = #{orderCreateType},</if>\n" +
+            "        </trim>\n" +
+            "        where order_code = #{orderCode}"+
+            "</script>"})
+    int updateFsStoreOrderByOrderCode(FsStoreOrderScrm fsStoreOrder);
 }

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

@@ -347,6 +347,9 @@ public interface FsStorePaymentScrmMapper
     @Select("select * from fs_store_payment_scrm where trade_no=#{tradeNo}")
     FsStorePaymentScrm selectFsStorePaymentByTradeNo(String tradeNo);
 
+    @Select("select * from fs_store_payment_scrm where business_type=#{type} and  business_order_id=#{business_order_id} and status=1")
+    List<FsStorePaymentScrm> selectFsStorePaymentByPay(@Param("type")int type, @Param("business_order_id") Long business_order_id);
+
     @Select("select * from fs_store_payment_scrm where pay_code=#{payCode}")
     FsStorePaymentScrm selectFsStorePaymentByPaymentCode(String payCode);
 }

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

@@ -130,4 +130,12 @@ public interface FsStoreProductAttrValueScrmMapper
             " order by v.id desc "+
             "</script>"})
     List<FsStoreTuiProductAttrValueVO> selectStoreTuiProductAttrValueVOList(@Param("maps")FsStoreTuiProductAttrValueParam param);
+
+    @Update({"<script> " +
+            "UPDATE fs_store_product_attr_value_scrm SET price=price*#{price} , ot_price=ot_price*#{price} WHERE product_id in"+
+            "<foreach item=\"id\" collection=\"ids\" open=\"(\" separator=\",\" close=\")\">\n" +
+            "            #{id}\n" +
+            "        </foreach>"+
+            "</script>"})
+    void updateFsStoreProductAttrValuePrice(List<Long> ids, double v);
 }

+ 27 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreProductCategoryScrmMapper.java

@@ -1,7 +1,11 @@
 package com.fs.hisStore.mapper;
 
 import java.util.List;
+
+import com.fs.his.vo.OptionsVO;
 import com.fs.hisStore.domain.FsStoreProductCategoryScrm;
+import com.fs.hisStore.vo.FsStoreProductCategoryVO;
+import com.fs.hisStore.vo.FsStoreProductCategorysVO;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
@@ -75,4 +79,27 @@ public interface FsStoreProductCategoryScrmMapper
             " order by c.sort asc "+
             "</script>"})
     List<FsStoreProductCategoryScrm> selectFsStoreProductCategoryListQuery(@Param("maps") FsStoreProductCategoryScrm param);
+
+    @Select("select * from fs_store_product_category_scrm where pid=0")
+    List<FsStoreProductCategoryScrm> getPid();
+
+    @Select("select * from fs_store_product_category_scrm ")
+    List<FsStoreProductCategorysVO> selectFsStoreProductCategorysVOList();
+
+    @Select({"<script> " +
+            "SELECT f1.*,f2.cate_name pname FROM fs_store_product_category_scrm f1 LEFT JOIN fs_store_product_category_scrm f2 on f1.pid=f2.cate_id \n" +
+            "WHERE   f1.is_del=0 "+
+            " <if test=\"pid != null \"> and f1.pid = #{pid}</if>\n" +
+            "            <if test=\"cateName != null  and cateName != ''\"> and f1.cate_name like concat('%', #{cateName}, '%')</if>\n" +
+            "            <if test=\"sort != null \"> and f1.sort = #{sort}</if>\n" +
+            "            <if test=\"pic != null  and pic != ''\"> f1.and pic = #{pic}</if>\n" +
+            "            <if test=\"isShow != null \"> and f1.is_show = #{isShow}</if>\n" +
+            "            <if test=\"isDel != null  and isDel != ''\"> and f1.is_del = #{isDel}</if>\n" +
+            "       order by f1.sort,f1.cate_id desc"+
+            "</script>"})
+    List<FsStoreProductCategoryVO> selectFsStoreProductCategoryListVO(FsStoreProductCategoryScrm fsStoreProductCategory);
+
+    @Select("select cate_id dict_value, cate_name dict_label,is_del status from fs_store_product_category_scrm WHERE pid = 0 and is_del=0 ")
+    List<OptionsVO> selectFsStoreProductPidList();
+
 }

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

@@ -2,6 +2,12 @@ package com.fs.hisStore.mapper;
 
 import java.util.List;
 
+import com.fs.common.annotation.Log;
+import com.fs.common.enums.BusinessType;
+import com.fs.his.param.FsStoreProductListSParam;
+import com.fs.his.vo.FsStoreProductListSVO;
+import com.fs.his.vo.OptionsVO;
+import com.fs.hisStore.domain.FsStoreProductRuleScrm;
 import com.fs.statis.dto.ModifyMoreDTO;
 import com.fs.hisStore.domain.FsStoreProductScrm;
 import com.fs.hisStore.param.FsStoreProductQueryParam;
@@ -207,4 +213,68 @@ public interface FsStoreProductScrmMapper
 
 
     void batchModify(ModifyMoreDTO modifyMoreDTO);
+
+    @Select({"<script> " +
+            "select p.*,pc.cate_name,st.store_name  from fs_store_product_scrm p left join fs_store_product_category_scrm pc on p.cate_id=pc.cate_id LEFT JOIN fs_store_scrm st ON st.store_id=p.store_id  " +
+            "where 1=1 " +
+            "<if test = 'maps.productName != null and  maps.productName !=\"\"    '> " +
+            "and p.product_name like CONCAT('%',#{maps.productName},'%') " +
+            "</if>" +
+            "<if test = 'maps.cateId != null    '> " +
+            "and (pc.cate_id =#{maps.cateId} or pc.pid=#{maps.cateId} )" +
+            "</if>" +
+            "<if test = 'maps.productType != null    '> " +
+            "and p.product_type =#{maps.productType} " +
+            "</if>" +
+            "<if test = 'maps.isShow != null    '> " +
+            "and p.is_show =#{maps.isShow} " +
+            "</if>" +
+            "<if test = 'maps.storeId != null    '> " +
+            "and p.store_id =#{maps.storeId} " +
+            "</if>" +
+            "<if test = 'maps.barCode != null    '> " +
+            "and p.product_id in(SELECT product_id FROM fs_store_product_attr_value_scrm WHERE bar_code =#{maps.barCode}) " +
+            "</if>" +
+            " order by p.product_id desc " +
+            "</script>"})
+    List<FsStoreProductListSVO> selectFsStoreProductListSVO(@Param("maps")FsStoreProductListSParam fsStoreProduct);
+
+    @Select({"<script> " +
+            "select p.product_id  from fs_store_product_scrm p left join fs_store_product_category_scrm pc on p.cate_id=pc.cate_id  " +
+            "where 1=1 " +
+            "<if test = 'maps.productName != null and  maps.productName !=\"\"    '> " +
+            "and p.product_name like CONCAT('%',#{maps.productName},'%') " +
+            "</if>" +
+            "<if test = 'maps.cateId != null    '> " +
+            "and (pc.cate_id =#{maps.cateId} or pc.pid=#{maps.cateId} )" +
+            "</if>" +
+            "<if test = 'maps.productType != null    '> " +
+            "and p.product_type =#{maps.productType} " +
+            "</if>" +
+            "<if test = 'maps.isShow != null    '> " +
+            "and p.is_show =#{maps.isShow} " +
+            "</if>" +
+            "<if test = 'maps.storeId != null    '> " +
+            "and p.store_id =#{maps.storeId} " +
+            "</if>" +
+            "<if test = 'maps.barCode != null    '> " +
+            "and p.product_id in(SELECT product_id FROM fs_store_product_attr_value_scrm WHERE bar_code =#{maps.barCode}) " +
+            "</if>" +
+            " order by p.product_id desc " +
+            "</script>"})
+    List<Long> selectFsStoreProductIdList(@Param("maps")FsStoreProductScrm fsStoreProduct);
+
+    @Update({"<script> " +
+            "UPDATE fs_store_product_scrm SET price=price*#{price} , ot_price=ot_price*#{price} WHERE product_id in" +
+            "<foreach item=\"id\" collection=\"ids\" open=\"(\" separator=\",\" close=\")\">\n" +
+            "            #{id}\n" +
+            "        </foreach>" +
+            "</script>"})
+    int updateFsStoreProductPrice(List<Long> ids, double v);
+
+    @Select("select store_id dictValue,store_name dictLabel from fs_store_scrm ")
+    List<OptionsVO> selectFsStoreProductStoreList();
+
+    @Select("select * FROM fs_store_product_rule_scrm WHERE is_del=0")
+    List<FsStoreProductRuleScrm> selectFsStoreProductRuleList();
 }

+ 73 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreScrmMapper.java

@@ -0,0 +1,73 @@
+package com.fs.hisStore.mapper;
+
+import com.fs.hisStore.domain.FsStoreScrm;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+
+import java.util.List;
+
+/**
+ * 店铺管理Mapper接口
+ *
+ * @author fs
+ * @date 2023-06-15
+ */
+public interface FsStoreScrmMapper
+{
+    /**
+     * 查询店铺管理
+     *
+     * @param storeId 店铺管理主键
+     * @return 店铺管理
+     */
+    public FsStoreScrm selectFsStoreByStoreId(Long storeId);
+
+    /**
+     * 查询店铺管理列表
+     *
+     * @param FsStoreScrm 店铺管理
+     * @return 店铺管理集合
+     */
+    public List<FsStoreScrm> selectFsStoreList(FsStoreScrm FsStoreScrm);
+
+    /**
+     * 新增店铺管理
+     *
+     * @param FsStoreScrm 店铺管理
+     * @return 结果
+     */
+    public int insertFsStore(FsStoreScrm FsStoreScrm);
+
+    /**
+     * 修改店铺管理
+     *
+     * @param FsStoreScrm 店铺管理
+     * @return 结果
+     */
+    public int updateFsStore(FsStoreScrm FsStoreScrm);
+
+    /**
+     * 删除店铺管理
+     *
+     * @param storeId 店铺管理主键
+     * @return 结果
+     */
+    public int deleteFsStoreByStoreId(Long storeId);
+
+    /**
+     * 批量删除店铺管理
+     *
+     * @param storeIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteFsStoreByStoreIds(Long[] storeIds);
+    @Update("UPDATE fs_store_scrm SET is_audit=#{isAudit} WHERE store_id=#{storeId}")
+    int updateFsStoreAudit(@Param("storeId") Long storeId, @Param("isAudit") Integer isAudit);
+
+    @Select("select * from fs_store_scrm where account=#{username}")
+    FsStoreScrm selectFsStoreByAccount(String username);
+
+    @Select("SELECT * from fs_store_scrm WHERE   FIND_IN_SET(store_id, (SELECT store_ids FROM fs_doctor where doctor_id=#{doctorId}))")
+    List<FsStoreScrm> selectFsStoreListByDoctorId(Long doctorId);
+}

+ 49 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/SysOperLogScrmMapper.java

@@ -0,0 +1,49 @@
+package com.fs.hisStore.mapper;
+
+import com.fs.hisStore.domain.SysOperLogScrm;
+
+import java.util.List;
+
+/**
+ * 操作日志 数据层
+ *
+
+ */
+public interface SysOperLogScrmMapper
+{
+    /**
+     * 新增操作日志
+     *
+     * @param operLog 操作日志对象
+     */
+    public void insertOperlog(SysOperLogScrm operLog);
+
+    /**
+     * 查询系统操作日志集合
+     *
+     * @param operLog 操作日志对象
+     * @return 操作日志集合
+     */
+    public List<SysOperLogScrm> selectOperLogList(SysOperLogScrm operLog);
+
+    /**
+     * 批量删除系统操作日志
+     *
+     * @param operIds 需要删除的操作日志ID
+     * @return 结果
+     */
+    public int deleteOperLogByIds(Long[] operIds);
+
+    /**
+     * 查询操作日志详细
+     *
+     * @param operId 操作ID
+     * @return 操作日志对象
+     */
+    public SysOperLogScrm selectOperLogById(Long operId);
+
+    /**
+     * 清空操作日志
+     */
+    public void cleanOperLog();
+}

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

@@ -1,21 +1,147 @@
 package com.fs.hisStore.param;
 
+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 FsPrescribeParam implements Serializable
 {
-    private Long patientId;
     private Long orderId;
     private Boolean isAllergic;
     private Boolean isLiver;
     private Boolean isRenal;
-    private Boolean isLactation;
     private String chiefComplaint;
     private String nowIllness;
     private String historyIllness;
+    /** id */
+    private Long prescribeId;
+
+    /** 处方类型 1问诊 2订单 */
+    @Excel(name = "处方类型 1西药 2中药")
+    private Integer prescribeType;
+
+    /** 订单ID */
+    @Excel(name = "订单ID")
+    private Long inquiryOrderId;
+
+    /** 店铺订单ID */
+    @Excel(name = "店铺订单ID")
+    private Long storeOrderId;
+
+    /** 用户ID */
+    @Excel(name = "用户ID")
+    private Long userId;
+
+    /** 患者ID */
+    @Excel(name = "患者ID")
+    private Long patientId;
+
+    @Excel(name = "处⽅单ID", readConverterExp = "唯=⼀ID")
+    private String prescribeCode;
+
+    @Excel(name = "病情描述(主诉)")
+    private String patientDescs;
+
+
+    @Excel(name = "患者年龄")
+    private String patientAge;
+
+    @Excel(name = "患者姓名")
+    private String patientName;
+
+    @Excel(name = "体重")
+    private String weight;
+
+    @Excel(name = "是否有过敏史", readConverterExp = "传=值:是/否")
+    private String isHistoryAllergic;
+
+    /** 过敏史 */
+    @Excel(name = "过敏史")
+    private String historyAllergic;
+
+    @Excel(name = "肝功能是否异常", readConverterExp = "传=值:是/否")
+    private String liverUnusual;
+
+    @Excel(name = "肾功能是否异常", readConverterExp = "传=值:是/否")
+    private String renalUnusual;
+
+    @Excel(name = "是否是备孕/怀孕/哺乳期", readConverterExp = "是否是备孕/怀孕/哺乳期(传值:是")
+    private String isLactation;
+
+    @Excel(name = "患者电话")
+    private String patientTel;
+
+    @Excel(name = "患者性别(传数字,1男 2⼥)")
+    private String patientGender;
+
+    /** 复诊凭证 */
+    @Excel(name = "复诊凭证")
     private String recordPic;
 
+
+
+    /** 拒绝原因 */
+    @Excel(name = "拒绝原因")
+    private String auditReason;
+
+    /** 诊断 */
+    @Excel(name = "诊断")
+    private String diagnose;
+
+    /** 医生ID */
+    @Excel(name = "医生ID")
+    private Long doctorId;
+    @Excel(name = "医生姓名")
+    private String doctorName;
+    /** 医生ID */
+    @Excel(name = "药师ID")
+    private Long drugDoctorId;
+
+    @Excel(name = "状态 0未开 1已开")
+    private Integer status;
+
+    private String usageJson;
+
+    /** 审核时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date auditTime;
+
+    private String remark;
+
+    private Long storeId;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+
+    /** 更新时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date sTime;
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date eTime;
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date auditSTime;
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date auditETime;
+    private String orderStatus;
+
+    private String orderCode;
+
+    private Long companyId;
+
+    private Long companyUserId;
+
+    private Long taskId;//任务ID
+
 }

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

@@ -87,4 +87,6 @@ public class FsStoreOrderParam extends BaseEntity implements Serializable
      */
     private Integer paidStatus;
 
+    private Long storeId;
+
 }

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

@@ -145,4 +145,6 @@ public class FsStoreProductAddEditParam implements Serializable
         // 指定企业
     private String companyIds;
 
+    private Long storeId;
+
 }

+ 68 - 0
fs-service/src/main/java/com/fs/hisStore/param/PrescribeXyImgParam.java

@@ -0,0 +1,68 @@
+package com.fs.hisStore.param;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import com.fs.his.domain.FsPrescribeDrug;
+import com.fs.hisStore.domain.FsPrescribeDrugScrm;
+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<FsPrescribeDrugScrm> 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;
+}

+ 84 - 0
fs-service/src/main/java/com/fs/hisStore/param/PrescribeZyImgParam.java

@@ -0,0 +1,84 @@
+package com.fs.hisStore.param;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import com.fs.his.domain.FsPrescribeDrug;
+import com.fs.hisStore.domain.FsPrescribeDrugScrm;
+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<FsPrescribeDrugScrm> 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;
+}

+ 41 - 0
fs-service/src/main/java/com/fs/hisStore/service/IFsDataScrmService.java

@@ -0,0 +1,41 @@
+package com.fs.hisStore.service;
+
+import com.fs.his.dto.DataDTO;
+import com.fs.his.dto.inquiryOrderChartDTO;
+import com.fs.his.vo.*;
+
+import java.util.List;
+
+public interface IFsDataScrmService {
+
+
+    OrderDataVO getOrderData();
+
+    List<ChartDataVO> getOrderChartData();
+
+    List<DoctorChartVO> doctorChartData(Integer type);
+
+    List<ChartDataVO> storeOrderChart(DataDTO dto);
+
+    List<ChartDataVO> inquiryOrderChart(inquiryOrderChartDTO dto);
+
+    List<ChartDaVO> storeOrderChartStore(DataDTO dto);
+
+    List<ChartDaVO> inquiryOrderChartInq(inquiryOrderChartDTO dto);
+
+    List<ChartProdVO> ChartProdVO(DataDTO dto);
+
+    StoreOrderDataVO getStoreOrderData(Long id);
+
+    List<ChartDataVO> getStoreOrderChartData(Long loginUserStoreID);
+
+    List<DoctorChartVO> storeChartData(Integer type, Long loginUserStoreID);
+
+    List<ChartDataVO> getInquiryOrderChartData();
+
+    List<ChartDataVO> getDoctorInquiryOrderChartData(Long doctorId);
+
+    Long todayInquiryCount(Long doctorId);
+
+
+}

+ 63 - 0
fs-service/src/main/java/com/fs/hisStore/service/IFsMaterialGroupScrmStoreService.java

@@ -0,0 +1,63 @@
+package com.fs.hisStore.service;
+
+
+import com.fs.hisStore.domain.FsMaterialGroupScrm;
+
+import java.util.List;
+
+/**
+ * 素材分组Service接口
+ *
+ * @author fs
+ * @date 2023-07-06
+ */
+public interface IFsMaterialGroupScrmStoreService
+{
+    /**
+     * 查询素材分组
+     *
+     * @param groupId 素材分组主键
+     * @return 素材分组
+     */
+    public FsMaterialGroupScrm selectFsMaterialGroupByGroupId(Long groupId);
+
+    /**
+     * 查询素材分组列表
+     *
+     * @param fsMaterialGroup 素材分组
+     * @return 素材分组集合
+     */
+    public List<FsMaterialGroupScrm> selectFsMaterialGroupList(FsMaterialGroupScrm fsMaterialGroup);
+
+    /**
+     * 新增素材分组
+     *
+     * @param fsMaterialGroup 素材分组
+     * @return 结果
+     */
+    public int insertFsMaterialGroup(FsMaterialGroupScrm fsMaterialGroup);
+
+    /**
+     * 修改素材分组
+     *
+     * @param fsMaterialGroup 素材分组
+     * @return 结果
+     */
+    public int updateFsMaterialGroup(FsMaterialGroupScrm fsMaterialGroup);
+
+    /**
+     * 批量删除素材分组
+     *
+     * @param groupIds 需要删除的素材分组主键集合
+     * @return 结果
+     */
+    public int deleteFsMaterialGroupByGroupIds(Long[] groupIds);
+
+    /**
+     * 删除素材分组信息
+     *
+     * @param groupId 素材分组主键
+     * @return 结果
+     */
+    public int deleteFsMaterialGroupByGroupId(Long groupId);
+}

+ 62 - 0
fs-service/src/main/java/com/fs/hisStore/service/IFsMaterialScrmStoreService.java

@@ -0,0 +1,62 @@
+package com.fs.hisStore.service;
+
+import com.fs.hisStore.domain.FsMaterialScrm;
+
+import java.util.List;
+
+/**
+ * 素材库Service接口
+ *
+ * @author fs
+ * @date 2023-07-06
+ */
+public interface IFsMaterialScrmStoreService
+{
+    /**
+     * 查询素材库
+     *
+     * @param materialId 素材库主键
+     * @return 素材库
+     */
+    public FsMaterialScrm selectFsMaterialByMaterialId(Long materialId);
+
+    /**
+     * 查询素材库列表
+     *
+     * @param fsMaterial 素材库
+     * @return 素材库集合
+     */
+    public List<FsMaterialScrm> selectFsMaterialList(FsMaterialScrm fsMaterial);
+
+    /**
+     * 新增素材库
+     *
+     * @param fsMaterial 素材库
+     * @return 结果
+     */
+    public int insertFsMaterial(FsMaterialScrm fsMaterial);
+
+    /**
+     * 修改素材库
+     *
+     * @param fsMaterial 素材库
+     * @return 结果
+     */
+    public int updateFsMaterial(FsMaterialScrm fsMaterial);
+
+    /**
+     * 批量删除素材库
+     *
+     * @param materialIds 需要删除的素材库主键集合
+     * @return 结果
+     */
+    public int deleteFsMaterialByMaterialIds(Long[] materialIds);
+
+    /**
+     * 删除素材库信息
+     *
+     * @param materialId 素材库主键
+     * @return 结果
+     */
+    public int deleteFsMaterialByMaterialId(Long materialId);
+}

+ 107 - 0
fs-service/src/main/java/com/fs/hisStore/service/IFsPrescribeScrmStoreService.java

@@ -0,0 +1,107 @@
+package com.fs.hisStore.service;
+
+import com.fs.common.core.domain.R;
+import com.fs.his.domain.FsPackageOrder;
+import com.fs.his.domain.FsPrescribe;
+import com.fs.his.domain.FsPrescribeDrug;
+import com.fs.his.param.*;
+import com.fs.his.vo.*;
+
+import java.util.List;
+
+/**
+ * 处方Service接口
+ *
+ * @author fs
+ * @date 2023-06-13
+ */
+public interface IFsPrescribeScrmStoreService
+{
+    /**
+     * 查询处方
+     *
+     * @param prescribeId 处方主键
+     * @return 处方
+     */
+    public FsPrescribe selectFsPrescribeByPrescribeId(Long prescribeId);
+
+    /**
+     * 查询处方列表
+     *
+     * @param fsPrescribe 处方
+     * @return 处方集合
+     */
+    public List<FsPrescribe> selectFsPrescribeList(FsPrescribe fsPrescribe);
+
+    /**
+     * 新增处方
+     *
+     * @param fsPrescribe 处方
+     * @return 结果
+     */
+    public int insertFsPrescribe(FsPrescribe fsPrescribe);
+
+    /**
+     * 修改处方
+     *
+     * @param fsPrescribe 处方
+     * @return 结果
+     */
+    public int updateFsPrescribe(FsPrescribe fsPrescribe);
+
+    /**
+     * 批量删除处方
+     *
+     * @param prescribeIds 需要删除的处方主键集合
+     * @return 结果
+     */
+    public int deleteFsPrescribeByPrescribeIds(Long[] prescribeIds);
+
+    /**
+     * 删除处方信息
+     *
+     * @param prescribeId 处方主键
+     * @return 结果
+     */
+    public int deleteFsPrescribeByPrescribeId(Long prescribeId);
+
+    List<FsPrescribeListVO> selectFsPrescribeListVO(FsPrescribeParam fsPrescribe);
+
+    List<FsPrescribeListDVO> selectFsPrescribeListDVO(FsPrescribeListDParam param);
+
+    String getFsPrescribeZyImg(PrescribeZyImgParam prescribeZyImgParam);
+
+    String getFsPrescribeXyImg(PrescribeXyImgParam prescribeXyImgParam);
+
+    List<FsPrescribeListUVO> selectFsPrescribeListUVO(FsPrescribeListUParam param);
+
+    FsPrescribeVO selectFsPrescribeByPrescribeIdVO(Long prescribeId);
+
+    List<FsPrescribeDrug> selectFsPrescribeDrugByPrescribeIdVO(Long prescribeId);
+
+    void auditPrescribe();
+
+    R audit(FsPrescribeAuditParam param);
+
+     String PrescribeImg(Long prescribeId);
+
+    Long insertFsPrescribeByPackageOrder(FsPackageOrder packageOrder);
+
+    List<FsPrescribeExcelListVO> selectFsPrescribeExcelListVO(FsPrescribeParam fsPrescribe);
+
+    List<FsMessageFeedbackExportListVO> selectFsMessageFeedbackExportListVO(FsPrescribeParam fsPrescribe);
+
+    String getPrescribeCodeUrl(Long prescribeId);
+
+    Boolean isEntityNull(FsPrescribeParam fsPrescribe);
+
+    Long selectFsPrescribeExcelListVOCount(FsPrescribeParam fsPrescribe);
+
+    void exportData(FsPrescribeParam fsPrescribe);
+
+    void exportMessageFeedback(FsPrescribeParam fsPrescribe);
+
+    List<Long> selectFsPrescribeByPrescribeIdByOrderType();
+
+    void PrescribeStoreImg(Long id);
+}

+ 22 - 0
fs-service/src/main/java/com/fs/hisStore/service/IFsStoreAfterSalesScrmService.java

@@ -4,6 +4,10 @@ import java.text.ParseException;
 import java.util.List;
 
 import com.fs.common.core.domain.R;
+import com.fs.his.domain.FsStoreAfterSalesItem;
+import com.fs.his.vo.FsStoreAfterSalesExcelVO;
+import com.fs.his.vo.FsStoreAfterSalesLogsVO;
+import com.fs.hisStore.domain.FsStoreAfterSalesItemScrm;
 import com.fs.hisStore.domain.FsStoreAfterSalesScrm;
 import com.fs.hisStore.param.*;
 import com.fs.hisStore.vo.FsStoreAfterSalesQueryVO;
@@ -95,4 +99,22 @@ public interface IFsStoreAfterSalesScrmService
     int updateDelivery(FsStoreAfterSalesScrm fsStoreAfterSales);
 
     R autoApplyForAfterSales(long userId, FsStoreAfterSalesParam storeAfterSalesParam);
+
+    List<FsStoreAfterSalesExcelVO> selectFsStoreAfterSalesExcelListVO(com.fs.his.param.FsStoreAfterSalesParam fsStoreAfterSales);
+
+    FsStoreAfterSalesVO selectFsStoreAfterSalesVOById(Long id);
+
+    List<FsStoreAfterSalesItemScrm> selectFsStoreAfterSalesItemById(Long id);
+
+    List<FsStoreAfterSalesLogsVO> selectFsStoreAfterSalesLogById(Long id);
+
+    Long selectFsOrderIdByCode(Long id);
+
+    int auditing(FsStoreAfterSalesScrm fsStoreAfterSales);
+
+    int depotAuditing(FsStoreAfterSalesScrm fsStoreAfterSales);
+
+    int noAuditing(FsStoreAfterSalesScrm fsStoreAfterSales);
+
+    int storeRefundMoney(FsStoreAfterSalesScrm fsStoreAfterSales);
 }

+ 68 - 0
fs-service/src/main/java/com/fs/hisStore/service/IFsStoreBillScrmService.java

@@ -0,0 +1,68 @@
+package com.fs.hisStore.service;
+
+import com.fs.his.param.FsStoreBillParam;
+import com.fs.his.vo.FsStoreBillVO;
+import com.fs.hisStore.domain.FsStoreBillScrm;
+
+import java.util.List;
+
+/**
+ * 店铺帐单记录Service接口
+ *
+ * @author fs
+ * @date 2023-06-25
+ */
+public interface IFsStoreBillScrmService
+{
+    /**
+     * 查询店铺帐单记录
+     *
+     * @param billId 店铺帐单记录主键
+     * @return 店铺帐单记录
+     */
+    public FsStoreBillScrm selectFsStoreBillByBillId(Long billId);
+
+    /**
+     * 查询店铺帐单记录列表
+     *
+     * @param fsStoreBill 店铺帐单记录
+     * @return 店铺帐单记录集合
+     */
+    public List<FsStoreBillScrm> selectFsStoreBillList(FsStoreBillScrm fsStoreBill);
+
+    /**
+     * 新增店铺帐单记录
+     *
+     * @param fsStoreBill 店铺帐单记录
+     * @return 结果
+     */
+    public int insertFsStoreBill(FsStoreBillScrm fsStoreBill);
+
+    /**
+     * 修改店铺帐单记录
+     *
+     * @param fsStoreBill 店铺帐单记录
+     * @return 结果
+     */
+    public int updateFsStoreBill(FsStoreBillScrm fsStoreBill);
+
+    /**
+     * 批量删除店铺帐单记录
+     *
+     * @param billIds 需要删除的店铺帐单记录主键集合
+     * @return 结果
+     */
+    public int deleteFsStoreBillByBillIds(Long[] billIds);
+
+    /**
+     * 删除店铺帐单记录信息
+     *
+     * @param billId 店铺帐单记录主键
+     * @return 结果
+     */
+    public int deleteFsStoreBillByBillId(Long billId);
+
+
+
+    List<FsStoreBillVO> selectFsStoreBillListVO(FsStoreBillParam fsStoreBill);
+}

+ 66 - 0
fs-service/src/main/java/com/fs/hisStore/service/IFsStoreExtractScrmService.java

@@ -0,0 +1,66 @@
+package com.fs.hisStore.service;
+
+import com.fs.hisStore.domain.FsStoreExtractScrm;
+import com.fs.his.vo.FsStoreExtractVO;
+
+import java.util.List;
+
+/**
+ * 店铺提现管理Service接口
+ *
+ * @author fs
+ * @date 2023-06-25
+ */
+public interface IFsStoreExtractScrmService
+{
+    /**
+     * 查询店铺提现管理
+     *
+     * @param extractId 店铺提现管理主键
+     * @return 店铺提现管理
+     */
+    public FsStoreExtractScrm selectFsStoreExtractByExtractId(String extractId);
+
+    /**
+     * 查询店铺提现管理列表
+     *
+     * @param fsStoreExtract 店铺提现管理
+     * @return 店铺提现管理集合
+     */
+    public List<FsStoreExtractScrm> selectFsStoreExtractList(FsStoreExtractScrm fsStoreExtract);
+
+    /**
+     * 新增店铺提现管理
+     *
+     * @param fsStoreExtract 店铺提现管理
+     * @return 结果
+     */
+    public int insertFsStoreExtract(FsStoreExtractScrm fsStoreExtract);
+
+    /**
+     * 修改店铺提现管理
+     *
+     * @param fsStoreExtract 店铺提现管理
+     * @return 结果
+     */
+    public int updateFsStoreExtract(FsStoreExtractScrm fsStoreExtract);
+
+    /**
+     * 批量删除店铺提现管理
+     *
+     * @param extractIds 需要删除的店铺提现管理主键集合
+     * @return 结果
+     */
+    public int deleteFsStoreExtractByExtractIds(String[] extractIds);
+
+    /**
+     * 删除店铺提现管理信息
+     *
+     * @param extractId 店铺提现管理主键
+     * @return 结果
+     */
+    public int deleteFsStoreExtractByExtractId(String extractId);
+
+
+    List<FsStoreExtractVO> selectFsStoreExtractListVO(FsStoreExtractScrm fsStoreExtract);
+}

+ 76 - 0
fs-service/src/main/java/com/fs/hisStore/service/IFsStoreOrderBillLogScrmService.java

@@ -0,0 +1,76 @@
+package com.fs.hisStore.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.common.core.domain.R;
+import com.fs.his.param.BillListParam;
+import com.fs.his.param.OrderBillParam;
+import com.fs.his.vo.FsStoreOrderBillLogVo;
+import com.fs.hisStore.domain.FsStoreOrderBillLogScrm;
+import com.github.pagehelper.PageInfo;
+
+import java.util.List;
+
+/**
+ * 订单开票记录Service接口
+ *
+ * @author fs
+ * @date 2025-01-07
+ */
+public interface IFsStoreOrderBillLogScrmService extends IService<FsStoreOrderBillLogScrm> {
+    /**
+     * 查询订单开票记录
+     *
+     * @param id 订单开票记录主键
+     * @return 订单开票记录
+     */
+    public FsStoreOrderBillLogScrm selectFsStoreOrderBillLogById(Long id);
+
+    /**
+     * 查询订单开票记录列表
+     *
+     * @param fsStoreOrderBillLog 订单开票记录
+     * @return 订单开票记录集合
+     */
+    public List<FsStoreOrderBillLogScrm> selectFsStoreOrderBillLogList(FsStoreOrderBillLogScrm fsStoreOrderBillLog);
+
+    /**
+     * 新增订单开票记录
+     *
+     * @param fsStoreOrderBillLog 订单开票记录
+     * @return 结果
+     */
+    public int insertFsStoreOrderBillLog(FsStoreOrderBillLogScrm fsStoreOrderBillLog);
+
+    /**
+     * 修改订单开票记录
+     *
+     * @param fsStoreOrderBillLog 订单开票记录
+     * @return 结果
+     */
+    public int updateFsStoreOrderBillLog(FsStoreOrderBillLogScrm fsStoreOrderBillLog);
+
+    /**
+     * 批量删除订单开票记录
+     *
+     * @param ids 需要删除的订单开票记录主键集合
+     * @return 结果
+     */
+    public int deleteFsStoreOrderBillLogByIds(Long[] ids);
+
+    /**
+     * 删除订单开票记录信息
+     *
+     * @param id 订单开票记录主键
+     * @return 结果
+     */
+    public int deleteFsStoreOrderBillLogById(Long id);
+
+    R bill(OrderBillParam param);
+
+    PageInfo<FsStoreOrderBillLogVo> billList(BillListParam param);
+
+    R billBack(Long id);
+    R billBackByOrderId(Long orderId);
+
+    R reopen(Long id);
+}

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

@@ -1,6 +1,8 @@
 package com.fs.hisStore.service;
 
 import java.util.List;
+
+import com.fs.his.vo.FsStoreOrderItemListDVO;
 import com.fs.hisStore.domain.FsStoreOrderItemScrm;
 import com.fs.hisStore.param.FsStoreOrderParam;
 import com.fs.hisStore.vo.FsStoreOrderItemExportVO;
@@ -69,4 +71,6 @@ public interface IFsStoreOrderItemScrmService
     Long countFsStoreOrderItemListExportVO(FsStoreOrderParam fsStoreOrder);
 
     int updateFsStoreOrderCode(Long orderId, String orderCode);
+
+    List<FsStoreOrderItemListDVO> selectFsStoreOrderItemListDVOByOrderId(Long orderId);
 }

+ 64 - 0
fs-service/src/main/java/com/fs/hisStore/service/IFsStoreOrderLogsScrmService.java

@@ -0,0 +1,64 @@
+package com.fs.hisStore.service;
+
+import com.fs.hisStore.domain.FsStoreOrderLogsScrm;
+
+import java.util.List;
+
+/**
+ * 订单操作记录Service接口
+ *
+ * @author fs
+ * @date 2023-08-11
+ */
+public interface IFsStoreOrderLogsScrmService
+{
+    /**
+     * 查询订单操作记录
+     *
+     * @param logsId 订单操作记录主键
+     * @return 订单操作记录
+     */
+    public FsStoreOrderLogsScrm selectFsStoreOrderLogsByLogsId(String logsId);
+
+    /**
+     * 查询订单操作记录列表
+     *
+     * @param fsStoreOrderLogs 订单操作记录
+     * @return 订单操作记录集合
+     */
+    public List<FsStoreOrderLogsScrm> selectFsStoreOrderLogsList(FsStoreOrderLogsScrm fsStoreOrderLogs);
+
+    /**
+     * 新增订单操作记录
+     *
+     * @param fsStoreOrderLogs 订单操作记录
+     * @return 结果
+     */
+    public int insertFsStoreOrderLogs(FsStoreOrderLogsScrm fsStoreOrderLogs);
+
+    /**
+     * 修改订单操作记录
+     *
+     * @param fsStoreOrderLogs 订单操作记录
+     * @return 结果
+     */
+    public int updateFsStoreOrderLogs(FsStoreOrderLogsScrm fsStoreOrderLogs);
+
+    /**
+     * 批量删除订单操作记录
+     *
+     * @param logsIds 需要删除的订单操作记录主键集合
+     * @return 结果
+     */
+    public int deleteFsStoreOrderLogsByLogsIds(String[] logsIds);
+
+    /**
+     * 删除订单操作记录信息
+     *
+     * @param logsId 订单操作记录主键
+     * @return 结果
+     */
+    public int deleteFsStoreOrderLogsByLogsId(String logsId);
+
+    int create(Long orderId, String type, String msg);
+}

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

@@ -12,7 +12,13 @@ import com.fs.common.core.domain.R;
 import com.fs.company.domain.CompanyUser;
 import com.fs.course.dto.FsOrderDeliveryNoteDTO;
 import com.fs.erp.domain.ErpOrder;
+import com.fs.his.domain.FsStorePayment;
+import com.fs.his.param.FsStoreOrderSalesParam;
+import com.fs.his.vo.FsStoreOrderExcelVO;
+import com.fs.hisStore.domain.FsStoreOrderItemScrm;
+import com.fs.hisStore.domain.FsStoreOrderLogsScrm;
 import com.fs.hisStore.domain.FsStoreOrderScrm;
+import com.fs.hisStore.domain.FsStorePaymentScrm;
 import com.fs.hisStore.dto.ExpressNotifyDTO;
 import com.fs.hisStore.dto.ExpressResultDTO;
 import com.fs.hisStore.dto.FsStoreOrderComputeDTO;
@@ -20,6 +26,8 @@ import com.fs.hisStore.dto.StoreOrderExpressExportDTO;
 import com.fs.hisStore.param.*;
 import com.fs.hisStore.vo.*;
 
+import com.fs.his.vo.FsPrescribeVO;
+
 /**
  * 订单Service接口
  *
@@ -92,6 +100,8 @@ public interface IFsStoreOrderScrmService
 
     R createOrder(long userId, FsStoreOrderCreateParam param);
 
+    R createOrderByPrescribe(Long prescribeId);
+
     void cancelOrder(Long orderId);
 
     void refundPrescribeOrder(Long orderId);
@@ -241,6 +251,32 @@ public interface IFsStoreOrderScrmService
 
     List<FsStoreProductCountsVO> selectFsStoreProductCountsByDept(Map<String, Object> map, Long deptId);
 
+    FsStoreOrderScrm selectFsStoreOrderByOrderId(Long storeOrderId);
+
+    List<FsStoreOrderExcelVO> selectFsStoreOrderExcelListSVO(FsStoreOrderParam fsStoreOrder);
+
+    String importSroreOrder(List<FsStoreProductDeliverExcelVO> list, Long storeID,Long companyId);
+
+    int deleteFsStoreOrderByOrderIds(String[] orderIds);
+
+    List<FsStoreOrderItemScrm> selectFsStoreOrderItemList(String orderId);
+
+    List<FsStoreOrderLogsScrm> selectFsStoreOrderLogsList(String orderId);
+
+    FsPrescribeVO selectFsPrescribeByPrescribeIdVO(Long prescribeId);
+
+    List<FsStorePaymentScrm> selectFsStorePaymentByOrderId(Long orderId);
+
+    int sendGoods(FsStoreOrderScrm fsStoreOrder);
+
+    int getGoods(Long id);
+
+    int updateMoney(FsStoreOrderScrm fsStoreOrder);
+
+    int tuiOrder(Long id);
+
+    int afterSales(FsStoreOrderSalesParam fsStoreOrder);
+
     /**
      * 批量导入更新微信订单发货状态
      * @param dtoList 订单数据

+ 25 - 8
fs-service/src/main/java/com/fs/hisStore/service/IFsStoreProductCategoryScrmService.java

@@ -1,19 +1,24 @@
 package com.fs.hisStore.service;
 
 import java.util.List;
+
+import com.fs.hisStore.domain.FsStoreProductCategoryScrm;
+import com.fs.hisStore.vo.FsStoreProductCategoryVO;
+import com.fs.hisStore.vo.FsStoreProductCategorysVO;
+import com.fs.his.vo.OptionsVO;
 import com.fs.hisStore.domain.FsStoreProductCategoryScrm;
 
 /**
  * 商品分类Service接口
- * 
+ *
  * @author fs
  * @date 2022-03-15
  */
-public interface IFsStoreProductCategoryScrmService 
+public interface IFsStoreProductCategoryScrmService
 {
     /**
      * 查询商品分类
-     * 
+     *
      * @param cateId 商品分类ID
      * @return 商品分类
      */
@@ -21,7 +26,7 @@ public interface IFsStoreProductCategoryScrmService
 
     /**
      * 查询商品分类列表
-     * 
+     *
      * @param fsStoreProductCategory 商品分类
      * @return 商品分类集合
      */
@@ -29,7 +34,7 @@ public interface IFsStoreProductCategoryScrmService
 
     /**
      * 新增商品分类
-     * 
+     *
      * @param fsStoreProductCategory 商品分类
      * @return 结果
      */
@@ -37,7 +42,7 @@ public interface IFsStoreProductCategoryScrmService
 
     /**
      * 修改商品分类
-     * 
+     *
      * @param fsStoreProductCategory 商品分类
      * @return 结果
      */
@@ -45,7 +50,7 @@ public interface IFsStoreProductCategoryScrmService
 
     /**
      * 批量删除商品分类
-     * 
+     *
      * @param cateIds 需要删除的商品分类ID
      * @return 结果
      */
@@ -53,7 +58,7 @@ public interface IFsStoreProductCategoryScrmService
 
     /**
      * 删除商品分类信息
-     * 
+     *
      * @param cateId 商品分类ID
      * @return 结果
      */
@@ -61,4 +66,16 @@ public interface IFsStoreProductCategoryScrmService
 
 
     List<FsStoreProductCategoryScrm> selectFsStoreProductCategoryListQuery(FsStoreProductCategoryScrm param);
+
+    List<FsStoreProductCategoryVO> selectFsStoreProductCategoryListVO(FsStoreProductCategoryScrm fsStoreProductCategory);
+
+    List<OptionsVO> selectFsStoreProductPidList();
+
+    FsStoreProductCategoryScrm selectFsStoreProductCategoryByCateId(Long cateId);
+
+    int deleteFsStoreProductCategoryByCateIds(Long[] cateIds);
+
+    List<FsStoreProductCategorysVO> selectFsStoreProductCategorysVOList();
+
+    List<FsStoreProductCategoryVO> getPidList();
 }

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

@@ -4,6 +4,12 @@ import java.util.List;
 import java.util.Map;
 
 import com.fs.common.core.domain.R;
+import com.fs.hisStore.domain.FsStoreProductScrm;
+import com.fs.hisStore.domain.FsStoreProductRuleScrm;
+import com.fs.his.param.FsStoreProductListSParam;
+import com.fs.his.vo.FsStoreProductExcelVO;
+import com.fs.his.vo.FsStoreProductListSVO;
+import com.fs.his.vo.OptionsVO;
 import com.fs.hisStore.vo.*;
 import com.fs.statis.dto.ModifyMoreDTO;
 import com.fs.hisStore.domain.FsStoreProductScrm;
@@ -110,4 +116,17 @@ public interface IFsStoreProductScrmService
 
     void batchModify(ModifyMoreDTO modifyMoreDTO);
 
+    List<FsStoreProductListSVO> selectFsStoreProductListSVO(FsStoreProductListSParam fsStoreProduct);
+
+    String importSrorePeoduct(List<FsStoreProductExcelVO> list, boolean updateSupport);
+
+    int updateFsStoreProductPrice(FsStoreProductScrm fsStoreProduct, Integer price);
+
+    List<OptionsVO> selectFsStoreProductStoreList();
+
+    FsStoreProductScrm selectFsStoreProductByProductId(Long productId);
+
+    List<FsStoreProductRuleScrm> selectFsStoreProductRuleList();
+
+
 }

+ 76 - 0
fs-service/src/main/java/com/fs/hisStore/service/IFsStoreScrmService.java

@@ -0,0 +1,76 @@
+package com.fs.hisStore.service;
+
+import com.fs.his.param.FsStoreAuditParam;
+import com.fs.hisStore.domain.FsStoreScrm;
+
+import java.util.List;
+
+
+/**
+ * 店铺管理Service接口
+ *
+ * @author fs
+ * @date 2023-06-15
+ */
+public interface IFsStoreScrmService
+{
+    /**
+     * 查询店铺管理
+     *
+     * @param storeId 店铺管理主键
+     * @return 店铺管理
+     */
+    public FsStoreScrm selectFsStoreByStoreId(Long storeId);
+
+    /**
+     * 查询店铺管理列表
+     *
+     * @param fsStore 店铺管理
+     * @return 店铺管理集合
+     */
+    public List<FsStoreScrm> selectFsStoreList(FsStoreScrm fsStore);
+
+    /**
+     * 新增店铺管理
+     *
+     * @param fsStore 店铺管理
+     * @return 结果
+     */
+    public int insertFsStore(FsStoreScrm fsStore);
+
+    /**
+     * 修改店铺管理
+     *
+     * @param fsStore 店铺管理
+     * @return 结果
+     */
+    public int updateFsStore(FsStoreScrm fsStore);
+
+    /**
+     * 批量删除店铺管理
+     *
+     * @param storeIds 需要删除的店铺管理主键集合
+     * @return 结果
+     */
+    public int deleteFsStoreByStoreIds(Long[] storeIds);
+
+    /**
+     * 删除店铺管理信息
+     *
+     * @param storeId 店铺管理主键
+     * @return 结果
+     */
+    public int deleteFsStoreByStoreId(Long storeId);
+
+    int updateFsStoreAudit(FsStoreAuditParam fsStore);
+
+    int updateFsStoreLogo(FsStoreScrm fsStore);
+
+    int updateEditData(FsStoreScrm fsStore);
+
+
+    List<FsStoreScrm> selectFsStoreListByDoctorId(Long doctorId);
+
+    int refreshFsStore(Long storeId);
+
+}

+ 49 - 0
fs-service/src/main/java/com/fs/hisStore/service/ISysOperLogScrmService.java

@@ -0,0 +1,49 @@
+package com.fs.hisStore.service;
+
+import com.fs.hisStore.domain.SysOperLogScrm;
+
+import java.util.List;
+
+/**
+ * 操作日志 服务层
+ *
+
+ */
+public interface ISysOperLogScrmService
+{
+    /**
+     * 新增操作日志
+     *
+     * @param operLog 操作日志对象
+     */
+    public void insertOperlog(SysOperLogScrm operLog);
+
+    /**
+     * 查询系统操作日志集合
+     *
+     * @param operLog 操作日志对象
+     * @return 操作日志集合
+     */
+    public List<SysOperLogScrm> selectOperLogList(SysOperLogScrm operLog);
+
+    /**
+     * 批量删除系统操作日志
+     *
+     * @param operIds 需要删除的操作日志ID
+     * @return 结果
+     */
+    public int deleteOperLogByIds(Long[] operIds);
+
+    /**
+     * 查询操作日志详细
+     *
+     * @param operId 操作ID
+     * @return 操作日志对象
+     */
+    public SysOperLogScrm selectOperLogById(Long operId);
+
+    /**
+     * 清空操作日志
+     */
+    public void cleanOperLog();
+}

+ 98 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsMaterialGroupScrmStoreServiceImpl.java

@@ -0,0 +1,98 @@
+package com.fs.hisStore.service.impl;
+
+import com.fs.common.utils.DateUtils;
+import com.fs.his.mapper.FsMaterialGroupMapper;
+import com.fs.hisStore.domain.FsMaterialGroupScrm;
+import com.fs.hisStore.mapper.FsMaterialGroupScrmMapper;
+import com.fs.hisStore.service.IFsMaterialGroupScrmStoreService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 素材分组Service业务层处理
+ *
+ * @author fs
+ * @date 2023-07-06
+ */
+@Service
+public class FsMaterialGroupScrmStoreServiceImpl implements IFsMaterialGroupScrmStoreService
+{
+    @Autowired
+    private FsMaterialGroupScrmMapper fsMaterialGroupMapper;
+
+    /**
+     * 查询素材分组
+     *
+     * @param groupId 素材分组主键
+     * @return 素材分组
+     */
+    @Override
+    public FsMaterialGroupScrm selectFsMaterialGroupByGroupId(Long groupId)
+    {
+        return fsMaterialGroupMapper.selectFsMaterialGroupById(groupId);
+    }
+
+    /**
+     * 查询素材分组列表
+     *
+     * @param fsMaterialGroup 素材分组
+     * @return 素材分组
+     */
+    @Override
+    public List<FsMaterialGroupScrm> selectFsMaterialGroupList(FsMaterialGroupScrm fsMaterialGroup)
+    {
+        return fsMaterialGroupMapper.selectFsMaterialGroupList(fsMaterialGroup);
+    }
+
+    /**
+     * 新增素材分组
+     *
+     * @param fsMaterialGroup 素材分组
+     * @return 结果
+     */
+    @Override
+    public int insertFsMaterialGroup(FsMaterialGroupScrm fsMaterialGroup)
+    {
+        fsMaterialGroup.setCreateTime(DateUtils.getNowDate());
+        return fsMaterialGroupMapper.insertFsMaterialGroup(fsMaterialGroup);
+    }
+
+    /**
+     * 修改素材分组
+     *
+     * @param fsMaterialGroup 素材分组
+     * @return 结果
+     */
+    @Override
+    public int updateFsMaterialGroup(FsMaterialGroupScrm fsMaterialGroup)
+    {
+        fsMaterialGroup.setUpdateTime(DateUtils.getNowDate());
+        return fsMaterialGroupMapper.updateFsMaterialGroup(fsMaterialGroup);
+    }
+
+    /**
+     * 批量删除素材分组
+     *
+     * @param groupIds 需要删除的素材分组主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsMaterialGroupByGroupIds(Long[] groupIds)
+    {
+        return fsMaterialGroupMapper.deleteFsMaterialGroupByIds(groupIds);
+    }
+
+    /**
+     * 删除素材分组信息
+     *
+     * @param groupId 素材分组主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsMaterialGroupByGroupId(Long groupId)
+    {
+        return fsMaterialGroupMapper.deleteFsMaterialGroupById(groupId);
+    }
+}

+ 99 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsMaterialScrmStoreServiceImpl.java

@@ -0,0 +1,99 @@
+package com.fs.hisStore.service.impl;
+
+import com.fs.common.utils.DateUtils;
+import com.fs.his.mapper.FsMaterialMapper;
+import com.fs.his.service.IFsMaterialService;
+import com.fs.hisStore.domain.FsMaterialScrm;
+import com.fs.hisStore.mapper.FsMaterialScrmMapper;
+import com.fs.hisStore.service.IFsMaterialScrmStoreService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 素材库Service业务层处理
+ *
+ * @author fs
+ * @date 2023-07-06
+ */
+@Service
+public class FsMaterialScrmStoreServiceImpl implements IFsMaterialScrmStoreService
+{
+    @Autowired
+    private FsMaterialScrmMapper fsMaterialMapper;
+
+    /**
+     * 查询素材库
+     *
+     * @param materialId 素材库主键
+     * @return 素材库
+     */
+    @Override
+    public FsMaterialScrm selectFsMaterialByMaterialId(Long materialId)
+    {
+        return fsMaterialMapper.selectFsMaterialById(materialId);
+    }
+
+    /**
+     * 查询素材库列表
+     *
+     * @param fsMaterial 素材库
+     * @return 素材库
+     */
+    @Override
+    public List<FsMaterialScrm> selectFsMaterialList(FsMaterialScrm fsMaterial)
+    {
+        return fsMaterialMapper.selectFsMaterialList(fsMaterial);
+    }
+
+    /**
+     * 新增素材库
+     *
+     * @param fsMaterial 素材库
+     * @return 结果
+     */
+    @Override
+    public int insertFsMaterial(FsMaterialScrm fsMaterial)
+    {
+        fsMaterial.setCreateTime(DateUtils.getNowDate());
+        return fsMaterialMapper.insertFsMaterial(fsMaterial);
+    }
+
+    /**
+     * 修改素材库
+     *
+     * @param fsMaterial 素材库
+     * @return 结果
+     */
+    @Override
+    public int updateFsMaterial(FsMaterialScrm fsMaterial)
+    {
+        fsMaterial.setUpdateTime(DateUtils.getNowDate());
+        return fsMaterialMapper.updateFsMaterial(fsMaterial);
+    }
+
+    /**
+     * 批量删除素材库
+     *
+     * @param materialIds 需要删除的素材库主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsMaterialByMaterialIds(Long[] materialIds)
+    {
+        return fsMaterialMapper.deleteFsMaterialByIds(materialIds);
+    }
+
+    /**
+     * 删除素材库信息
+     *
+     * @param materialId 素材库主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsMaterialByMaterialId(Long materialId)
+    {
+        return fsMaterialMapper.deleteFsMaterialById(materialId);
+    }
+}

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

@@ -157,7 +157,7 @@ public class FsPrescribeScrmServiceImpl implements IFsPrescribeScrmService
         prescribe.setIs_history_allergic(param.getIsAllergic()?"是":"否");
         prescribe.setLiver_unusual(param.getIsLiver()?"是":"否");
         prescribe.setRenal_unusual(param.getIsRenal()?"是":"否");
-        prescribe.setLactation_flag(param.getIsLactation()?"是":"否");
+        prescribe.setLactation_flag(param.getIsLactation());
         prescribe.setChief_complaint(param.getChiefComplaint());
         prescribe.setNow_illness(param.getNowIllness());
         prescribe.setHistory_illness(param.getHistoryIllness());
@@ -201,7 +201,7 @@ public class FsPrescribeScrmServiceImpl implements IFsPrescribeScrmService
             fsPrescribe.setPatientName(patient.getPatientName());
             fsPrescribe.setIsHistoryAllergic(param.getIsAllergic()?"是":"否");
             fsPrescribe.setLiverUnusual(param.getIsLiver()?"是":"否");
-            fsPrescribe.setLactationFlag(param.getIsLactation()?"是":"否");
+            fsPrescribe.setLactationFlag(param.getIsLactation());
             fsPrescribe.setRenalUnusual(param.getIsRenal()?"是":"否");
             fsPrescribe.setChiefComplaint(param.getChiefComplaint());
             fsPrescribe.setNowIllness(param.getNowIllness());

+ 957 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsPrescribeScrmStoreServiceImpl.java

@@ -0,0 +1,957 @@
+package com.fs.hisStore.service.impl;
+
+import cn.hutool.core.util.IdUtil;
+import cn.hutool.json.JSONUtil;
+import com.alibaba.fastjson.JSON;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.exception.CustomException;
+import com.fs.common.utils.DateUtils;
+import com.fs.common.utils.StringUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.his.config.FsSysConfig;
+import com.fs.his.domain.*;
+import com.fs.his.dto.FsPackagePatientDTO;
+import com.fs.his.dto.FsPackagePruductDTO;
+import com.fs.his.dto.FsPrescribeUsageDTO;
+import com.fs.his.mapper.*;
+import com.fs.his.param.*;
+import com.fs.his.service.IFsDoctorService;
+import com.fs.his.service.IFsPrescribeDrugService;
+import com.fs.his.utils.ConfigUtil;
+import com.fs.his.utils.qrcode.QRCodeUtils;
+import com.fs.his.vo.*;
+import com.fs.hisStore.domain.*;
+import com.fs.hisStore.service.IFsPrescribeScrmStoreService;
+import com.fs.hisStore.service.IFsStoreOrderScrmService;
+import com.fs.im.dto.MsgCustomDTO;
+import com.fs.im.dto.MsgDTO;
+import com.fs.im.dto.MsgDataDTO;
+import com.fs.im.dto.MsgDataFormatDTO;
+import com.fs.im.service.IImService;
+import com.fs.system.oss.CloudStorageService;
+import com.fs.system.oss.OSSFactory;
+import com.google.zxing.WriterException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.imageio.ImageIO;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.io.*;
+import java.lang.reflect.Field;
+import java.math.BigDecimal;
+import java.net.URL;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 处方Service业务层处理
+ *
+ * @author fs
+ * @date 2023-06-13
+ */
+@Service
+public class FsPrescribeScrmStoreServiceImpl implements IFsPrescribeScrmStoreService
+{
+    @Autowired
+    private FsPrescribeMapper fsPrescribeMapper;
+    @Autowired
+    private FsPrescribeDrugMapper fsPrescribeDrugMapper;
+    @Autowired
+    private FsInquiryOrderMapper fsInquiryOrderMapper;
+    @Autowired
+    IFsDoctorService doctorService;
+    @Autowired
+    FsDoctorMapper doctorMapper;
+    @Lazy
+    @Autowired
+    IFsStoreOrderScrmService storeOrderService;
+    @Autowired
+    private IFsPrescribeDrugService prescribeDrugService;
+    @Autowired
+    IImService imService;
+    @Autowired
+    FsPackageMapper fsPackageMapper;
+    @Autowired
+    ConfigUtil configUtil;
+    @Autowired
+    FsExportTaskMapper fsExportTaskMapper;
+    /**
+     * 查询处方
+     *
+     * @param prescribeId 处方主键
+     * @return 处方
+     */
+    @Override
+    public FsPrescribe selectFsPrescribeByPrescribeId(Long prescribeId)
+    {
+        return fsPrescribeMapper.selectFsPrescribeByPrescribeId(prescribeId);
+    }
+
+    /**
+     * 查询处方列表
+     *
+     * @param fsPrescribe 处方
+     * @return 处方
+     */
+    @Override
+    public List<FsPrescribe> selectFsPrescribeList(FsPrescribe fsPrescribe)
+    {
+        return fsPrescribeMapper.selectFsPrescribeList(fsPrescribe);
+    }
+
+    /**
+     * 新增处方
+     *
+     * @param fsPrescribe 处方
+     * @return 结果
+     */
+    @Override
+    public int insertFsPrescribe(FsPrescribe fsPrescribe)
+    {
+        fsPrescribe.setCreateTime(DateUtils.getNowDate());
+        return fsPrescribeMapper.insertFsPrescribe(fsPrescribe);
+    }
+
+    /**
+     * 修改处方
+     *
+     * @param fsPrescribe 处方
+     * @return 结果
+     */
+    @Override
+    public int updateFsPrescribe(FsPrescribe fsPrescribe)
+    {
+        return fsPrescribeMapper.updateFsPrescribe(fsPrescribe);
+    }
+
+    /**
+     * 批量删除处方
+     *
+     * @param prescribeIds 需要删除的处方主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsPrescribeByPrescribeIds(Long[] prescribeIds)
+    {
+        return fsPrescribeMapper.deleteFsPrescribeByPrescribeIds(prescribeIds);
+    }
+
+    /**
+     * 删除处方信息
+     *
+     * @param prescribeId 处方主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsPrescribeByPrescribeId(Long prescribeId)
+    {
+        return fsPrescribeMapper.deleteFsPrescribeByPrescribeId(prescribeId);
+    }
+
+    @Override
+    public List<FsPrescribeListVO> selectFsPrescribeListVO(FsPrescribeParam fsPrescribe) {
+        return  fsPrescribeMapper.selectFsPrescribeListVO(fsPrescribe);
+    }
+
+    @Override
+    public List<FsPrescribeListDVO> selectFsPrescribeListDVO(FsPrescribeListDParam param) {
+        List<FsPrescribeListDVO> list=fsPrescribeMapper.selectFsPrescribeListDVO(param);
+        for(FsPrescribeListDVO vo:list){
+            FsPrescribeDrug map=new FsPrescribeDrug();
+            map.setPrescribeId(vo.getPrescribeId());
+            vo.setDrugs(fsPrescribeDrugMapper.selectFsPrescribeDrugList(map));
+        }
+        return list;
+
+
+    }
+
+    @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);
+
+       // penDrawString(pen,o.getDoctorName(),152,1378);
+        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.getCheck(),348,1378);
+        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(System.getProperty("user.dir")+"\\xycf.jpg");
+        File mb = new File("C:\\fs\\xycf.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, 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();
+//        BigDecimal price=BigDecimal.valueOf(0);
+        for (int i = 0; i < size; i++) {
+            FsPrescribeDrug d = Drug.get(i);
+            String drugName = d.getDrugName();
+            BigDecimal drugPrice = d.getDrugPrice().multiply(BigDecimal.valueOf(d.getDrugNum()));
+//            price= price.add(drugPrice);
+            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());
+                pen.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
+                BufferedImage img = ImageIO.read(imageUrl);
+                pen.drawImage(img, 65, 688, 88, 40, 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 img = ImageIO.read(imageUrl);
+                pen.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
+                pen.drawImage(img, 90, 730, 88, 40, 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();
+        String url = storage.uploadSuffix(inputStream, ".jpg");
+        return url;
+    }
+
+    @Override
+    public List<FsPrescribeListUVO> selectFsPrescribeListUVO(FsPrescribeListUParam param) {
+        List<FsPrescribeListUVO> list=fsPrescribeMapper.selectFsPrescribeListUVO(param);
+        for(FsPrescribeListUVO vo:list){
+            FsPrescribeDrug map=new FsPrescribeDrug();
+            map.setPrescribeId(vo.getPrescribeId());
+            vo.setDrugs(fsPrescribeDrugMapper.selectFsPrescribeDrugList(map));
+        }
+        return list;
+    }
+
+//    @Async
+    @Override
+    public String PrescribeImg(Long PrescribeId){
+        FsPrescribeVO f = fsPrescribeMapper.selectFsPrescribeByPrescribeIdVO(PrescribeId);
+        if (f==null){
+            return "";
+        }
+        FsStoreOrderScrm fsStoreOrder = storeOrderService.selectFsStoreOrderByOrderId(f.getStoreOrderId());
+        FsInquiryOrderVO order = fsInquiryOrderMapper.selectFsInquiryOrderVOByOrderId(f.getInquiryOrderId());
+        if (f.getPrescribeImgUrl()==null||f.getPrescribeImgUrl().equals("")){
+            FsPrescribeDrug d = new FsPrescribeDrug();
+            d.setPrescribeId(f.getPrescribeId());
+            List<FsPrescribeDrug> list = fsPrescribeDrugMapper.selectFsPrescribeDrugList(d);
+//            List<FsPrescribeDrug> list =new ArrayList<>();
+//            for (FsPrescribeDrug fsPrescribeDrug : FsPrescribeDruglist) {
+//                if (fsPrescribeDrug.getIsDrug()!=null&&fsPrescribeDrug.getIsDrug()!=0){
+//                    list.add(fsPrescribeDrug);
+//                }else if (fsPrescribeDrug.getIsDrug()==null){
+//                    list.add(fsPrescribeDrug);
+//                }
+//            }
+            if (list.size()==0){
+                return "";
+            }
+            if (f.getPrescribeType()==1){
+                PrescribeXyImgParam o = new PrescribeXyImgParam();
+                o.setTotalPrice(fsStoreOrder.getPayPrice());
+                o.setTime(f.getCreateTime());
+                o.setPrescribeId(f.getPrescribeCode());
+                o.setPatientName(f.getPatientName());
+                o.setPatientGender(f.getPatientGender());
+                o.setPatientAge(f.getPatientAge());
+                o.setOutpatientId(f.getPrescribeCode());
+                o.setUrl(f.getPrescribeDoctorSignUrl());
+                o.setDrugDoctorUrl(f.getDrugDoctorSignUrl());
+                if (order!=null){
+                    o.setBedId(order.getDeptName());
+                }else {
+                    o.setBedId("中医科");
+                }
+                String remark="";
+                if (f.getUsageJson()!=null){
+                    FsPrescribeUsageDTO usage = JSONUtil.toBean(f.getUsageJson(), FsPrescribeUsageDTO.class);
+                    remark=usage.getRemark();
+                }
+                if (remark!=null&&remark!=""){
+                    o.setRemark(remark);
+                }else {
+                    o.setRemark("请按照用药说明书服用药品,如有不适,请及时就医!");
+                }
+                o.setHistoryAllergic(f.getHistoryAllergic());
+                o.setDiagnose(f.getDiagnose());
+                o.setPrescribeDrug(list); // 在这里添加处方药品列表的值
+                o.setDoctorName(f.getDoctorName());
+                o.setAuditDoctor(f.getDoctorDrugName());
+                o.setDispatcher("");
+                o.setCheckDoctor("");
+                o.setDoctorName(f.getDoctorName());
+                String s = getFsPrescribeXyImg(o);
+                FsPrescribe fsPrescribe = new FsPrescribe();
+                fsPrescribe.setPrescribeImgUrl(s);
+                fsPrescribe.setPrescribeId(f.getPrescribeId());
+                fsPrescribeMapper.updateFsPrescribe(fsPrescribe);
+                return s;
+            }else if (f.getPrescribeType()==2){
+
+                FsPrescribeUsageDTO usage = JSONUtil.toBean(f.getUsageJson(), FsPrescribeUsageDTO.class);
+
+                // 设置字段值
+                PrescribeZyImgParam o = new PrescribeZyImgParam();
+                o.setTime(f.getCreateTime());
+
+                o.setPrescribeId(f.getPrescribeCode());
+                o.setPatientName(f.getPatientName());
+                o.setPatientGender(f.getPatientGender());
+                o.setPatientAge(f.getPatientAge());
+                o.setPatientTel(f.getPatientTel());
+                o.setPrescribeDoctorName(f.getPrescribeDoctorName());
+                o.setUserName(fsStoreOrder.getRealName()); //发货地址
+                o.setUserPhone(fsStoreOrder.getUserPhone()); //收货人手机
+                o.setUserAddress(fsStoreOrder.getUserAddress()); //收货地址
+                o.setDiagnose(f.getDiagnose());
+                o.setPrescribeDrug(list); // 在这里添加处方药品列表的值
+                o.setEat(usage.getUsageMethod());
+                o.setUsageFrequencyUnit(usage.getUsageFrequencyUnit());
+                o.setRemark(usage.getRemark());
+                o.setDoctorName(f.getDoctorName());
+                o.setCheck(f.getDoctorDrugName());
+                if (usage.getCounts()!=null){
+                    o.setSize(usage.getCounts().toString());
+                }
+                o.setUrl(f.getPrescribeDoctorSignUrl());
+                o.setDrugDoctorUrl(f.getDrugDoctorSignUrl());
+                o.setTotalPrice(fsStoreOrder.getPayPrice());
+                String s = getFsPrescribeZyImg(o);
+                FsPrescribe fsPrescribe = new FsPrescribe();
+                fsPrescribe.setPrescribeImgUrl(s);
+                fsPrescribe.setPrescribeId(f.getPrescribeId());
+                fsPrescribeMapper.updateFsPrescribe(fsPrescribe);
+                return s;
+            }
+        }
+        return f.getPrescribeImgUrl();
+    }
+
+    @Override
+    public Long insertFsPrescribeByPackageOrder(FsPackageOrder packageOrder) {
+        FsPackage fsPackage=fsPackageMapper.selectFsPackageByPackageId(packageOrder.getPackageId());
+        FsPrescribe fsPrescribe = new FsPrescribe();
+        fsPrescribe.setPrescribeType(fsPackage.getProductType());
+        fsPrescribe.setRecipeType(fsPackage.getRecipeType());
+        fsPrescribe.setStoreId(fsPackage.getStoreId());
+        fsPrescribe.setStatus(1);
+        fsPrescribe.setIcdCode(fsPackage.getIcdCode());
+        fsPrescribe.setAuditTime(DateUtils.getNowDate());
+        fsPrescribe.setCreateTime(DateUtils.getNowDate());
+        fsPrescribe.setUsageJson("{}");
+        fsPrescribe.setDiagnose(fsPackage.getTags());
+        FsPrescribeUsageDTO fsPrescribeUsageDTO = new FsPrescribeUsageDTO();
+        if (fsPackage.getProductType()==2){
+            fsPrescribeUsageDTO.setCounts(fsPackage.getCounts()+0L);
+            fsPrescribeUsageDTO.setUsageFrequencyUnit(fsPackage.getUsageFrequencyUnit());
+            fsPrescribeUsageDTO.setRemark(fsPackage.getDoctorRemark());
+        }
+        if (packageOrder.getRemark()!=null||packageOrder.getRemark()!=""){
+            fsPrescribeUsageDTO.setRemark(packageOrder.getDoctorRemark());
+        }else {
+            fsPrescribeUsageDTO.setRemark("请按照用药说明书服用药品,如有不适,请及时就医!");
+        }
+
+        String jsonString = JSON.toJSONString(fsPrescribeUsageDTO);
+        fsPrescribe.setUsageJson(jsonString);
+
+        fsPrescribe.setUserId(packageOrder.getUserId());
+        fsPrescribe.setPrescribeCode(IdUtil.getSnowflake(0, 0).nextIdStr());
+        FsPackagePatientDTO patJson = JSON.parseObject(packageOrder.getPatientJson(),FsPackagePatientDTO.class);
+        long currentTimeMillis = System.currentTimeMillis();
+        long ageInMillis = currentTimeMillis - patJson.getBirthday();
+        long ageInSeconds = ageInMillis / 1000;
+        long ageInYears = ageInSeconds / (365 * 24 * 3600);
+        fsPrescribe.setPatientAge(ageInYears+"");
+        fsPrescribe.setPatientId(patJson.getPatientId()+0L);
+        fsPrescribe.setPatientName(patJson.getPatientName());
+        fsPrescribe.setPatientTel(patJson.getMobile());
+        fsPrescribe.setPatientGender(patJson.getSex().toString());
+        fsPrescribe.setPatientBirthday(new SimpleDateFormat("yyyy-MM-dd").format(new Date(patJson.getBirthday())));
+        fsPrescribe.setDoctorId(packageOrder.getDoctorId());
+        FsDoctor fsDoctor = doctorMapper.selectFsDoctorByDoctorId(packageOrder.getDoctorId());
+        if (fsDoctor==null){
+            throw new CustomException("医生查询错误:"+packageOrder.getDoctorId());
+        }
+        fsPrescribe.setPrescribeDoctorId(fsDoctor.getDoctorId());
+        fsPrescribe.setPrescribeDoctorSignUrl(fsDoctor.getSignUrl());
+
+        FsDoctor drug =doctorMapper.selectPackageFsDoctorType2Ids(fsPackage.getProductType());
+
+        fsPrescribe.setDrugDoctorId(drug.getDoctorId());
+        fsPrescribe.setDrugDoctorSignUrl(drug.getSignUrl());
+
+        int i = fsPrescribeMapper.insertFsPrescribe(fsPrescribe);
+        if(i>0){
+            String productJson = packageOrder.getPackageJson();
+            Map<String,Object> prod = (Map) JSON.parse(productJson);
+
+            List<FsPackagePruductDTO> prodList = JSON.parseArray((String) prod.get("productJson"), FsPackagePruductDTO.class);
+            for (FsPackagePruductDTO dto : prodList) {
+                FsPrescribeDrug prescribeDrug = new FsPrescribeDrug();
+                //写入药品
+                prescribeDrug.setProductAttrValueId(dto.getId());
+                prescribeDrug.setPrescribeId(fsPrescribe.getPrescribeId());
+                prescribeDrug.setDrugName(dto.getProductName());
+                prescribeDrug.setDrugSpec(dto.getPrescribeSpec());
+                prescribeDrug.setIsDrug(dto.getIsDrug());
+                prescribeDrug.setUsageMethod(dto.getUsageMethod());
+                prescribeDrug.setUsagePerUseCount(dto.getUsagePerUseCount());
+                prescribeDrug.setUsageFrequencyUnit("每日"+(dto.getUsageFrequencyUnit()!=null?dto.getUsageFrequencyUnit()+"":"1")+"次");
+                prescribeDrug.setDrugPrice(dto.getPrice());
+                prescribeDrug.setDrugNum(dto.getCount()+0L);
+                prescribeDrug.setProductId(dto.getProductId());
+                prescribeDrug.setDrugImgUrl(dto.getImage());
+                prescribeDrug.setDrugType(fsPackage.getProductType());
+                prescribeDrugService.insertFsPrescribeDrug(prescribeDrug);
+            }
+
+        }
+
+
+
+        return fsPrescribe.getPrescribeId();
+    }
+
+    @Override
+    public List<FsPrescribeExcelListVO> selectFsPrescribeExcelListVO(FsPrescribeParam fsPrescribe) {
+        return fsPrescribeMapper.selectFsPrescribeExcelListVO(fsPrescribe);
+    }
+
+    @Override
+    public List<FsMessageFeedbackExportListVO> selectFsMessageFeedbackExportListVO(FsPrescribeParam fsPrescribe) {
+        return fsPrescribeMapper.selectFsMessageFeedbackExportListVO(fsPrescribe);
+    }
+
+    @Override
+    public String getPrescribeCodeUrl(Long prescribeId) {
+        FsSysConfig sysConfig = configUtil.getSysConfig();
+        FsPrescribeVO fsPrescribeVO = fsPrescribeMapper.selectFsPrescribeByPrescribeIdVO(prescribeId);
+        if (fsPrescribeVO.getPrescribeCodeUrl()!=null&&fsPrescribeVO.getPrescribeCodeUrl()!=""){
+            return fsPrescribeVO.getPrescribeCodeUrl();
+        }
+        String doctorName = fsPrescribeVO.getDoctorName();
+        if (doctorName==null||doctorName.equals("")){
+            throw  new CustomException("医生不存在");
+        }
+        String patientName = fsPrescribeVO.getPatientName();
+        String codeUrl=sysConfig.getCodeUrl()+"prescribe?prescribeId="+prescribeId;
+
+        File mb = new File("C:\\fs\\pCode.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.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.BOLD  ,120));
+        pen.setColor(Color.decode("#612f00"));
+
+        if (doctorName.length()==2){
+            pen.drawString(doctorName+"已为您",135,285);
+        }else {
+            pen.drawString(doctorName+"已为您",80,285);
+        }
+
+        pen.setFont(new Font("黑体", Font.BOLD  ,58));
+        pen.setColor(Color.decode("#fdf3e7"));
+        if (patientName.length()==2){
+            pen.drawString(patientName+"的处方",300,1438);
+        }else {
+            pen.drawString(patientName+"的处方",270,1438);
+        }
+
+
+        try {
+            ByteArrayOutputStream qr = QRCodeUtils.create(codeUrl);
+            byte[] imageBytes = qr.toByteArray(); // 从 ByteArrayOutputStream 获取字节数组
+
+            ByteArrayInputStream inputStream = new ByteArrayInputStream(imageBytes); // 创建 ByteArrayInputStream
+            BufferedImage qrImage = ImageIO.read(inputStream);
+            pen.drawImage(qrImage, 260, 815, 380, 380, null);
+        } catch (WriterException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        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");
+        FsPrescribe fsPrescribe = new FsPrescribe();
+        fsPrescribe.setPrescribeCodeUrl(url);
+        fsPrescribe.setPrescribeId(prescribeId);
+        fsPrescribeMapper.updateFsPrescribe(fsPrescribe);
+        return url;
+    }
+
+    @Override
+    public Boolean isEntityNull(FsPrescribeParam param) {
+        if (param == null) {
+            return true; // 整个实体对象为null
+        }
+
+        Class<? extends FsPrescribeParam> entityClass = param.getClass();
+        Field[] fields = entityClass.getDeclaredFields();
+        try {
+            for (Field field : fields) {
+                field.setAccessible(true);
+                Object value = field.get(param);
+                if (value != null) {
+                    return false; // 实体对象中有字段不为null
+                }
+            }
+        } catch (IllegalAccessException e) {
+            e.printStackTrace();
+        }
+        return true; // 实体对象内所有字段为null
+    }
+
+    @Override
+    public Long selectFsPrescribeExcelListVOCount(FsPrescribeParam fsPrescribe) {
+
+       return fsPrescribeMapper.selectFsPrescribeExcelListVOCount(fsPrescribe);
+    }
+    @Async
+    @Override
+    public void exportData(FsPrescribeParam param) {
+        List<FsPrescribeExcelListVO> list = fsPrescribeMapper.selectFsPrescribeExcelListVO(param);
+
+        for (FsPrescribeExcelListVO vo : list){
+            if (vo.getPatientTel()!=null){
+                vo.setPatientTel(vo.getPatientTel().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+            }
+        }
+        ExcelUtil<FsPrescribeExcelListVO> util = new ExcelUtil<FsPrescribeExcelListVO>(FsPrescribeExcelListVO.class);
+        AjaxResult result = util.exportExcel(list, "处方数据");
+
+        FsExportTask task=fsExportTaskMapper.selectFsExportTaskByTaskId(param.getTaskId());
+        task.setFinishTime(new Date());
+        task.setStatus(1);
+        task.setFileUrl(result.get("msg").toString());
+        fsExportTaskMapper.updateFsExportTask(task);
+    }
+    @Async
+    @Override
+    public void exportMessageFeedback(FsPrescribeParam param) {
+        List<FsMessageFeedbackExportListVO> list = fsPrescribeMapper.selectFsMessageFeedbackExportListVO(param);
+
+        for (FsMessageFeedbackExportListVO vo : list){
+            vo.setFeedbackContent("复诊");
+            if (vo.getPatientTel()!=null){
+                vo.setPatientTel(vo.getPatientTel().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+            }
+            vo.setFeedbackTime(vo.getAuditTime());
+        }
+        ExcelUtil<FsMessageFeedbackExportListVO> util = new ExcelUtil<FsMessageFeedbackExportListVO>(FsMessageFeedbackExportListVO.class);
+        AjaxResult result = util.exportExcel(list, "医疗信息反馈单数据");
+
+        FsExportTask task=fsExportTaskMapper.selectFsExportTaskByTaskId(param.getTaskId());
+        task.setFinishTime(new Date());
+        task.setStatus(1);
+        task.setFileUrl(result.get("msg").toString());
+        fsExportTaskMapper.updateFsExportTask(task);
+    }
+
+    @Override
+    public List<Long> selectFsPrescribeByPrescribeIdByOrderType() {
+        return fsPrescribeMapper.selectFsPrescribeByPrescribeIdByOrderType();
+    }
+
+    @Override
+    public void PrescribeStoreImg(Long id) {
+        FsPrescribeVO f = fsPrescribeMapper.selectFsPrescribeByPrescribeIdVO(id);
+        if (f==null){
+            return ;
+        }
+        FsStoreOrderScrm fsStoreOrder = storeOrderService.selectFsStoreOrderByOrderId(f.getStoreOrderId());
+        FsPrescribeDrug d = new FsPrescribeDrug();
+        d.setPrescribeId(f.getPrescribeId());
+        List<FsPrescribeDrug> list = fsPrescribeDrugMapper.selectFsPrescribeDrugList(d);
+        if (list.isEmpty()){
+                return ;
+        }
+            FsPrescribeUsageDTO usage = JSONUtil.toBean(f.getUsageJson(), FsPrescribeUsageDTO.class);
+            // 设置字段值
+            PrescribeZyImgParam o = new PrescribeZyImgParam();
+            o.setTime(f.getCreateTime());
+            o.setPrescribeId(f.getPrescribeCode());
+            o.setPatientName(f.getPatientName());
+            o.setPatientGender(f.getPatientGender());
+            o.setPatientAge(f.getPatientAge());
+            o.setPatientTel(f.getPatientTel());
+            o.setPrescribeDoctorName(f.getPrescribeDoctorName());
+            o.setUserName(fsStoreOrder.getRealName()); //发货地址
+            o.setUserPhone(fsStoreOrder.getUserPhone()); //收货人手机
+            o.setUserAddress(fsStoreOrder.getUserAddress()); //收货地址
+            o.setDiagnose(f.getDiagnose());
+            o.setPrescribeDrug(list); // 在这里添加处方药品列表的值
+            o.setEat(usage.getUsageMethod());
+            o.setUsageFrequencyUnit(usage.getUsageFrequencyUnit());
+            o.setRemark(usage.getRemark());
+            o.setDoctorName(f.getDoctorName());
+            o.setCheck(f.getDoctorDrugName());
+            if (usage.getCounts()!=null){
+                o.setSize(usage.getCounts().toString());
+            }
+            o.setUrl(f.getPrescribeDoctorSignUrl());
+            o.setDrugDoctorUrl(f.getDrugDoctorSignUrl());
+            o.setTotalPrice(fsStoreOrder.getPayPrice());
+            String s = getFsPrescribeStoreZyImg(o);
+
+            FsPrescribe fsPrescribe = new FsPrescribe();
+            fsPrescribe.setPrescribeImgStoreUrl(s);
+            fsPrescribe.setPrescribeId(f.getPrescribeId());
+            fsPrescribeMapper.updateFsPrescribe(fsPrescribe);
+
+    }
+
+    private String getFsPrescribeStoreZyImg(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()+"  "+Drug.get(i*3).getDrugNum()+"克",145,680+i*50);
+            }
+            if (i*3+1<size){
+                pen.drawString(Drug.get(i*3+1).getDrugName()+"  "+Drug.get(i*3+1).getDrugNum()+"克",510,680+i*50);
+            }
+            if (i*3+2<size){
+                pen.drawString(Drug.get(i*3+2).getDrugName()+"  "+Drug.get(i*3+2).getDrugNum()+"克",875,680+i*50);
+            }
+        }
+        penDrawString(pen,o.getEat(),110,1195);
+        penDrawString(pen,o.getUsageFrequencyUnit(),135,1240);
+        penDrawString(pen,o.getRemark(),110,1288);
+
+        // penDrawString(pen,o.getDoctorName(),152,1378);
+        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.getCheck(),348,1378);
+        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 FsPrescribeVO selectFsPrescribeByPrescribeIdVO(Long prescribeId) {
+        FsPrescribeVO f = fsPrescribeMapper.selectFsPrescribeByPrescribeIdVO(prescribeId);
+        return f;
+    }
+
+    @Override
+    public List<FsPrescribeDrug> selectFsPrescribeDrugByPrescribeIdVO(Long prescribeId) {
+        FsPrescribeDrug drug = new FsPrescribeDrug();
+        drug.setPrescribeId(prescribeId);
+        return fsPrescribeDrugMapper.selectFsPrescribeDrugList(drug);
+    }
+
+
+    @Override
+    public void auditPrescribe() {
+        List<FsPrescribe> FsPrescribes=fsPrescribeDrugMapper.selectFsPrescribeNoAudit();
+        for (FsPrescribe fsPrescribe : FsPrescribes) {
+            Long id = doctorMapper.selectFsDoctorType2Ids(fsPrescribe.getPrescribeType());
+            FsPrescribeAuditParam param=new FsPrescribeAuditParam();
+            param.setDoctorId(id);
+            param.setStatus(1);
+            param.setPrescribeId(fsPrescribe.getPrescribeId());
+            audit(param);
+        }
+    }
+
+    @Override
+    @Transactional
+    public R audit(FsPrescribeAuditParam param){
+        FsPrescribe prescribe=this.selectFsPrescribeByPrescribeId(param.getPrescribeId());
+        if(prescribe.getStatus()!=0){
+            return R.error("非法操作");
+        }
+        FsPrescribe map=new FsPrescribe();
+        map.setPrescribeId(param.getPrescribeId());
+        map.setDrugDoctorId(param.getDoctorId());
+        map.setStatus(param.getStatus());
+        map.setAuditReason(param.getAuditReason());
+        map.setAuditTime(new Date());
+        FsDoctor doctor=doctorService.selectFsDoctorByDoctorId(map.getDrugDoctorId());
+        if(StringUtils.isNotEmpty(doctor.getSignUrl())){
+            map.setDrugDoctorSignUrl(doctor.getSignUrl());
+        }
+        if(param.getStatus().equals(1)){
+            this.updateFsPrescribe(map);
+            //写入订单
+            storeOrderService.createOrderByPrescribe(prescribe.getPrescribeId());
+            //发送信息
+            String orderId=prescribe.getInquiryOrderId().toString();
+            MsgDTO msgDTO=new MsgDTO();
+            MsgCustomDTO customDTO=new MsgCustomDTO();
+            FsInquiryOrder fsInquiryOrder = fsInquiryOrderMapper.selectFsInquiryOrderByOrderId(prescribe.getInquiryOrderId());
+            customDTO.setType("inquiry");
+            customDTO.setOrderId(orderId);
+            customDTO.setImType(1);
+            customDTO.setOrderType(fsInquiryOrder.getOrderType());
+            msgDTO.setCloudCustomData(JSONUtil.toJsonStr(customDTO));
+            msgDTO.setFrom_Account("D-"+prescribe.getDoctorId());
+            msgDTO.setTo_Account("U-"+prescribe.getUserId());
+            List<MsgDataDTO> msgs=new ArrayList<>();
+            MsgDataDTO msg=new MsgDataDTO();
+            String ext= JSONUtil.toJsonStr(prescribe);
+
+            msg.setMsgContent(new MsgDataFormatDTO("prescribe",ext,orderId));
+            msg.setMsgType("TIMCustomElem");//TIMCustomElem
+            msgs.add(msg);
+            msgDTO.setMsgBody(msgs);
+            imService.sendMsg(msgDTO);
+            return R.ok();
+        }
+        return R.ok("操作成功");
+
+    }
+
+    public void penDrawString( Graphics2D pen,String value,int x,int y){
+        if (value!=null){
+            pen.drawString(value,x,y);
+        }
+    }
+}

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

@@ -1,6 +1,7 @@
 package com.fs.hisStore.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.date.DateTime;
 import cn.hutool.core.util.IdUtil;
 import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson.JSON;
@@ -13,11 +14,20 @@ import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.company.service.ICompanyService;
 import com.fs.core.config.WxPayProperties;
+import com.fs.core.utils.OrderCodeUtils;
 import com.fs.erp.dto.BaseResponse;
 import com.fs.erp.dto.ErpRefundUpdateRequest;
 import com.fs.erp.service.IErpOrderService;
+import com.fs.his.config.FsSysConfig;
+import com.fs.his.domain.*;
+import com.fs.his.enums.FsStoreAfterSalesStatusEnum;
+import com.fs.his.enums.FsStoreOrderStatusEnum;
+import com.fs.his.mapper.*;
 import com.fs.his.utils.ConfigUtil;
+import com.fs.his.vo.FsStoreAfterSalesExcelVO;
+import com.fs.his.vo.FsStoreAfterSalesLogsVO;
 import com.fs.hisStore.enums.SysConfigEnum;
+import com.fs.hisStore.mapper.*;
 import com.fs.hisStore.param.*;
 import com.fs.huifuPay.domain.HuiFuRefundResult;
 import com.fs.huifuPay.sdk.opps.core.request.V2TradePaymentScanpayRefundRequest;
@@ -29,13 +39,17 @@ import com.fs.hisStore.dto.StoreOrderProductDTO;
 import com.fs.hisStore.enums.AfterSalesStatusEnum;
 import com.fs.hisStore.enums.AfterStatusEnum;
 import com.fs.hisStore.enums.OrderInfoEnum;
-import com.fs.hisStore.mapper.FsStoreAfterSalesScrmMapper;
-import com.fs.hisStore.mapper.FsStoreOrderItemScrmMapper;
 import com.fs.hisStore.service.*;
 import com.fs.hisStore.vo.FsStoreAfterSalesQueryVO;
 import com.fs.hisStore.vo.FsStoreAfterSalesVO;
 import com.fs.hisStore.vo.FsStoreOrderItemVO;
+import com.fs.system.domain.SysConfig;
+import com.fs.system.mapper.SysConfigMapper;
 import com.fs.system.service.ISysConfigService;
+import com.fs.tzBankPay.TzBankService.TzBankService;
+import com.fs.tzBankPay.doman.RefundParam;
+import com.fs.tzBankPay.doman.RefundResult;
+import com.fs.tzBankPay.doman.TzBankResult;
 import com.github.binarywang.wxpay.bean.request.WxPayRefundRequest;
 import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest;
 import com.github.binarywang.wxpay.bean.result.WxPayRefundQueryResult;
@@ -43,10 +57,12 @@ import com.github.binarywang.wxpay.bean.result.WxPayRefundResult;
 import com.github.binarywang.wxpay.config.WxPayConfig;
 import com.github.binarywang.wxpay.exception.WxPayException;
 import com.github.binarywang.wxpay.service.WxPayService;
+import com.google.gson.Gson;
 import lombok.Synchronized;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
@@ -94,8 +110,26 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
     @Autowired
     IErpOrderService erpOrderService;
     @Autowired
+    @Qualifier("hzOMSErpOrderServiceImpl")
+    private IErpOrderService hzOMSerpOrderService;
+
+    @Autowired
+    @Qualifier("dfOrderServiceImpl")
+    private IErpOrderService dfOrderService;
+
+    @Autowired
+    @Qualifier("wdtErpOrderServiceImpl")
+    private IErpOrderService wdtErpOrderService;
+
+    @Autowired
+    @Qualifier("JSTErpOrderServiceImpl")
+    private IErpOrderService jSTOrderService;
+    @Autowired
     private ISysConfigService configService;
 
+    @Autowired
+    SysConfigMapper sysConfigMapper;
+
     @Autowired
     IFsUserScrmService userService;
 
@@ -111,6 +145,37 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
     @Autowired
     private ConfigUtil configUtil;
 
+    @Autowired
+    private FsStoreAfterSalesLogsScrmMapper fsStoreAfterSalesLogsMapper;
+
+    @Autowired
+    private FsStoreScrmMapper fsStoreMapper;
+
+    @Autowired
+    private FsStoreOrderScrmMapper fsStoreOrderMapper;
+    //fsStoreOrderService
+    @Autowired
+    private IFsStoreOrderScrmService fsStoreOrderService;
+    //fsPackageOrderMapper
+    @Autowired
+    private FsPackageOrderMapper fsPackageOrderMapper;
+    //fsInquiryOrderMapper
+    @Autowired
+    private FsInquiryOrderMapper fsInquiryOrderMapper;
+    @Autowired
+    //fsStorePaymentMapper
+    private FsStorePaymentScrmMapper fsStorePaymentMapper;
+    @Autowired
+    //fsStoreOrderLogsMapper
+    private FsStoreOrderLogsScrmMapper fsStoreOrderLogsMapper;
+    @Autowired
+    IFsStoreOrderBillLogScrmService fsStoreOrderBillLogService;
+
+    @Autowired
+    FsInquiryOrderMapper inquiryOrderMapper;
+
+    @Autowired
+    private TzBankService tzBankService;
 
     /**
      * 查询售后记录
@@ -427,14 +492,14 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
 //    @Override
 //    public R audit(FsStoreAfterSalesAudit1Param param) {
 //
-//        FsStoreAfterSales storeAfterSales = fsStoreAfterSalesMapper.selectFsStoreAfterSalesById(param.getSalesId());
+//        FsStoreAfterSalesScrm storeAfterSales = fsStoreAfterSalesMapper.selectFsStoreAfterSalesById(param.getSalesId());
 //        if (storeAfterSales == null) {
 //            throw new CustomException("未查询到售后订单信息");
 //        }
 //        if (!storeAfterSales.getStatus().equals(AfterSalesStatusEnum.STATUS_0.getValue())) {
 //            throw new CustomException("非法操作");
 //        }
-//        FsStoreOrder order=orderService.selectFsStoreOrderByOrderCode(storeAfterSales.getOrderCode());
+//        FsStoreOrderScrm order=orderService.selectFsStoreOrderByOrderCode(storeAfterSales.getOrderCode());
 //        if(param.getRefundAmount().compareTo(order.getPayPrice())==1){
 //            return R.error("退款金额不能大于支付金额");
 //        }
@@ -465,7 +530,7 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
 //                }
 //                else{
 //                    //将钱退还给用户
-//                    FsStorePayment payment=paymentService.selectFsStorePaymentByOrderId(order.getId());
+//                    FsStorePaymentScrm payment=paymentService.selectFsStorePaymentByOrderId(order.getId());
 //                    if(payment!=null){
 //                        RefundDTO refundDTO=new RefundDTO();
 //                        refundDTO.setMerchOrderNo(Ids.oid());
@@ -973,4 +1038,384 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
             return R.error(response.getErrorDesc());
         }
     }
+
+    @Override
+    public List<FsStoreAfterSalesExcelVO> selectFsStoreAfterSalesExcelListVO(com.fs.his.param.FsStoreAfterSalesParam fsStoreAfterSales) {
+        return fsStoreAfterSalesMapper.selectFsStoreAfterSalesExcelListVO(fsStoreAfterSales);
+    }
+
+    @Override
+    public FsStoreAfterSalesVO selectFsStoreAfterSalesVOById(Long id) {
+        return fsStoreAfterSalesMapper.selectFsStoreAfterSalesVOById(id);
+    }
+
+    @Override
+    public List<FsStoreAfterSalesItemScrm> selectFsStoreAfterSalesItemById(Long id) {
+        return fsStoreAfterSalesMapper.selectFsStoreAfterSalesItemById(id);
+    }
+
+    @Override
+    public List<FsStoreAfterSalesLogsVO> selectFsStoreAfterSalesLogById(Long id) {
+        return fsStoreAfterSalesMapper.selectFsStoreAfterSalesLogById(id);
+    }
+
+    @Override
+    public Long selectFsOrderIdByCode(Long id) {
+        return fsStoreAfterSalesMapper.selectFsOrderIdByCode(id);
+    }
+
+    @Override
+    public int auditing(FsStoreAfterSalesScrm fsStoreAfterSales) {
+        FsStoreAfterSalesScrm order = fsStoreAfterSalesMapper.selectFsStoreAfterSalesById(fsStoreAfterSales.getId());
+        if (order == null) {
+
+            throw new CustomException("订单不存在");
+        }
+        if (order.getSalesStatus() != 0) {
+            throw new CustomException("非法更改");
+        }
+        Integer status = null;
+        FsStoreAfterSalesScrm fs = new FsStoreAfterSalesScrm();
+        if (order.getOrderStatus() == 2) {
+            status = 3;
+        } else if (order.getOrderStatus() == 3) {
+            FsStoreScrm fsStore = fsStoreMapper.selectFsStoreByStoreId(order.getStoreId());
+            fs.setPhoneNumber(fsStore.getRefundPhone());
+            fs.setAddress(fsStore.getRefundAddress());
+            fs.setConsignee(fsStore.getRefundConsignee());
+            status = 2;
+        } else if (order.getOrderStatus() == 4) {
+            FsStoreScrm fsStore = fsStoreMapper.selectFsStoreByStoreId(order.getStoreId());
+            fs.setPhoneNumber(fsStore.getRefundPhone());
+            fs.setAddress(fsStore.getRefundAddress());
+            fs.setConsignee(fsStore.getRefundConsignee());
+            status = 1;
+        }
+
+        fs.setId(fsStoreAfterSales.getId());
+        fs.setStatus(status);
+        int i = fsStoreAfterSalesMapper.updateFsStoreAfterSales(fs);
+        FsStoreAfterSalesLogsScrm logs = new FsStoreAfterSalesLogsScrm();
+        logs.setChangeTime(new DateTime());
+        logs.setChangeType(FsStoreAfterSalesStatusEnum.STATUS_1.getValue());
+        logs.setStoreAfterSalesId(fsStoreAfterSales.getId());
+        logs.setChangeMessage(FsStoreAfterSalesStatusEnum.STATUS_1.getDesc());
+        logs.setOperator(fsStoreAfterSales.getOperator());
+        fsStoreAfterSalesLogsMapper.insertFsStoreAfterSalesLogs(logs);
+        return 1;
+    }
+
+    @Override
+    public int depotAuditing(FsStoreAfterSalesScrm fsStoreAfterSales) {
+        FsStoreAfterSalesScrm order = fsStoreAfterSalesMapper.selectFsStoreAfterSalesById(fsStoreAfterSales.getId());
+        if (order == null) throw new CustomException("订单不存在");
+        if (order.getSalesStatus() != 0) throw new CustomException("非法更改");
+        if (order.getStatus() != 2) {
+            throw new CustomException("非法更改");
+        }
+        FsStoreAfterSalesScrm fs = new FsStoreAfterSalesScrm();
+        fs.setId(fsStoreAfterSales.getId());
+        fs.setStatus(3);
+        int i = fsStoreAfterSalesMapper.updateFsStoreAfterSales(fs);
+        FsStoreAfterSalesLogsScrm logs = new FsStoreAfterSalesLogsScrm();
+        logs.setChangeTime(new DateTime());
+        logs.setChangeType(FsStoreAfterSalesStatusEnum.STATUS_3.getValue());
+        logs.setStoreAfterSalesId(fsStoreAfterSales.getId());
+        logs.setChangeMessage(FsStoreAfterSalesStatusEnum.STATUS_3.getDesc());
+        logs.setOperator(fsStoreAfterSales.getOperator());
+        fsStoreAfterSalesLogsMapper.insertFsStoreAfterSalesLogs(logs);
+        return 1;
+    }
+
+    @Override
+    public int noAuditing(FsStoreAfterSalesScrm fsStoreAfterSales) {
+        FsStoreAfterSalesScrm order = fsStoreAfterSalesMapper.selectFsStoreAfterSalesById(fsStoreAfterSales.getId());
+        if (order == null) throw new CustomException("订单不存在");
+        if (order.getSalesStatus() != 0) {
+            throw new CustomException("非法更改");
+        }
+        if (order.getStatus() == 5) {
+            throw new CustomException("非法更改");
+        }
+        FsStoreAfterSalesScrm fs = new FsStoreAfterSalesScrm();
+        fs.setId(fsStoreAfterSales.getId());
+        fs.setSalesStatus(2);
+        fs.setStatus(5);
+        int i = fsStoreAfterSalesMapper.updateFsStoreAfterSales(fs);
+        FsStoreAfterSalesLogsScrm logs = new FsStoreAfterSalesLogsScrm();
+        logs.setChangeTime(new DateTime());
+        logs.setChangeType(FsStoreAfterSalesStatusEnum.STATUS_6.getValue());
+        logs.setStoreAfterSalesId(fsStoreAfterSales.getId());
+        logs.setChangeMessage(FsStoreAfterSalesStatusEnum.STATUS_6.getDesc() + " " + fsStoreAfterSales.getRemark());
+        logs.setOperator(fsStoreAfterSales.getOperator());
+        fsStoreAfterSalesLogsMapper.insertFsStoreAfterSalesLogs(logs);
+//        FsStoreOrderLogsScrm Logs = new FsStoreOrderLogsScrm();
+//        Logs.setChangeMessage("已取消退款");
+//        Logs.setOrderId(order.getOrderId());
+//        Logs.setChangeTime(new DateTime());
+//        Logs.setChangeType(order.getOrderStatus().toString());
+//        fsStoreOrderLogsMapper.insertFsStoreOrderLogs(Logs);
+        FsStoreOrderScrm or = new FsStoreOrderScrm();
+        or.setId(order.getOrderId());
+        or.setStatus(order.getOrderStatus());
+        fsStoreOrderMapper.updateFsStoreOrder(or);
+        if (order.getOrderStatus() == 2) {
+            FsStoreOrderScrm fsStoreOrder = fsStoreOrderMapper.selectFsStoreOrderById(order.getOrderId());
+            String newOrderSn = OrderCodeUtils.getOrderSn();
+            if (StringUtils.isEmpty(newOrderSn)) {
+                newOrderSn = OrderCodeUtils.getOrderSn();
+            }
+            FsStoreOrderScrm newOrder = new FsStoreOrderScrm();
+            newOrder.setId(order.getOrderId());
+            newOrder.setOrderCode(newOrderSn);
+            fsStoreOrderMapper.updateFsStoreOrder(newOrder);
+            or.setOrderCode(newOrderSn);
+            if (fsStoreOrder.getPackageOrderId() != null) {
+                FsPackageOrder fsPackageOrder = new FsPackageOrder();
+                fsPackageOrder.setOrderId(fsStoreOrder.getPackageOrderId());
+                fsPackageOrder.setOrderSn(newOrderSn);
+                fsPackageOrderMapper.updateFsPackageOrder(fsPackageOrder);
+            }
+            if (fsStoreOrder.getInquiryOrderId() != null) {
+                FsInquiryOrder fsInquiryOrder = new FsInquiryOrder();
+                fsInquiryOrder.setOrderSn(newOrderSn);
+                fsInquiryOrder.setOrderId(fsStoreOrder.getInquiryOrderId());
+                fsInquiryOrderMapper.updateFsInquiryOrder(fsInquiryOrder);
+            }
+
+            List<FsStorePaymentScrm> payments = fsStorePaymentMapper.selectFsStorePaymentByPay(2, fsStoreOrder.getId());
+            if (fsStoreOrder.getPackageOrderId() != null) {
+                payments = fsStorePaymentMapper.selectFsStorePaymentByPay(3, fsStoreOrder.getPackageOrderId());
+            }
+            for (FsStorePaymentScrm payment : payments) {
+                FsStorePaymentScrm fsStorePayment = new FsStorePaymentScrm();
+                fsStorePayment.setPaymentId(payment.getPaymentId());
+                fsStorePayment.setBusinessCode(newOrderSn);
+                fsStorePaymentMapper.updateFsStorePayment(fsStorePayment);
+            }
+
+            try {
+                fsStoreOrderService.createOmsOrder(order.getOrderId());
+            } catch (ParseException e) {
+                logger.error(e.getMessage());
+            }
+
+        }
+
+
+        return 1;
+    }
+
+    @Override
+    public int storeRefundMoney(FsStoreAfterSalesScrm fsStoreAfterSales) {
+        FsStoreAfterSalesScrm order = fsStoreAfterSalesMapper.selectFsStoreAfterSalesById(fsStoreAfterSales.getId());
+        FsStoreOrderScrm fsStoreOrder = fsStoreOrderMapper.selectFsStoreOrderById(order.getOrderId());
+        if (order == null) throw new CustomException("订单不存在");
+        if (order.getStatus() != 3) throw new CustomException("非法更改");
+        //更改售后订单状态
+        FsStoreAfterSalesScrm fs = new FsStoreAfterSalesScrm();
+        fs.setId(fsStoreAfterSales.getId());
+        fs.setStatus(4);
+        fs.setSalesStatus(3);
+        int i = fsStoreAfterSalesMapper.updateFsStoreAfterSales(fs);
+        FsStoreAfterSalesLogsScrm logs = new FsStoreAfterSalesLogsScrm();
+        logs.setChangeTime(new DateTime());
+        logs.setChangeType(FsStoreAfterSalesStatusEnum.STATUS_4.getValue());
+        logs.setStoreAfterSalesId(fsStoreAfterSales.getId());
+        logs.setChangeMessage(FsStoreAfterSalesStatusEnum.STATUS_4.getDesc());
+        logs.setOperator(fsStoreAfterSales.getOperator());
+        fsStoreAfterSalesLogsMapper.insertFsStoreAfterSalesLogs(logs);
+        //更改订单状态
+        FsStoreOrderScrm or = new FsStoreOrderScrm();
+        or.setId(order.getOrderId());
+        or.setStatus(-2);
+        or.setRefundTime(DateUtils.getNowDate());
+        fsStoreOrderMapper.updateFsStoreOrder(or);
+        FsStoreOrderLogsScrm Logs = new FsStoreOrderLogsScrm();
+        Logs.setChangeMessage(FsStoreOrderStatusEnum.REFUND_STATUS_2.getDesc());
+        Logs.setOrderId(order.getOrderId());
+        Logs.setChangeTime(new DateTime());
+        Logs.setChangeType(FsStoreOrderStatusEnum.REFUND_STATUS_2.getValue().toString());
+        fsStoreOrderLogsMapper.insertFsStoreOrderLogs(Logs);
+        BigDecimal reMoney = order.getRefundAmount();
+        String orderType = "store";
+        // 开票冲红
+        fsStoreOrderBillLogService.billBackByOrderId(fsStoreOrder.getId());
+
+
+        if (fsStoreOrder.getPackageOrderId() != null) {
+            orderType = "package";
+            FsPackageOrder fsPackageOrder = fsPackageOrderMapper.selectFsPackageOrderByOrderId(fsStoreOrder.getPackageOrderId());
+            if (fsPackageOrder != null) {
+                fsPackageOrder.setStatus(-2);
+                fsPackageOrder.setRefundStatus(2);
+                fsPackageOrderMapper.updateFsPackageOrder(fsPackageOrder);
+            }
+            if (fsPackageOrder.getInquiryOrderId() != null) {
+                FsInquiryOrder fsInquiryOrder = new FsInquiryOrder();
+                fsInquiryOrder.setOrderId(fsPackageOrder.getInquiryOrderId());
+                fsInquiryOrder.setStatus(-2);
+                inquiryOrderMapper.updateFsInquiryOrder(fsInquiryOrder);
+            }
+
+        }
+        //商品增加库存
+        //退库存
+        //获取订单下的商品
+//        List<FsStoreOrderItem> orderItem=fsStoreOrderItemMapper.selectFsStoreOrderItemListByOrderId(order.getOrderId());
+//        for(FsStoreOrderItem vo:orderItem){
+//            if(vo.getIsAfterSales()==1){
+//                logger.info("退库存"+vo.getNum()+":"+vo.getProductId());
+//                productService.incProductStock(vo.getNum(), vo.getProductId(), vo.getProductAttrValueId());
+//            }
+//        }
+        if (order.getCompanyId() != null) {
+            companyService.refundCompanyMoneyScrm(fsStoreOrder);
+        }
+
+//        if (fsStoreOrder.getPackageOrderId()!=null){
+//            fsUserService.subUserIntegral(fsStoreOrder.getUserId(),fsStoreOrder.getPackageOrderId(),3);
+//        }else {
+//            fsUserService.subUserIntegral(fsStoreOrder.getUserId(),fsStoreOrder.getOrderId(),2);
+//        }
+
+        List<FsStorePaymentScrm> payments = fsStorePaymentMapper.selectFsStorePaymentByPay(2, fsStoreOrder.getId());
+        if (fsStoreOrder.getPackageOrderId() != null) {
+
+            payments = fsStorePaymentMapper.selectFsStorePaymentByPay(3, fsStoreOrder.getPackageOrderId());
+        }
+        if (payments != null && payments.size() > 0) {
+            FsStorePaymentScrm payment = payments.get(0);
+            String json = configService.selectConfigByKey("his.pay");
+            if (payment.getPayMode().equals("wx")) {
+                WxPayConfig payConfig = new WxPayConfig();
+                SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("his.pay");
+                FsPayConfig fsPayConfig = new Gson().fromJson(sysConfig.getConfigValue(), FsPayConfig.class);
+                payConfig.setAppId(fsPayConfig.getAppId());
+                payConfig.setMchId(fsPayConfig.getWxMchId());
+                payConfig.setMchKey(fsPayConfig.getWxMchKey());
+                payConfig.setKeyPath(wxPayProperties.getKeyPath());
+                payConfig.setSubAppId(org.apache.commons.lang3.StringUtils.trimToNull(null));
+                payConfig.setSubMchId(org.apache.commons.lang3.StringUtils.trimToNull(null));
+                wxPayService.setConfig(payConfig);
+                WxPayRefundRequest refundRequest = new WxPayRefundRequest();
+                refundRequest.setOutTradeNo(orderType + "-" + payment.getPayCode());
+                refundRequest.setOutRefundNo(orderType + "-" + payment.getPayCode());
+                refundRequest.setTotalFee(WxPayUnifiedOrderRequest.yuanToFen(payment.getPayMoney().toString()));
+                refundRequest.setRefundFee(WxPayUnifiedOrderRequest.yuanToFen(payment.getPayMoney().toString()));
+                try {
+                    WxPayRefundResult refundResult = wxPayService.refund(refundRequest);
+                    WxPayRefundQueryResult refundQueryResult = wxPayService.refundQuery("", refundResult.getOutTradeNo(), refundResult.getOutRefundNo(), refundResult.getRefundId());
+                    if (refundQueryResult != null && refundQueryResult.getResultCode().equals("SUCCESS")) {
+                        FsStorePaymentScrm paymentMap = new FsStorePaymentScrm();
+                        paymentMap.setPaymentId(payment.getPaymentId());
+                        paymentMap.setStatus(-1);
+                        paymentMap.setRefundTime(DateUtils.getNowDate());
+                        paymentMap.setRefundMoney(payment.getPayMoney());
+                        fsStorePaymentMapper.updateFsStorePayment(paymentMap);
+                    } else {
+                        throw new CustomException("退款请求失败" + refundQueryResult.getReturnMsg());
+                    }
+                } catch (WxPayException e) {
+                    throw new CustomException("退款请求失败" + e.getReturnMsg());
+                }
+            } else if (payment.getPayMode().equals("yb")) {
+                //易宝
+                com.fs.pay.pay.dto.RefundDTO refundDTO = new com.fs.pay.pay.dto.RefundDTO();
+                refundDTO.setRefundMoney(payment.getPayMoney().toString());
+                refundDTO.setLowRefundNo(orderType + "-" + payment.getPayCode());
+                refundDTO.setUpOrderId(payment.getTradeNo());
+                com.fs.ybPay.domain.RefundResult result = payService.refund(refundDTO);
+                logger.info("订单退款返回结果:退款订单id:" + order.getOrderId() + result);
+                if (result.getState().equals("5")) {
+                    FsStorePaymentScrm paymentMap = new FsStorePaymentScrm();
+                    paymentMap.setPaymentId(payment.getPaymentId());
+                    paymentMap.setStatus(-1);
+                    paymentMap.setRefundTime(DateUtils.getNowDate());
+                    paymentMap.setRefundMoney(payment.getPayMoney());
+                    fsStorePaymentMapper.updateFsStorePayment(paymentMap);
+                } else {
+                    throw new CustomException("退款请求失败" + result.getMessage());
+                }
+            } else if (payment.getPayMode().equals("tz")) {
+                RefundParam tzBankResult = new RefundParam();
+                // 使用set方法为对象的字段赋值
+                //商户原支付订单号
+                tzBankResult.setOldPayOutOrderNo(orderType + payment.getPayCode());
+                // 商户退款订单号 对接平台系统里自己生成的退款订单号
+                tzBankResult.setRefundOrderNo(orderType + payment.getPayCode());
+                // 交易发送时间 yyyyMMddHHmmss
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
+                tzBankResult.setTrxSendTime(sdf.format(new Date()));
+                // 退款金额
+                tzBankResult.setRefundOrdTransAmt(payment.getPayMoney().doubleValue());
+                TzBankResult<RefundResult> result = tzBankService.refund(tzBankResult);
+                logger.info("订单退款返回结果:退款订单id:" + order.getOrderId() + result);
+                if (result.getBody().getRefundOrdStatus().equals("90") || result.getBody().getRefundOrdStatus().equals("60")) {
+                    FsStorePaymentScrm paymentMap = new FsStorePaymentScrm();
+                    paymentMap.setPaymentId(payment.getPaymentId());
+                    paymentMap.setStatus(-1);
+                    paymentMap.setRefundTime(DateUtils.getNowDate());
+                    paymentMap.setRefundMoney(payment.getPayMoney());
+                    fsStorePaymentMapper.updateFsStorePayment(paymentMap);
+                } else {
+                    throw new CustomException("退款请求失败" + result.getRetMsg());
+                }
+            } else if (payment.getPayMode().equals("hf")) {
+                V2TradePaymentScanpayRefundRequest request = new V2TradePaymentScanpayRefundRequest();
+                request.setOrdAmt(payment.getPayMoney().toString());
+                request.setOrgReqDate(new SimpleDateFormat("yyyyMMdd").format(payment.getCreateTime()));
+                request.setReqSeqId("refund-" + payment.getPayCode());
+                Map<String, Object> extendInfoMap = new HashMap<>();
+                extendInfoMap.put("org_req_seq_id", orderType + "-" + payment.getPayCode());
+                request.setExtendInfo(extendInfoMap);
+                HuiFuRefundResult refund = huiFuService.refund(request);
+                logger.info("订单退款返回结果:退款订单id:" + order.getOrderId() + refund);
+                if ((refund.getResp_code().equals("00000000") || refund.getResp_code().equals("00000100")) && (refund.getTrans_stat().equals("S") || refund.getTrans_stat().equals("P"))) {
+                    FsStorePaymentScrm paymentMap = new FsStorePaymentScrm();
+                    paymentMap.setPaymentId(payment.getPaymentId());
+                    paymentMap.setStatus(-1);
+                    paymentMap.setRefundTime(DateUtils.getNowDate());
+                    paymentMap.setRefundMoney(payment.getPayMoney());
+                    fsStorePaymentMapper.updateFsStorePayment(paymentMap);
+                } else {
+                    throw new CustomException("退款请求失败" + refund.getResp_desc());
+                }
+            }
+            //管易作废
+            if (StringUtils.isNotEmpty(fsStoreOrder.getExtendOrderId())) {
+                if (!fsStoreOrder.getExtendOrderId().equals("HIS")) {
+                    ErpRefundUpdateRequest request = new ErpRefundUpdateRequest();
+                    request.setTid(fsStoreOrder.getOrderCode());
+                    request.setOid(fsStoreOrder.getOrderCode());
+                    request.setRefund_state(1);
+                    request.setStoreAfterSalesId(fsStoreAfterSales.getId());
+                    FsSysConfig sysConfig = configUtil.getSysConfig();
+                    Integer erpType = sysConfig.getErpType();
+                    if (erpType == 1) {
+                        erpOrderService.refundUpdate(request);
+                    }else if (erpType == 2) {
+                        //旺店通
+                        wdtErpOrderService.refundUpdate(request);
+                    } else if (erpType == 3) {
+                        //瀚智
+                        hzOMSerpOrderService.refundUpdate(request);
+                    }  else if (erpType == 4) {
+                        dfOrderService.refundUpdate(request);
+                    }else if(erpType == 5){
+                        jSTOrderService.refundUpdate(request);
+                    }
+                }
+            }
+        } else {
+            if (order.getRefundAmount().compareTo(BigDecimal.ZERO) == 0) {
+
+            } else {
+                throw new CustomException("未找的支付明细");
+            }
+        }
+
+
+        return i;
+    }
 }

+ 103 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreBillScrmServiceImpl.java

@@ -0,0 +1,103 @@
+package com.fs.hisStore.service.impl;
+
+import com.fs.common.utils.DateUtils;
+import com.fs.hisStore.domain.FsStoreBillScrm;
+import com.fs.his.param.FsStoreBillParam;
+import com.fs.his.vo.FsStoreBillVO;
+import com.fs.hisStore.mapper.FsStoreBillScrmMapper;
+import com.fs.hisStore.service.IFsStoreBillScrmService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 店铺帐单记录Service业务层处理
+ *
+ * @author fs
+ * @date 2023-06-25
+ */
+@Service
+public class FsStoreBillScrmServiceImpl implements IFsStoreBillScrmService
+{
+    @Autowired
+    private FsStoreBillScrmMapper fsStoreBillMapper;
+
+    /**
+     * 查询店铺帐单记录
+     *
+     * @param billId 店铺帐单记录主键
+     * @return 店铺帐单记录
+     */
+    @Override
+    public FsStoreBillScrm selectFsStoreBillByBillId(Long billId)
+    {
+        return fsStoreBillMapper.selectFsStoreBillByBillId(billId);
+    }
+
+    /**
+     * 查询店铺帐单记录列表
+     *
+     * @param fsStoreBill 店铺帐单记录
+     * @return 店铺帐单记录
+     */
+    @Override
+    public List<FsStoreBillScrm> selectFsStoreBillList(FsStoreBillScrm fsStoreBill)
+    {
+        return fsStoreBillMapper.selectFsStoreBillList(fsStoreBill);
+    }
+
+    /**
+     * 新增店铺帐单记录
+     *
+     * @param fsStoreBill 店铺帐单记录
+     * @return 结果
+     */
+    @Override
+    public int insertFsStoreBill(FsStoreBillScrm fsStoreBill)
+    {
+        fsStoreBill.setCreateTime(DateUtils.getNowDate());
+        return fsStoreBillMapper.insertFsStoreBill(fsStoreBill);
+    }
+
+    /**
+     * 修改店铺帐单记录
+     *
+     * @param fsStoreBill 店铺帐单记录
+     * @return 结果
+     */
+    @Override
+    public int updateFsStoreBill(FsStoreBillScrm fsStoreBill)
+    {
+        return fsStoreBillMapper.updateFsStoreBill(fsStoreBill);
+    }
+
+    /**
+     * 批量删除店铺帐单记录
+     *
+     * @param billIds 需要删除的店铺帐单记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsStoreBillByBillIds(Long[] billIds)
+    {
+        return fsStoreBillMapper.deleteFsStoreBillByBillIds(billIds);
+    }
+
+    /**
+     * 删除店铺帐单记录信息
+     *
+     * @param billId 店铺帐单记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsStoreBillByBillId(Long billId)
+    {
+        return fsStoreBillMapper.deleteFsStoreBillByBillId(billId);
+    }
+
+    @Override
+    public List<FsStoreBillVO> selectFsStoreBillListVO(FsStoreBillParam fsStoreBill) {
+        return fsStoreBillMapper.selectFsStoreBillListVO(fsStoreBill);
+    }
+}

+ 136 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreExtractScrmServiceImpl.java

@@ -0,0 +1,136 @@
+package com.fs.hisStore.service.impl;
+
+import com.fs.common.exception.CustomException;
+import com.fs.common.utils.DateUtils;
+import com.fs.hisStore.domain.FsStoreScrm;
+import com.fs.hisStore.domain.FsStoreBillScrm;
+import com.fs.hisStore.domain.FsStoreExtractScrm;
+import com.fs.his.vo.FsStoreExtractVO;
+import com.fs.hisStore.mapper.FsStoreBillScrmMapper;
+import com.fs.hisStore.mapper.FsStoreExtractScrmMapper;
+import com.fs.hisStore.mapper.FsStoreScrmMapper;
+import com.fs.hisStore.service.IFsStoreExtractScrmService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * 店铺提现管理Service业务层处理
+ *
+ * @author fs
+ * @date 2023-06-25
+ */
+@Service
+public class FsStoreExtractScrmServiceImpl implements IFsStoreExtractScrmService
+{
+    @Autowired
+    private FsStoreExtractScrmMapper fsStoreExtractMapper;
+    @Autowired
+    private FsStoreScrmMapper fsStoreMapper;
+    @Autowired
+    private FsStoreBillScrmMapper fsStoreBillMapper;
+    /**
+     * 查询店铺提现管理
+     *
+     * @param extractId 店铺提现管理主键
+     * @return 店铺提现管理
+     */
+    @Override
+    public FsStoreExtractScrm selectFsStoreExtractByExtractId(String extractId)
+    {
+        return fsStoreExtractMapper.selectFsStoreExtractByExtractId(extractId);
+    }
+
+    /**
+     * 查询店铺提现管理列表
+     *
+     * @param fsStoreExtract 店铺提现管理
+     * @return 店铺提现管理
+     */
+    @Override
+    public List<FsStoreExtractScrm> selectFsStoreExtractList(FsStoreExtractScrm fsStoreExtract)
+    {
+        return fsStoreExtractMapper.selectFsStoreExtractList(fsStoreExtract);
+    }
+
+    /**
+     * 新增店铺提现管理
+     *
+     * @param fsStoreExtract 店铺提现管理
+     * @return 结果
+     */
+    @Transactional
+    @Override
+    public int insertFsStoreExtract(FsStoreExtractScrm fsStoreExtract)
+    {
+        fsStoreExtract.setCreateTime(DateUtils.getNowDate());
+        FsStoreScrm fsStore = fsStoreMapper.selectFsStoreByStoreId(fsStoreExtract.getStoreId());
+
+        BigDecimal result = fsStore.getBalance().subtract(fsStoreExtract.getExtractPrice());
+        if (result.compareTo(BigDecimal.ZERO)<0){
+            throw new CustomException("余额不足");
+        }
+        fsStoreExtract.setBalance(result);
+        fsStore.setBalance(result);
+        fsStoreMapper.updateFsStore(fsStore);
+        FsStoreBillScrm fsStoreBill = new FsStoreBillScrm();
+        fsStoreBill.setStoreId(fsStore.getStoreId());
+        fsStoreBill.setBillType(1);
+        fsStoreBill.setBalance(result);
+        fsStoreBill.setTitle("申请提现");
+        fsStoreBill.setMoney(fsStoreExtract.getExtractPrice());
+        fsStoreBillMapper.insertFsStoreBill(fsStoreBill);
+        return fsStoreExtractMapper.insertFsStoreExtract(fsStoreExtract);
+    }
+
+    /**
+     * 修改店铺提现管理
+     *
+     * @param fsStoreExtract 店铺提现管理
+     * @return 结果
+     */
+    @Override
+    public int updateFsStoreExtract(FsStoreExtractScrm fsStoreExtract)
+    {
+        if (fsStoreExtract!=null)throw new CustomException("非法操作");
+        if (fsStoreExtract.getStatus()!=null&&fsStoreExtract.getStatus()==1){
+            //退款操作
+        }
+
+        fsStoreExtract.setUpdateTime(DateUtils.getNowDate());
+        fsStoreExtract.setFailTime(DateUtils.getNowDate());
+        return fsStoreExtractMapper.updateFsStoreExtract(fsStoreExtract);
+    }
+
+    /**
+     * 批量删除店铺提现管理
+     *
+     * @param extractIds 需要删除的店铺提现管理主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsStoreExtractByExtractIds(String[] extractIds)
+    {
+        return fsStoreExtractMapper.deleteFsStoreExtractByExtractIds(extractIds);
+    }
+
+    /**
+     * 删除店铺提现管理信息
+     *
+     * @param extractId 店铺提现管理主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsStoreExtractByExtractId(String extractId)
+    {
+        return fsStoreExtractMapper.deleteFsStoreExtractByExtractId(extractId);
+    }
+
+    @Override
+    public List<FsStoreExtractVO> selectFsStoreExtractListVO(FsStoreExtractScrm fsStoreExtract) {
+        return fsStoreExtractMapper.selectFsStoreExtractListVO(fsStoreExtract);
+    }
+}

+ 267 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderBillLogScrmServiceImpl.java

@@ -0,0 +1,267 @@
+package com.fs.hisStore.service.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.common.core.domain.R;
+import com.fs.common.utils.DateUtils;
+import com.fs.common.utils.IdUtils;
+import com.fs.his.enums.FsInquiryOrderStatusEnum;
+import com.fs.his.param.BillListParam;
+import com.fs.his.param.OrderBillParam;
+import com.fs.his.vo.FsStoreOrderBillLogVo;
+import com.fs.his.vo.FsStoreOrderItemListDVO;
+import com.fs.hisStore.domain.FsStoreOrderBillLogScrm;
+import com.fs.hisStore.domain.FsStoreOrderScrm;
+import com.fs.hisStore.mapper.FsStoreOrderBillLogScrmMapper;
+import com.fs.hisStore.service.IFsStoreOrderBillLogScrmService;
+import com.fs.hisStore.service.IFsStoreOrderItemScrmService;
+import com.fs.hisStore.service.IFsStoreOrderScrmService;
+import com.fs.huifuPay.sdk.opps.core.utils.StringUtil;
+import com.fs.nuonuo.NuonuoUtils;
+import com.github.pagehelper.PageInfo;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 订单开票记录Service业务层处理
+ *
+ * @author fs
+ * @date 2025-01-07
+ */
+@Slf4j
+@Service
+@AllArgsConstructor
+public class FsStoreOrderBillLogScrmServiceImpl extends ServiceImpl<FsStoreOrderBillLogScrmMapper, FsStoreOrderBillLogScrm> implements IFsStoreOrderBillLogScrmService {
+
+    private final FsStoreOrderBillLogScrmMapper fsStoreOrderBillLogMapper;
+    private final IFsStoreOrderScrmService fsStoreOrderService;
+    private final IFsStoreOrderItemScrmService fsStoreOrderItemService;
+
+    /**
+     * 查询订单开票记录
+     *
+     * @param id 订单开票记录主键
+     * @return 订单开票记录
+     */
+    @Override
+    public FsStoreOrderBillLogScrm selectFsStoreOrderBillLogById(Long id)
+    {
+        return fsStoreOrderBillLogMapper.selectFsStoreOrderBillLogById(id);
+    }
+
+    /**
+     * 查询订单开票记录列表
+     *
+     * @param fsStoreOrderBillLog 订单开票记录
+     * @return 订单开票记录
+     */
+    @Override
+    public List<FsStoreOrderBillLogScrm> selectFsStoreOrderBillLogList(FsStoreOrderBillLogScrm fsStoreOrderBillLog)
+    {
+        return fsStoreOrderBillLogMapper.selectFsStoreOrderBillLogList(fsStoreOrderBillLog);
+    }
+
+    /**
+     * 新增订单开票记录
+     *
+     * @param fsStoreOrderBillLog 订单开票记录
+     * @return 结果
+     */
+    @Override
+    public int insertFsStoreOrderBillLog(FsStoreOrderBillLogScrm fsStoreOrderBillLog)
+    {
+        fsStoreOrderBillLog.setCreateTime(DateUtils.getNowDate());
+        return fsStoreOrderBillLogMapper.insertFsStoreOrderBillLog(fsStoreOrderBillLog);
+    }
+
+    /**
+     * 修改订单开票记录
+     *
+     * @param fsStoreOrderBillLog 订单开票记录
+     * @return 结果
+     */
+    @Override
+    public int updateFsStoreOrderBillLog(FsStoreOrderBillLogScrm fsStoreOrderBillLog)
+    {
+        fsStoreOrderBillLog.setUpdateTime(DateUtils.getNowDate());
+        return fsStoreOrderBillLogMapper.updateFsStoreOrderBillLog(fsStoreOrderBillLog);
+    }
+
+    /**
+     * 批量删除订单开票记录
+     *
+     * @param ids 需要删除的订单开票记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsStoreOrderBillLogByIds(Long[] ids)
+    {
+        return fsStoreOrderBillLogMapper.deleteFsStoreOrderBillLogByIds(ids);
+    }
+
+    /**
+     * 删除订单开票记录信息
+     *
+     * @param id 订单开票记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsStoreOrderBillLogById(Long id){
+        return fsStoreOrderBillLogMapper.deleteFsStoreOrderBillLogById(id);
+    }
+
+    /**
+     * 判断当前时间是否在零点到九点半之间,是否上传接口
+     * @return true:上传,false:不上传
+     */
+    private static boolean time(){
+        // 获取当前时间
+//        LocalTime now = LocalTime.of(22, 0);
+        LocalTime now = LocalTime.now();
+        LocalDateTime dateNow = LocalDateTime.now();
+//        LocalDateTime dateNow = LocalDateTime.of(2025, 2, 14, 0, 0);
+
+        LocalTime start = LocalTime.of(9, 30);
+        LocalTime end = LocalTime.of(22, 0);
+        LocalDate noUploadDate = LocalDate.of(2025, 2, 14);
+
+        // 判断是否在允许上传的时间段内
+        boolean isUploadTime = !now.isBefore(start) && !now.isAfter(end);
+        // 判断是否是禁止上传的日期
+        boolean isNoUploadDate = dateNow.toLocalDate().equals(noUploadDate);
+
+        if (!isUploadTime || isNoUploadDate) {
+            log.info("当前时间{}不提交开票接口", now);
+            return false;
+        } else {
+            log.info("当前时间{}上传开票", now);
+            return true;
+        }
+    }
+
+    @Override
+    @Transactional
+    public R bill(OrderBillParam param) {
+        FsStoreOrderScrm fsStoreOrder = fsStoreOrderService.selectFsStoreOrderByOrderId(param.getOrderId());
+        if(fsStoreOrder.getStatus() != FsInquiryOrderStatusEnum.STATUS_4.getValue()){
+            return R.error("订单未完成无法开票");
+        }
+        try {
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            Date targetDate = sdf.parse("2025-01-01");
+            // 判断当前日期是否小于2025-01-01
+            if (fsStoreOrder.getFinishTime().before(targetDate)) {
+                return R.error("仅限于2025-01-01以后的订单开票,如需开具之前的发票,请联系客服!");
+            }
+        } catch (ParseException e) {
+            return R.error("日期格式错误");
+        }
+        if(param.getAmount().add(fsStoreOrder.getBillPrice()).compareTo(fsStoreOrder.getPayPrice()) > 0){
+            return R.error("开票金额不能大于订单金额");
+        }
+        fsStoreOrder.setBillPrice(fsStoreOrder.getBillPrice().add(param.getAmount()));
+        fsStoreOrderService.updateFsStoreOrder(fsStoreOrder);
+        StringBuilder sb;
+        if(StringUtil.isEmpty(param.getMemoStr())){
+            sb = new StringBuilder(StringUtil.isEmpty(fsStoreOrder.getRealName()) ? "" : fsStoreOrder.getRealName() + "    ");
+            if(param.isMemo()){
+                List<FsStoreOrderItemListDVO> items = fsStoreOrderItemService.selectFsStoreOrderItemListDVOByOrderId(param.getOrderId());
+                items.forEach(item->{
+                    JSONObject json = JSON.parseObject(item.getJsonInfo());
+                    sb.append(json.getString("productName")).append("  ").append(json.getString("num")).append("    ");
+                });
+            }
+        }else{
+            sb = new StringBuilder(param.getMemoStr());
+        }
+        FsStoreOrderBillLogScrm log = new FsStoreOrderBillLogScrm();
+        String orderNo = IdUtils.getPrimaryKey();
+        String no = "";
+        if(time()){
+            no = NuonuoUtils.requestBilling(orderNo, param.getSaleName(), param.getSaleNo(), param.getAmount(), sb.toString());
+            log.setUploadApi(1);
+        }
+        log.setOrderCode(fsStoreOrder.getOrderCode());
+        log.setOrderAmount(param.getAmount());
+        log.setPayerName(param.getSaleName());
+        log.setPayerTaxNo(param.getSaleNo());
+        log.setOrderId(param.getOrderId());
+        log.setBillType(param.getBillType());
+        log.setOrderNo(orderNo);
+        log.setSerialNo(no);
+        log.setStatus(20);
+        log.setCreateTime(DateUtils.getNowDate());
+        log.setCreateBy(param.getUserId().toString());
+        log.setUpdateBy(param.getUserId().toString());
+        log.setUpdateTime(DateUtils.getNowDate());
+        log.setRemark(sb.toString());
+        save(log);
+        return R.ok();
+    }
+
+    @Override
+    public PageInfo<FsStoreOrderBillLogVo> billList(BillListParam param) {
+        List<FsStoreOrderBillLogScrm> list = list(new QueryWrapper<FsStoreOrderBillLogScrm>().eq(param.getOrderId() != null, "order_id", param.getOrderId()).eq("create_by", param.getUserId()).orderByDesc("create_time"));
+        PageInfo<FsStoreOrderBillLogScrm> listPageInfo=new PageInfo<>(list);
+        PageInfo<FsStoreOrderBillLogVo> pageInfo = new PageInfo<>();
+        BeanUtils.copyProperties(listPageInfo, pageInfo);
+        pageInfo.setList(list.stream().map(e -> {
+            FsStoreOrderBillLogVo vo = new FsStoreOrderBillLogVo();
+            BeanUtils.copyProperties(e, vo);
+            return vo;
+        }).collect(Collectors.toList()));
+        return pageInfo;
+    }
+
+    @Override
+    public R billBack(Long id) {
+        FsStoreOrderBillLogScrm log = getById(id);
+        if(log.getStatus() != 2) return R.error("发票无法冲红");
+        return R.ok();
+    }
+
+    private void back(FsStoreOrderBillLogScrm log){
+        String s = NuonuoUtils.saveInvoiceRedConfirm(log.getInvoiceNo(), 2, log.getPayerName());
+        log.setRedNo(s);
+        log.setRedStatus("01");
+        log.setRedReason(2);
+        log.setRedTime(LocalDateTime.now());
+        updateById(log);
+    }
+
+    @Override
+    public R billBackByOrderId(Long orderId) {
+        List<FsStoreOrderBillLogScrm> list = list(new QueryWrapper<FsStoreOrderBillLogScrm>().eq("order_id", orderId).eq("status", 2));
+        list.forEach(this::back);
+        return null;
+    }
+
+    @Override
+    public R reopen(Long id) {
+        FsStoreOrderBillLogScrm byId = getById(id);
+        if(byId == null) return R.error("ID错误");
+        OrderBillParam param = new OrderBillParam();
+        param.setOrderId(byId.getOrderId());
+        param.setBillType(byId.getBillType());
+        param.setSaleName(byId.getPayerName());
+        param.setSaleNo(byId.getPayerTaxNo());
+        param.setAmount(byId.getOrderAmount());
+        param.setMemoStr(byId.getRemark());
+        param.setUserId(Long.parseLong(byId.getCreateBy()));
+        return this.bill(param);
+    }
+}

+ 7 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderItemScrmServiceImpl.java

@@ -1,7 +1,9 @@
 package com.fs.hisStore.service.impl;
 
+import java.util.Collections;
 import java.util.List;
 
+import com.fs.his.vo.FsStoreOrderItemListDVO;
 import com.fs.hisStore.param.FsStoreOrderParam;
 import com.fs.hisStore.vo.FsStoreOrderItemExportVO;
 import com.fs.hisStore.vo.FsStoreOrderItemVO;
@@ -114,4 +116,9 @@ public class FsStoreOrderItemScrmServiceImpl implements IFsStoreOrderItemScrmSer
     public int updateFsStoreOrderCode(Long orderId, String orderCode) {
         return fsStoreOrderItemMapper.updateFsStoreOrderCode(orderId,orderCode);
     }
+
+    @Override
+    public List<FsStoreOrderItemListDVO> selectFsStoreOrderItemListDVOByOrderId(Long orderId) {
+        return fsStoreOrderItemMapper.selectFsStoreOrderItemListDVOByOrderId(orderId);
+    }
 }

+ 105 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderLogsScrmServiceImpl.java

@@ -0,0 +1,105 @@
+package com.fs.hisStore.service.impl;
+
+import com.fs.hisStore.domain.FsStoreOrderLogsScrm;
+import com.fs.hisStore.mapper.FsStoreOrderLogsScrmMapper;
+import com.fs.hisStore.service.IFsStoreOrderLogsScrmService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 订单操作记录Service业务层处理
+ *
+ * @author fs
+ * @date 2023-08-11
+ */
+@Service
+public class FsStoreOrderLogsScrmServiceImpl implements IFsStoreOrderLogsScrmService
+{
+    @Autowired
+    private FsStoreOrderLogsScrmMapper fsStoreOrderLogsMapper;
+
+    /**
+     * 查询订单操作记录
+     *
+     * @param logsId 订单操作记录主键
+     * @return 订单操作记录
+     */
+    @Override
+    public FsStoreOrderLogsScrm selectFsStoreOrderLogsByLogsId(String logsId)
+    {
+        return fsStoreOrderLogsMapper.selectFsStoreOrderLogsByLogsId(logsId);
+    }
+
+    /**
+     * 查询订单操作记录列表
+     *
+     * @param fsStoreOrderLogs 订单操作记录
+     * @return 订单操作记录
+     */
+    @Override
+    public List<FsStoreOrderLogsScrm> selectFsStoreOrderLogsList(FsStoreOrderLogsScrm fsStoreOrderLogs)
+    {
+        return fsStoreOrderLogsMapper.selectFsStoreOrderLogsList(fsStoreOrderLogs);
+    }
+
+    /**
+     * 新增订单操作记录
+     *
+     * @param fsStoreOrderLogs 订单操作记录
+     * @return 结果
+     */
+    @Override
+    public int insertFsStoreOrderLogs(FsStoreOrderLogsScrm fsStoreOrderLogs)
+    {
+        return fsStoreOrderLogsMapper.insertFsStoreOrderLogs(fsStoreOrderLogs);
+    }
+
+    /**
+     * 修改订单操作记录
+     *
+     * @param fsStoreOrderLogs 订单操作记录
+     * @return 结果
+     */
+    @Override
+    public int updateFsStoreOrderLogs(FsStoreOrderLogsScrm fsStoreOrderLogs)
+    {
+        return fsStoreOrderLogsMapper.updateFsStoreOrderLogs(fsStoreOrderLogs);
+    }
+
+    /**
+     * 批量删除订单操作记录
+     *
+     * @param logsIds 需要删除的订单操作记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsStoreOrderLogsByLogsIds(String[] logsIds)
+    {
+        return fsStoreOrderLogsMapper.deleteFsStoreOrderLogsByLogsIds(logsIds);
+    }
+
+    /**
+     * 删除订单操作记录信息
+     *
+     * @param logsId 订单操作记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsStoreOrderLogsByLogsId(String logsId)
+    {
+        return fsStoreOrderLogsMapper.deleteFsStoreOrderLogsByLogsId(logsId);
+    }
+
+    @Override
+    public int create(Long orderId, String type, String msg) {
+        FsStoreOrderLogsScrm logs=new FsStoreOrderLogsScrm();
+        logs.setOrderId(orderId);
+        logs.setChangeType(type);
+        logs.setChangeMessage(msg);
+        logs.setCreateTime(new Date());
+        return fsStoreOrderLogsMapper.insertFsStoreOrderLogs(logs);
+    }
+}

+ 648 - 10
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderScrmServiceImpl.java

@@ -1,5 +1,6 @@
 package com.fs.hisStore.service.impl;
 
+import cn.hutool.core.date.DateTime;
 import cn.binarywang.wx.miniapp.api.WxMaService;
 import cn.hutool.core.net.URLDecoder;
 import cn.hutool.core.util.IdUtil;
@@ -20,6 +21,7 @@ import com.fs.common.event.TemplateBean;
 import com.fs.common.event.TemplateEvent;
 import com.fs.common.event.TemplateListenEnum;
 import com.fs.common.exception.CustomException;
+import com.fs.common.exception.ServiceException;
 import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.company.domain.Company;
@@ -34,21 +36,40 @@ import com.fs.company.service.ICompanyService;
 import com.fs.company.service.ICompanyUserService;
 import com.fs.core.config.WxMaConfiguration;
 import com.fs.core.config.WxPayProperties;
+import com.fs.core.utils.OrderCodeUtils;
 import com.fs.course.dto.FsOrderDeliveryNoteDTO;
 import com.fs.erp.domain.*;
 import com.fs.erp.dto.*;
 import com.fs.erp.mapper.FsErpFinishPushMapper;
 import com.fs.erp.service.IErpOrderService;
 import com.fs.his.config.FsSysConfig;
+import com.fs.his.domain.*;
+import com.fs.his.dto.FsPrescribeUsageDTO;
+import com.fs.his.dto.FsProdItemDTO;
+import com.fs.his.dto.FsStoreOrderItemDTO;
+import com.fs.his.enums.FsStoreOrderLogEnum;
+import com.fs.his.enums.FsStoreOrderStatusEnum;
+import com.fs.his.mapper.*;
+import com.fs.his.param.FsStoreOrderSalesParam;
+import com.fs.his.service.IFsPrescribeService;
+import com.fs.his.service.IFsUserWatchService;
 import com.fs.his.utils.ConfigUtil;
+import com.fs.his.vo.FsInquiryOrderVO;
+import com.fs.his.vo.FsStoreOrderExcelVO;
 import com.fs.hisStore.config.FsErpConfig;
 import com.fs.hisStore.dto.*;
 import com.fs.hisStore.mapper.*;
 import com.fs.hisStore.param.*;
 import com.fs.hisStore.vo.*;
+import com.fs.his.vo.FsPrescribeVO;
+import com.fs.hisapi.domain.ApiResponse;
+import com.fs.hisapi.param.CreateOrderParam;
+import com.fs.hisapi.param.RecipeDetailParam;
+import com.fs.hisapi.service.HisApiService;
 import com.fs.huifuPay.domain.HuiFuRefundResult;
 import com.fs.huifuPay.sdk.opps.core.request.V2TradePaymentScanpayRefundRequest;
 import com.fs.huifuPay.service.HuiFuService;
+import com.fs.pay.pay.dto.RefundDTO;
 import com.fs.pay.service.IPayService;
 import com.fs.hisStore.config.StoreConfig;
 import com.fs.hisStore.config.StoreIntegralConfig;
@@ -75,6 +96,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.context.ApplicationEventPublisher;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
@@ -91,6 +113,7 @@ import java.util.*;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
+import static com.fs.his.utils.PhoneUtil.decryptPhone;
 import static com.fs.hisStore.constants.StoreConstants.DELIVERY;
 
 /**
@@ -148,6 +171,10 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService
     @Autowired
     private IFsExpressScrmService expressService;
 
+    @Autowired
+    @Lazy
+    private IFsPrescribeService fsPrescribeService;
+
     @Autowired
     private IPayService payService;
     @Autowired
@@ -183,6 +210,13 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService
 
     @Autowired
     private FsStoreOrderItemScrmMapper fsStoreOrderItemMapper;
+    @Autowired
+    private FsStoreOrderLogsScrmMapper fsStoreOrderLogsMapper;
+
+
+    @Autowired
+    private FsStorePaymentScrmMapper fsStorePaymentMapper;
+
     @Autowired
     ICompanyDeptService companyDeptService;
     @Autowired
@@ -237,6 +271,43 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService
     @Autowired
     private FsStoreProductScrmMapper fsStoreProductMapper;
 
+    @Autowired
+    private FsPrescribeMapper prescribeMapper;
+
+    @Autowired
+    private FsPrescribeDrugMapper prescribeDrugMapper;
+
+    @Autowired
+    private FsInquiryOrderMapper fsInquiryOrderMapper;
+
+    @Autowired
+    private IFsStoreOrderLogsScrmService fsStoreOrderLogsService;//
+
+    @Autowired
+    private FsStoreProductAttrValueScrmMapper fsStoreProductAttrValueMapper;
+
+    @Autowired
+    //fsStoreMapper
+    private FsStoreScrmMapper fsStoreMapper;
+
+    @Autowired
+    private IFsUserWatchService fsUserWatchService;
+
+
+    @Autowired
+    private HisApiService hisApiService;
+
+    @Autowired
+    private IFsStoreAfterSalesScrmService fsStoreAfterSalesService;
+    @Autowired
+    private FsStoreAfterSalesLogsScrmMapper fsStoreAfterSalesLogsMapper;
+
+    @Autowired
+    private FsStoreAfterSalesItemScrmMapper fsStoreAfterSalesItemMapper;
+
+    @Autowired
+    private FsPackageOrderMapper fsPackageOrderMapper;
+
     /**
      * 查询订单
      *
@@ -769,6 +840,107 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService
         }
     }
 
+    @Override
+    public R createOrderByPrescribe(Long prescribeId) {
+        FsPrescribe prescribe = prescribeMapper.selectFsPrescribeByPrescribeId(prescribeId);
+        FsPrescribeDrug map = new FsPrescribeDrug();
+        map.setPrescribeId(prescribeId);
+        List<FsPrescribeDrug> drugs = prescribeDrugMapper.selectFsPrescribeDrugList(map);
+        FsStoreOrderScrm order = new FsStoreOrderScrm();
+        List<FsStoreOrderItemScrm> items = new ArrayList<>();
+        String orderSn = OrderCodeUtils.getOrderSn();
+        if (StringUtils.isEmpty(orderSn)) {
+            return R.error("订单生成失败,请重试");
+        }
+        order.setOrderCode(orderSn);
+        order.setCycle(prescribe.getCycle());
+        order.setStoreId(prescribe.getStoreOrderId());
+        order.setUserId(prescribe.getUserId());
+        order.setStoreId(prescribe.getStoreId());
+        order.setDoctorId(prescribe.getDoctorId());
+        order.setInquiryOrderId(prescribe.getInquiryOrderId());
+        FsInquiryOrder fsInquiryOrder = fsInquiryOrderMapper.selectFsInquiryOrderByOrderId(prescribe.getInquiryOrderId());
+        if (fsInquiryOrder != null) {
+            order.setCompanyId(fsInquiryOrder.getCompanyId());
+            order.setCompanyUserId(fsInquiryOrder.getCompanyUserId());
+        }
+        order.setPackageSecondName("医生处方");
+        order.setPackageName("医生处方");
+        order.setStatus(1);
+        order.setPayType("1");
+        order.setIsPrescribe(1);
+        order.setPrescribeId(prescribe.getPrescribeId());
+        order.setCreateTime(new Date());
+        if (prescribe.getSource() != null) {
+            order.setSource(prescribe.getSource());
+        }
+        Long totalNum = 0l;
+        BigDecimal totalPrice = new BigDecimal(0);
+        BigDecimal totalCostPrice = new BigDecimal("0");
+        for (FsPrescribeDrug drug : drugs) {
+            totalPrice = totalPrice.add(drug.getDrugPrice().multiply(BigDecimal.valueOf(drug.getDrugNum())));
+            totalNum = totalNum + drug.getDrugNum();
+            FsStoreOrderItemScrm item = new FsStoreOrderItemScrm();
+            item.setProductId(drug.getProductId());
+            item.setIsDrug(drug.getIsDrug());
+            item.setStoreId(prescribe.getStoreId());
+            item.setProductAttrValueId(drug.getProductAttrValueId());
+            if (drug.getProductAttrValueId() != null) {
+                FsStoreProductAttrValueScrm value = fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueById(drug.getProductAttrValueId());
+                if (value.getCost() != null) {
+                    if (drug.getDrugNum() != null) {
+                        totalCostPrice = totalCostPrice.add(value.getCost().multiply(BigDecimal.valueOf(drug.getDrugNum())));
+                    }
+                }
+            }
+
+            item.setNum(drug.getDrugNum() != null ? drug.getDrugNum().intValue() : null);
+            FsStoreOrderItemDTO dto = new FsStoreOrderItemDTO();
+            dto.setImage(drug.getDrugImgUrl());
+            dto.setNum(drug.getDrugNum());
+            FsStoreProductScrm product = fsStoreProductMapper.selectFsStoreProductById(drug.getProductId());
+            if (product != null) {
+                dto.setProductName(product.getProductName());
+                dto.setProductId(product.getProductId());
+            }
+            FsStoreProductAttrValueScrm value = fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueById(drug.getProductAttrValueId());
+            if (value != null) {
+                dto.setSku(value.getSku());
+                dto.setBarCode(value.getBarCode());
+                dto.setPrice(value.getPrice());
+                dto.setNum(drug.getDrugNum());
+                dto.setImage(value.getImage());
+            }
+            item.setIsPrescribe(1);
+            item.setJsonInfo(JSON.toJSONString(dto));
+            items.add(item);
+        }
+        //中药总价处理
+        if (prescribe.getPrescribeType().equals(2)) {
+            FsPrescribeUsageDTO dto = JSONUtil.toBean(prescribe.getUsageJson(), FsPrescribeUsageDTO.class);
+            totalPrice = totalPrice.multiply(BigDecimal.valueOf(dto.getCounts()));
+            totalNum = dto.getCounts();
+            totalCostPrice = totalCostPrice.multiply(BigDecimal.valueOf(dto.getCounts()));
+        }
+        order.setCostPrice(totalCostPrice);
+        order.setOrderType(prescribe.getPrescribeType());
+        order.setTotalNum(totalNum);
+        order.setTotalPrice(totalPrice);
+        order.setPayPrice(totalPrice);
+        order.setItemJson(JSONUtil.toJsonStr(items));
+        if (fsStoreOrderMapper.insertFsStoreOrder(order) > 0) {
+            prescribe.setStoreOrderId(order.getId());
+            prescribeMapper.updateFsPrescribe(prescribe);
+            for (FsStoreOrderItemScrm item : items) {
+                item.setOrderId(order.getId());
+                fsStoreOrderItemMapper.insertFsStoreOrderItem(item);
+            }
+            fsStoreOrderLogsService.create(order.getId(), FsStoreOrderLogEnum.CREATE_ORDER.getValue(),
+                    FsStoreOrderLogEnum.CREATE_ORDER.getDesc());
+        }
+        return R.ok();
+    }
+
     /**
      * 积分抵扣
      */
@@ -854,7 +1026,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService
                 if(payments!=null){
                     for(FsStorePaymentScrm payment:payments){
                         //易宝退款
-                        com.fs.pay.pay.dto.RefundDTO refundDTO = new com.fs.pay.pay.dto.RefundDTO();
+                        RefundDTO refundDTO = new RefundDTO();
                         refundDTO.setRefundMoney(payment.getPayMoney().toString());
                         refundDTO.setLowRefundNo("refund-"+payment.getPayCode());
                         refundDTO.setUpOrderId(payment.getTradeNo());
@@ -2939,14 +3111,480 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService
     }
 
     @Override
-    public void importDeliveryNoteExpress(List<FsOrderDeliveryNoteDTO> dtoList, String miniAppId) {
-       try {
-           //获取微信token逻辑
-           final WxMaService wxService = WxMaConfiguration.getMaService(miniAppId);
-           String token = wxService.getAccessToken();
-           System.out.println("获取到的token------------->:"+token);
-       }catch (Exception e){
-           e.getStackTrace();
-       }
+    public FsStoreOrderScrm selectFsStoreOrderByOrderId(Long storeOrderId) {
+        return fsStoreOrderMapper.selectFsStoreOrderById(storeOrderId);
+    }
+
+    @Override
+    public List<FsStoreOrderExcelVO> selectFsStoreOrderExcelListSVO(FsStoreOrderParam fsStoreOrder) {
+        List<FsStoreOrderExcelVO> fsStoreOrderVOS = fsStoreOrderMapper.selectFsStoreOrderExcelListVO(fsStoreOrder);
+
+        for (FsStoreOrderExcelVO vo : fsStoreOrderVOS) {
+            vo.setProductName(vo.getPackageSecondName());
+            int count = 1;
+            if (vo.getCycle() != null) {
+                count = vo.getCycle() / 6;
+                if (count == 0) {
+                    count = 1;
+                }
+                vo.setFollowNum(count);
+            }
+            BigDecimal money = new BigDecimal(count * 300);
+            vo.setInquiryMoney(money);
+            if (vo.getTotalCostMoney() == null) {
+                if (vo.getCostPrice() != null) {
+                    vo.setTotalCostMoney(vo.getCostPrice());
+                } else {
+                    vo.setTotalCostMoney(new BigDecimal("0"));
+                }
+            }
+            vo.setTotalMoney(vo.getInquiryMoney().add(vo.getTotalCostMoney()));
+            vo.setInquiryDiscountMoney(vo.getTotalMoney().subtract(vo.getPrescribePrice()));
+        }
+        return fsStoreOrderVOS;
+    }
+
+    @Override
+    public String importSroreOrder(List<FsStoreProductDeliverExcelVO> list, Long storeId, Long companyId) {
+        if (StringUtils.isNull(list) || list.size() == 0) {
+            throw new ServiceException("导入商品数据不能为空!");
+        }
+        int successNum = 0;
+        int failureNum = 0;
+        StringBuilder successMsg = new StringBuilder();
+        StringBuilder failureMsg = new StringBuilder();
+        for (FsStoreProductDeliverExcelVO vo : list) {
+            try {
+                FsStoreOrderScrm o = fsStoreOrderMapper.selectFsStoreOrderByOrderCode(vo.getOrderCode());
+                if (storeId != null) {
+                    if (o.getStoreId() != storeId) {
+                        throw new CustomException("不是本店铺订单");
+                    }
+                }
+
+                if (companyId != null) {
+                    if (o.getCompanyId() != companyId) {
+                        throw new CustomException("不是本公司订单");
+                    }
+                }
+                if (o.getStatus() != 2) {
+                    throw new CustomException("订单状态不为待发货");
+                }
+                // 判断每个字段是否为null或为空字符串
+                if (vo.getOrderCode() == null || vo.getOrderCode().isEmpty()) {
+                    throw new CustomException("订单编号为空");
+                }
+
+                if (vo.getDeliveryName() == null || vo.getDeliveryName().isEmpty()) {
+                    throw new CustomException("快递名称为空");
+                }
+
+                if (vo.getDeliverySn() == null || vo.getDeliverySn().isEmpty()) {
+                    throw new CustomException("快递单号为空");
+                }
+                FsStoreOrderScrm fsStoreOrder = new FsStoreOrderScrm();
+
+                fsStoreOrder.setDeliverySn(vo.getDeliverySn());
+                fsStoreOrder.setDeliveryName(vo.getDeliveryName());
+                SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                fsStoreOrder.setDeliveryTime(formatter.format(new Date()));
+                fsStoreOrder.setDeliveryCode(vo.getDeliveryCode());
+
+                fsStoreOrder.setOrderCode(vo.getOrderCode());
+                fsStoreOrder.setStatus(3);
+                if (o.getCompanyId() != null) {
+                    companyService.subtractCompanyMoneyScrm(o);
+                }
+                FsStoreScrm store = fsStoreMapper.selectFsStoreByStoreId(o.getStoreId());
+                int i = fsStoreOrderMapper.updateFsStoreOrderByOrderCode(fsStoreOrder);
+                String lastFourNumber = "";
+                if (fsStoreOrder.getDeliveryCode().equals(com.fs.his.enums.ShipperCodeEnum.SF.getValue())) {
+                    if (store.getSendPhone() != null) {
+                        lastFourNumber = store.getSendPhone();
+                    } else {
+                        lastFourNumber = o.getUserPhone();
+                    }
+                    if (lastFourNumber.length() == 11) {
+                        lastFourNumber = StrUtil.sub(lastFourNumber, lastFourNumber.length(), -4);
+                    }
+                }
+                expressService.subscribeEspress(o.getOrderCode(), fsStoreOrder.getDeliveryCode(), fsStoreOrder.getDeliverySn(), lastFourNumber);
+
+                try {
+                    String s = fsPrescribeService.PrescribeImg(o.getPrescribeId());
+                } catch (Exception e) {
+
+                }
+
+                successNum++;
+                successMsg.append("<br/>" + successNum + "、订单编号 " + vo.getOrderCode() + " 导入成功");
+
+            } catch (Exception e) {
+
+                failureNum++;
+                String msg = "<br/>" + failureNum + "、订单编号 " + vo.getOrderCode() + " 导入失败:";
+                failureMsg.append(msg + e.getMessage());
+            }
+        }
+        if (failureNum > 0) {
+            failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
+            throw new ServiceException(failureMsg.toString());
+        } else {
+            successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
+        }
+        return successMsg.toString();
+    }
+
+    @Override
+    public int deleteFsStoreOrderByOrderIds(String[] orderIds) {
+        Long[] ids = Arrays.stream(orderIds).map(Long::parseLong).toArray(Long[]::new);
+        return fsStoreOrderMapper.deleteFsStoreOrderByIds(ids);
+    }
+
+    @Override
+    public List<FsStoreOrderItemScrm> selectFsStoreOrderItemList(String orderId) {
+        FsStoreOrderItemScrm fsStoreOrderItem = new FsStoreOrderItemScrm();
+        fsStoreOrderItem.setOrderId(Long.parseLong(orderId));
+        return fsStoreOrderItemMapper.selectFsStoreOrderItemList(fsStoreOrderItem);
+    }
+
+    @Override
+    public List<FsStoreOrderLogsScrm> selectFsStoreOrderLogsList(String orderId) {
+        FsStoreOrderLogsScrm fsStoreOrderLogs = new FsStoreOrderLogsScrm();
+        fsStoreOrderLogs.setOrderId(Long.parseLong(orderId));
+        return fsStoreOrderLogsMapper.selectFsStoreOrderLogsList(fsStoreOrderLogs);
+    }
+
+    @Override
+    public FsPrescribeVO selectFsPrescribeByPrescribeIdVO(Long prescribeId) {
+        return prescribeMapper.selectFsPrescribeByPrescribeIdVO(prescribeId);
+    }
+
+    @Override
+    public List<FsStorePaymentScrm> selectFsStorePaymentByOrderId(Long orderId) {
+        FsStoreOrderScrm fsStoreOrder = fsStoreOrderMapper.selectFsStoreOrderById(orderId);
+        if (fsStoreOrder.getPackageOrderId() == null) {
+            return fsStorePaymentMapper.selectFsStorePaymentByOrderId(orderId);
+        } else {
+            return fsStorePaymentMapper.selectFsStorePaymentByPay(3, fsStoreOrder.getPackageOrderId());
+
+        }
+    }
+
+    @Override
+    public int sendGoods(FsStoreOrderScrm fsStoreOrder) {
+        FsStoreOrderScrm order = fsStoreOrderMapper.selectFsStoreOrderById(fsStoreOrder.getId());
+        if (order == null) throw new CustomException("订单不存在");
+        if (order.getStatus() != 2) throw new CustomException("非法更改");
+        FsStoreOrderScrm o1 = new FsStoreOrderScrm();
+        o1.setId(fsStoreOrder.getId());
+        o1.setStatus(3);
+        o1.setUpdateTime(new DateTime());
+        o1.setDeliveryCode(fsStoreOrder.getDeliveryCode());
+        o1.setDeliveryName(fsStoreOrder.getDeliveryName());
+        o1.setDeliverySn(fsStoreOrder.getDeliverySn());
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String dateString = formatter.format(new Date());
+        o1.setDeliveryTime(dateString);
+        int i = fsStoreOrderMapper.updateFsStoreOrder(o1);
+        if (order.getCompanyId() != null) {
+            companyService.subtractCompanyMoneyScrm(order);
+        }
+        FsStoreOrderLogsScrm Logs = new FsStoreOrderLogsScrm();
+        Logs.setChangeMessage("订单发货");
+        Logs.setOrderId(fsStoreOrder.getId());
+        Logs.setChangeTime(new DateTime());
+        Logs.setChangeType("delivery_goods");
+        fsStoreOrderLogsMapper.insertFsStoreOrderLogs(Logs);
+
+        String lastFourNumber = "";
+        if (order.getDeliveryCode().equals(com.fs.his.enums.ShipperCodeEnum.SF.getValue())) {
+            lastFourNumber = order.getUserPhone();
+            if (lastFourNumber.length() == 11) {
+                lastFourNumber = StrUtil.sub(lastFourNumber, lastFourNumber.length(), -4);
+            }
+        }
+        expressService.subscribeEspress(order.getOrderCode(), fsStoreOrder.getDeliveryCode(), fsStoreOrder.getDeliverySn(), lastFourNumber);
+        return i;
+    }
+
+    @Override
+    public int getGoods(Long orderId) {
+        FsStoreOrderScrm order = fsStoreOrderMapper.selectFsStoreOrderById(orderId);
+        if (order == null) throw new CustomException("订单不存在");
+        if (order.getStatus() != FsStoreOrderStatusEnum.STATUS_3.getValue()) throw new CustomException("非法更改");
+        FsStoreOrderScrm o1 = new FsStoreOrderScrm();
+        o1.setUpdateTime(new DateTime());
+        o1.setFinishTime(new Date());
+        o1.setId(orderId);
+        o1.setStatus(FsStoreOrderStatusEnum.STATUS_4.getValue());
+        log.info("确认收货:" + orderId);
+        if (order.getCompanyId() != null && order.getTuiMoneyStatus() == 0 && "1".equals(order.getPayType())) {
+            log.info("分佣:" + orderId);
+            companyService.addCompanyMoney(order);
+            o1.setTuiMoneyTime(new Date());
+        }
+        fsUserWatchService.addUserWatchScrm(order);
+        int i = fsStoreOrderMapper.updateFsStoreOrder(o1);
+        fsStoreOrderLogsService.create(order.getId(), FsStoreOrderLogEnum.FINISH_ORDER.getValue(),
+                FsStoreOrderLogEnum.FINISH_ORDER.getDesc());
+        return i;
+    }
+
+    @Override
+    public int updateMoney(FsStoreOrderScrm fsStoreOrder) {
+        FsStoreOrderScrm order = fsStoreOrderMapper.selectFsStoreOrderById(fsStoreOrder.getId());
+        if (order == null) {
+            throw new CustomException("订单不存在");
+        }
+        if (order.getStatus() != 1) {
+            throw new CustomException("非法更改");
+        }
+        FsStoreOrderScrm o1 = new FsStoreOrderScrm();
+        o1.setUpdateTime(new DateTime());
+        o1.setPayPrice(fsStoreOrder.getPayPrice());
+        o1.setId(fsStoreOrder.getId());
+        int i = fsStoreOrderMapper.updateFsStoreOrder(o1);
+        FsStoreOrderLogsScrm Logs = new FsStoreOrderLogsScrm();
+        Logs.setChangeMessage("改价");
+        Logs.setOrderId(fsStoreOrder.getId());
+        Logs.setChangeTime(new DateTime());
+        Logs.setChangeType("edit_order_money");
+        fsStoreOrderLogsMapper.insertFsStoreOrderLogs(Logs);
+        return i;
+    }
+
+    @Override
+    public int tuiOrder(Long orderId) {
+        CreateOrderParam op = new CreateOrderParam();
+
+        FsStoreOrderScrm o = fsStoreOrderMapper.selectFsStoreOrderById(orderId);
+
+        if (o.getStatus() != 2) {
+            throw new CustomException("订单状态不为代发货");
+        }
+        if (o.getUserAddress() == null || o.getUserAddress() == "") {
+            throw new CustomException("用户收货地址为空");
+        }
+        if (o.getUserPhone() == null || o.getUserPhone() == "") {
+            throw new CustomException("用户收货电话为空");
+        }
+        FsPrescribeVO fp = prescribeMapper.selectFsPrescribeByPrescribeIdVO(o.getPrescribeId());
+
+        String s = fsPrescribeService.PrescribeImg(fp.getPrescribeId());
+
+        FsPrescribeUsageDTO usage = JSONUtil.toBean(fp.getUsageJson(), FsPrescribeUsageDTO.class);
+
+        FsInquiryOrderVO io = fsInquiryOrderMapper.selectFsInquiryOrderVOByOrderId(fp.getInquiryOrderId());
+
+        FsStoreOrderItemScrm item = new FsStoreOrderItemScrm();
+        item.setOrderId(o.getId());
+        List<FsStoreOrderItemScrm> fsStoreOrderItems = fsStoreOrderItemMapper.selectFsStoreOrderItemList(item);
+        log.info("" + fsStoreOrderItems);
+        ArrayList<RecipeDetailParam> list = new ArrayList<>();
+        Integer i = 1;
+        BigDecimal dprice = new BigDecimal(0);
+        for (FsStoreOrderItemScrm fsStoreOrderItem : fsStoreOrderItems) {
+
+            RecipeDetailParam p = new RecipeDetailParam();
+            String json = fsStoreOrderItem.getJsonInfo();
+            FsProdItemDTO fsProdItemDTO = JSON.parseObject(json, FsProdItemDTO.class);
+            String barCode = fsProdItemDTO.getBarCode();
+
+            log.info("" + fsProdItemDTO);
+            if (fsStoreOrderItem.getIsGift() != null && fsStoreOrderItem.getIsGift() == 1) {
+                continue;
+            }
+            if (barCode.equals("106013")) {
+                continue;
+            }
+
+            String barCodeTrim = barCode.replaceAll("[^a-zA-Z0-9]", "");
+            ;
+            p.setGranule_his(barCodeTrim);
+            p.setGranule_name(new org.json.JSONObject(json).getString("productName"));
+            BigDecimal price = new org.json.JSONObject(json).getBigDecimal("price");
+            p.setGranule_price(price.toString());
+            BigDecimal counts = new org.json.JSONObject(json).getBigDecimal("num");
+            p.setHerb_dose(counts.toString());
+            p.setGranule_no(i.toString());
+            list.add(p);
+            i++;
+            dprice = dprice.add(price.multiply(counts));
+        }
+
+        op.setRecipe_name(fp.getPrescribeCode());
+
+        op.setBirthday(fp.getPatientBirthday());
+        op.setName(fp.getPatientName());
+        op.setSex(fp.getPatientGender().equals("1") ? "男" : "女");
+        op.setAge(Integer.parseInt(fp.getPatientAge()));
+        if (o.getUserPhone().length() > 11) {
+            op.setPhone(decryptPhone(o.getUserPhone()));
+        } else {
+            op.setPhone(o.getUserPhone());
+        }
+
+        if (io != null) {
+            op.setDepartment(io.getDeptName());
+        }
+        op.setDoctor(fp.getDoctorName());
+        op.setRecipe_no(usage.getCounts().intValue());//处方副数
+        op.setGranule_total_no(i - 1);
+        String usageFrequencyUnit = usage.getUsageFrequencyUnit();
+        int dayNum = 2;
+        if (usageFrequencyUnit != null) {
+            if (usageFrequencyUnit.equals("每日一次")) {
+                dayNum = 1;
+            } else if (usageFrequencyUnit.equals("每日二次")) {
+                dayNum = 2;
+            } else if (usageFrequencyUnit.equals("每日三次")) {
+                dayNum = 3;
+            } else if (usageFrequencyUnit.equals("每日四次")) {
+                dayNum = 4;
+            }
+        }
+
+        if (fp.getRecipeType() != null) {
+            op.setRecipe_type(fp.getRecipeType());
+        }
+        op.setTimes_day(dayNum);
+        op.setFactor(0);
+        String remark = usage.getRemark();
+        if (remark != null && remark.length() > 50) {
+            remark = remark.substring(0, 40);
+        }
+
+        op.setAttention(remark);//医嘱
+        op.setSymptoms(fp.getDiagnose());
+        op.setRecipe_time(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(fp.getCreateTime()));
+        op.setPrice(dprice.toString());
+        op.setPrice_total(dprice.multiply(new BigDecimal(usage.getCounts())).toString());
+        op.setRecipe_sale_price(o.getPayMoney().toString()); //实际收款
+        op.setPayment_type("1");
+        op.setPayment_status("PAYED");
+        op.setRecipe_source("HIS");
+        op.setMachine_name("");
+        op.setRecipe_status("NEW");
+        op.setDescription(s);
+        if (fp.getPatientId() != null) {
+            op.setPatient_id(fp.getPatientId().toString());
+        }
+
+        op.setAddress(o.getUserAddress());
+        op.setRecipe_detail_list(list);
+        ApiResponse order = hisApiService.createOrder(op);
+        if (order.getState().equals("error")) {
+            throw new CustomException(order.getMsg());
+        }
+        FsStoreOrderScrm fso = new FsStoreOrderScrm();
+        fso.setId(o.getId());
+        fso.setExtendOrderId("HIS");
+        fsStoreOrderMapper.updateFsStoreOrder(fso);
+
+        return 1;
+    }
+
+    @Override
+    public int afterSales(FsStoreOrderSalesParam fsStoreOrderSalesParam) {
+        FsStoreOrderScrm order = fsStoreOrderMapper.selectFsStoreOrderById(fsStoreOrderSalesParam.getOrderId());
+        if (order.getStatus() < 0) {
+            throw new CustomException("订单不可提交售后");
+        }
+        FsStoreAfterSalesScrm fsStoreAfterSales = new FsStoreAfterSalesScrm();
+        fsStoreAfterSales.setOrderId(order.getId());
+        fsStoreAfterSales.setStoreId(order.getStoreId());
+        fsStoreAfterSales.setRefundAmount(order.getPayMoney());
+        fsStoreAfterSales.setCreateTime(DateUtils.getNowDate());
+        if (order.getStatus() == 2 || order.getStatus() == 3) {
+            fsStoreAfterSales.setRefundType(0);
+        }
+        if (order.getStatus() == 4) {
+            FsStoreScrm fsStore = fsStoreMapper.selectFsStoreByStoreId(order.getStoreId());
+            fsStoreAfterSales.setRefundType(1);
+            fsStoreAfterSales.setPhoneNumber(fsStore.getRefundPhone());
+            fsStoreAfterSales.setAddress(fsStore.getRefundAddress());
+            fsStoreAfterSales.setConsignee(fsStore.getRefundConsignee());
+        }
+        fsStoreAfterSales.setStatus(0);
+        fsStoreAfterSales.setDeptId(order.getDeptId());
+        fsStoreAfterSales.setSalesStatus(0);
+        fsStoreAfterSales.setOrderStatus(order.getStatus());
+        fsStoreAfterSales.setUserId(order.getUserId());
+        fsStoreAfterSales.setCompanyId(order.getCompanyId());
+        fsStoreAfterSales.setCompanyUserId(order.getCompanyUserId());
+        fsStoreAfterSales.setIsDel(0);
+        fsStoreAfterSalesService.insertFsStoreAfterSales(fsStoreAfterSales);
+        List<FsStoreOrderItemVO> fsStoreOrderItems = fsStoreOrderItemMapper.selectFsStoreOrderItemListByOrderId(order.getId());
+        for (FsStoreOrderItemVO fsStoreOrderItem : fsStoreOrderItems) {
+            FsStoreAfterSalesItemScrm item = new FsStoreAfterSalesItemScrm();
+            item.setStoreAfterSalesId(fsStoreAfterSales.getId());
+            item.setProductId(fsStoreOrderItem.getProductId());
+            item.setJsonInfo(fsStoreOrderItem.getJsonInfo());
+            fsStoreAfterSalesItemMapper.insertFsStoreAfterSalesItem(item);
+        }
+        //增加操作日志
+        FsStoreAfterSalesLogsScrm logs = new FsStoreAfterSalesLogsScrm();
+        logs.setChangeTime(new DateTime());
+        logs.setChangeType(0);
+        logs.setStoreAfterSalesId(fsStoreAfterSales.getId());
+        logs.setOperator(fsStoreOrderSalesParam.getOperator());
+        logs.setCompanyId(fsStoreOrderSalesParam.getCompanyId());
+        logs.setChangeMessage("平台提交售后");
+        fsStoreAfterSalesLogsMapper.insertFsStoreAfterSalesLogs(logs);
+        //判断是否开启erp
+        FsSysConfig sysConfig = configUtil.getSysConfig();
+        Integer erpOpen = sysConfig.getErpOpen();
+        if (erpOpen != null && erpOpen == 1) {
+            //判断erp类型
+            Integer erpType = sysConfig.getErpType();
+            if (erpType != null) {
+
+                IErpOrderService erpOrderService = null;
+                if (erpType == 1) {
+                    //管易
+                    erpOrderService = gyOrderService;
+                } else if (erpType == 2) {
+                    //旺店通
+                    erpOrderService = wdtOrderService;
+                } else if (erpType == 3) {
+                    //瀚智
+                    erpOrderService = hzOMSOrderService;
+                } else if (erpType == 4) {
+                    //瀚智
+                    erpOrderService = dfOrderService;
+                } else if (erpType == 5) {
+                    erpOrderService = jSTOrderService;
+                }
+                if (erpOrderService != null && StringUtils.isNotEmpty(order.getExtendOrderId())) {
+                    if (!order.getExtendOrderId().equals("HIS")) {
+                        if (erpType != 3) {
+                            ErpRefundUpdateRequest request = new ErpRefundUpdateRequest();
+                            request.setTid(order.getOrderCode());
+                            request.setOid(order.getOrderCode());
+                            request.setRefund_state(1);
+                            erpOrderService.refundUpdate(request);
+                        } else {
+                            ErpRefundOrder param = new ErpRefundOrder();
+                            param.setOrderCode(order.getOrderCode());
+                            param.setAfterSalesId(fsStoreAfterSales.getId());
+                            erpOrderService.refundOrder(param);
+                        }
+                    }
+                }
+            }
+        }
+
+
+        order.setStatus(-1);
+        order.setRefundStatus(1);
+        fsStoreOrderMapper.updateFsStoreOrder(order);
+        if (order.getPackageOrderId() != null) {
+            FsPackageOrder fsPackageOrder = fsPackageOrderMapper.selectFsPackageOrderByOrderId(order.getPackageOrderId());
+            fsPackageOrder.setRefundStatus(1);
+            fsPackageOrderMapper.updateFsPackageOrder(fsPackageOrder);
+        }
+        return 1;
     }
+
 }

+ 81 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreProductCategoryScrmServiceImpl.java

@@ -1,7 +1,15 @@
 package com.fs.hisStore.service.impl;
 
+import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
+
+import com.fs.common.BeanCopyUtils;
 import com.fs.common.utils.DateUtils;
+import com.fs.hisStore.domain.FsStoreProductCategoryScrm;
+import com.fs.hisStore.vo.FsStoreProductCategoryVO;
+import com.fs.hisStore.vo.FsStoreProductCategorysVO;
+import com.fs.his.vo.OptionsVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.fs.hisStore.mapper.FsStoreProductCategoryScrmMapper;
@@ -107,4 +115,77 @@ public class FsStoreProductCategoryScrmServiceImpl implements IFsStoreProductCat
     public List<FsStoreProductCategoryScrm> selectFsStoreProductCategoryListQuery(FsStoreProductCategoryScrm param) {
         return fsStoreProductCategoryMapper.selectFsStoreProductCategoryListQuery(param);
     }
+
+    @Override
+    public List<FsStoreProductCategoryVO> selectFsStoreProductCategoryListVO(FsStoreProductCategoryScrm fsStoreProductCategory) {
+        List<FsStoreProductCategoryVO> a = fsStoreProductCategoryMapper.selectFsStoreProductCategoryListVO(fsStoreProductCategory);
+
+        ArrayList<FsStoreProductCategoryVO> v = new ArrayList<>();
+        for (FsStoreProductCategoryVO fv : a) {
+            if(fv.getPid()==0L){
+                ArrayList<FsStoreProductCategoryScrm> sec = new ArrayList<>();
+                for (FsStoreProductCategoryVO vv : a) {
+                    if (vv.getPid().equals(fv.getCateId())){
+                        FsStoreProductCategoryScrm copy = BeanCopyUtils.copy(vv, FsStoreProductCategoryScrm.class);
+                        sec.add(copy);
+                    }
+                }
+                fv.setChildren(sec);
+                v.add(fv);
+            }
+
+
+        }
+        return v;
+    }
+
+    @Override
+    public List<OptionsVO> selectFsStoreProductPidList() {
+        return fsStoreProductCategoryMapper.selectFsStoreProductPidList();
+    }
+
+    @Override
+    public FsStoreProductCategoryScrm selectFsStoreProductCategoryByCateId(Long cateId) {
+        return fsStoreProductCategoryMapper.selectFsStoreProductCategoryById(cateId);
+    }
+
+    @Override
+    public int deleteFsStoreProductCategoryByCateIds(Long[] cateIds) {
+        return fsStoreProductCategoryMapper.deleteFsStoreProductCategoryByIds(cateIds);
+    }
+
+    @Override
+    public List<FsStoreProductCategorysVO> selectFsStoreProductCategorysVOList() {
+        List<FsStoreProductCategorysVO> fsStoreProductCategories = fsStoreProductCategoryMapper.selectFsStoreProductCategorysVOList();
+
+        ArrayList<FsStoreProductCategorysVO> v = new ArrayList<>();
+        for (FsStoreProductCategorysVO fsStoreProductCategorysVo : fsStoreProductCategories) {
+            if(fsStoreProductCategorysVo.getPid()==0){
+                ArrayList<FsStoreProductCategoryScrm> sec = new ArrayList<>();
+                for (FsStoreProductCategorysVO vv : fsStoreProductCategories) {
+                    if (vv.getPid().equals(fsStoreProductCategorysVo.getCateId())){
+                        FsStoreProductCategoryScrm copy = BeanCopyUtils.copy(vv, FsStoreProductCategoryScrm.class);
+                        sec.add(copy);
+                    }
+                }
+                fsStoreProductCategorysVo.setChildren(sec);
+                v.add(fsStoreProductCategorysVo);
+            }
+
+
+        }
+        return v;
+    }
+
+    @Override
+    public List<FsStoreProductCategoryVO> getPidList() {
+        FsStoreProductCategoryVO vo = new FsStoreProductCategoryVO();
+        List<FsStoreProductCategoryScrm> pid = fsStoreProductCategoryMapper.getPid();
+        vo.setCateName("顶级目录");
+        vo.setCateId(0L);
+        vo.setChildren(pid);
+        ArrayList<FsStoreProductCategoryVO> list = new ArrayList<>();
+        list.add(vo);
+        return list;
+    }
 }

+ 197 - 1
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreProductScrmServiceImpl.java

@@ -11,10 +11,21 @@ import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.fs.common.BeanCopyUtils;
+import com.fs.common.annotation.Log;
 import com.fs.common.core.domain.R;
+import com.fs.common.enums.BusinessType;
 import com.fs.common.exception.CustomException;
+import com.fs.common.exception.ServiceException;
 import com.fs.common.utils.DateUtils;
 import com.fs.company.cache.ICompanyCacheService;
+import com.fs.erp.domain.ErpGoods;
+import com.fs.erp.service.IErpGoodsService;
+import com.fs.his.config.FsSysConfig;
+import com.fs.his.param.FsStoreProductListSParam;
+import com.fs.his.utils.ConfigUtil;
+import com.fs.his.vo.FsStoreProductExcelVO;
+import com.fs.his.vo.FsStoreProductListSVO;
+import com.fs.his.vo.OptionsVO;
 import com.fs.hisStore.domain.*;
 import com.fs.hisStore.mapper.*;
 import com.fs.statis.dto.ModifyMoreDTO;
@@ -27,6 +38,7 @@ import com.fs.hisStore.vo.*;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Service;
 import com.fs.hisStore.service.IFsStoreProductScrmService;
 import org.springframework.transaction.annotation.Propagation;
@@ -59,6 +71,18 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
 
     @Autowired
     private ICompanyCacheService companyCacheService;
+
+
+    @Autowired
+    private ConfigUtil configUtil;
+
+    @Autowired
+    @Qualifier("hzOMSErpGoodsServiceImpl")
+    private IErpGoodsService hzOMSErpGoodsService;
+
+    @Autowired
+    @Qualifier("JSTErpGoodsServiceImpl")
+    private IErpGoodsService jSTErpGoodsService;
     /**
      * 查询商品
      *
@@ -275,7 +299,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
     public R addOrEdit(FsStoreProductAddEditParam param) {
         ProductAttrCountDto countDto=computedProductCount(param.getValues());
 
-        if(param.getProductId()>0){
+        if(param.getProductId() != null){
             FsStoreProductScrm product=new FsStoreProductScrm();
             BeanUtils.copyProperties(param,product);
             product.setPrice(countDto.getMinPrice());
@@ -771,4 +795,176 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
     public void batchModify(ModifyMoreDTO modifyMoreDTO) {
         fsStoreProductMapper.batchModify(modifyMoreDTO);
     }
+
+    @Override
+    public List<FsStoreProductListSVO> selectFsStoreProductListSVO(FsStoreProductListSParam fsStoreProduct) {
+        return fsStoreProductMapper.selectFsStoreProductListSVO(fsStoreProduct);
+    }
+
+    @Override
+    public String importSrorePeoduct(List<FsStoreProductExcelVO> productList, boolean updateSupport) {
+        if (com.fs.common.utils.StringUtils.isNull(productList) || productList.size() == 0) {
+            throw new ServiceException("导入商品数据不能为空!");
+        }
+        int successNum = 0;
+        int failureNum = 0;
+        StringBuilder successMsg = new StringBuilder();
+        StringBuilder failureMsg = new StringBuilder();
+
+        //存储商品Id
+        List<Long> jstProductIds=new LinkedList<>();
+        for (FsStoreProductExcelVO productVO : productList) {
+            try {
+
+//                if (1==1){
+//                    FsStoreProductAttrValue v = new FsStoreProductAttrValue();
+//                    v.setBarCode(productVO.getBarCode());
+//                    List<FsStoreProductAttrValue> es = fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueList(v);
+//                    for (FsStoreProductAttrValue e : es) {
+//                        e.setDoctorBrokerage(productVO.getDoctorBrokerage());
+//                        fsStoreProductAttrValueMapper.updateFsStoreProductAttrValue(e);
+//                    }
+//
+//                    throw new CustomException("更改成功");
+//                }
+
+                FsStoreProductScrm product = BeanCopyUtils.copy(productVO, FsStoreProductScrm.class);
+                //
+//                product.setIsPrescribe(productVO.getIsPrescribe().equals("非处方") ? 0:1);
+//                product.setProductType(1);
+//                product.setSpecType(0);
+//                productVO.setDoctorBrokerage(new BigDecimal(0));
+                if (product.getBarCode() == null || product.getBarCode() == "") {
+                    throw new CustomException("商品编号为空");
+                }
+                //
+                this.insertFsStoreProduct(product);
+
+                com.fs.his.dto.ProductArrtDTO fromatDetailDto = com.fs.his.dto.ProductArrtDTO.builder()
+                        .value("规格")
+                        .detail(ListUtil.toList("默认"))
+                        .build();
+                List<com.fs.his.dto.ProductArrtDTO> items = new ArrayList<>();
+                items.add(fromatDetailDto);
+                FsStoreProductAttrValueScrm p = new FsStoreProductAttrValueScrm();
+                p.setProductId(product.getProductId());
+                p.setSku("默认");
+                p.setStock(product.getStock().intValue());
+                if (product.getStock() == null) {
+                    p.setStock(0);
+                }
+                p.setSales(product.getSales().intValue());
+                if (product.getSales() == null) {
+                    p.setStock(0);
+                }
+                p.setPrice(product.getPrice());
+                if (product.getPrice() == null) {
+                    p.setPrice(new BigDecimal(0));
+                }
+                p.setImage(product.getImgUrl());
+                p.setCost(product.getCostPrice());
+                if (product.getCostPrice() == null) {
+                    p.setCost(new BigDecimal(0));
+                }
+                p.setBarCode(product.getBarCode());
+                p.setGroupBarCode(product.getBarCode());
+                p.setOtPrice(product.getOtPrice());
+                if (product.getOtPrice() == null) {
+                    p.setOtPrice(new BigDecimal(0));
+                }
+
+                p.setDoctorBrokerage(productVO.getDoctorBrokerage());
+                p.setWeight(productVO.getWeight());
+                if (productVO.getWeight() == null) {
+                    p.setWeight(new BigDecimal(0));
+                }
+
+                p.setVolume(new BigDecimal(0));
+                p.setBrokerage(new BigDecimal(0));
+                p.setBrokerageTwo(new BigDecimal(0));
+                p.setBrokerageThree(new BigDecimal(0));
+                if (product.getGiveIntegral() == null) {
+                    p.setGiveIntegral(0);
+                } else {
+                    p.setGiveIntegral(product.getGiveIntegral().intValue());
+                }
+                p.setAgentPrice(new BigDecimal(0));
+                fsStoreProductAttrValueMapper.insertFsStoreProductAttrValue(p);
+
+                fsStoreProductAttrMapper.clear(product.getProductId());
+                FsStoreProductAttrScrm attr = new FsStoreProductAttrScrm();
+                attr.setProductId(product.getProductId());
+                attr.setAttrName("规格");
+                attr.setAttrValues("默认");
+                fsStoreProductAttrMapper.insertFsStoreProductAttr(attr);
+                successNum++;
+                successMsg.append("<br/>" + successNum + "、商品 " + product.getProductName() + " 导入成功");
+
+                //todo 添加商品HzOMSerp调用
+                //判断是否开启erp
+                FsSysConfig sysConfig = configUtil.getSysConfig();
+                Integer erpOpen = sysConfig.getErpOpen();
+                if (erpOpen == null || erpOpen == 0) {
+                    //不作操作
+                } else{
+                    //判断erp类型
+                    Integer erpType = sysConfig.getErpType();
+                    if (erpType == null) {
+                        //不作操作
+                    }else if (erpType == 3) {
+                        ErpGoods params = new ErpGoods();
+                        params.setStoreProductId(product.getProductId());
+                        //瀚智OMS 维护添加商品
+                        hzOMSErpGoodsService.addGoods(params);
+                    }else if(erpType == 5){
+                        jstProductIds.add(product.getProductId());
+                    }
+                }
+            } catch (Exception e) {
+
+                failureNum++;
+                String msg = "<br/>" + failureNum + "、商品 " + productVO.getProductName() + " 导入失败:";
+                failureMsg.append(msg + e.getMessage());
+            }
+        }
+
+        //验证聚水潭商品Id
+        if(!jstProductIds.isEmpty()){
+            //同步聚水潭商品
+            ErpGoods params = new ErpGoods();
+            params.setProductIdList(jstProductIds);
+            jSTErpGoodsService.addGoods(params);
+        }
+
+
+        if (failureNum > 0) {
+            failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
+            throw new ServiceException(failureMsg.toString());
+        } else {
+            successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
+        }
+        return successMsg.toString();
+    }
+
+    @Override
+    public int updateFsStoreProductPrice(FsStoreProductScrm fsStoreProduct, Integer price) {
+        List<Long> ids = fsStoreProductMapper.selectFsStoreProductIdList(fsStoreProduct);
+        fsStoreProductAttrValueMapper.updateFsStoreProductAttrValuePrice(ids, (100 + price) / 100.0);
+        return fsStoreProductMapper.updateFsStoreProductPrice(ids, (100 + price) / 100.0);
+    }
+
+    @Override
+    public List<OptionsVO> selectFsStoreProductStoreList() {
+        return fsStoreProductMapper.selectFsStoreProductStoreList();
+    }
+
+    @Override
+    public FsStoreProductScrm selectFsStoreProductByProductId(Long productId) {
+        return fsStoreProductMapper.selectFsStoreProductById(productId);
+    }
+
+    @Override
+    public List<FsStoreProductRuleScrm> selectFsStoreProductRuleList() {
+        return fsStoreProductMapper.selectFsStoreProductRuleList();
+    }
 }

+ 149 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreScrmServiceImpl.java

@@ -0,0 +1,149 @@
+package com.fs.hisStore.service.impl;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.exception.CustomException;
+import com.fs.common.utils.DateUtils;
+import com.fs.his.param.FsStoreAuditParam;
+import com.fs.his.utils.StoreMD5PasswordEncoder;
+import com.fs.hisStore.domain.FsStoreScrm;
+import com.fs.hisStore.mapper.FsStoreScrmMapper;
+import com.fs.hisStore.service.IFsStoreScrmService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Collections;
+import java.util.List;
+
+
+/**
+ * 店铺管理Service业务层处理
+ *
+ * @author fs
+ * @date 2023-06-15
+ */
+@Service
+public class FsStoreScrmServiceImpl implements IFsStoreScrmService
+{
+    @Autowired
+    private FsStoreScrmMapper fsStoreMapper;
+
+
+    /**
+     * 查询店铺管理
+     *
+     * @param storeId 店铺管理主键
+     * @return 店铺管理
+     */
+    @Override
+    public FsStoreScrm selectFsStoreByStoreId(Long storeId)
+    {
+        return fsStoreMapper.selectFsStoreByStoreId(storeId);
+    }
+
+    /**
+     * 查询店铺管理列表
+     *
+     * @param fsStore 店铺管理
+     * @return 店铺管理
+     */
+    @Override
+    public List<FsStoreScrm> selectFsStoreList(FsStoreScrm fsStore)
+    {
+        return fsStoreMapper.selectFsStoreList(fsStore);
+    }
+
+    /**
+     * 新增店铺管理
+     *
+     * @param fsStore 店铺管理
+     * @return 结果
+     */
+    @Override
+    public int insertFsStore(FsStoreScrm fsStore)
+    {
+        if (fsStore.getAccount()!=null){
+            FsStoreScrm fs = fsStoreMapper.selectFsStoreByAccount(fsStore.getAccount());
+            if (fs!=null){
+                throw new CustomException("店铺账号重复");
+            }
+        }
+        StoreMD5PasswordEncoder storeMD5PasswordEncoder = new StoreMD5PasswordEncoder();
+        fsStore.setPassword(storeMD5PasswordEncoder.encode("123456"));
+        fsStore.setCreateTime(DateUtils.getNowDate());
+        return fsStoreMapper.insertFsStore(fsStore);
+    }
+
+    /**
+     * 修改店铺管理
+     *
+     * @param fsStore 店铺管理
+     * @return 结果
+     */
+    @Override
+    public int updateFsStore(FsStoreScrm fsStore)
+    {
+        fsStore.setUpdateTime(DateUtils.getNowDate());
+        return fsStoreMapper.updateFsStore(fsStore);
+    }
+
+    /**
+     * 批量删除店铺管理
+     *
+     * @param storeIds 需要删除的店铺管理主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsStoreByStoreIds(Long[] storeIds)
+    {
+        return fsStoreMapper.deleteFsStoreByStoreIds(storeIds);
+    }
+
+    /**
+     * 删除店铺管理信息
+     *
+     * @param storeId 店铺管理主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsStoreByStoreId(Long storeId)
+    {
+        return fsStoreMapper.deleteFsStoreByStoreId(storeId);
+    }
+
+    @Override
+    public int updateFsStoreAudit(FsStoreAuditParam fsStore) {
+
+
+        return fsStoreMapper.updateFsStoreAudit(fsStore.getStoreId(),fsStore.getIsAudit());
+    }
+
+    @Override
+    public int updateFsStoreLogo(FsStoreScrm fsStore) {
+
+
+        return   fsStoreMapper.updateFsStore(fsStore);
+    }
+
+    @Override
+    public int updateEditData(FsStoreScrm fsStore) {
+        return fsStoreMapper.updateFsStore(fsStore);
+    }
+
+    @Override
+    public List<FsStoreScrm> selectFsStoreListByDoctorId(Long doctorId) {
+        return fsStoreMapper.selectFsStoreListByDoctorId(doctorId);
+    }
+
+    @Override
+    public int refreshFsStore(Long storeId) {
+        FsStoreScrm fsStoreScrm = new FsStoreScrm();
+        fsStoreScrm.setStoreId(storeId);
+        StoreMD5PasswordEncoder storeMD5PasswordEncoder = new StoreMD5PasswordEncoder();
+        fsStoreScrm.setPassword(storeMD5PasswordEncoder.encode("123456"));
+        fsStoreScrm.setUpdateTime(DateUtils.getNowDate());
+        return fsStoreMapper.updateFsStore(fsStoreScrm);
+    }
+
+
+}

+ 219 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/IFsDataScrmServiceImpl.java

@@ -0,0 +1,219 @@
+package com.fs.hisStore.service.impl;
+
+import com.fs.his.dto.DataDTO;
+import com.fs.his.dto.inquiryOrderChartDTO;
+import com.fs.his.vo.*;
+import com.fs.hisStore.mapper.FsDataScrmMapper;
+import com.fs.hisStore.service.IFsDataScrmService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@SuppressWarnings("all")
+@Service
+public class IFsDataScrmServiceImpl implements IFsDataScrmService {
+    @Autowired
+    FsDataScrmMapper fsDataMapper;
+
+    @Override
+    public OrderDataVO getOrderData() {
+        OrderDataVO o = new OrderDataVO();
+        o.setAllOrderNum(fsDataMapper.allOrderNum());
+        o.setTodayOrderNum(fsDataMapper.todayOrderNum());
+        o.setAllOrderMoney(fsDataMapper.allOrderMoney());
+        o.setTodayOrderMoney(fsDataMapper.todayOrderMoney());
+        o.setAllInquiryOrderNum(fsDataMapper.allInquiryOrderNum());
+        o.setTodayInquiryOrderNum(fsDataMapper.todayInquiryOrderNum());
+        o.setTodayDoctor(fsDataMapper.getTodayDoctor());
+        o.setTodayMedicinePe(fsDataMapper.getTodayMedicinePe());
+        o.setStoreProdNum(fsDataMapper.getStoreProdNum());
+        o.setTodayStoreProdNum(fsDataMapper.getTodayStoreProdNum());
+        Long doctor = fsDataMapper.getDoctor();
+        Long medicinePe = fsDataMapper.getMedicinePe();
+        Long patient = fsDataMapper.getPatient();
+        o.setUserNum(fsDataMapper.getUserNum());
+        o.setTodayUserNum(fsDataMapper.getTodayUserNum());
+
+        o.setDoctor(doctor);
+        o.setMedicinePe(medicinePe);
+        o.setPatient(patient);
+        Long pe = doctor + medicinePe + patient;
+        o.setPe(pe);
+        return o;
+    }
+
+    @Override
+    public List<ChartDataVO> getOrderChartData() {
+        return fsDataMapper.getOrderChartData();
+    }
+
+    @Override
+    public List<DoctorChartVO> doctorChartData(Integer type) {
+        List<DoctorChartVO> vo=null;
+        if (type == 0){
+           vo = fsDataMapper.doctorChartData();
+        }else
+        if (type == 1) {
+            vo = fsDataMapper.doctorYearData();
+        }else
+        if (type == 2) {
+            vo = fsDataMapper.doctorMonData();
+        }else
+        if (type == 3) {
+            vo = fsDataMapper.doctorWeekData();
+        }else
+        if (type == 4) {
+            vo = fsDataMapper.doctorDayData();
+        }
+        return vo;
+    }
+
+    @Override
+    public List<ChartDataVO> storeOrderChart(DataDTO dto) {
+        Integer type=dto.getType();
+        Long storeId = dto.getStoreId();
+        List<ChartDataVO> vo=null;
+        if (type == null){
+            vo = fsDataMapper.getOrderChartstoreIdData(storeId);
+        }else
+        if (type == 1) {
+            vo = fsDataMapper.getTodaystoreOrderChart(storeId);
+        }else
+        if (type == 2) {
+            vo = fsDataMapper.getYesterdaystoreOrderChart(storeId);
+        }else
+        if (type == 3) {
+            vo = fsDataMapper.getWeekstoreOrderChart(storeId);
+        }else
+        if (type == 4) {
+            vo = fsDataMapper.getLastWeekstoreOrderChart(storeId);
+        }else
+        if (type == 5) {
+            vo = fsDataMapper.getMonstoreOrderChart(storeId);
+        }else
+        if (type == 6) {
+            vo = fsDataMapper.getLastMonstoreOrderChart(storeId);
+            vo.remove(vo.size()-1);
+        }else
+        if (type == 7) {
+            vo = fsDataMapper.getquarterstoreOrderChart(storeId);
+        }else
+        if (type == 8) {
+            vo = fsDataMapper.getLastquarterstoreOrderChart(storeId);
+        }else
+        if (type == 9) {
+            vo = fsDataMapper.getYearstoreOrderChart(storeId);
+        }else
+        if (type == 10) {
+            vo = fsDataMapper.getLastYearstoreOrderChart(storeId);
+        }
+
+        return vo;
+    }
+
+    @Override
+    public List<ChartDataVO> inquiryOrderChart(inquiryOrderChartDTO dto) {
+        Integer type=dto.getType();
+        Long doctorId = dto.getDoctorId();
+        List<ChartDataVO> vo=null;
+        if (type == null){
+            vo = fsDataMapper.getYearinquiryOrderChart(doctorId);
+        }else
+        if (type == 1) {
+            vo = fsDataMapper.getTodayinquiryOrderChart(doctorId);
+        }else
+        if (type == 2) {
+            vo = fsDataMapper.getYesterdayinquiryOrderChart(doctorId);
+        }else
+        if (type == 3) {
+            vo = fsDataMapper.getWeekinquiryOrderChart(doctorId);
+        }else
+        if (type == 4) {
+            vo = fsDataMapper.getLastWeekinquiryOrderChart(doctorId);
+        }else
+        if (type == 5) {
+            vo = fsDataMapper.getMoninquiryOrderChart(doctorId);
+        }else
+        if (type == 6) {
+            vo = fsDataMapper.getLastMoninquiryOrderChart(doctorId);
+            vo.remove(vo.size()-1);
+        }else
+        if (type == 7) {
+            vo = fsDataMapper.getquarterinquiryOrderChart(doctorId);
+        }else
+        if (type == 8) {
+            vo = fsDataMapper.getLastquarterinquiryOrderChart(doctorId);
+        }else
+        if (type == 9) {
+            vo = fsDataMapper.getYearinquiryOrderChart(doctorId);
+        }else
+        if (type == 10) {
+            vo = fsDataMapper.getLastYearinquiryOrderChart(doctorId);
+        }
+
+        return vo;
+    }
+
+    @Override
+    public List<ChartDaVO> storeOrderChartStore(DataDTO dto) {
+        return fsDataMapper.getStoreDate(dto);
+    }
+
+    @Override
+    public List<ChartDaVO> inquiryOrderChartInq(inquiryOrderChartDTO dto) {
+        return fsDataMapper.getInquiryOrderChartInq(dto);
+    }
+
+    @Override
+    public List<ChartProdVO> ChartProdVO(DataDTO dto) {
+        List<ChartProdVO> chartProdVos = fsDataMapper.ChartProdVO(dto);
+        for (ChartProdVO chartProdVo : chartProdVos) {
+            if (chartProdVo.getPrice()!=null){
+                chartProdVo.setAllPrice(chartProdVo.getPrice().multiply( chartProdVo.getNum()));
+            }
+
+        }
+        return chartProdVos;
+    }
+
+    @Override
+    public StoreOrderDataVO getStoreOrderData(Long id) {
+        StoreOrderDataVO Vo = new StoreOrderDataVO();
+        Vo.setStore(fsDataMapper.getStore(id));
+        Vo.setAStore(fsDataMapper.getAStore(id));
+        Vo.setOrder(fsDataMapper.getOrder(id));
+        Vo.setYsStore(fsDataMapper.getYsStore(id));
+        Vo.setSendStore(fsDataMapper.getSendStore(id));
+        Vo.setGetStore(fsDataMapper.getGetStore(id));
+
+
+        return Vo;
+    }
+
+    @Override
+    public List<ChartDataVO> getStoreOrderChartData(Long loginUserStoreID) {
+        return fsDataMapper.getStoreOrderChartData(loginUserStoreID);
+    }
+
+    @Override
+    public List<DoctorChartVO> storeChartData(Integer type, Long storeId) {
+
+        return  fsDataMapper.ChartStoreProdVo(type,storeId);
+    }
+
+    @Override
+    public List<ChartDataVO> getInquiryOrderChartData() {
+        return fsDataMapper.getInquiryOrderChartData();
+    }
+
+    @Override
+    public List<ChartDataVO> getDoctorInquiryOrderChartData(Long doctorId) {
+        return fsDataMapper.getDoctorInquiryOrderChartData(doctorId);
+    }
+
+    @Override
+    public Long todayInquiryCount(Long doctorId) {
+        return fsDataMapper.getDoctorInquiryCount(doctorId);
+    }
+}

+ 77 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/SysOperLogScrmServiceImpl.java

@@ -0,0 +1,77 @@
+package com.fs.hisStore.service.impl;
+
+import com.fs.hisStore.mapper.SysOperLogScrmMapper;
+import com.fs.hisStore.service.ISysOperLogScrmService;
+import com.fs.hisStore.domain.SysOperLogScrm;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 操作日志 服务层处理
+ *
+
+ */
+@Service
+public class SysOperLogScrmServiceImpl implements ISysOperLogScrmService
+{
+    @Autowired
+    private SysOperLogScrmMapper operLogMapper;
+
+    /**
+     * 新增操作日志
+     *
+     * @param operLog 操作日志对象
+     */
+    @Override
+    public void insertOperlog(SysOperLogScrm operLog)
+    {
+        operLogMapper.insertOperlog(operLog);
+    }
+
+    /**
+     * 查询系统操作日志集合
+     *
+     * @param operLog 操作日志对象
+     * @return 操作日志集合
+     */
+    @Override
+    public List<SysOperLogScrm> selectOperLogList(SysOperLogScrm operLog)
+    {
+        return operLogMapper.selectOperLogList(operLog);
+    }
+
+    /**
+     * 批量删除系统操作日志
+     *
+     * @param operIds 需要删除的操作日志ID
+     * @return 结果
+     */
+    @Override
+    public int deleteOperLogByIds(Long[] operIds)
+    {
+        return operLogMapper.deleteOperLogByIds(operIds);
+    }
+
+    /**
+     * 查询操作日志详细
+     *
+     * @param operId 操作ID
+     * @return 操作日志对象
+     */
+    @Override
+    public SysOperLogScrm selectOperLogById(Long operId)
+    {
+        return operLogMapper.selectOperLogById(operId);
+    }
+
+    /**
+     * 清空操作日志
+     */
+    @Override
+    public void cleanOperLog()
+    {
+        operLogMapper.cleanOperLog();
+    }
+}

+ 56 - 0
fs-service/src/main/java/com/fs/hisStore/vo/FsStoreProductCategoryVO.java

@@ -0,0 +1,56 @@
+package com.fs.hisStore.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import com.fs.his.domain.FsStoreProductCategory;
+import com.fs.hisStore.domain.FsStoreProductCategoryScrm;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class FsStoreProductCategoryVO implements Serializable {
+    /** 商品分类表ID */
+    private Long cateId;
+
+    /** 父id */
+    @Excel(name = "父id")
+    private Long pid;
+    /** 父id */
+    @Excel(name = "父id")
+    private String pname;
+    /** 分类名称 */
+    @Excel(name = "分类名称")
+    private String cateName;
+
+    /** 排序 */
+    @Excel(name = "排序")
+    private Long sort;
+
+    /** 图标 */
+    @Excel(name = "图标")
+    private String pic;
+
+    /** 是否推荐 */
+    @Excel(name = "是否推荐")
+    private Integer isShow;
+
+    /** 删除状态 */
+    @Excel(name = "删除状态")
+    private String isDel;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+
+    /** 更新时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+
+    List<FsStoreProductCategoryScrm> children;
+
+}

+ 51 - 0
fs-service/src/main/java/com/fs/hisStore/vo/FsStoreProductCategorysVO.java

@@ -0,0 +1,51 @@
+package com.fs.hisStore.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import com.fs.hisStore.domain.FsStoreProductCategoryScrm;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class FsStoreProductCategorysVO implements Serializable {
+    /** 商品分类表ID */
+    private Long cateId;
+
+    /** 父id */
+    @Excel(name = "父id")
+    private Long pid;
+
+    /** 分类名称 */
+    @Excel(name = "分类名称")
+    private String cateName;
+
+    /** 排序 */
+    @Excel(name = "排序")
+    private Long sort;
+
+    /** 图标 */
+    @Excel(name = "图标")
+    private String pic;
+
+    /** 是否推荐 */
+    @Excel(name = "是否推荐")
+    private Integer isShow;
+
+    /** 删除状态 */
+    @Excel(name = "删除状态")
+    private String isDel;
+
+        List<FsStoreProductCategoryScrm> children;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+
+    /** 更新时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+}

+ 85 - 2
fs-service/src/main/java/com/fs/task/StoreTask.java → fs-service/src/main/java/com/fs/task/MallStoreTask.java

@@ -21,8 +21,8 @@ import com.fs.his.dto.ExpressInfoDTO;
 import com.fs.his.service.IFsExpressService;
 import com.fs.his.service.IFsUserService;
 import com.fs.his.utils.ConfigUtil;
-import com.fs.hisStore.config.FsErpConfig;
 import com.fs.hisStore.domain.*;
+import com.fs.hisStore.dto.DateComparisonConfigDTO;
 import com.fs.hisStore.enums.ShipperCodeEnum;
 import com.fs.hisStore.mapper.FsStoreOrderItemScrmMapper;
 import com.fs.hisStore.mapper.FsStoreOrderScrmMapper;
@@ -35,16 +35,20 @@ import com.fs.pay.service.IPayService;
 import com.fs.store.config.StoreConfig;
 import com.fs.system.service.ISysConfigService;
 import com.fs.ybPay.domain.OrderResult;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.stereotype.Component;
 
 import java.math.BigDecimal;
 import java.text.ParseException;
+import java.time.LocalTime;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 import static com.fs.hisStore.constants.StoreConstants.DELIVERY;
 
@@ -53,8 +57,9 @@ import static com.fs.hisStore.constants.StoreConstants.DELIVERY;
  *
  * @author fs
  */
+@Slf4j
 @Component("mallStoreTask")
-public class StoreTask
+public class MallStoreTask
 {
     @Autowired
     private RedisTemplate redisTemplate;
@@ -504,4 +509,82 @@ public class StoreTask
         fsUserOnlineStateService.insertUserNotOnline();
     }*/
 
+    /**
+     * 提醒证件到期任务
+     * */
+    @Autowired
+    private JdbcTemplate jdbcTemplate;
+    public void remindCertValidation() {
+        log.info("提醒店铺证件到期任务执行... 当前时间: {}", LocalTime.now());
+
+        // 从配置表获取需要比较的表和字段
+        List<DateComparisonConfigDTO> tablesToCheck = jdbcTemplate.query(
+                "SELECT table_name, date_column,in_advance,user_column,phone_column,remind_words,platform,cert_type" +
+                        " FROM date_comparison_config",(rs, rowNum)->{
+                    return DateComparisonConfigDTO.builder()
+                            .tableName(rs.getString("table_name"))//表名
+                            .certType(rs.getString("cert_type"))//证件类型
+                            .dateColumn(rs.getString("date_column"))//日期字段
+                            .userColumn(rs.getString("user_column"))//用户字段
+                            .remindWords(rs.getString("remindWords"))//提醒内容
+                            .phoneColumn(rs.getString("phone_column"))//提醒手机
+                            .inAdvance(rs.getInt("inAdvance"))//提前天数
+                            .platform(rs.getString("platform")).build();//平台
+                });
+
+        tablesToCheck.forEach(dto -> {
+            //获取证件失效日期字段小于当前时间加提前天数的用户和电话号码
+            String sql = String.format("SELECT %s , %s " +
+                            "FROM %s " +
+                            "WHERE %s >= DATE_SUB(CURDATE(), INTERVAL %d DAY)",
+                            dto.getUserColumn(),
+                            dto.getPhoneColumn(),
+                            dto.getTableName(),
+                            dto.getDateColumn(),
+                            dto.getInAdvance()
+                            );
+            List<Map<String, Object>> users = jdbcTemplate.queryForList(sql);
+            users.forEach(user -> {
+                String userName = (String) user.get(dto.getUserColumn());
+                String phone = (String) user.get(dto.getPhoneColumn());
+                String remindWords = String.format("【%s平台提示】尊敬的%s用户,店铺%s证件即将到期,请及时处理!",
+                        dto.getPlatform(),
+                        userName,
+                        dto.getCertType());
+                // 使用phone发送remindWords短信
+                // TODO 发送通知
+            });
+        });
+
+    }
+
+    /**
+     * 禁用店铺
+     * */
+    public void disable() {
+        log.info("禁用店铺任务执行... 当前时间: {}", LocalTime.now());
+        // 从配置表获取需要禁用的表和字段
+        List<DateComparisonConfigDTO> toDisable = jdbcTemplate.query(
+                "SELECT table_name, date_column,invalid_expression,status_column" +
+                        " FROM date_comparison_config " +
+                        " WHERE is_do_invalid = '1'",(rs, rowNum)-> DateComparisonConfigDTO.builder()
+                                .tableName(rs.getString("table_name"))//表名
+                                .dateColumn(rs.getString("date_column"))//日期字段
+                                .invalidExpression(rs.getString("invalid_expression"))//失效表达式
+                                .statusColumn(rs.getString("status_column"))//状态字段
+                                .build());
+
+        toDisable.forEach(dto -> {
+            //更新证件失效日期字段小于当前时间的数据
+            String sql = String.format("UPDATE %s " +
+                    "SET %s = %s " +
+                    "WHERE %s < CURDATE()",
+                    dto.getTableName(),
+                    dto.getStatusColumn(),
+                    dto.getInvalidExpression(),
+                    dto.getDateColumn());
+            jdbcTemplate.update(sql);
+        });
+    }
+
 }

+ 82 - 0
fs-service/src/main/resources/mapper/hisStore/FsStoreAfterSalesLogsScrmMapper.xml

@@ -0,0 +1,82 @@
+<?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.hisStore.mapper.FsStoreAfterSalesLogsScrmMapper">
+
+    <resultMap type="FsStoreAfterSalesLogsScrm" id="FsStoreAfterSalesLogsResult">
+        <result property="logsId"    column="logs_id"    />
+        <result property="storeAfterSalesId"    column="store_after_sales_id"    />
+        <result property="changeType"    column="change_type"    />
+        <result property="changeMessage"    column="change_message"    />
+        <result property="changeTime"    column="change_time"    />
+        <result property="operator"    column="operator"    />
+    </resultMap>
+
+    <sql id="selectFsStoreAfterSalesLogsVo">
+        select logs_id, store_after_sales_id, change_type, change_message, change_time, operator from fs_store_after_sales_logs_scrm
+    </sql>
+
+    <select id="selectFsStoreAfterSalesLogsList" parameterType="FsStoreAfterSalesLogsScrm" resultMap="FsStoreAfterSalesLogsResult">
+        <include refid="selectFsStoreAfterSalesLogsVo"/>
+        <where>
+            <if test="storeAfterSalesId != null "> and store_after_sales_id = #{storeAfterSalesId}</if>
+            <if test="changeType != null "> and change_type = #{changeType}</if>
+            <if test="changeMessage != null  and changeMessage != ''"> and change_message = #{changeMessage}</if>
+            <if test="changeTime != null "> and change_time = #{changeTime}</if>
+            <if test="operator != null  and operator != ''"> and operator = #{operator}</if>
+        </where>
+    </select>
+
+    <select id="selectFsStoreAfterSalesLogsByLogsId" parameterType="Long" resultMap="FsStoreAfterSalesLogsResult">
+        <include refid="selectFsStoreAfterSalesLogsVo"/>
+        where logs_id = #{logsId}
+    </select>
+
+    <insert id="insertFsStoreAfterSalesLogs" parameterType="FsStoreAfterSalesLogsScrm" useGeneratedKeys="true" keyProperty="logsId">
+        insert into fs_store_after_sales_logs_scrm
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="storeAfterSalesId != null">store_after_sales_id,</if>
+            <if test="changeType != null">change_type,</if>
+            <if test="changeMessage != null">change_message,</if>
+            <if test="changeTime != null">change_time,</if>
+            <if test="operator != null">operator,</if>
+            <if test="companyId != null">company_id,</if>
+            <if test="storeId != null">store_id,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="storeAfterSalesId != null">#{storeAfterSalesId},</if>
+            <if test="changeType != null">#{changeType},</if>
+            <if test="changeMessage != null">#{changeMessage},</if>
+            <if test="changeTime != null">#{changeTime},</if>
+            <if test="operator != null">#{operator},</if>
+            <if test="companyId != null">#{companyId},</if>
+            <if test="storeId != null">#{storeId},</if>
+         </trim>
+    </insert>
+
+    <update id="updateFsStoreAfterSalesLogs" parameterType="FsStoreAfterSalesLogsScrm">
+        update fs_store_after_sales_logs_scrm
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="storeAfterSalesId != null">store_after_sales_id = #{storeAfterSalesId},</if>
+            <if test="changeType != null">change_type = #{changeType},</if>
+            <if test="changeMessage != null">change_message = #{changeMessage},</if>
+            <if test="changeTime != null">change_time = #{changeTime},</if>
+            <if test="operator != null">operator = #{operator},</if>
+            <if test="companyId != null">company_id = #{companyId},</if>
+            <if test="storeId != null">store_id = #{storeId},</if>
+        </trim>
+        where logs_id = #{logsId}
+    </update>
+
+    <delete id="deleteFsStoreAfterSalesLogsByLogsId" parameterType="Long">
+        delete from fs_store_after_sales_logs_scrm where logs_id = #{logsId}
+    </delete>
+
+    <delete id="deleteFsStoreAfterSalesLogsByLogsIds" parameterType="String">
+        delete from fs_store_after_sales_logs_scrm where logs_id in
+        <foreach item="logsId" collection="array" open="(" separator="," close=")">
+            #{logsId}
+        </foreach>
+    </delete>
+</mapper>

+ 89 - 0
fs-service/src/main/resources/mapper/hisStore/FsStoreBillScrmMapper.xml

@@ -0,0 +1,89 @@
+<?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.hisStore.mapper.FsStoreBillScrmMapper">
+
+    <resultMap type="FsStoreBillScrm" id="FsStoreBillResult">
+        <result property="billId"    column="bill_id"    />
+        <result property="storeId"    column="store_id"    />
+        <result property="title"    column="title"    />
+        <result property="money"    column="money"    />
+        <result property="balance"    column="balance"    />
+        <result property="billType"    column="bill_type"    />
+        <result property="remark"    column="remark"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="businessId"    column="business_id"    />
+    </resultMap>
+
+    <sql id="selectFsStoreBillVo">
+        select bill_id, store_id, title, money, balance, bill_type, remark, create_time, business_id from fs_store_bill_scrm
+    </sql>
+
+    <select id="selectFsStoreBillList" parameterType="FsStoreBillScrm" resultMap="FsStoreBillResult">
+        <include refid="selectFsStoreBillVo"/>
+        <where>
+            <if test="storeId != null "> and store_id = #{storeId}</if>
+            <if test="title != null  and title != ''"> and title = #{title}</if>
+            <if test="money != null "> and money = #{money}</if>
+            <if test="balance != null "> and balance = #{balance}</if>
+            <if test="billType != null "> and bill_type = #{billType}</if>
+            <if test="businessId != null  and businessId != ''"> and business_id = #{businessId}</if>
+        </where>
+    </select>
+
+    <select id="selectFsStoreBillByBillId" parameterType="Long" resultMap="FsStoreBillResult">
+        <include refid="selectFsStoreBillVo"/>
+        where bill_id = #{billId}
+    </select>
+
+    <insert id="insertFsStoreBill" parameterType="FsStoreBillScrm" useGeneratedKeys="true" keyProperty="billId">
+        insert into fs_store_bill_scrm
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="storeId != null">store_id,</if>
+            <if test="title != null">title,</if>
+            <if test="money != null">money,</if>
+            <if test="balance != null">balance,</if>
+            <if test="billType != null">bill_type,</if>
+            <if test="remark != null">remark,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="businessId != null">business_id,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="storeId != null">#{storeId},</if>
+            <if test="title != null">#{title},</if>
+            <if test="money != null">#{money},</if>
+            <if test="balance != null">#{balance},</if>
+            <if test="billType != null">#{billType},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="businessId != null">#{businessId},</if>
+         </trim>
+    </insert>
+
+    <update id="updateFsStoreBill" parameterType="FsStoreBillScrm">
+        update fs_store_bill_scrm
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="storeId != null">store_id = #{storeId},</if>
+            <if test="title != null">title = #{title},</if>
+            <if test="money != null">money = #{money},</if>
+            <if test="balance != null">balance = #{balance},</if>
+            <if test="billType != null">bill_type = #{billType},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="businessId != null">business_id = #{businessId},</if>
+        </trim>
+        where bill_id = #{billId}
+    </update>
+
+    <delete id="deleteFsStoreBillByBillId" parameterType="Long">
+        delete from fs_store_bill_scrm where bill_id = #{billId}
+    </delete>
+
+    <delete id="deleteFsStoreBillByBillIds" parameterType="String">
+        delete from fs_store_bill_scrm where bill_id in
+        <foreach item="billId" collection="array" open="(" separator="," close=")">
+            #{billId}
+        </foreach>
+    </delete>
+</mapper>

+ 129 - 0
fs-service/src/main/resources/mapper/hisStore/FsStoreExtractScrmMapper.xml

@@ -0,0 +1,129 @@
+<?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.hisStore.mapper.FsStoreExtractScrmMapper">
+
+    <resultMap type="FsStoreExtractScrm" id="FsStoreExtractResult">
+        <result property="extractId"    column="extract_id"    />
+        <result property="storeId"    column="store_id"    />
+        <result property="realName"    column="real_name"    />
+        <result property="extractType"    column="extract_type"    />
+        <result property="bankCode"    column="bank_code"    />
+        <result property="bankAddress"    column="bank_address"    />
+        <result property="alipayCode"    column="alipay_code"    />
+        <result property="extractPrice"    column="extract_price"    />
+        <result property="mark"    column="mark"    />
+        <result property="balance"    column="balance"    />
+        <result property="failMsg"    column="fail_msg"    />
+        <result property="failTime"    column="fail_time"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="status"    column="status"    />
+        <result property="wechat"    column="wechat"    />
+        <result property="isDel"    column="is_del"    />
+    </resultMap>
+
+    <sql id="selectFsStoreExtractVo">
+        select extract_id, store_id, real_name, extract_type, bank_code, bank_address, alipay_code, extract_price, mark, balance, fail_msg, fail_time, create_time, update_time, status, wechat, is_del from fs_store_extract_scrm
+    </sql>
+
+    <select id="selectFsStoreExtractList" parameterType="FsStoreExtractScrm" resultMap="FsStoreExtractResult">
+        <include refid="selectFsStoreExtractVo"/>
+        <where>
+            <if test="storeId != null  and storeId != ''"> and store_id = #{storeId}</if>
+            <if test="realName != null  and realName != ''"> and real_name like concat('%', #{realName}, '%')</if>
+            <if test="extractType != null  and extractType != ''"> and extract_type = #{extractType}</if>
+            <if test="bankCode != null  and bankCode != ''"> and bank_code = #{bankCode}</if>
+            <if test="bankAddress != null  and bankAddress != ''"> and bank_address = #{bankAddress}</if>
+            <if test="alipayCode != null  and alipayCode != ''"> and alipay_code = #{alipayCode}</if>
+            <if test="extractPrice != null "> and extract_price = #{extractPrice}</if>
+            <if test="mark != null  and mark != ''"> and mark = #{mark}</if>
+            <if test="balance != null "> and balance = #{balance}</if>
+            <if test="failMsg != null  and failMsg != ''"> and fail_msg = #{failMsg}</if>
+            <if test="failTime != null "> and fail_time = #{failTime}</if>
+            <if test="status != null "> and status = #{status}</if>
+            <if test="wechat != null  and wechat != ''"> and wechat = #{wechat}</if>
+            <if test="isDel != null "> and is_del = #{isDel}</if>
+        </where>
+    </select>
+
+    <select id="selectFsStoreExtractByExtractId" parameterType="String" resultMap="FsStoreExtractResult">
+        <include refid="selectFsStoreExtractVo"/>
+        where extract_id = #{extractId}
+    </select>
+
+    <insert id="insertFsStoreExtract" parameterType="FsStoreExtractScrm" useGeneratedKeys="true" keyProperty="extractId">
+        insert into fs_store_extract_scrm
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="storeId != null">store_id,</if>
+            <if test="realName != null">real_name,</if>
+            <if test="extractType != null">extract_type,</if>
+            <if test="bankCode != null">bank_code,</if>
+            <if test="bankAddress != null">bank_address,</if>
+            <if test="alipayCode != null">alipay_code,</if>
+            <if test="extractPrice != null">extract_price,</if>
+            <if test="mark != null">mark,</if>
+            <if test="balance != null">balance,</if>
+            <if test="failMsg != null">fail_msg,</if>
+            <if test="failTime != null">fail_time,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="status != null">status,</if>
+            <if test="wechat != null">wechat,</if>
+            <if test="isDel != null">is_del,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="storeId != null">#{storeId},</if>
+            <if test="realName != null">#{realName},</if>
+            <if test="extractType != null">#{extractType},</if>
+            <if test="bankCode != null">#{bankCode},</if>
+            <if test="bankAddress != null">#{bankAddress},</if>
+            <if test="alipayCode != null">#{alipayCode},</if>
+            <if test="extractPrice != null">#{extractPrice},</if>
+            <if test="mark != null">#{mark},</if>
+            <if test="balance != null">#{balance},</if>
+            <if test="failMsg != null">#{failMsg},</if>
+            <if test="failTime != null">#{failTime},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="status != null">#{status},</if>
+            <if test="wechat != null">#{wechat},</if>
+            <if test="isDel != null">#{isDel},</if>
+         </trim>
+    </insert>
+
+    <update id="updateFsStoreExtract" parameterType="FsStoreExtractScrm">
+        update fs_store_extract_scrm
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="storeId != null">store_id = #{storeId},</if>
+            <if test="realName != null">real_name = #{realName},</if>
+            <if test="extractType != null">extract_type = #{extractType},</if>
+            <if test="bankCode != null">bank_code = #{bankCode},</if>
+            <if test="bankAddress != null">bank_address = #{bankAddress},</if>
+            <if test="alipayCode != null">alipay_code = #{alipayCode},</if>
+            <if test="extractPrice != null">extract_price = #{extractPrice},</if>
+            <if test="mark != null">mark = #{mark},</if>
+            <if test="balance != null">balance = #{balance},</if>
+            <if test="failMsg != null">fail_msg = #{failMsg},</if>
+            <if test="failTime != null">fail_time = #{failTime},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="wechat != null">wechat = #{wechat},</if>
+            <if test="isDel != null">is_del = #{isDel},</if>
+        </trim>
+        where extract_id = #{extractId}
+    </update>
+
+    <delete id="deleteFsStoreExtractByExtractId" parameterType="String">
+        delete from fs_store_extract_scrm where extract_id = #{extractId}
+    </delete>
+
+    <delete id="deleteFsStoreExtractByExtractIds" parameterType="String">
+        delete from fs_store_extract_scrm where extract_id in
+        <foreach item="extractId" collection="array" open="(" separator="," close=")">
+            #{extractId}
+        </foreach>
+    </delete>
+</mapper>

+ 76 - 0
fs-service/src/main/resources/mapper/hisStore/FsStoreOrderLogsScrmMapper.xml

@@ -0,0 +1,76 @@
+<?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.hisStore.mapper.FsStoreOrderLogsScrmMapper">
+
+    <resultMap type="FsStoreOrderLogsScrm" id="FsStoreOrderLogsResult">
+        <result property="logsId"    column="logs_id"    />
+        <result property="orderId"    column="order_id"    />
+        <result property="changeType"    column="change_type"    />
+        <result property="changeMessage"    column="change_message"    />
+        <result property="changeTime"    column="change_time"    />
+        <result property="operator"    column="operator"    />
+    </resultMap>
+
+    <sql id="selectFsStoreOrderLogsVo">
+        select logs_id, order_id, change_type, change_message, change_time, operator from fs_store_order_logs_scrm
+    </sql>
+
+    <select id="selectFsStoreOrderLogsList" parameterType="FsStoreOrderLogsScrm" resultMap="FsStoreOrderLogsResult">
+        <include refid="selectFsStoreOrderLogsVo"/>
+        <where>
+            <if test="orderId != null  and orderId != ''"> and order_id = #{orderId}</if>
+            <if test="changeType != null  and changeType != ''"> and change_type = #{changeType}</if>
+            <if test="changeMessage != null  and changeMessage != ''"> and change_message = #{changeMessage}</if>
+            <if test="changeTime != null "> and change_time = #{changeTime}</if>
+            <if test="operator != null  and operator != ''"> and operator = #{operator}</if>
+        </where>
+    </select>
+
+    <select id="selectFsStoreOrderLogsByLogsId" parameterType="String" resultMap="FsStoreOrderLogsResult">
+        <include refid="selectFsStoreOrderLogsVo"/>
+        where logs_id = #{logsId}
+    </select>
+
+    <insert id="insertFsStoreOrderLogs" parameterType="FsStoreOrderLogsScrm" useGeneratedKeys="true" keyProperty="logsId">
+        insert into fs_store_order_logs_scrm
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="orderId != null and orderId != ''">order_id,</if>
+            <if test="changeType != null and changeType != ''">change_type,</if>
+            <if test="changeMessage != null and changeMessage != ''">change_message,</if>
+            <if test="changeTime != null">change_time,</if>
+            <if test="operator != null">operator,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="orderId != null and orderId != ''">#{orderId},</if>
+            <if test="changeType != null and changeType != ''">#{changeType},</if>
+            <if test="changeMessage != null and changeMessage != ''">#{changeMessage},</if>
+            <if test="changeTime != null">#{changeTime},</if>
+            <if test="operator != null">#{operator},</if>
+         </trim>
+    </insert>
+
+    <update id="updateFsStoreOrderLogs" parameterType="FsStoreOrderLogsScrm">
+        update fs_store_order_logs_scrm
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="orderId != null and orderId != ''">order_id = #{orderId},</if>
+            <if test="changeType != null and changeType != ''">change_type = #{changeType},</if>
+            <if test="changeMessage != null and changeMessage != ''">change_message = #{changeMessage},</if>
+            <if test="changeTime != null">change_time = #{changeTime},</if>
+            <if test="operator != null">operator = #{operator},</if>
+        </trim>
+        where logs_id = #{logsId}
+    </update>
+
+    <delete id="deleteFsStoreOrderLogsByLogsId" parameterType="String">
+        delete from fs_store_order_logs_scrm where logs_id = #{logsId}
+    </delete>
+
+    <delete id="deleteFsStoreOrderLogsByLogsIds" parameterType="String">
+        delete from fs_store_order_logs_scrm where logs_id in
+        <foreach item="logsId" collection="array" open="(" separator="," close=")">
+            #{logsId}
+        </foreach>
+    </delete>
+</mapper>

+ 5 - 0
fs-service/src/main/resources/mapper/hisStore/FsStoreProductScrmMapper.xml

@@ -55,6 +55,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select product_id, image,video, 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,company_ids from fs_store_product_scrm
     </sql>
 
+    <select id="selectFsStoreProductByProductId" parameterType="Long" resultMap="FsStoreProductResult">
+        <include refid="selectFsStoreProductVo"/>
+        where product_id = #{productId}
+    </select>
+
     <select id="selectFsStoreProductList" parameterType="FsStoreProductScrm" resultMap="FsStoreProductResult">
         <include refid="selectFsStoreProductVo"/>
         <where>

+ 170 - 0
fs-service/src/main/resources/mapper/hisStore/FsStoreScrmMapper.xml

@@ -0,0 +1,170 @@
+<?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.hisStore.mapper.FsStoreScrmMapper">
+
+    <resultMap type="FsStoreScrm" id="FsStoreResult">
+        <result property="storeId"    column="store_id"    />
+        <result property="cityIds"    column="city_ids"    />
+        <result property="storeName"    column="store_name"    />
+        <result property="descs"    column="descs"    />
+        <result property="logoUrl"    column="logo_url"    />
+        <result property="address"    column="address"    />
+        <result property="lng"    column="lng"    />
+        <result property="lat"    column="lat"    />
+        <result property="phone"    column="phone"    />
+        <result property="licenseImages"    column="license_images"    />
+        <result property="productCount"    column="product_count"    />
+        <result property="status"    column="status"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="salesCount"    column="sales_count"    />
+        <result property="balance"    column="balance"    />
+        <result property="totalMoney"    column="total_money"    />
+        <result property="isAudit"    column="is_audit"    />
+        <result property="account"    column="account"    />
+        <result property="password"    column="password"    />
+        <result property="shippingType"    column="shipping_type"    />
+        <result property="brokerageType"    column="brokerage_type"    />
+        <result property="brokerageRate"    column="brokerage_rate"    />
+        <result property="fullName"    column="full_name"    />
+        <result property="refundPhone"    column="refund_phone"    />
+        <result property="refundAddress"    column="refund_address"    />
+        <result property="refundConsignee"    column="refund_consignee"    />
+        <result property="deliveryType"    column="delivery_type"    />
+        <result property="sendPhone"    column="send_phone"    />
+    </resultMap>
+
+    <sql id="selectFsStoreVo">
+        select store_id,full_name,delivery_type,send_phone, brokerage_rate,refund_phone,refund_address,refund_consignee,city_ids, store_name, descs, brokerage_type,logo_url, address, lng, lat, phone, license_images, product_count, status, create_time, update_time, sales_count, balance, total_money, is_audit, account, password, shipping_type from fs_store_scrm
+    </sql>
+
+    <select id="selectFsStoreList" parameterType="FsStoreScrm" resultMap="FsStoreResult">
+        <include refid="selectFsStoreVo"/>
+        <where>
+            <if test="storeName != null  and storeName != ''"> and store_name like concat('%', #{storeName}, '%')</if>
+            <if test="address != null  and address != ''"> and address like concat('%', #{address}, '%')</if>
+            <if test="phone != null  and phone != ''"> and phone = #{phone}</if>
+            <if test="status != null "> and status = #{status}</if>
+            <if test="isAudit != null "> and is_audit = #{isAudit}</if>
+            <if test="account != null  and account != ''"> and account like concat('%', #{account}, '%')</if>
+        </where>
+        order by store_id desc
+    </select>
+
+    <select id="selectFsStoreByStoreId" parameterType="Long" resultMap="FsStoreResult">
+        <include refid="selectFsStoreVo"/>
+        where store_id = #{storeId}
+    </select>
+
+    <insert id="insertFsStore" parameterType="FsStoreScrm" useGeneratedKeys="true" keyProperty="storeId">
+        insert into fs_store_scrm
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="cityIds != null">city_ids,</if>
+            <if test="storeName != null">store_name,</if>
+            <if test="descs != null">descs,</if>
+            <if test="logoUrl != null">logo_url,</if>
+            <if test="address != null">address,</if>
+            <if test="lng != null">lng,</if>
+            <if test="lat != null">lat,</if>
+            <if test="phone != null">phone,</if>
+            <if test="licenseImages != null">license_images,</if>
+            <if test="productCount != null">product_count,</if>
+            <if test="status != null">status,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="salesCount != null">sales_count,</if>
+            <if test="balance != null">balance,</if>
+            <if test="totalMoney != null">total_money,</if>
+            <if test="isAudit != null">is_audit,</if>
+            <if test="account != null">account,</if>
+            <if test="password != null">password,</if>
+            <if test="shippingType != null">shipping_type,</if>
+            <if test="brokerageType != null">brokerage_type,</if>
+            <if test="brokerageRate != null">brokerage_rate,</if>
+            <if test="fullName != null">full_name,</if>
+            <if test="refundPhone != null">refund_phone,</if>
+            <if test="refundAddress != null">refund_address,</if>
+            <if test="refundConsignee != null">refund_consignee,</if>
+            <if test="deliveryType != null">delivery_type,</if>
+            <if test="sendPhone != null">send_phone,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="cityIds != null">#{cityIds},</if>
+            <if test="storeName != null">#{storeName},</if>
+            <if test="descs != null">#{descs},</if>
+            <if test="logoUrl != null">#{logoUrl},</if>
+            <if test="address != null">#{address},</if>
+            <if test="lng != null">#{lng},</if>
+            <if test="lat != null">#{lat},</if>
+            <if test="phone != null">#{phone},</if>
+            <if test="licenseImages != null">#{licenseImages},</if>
+            <if test="productCount != null">#{productCount},</if>
+            <if test="status != null">#{status},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="salesCount != null">#{salesCount},</if>
+            <if test="balance != null">#{balance},</if>
+            <if test="totalMoney != null">#{totalMoney},</if>
+            <if test="isAudit != null">#{isAudit},</if>
+            <if test="account != null">#{account},</if>
+            <if test="password != null">#{password},</if>
+            <if test="shippingType != null">#{shippingType},</if>
+            <if test="brokerageType != null">#{brokerageType},</if>
+            <if test="brokerageRate != null">#{brokerageRate},</if>
+            <if test="fullName != null">#{fullName},</if>
+            <if test="refundPhone != null">#{refundPhone},</if>
+            <if test="refundAddress != null">#{refundAddress},</if>
+            <if test="refundConsignee != null">#{refundConsignee},</if>
+            <if test="deliveryType != null">#{deliveryType},</if>
+            <if test="sendPhone != null">#{sendPhone},</if>
+        </trim>
+    </insert>
+
+    <update id="updateFsStore" parameterType="FsStoreScrm">
+        update fs_store_scrm
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="cityIds != null">city_ids = #{cityIds},</if>
+            <if test="storeName != null">store_name = #{storeName},</if>
+            <if test="descs != null">descs = #{descs},</if>
+            <if test="logoUrl != null">logo_url = #{logoUrl},</if>
+            <if test="address != null">address = #{address},</if>
+            <if test="lng != null">lng = #{lng},</if>
+            <if test="lat != null">lat = #{lat},</if>
+            <if test="phone != null">phone = #{phone},</if>
+            <if test="licenseImages != null">license_images = #{licenseImages},</if>
+            <if test="productCount != null">product_count = #{productCount},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="salesCount != null">sales_count = #{salesCount},</if>
+            <if test="balance != null">balance = #{balance},</if>
+            <if test="totalMoney != null">total_money = #{totalMoney},</if>
+            <if test="isAudit != null">is_audit = #{isAudit},</if>
+            <if test="account != null">account = #{account},</if>
+            <if test="password != null">password = #{password},</if>
+            <if test="shippingType != null">shipping_type = #{shippingType},</if>
+            <if test="brokerageType != null">brokerage_type = #{brokerageType},</if>
+            <if test="brokerageRate != null">brokerage_rate = #{brokerageRate},</if>
+            <if test="fullName != null">full_name = #{fullName},</if>
+            <if test="refundPhone != null">refund_phone = #{refundPhone},</if>
+            <if test="refundAddress != null">refund_address = #{refundAddress},</if>
+            <if test="refundConsignee != null">refund_consignee = #{refundConsignee},</if>
+            <if test="deliveryType != null">delivery_type = #{deliveryType},</if>
+            <if test="sendPhone != null">send_phone = #{sendPhone},</if>
+        </trim>
+        where store_id = #{storeId}
+    </update>
+
+    <delete id="deleteFsStoreByStoreId" parameterType="Long">
+        delete from fs_store_scrm where store_id = #{storeId}
+    </delete>
+
+    <delete id="deleteFsStoreByStoreIds" parameterType="String">
+        delete from fs_store_scrm where store_id in
+        <foreach item="storeId" collection="array" open="(" separator="," close=")">
+            #{storeId}
+        </foreach>
+    </delete>
+</mapper>

+ 79 - 0
fs-service/src/main/resources/mapper/hisStore/SysOperLogScrmMapper.xml

@@ -0,0 +1,79 @@
+<?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.hisStore.mapper.SysOperLogScrmMapper">
+
+	<resultMap type="SysOperLogScrm" id="SysOperLogResult">
+		<id     property="operId"         column="oper_id"        />
+		<result property="title"          column="title"          />
+		<result property="businessType"   column="business_type"  />
+		<result property="method"         column="method"         />
+		<result property="requestMethod"  column="request_method" />
+		<result property="operatorType"   column="operator_type"  />
+		<result property="operName"       column="oper_name"      />
+		<result property="deptName"       column="dept_name"      />
+		<result property="operUrl"        column="oper_url"       />
+		<result property="operIp"         column="oper_ip"        />
+		<result property="operLocation"   column="oper_location"  />
+		<result property="operParam"      column="oper_param"     />
+		<result property="jsonResult"     column="json_result"    />
+		<result property="status"         column="status"         />
+		<result property="errorMsg"       column="error_msg"      />
+		<result property="operTime"       column="oper_time"      />
+		<result property="mainType"       column="main_type"       />
+		<result property="des"         column="des"    />
+	</resultMap>
+
+	<sql id="selectOperLogVo">
+        select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time, main_type, des
+        from sys_oper_log_scrm
+    </sql>
+
+	<insert id="insertOperlog" parameterType="SysOperLogScrm">
+		insert into sys_oper_log_scrm(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time, main_type, des)
+        values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, sysdate(), #{mainType}, #{des})
+	</insert>
+
+	<select id="selectOperLogList" parameterType="SysOperLogScrm" resultMap="SysOperLogResult">
+		<include refid="selectOperLogVo"/>
+		<where>
+			<if test="mainType != null and mainType != ''">
+				AND main_type = #{main_type},
+			</if>
+			<if test="title != null and title != ''">
+				AND title like concat('%', #{title}, '%')
+			</if>
+			<if test="businessType != null and businessType != ''">
+				AND business_type = #{businessType}
+			</if>
+			<if test="businessTypes != null and businessTypes.length > 0">
+			    AND business_type in
+			    <foreach collection="businessTypes" item="businessType" open="(" separator="," close=")">
+		 			#{businessType}
+		        </foreach>
+			</if>
+			<if test="status != null">
+				AND status = #{status}
+			</if>
+			<if test="operName != null and operName != ''">
+				AND oper_name like concat('%', #{operName}, '%')
+			</if>
+			<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
+				and date_format(oper_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
+			</if>
+			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
+				and date_format(oper_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
+			</if>
+		</where>
+		order by oper_id desc
+	</select>
+
+
+ 	<select id="selectOperLogById" parameterType="Long" resultMap="SysOperLogResult">
+		<include refid="selectOperLogVo"/>
+		where oper_id = #{operId}
+	</select>
+
+
+</mapper>

+ 49 - 6
fs-store/src/main/java/com/fs/framework/config/SecurityConfig.java

@@ -4,6 +4,9 @@ package com.fs.framework.config;
 import com.fs.framework.security.filter.JwtAuthenticationTokenFilter;
 import com.fs.framework.security.handle.AuthenticationEntryPointImpl;
 import com.fs.framework.security.handle.LogoutSuccessHandlerImpl;
+import com.fs.framework.security.handle.LogoutSuccessScrmHandlerImpl;
+import com.fs.framework.service.UserDetailsScrmServiceImpl;
+import com.fs.framework.service.UserDetailsServiceImpl;
 import com.fs.store.utils.MD5PasswordEncoder;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Bean;
@@ -18,7 +21,16 @@ import org.springframework.security.core.userdetails.UserDetailsService;
 import org.springframework.security.crypto.password.PasswordEncoder;
 import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
 import org.springframework.security.web.authentication.logout.LogoutFilter;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
 import org.springframework.web.filter.CorsFilter;
+import org.springframework.web.filter.OncePerRequestFilter;
+
+import javax.servlet.FilterChain;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
 
 /**
  * spring security配置
@@ -32,7 +44,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
      * 自定义用户认证逻辑
      */
     @Autowired
-    private UserDetailsService userDetailsService;
+    private UserDetailsServiceImpl userDetailsService;
+
+    @Autowired
+    private UserDetailsScrmServiceImpl userDetailsScrmService;
 
     /**
      * 认证失败处理类
@@ -46,6 +61,12 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
     @Autowired
     private LogoutSuccessHandlerImpl logoutSuccessHandler;
 
+    /**
+     * 退出处理类
+     */
+    @Autowired
+    private LogoutSuccessScrmHandlerImpl logoutSuccessScrmHandler;
+
     /**
      * token认证过滤器
      */
@@ -89,6 +110,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
     @Override
     protected void configure(HttpSecurity httpSecurity) throws Exception
     {
+
         httpSecurity
                 // CSRF禁用,因为不使用session
                 .csrf().disable()
@@ -99,7 +121,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
                 // 过滤请求
                 .authorizeRequests()
                 // 对于登录login 注册register 验证码captchaImage 允许匿名访问
-                .antMatchers("/login", "/register", "/captchaImage").anonymous()
+                .antMatchers("/login", "/register", "/captchaImage","/store/login").anonymous()
                 .antMatchers(
                         HttpMethod.GET,
                         "/",
@@ -125,7 +147,15 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
                 .anyRequest().authenticated()
                 .and()
                 .headers().frameOptions().disable();
-        httpSecurity.logout().logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler);
+        httpSecurity.logout().logoutUrl("/logout").logoutSuccessHandler((request, response, authentication) -> {
+            boolean isNewStore = "1".equals(request.getHeader("isNewStore"));
+
+            if (isNewStore) {
+                logoutSuccessScrmHandler.onLogoutSuccess(request, response, authentication);
+            } else {
+                logoutSuccessHandler.onLogoutSuccess(request, response, authentication);
+            }
+        });
         // 添加JWT filter
         httpSecurity.addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class);
         // 添加CORS filter
@@ -146,8 +176,21 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
      * 身份认证接口
      */
     @Override
-    protected void configure(AuthenticationManagerBuilder auth) throws Exception
-    {
-        auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder());
+    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
+        auth.userDetailsService(username -> {
+            HttpServletRequest request = getCurrentRequest();
+            boolean isNewStore = request != null && "1".equals(request.getHeader("isNewStore"));
+
+            UserDetailsService service = isNewStore ? userDetailsScrmService : userDetailsService;
+            return service.loadUserByUsername(username);
+        }).passwordEncoder(bCryptPasswordEncoder());
+    }
+
+    private HttpServletRequest getCurrentRequest() {
+        try {
+            return ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest();
+        } catch (Exception e) {
+            return null;
+        }
     }
 }

+ 9 - 1
fs-store/src/main/java/com/fs/framework/security/filter/JwtAuthenticationTokenFilter.java

@@ -4,6 +4,8 @@ import com.fs.framework.service.TokenService;
 import com.fs.common.utils.SecurityUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.his.domain.StoreLoginUser;
+import com.fs.hisStore.domain.StoreLoginUserScrm;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
 import org.springframework.security.core.context.SecurityContextHolder;
@@ -19,7 +21,7 @@ import java.io.IOException;
 
 /**
  * token过滤器 验证token有效性
- * 
+ *
 
  */
 @Component
@@ -33,6 +35,7 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter
             throws ServletException, IOException
     {
         StoreLoginUser loginUser = tokenService.getLoginUser(request);
+        StoreLoginUserScrm loginUserScrm = tokenService.getLoginUserScrm(request);
         if (StringUtils.isNotNull(loginUser) && StringUtils.isNull(SecurityUtils.getAuthentication()))
         {
 
@@ -41,6 +44,11 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter
             authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
             SecurityContextHolder.getContext().setAuthentication(authenticationToken);
 
+        }else if(loginUserScrm != null && StringUtils.isNull(SecurityUtils.getAuthentication())){
+            tokenService.verifyTokenScrm(loginUserScrm);
+            UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginUserScrm, null, loginUserScrm.getAuthorities());
+            authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
+            SecurityContextHolder.getContext().setAuthentication(authenticationToken);
         }
         chain.doFilter(request, response);
     }

+ 51 - 0
fs-store/src/main/java/com/fs/framework/security/handle/LogoutSuccessScrmHandlerImpl.java

@@ -0,0 +1,51 @@
+package com.fs.framework.security.handle;
+
+import com.alibaba.fastjson.JSON;
+import com.fs.common.constant.HttpStatus;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.StringUtils;
+import com.fs.framework.service.TokenService;
+import com.fs.hisStore.domain.StoreLoginUserScrm;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * 自定义退出处理类 返回成功
+ *
+
+ */
+@Configuration
+public class LogoutSuccessScrmHandlerImpl implements LogoutSuccessHandler
+{
+    @Autowired
+    private TokenService tokenService;
+
+    /**
+     * 退出处理
+     *
+     * @return
+     */
+    @Override
+    public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication)
+            throws IOException, ServletException
+    {
+        StoreLoginUserScrm loginUser = tokenService.getLoginUserScrm(request);
+        if (StringUtils.isNotNull(loginUser))
+        {
+            String userName = loginUser.getUsername();
+            // 删除用户缓存记录
+            tokenService.delLoginUser(loginUser.getToken());
+            // 记录用户退出日志
+           // AsyncManager.me().execute(AsyncFactory.recordLogininfor(userName, Constants.LOGOUT, "退出成功"));
+        }
+        ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(HttpStatus.SUCCESS, "退出成功")));
+    }
+}

+ 122 - 0
fs-store/src/main/java/com/fs/framework/service/LoginServiceScrm.java

@@ -0,0 +1,122 @@
+package com.fs.framework.service;
+
+
+
+import com.fs.common.constant.Constants;
+import com.fs.common.core.redis.RedisCache;
+import com.fs.common.exception.ServiceException;
+import com.fs.common.exception.user.CaptchaException;
+import com.fs.common.exception.user.CaptchaExpireException;
+import com.fs.common.exception.user.UserPasswordNotMatchException;
+import com.fs.his.domain.StoreLoginUser;
+import com.fs.hisStore.domain.StoreLoginUserScrm;
+import com.fs.system.service.ISysConfigService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.authentication.AuthenticationManager;
+import org.springframework.security.authentication.BadCredentialsException;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.core.Authentication;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+
+/**
+ * 登录校验方法
+ *
+
+ */
+@Component
+public class LoginServiceScrm
+{
+    @Autowired
+    private TokenService tokenService;
+
+    @Resource
+    private AuthenticationManager authenticationManager;
+
+    @Autowired
+    private RedisCache redisCache;
+
+
+    @Autowired
+    private ISysConfigService configService;
+
+    /**
+     * 登录验证
+     *
+     * @param username 用户名
+     * @param password 密码
+     * @param code 验证码
+     * @param uuid 唯一标识
+     * @return 结果
+     */
+    public String login(String username, String password, String code, String uuid)
+    {
+        boolean captchaOnOff = configService.selectCaptchaOnOff();
+        // 验证码开关
+        if (captchaOnOff)
+        {
+            validateCaptcha(username, code, uuid);
+        }
+        // 用户验证
+        Authentication authentication = null;
+        try
+        {
+            // 该方法会去调用UserDetailsServiceImpl.loadUserByUsername
+            authentication = authenticationManager
+                    .authenticate(new UsernamePasswordAuthenticationToken(username, password));
+
+        }
+        catch (Exception e)
+        {
+            if (e instanceof BadCredentialsException)
+            {
+              //  AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
+                throw new UserPasswordNotMatchException();
+            }
+            else
+            {
+              //  AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage()));
+                throw new ServiceException(e.getMessage());
+            }
+        }
+//        AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
+        StoreLoginUserScrm loginUser = (StoreLoginUserScrm) authentication.getPrincipal();
+//        recordLoginInfo(loginUser);
+        // 生成token
+        return tokenService.createTokenScrm(loginUser);
+    }
+
+    /**
+     * 校验验证码
+     *
+     * @param username 用户名
+     * @param code 验证码
+     * @param uuid 唯一标识
+     * @return 结果
+     */
+    public void validateCaptcha(String username, String code, String uuid)
+    {
+        String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
+        String captcha = redisCache.getCacheObject(verifyKey);
+        redisCache.deleteObject(verifyKey);
+        if (captcha == null)
+        {
+           // AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
+            throw new CaptchaExpireException();
+        }
+        if (!code.equalsIgnoreCase(captcha))
+        {
+      //     AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
+            throw new CaptchaException();
+        }
+    }
+
+//    /**
+//     * 记录登录信息
+//     */
+//    public void recordLoginInfo(StoreLoginUserScrm user)
+//    {
+//        user.setIpaddr(IpUtils.getIpAddr(ServletUtils.getRequest()));
+//    }
+}

+ 105 - 0
fs-store/src/main/java/com/fs/framework/service/TokenService.java

@@ -8,10 +8,13 @@ import com.fs.common.utils.ip.IpUtils;
 import com.fs.common.utils.uuid.IdUtils;
 
 import com.fs.his.domain.StoreLoginUser;
+import com.fs.hisStore.domain.FsStoreScrm;
+import com.fs.hisStore.domain.StoreLoginUserScrm;
 import eu.bitwalker.useragentutils.UserAgent;
 import io.jsonwebtoken.Claims;
 import io.jsonwebtoken.Jwts;
 import io.jsonwebtoken.SignatureAlgorithm;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.data.redis.core.RedisTemplate;
@@ -230,4 +233,106 @@ public class TokenService
     {
         return Constants.LOGIN_TOKEN_KEY + uuid;
     }
+
+    /**
+     * 获取用户身份信息
+     *
+     * @return 用户信息
+     */
+    public StoreLoginUserScrm getLoginUserScrm(HttpServletRequest request)
+    {
+        // 获取请求携带的令牌
+        String token = getToken(request);
+        if (StringUtils.isNotEmpty(token))
+        {
+            try
+            {
+                Claims claims = parseToken(token);
+                // 解析对应的权限以及用户信息
+                String uuid = (String) claims.get(Constants.LOGIN_USER_KEY);
+                String userKey = getTokenKey(uuid);
+                StoreLoginUserScrm user = redisCache.getCacheObject(userKey);
+                return user;
+            }
+            catch (Exception e)
+            {
+            }
+        }
+        return null;
+    }
+
+    /**
+     * 设置用户身份信息
+     */
+    public void setLoginUserScrm(StoreLoginUserScrm loginUser)
+    {
+        if (StringUtils.isNotNull(loginUser) && StringUtils.isNotEmpty(loginUser.getToken()))
+        {
+            refreshTokenScrm(loginUser);
+        }
+    }
+
+    /**
+     * 创建令牌
+     *
+     * @param loginUser 用户信息
+     * @return 令牌
+     */
+    public String createTokenScrm(StoreLoginUserScrm loginUser)
+    {
+        String token = IdUtils.fastUUID();
+        loginUser.setToken(token);
+        setUserAgentScrm(loginUser);
+        refreshTokenScrm(loginUser);
+        Map<String, Object> claims = new HashMap<>();
+        claims.put(Constants.LOGIN_USER_KEY, token);
+        return createToken(claims);
+    }
+
+    /**
+     * 验证令牌有效期,相差不足20分钟,自动刷新缓存
+     *
+     * @param loginUser
+     * @return 令牌
+     */
+    public void verifyTokenScrm(StoreLoginUserScrm loginUser)
+    {
+        long expireTime = loginUser.getExpireTime();
+        long currentTime = System.currentTimeMillis();
+        if (expireTime - currentTime <= MILLIS_MINUTE_TEN)
+        {
+            refreshTokenScrm(loginUser);
+        }
+    }
+
+    /**
+     * 刷新令牌有效期
+     *
+     * @param loginUser 登录信息
+     */
+    public void refreshTokenScrm(StoreLoginUserScrm loginUser)
+    {
+        loginUser.setLoginTime(System.currentTimeMillis());
+        loginUser.setExpireTime(loginUser.getLoginTime() + expireTime * MILLIS_MINUTE);
+        // 根据uuid将loginUser缓存
+
+        String userKey = getTokenKey(loginUser.getToken());
+        redisCache.setCacheObject(userKey, loginUser, expireTime, TimeUnit.MINUTES);
+
+    }
+
+    /**
+     * 设置用户代理信息
+     *
+     * @param loginUser 登录信息
+     */
+    public void setUserAgentScrm(StoreLoginUserScrm loginUser)
+    {
+        UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent"));
+        String ip = IpUtils.getIpAddr(ServletUtils.getRequest());
+        loginUser.setIpaddr(ip);
+        loginUser.setLoginLocation(AddressUtils.getRealAddressByIP(ip));
+        loginUser.setBrowser(userAgent.getBrowser().getName());
+        loginUser.setOs(userAgent.getOperatingSystem().getName());
+    }
 }

+ 233 - 0
fs-store/src/main/java/com/fs/framework/service/TokenServiceScrm.java

@@ -0,0 +1,233 @@
+package com.fs.framework.service;
+
+import com.fs.common.constant.Constants;
+import com.fs.common.core.redis.RedisCache;
+import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.StringUtils;
+import com.fs.common.utils.ip.AddressUtils;
+import com.fs.common.utils.ip.IpUtils;
+import com.fs.common.utils.uuid.IdUtils;
+import com.fs.hisStore.domain.StoreLoginUserScrm;
+import eu.bitwalker.useragentutils.UserAgent;
+import io.jsonwebtoken.Claims;
+import io.jsonwebtoken.Jwts;
+import io.jsonwebtoken.SignatureAlgorithm;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * token验证处理
+ *
+
+ */
+@Component
+public class TokenServiceScrm
+
+
+{
+    @Autowired
+    public RedisTemplate redisTemplate;
+    // 令牌自定义标识
+    @Value("${token.header}")
+    private String header;
+
+    // 令牌秘钥
+    @Value("${token.secret}")
+    private String secret;
+
+    // 令牌有效期(默认30分钟)
+    @Value("${token.expireTime}")
+    private int expireTime;
+
+    protected static final long MILLIS_SECOND = 1000;
+
+    protected static final long MILLIS_MINUTE = 60 * MILLIS_SECOND;
+
+    private static final Long MILLIS_MINUTE_TEN = 20 * 60 * 1000L;
+
+    @Autowired
+    private RedisCache redisCache;
+
+    /**
+     * 获取用户身份信息
+     *
+     * @return 用户信息
+     */
+    public StoreLoginUserScrm getLoginUser(HttpServletRequest request)
+    {
+        // 获取请求携带的令牌
+        String token = getToken(request);
+        if (StringUtils.isNotEmpty(token))
+        {
+            try
+            {
+                Claims claims = parseToken(token);
+                // 解析对应的权限以及用户信息
+                String uuid = (String) claims.get(Constants.LOGIN_USER_KEY);
+                String userKey = getTokenKey(uuid);
+                StoreLoginUserScrm user = redisCache.getCacheObject(userKey);
+                return user;
+            }
+            catch (Exception e)
+            {
+            }
+        }
+        return null;
+    }
+
+    /**
+     * 设置用户身份信息
+     */
+    public void setLoginUser(StoreLoginUserScrm loginUser)
+    {
+        if (StringUtils.isNotNull(loginUser) && StringUtils.isNotEmpty(loginUser.getToken()))
+        {
+            refreshToken(loginUser);
+        }
+    }
+
+    /**
+     * 删除用户身份信息
+     */
+    public void delLoginUser(String token)
+    {
+        if (StringUtils.isNotEmpty(token))
+        {
+            String userKey = getTokenKey(token);
+            redisCache.deleteObject(userKey);
+        }
+    }
+
+    /**
+     * 创建令牌
+     *
+     * @param loginUser 用户信息
+     * @return 令牌
+     */
+    public String createToken(StoreLoginUserScrm loginUser)
+    {
+        String token = IdUtils.fastUUID();
+        loginUser.setToken(token);
+        setUserAgent(loginUser);
+        refreshToken(loginUser);
+        Map<String, Object> claims = new HashMap<>();
+        claims.put(Constants.LOGIN_USER_KEY, token);
+        return createToken(claims);
+    }
+
+    /**
+     * 验证令牌有效期,相差不足20分钟,自动刷新缓存
+     *
+     * @param loginUser
+     * @return 令牌
+     */
+    public void verifyToken(StoreLoginUserScrm loginUser)
+    {
+        long expireTime = loginUser.getExpireTime();
+        long currentTime = System.currentTimeMillis();
+        if (expireTime - currentTime <= MILLIS_MINUTE_TEN)
+        {
+            refreshToken(loginUser);
+        }
+    }
+
+    /**
+     * 刷新令牌有效期
+     *
+     * @param loginUser 登录信息
+     */
+    public void refreshToken(StoreLoginUserScrm loginUser)
+    {
+        loginUser.setLoginTime(System.currentTimeMillis());
+        loginUser.setExpireTime(loginUser.getLoginTime() + expireTime * MILLIS_MINUTE);
+        // 根据uuid将loginUser缓存
+
+        String userKey = getTokenKey(loginUser.getToken());
+        redisCache.setCacheObject(userKey, loginUser, expireTime, TimeUnit.MINUTES);
+
+
+    }
+
+    /**
+     * 设置用户代理信息
+     *
+     * @param loginUser 登录信息
+     */
+    public void setUserAgent(StoreLoginUserScrm loginUser)
+    {
+        UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent"));
+        String ip = IpUtils.getIpAddr(ServletUtils.getRequest());
+        loginUser.setIpaddr(ip);
+        loginUser.setLoginLocation(AddressUtils.getRealAddressByIP(ip));
+        loginUser.setBrowser(userAgent.getBrowser().getName());
+        loginUser.setOs(userAgent.getOperatingSystem().getName());
+    }
+
+    /**
+     * 从数据声明生成令牌
+     *
+     * @param claims 数据声明
+     * @return 令牌
+     */
+    private String createToken(Map<String, Object> claims)
+    {
+        String token = Jwts.builder()
+                .setClaims(claims)
+                .signWith(SignatureAlgorithm.HS512, secret).compact();
+        return token;
+    }
+
+    /**
+     * 从令牌中获取数据声明
+     *
+     * @param token 令牌
+     * @return 数据声明
+     */
+    private Claims parseToken(String token)
+    {
+        return Jwts.parser()
+                .setSigningKey(secret)
+                .parseClaimsJws(token)
+                .getBody();
+    }
+
+    /**
+     * 从令牌中获取用户名
+     *
+     * @param token 令牌
+     * @return 用户名
+     */
+    public String getUsernameFromToken(String token)
+    {
+        Claims claims = parseToken(token);
+        return claims.getSubject();
+    }
+
+    /**
+     * 获取请求token
+     *
+     * @param request
+     * @return token
+     */
+    private String getToken(HttpServletRequest request)
+    {
+        String token = request.getHeader(header);
+        if (StringUtils.isNotEmpty(token) && token.startsWith(Constants.TOKEN_PREFIX))
+        {
+            token = token.replace(Constants.TOKEN_PREFIX, "");
+        }
+        return token;
+    }
+
+    private String getTokenKey(String uuid)
+    {
+        return Constants.LOGIN_TOKEN_KEY + uuid;
+    }
+}

+ 61 - 0
fs-store/src/main/java/com/fs/framework/service/UserDetailsScrmServiceImpl.java

@@ -0,0 +1,61 @@
+package com.fs.framework.service;
+
+
+
+import com.fs.common.exception.ServiceException;
+import com.fs.common.utils.StringUtils;
+import com.fs.his.domain.FsStore;
+import com.fs.his.domain.StoreLoginUser;
+import com.fs.his.mapper.FsStoreMapper;
+import com.fs.hisStore.domain.FsStoreScrm;
+import com.fs.hisStore.domain.StoreLoginUserScrm;
+import com.fs.hisStore.mapper.FsStoreScrmMapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.core.userdetails.UserDetails;
+import org.springframework.security.core.userdetails.UserDetailsService;
+import org.springframework.security.core.userdetails.UsernameNotFoundException;
+import org.springframework.stereotype.Service;
+
+/**
+ * 用户验证处理
+ *
+
+ */
+@Service
+public class UserDetailsScrmServiceImpl implements UserDetailsService
+{
+    private static final Logger log = LoggerFactory.getLogger(UserDetailsScrmServiceImpl.class);
+
+
+    @Autowired
+    private FsStoreScrmMapper fsStoreMapper;
+
+
+    @Override
+    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException
+    {
+         FsStoreScrm user = fsStoreMapper.selectFsStoreByAccount(username);
+        if (StringUtils.isNull(user))
+        {
+            log.info("登录用户:{} 不存在.", username);
+            throw new ServiceException("登录用户:" + username + " 不存在");
+        }
+
+        else if (user.getStatus()==0)
+        {
+            log.info("登录用户:{} 已被停用.", username);
+            throw new ServiceException("对不起,您的店铺:" + username + " 已停用");
+        }
+
+        return createLoginUser(user);
+    }
+
+    public UserDetails createLoginUser(FsStoreScrm user)
+    {
+        StoreLoginUserScrm storeLoginUser = new StoreLoginUserScrm();
+        storeLoginUser.setFsStore(user);
+        return storeLoginUser;
+    }
+}

+ 85 - 0
fs-store/src/main/java/com/fs/hisStore/controller/store/DataScrmController.java

@@ -0,0 +1,85 @@
+package com.fs.hisStore.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.his.dto.DataDTO;
+import com.fs.his.vo.*;
+import com.fs.hisStore.service.IFsDataScrmService;
+import com.fs.hisStore.utils.UserUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/store/store/data")
+public class DataScrmController extends BaseController {
+    @Autowired
+    IFsDataScrmService iFsDataService;
+
+    @GetMapping("/orderData")
+    public AjaxResult list() {
+
+        StoreOrderDataVO list = iFsDataService.getStoreOrderData(UserUtil.getLoginUserStoreID());
+        return AjaxResult.success(list);
+    }
+
+    @GetMapping("/orderChartData")
+    public AjaxResult orderChartList() {
+        List<ChartDataVO> list = iFsDataService.getStoreOrderChartData(UserUtil.getLoginUserStoreID());
+        return AjaxResult.success(list);
+    }
+    @GetMapping("/storeChartData/{type}")
+    public AjaxResult storeChartData(@PathVariable("type")Integer type) {
+        List<DoctorChartVO> list = iFsDataService.storeChartData(type, UserUtil.getLoginUserStoreID());
+        return AjaxResult.success(list);
+    }
+
+
+    @GetMapping("/storeOrderChart")
+    public AjaxResult storeOrderChart( DataDTO dto) {
+        dto.setStoreId(UserUtil.getLoginUserStoreID());
+        List<ChartDataVO> list = iFsDataService.storeOrderChart(dto);
+        return AjaxResult.success(list);
+    }
+
+    @GetMapping("/storeOrderChartStore")
+    public AjaxResult storeOrderChartStore( DataDTO dto) {
+        dto.setStoreId(UserUtil.getLoginUserStoreID());
+        List<ChartDaVO> list = iFsDataService.storeOrderChartStore(dto);
+        return AjaxResult.success(list);
+    }
+
+    @GetMapping("/storeProd")
+    public AjaxResult storeProd( DataDTO dto) {
+        dto.setStoreId(UserUtil.getLoginUserStoreID());
+        List<ChartProdVO> list = iFsDataService.ChartProdVO(dto);
+        return AjaxResult.success(list);
+    }
+
+    @Log(title = "药品订单统计", businessType = BusinessType.EXPORT)
+    @GetMapping("/storeExport")
+    public AjaxResult storeExport( DataDTO dto)
+    {
+        dto.setStoreId(UserUtil.getLoginUserStoreID());
+        List<ChartDaVO> list = iFsDataService.storeOrderChartStore(dto);
+        ExcelUtil<ChartDaVO> util = new ExcelUtil<ChartDaVO>(ChartDaVO.class);
+        return util.exportExcel(list, "药品订单统计");
+    }
+
+    @Log(title = "药品销量订单统计", businessType = BusinessType.EXPORT)
+    @GetMapping("/storeProdExport")
+    public AjaxResult storeProdExport( DataDTO dto)
+    {
+        dto.setStoreId(UserUtil.getLoginUserStoreID());
+        List<ChartProdVO> list = iFsDataService.ChartProdVO(dto);
+        ExcelUtil<ChartProdVO> util = new ExcelUtil<ChartProdVO>(ChartProdVO.class);
+        return util.exportExcel(list, "药品订单统计");
+    }
+}

Some files were not shown because too many files changed in this diff