ソースを参照

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	fs-service/src/main/java/com/fs/crm/service/ICrmCustomerService.java
#	fs-service/src/main/java/com/fs/crm/service/impl/CrmCustomerServiceImpl.java
yfh 2 ヶ月 前
コミット
07a5e7fe62
100 ファイル変更8597 行追加61 行削除
  1. 9 0
      fs-admin/pom.xml
  2. 107 0
      fs-admin/src/main/java/com/fs/bean/AliPayBean.java
  3. 98 0
      fs-admin/src/main/java/com/fs/hisStore/FsMaterialGroupScrmController.java
  4. 90 0
      fs-admin/src/main/java/com/fs/hisStore/FsMaterialScrmController.java
  5. 97 0
      fs-admin/src/main/java/com/fs/hisStore/FsMenuScrmController.java
  6. 97 0
      fs-admin/src/main/java/com/fs/hisStore/FsPrescribeDrugScrmController.java
  7. 103 0
      fs-admin/src/main/java/com/fs/hisStore/FsPrescribeScrmController.java
  8. 97 0
      fs-admin/src/main/java/com/fs/hisStore/FsShippingTemplatesFreeScrmController.java
  9. 97 0
      fs-admin/src/main/java/com/fs/hisStore/FsShippingTemplatesRegionScrmController.java
  10. 106 0
      fs-admin/src/main/java/com/fs/hisStore/FsShippingTemplatesScrmController.java
  11. 107 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreActivityScrmController.java
  12. 97 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreAfterSalesItemScrmController.java
  13. 198 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreAfterSalesScrmController.java
  14. 97 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreAfterSalesStatusScrmController.java
  15. 52 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreCanvasScrmController.java
  16. 97 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreCartScrmController.java
  17. 98 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreCouponIssueScrmController.java
  18. 97 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreCouponIssueUserScrmController.java
  19. 146 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreCouponScrmController.java
  20. 102 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreCouponUserScrmController.java
  21. 176 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreHealthOrderScrmController.java
  22. 41 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreOrderAuditScrmController.java
  23. 97 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreOrderItemScrmController.java
  24. 97 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreOrderNoticeScrmController.java
  25. 97 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreOrderOfflineItemScrmController.java
  26. 159 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreOrderOfflineScrmController.java
  27. 162 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreOrderPromotionScrmController.java
  28. 644 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreOrderScrmController.java
  29. 54 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreOrderStatisticsScrmController.java
  30. 97 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreOrderStatusScrmController.java
  31. 298 0
      fs-admin/src/main/java/com/fs/hisStore/FsStorePaymentScrmController.java
  32. 97 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreProductAttrScrmController.java
  33. 99 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreProductAttrValueScrmController.java
  34. 105 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreProductCategoryScrmController.java
  35. 97 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreProductDetailsScrmController.java
  36. 133 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreProductGroupScrmController.java
  37. 200 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreProductPackageScrmController.java
  38. 58 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreProductRelationScrmController.java
  39. 110 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreProductReplyScrmController.java
  40. 119 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreProductRuleScrmController.java
  41. 189 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreProductScrmController.java
  42. 97 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreProductTemplateScrmController.java
  43. 97 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreShopScrmController.java
  44. 97 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreShopStaffScrmController.java
  45. 174 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreStatisticsScrmController.java
  46. 97 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreVisitScrmController.java
  47. 10 0
      fs-admin/src/main/resources/pay/alipay.properties
  48. 8 0
      fs-admin/src/main/resources/pay/alipay1.properties
  49. BIN
      fs-admin/src/main/resources/pay/cert/apiclient_cert.p12
  50. 26 0
      fs-admin/src/main/resources/pay/cert/apiclient_cert.pem
  51. 28 0
      fs-admin/src/main/resources/pay/cert/apiclient_key.pem
  52. 18 0
      fs-admin/src/main/resources/pay/cert/证书使用说明.txt
  53. 8 0
      fs-admin/src/main/resources/pay/wxpay.properties
  54. 9 0
      fs-admin/src/main/resources/pay/wxpay_v3.properties
  55. 14 0
      fs-common/src/main/java/com/fs/common/config/FSConfig.java
  56. 304 0
      fs-common/src/main/java/com/fs/common/config/FSSysConfig.java
  57. 35 0
      fs-common/src/main/java/com/fs/common/utils/http/HttpUtils.java
  58. 59 0
      fs-company/src/main/java/com/fs/hisStore/controller/FsCityScrmController.java
  59. 156 0
      fs-company/src/main/java/com/fs/hisStore/controller/FsStoreAfterSalesScrmController.java
  60. 43 0
      fs-company/src/main/java/com/fs/hisStore/controller/FsStoreOrderAuditScrmController.java
  61. 169 0
      fs-company/src/main/java/com/fs/hisStore/controller/FsStoreOrderOfflineScrmController.java
  62. 459 0
      fs-company/src/main/java/com/fs/hisStore/controller/FsStoreOrderScrmController.java
  63. 144 0
      fs-company/src/main/java/com/fs/hisStore/controller/FsStorePaymentScrmController.java
  64. 33 0
      fs-company/src/main/java/com/fs/hisStore/controller/FsStoreProductCategoryScrmController.java
  65. 169 0
      fs-company/src/main/java/com/fs/hisStore/controller/FsStoreProductPackageScrmController.java
  66. 71 0
      fs-company/src/main/java/com/fs/hisStore/controller/FsStoreProductScrmController.java
  67. 189 0
      fs-company/src/main/java/com/fs/hisStore/controller/FsStoreStatisticsScrmController.java
  68. 87 0
      fs-company/src/main/java/com/fs/hisStore/utils/CityTreeUtil.java
  69. 19 0
      fs-company/src/main/java/com/fs/hisStore/vo/CityVO.java
  70. 7 0
      fs-company/src/main/java/com/fs/hisStore/vo/FsStoreOrderOfflineVO.java
  71. 1 1
      fs-company/src/main/resources/application.yml
  72. 2 2
      fs-service/pom.xml
  73. 9 0
      fs-service/src/main/java/com/fs/api/param/ExpressParam.java
  74. 13 0
      fs-service/src/main/java/com/fs/api/param/OrderListParam.java
  75. 14 0
      fs-service/src/main/java/com/fs/api/vo/ExpressVO.java
  76. 23 0
      fs-service/src/main/java/com/fs/api/vo/OrderListVO.java
  77. 16 0
      fs-service/src/main/java/com/fs/api/vo/ProductListVO.java
  78. 28 0
      fs-service/src/main/java/com/fs/common/event/TemplateBean.java
  79. 22 0
      fs-service/src/main/java/com/fs/common/event/TemplateEvent.java
  80. 29 0
      fs-service/src/main/java/com/fs/common/event/TemplateListenEnum.java
  81. 229 0
      fs-service/src/main/java/com/fs/company/domain/Company.java
  82. 2 1
      fs-service/src/main/java/com/fs/company/domain/CompanyUser.java
  83. 17 0
      fs-service/src/main/java/com/fs/company/service/ICompanyService.java
  84. 2 1
      fs-service/src/main/java/com/fs/company/service/impl/CompanyRechargeOrderServiceImpl.java
  85. 129 0
      fs-service/src/main/java/com/fs/company/service/impl/CompanyServiceImpl.java
  86. 64 54
      fs-service/src/main/java/com/fs/core/config/WxMpConfiguration.java
  87. 57 1
      fs-service/src/main/java/com/fs/core/config/WxPayProperties.java
  88. 2 0
      fs-service/src/main/java/com/fs/course/config/RedPacketConfig.java
  89. 1 0
      fs-service/src/main/java/com/fs/course/domain/FsCourseRedPacketLog.java
  90. 8 0
      fs-service/src/main/java/com/fs/course/mapper/FsCourseRedPacketLogMapper.java
  91. 2 0
      fs-service/src/main/java/com/fs/course/service/IFsCourseRedPacketLogService.java
  92. 2 0
      fs-service/src/main/java/com/fs/course/service/IFsUserCourseVideoService.java
  93. 13 1
      fs-service/src/main/java/com/fs/course/service/impl/FsCourseRedPacketLogServiceImpl.java
  94. 21 0
      fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java
  95. 2 0
      fs-service/src/main/java/com/fs/crm/service/ICrmCustomerService.java
  96. 28 0
      fs-service/src/main/java/com/fs/crm/service/impl/CrmCustomerServiceImpl.java
  97. 3 0
      fs-service/src/main/java/com/fs/erp/domain/ErpRefundOrder.java
  98. 29 0
      fs-service/src/main/java/com/fs/erp/domain/KbStockRequest.java
  99. 48 0
      fs-service/src/main/java/com/fs/erp/domain/KbStockResponse.java
  100. 33 0
      fs-service/src/main/java/com/fs/erp/domain/KingbosOrderD1Data.java

+ 9 - 0
fs-admin/pom.xml

@@ -16,6 +16,15 @@
     </description>
 
     <dependencies>
+        <dependency>
+            <groupId>com.github.javen205</groupId>
+            <artifactId>IJPay-All</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.alipay.sdk</groupId>
+            <artifactId>alipay-sdk-java</artifactId>
+            <version>4.8.62.ALL</version>
+        </dependency>
 
         <!-- spring-boot-devtools -->
         <dependency>

+ 107 - 0
fs-admin/src/main/java/com/fs/bean/AliPayBean.java

@@ -0,0 +1,107 @@
+package com.fs.bean;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.stereotype.Component;
+
+@Component
+@PropertySource("classpath:/pay/alipay.properties")
+@ConfigurationProperties(prefix = "alipay")
+public class AliPayBean {
+    private String appId;
+    private String privateKey;
+    private String publicKey;
+    private String appCertPath;
+    private String aliPayCertPath;
+    private String aliPayRootCertPath;
+    private String serverUrl;
+    private String domain;
+    private String returnDomain;
+
+    public String getReturnDomain() {
+        return returnDomain;
+    }
+
+    public void setReturnDomain(String returnDomain) {
+        this.returnDomain = returnDomain;
+    }
+
+    public String getAppId() {
+        return appId;
+    }
+
+    public void setAppId(String appId) {
+        this.appId = appId;
+    }
+
+    public String getPrivateKey() {
+        return privateKey;
+    }
+
+    public void setPrivateKey(String privateKey) {
+        this.privateKey = privateKey;
+    }
+
+    public String getPublicKey() {
+        return publicKey;
+    }
+
+    public void setPublicKey(String publicKey) {
+        this.publicKey = publicKey;
+    }
+
+    public String getAppCertPath() {
+        return appCertPath;
+    }
+
+    public void setAppCertPath(String appCertPath) {
+        this.appCertPath = appCertPath;
+    }
+
+    public String getAliPayCertPath() {
+        return aliPayCertPath;
+    }
+
+    public void setAliPayCertPath(String aliPayCertPath) {
+        this.aliPayCertPath = aliPayCertPath;
+    }
+
+    public String getAliPayRootCertPath() {
+        return aliPayRootCertPath;
+    }
+
+    public void setAliPayRootCertPath(String aliPayRootCertPath) {
+        this.aliPayRootCertPath = aliPayRootCertPath;
+    }
+
+    public String getServerUrl() {
+        return serverUrl;
+    }
+
+    public void setServerUrl(String serverUrl) {
+        this.serverUrl = serverUrl;
+    }
+
+
+    public String getDomain() {
+        return domain;
+    }
+
+    public void setDomain(String domain) {
+        this.domain = domain;
+    }
+
+    @Override
+    public String toString() {
+        return "AliPayBean{" +
+                "appId='" + appId + '\'' +
+                ", privateKey='" + privateKey + '\'' +
+                ", publicKey='" + publicKey + '\'' +
+                ", appCertPath='" + appCertPath + '\'' +
+                ", aliPayCertPath='" + aliPayCertPath + '\'' +
+                ", aliPayRootCertPath='" + aliPayRootCertPath + '\'' +
+                ", serverUrl='" + serverUrl + '\'' +
+                ", domain='" + domain + '\'' +
+                '}';
+    }
+}

+ 98 - 0
fs-admin/src/main/java/com/fs/hisStore/FsMaterialGroupScrmController.java

@@ -0,0 +1,98 @@
+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.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.hisStore.domain.FsMaterialGroupScrm;
+import com.fs.hisStore.service.IFsMaterialGroupScrmService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 素材分组Controller
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/materialGroup")
+public class FsMaterialGroupScrmController extends BaseController
+{
+    @Autowired
+    private IFsMaterialGroupScrmService fsMaterialGroupService;
+
+    /**
+     * 查询素材分组列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(FsMaterialGroupScrm fsMaterialGroup)
+    {
+        startPage();
+        List<FsMaterialGroupScrm> list = fsMaterialGroupService.selectFsMaterialGroupList(fsMaterialGroup);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出素材分组列表
+     */
+    @Log(title = "素材分组", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsMaterialGroupScrm fsMaterialGroup)
+    {
+        List<FsMaterialGroupScrm> list = fsMaterialGroupService.selectFsMaterialGroupList(fsMaterialGroup);
+        ExcelUtil<FsMaterialGroupScrm> util = new ExcelUtil<FsMaterialGroupScrm>(FsMaterialGroupScrm.class);
+        return util.exportExcel(list, "materialGroup");
+    }
+
+    /**
+     * 获取素材分组详细信息
+     */
+    @GetMapping(value = "/{groupId}")
+    public AjaxResult getInfo(@PathVariable("groupId") Long groupId)
+    {
+        return AjaxResult.success(fsMaterialGroupService.selectFsMaterialGroupById(groupId));
+    }
+
+    /**
+     * 新增素材分组
+     */
+    @Log(title = "素材分组", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsMaterialGroupScrm fsMaterialGroup)
+    {
+        return toAjax(fsMaterialGroupService.insertFsMaterialGroup(fsMaterialGroup));
+    }
+
+    /**
+     * 修改素材分组
+     */
+    @Log(title = "素材分组", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsMaterialGroupScrm fsMaterialGroup)
+    {
+        return toAjax(fsMaterialGroupService.updateFsMaterialGroup(fsMaterialGroup));
+    }
+
+    /**
+     * 删除素材分组
+     */
+    @Log(title = "素材分组", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{groupIds}")
+    public AjaxResult remove(@PathVariable Long[] groupIds)
+    {
+        return toAjax(fsMaterialGroupService.deleteFsMaterialGroupByIds(groupIds));
+    }
+
+    @GetMapping("/getAllList")
+    public R getAllList(FsMaterialGroupScrm fsMaterialGroup)
+    {
+        List<FsMaterialGroupScrm> list = fsMaterialGroupService.selectFsMaterialGroupList(fsMaterialGroup);
+        return R.ok().put("data",list);
+    }
+}

+ 90 - 0
fs-admin/src/main/java/com/fs/hisStore/FsMaterialScrmController.java

@@ -0,0 +1,90 @@
+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.domain.FsMaterialScrm;
+import com.fs.hisStore.service.IFsMaterialScrmService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 素材库Controller
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/material")
+public class FsMaterialScrmController extends BaseController
+{
+    @Autowired
+    private IFsMaterialScrmService fsMaterialService;
+
+    /**
+     * 查询素材库列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(FsMaterialScrm fsMaterial)
+    {
+        startPage();
+        List<FsMaterialScrm> list = fsMaterialService.selectFsMaterialList(fsMaterial);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出素材库列表
+     */
+    @Log(title = "素材库", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsMaterialScrm fsMaterial)
+    {
+        List<FsMaterialScrm> list = fsMaterialService.selectFsMaterialList(fsMaterial);
+        ExcelUtil<FsMaterialScrm> util = new ExcelUtil<FsMaterialScrm>(FsMaterialScrm.class);
+        return util.exportExcel(list, "material");
+    }
+
+    /**
+     * 获取素材库详细信息
+     */
+    @GetMapping(value = "/{materialId}")
+    public AjaxResult getInfo(@PathVariable("materialId") Long materialId)
+    {
+        return AjaxResult.success(fsMaterialService.selectFsMaterialById(materialId));
+    }
+
+    /**
+     * 新增素材库
+     */
+    @Log(title = "素材库", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsMaterialScrm fsMaterial)
+    {
+        return toAjax(fsMaterialService.insertFsMaterial(fsMaterial));
+    }
+
+    /**
+     * 修改素材库
+     */
+    @Log(title = "素材库", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsMaterialScrm fsMaterial)
+    {
+        return toAjax(fsMaterialService.updateFsMaterial(fsMaterial));
+    }
+
+    /**
+     * 删除素材库
+     */
+    @Log(title = "素材库", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{materialIds}")
+    public AjaxResult remove(@PathVariable Long[] materialIds)
+    {
+        return toAjax(fsMaterialService.deleteFsMaterialByIds(materialIds));
+    }
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/hisStore/FsMenuScrmController.java

@@ -0,0 +1,97 @@
+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.domain.FsMenuScrm;
+import com.fs.hisStore.service.IFsMenuScrmService;
+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 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/menu")
+public class FsMenuScrmController extends BaseController
+{
+    @Autowired
+    private IFsMenuScrmService fsMenuService;
+
+    /**
+     * 查询用户端菜单管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:menu:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsMenuScrm fsMenu)
+    {
+        startPage();
+        List<FsMenuScrm> list = fsMenuService.selectFsMenuList(fsMenu);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出用户端菜单管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:menu:export')")
+    @Log(title = "用户端菜单管理", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsMenuScrm fsMenu)
+    {
+        List<FsMenuScrm> list = fsMenuService.selectFsMenuList(fsMenu);
+        ExcelUtil<FsMenuScrm> util = new ExcelUtil<FsMenuScrm>(FsMenuScrm.class);
+        return util.exportExcel(list, "menu");
+    }
+
+    /**
+     * 获取用户端菜单管理详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:menu:query')")
+    @GetMapping(value = "/{menuId}")
+    public AjaxResult getInfo(@PathVariable("menuId") Long menuId)
+    {
+        return AjaxResult.success(fsMenuService.selectFsMenuById(menuId));
+    }
+
+    /**
+     * 新增用户端菜单管理
+     */
+    @PreAuthorize("@ss.hasPermi('store:menu:add')")
+    @Log(title = "用户端菜单管理", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsMenuScrm fsMenu)
+    {
+        return toAjax(fsMenuService.insertFsMenu(fsMenu));
+    }
+
+    /**
+     * 修改用户端菜单管理
+     */
+    @PreAuthorize("@ss.hasPermi('store:menu:edit')")
+    @Log(title = "用户端菜单管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsMenuScrm fsMenu)
+    {
+        return toAjax(fsMenuService.updateFsMenu(fsMenu));
+    }
+
+    /**
+     * 删除用户端菜单管理
+     */
+    @PreAuthorize("@ss.hasPermi('store:menu:remove')")
+    @Log(title = "用户端菜单管理", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{menuIds}")
+    public AjaxResult remove(@PathVariable Long[] menuIds)
+    {
+        return toAjax(fsMenuService.deleteFsMenuByIds(menuIds));
+    }
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/hisStore/FsPrescribeDrugScrmController.java

@@ -0,0 +1,97 @@
+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.domain.FsPrescribeDrugScrm;
+import com.fs.hisStore.service.IFsPrescribeDrugScrmService;
+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 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/prescribeDrug")
+public class FsPrescribeDrugScrmController extends BaseController
+{
+    @Autowired
+    private IFsPrescribeDrugScrmService fsPrescribeDrugService;
+
+    /**
+     * 查询处方药品列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:prescribeDrug:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsPrescribeDrugScrm fsPrescribeDrug)
+    {
+        startPage();
+        List<FsPrescribeDrugScrm> list = fsPrescribeDrugService.selectFsPrescribeDrugList(fsPrescribeDrug);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出处方药品列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:prescribeDrug:export')")
+    @Log(title = "处方药品", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsPrescribeDrugScrm fsPrescribeDrug)
+    {
+        List<FsPrescribeDrugScrm> list = fsPrescribeDrugService.selectFsPrescribeDrugList(fsPrescribeDrug);
+        ExcelUtil<FsPrescribeDrugScrm> util = new ExcelUtil<FsPrescribeDrugScrm>(FsPrescribeDrugScrm.class);
+        return util.exportExcel(list, "prescribeDrug");
+    }
+
+    /**
+     * 获取处方药品详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:prescribeDrug:query')")
+    @GetMapping(value = "/{drugId}")
+    public AjaxResult getInfo(@PathVariable("drugId") Long drugId)
+    {
+        return AjaxResult.success(fsPrescribeDrugService.selectFsPrescribeDrugById(drugId));
+    }
+
+    /**
+     * 新增处方药品
+     */
+    @PreAuthorize("@ss.hasPermi('store:prescribeDrug:add')")
+    @Log(title = "处方药品", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsPrescribeDrugScrm fsPrescribeDrug)
+    {
+        return toAjax(fsPrescribeDrugService.insertFsPrescribeDrug(fsPrescribeDrug));
+    }
+
+    /**
+     * 修改处方药品
+     */
+    @PreAuthorize("@ss.hasPermi('store:prescribeDrug:edit')")
+    @Log(title = "处方药品", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsPrescribeDrugScrm fsPrescribeDrug)
+    {
+        return toAjax(fsPrescribeDrugService.updateFsPrescribeDrug(fsPrescribeDrug));
+    }
+
+    /**
+     * 删除处方药品
+     */
+    @PreAuthorize("@ss.hasPermi('store:prescribeDrug:remove')")
+    @Log(title = "处方药品", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{drugIds}")
+    public AjaxResult remove(@PathVariable Long[] drugIds)
+    {
+        return toAjax(fsPrescribeDrugService.deleteFsPrescribeDrugByIds(drugIds));
+    }
+}

+ 103 - 0
fs-admin/src/main/java/com/fs/hisStore/FsPrescribeScrmController.java

@@ -0,0 +1,103 @@
+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.FsPrescribeScrm;
+import com.fs.hisStore.param.FsPrescribeVOParam;
+import com.fs.hisStore.service.IFsPrescribeScrmService;
+import com.fs.hisStore.vo.FsPrescribeVO;
+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 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/prescribe")
+public class FsPrescribeScrmController extends BaseController
+{
+    @Autowired
+    private IFsPrescribeScrmService fsPrescribeService;
+
+    /**
+     * 查询处方列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:prescribe:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsPrescribeVOParam fsPrescribe)
+    {
+        startPage();
+        List<FsPrescribeVO> list = fsPrescribeService.selectFsPrescribeListVO(fsPrescribe);
+        for (FsPrescribeVO vo : list){
+            vo.setUserPhone(ParseUtils.parsePhone(vo.getUserPhone()));
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出处方列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:prescribe:export')")
+    @Log(title = "处方", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsPrescribeScrm fsPrescribe)
+    {
+        List<FsPrescribeScrm> list = fsPrescribeService.selectFsPrescribeList(fsPrescribe);
+        ExcelUtil<FsPrescribeScrm> util = new ExcelUtil<FsPrescribeScrm>(FsPrescribeScrm.class);
+        return util.exportExcel(list, "prescribe");
+    }
+
+    /**
+     * 获取处方详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:prescribe:query')")
+    @GetMapping(value = "/{prescribeId}")
+    public AjaxResult getInfo(@PathVariable("prescribeId") Long prescribeId)
+    {
+        return AjaxResult.success(fsPrescribeService.selectFsPrescribeById(prescribeId));
+    }
+
+    /**
+     * 新增处方
+     */
+    @PreAuthorize("@ss.hasPermi('store:prescribe:add')")
+    @Log(title = "处方", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsPrescribeScrm fsPrescribe)
+    {
+        return toAjax(fsPrescribeService.insertFsPrescribe(fsPrescribe));
+    }
+
+    /**
+     * 修改处方
+     */
+    @PreAuthorize("@ss.hasPermi('store:prescribe:edit')")
+    @Log(title = "处方", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsPrescribeScrm fsPrescribe)
+    {
+        return toAjax(fsPrescribeService.updateFsPrescribe(fsPrescribe));
+    }
+
+    /**
+     * 删除处方
+     */
+    @PreAuthorize("@ss.hasPermi('store:prescribe:remove')")
+    @Log(title = "处方", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{prescribeIds}")
+    public AjaxResult remove(@PathVariable Long[] prescribeIds)
+    {
+        return toAjax(fsPrescribeService.deleteFsPrescribeByIds(prescribeIds));
+    }
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/hisStore/FsShippingTemplatesFreeScrmController.java

@@ -0,0 +1,97 @@
+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.domain.FsShippingTemplatesFreeScrm;
+import com.fs.hisStore.service.IFsShippingTemplatesFreeScrmService;
+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 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/shippingTemplatesFree")
+public class FsShippingTemplatesFreeScrmController extends BaseController
+{
+    @Autowired
+    private IFsShippingTemplatesFreeScrmService fsShippingTemplatesFreeService;
+
+    /**
+     * 查询免邮费列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:shippingTemplatesFree:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsShippingTemplatesFreeScrm fsShippingTemplatesFree)
+    {
+        startPage();
+        List<FsShippingTemplatesFreeScrm> list = fsShippingTemplatesFreeService.selectFsShippingTemplatesFreeList(fsShippingTemplatesFree);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出免邮费列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:shippingTemplatesFree:export')")
+    @Log(title = "免邮费", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsShippingTemplatesFreeScrm fsShippingTemplatesFree)
+    {
+        List<FsShippingTemplatesFreeScrm> list = fsShippingTemplatesFreeService.selectFsShippingTemplatesFreeList(fsShippingTemplatesFree);
+        ExcelUtil<FsShippingTemplatesFreeScrm> util = new ExcelUtil<FsShippingTemplatesFreeScrm>(FsShippingTemplatesFreeScrm.class);
+        return util.exportExcel(list, "shippingTemplatesFree");
+    }
+
+    /**
+     * 获取免邮费详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:shippingTemplatesFree:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsShippingTemplatesFreeService.selectFsShippingTemplatesFreeById(id));
+    }
+
+    /**
+     * 新增免邮费
+     */
+    @PreAuthorize("@ss.hasPermi('store:shippingTemplatesFree:add')")
+    @Log(title = "免邮费", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsShippingTemplatesFreeScrm fsShippingTemplatesFree)
+    {
+        return toAjax(fsShippingTemplatesFreeService.insertFsShippingTemplatesFree(fsShippingTemplatesFree));
+    }
+
+    /**
+     * 修改免邮费
+     */
+    @PreAuthorize("@ss.hasPermi('store:shippingTemplatesFree:edit')")
+    @Log(title = "免邮费", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsShippingTemplatesFreeScrm fsShippingTemplatesFree)
+    {
+        return toAjax(fsShippingTemplatesFreeService.updateFsShippingTemplatesFree(fsShippingTemplatesFree));
+    }
+
+    /**
+     * 删除免邮费
+     */
+    @PreAuthorize("@ss.hasPermi('store:shippingTemplatesFree:remove')")
+    @Log(title = "免邮费", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsShippingTemplatesFreeService.deleteFsShippingTemplatesFreeByIds(ids));
+    }
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/hisStore/FsShippingTemplatesRegionScrmController.java

@@ -0,0 +1,97 @@
+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.domain.FsShippingTemplatesRegionScrm;
+import com.fs.hisStore.service.IFsShippingTemplatesRegionScrmService;
+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 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/shippingTemplatesRegion")
+public class FsShippingTemplatesRegionScrmController extends BaseController
+{
+    @Autowired
+    private IFsShippingTemplatesRegionScrmService fsShippingTemplatesRegionService;
+
+    /**
+     * 查询邮费区域列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:shippingTemplatesRegion:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsShippingTemplatesRegionScrm fsShippingTemplatesRegion)
+    {
+        startPage();
+        List<FsShippingTemplatesRegionScrm> list = fsShippingTemplatesRegionService.selectFsShippingTemplatesRegionList(fsShippingTemplatesRegion);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出邮费区域列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:shippingTemplatesRegion:export')")
+    @Log(title = "邮费区域", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsShippingTemplatesRegionScrm fsShippingTemplatesRegion)
+    {
+        List<FsShippingTemplatesRegionScrm> list = fsShippingTemplatesRegionService.selectFsShippingTemplatesRegionList(fsShippingTemplatesRegion);
+        ExcelUtil<FsShippingTemplatesRegionScrm> util = new ExcelUtil<FsShippingTemplatesRegionScrm>(FsShippingTemplatesRegionScrm.class);
+        return util.exportExcel(list, "shippingTemplatesRegion");
+    }
+
+    /**
+     * 获取邮费区域详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:shippingTemplatesRegion:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsShippingTemplatesRegionService.selectFsShippingTemplatesRegionById(id));
+    }
+
+    /**
+     * 新增邮费区域
+     */
+    @PreAuthorize("@ss.hasPermi('store:shippingTemplatesRegion:add')")
+    @Log(title = "邮费区域", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsShippingTemplatesRegionScrm fsShippingTemplatesRegion)
+    {
+        return toAjax(fsShippingTemplatesRegionService.insertFsShippingTemplatesRegion(fsShippingTemplatesRegion));
+    }
+
+    /**
+     * 修改邮费区域
+     */
+    @PreAuthorize("@ss.hasPermi('store:shippingTemplatesRegion:edit')")
+    @Log(title = "邮费区域", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsShippingTemplatesRegionScrm fsShippingTemplatesRegion)
+    {
+        return toAjax(fsShippingTemplatesRegionService.updateFsShippingTemplatesRegion(fsShippingTemplatesRegion));
+    }
+
+    /**
+     * 删除邮费区域
+     */
+    @PreAuthorize("@ss.hasPermi('store:shippingTemplatesRegion:remove')")
+    @Log(title = "邮费区域", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsShippingTemplatesRegionService.deleteFsShippingTemplatesRegionByIds(ids));
+    }
+}

+ 106 - 0
fs-admin/src/main/java/com/fs/hisStore/FsShippingTemplatesScrmController.java

@@ -0,0 +1,106 @@
+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.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.hisStore.domain.FsShippingTemplatesScrm;
+import com.fs.hisStore.param.FsShippingTemplatesAddEditParam;
+import com.fs.hisStore.service.IFsShippingTemplatesScrmService;
+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 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/shippingTemplates")
+public class FsShippingTemplatesScrmController extends BaseController
+{
+    @Autowired
+    private IFsShippingTemplatesScrmService fsShippingTemplatesService;
+
+    /**
+     * 查询运费模板列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:shippingTemplates:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsShippingTemplatesScrm fsShippingTemplates)
+    {
+        startPage();
+        fsShippingTemplates.setIsDel(0);
+        List<FsShippingTemplatesScrm> list = fsShippingTemplatesService.selectFsShippingTemplatesList(fsShippingTemplates);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出运费模板列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:shippingTemplates:export')")
+    @Log(title = "运费模板", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsShippingTemplatesScrm fsShippingTemplates)
+    {
+        List<FsShippingTemplatesScrm> list = fsShippingTemplatesService.selectFsShippingTemplatesList(fsShippingTemplates);
+        ExcelUtil<FsShippingTemplatesScrm> util = new ExcelUtil<FsShippingTemplatesScrm>(FsShippingTemplatesScrm.class);
+        return util.exportExcel(list, "shippingTemplates");
+    }
+
+    /**
+     * 获取运费模板详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:shippingTemplates:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsShippingTemplatesService.selectFsShippingTemplatesById(id));
+    }
+
+    /**
+     * 新增运费模板
+     */
+    @PreAuthorize("@ss.hasPermi('store:shippingTemplates:add')")
+    @Log(title = "运费模板", businessType = BusinessType.INSERT)
+    @PostMapping
+    public R add(@RequestBody FsShippingTemplatesAddEditParam param)
+    {
+        return fsShippingTemplatesService.addOrEdit(param);
+    }
+    /**
+     * 修改运费模板
+     */
+    @PreAuthorize("@ss.hasPermi('store:shippingTemplates:edit')")
+    @Log(title = "运费模板", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public R edit(@RequestBody FsShippingTemplatesAddEditParam param)
+    {
+        return fsShippingTemplatesService.addOrEdit(param);
+    }
+    /**
+     * 删除运费模板
+     */
+    @PreAuthorize("@ss.hasPermi('store:shippingTemplates:remove')")
+    @Log(title = "运费模板", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsShippingTemplatesService.deleteFsShippingTemplatesByIds(ids));
+    }
+
+    @GetMapping("/getAllList")
+    public R getAllList(FsShippingTemplatesScrm fsShippingTemplates)
+    {
+        fsShippingTemplates.setIsDel(0);
+        List<FsShippingTemplatesScrm> list = fsShippingTemplatesService.selectFsShippingTemplatesList(fsShippingTemplates);
+        return R.ok().put("data",list);
+    }
+}

+ 107 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreActivityScrmController.java

@@ -0,0 +1,107 @@
+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.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.hisStore.domain.FsStoreActivityScrm;
+import com.fs.hisStore.service.IFsStoreActivityScrmService;
+import com.fs.hisStore.service.IFsStoreProductScrmService;
+import com.fs.hisStore.vo.FsStoreProductActivityListVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 活动Controller
+ *
+ * @author fs
+ * @date 2022-11-18
+ */
+@RestController
+@RequestMapping("/store/store/storeActivity")
+public class FsStoreActivityScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreActivityScrmService fsStoreActivityService;
+    @Autowired
+    private IFsStoreProductScrmService productService;
+    /**
+     * 查询活动列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeActivity:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreActivityScrm fsStoreActivity)
+    {
+        startPage();
+        List<FsStoreActivityScrm> list = fsStoreActivityService.selectFsStoreActivityList(fsStoreActivity);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出活动列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeActivity:export')")
+    @Log(title = "活动", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreActivityScrm fsStoreActivity)
+    {
+        List<FsStoreActivityScrm> list = fsStoreActivityService.selectFsStoreActivityList(fsStoreActivity);
+        ExcelUtil<FsStoreActivityScrm> util = new ExcelUtil<FsStoreActivityScrm>(FsStoreActivityScrm.class);
+        return util.exportExcel(list, "storeActivity");
+    }
+
+    /**
+     * 获取活动详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeActivity:query')")
+    @GetMapping(value = "/{activityId}")
+    public R getInfo(@PathVariable("activityId") Long activityId)
+    {
+        FsStoreActivityScrm activity=fsStoreActivityService.selectFsStoreActivityById(activityId);
+        List<FsStoreProductActivityListVO> products =new ArrayList<>();
+        if(activity.getProductIds()!=null){
+            products=productService.selectFsStoreProductByIds(activity.getProductIds());
+        }
+        return R.ok().put("activity",activity).put("products",products);
+    }
+
+    /**
+     * 新增活动
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeActivity:add')")
+    @Log(title = "活动", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreActivityScrm fsStoreActivity)
+    {
+        return toAjax(fsStoreActivityService.insertFsStoreActivity(fsStoreActivity));
+    }
+
+    /**
+     * 修改活动
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeActivity:edit')")
+    @Log(title = "活动", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreActivityScrm fsStoreActivity)
+    {
+        return toAjax(fsStoreActivityService.updateFsStoreActivity(fsStoreActivity));
+    }
+
+    /**
+     * 删除活动
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeActivity:remove')")
+    @Log(title = "活动", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{activityIds}")
+    public AjaxResult remove(@PathVariable Long[] activityIds)
+    {
+        return toAjax(fsStoreActivityService.deleteFsStoreActivityByIds(activityIds));
+    }
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreAfterSalesItemScrmController.java

@@ -0,0 +1,97 @@
+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.domain.FsStoreAfterSalesItemScrm;
+import com.fs.hisStore.service.IFsStoreAfterSalesItemScrmService;
+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 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/storeAfterSalesItem")
+public class FsStoreAfterSalesItemScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreAfterSalesItemScrmService fsStoreAfterSalesItemService;
+
+    /**
+     * 查询售后子列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSalesItem:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreAfterSalesItemScrm fsStoreAfterSalesItem)
+    {
+        startPage();
+        List<FsStoreAfterSalesItemScrm> list = fsStoreAfterSalesItemService.selectFsStoreAfterSalesItemList(fsStoreAfterSalesItem);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出售后子列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSalesItem:export')")
+    @Log(title = "售后子", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreAfterSalesItemScrm fsStoreAfterSalesItem)
+    {
+        List<FsStoreAfterSalesItemScrm> list = fsStoreAfterSalesItemService.selectFsStoreAfterSalesItemList(fsStoreAfterSalesItem);
+        ExcelUtil<FsStoreAfterSalesItemScrm> util = new ExcelUtil<FsStoreAfterSalesItemScrm>(FsStoreAfterSalesItemScrm.class);
+        return util.exportExcel(list, "storeAfterSalesItem");
+    }
+
+    /**
+     * 获取售后子详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSalesItem:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsStoreAfterSalesItemService.selectFsStoreAfterSalesItemById(id));
+    }
+
+    /**
+     * 新增售后子
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSalesItem:add')")
+    @Log(title = "售后子", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreAfterSalesItemScrm fsStoreAfterSalesItem)
+    {
+        return toAjax(fsStoreAfterSalesItemService.insertFsStoreAfterSalesItem(fsStoreAfterSalesItem));
+    }
+
+    /**
+     * 修改售后子
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSalesItem:edit')")
+    @Log(title = "售后子", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreAfterSalesItemScrm fsStoreAfterSalesItem)
+    {
+        return toAjax(fsStoreAfterSalesItemService.updateFsStoreAfterSalesItem(fsStoreAfterSalesItem));
+    }
+
+    /**
+     * 删除售后子
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSalesItem:remove')")
+    @Log(title = "售后子", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsStoreAfterSalesItemService.deleteFsStoreAfterSalesItemByIds(ids));
+    }
+}

+ 198 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreAfterSalesScrmController.java

@@ -0,0 +1,198 @@
+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.domain.R;
+import com.fs.common.core.domain.model.LoginUser;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.ParseUtils;
+import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.framework.web.service.TokenService;
+import com.fs.his.domain.FsUser;
+import com.fs.his.service.IFsUserService;
+import com.fs.hisStore.domain.FsStoreAfterSalesItemScrm;
+import com.fs.hisStore.domain.FsStoreAfterSalesScrm;
+import com.fs.hisStore.domain.FsStoreAfterSalesStatusScrm;
+import com.fs.hisStore.domain.FsStoreOrderScrm;
+import com.fs.hisStore.param.FsStoreAfterSalesAudit1Param;
+import com.fs.hisStore.param.FsStoreAfterSalesAudit2Param;
+import com.fs.hisStore.param.FsStoreAfterSalesCancelParam;
+import com.fs.hisStore.param.FsStoreAfterSalesRefundParam;
+import com.fs.hisStore.service.IFsStoreAfterSalesItemScrmService;
+import com.fs.hisStore.service.IFsStoreAfterSalesScrmService;
+import com.fs.hisStore.service.IFsStoreAfterSalesStatusScrmService;
+import com.fs.hisStore.service.IFsStoreOrderScrmService;
+import com.fs.hisStore.vo.FsStoreAfterSalesVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.text.ParseException;
+import java.util.List;
+
+/**
+ * 售后记录Controller
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/storeAfterSales")
+public class FsStoreAfterSalesScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreOrderScrmService fsStoreOrderService;
+    @Autowired
+    private IFsUserService userService;
+    @Autowired
+    private IFsStoreAfterSalesScrmService fsStoreAfterSalesService;
+    @Autowired
+    private IFsStoreAfterSalesItemScrmService fsStoreAfterSalesItemService;
+    @Autowired
+    private IFsStoreAfterSalesStatusScrmService storeAfterSalesStatusService;
+
+    @Autowired
+    private TokenService tokenService;
+    /**
+     * 查询售后记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSales:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreAfterSalesScrm fsStoreAfterSales)
+    {
+        startPage();
+        List<FsStoreAfterSalesVO> list = fsStoreAfterSalesService.selectFsStoreAfterSalesListVO(fsStoreAfterSales);
+        for (FsStoreAfterSalesVO vo : list){
+            vo.setUserPhone(ParseUtils.parsePhone(vo.getUserPhone()));
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出售后记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSales:export')")
+    @Log(title = "售后记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreAfterSalesScrm fsStoreAfterSales)
+    {
+        if (fsStoreAfterSales.getBeginTime().equals("") && fsStoreAfterSales.getEndTime().equals("")){
+            fsStoreAfterSales.setBeginTime(null);
+            fsStoreAfterSales.setEndTime(null);
+        }
+        Boolean a = fsStoreAfterSalesService.isEntityNull(fsStoreAfterSales);
+        if (fsStoreAfterSalesService.isEntityNull(fsStoreAfterSales)){
+            return AjaxResult.error("请筛选数据导出");
+        }
+        List<FsStoreAfterSalesVO> list = fsStoreAfterSalesService.selectFsStoreAfterSalesListVO(fsStoreAfterSales);
+        for (FsStoreAfterSalesVO vo : list){
+            vo.setUserPhone(ParseUtils.parsePhone(vo.getUserPhone()));
+        }
+        ExcelUtil<FsStoreAfterSalesVO> util = new ExcelUtil<FsStoreAfterSalesVO>(FsStoreAfterSalesVO.class);
+        return util.exportExcel(list, "storeAfterSales");
+    }
+    /**
+     * 获取售后记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSales:query')")
+    @GetMapping(value = "/{id}")
+    public R getInfo(@PathVariable("id") Long id)
+    {
+        FsStoreAfterSalesScrm afterSales=fsStoreAfterSalesService.selectFsStoreAfterSalesById(id);
+        FsStoreAfterSalesItemScrm map=new FsStoreAfterSalesItemScrm();
+        map.setStoreAfterSalesId(id);
+        List<FsStoreAfterSalesItemScrm> items=fsStoreAfterSalesItemService.selectFsStoreAfterSalesItemList(map);
+        FsStoreAfterSalesStatusScrm statusMap=new FsStoreAfterSalesStatusScrm();
+        statusMap.setStoreAfterSalesId(id);
+        List<FsStoreAfterSalesStatusScrm> logs=storeAfterSalesStatusService.selectFsStoreAfterSalesStatusList(statusMap);
+        FsUser user=userService.selectFsUserById(afterSales.getUserId());
+        user.setPhone(ParseUtils.parsePhone(user.getPhone()));
+        FsStoreOrderScrm order=fsStoreOrderService.selectFsStoreOrderByOrderCode(afterSales.getOrderCode());
+        return R.ok().put("afterSales",afterSales).put("items",items).put("logs",logs).put("user",user).put("order",order);
+    }
+
+    /**
+     * 新增售后记录
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSales:add')")
+    @Log(title = "售后记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreAfterSalesScrm fsStoreAfterSales)
+    {
+        return toAjax(fsStoreAfterSalesService.insertFsStoreAfterSales(fsStoreAfterSales));
+    }
+
+    /**
+     * 修改售后记录
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSales:edit')")
+    @Log(title = "售后记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreAfterSalesScrm fsStoreAfterSales)
+    {
+        if ((!"".equals(fsStoreAfterSales.getDeliveryName()) && !"".equals(fsStoreAfterSales.getDeliverySn())) || (fsStoreAfterSales.getDeliveryName() == null && fsStoreAfterSales.getDeliverySn() == null)){
+            fsStoreAfterSales.setStatus(2);
+        }
+        return toAjax(fsStoreAfterSalesService.updateDelivery(fsStoreAfterSales));
+    }
+
+    /**
+     * 删除售后记录
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSales:remove')")
+    @Log(title = "售后记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsStoreAfterSalesService.deleteFsStoreAfterSalesByIds(ids));
+    }
+
+
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSales:audit1')")
+    @PostMapping("/audit1")
+    //平台审核
+    public R audit1(@RequestBody FsStoreAfterSalesAudit1Param param)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        param.setOperator(loginUser.getUser().getNickName());
+        return fsStoreAfterSalesService.audit1(param);
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSales:audit2')")
+    @PostMapping("/audit2")
+    //仓库审核
+    public R audit2(@RequestBody FsStoreAfterSalesAudit2Param param)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        param.setOperator(loginUser.getUser().getNickName());
+        return fsStoreAfterSalesService.audit2(param);
+    }
+    //财务审核
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSales:refund')")
+    @PostMapping("/refund")
+    public R refund(@RequestBody FsStoreAfterSalesRefundParam param)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        param.setOperator(loginUser.getUser().getNickName());
+        return fsStoreAfterSalesService.refundMoney(param);
+    }
+    //平台撤销
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSales:cancel')")
+    @PostMapping("/cancel")
+    public R cancel(@RequestBody FsStoreAfterSalesCancelParam param) throws ParseException {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        param.setOperator(loginUser.getUser().getNickName());
+        return fsStoreAfterSalesService.cancel(param);
+    }
+
+    @GetMapping("/getStoreAfterSales")
+    public R getStoreAfterSales(@RequestParam("orderCode") String orderCode)
+    {
+        List<FsStoreAfterSalesVO> vo = fsStoreAfterSalesService.selectFsStoreAfterSalesVOByOrderCode(orderCode);
+        return R.ok().put("data",vo);
+    }
+
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreAfterSalesStatusScrmController.java

@@ -0,0 +1,97 @@
+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.domain.FsStoreAfterSalesStatusScrm;
+import com.fs.hisStore.service.IFsStoreAfterSalesStatusScrmService;
+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 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/storeAfterSalesStatus")
+public class FsStoreAfterSalesStatusScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreAfterSalesStatusScrmService fsStoreAfterSalesStatusService;
+
+    /**
+     * 查询售后订单操作列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSalesStatus:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreAfterSalesStatusScrm fsStoreAfterSalesStatus)
+    {
+        startPage();
+        List<FsStoreAfterSalesStatusScrm> list = fsStoreAfterSalesStatusService.selectFsStoreAfterSalesStatusList(fsStoreAfterSalesStatus);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出售后订单操作列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSalesStatus:export')")
+    @Log(title = "售后订单操作", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreAfterSalesStatusScrm fsStoreAfterSalesStatus)
+    {
+        List<FsStoreAfterSalesStatusScrm> list = fsStoreAfterSalesStatusService.selectFsStoreAfterSalesStatusList(fsStoreAfterSalesStatus);
+        ExcelUtil<FsStoreAfterSalesStatusScrm> util = new ExcelUtil<FsStoreAfterSalesStatusScrm>(FsStoreAfterSalesStatusScrm.class);
+        return util.exportExcel(list, "storeAfterSalesStatus");
+    }
+
+    /**
+     * 获取售后订单操作详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSalesStatus:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsStoreAfterSalesStatusService.selectFsStoreAfterSalesStatusById(id));
+    }
+
+    /**
+     * 新增售后订单操作
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSalesStatus:add')")
+    @Log(title = "售后订单操作", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreAfterSalesStatusScrm fsStoreAfterSalesStatus)
+    {
+        return toAjax(fsStoreAfterSalesStatusService.insertFsStoreAfterSalesStatus(fsStoreAfterSalesStatus));
+    }
+
+    /**
+     * 修改售后订单操作
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSalesStatus:edit')")
+    @Log(title = "售后订单操作", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreAfterSalesStatusScrm fsStoreAfterSalesStatus)
+    {
+        return toAjax(fsStoreAfterSalesStatusService.updateFsStoreAfterSalesStatus(fsStoreAfterSalesStatus));
+    }
+
+    /**
+     * 删除售后订单操作
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSalesStatus:remove')")
+    @Log(title = "售后订单操作", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsStoreAfterSalesStatusService.deleteFsStoreAfterSalesStatusByIds(ids));
+    }
+}

+ 52 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreCanvasScrmController.java

@@ -0,0 +1,52 @@
+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.enums.BusinessType;
+import com.fs.hisStore.domain.FsStoreCanvasScrm;
+import com.fs.hisStore.service.IFsStoreCanvasScrmService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 画布信息Controller
+ *
+ * @author fs
+ * @date 2022-08-29
+ */
+@RestController
+@RequestMapping("/store/store/storeCanvas")
+public class FsStoreCanvasScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreCanvasScrmService fsStoreCanvasService;
+
+
+
+    /**
+     * 获取画布信息详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCanvas:query')")
+    @GetMapping(value = "/{terminal}")
+    public AjaxResult getInfo(@PathVariable("terminal") Integer terminal)
+    {
+
+        return AjaxResult.success(fsStoreCanvasService.selectFsStoreCanvasByTerminal(terminal));
+    }
+
+
+    /**
+     * 修改画布信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCanvas:edit')")
+    @Log(title = "画布信息", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreCanvasScrm fsStoreCanvas)
+    {
+        return toAjax(fsStoreCanvasService.updateFsStoreCanvas(fsStoreCanvas));
+    }
+
+
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreCartScrmController.java

@@ -0,0 +1,97 @@
+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.domain.FsStoreCartScrm;
+import com.fs.hisStore.service.IFsStoreCartScrmService;
+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 2022-03-21
+ */
+@RestController
+@RequestMapping("/store/store/storeCart")
+public class FsStoreCartScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreCartScrmService fsStoreCartService;
+
+    /**
+     * 查询购物车列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCart:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreCartScrm fsStoreCart)
+    {
+        startPage();
+        List<FsStoreCartScrm> list = fsStoreCartService.selectFsStoreCartList(fsStoreCart);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出购物车列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCart:export')")
+    @Log(title = "购物车", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreCartScrm fsStoreCart)
+    {
+        List<FsStoreCartScrm> list = fsStoreCartService.selectFsStoreCartList(fsStoreCart);
+        ExcelUtil<FsStoreCartScrm> util = new ExcelUtil<FsStoreCartScrm>(FsStoreCartScrm.class);
+        return util.exportExcel(list, "storeCart");
+    }
+
+    /**
+     * 获取购物车详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCart:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsStoreCartService.selectFsStoreCartById(id));
+    }
+
+    /**
+     * 新增购物车
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCart:add')")
+    @Log(title = "购物车", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreCartScrm fsStoreCart)
+    {
+        return toAjax(fsStoreCartService.insertFsStoreCart(fsStoreCart));
+    }
+
+    /**
+     * 修改购物车
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCart:edit')")
+    @Log(title = "购物车", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreCartScrm fsStoreCart)
+    {
+        return toAjax(fsStoreCartService.updateFsStoreCart(fsStoreCart));
+    }
+
+    /**
+     * 删除购物车
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCart:remove')")
+    @Log(title = "购物车", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsStoreCartService.deleteFsStoreCartByIds(ids));
+    }
+}

+ 98 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreCouponIssueScrmController.java

@@ -0,0 +1,98 @@
+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.domain.FsStoreCouponIssueScrm;
+import com.fs.hisStore.service.IFsStoreCouponIssueScrmService;
+import com.fs.hisStore.vo.FsStoreCouponIssueVO;
+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 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/storeCouponIssue")
+public class FsStoreCouponIssueScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreCouponIssueScrmService fsStoreCouponIssueService;
+
+    /**
+     * 查询优惠券领取列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCouponIssue:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreCouponIssueScrm fsStoreCouponIssue)
+    {
+        startPage();
+        List<FsStoreCouponIssueVO> list = fsStoreCouponIssueService.selectFsStoreCouponIssueListVO(fsStoreCouponIssue);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出优惠券领取列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCouponIssue:export')")
+    @Log(title = "优惠券领取", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreCouponIssueScrm fsStoreCouponIssue)
+    {
+        List<FsStoreCouponIssueScrm> list = fsStoreCouponIssueService.selectFsStoreCouponIssueList(fsStoreCouponIssue);
+        ExcelUtil<FsStoreCouponIssueScrm> util = new ExcelUtil<FsStoreCouponIssueScrm>(FsStoreCouponIssueScrm.class);
+        return util.exportExcel(list, "storeCouponIssue");
+    }
+
+    /**
+     * 获取优惠券领取详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCouponIssue:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsStoreCouponIssueService.selectFsStoreCouponIssueById(id));
+    }
+
+    /**
+     * 新增优惠券领取
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCouponIssue:add')")
+    @Log(title = "优惠券领取", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreCouponIssueScrm fsStoreCouponIssue)
+    {
+        return toAjax(fsStoreCouponIssueService.insertFsStoreCouponIssue(fsStoreCouponIssue));
+    }
+
+    /**
+     * 修改优惠券领取
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCouponIssue:edit')")
+    @Log(title = "优惠券领取", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreCouponIssueScrm fsStoreCouponIssue)
+    {
+        return toAjax(fsStoreCouponIssueService.updateFsStoreCouponIssue(fsStoreCouponIssue));
+    }
+
+    /**
+     * 删除优惠券领取
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCouponIssue:remove')")
+    @Log(title = "优惠券领取", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsStoreCouponIssueService.deleteFsStoreCouponIssueByIds(ids));
+    }
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreCouponIssueUserScrmController.java

@@ -0,0 +1,97 @@
+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.domain.FsStoreCouponIssueUserScrm;
+import com.fs.hisStore.service.IFsStoreCouponIssueUserScrmService;
+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 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/storeCouponIssueUser")
+public class FsStoreCouponIssueUserScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreCouponIssueUserScrmService fsStoreCouponIssueUserService;
+
+    /**
+     * 查询优惠券用户领取记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCouponIssueUser:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreCouponIssueUserScrm fsStoreCouponIssueUser)
+    {
+        startPage();
+        List<FsStoreCouponIssueUserScrm> list = fsStoreCouponIssueUserService.selectFsStoreCouponIssueUserList(fsStoreCouponIssueUser);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出优惠券用户领取记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCouponIssueUser:export')")
+    @Log(title = "优惠券用户领取记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreCouponIssueUserScrm fsStoreCouponIssueUser)
+    {
+        List<FsStoreCouponIssueUserScrm> list = fsStoreCouponIssueUserService.selectFsStoreCouponIssueUserList(fsStoreCouponIssueUser);
+        ExcelUtil<FsStoreCouponIssueUserScrm> util = new ExcelUtil<FsStoreCouponIssueUserScrm>(FsStoreCouponIssueUserScrm.class);
+        return util.exportExcel(list, "storeCouponIssueUser");
+    }
+
+    /**
+     * 获取优惠券用户领取记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCouponIssueUser:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsStoreCouponIssueUserService.selectFsStoreCouponIssueUserById(id));
+    }
+
+    /**
+     * 新增优惠券用户领取记录
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCouponIssueUser:add')")
+    @Log(title = "优惠券用户领取记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreCouponIssueUserScrm fsStoreCouponIssueUser)
+    {
+        return toAjax(fsStoreCouponIssueUserService.insertFsStoreCouponIssueUser(fsStoreCouponIssueUser));
+    }
+
+    /**
+     * 修改优惠券用户领取记录
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCouponIssueUser:edit')")
+    @Log(title = "优惠券用户领取记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreCouponIssueUserScrm fsStoreCouponIssueUser)
+    {
+        return toAjax(fsStoreCouponIssueUserService.updateFsStoreCouponIssueUser(fsStoreCouponIssueUser));
+    }
+
+    /**
+     * 删除优惠券用户领取记录
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCouponIssueUser:remove')")
+    @Log(title = "优惠券用户领取记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsStoreCouponIssueUserService.deleteFsStoreCouponIssueUserByIds(ids));
+    }
+}

+ 146 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreCouponScrmController.java

@@ -0,0 +1,146 @@
+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.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.hisStore.domain.FsStoreCouponScrm;
+import com.fs.hisStore.domain.FsStoreCouponIssueScrm;
+import com.fs.hisStore.param.FsStoreCouponPublishParam;
+import com.fs.hisStore.service.IFsStoreCouponIssueScrmService;
+import com.fs.hisStore.service.IFsStoreCouponScrmService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 优惠券Controller
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/storeCoupon")
+public class FsStoreCouponScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreCouponScrmService fsStoreCouponService;
+    @Autowired
+    private IFsStoreCouponIssueScrmService fsStoreCouponIssueService;
+    /**
+     * 查询优惠券列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCoupon:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreCouponScrm fsStoreCoupon)
+    {
+        startPage();
+        fsStoreCoupon.setIsDel(0);
+        List<FsStoreCouponScrm> list = fsStoreCouponService.selectFsStoreCouponList(fsStoreCoupon);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出优惠券列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCoupon:export')")
+    @Log(title = "优惠券", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreCouponScrm fsStoreCoupon)
+    {
+        List<FsStoreCouponScrm> list = fsStoreCouponService.selectFsStoreCouponList(fsStoreCoupon);
+        ExcelUtil<FsStoreCouponScrm> util = new ExcelUtil<FsStoreCouponScrm>(FsStoreCouponScrm.class);
+        return util.exportExcel(list, "storeCoupon");
+    }
+
+    /**
+     * 获取优惠券详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCoupon:query')")
+    @GetMapping(value = "/{couponId}")
+    public AjaxResult getInfo(@PathVariable("couponId") Long couponId)
+    {
+        return AjaxResult.success(fsStoreCouponService.selectFsStoreCouponById(couponId));
+    }
+
+    /**
+     * 新增优惠券
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCoupon:add')")
+    @Log(title = "优惠券", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreCouponScrm fsStoreCoupon)
+    {
+        return toAjax(fsStoreCouponService.insertFsStoreCoupon(fsStoreCoupon));
+    }
+
+    /**
+     * 修改优惠券
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCoupon:edit')")
+    @Log(title = "优惠券", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreCouponScrm fsStoreCoupon)
+    {
+        return toAjax(fsStoreCouponService.updateFsStoreCoupon(fsStoreCoupon));
+    }
+
+    /**
+     * 删除优惠券
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCoupon:remove')")
+    @Log(title = "优惠券", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{couponIds}")
+    public AjaxResult remove(@PathVariable Long[] couponIds)
+    {
+        return toAjax(fsStoreCouponService.deleteFsStoreCouponByIds(couponIds));
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeCoupon:publish')")
+    @PostMapping("/publish")
+    public AjaxResult publish(@RequestBody FsStoreCouponPublishParam publishParam)
+    {
+        FsStoreCouponScrm coupon=fsStoreCouponService.selectFsStoreCouponById(publishParam.getCouponId());
+        FsStoreCouponIssueScrm issue=new FsStoreCouponIssueScrm();
+        issue.setCouponId(publishParam.getCouponId());
+        issue.setCouponName(coupon.getTitle());
+        issue.setCouponType(coupon.getType());
+        issue.setStartTime(publishParam.getStartTime());
+        issue.setLimitTime(publishParam.getLimitTime());
+        issue.setTotalCount(publishParam.getTotalCount());
+        issue.setRemainCount(0);
+        issue.setIsPermanent(0);
+        issue.setStatus(1);
+        issue.setCreateTime(new Date());
+        return toAjax( fsStoreCouponIssueService.insertFsStoreCouponIssue(issue));
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeCoupon:batchPublish')")
+    @PostMapping("/batchPublish")
+    public R batchPublish(@RequestBody FsStoreCouponPublishParam publishParam)
+    {
+
+        List<FsStoreCouponScrm> list=fsStoreCouponService.selectFsStoreCouponByIds(publishParam.getIds());
+        for (FsStoreCouponScrm coupon :list ){
+            FsStoreCouponIssueScrm issue=new FsStoreCouponIssueScrm();
+            issue.setCouponId(coupon.getCouponId());
+            issue.setCouponName(coupon.getTitle());
+            issue.setCouponType(coupon.getType());
+            issue.setStartTime(publishParam.getStartTime());
+            issue.setLimitTime(publishParam.getLimitTime());
+            issue.setTotalCount(publishParam.getTotalCount());
+            issue.setRemainCount(0);
+            issue.setIsPermanent(0);
+            issue.setStatus(1);
+            issue.setCreateTime(new Date());
+            fsStoreCouponIssueService.insertFsStoreCouponIssue(issue);
+        }
+        return R.ok();
+    }
+}

+ 102 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreCouponUserScrmController.java

@@ -0,0 +1,102 @@
+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.FsStoreCouponUserScrm;
+import com.fs.hisStore.service.IFsStoreCouponUserScrmService;
+import com.fs.hisStore.vo.FsStoreCouponUserVO;
+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 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/storeCouponUser")
+public class FsStoreCouponUserScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreCouponUserScrmService fsStoreCouponUserService;
+
+    /**
+     * 查询优惠券发放记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCouponUser:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreCouponUserScrm fsStoreCouponUser)
+    {
+        startPage();
+        List<FsStoreCouponUserVO> list = fsStoreCouponUserService.selectFsStoreCouponUserListVO(fsStoreCouponUser);
+        for (FsStoreCouponUserVO  vo : list){
+            vo.setPhone(ParseUtils.parsePhone(vo.getPhone()));
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出优惠券发放记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCouponUser:export')")
+    @Log(title = "优惠券发放记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreCouponUserScrm fsStoreCouponUser)
+    {
+        List<FsStoreCouponUserVO> list = fsStoreCouponUserService.selectFsStoreCouponUserListVO(fsStoreCouponUser);
+        ExcelUtil<FsStoreCouponUserVO> util = new ExcelUtil<FsStoreCouponUserVO>(FsStoreCouponUserVO.class);
+        return util.exportExcel(list, "优惠券领取记录");
+    }
+
+    /**
+     * 获取优惠券发放记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCouponUser:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsStoreCouponUserService.selectFsStoreCouponUserById(id));
+    }
+
+    /**
+     * 新增优惠券发放记录
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCouponUser:add')")
+    @Log(title = "优惠券发放记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreCouponUserScrm fsStoreCouponUser)
+    {
+        return toAjax(fsStoreCouponUserService.insertFsStoreCouponUser(fsStoreCouponUser));
+    }
+
+    /**
+     * 修改优惠券发放记录
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCouponUser:edit')")
+    @Log(title = "优惠券发放记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreCouponUserScrm fsStoreCouponUser)
+    {
+        return toAjax(fsStoreCouponUserService.updateFsStoreCouponUser(fsStoreCouponUser));
+    }
+
+    /**
+     * 删除优惠券发放记录
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeCouponUser:remove')")
+    @Log(title = "优惠券发放记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsStoreCouponUserService.deleteFsStoreCouponUserByIds(ids));
+    }
+}

+ 176 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreHealthOrderScrmController.java

@@ -0,0 +1,176 @@
+package com.fs.hisStore;
+
+
+import cn.hutool.core.bean.BeanUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.StringUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.company.service.ICompanyMoneyLogsService;
+import com.fs.erp.service.IErpOrderService;
+import com.fs.his.service.IFsUserService;
+import com.fs.hisStore.dto.StoreOrderProductDTO;
+import com.fs.hisStore.param.FsStoreOrderParam;
+import com.fs.hisStore.service.*;
+import com.fs.hisStore.vo.FsStoreOrderExportVO;
+import com.fs.hisStore.vo.FsStoreOrderItemExportVO;
+import com.fs.hisStore.vo.FsStoreOrderVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/store/store/storeOrder")
+public class FsStoreHealthOrderScrmController extends BaseController {
+    @Autowired
+    private IFsExpressScrmService expressService;
+    @Autowired
+    private IFsStoreOrderScrmService fsStoreOrderService;
+    @Autowired
+    private IFsStoreOrderItemScrmService orderItemService;
+
+    @Autowired
+    private IFsUserService userService;
+
+    @Autowired
+    private IFsStoreOrderStatusScrmService orderStatusService;
+
+    @Autowired
+    IErpOrderService erpOrderService;
+    @Autowired
+    IFsStorePaymentScrmService paymentService;
+
+    @Autowired
+    private ICompanyMoneyLogsService moneyLogsService;
+
+    /**
+     * 查询健康商城订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:healthStoreOrder:list')")
+    @GetMapping("/healthList")
+    public TableDataInfo healthStoreList(FsStoreOrderParam param) {
+        startPage();
+        if(!StringUtils.isEmpty(param.getCreateTimeRange())){
+            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getPayTimeRange())){
+            param.setPayTimeList(param.getPayTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
+            param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliverySendTimeRange())){
+            param.setDeliverySendTimeList(param.getDeliverySendTimeRange().split("--"));
+        }
+        param.setIsHealth("1");
+        List<FsStoreOrderVO> list = fsStoreOrderService.selectFsStoreOrderListVO(param);
+        if (list != null) {
+            for (FsStoreOrderVO vo : list) {
+                if(vo.getPhone()!=null){
+                    vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                    vo.setUserPhone(vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+
+            }
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出健康商城列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:healthStoreOrder:export')")
+    @Log(title = "健康商城订单", businessType = BusinessType.EXPORT)
+    @GetMapping("/healthExport")
+    public AjaxResult export1(FsStoreOrderParam param) {
+        if (param.getBeginTime().equals("") && param.getEndTime().equals("")){
+            param.setBeginTime(null);
+            param.setEndTime(null);
+        }
+        if (fsStoreOrderService.isEntityNull(param)){
+            return AjaxResult.error("请筛选数据导出");
+        }
+        if(!StringUtils.isEmpty(param.getCreateTimeRange())){
+            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getPayTimeRange())){
+            param.setPayTimeList(param.getPayTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliverySendTimeRange())){
+            param.setDeliverySendTimeList(param.getDeliverySendTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
+            param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
+        }
+        param.setIsHealth("1");
+        List<FsStoreOrderExportVO> list = fsStoreOrderService.selectFsStoreOrderListVOByExport(param);
+        //对手机号脱敏
+        if (list != null) {
+            for (FsStoreOrderExportVO vo : list) {
+                if (vo.getPhone() != null) {
+                    vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+                if (vo.getUserPhone() != null) {
+                    vo.setUserPhone(vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+
+            }
+        }
+        ExcelUtil<FsStoreOrderExportVO> util = new ExcelUtil<FsStoreOrderExportVO>(FsStoreOrderExportVO.class);
+        return util.exportExcel(list, "订单数据");
+    }
+
+
+    @PreAuthorize("@ss.hasPermi('store:healthStoreOrder:exportItems')")
+    @Log(title = "健康商城订单明细导出", businessType = BusinessType.EXPORT)
+    @GetMapping("/healthExportItems")
+    public AjaxResult exportItems1(FsStoreOrderParam param) {
+        if (param.getBeginTime().equals("") && param.getEndTime().equals("")){
+            param.setBeginTime(null);
+            param.setEndTime(null);
+        }
+        if (fsStoreOrderService.isEntityNull(param)){
+            return AjaxResult.error("请筛选数据导出");
+        }
+        if(!StringUtils.isEmpty(param.getCreateTimeRange())){
+            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getPayTimeRange())){
+            param.setPayTimeList(param.getPayTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliverySendTimeRange())){
+            param.setDeliverySendTimeList(param.getDeliverySendTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
+            param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
+        }
+        param.setIsHealth("1");
+        List<FsStoreOrderItemExportVO> list = orderItemService.selectFsStoreOrderItemListExportVO(param);
+        //对手机号脱敏
+        if (list != null) {
+            for (FsStoreOrderItemExportVO vo : list) {
+                if (vo.getUserPhone() != null) {
+                    String phone = vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{1})", "$1****$2");
+                    vo.setUserPhone(phone);
+                }
+                if (!StringUtils.isEmpty(vo.getJsonInfo())) {
+                    try {
+                        StoreOrderProductDTO orderProductDTO = JSONObject.parseObject(vo.getJsonInfo(), StoreOrderProductDTO.class);
+                        BeanUtil.copyProperties(orderProductDTO, vo);
+                    } catch (Exception e) {
+                    }
+                }
+            }
+        }
+        ExcelUtil<FsStoreOrderItemExportVO> util = new ExcelUtil<FsStoreOrderItemExportVO>(FsStoreOrderItemExportVO.class);
+        return util.exportExcel(list, "订单明细数据");
+    }
+}

+ 41 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreOrderAuditScrmController.java

@@ -0,0 +1,41 @@
+package com.fs.hisStore;
+
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.entity.SysUser;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.utils.SecurityUtils;
+import com.fs.hisStore.param.FsStoreOrderAuditParam;
+import com.fs.hisStore.param.FsStoreOrderAuditReviewParam;
+import com.fs.hisStore.service.IFsStoreOrderAuditScrmService;
+import com.fs.hisStore.vo.FsStoreOrderAuditVO;
+import lombok.AllArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.List;
+
+@RestController
+@RequestMapping("/store/store/storeOrderAudit")
+@AllArgsConstructor
+public class FsStoreOrderAuditScrmController extends BaseController {
+
+    private final IFsStoreOrderAuditScrmService fsStoreOrderAuditService;
+
+    @PreAuthorize("@ss.hasAnyPermi('store:storeOrderAudit:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreOrderAuditParam param) {
+        startPage();
+        List<FsStoreOrderAuditVO> list = fsStoreOrderAuditService.selectStoreOrderAuditVOList(param);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasAnyPermi('store:storeOrderAudit:audit')")
+    @PostMapping("/audit")
+    public AjaxResult audit(@Valid @RequestBody FsStoreOrderAuditReviewParam param) {
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        fsStoreOrderAuditService.audit(param, user.getUserId(), true);
+        return AjaxResult.success();
+    }
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreOrderItemScrmController.java

@@ -0,0 +1,97 @@
+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.domain.FsStoreOrderItemScrm;
+import com.fs.hisStore.service.IFsStoreOrderItemScrmService;
+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 2022-03-21
+ */
+@RestController
+@RequestMapping("/store/store/storeOrderItem")
+public class FsStoreOrderItemScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreOrderItemScrmService fsStoreOrderItemService;
+
+    /**
+     * 查询订单详情列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderItem:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreOrderItemScrm fsStoreOrderItem)
+    {
+        startPage();
+        List<FsStoreOrderItemScrm> list = fsStoreOrderItemService.selectFsStoreOrderItemList(fsStoreOrderItem);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出订单详情列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderItem:export')")
+    @Log(title = "订单详情", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreOrderItemScrm fsStoreOrderItem)
+    {
+        List<FsStoreOrderItemScrm> list = fsStoreOrderItemService.selectFsStoreOrderItemList(fsStoreOrderItem);
+        ExcelUtil<FsStoreOrderItemScrm> util = new ExcelUtil<FsStoreOrderItemScrm>(FsStoreOrderItemScrm.class);
+        return util.exportExcel(list, "storeOrderItem");
+    }
+
+    /**
+     * 获取订单详情详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderItem:query')")
+    @GetMapping(value = "/{itemId}")
+    public AjaxResult getInfo(@PathVariable("itemId") Long itemId)
+    {
+        return AjaxResult.success(fsStoreOrderItemService.selectFsStoreOrderItemById(itemId));
+    }
+
+    /**
+     * 新增订单详情
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderItem:add')")
+    @Log(title = "订单详情", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreOrderItemScrm fsStoreOrderItem)
+    {
+        return toAjax(fsStoreOrderItemService.insertFsStoreOrderItem(fsStoreOrderItem));
+    }
+
+    /**
+     * 修改订单详情
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderItem:edit')")
+    @Log(title = "订单详情", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreOrderItemScrm fsStoreOrderItem)
+    {
+        return toAjax(fsStoreOrderItemService.updateFsStoreOrderItem(fsStoreOrderItem));
+    }
+
+    /**
+     * 删除订单详情
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderItem:remove')")
+    @Log(title = "订单详情", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{itemIds}")
+    public AjaxResult remove(@PathVariable Long[] itemIds)
+    {
+        return toAjax(fsStoreOrderItemService.deleteFsStoreOrderItemByIds(itemIds));
+    }
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreOrderNoticeScrmController.java

@@ -0,0 +1,97 @@
+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.domain.FsStoreOrderNoticeScrm;
+import com.fs.hisStore.service.IFsStoreOrderNoticeScrmService;
+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 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/storeOrderNotice")
+public class FsStoreOrderNoticeScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreOrderNoticeScrmService fsStoreOrderNoticeService;
+
+    /**
+     * 查询订单通知用户 接收订单通知的用户列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderNotice:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreOrderNoticeScrm fsStoreOrderNotice)
+    {
+        startPage();
+        List<FsStoreOrderNoticeScrm> list = fsStoreOrderNoticeService.selectFsStoreOrderNoticeList(fsStoreOrderNotice);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出订单通知用户 接收订单通知的用户列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderNotice:export')")
+    @Log(title = "订单通知用户 接收订单通知的用户", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreOrderNoticeScrm fsStoreOrderNotice)
+    {
+        List<FsStoreOrderNoticeScrm> list = fsStoreOrderNoticeService.selectFsStoreOrderNoticeList(fsStoreOrderNotice);
+        ExcelUtil<FsStoreOrderNoticeScrm> util = new ExcelUtil<FsStoreOrderNoticeScrm>(FsStoreOrderNoticeScrm.class);
+        return util.exportExcel(list, "storeOrderNotice");
+    }
+
+    /**
+     * 获取订单通知用户 接收订单通知的用户详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderNotice:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsStoreOrderNoticeService.selectFsStoreOrderNoticeById(id));
+    }
+
+    /**
+     * 新增订单通知用户 接收订单通知的用户
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderNotice:add')")
+    @Log(title = "订单通知用户 接收订单通知的用户", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreOrderNoticeScrm fsStoreOrderNotice)
+    {
+        return toAjax(fsStoreOrderNoticeService.insertFsStoreOrderNotice(fsStoreOrderNotice));
+    }
+
+    /**
+     * 修改订单通知用户 接收订单通知的用户
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderNotice:edit')")
+    @Log(title = "订单通知用户 接收订单通知的用户", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreOrderNoticeScrm fsStoreOrderNotice)
+    {
+        return toAjax(fsStoreOrderNoticeService.updateFsStoreOrderNotice(fsStoreOrderNotice));
+    }
+
+    /**
+     * 删除订单通知用户 接收订单通知的用户
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderNotice:remove')")
+    @Log(title = "订单通知用户 接收订单通知的用户", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsStoreOrderNoticeService.deleteFsStoreOrderNoticeByIds(ids));
+    }
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreOrderOfflineItemScrmController.java

@@ -0,0 +1,97 @@
+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.domain.FsStoreOrderOfflineItemScrm;
+import com.fs.hisStore.service.IFsStoreOrderOfflineItemScrmService;
+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 2024-10-29
+ */
+@RestController
+@RequestMapping("/store/storeOrderOfflineItem/store")
+public class FsStoreOrderOfflineItemScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreOrderOfflineItemScrmService fsStoreOrderOfflineItemService;
+
+    /**
+     * 查询线下订单详情列表
+     */
+    @PreAuthorize("@ss.hasPermi('storeOrderOfflineItem:store:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreOrderOfflineItemScrm fsStoreOrderOfflineItem)
+    {
+        startPage();
+        List<FsStoreOrderOfflineItemScrm> list = fsStoreOrderOfflineItemService.selectFsStoreOrderOfflineItemList(fsStoreOrderOfflineItem);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出线下订单详情列表
+     */
+    @PreAuthorize("@ss.hasPermi('storeOrderOfflineItem:store:export')")
+    @Log(title = "线下订单详情", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreOrderOfflineItemScrm fsStoreOrderOfflineItem)
+    {
+        List<FsStoreOrderOfflineItemScrm> list = fsStoreOrderOfflineItemService.selectFsStoreOrderOfflineItemList(fsStoreOrderOfflineItem);
+        ExcelUtil<FsStoreOrderOfflineItemScrm> util = new ExcelUtil<FsStoreOrderOfflineItemScrm>(FsStoreOrderOfflineItemScrm.class);
+        return util.exportExcel(list, "store");
+    }
+
+    /**
+     * 获取线下订单详情详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('storeOrderOfflineItem:store:query')")
+    @GetMapping(value = "/{itemId}")
+    public AjaxResult getInfo(@PathVariable("itemId") Long itemId)
+    {
+        return AjaxResult.success(fsStoreOrderOfflineItemService.selectFsStoreOrderOfflineItemById(itemId));
+    }
+
+    /**
+     * 新增线下订单详情
+     */
+    @PreAuthorize("@ss.hasPermi('storeOrderOfflineItem:store:add')")
+    @Log(title = "线下订单详情", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreOrderOfflineItemScrm fsStoreOrderOfflineItem)
+    {
+        return toAjax(fsStoreOrderOfflineItemService.insertFsStoreOrderOfflineItem(fsStoreOrderOfflineItem));
+    }
+
+    /**
+     * 修改线下订单详情
+     */
+    @PreAuthorize("@ss.hasPermi('storeOrderOfflineItem:store:edit')")
+    @Log(title = "线下订单详情", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreOrderOfflineItemScrm fsStoreOrderOfflineItem)
+    {
+        return toAjax(fsStoreOrderOfflineItemService.updateFsStoreOrderOfflineItem(fsStoreOrderOfflineItem));
+    }
+
+    /**
+     * 删除线下订单详情
+     */
+    @PreAuthorize("@ss.hasPermi('storeOrderOfflineItem:store:remove')")
+    @Log(title = "线下订单详情", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{itemIds}")
+    public AjaxResult remove(@PathVariable Long[] itemIds)
+    {
+        return toAjax(fsStoreOrderOfflineItemService.deleteFsStoreOrderOfflineItemByIds(itemIds));
+    }
+}

+ 159 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreOrderOfflineScrmController.java

@@ -0,0 +1,159 @@
+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.domain.R;
+import com.fs.common.core.domain.model.LoginUser;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.ParseUtils;
+import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.crm.domain.CrmCustomer;
+import com.fs.crm.service.ICrmCustomerService;
+import com.fs.framework.web.service.TokenService;
+import com.fs.hisStore.domain.FsStoreOrderOfflineScrm;
+import com.fs.hisStore.domain.FsStoreOrderOfflineItemScrm;
+import com.fs.hisStore.param.FsStoreOrderOfflineParam;
+import com.fs.hisStore.service.IFsStoreOrderOfflineItemScrmService;
+import com.fs.hisStore.service.IFsStoreOrderOfflineScrmService;
+import com.fs.hisStore.vo.FsStoreOrderOfflineListVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 线下订单Controller
+ *
+ * @author fs
+ * @date 2024-10-29
+ */
+@RestController
+@RequestMapping("/store/store/storeOrderOffline")
+public class FsStoreOrderOfflineScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreOrderOfflineScrmService fsStoreOrderOfflineService;
+    @Autowired
+    private IFsStoreOrderOfflineItemScrmService fsStoreOrderOfflineItemService;
+    @Autowired
+    private ICrmCustomerService crmCustomerService;
+    @Autowired
+    private TokenService tokenService;
+
+
+
+    /**
+     * 查询线下订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderOffline:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreOrderOfflineParam param)
+    {
+        startPage();
+        List<FsStoreOrderOfflineListVO> list = fsStoreOrderOfflineService.selectFsStoreOrderOfflineListVO(param);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出线下订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderOffline:export')")
+    @Log(title = "线下订单", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreOrderOfflineScrm fsStoreOrderOffline)
+    {
+        List<FsStoreOrderOfflineScrm> list = fsStoreOrderOfflineService.selectFsStoreOrderOfflineList(fsStoreOrderOffline);
+        ExcelUtil<FsStoreOrderOfflineScrm> util = new ExcelUtil<FsStoreOrderOfflineScrm>(FsStoreOrderOfflineScrm.class);
+        return util.exportExcel(list, "storeOrderOffline");
+    }
+
+    /**
+     * 获取线下订单详细信息
+     */
+    /**
+     * 获取线下订单详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderOffline:query')")
+    @GetMapping(value = "/{orderId}")
+    public R getInfo(@PathVariable("orderId") Long orderId)
+    {
+
+        FsStoreOrderOfflineListVO order=fsStoreOrderOfflineService.selectFsStoreOrderOfflineVOById(orderId);
+        order.setMobile(ParseUtils.parsePhone(order.getMobile()));
+        CrmCustomer customer=null;
+        if(order.getCrmId()!=null&&order.getCrmId()>0){
+            customer=crmCustomerService.selectCrmCustomerById(order.getCrmId());
+            customer.setMobile(ParseUtils.parsePhone(customer.getMobile()));
+        }
+        FsStoreOrderOfflineItemScrm itemMap=new FsStoreOrderOfflineItemScrm();
+        itemMap.setOrderId(order.getOrderId());
+        List<FsStoreOrderOfflineItemScrm> items=fsStoreOrderOfflineItemService.selectFsStoreOrderOfflineItemList(itemMap);
+        return R.ok().put("order", order).put("items", items).put("customer",customer) ;
+    }
+
+    @GetMapping(value = "/queryPhone/{orderId}")
+    @Log(title = "查看电话", businessType = BusinessType.GRANT)
+    @PreAuthorize("@ss.hasPermi('store:storeOrderOffline:queryPhone')")
+    public R getPhone(@PathVariable("orderId") Long orderId)
+    {
+        FsStoreOrderOfflineListVO order=fsStoreOrderOfflineService.selectFsStoreOrderOfflineVOById(orderId);
+        String userPhone = order.getMobile();
+        return R.ok().put("userPhone",userPhone);
+    }
+
+    /**
+     * 新增线下订单
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderOffline:add')")
+    @Log(title = "线下订单", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreOrderOfflineScrm fsStoreOrderOffline)
+    {
+        return toAjax(fsStoreOrderOfflineService.insertFsStoreOrderOffline(fsStoreOrderOffline));
+    }
+
+    /**
+     * 修改线下订单
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderOffline:edit')")
+    @Log(title = "线下订单", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreOrderOfflineScrm fsStoreOrderOffline)
+    {
+        return toAjax(fsStoreOrderOfflineService.updateFsStoreOrderOffline(fsStoreOrderOffline));
+    }
+
+    /**
+     * 删除线下订单
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderOffline:remove')")
+    @Log(title = "线下订单", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{orderIds}")
+    public AjaxResult remove(@PathVariable Long[] orderIds)
+    {
+        return toAjax(fsStoreOrderOfflineService.deleteFsStoreOrderOfflineByIds(orderIds));
+    }
+
+
+    @PreAuthorize("@ss.hasPermi('store:storeOrderOffline:audit')")
+    @Log(title = "审核订单", businessType = BusinessType.UPDATE)
+    @PostMapping("/auditOrder/{orderId}")
+    public R auditOrder(@PathVariable Long orderId)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        FsStoreOrderOfflineScrm fsStoreOrderOffline = new FsStoreOrderOfflineScrm();
+        fsStoreOrderOffline.setOrderId(orderId);
+        fsStoreOrderOffline.setStatus(3L);
+        fsStoreOrderOffline.setAuditBy(loginUser.getUser().getNickName());
+        fsStoreOrderOffline.setAuditTime(new Date());
+        if (fsStoreOrderOfflineService.updateFsStoreOrderOffline(fsStoreOrderOffline)>0){
+            return R.ok();
+        }
+        return R.error("审核失败");
+    }
+}

+ 162 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreOrderPromotionScrmController.java

@@ -0,0 +1,162 @@
+package com.fs.hisStore;
+
+
+import cn.hutool.core.bean.BeanUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.StringUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.company.service.ICompanyMoneyLogsService;
+import com.fs.erp.service.IErpOrderService;
+import com.fs.his.service.IFsExpressService;
+import com.fs.his.service.IFsUserService;
+import com.fs.hisStore.dto.StoreOrderProductDTO;
+import com.fs.hisStore.param.FsStoreOrderParam;
+import com.fs.hisStore.service.IFsStoreOrderItemScrmService;
+import com.fs.hisStore.service.IFsStoreOrderScrmService;
+import com.fs.hisStore.service.IFsStoreOrderStatusScrmService;
+import com.fs.hisStore.service.IFsStorePaymentScrmService;
+import com.fs.hisStore.vo.FsPromotionOrderVO;
+import com.fs.hisStore.vo.FsStoreOrderItemExportVO;
+import com.fs.hisStore.vo.FsStoreOrderPromotionExportVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/store/store/storeOrder")
+public class FsStoreOrderPromotionScrmController extends BaseController {
+    @Autowired
+    private IFsExpressService expressService;
+    @Autowired
+    private IFsStoreOrderScrmService fsStoreOrderService;
+    @Autowired
+    private IFsStoreOrderItemScrmService orderItemService;
+
+    @Autowired
+    private IFsUserService userService;
+
+    @Autowired
+    private IFsStoreOrderStatusScrmService orderStatusService;
+
+    @Autowired
+    IErpOrderService erpOrderService;
+    @Autowired
+    IFsStorePaymentScrmService paymentService;
+
+    @Autowired
+    private ICompanyMoneyLogsService moneyLogsService;
+
+    /**
+     * 查询推广订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:PromotionOrder:list')")
+    @GetMapping("/promotionList")
+    public TableDataInfo list(FsStoreOrderParam param) {
+        startPage();
+        if(!StringUtils.isEmpty(param.getCreateTimeRange())){
+            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getPayTimeRange())){
+            param.setPayTimeList(param.getPayTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
+            param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliverySendTimeRange())){
+            param.setDeliverySendTimeList(param.getDeliverySendTimeRange().split("--"));
+        }
+
+        List<FsPromotionOrderVO> list = fsStoreOrderService.selectFsPromotionOrderListVO(param);
+        if (list != null) {
+            for (FsPromotionOrderVO vo : list) {
+                if(vo.getPhone()!=null){
+                    vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                    vo.setUserPhone(vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+
+            }
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出推广订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:promotionOrder:export')")
+    @Log(title = "导出推广订单", businessType = BusinessType.EXPORT)
+    @GetMapping("/promotionExport")
+    public AjaxResult export(FsStoreOrderParam param) {
+        if (param == null){
+            return AjaxResult.error("请筛选数据导出");
+        }
+        if(!StringUtils.isEmpty(param.getCreateTimeRange())){
+            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getPayTimeRange())){
+            param.setPayTimeList(param.getPayTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
+            param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
+        }
+        List<FsStoreOrderPromotionExportVO> list = fsStoreOrderService.selectFsPromotionOrderListVOByExport(param);
+        //对手机号脱敏
+        if (list != null) {
+            for (FsStoreOrderPromotionExportVO vo : list) {
+                if (vo.getPhone() != null) {
+                    vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+                if (vo.getUserPhone() != null) {
+                    vo.setUserPhone(vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+
+            }
+        }
+        ExcelUtil<FsStoreOrderPromotionExportVO> util = new ExcelUtil<FsStoreOrderPromotionExportVO>(FsStoreOrderPromotionExportVO.class);
+        return util.exportExcel(list, "订单数据");
+    }
+
+
+    @PreAuthorize("@ss.hasPermi('store:promotionOrder:exportItems')")
+    @Log(title = "推广订单明细导出", businessType = BusinessType.EXPORT)
+    @GetMapping("/promotionExportItems")
+    public AjaxResult exportItems(FsStoreOrderParam param) {
+        if(!StringUtils.isEmpty(param.getCreateTimeRange())){
+            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getPayTimeRange())){
+            param.setPayTimeList(param.getPayTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
+            param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
+        }
+        param.setIsHealth("1");
+        List<FsStoreOrderItemExportVO> list = orderItemService.selectFsStoreOrderItemListExportVO(param);
+        //对手机号脱敏
+        if (list != null) {
+            for (FsStoreOrderItemExportVO vo : list) {
+                if (vo.getUserPhone() != null) {
+                    String phone = vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{1})", "$1****$2");
+                    vo.setUserPhone(phone);
+                }
+                if (!StringUtils.isEmpty(vo.getJsonInfo())) {
+                    try {
+                        StoreOrderProductDTO orderProductDTO = JSONObject.parseObject(vo.getJsonInfo(), StoreOrderProductDTO.class);
+                        BeanUtil.copyProperties(orderProductDTO, vo);
+                    } catch (Exception e) {
+                    }
+                }
+            }
+        }
+        ExcelUtil<FsStoreOrderItemExportVO> util = new ExcelUtil<FsStoreOrderItemExportVO>(FsStoreOrderItemExportVO.class);
+        return util.exportExcel(list, "订单明细数据");
+    }
+}

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

@@ -0,0 +1,644 @@
+package com.fs.hisStore;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.ParseUtils;
+import com.fs.common.utils.StringUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.company.param.CompanyStoreOrderMoneyLogsListParam;
+import com.fs.company.service.ICompanyMoneyLogsService;
+import com.fs.company.vo.CompanyStoreOrderMoneyLogsVO;
+import com.fs.erp.domain.ErpDeliverys;
+import com.fs.erp.domain.ErpOrderQuery;
+import com.fs.erp.dto.ErpOrderQueryRequert;
+import com.fs.erp.dto.ErpOrderQueryResponse;
+import com.fs.erp.service.IErpOrderService;
+import com.fs.his.domain.FsUser;
+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.FsStoreOrderItemScrm;
+import com.fs.hisStore.domain.FsStoreOrderScrm;
+import com.fs.hisStore.domain.FsStoreOrderStatusScrm;
+import com.fs.hisStore.domain.FsStorePaymentScrm;
+import com.fs.his.dto.ExpressInfoDTO;
+import com.fs.hisStore.dto.StoreOrderExpressExportDTO;
+import com.fs.hisStore.dto.StoreOrderProductDTO;
+import com.fs.hisStore.enums.ShipperCodeEnum;
+import com.fs.hisStore.param.*;
+import com.fs.hisStore.service.*;
+import com.fs.hisStore.vo.*;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * 订单Controller
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/storeOrder")
+public class FsStoreOrderScrmController extends BaseController {
+    @Autowired
+    private IFsExpressService expressService;
+    @Autowired
+    private IFsStoreOrderScrmService fsStoreOrderService;
+    @Autowired
+    private IFsStoreOrderItemScrmService orderItemService;
+
+    @Autowired
+    private IFsUserService userService;
+
+    @Autowired
+    private IFsStoreOrderStatusScrmService orderStatusService;
+
+    @Autowired
+    IFsStorePaymentScrmService paymentService;
+
+    @Autowired
+    private ICompanyMoneyLogsService moneyLogsService;
+    @Autowired
+    @Qualifier("erpOrderServiceImpl")
+    private IErpOrderService gyOrderService;
+
+    @Autowired
+    @Qualifier("wdtErpOrderServiceImpl")
+    private IErpOrderService wdtOrderService;
+
+    @Autowired
+    @Qualifier("k9OrderScrmServiceImpl")
+    private IErpOrderService k9OrderService;
+    @Autowired
+    private ConfigUtil configUtil;
+    @Autowired
+    private IFsStoreOrderAuditLogScrmService orderAuditLogService;
+
+    private IErpOrderService getErpService(){
+        //判断是否开启erp
+        IErpOrderService erpOrderService = null;
+        FsErpConfig erpConfig = configUtil.getErpConfig();
+        Integer erpOpen = erpConfig.getErpOpen();
+        if (erpOpen != null && erpOpen == 1) {
+            //判断erp类型
+            Integer erpType = erpConfig.getErpType();
+            if (erpType != null) {
+                if (erpType == 1) {
+                    //管易
+                    erpOrderService = gyOrderService;
+                } else if (erpType == 2) {
+                    //旺店通
+                    erpOrderService = wdtOrderService;
+                } else if (erpType == 3) {
+                    //旺店通
+                    erpOrderService = k9OrderService;
+                }
+            }
+        }
+        return erpOrderService;
+    }
+
+    /**
+     * 查询订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreOrderParam param) {
+        startPage();
+        if(!StringUtils.isEmpty(param.getCreateTimeRange())){
+            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getPayTimeRange())){
+            param.setPayTimeList(param.getPayTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
+            param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliverySendTimeRange())){
+            param.setDeliverySendTimeList(param.getDeliverySendTimeRange().split("--"));
+        }
+        param.setNotHealth(1);
+        List<FsStoreOrderVO> list = fsStoreOrderService.selectFsStoreOrderListVO(param);
+        if (list != null) {
+            for (FsStoreOrderVO vo : list) {
+                if(vo.getPhone()!=null){
+                    vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                    vo.setUserPhone(vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+            }
+        }
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:payRemainList')")
+    @GetMapping("/payRemainList")
+    public TableDataInfo payRemainList(FsStoreOrderParam param) {
+        startPage();
+        if(!StringUtils.isEmpty(param.getCreateTimeRange())){
+            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getPayTimeRange())){
+            param.setPayTimeList(param.getPayTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
+            param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
+        }
+        List<FsStoreOrderVO> list = fsStoreOrderService.selectPayRemainListVO(param);
+        if (list != null) {
+            for (FsStoreOrderVO vo : list) {
+                if(vo.getPhone()!=null){
+                    vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                    vo.setUserPhone(vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+
+            }
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出付尾款订单列表
+     */
+    @Log(title = "付尾款订单", businessType = BusinessType.EXPORT)
+    @GetMapping("/payRemainExport")
+    public AjaxResult payRemainExport(FsStoreOrderParam param) {
+        if(!StringUtils.isEmpty(param.getCreateTimeRange())){
+            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getPayTimeRange())){
+            param.setPayTimeList(param.getPayTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
+            param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
+        }
+        List<FsStorePayRemainOrderExportVO> list = fsStoreOrderService.selectFsStorePayRemainOrderListVOByExport(param);
+        //对手机号脱敏
+        if (list != null) {
+            for (FsStorePayRemainOrderExportVO vo : list) {
+                if (vo.getPhone() != null) {
+                    vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+                if (vo.getUserPhone() != null) {
+                    vo.setUserPhone(vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+                if (vo.getUserAddress()!=null){
+                    vo.setUserAddress(ParseUtils.parseAddress(vo.getUserAddress()));
+                }
+
+            }
+        }
+        ExcelUtil<FsStorePayRemainOrderExportVO> util = new ExcelUtil<FsStorePayRemainOrderExportVO>(FsStorePayRemainOrderExportVO.class);
+        return util.exportExcel(list, "付尾款订单数据");
+    }
+
+    /**
+     * 导出订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:export')")
+    @Log(title = "订单", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreOrderParam param) {
+        if (param.getBeginTime().equals("") && param.getEndTime().equals("")){
+            param.setBeginTime(null);
+            param.setEndTime(null);
+        }
+        if (fsStoreOrderService.isEntityNull(param)){
+            return AjaxResult.error("请筛选数据导出");
+        }
+        if(!StringUtils.isEmpty(param.getCreateTimeRange())){
+            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getPayTimeRange())){
+            param.setPayTimeList(param.getPayTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliverySendTimeRange())){
+            param.setDeliverySendTimeList(param.getDeliverySendTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
+            param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
+        }
+        param.setNotHealth(1);
+        List<FsStoreOrderExportVO> list = fsStoreOrderService.selectFsStoreOrderListVOByExport(param);
+        //对手机号脱敏
+        if (list != null) {
+            for (FsStoreOrderExportVO vo : list) {
+                if (vo.getPhone() != null) {
+                    vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+                if (vo.getUserPhone() != null) {
+                    vo.setUserPhone(vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+                if (vo.getUserAddress()!=null){
+                    vo.setUserAddress(ParseUtils.parseAddress(vo.getUserAddress()));
+                }
+            }
+        }
+        ExcelUtil<FsStoreOrderExportVO> util = new ExcelUtil<FsStoreOrderExportVO>(FsStoreOrderExportVO.class);
+        return util.exportExcel(list, "订单数据");
+    }
+
+
+
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:exportItems')")
+    @Log(title = "订单明细导出", businessType = BusinessType.EXPORT)
+    @GetMapping("/exportItems")
+    public AjaxResult exportItems(FsStoreOrderParam param) {
+        if (param.getBeginTime().equals("") && param.getEndTime().equals("")){
+            param.setBeginTime(null);
+            param.setEndTime(null);
+        }
+        if (fsStoreOrderService.isEntityNull(param)){
+            return AjaxResult.error("请筛选数据导出");
+        }
+        if(!StringUtils.isEmpty(param.getCreateTimeRange())){
+            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getPayTimeRange())){
+            param.setPayTimeList(param.getPayTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
+            param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliverySendTimeRange())){
+            param.setDeliverySendTimeList(param.getDeliverySendTimeRange().split("--"));
+        }
+        param.setNotHealth(1);
+        List<FsStoreOrderItemExportVO> list = orderItemService.selectFsStoreOrderItemListExportVO(param);
+        //对手机号脱敏
+        if (list != null) {
+            for (FsStoreOrderItemExportVO vo : list) {
+                if (vo.getUserPhone() != null) {
+                    String phone = vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{1})", "$1****$2");
+                    vo.setUserPhone(phone);
+                }
+                if (vo.getUserAddress()!=null){
+                    vo.setUserAddress(ParseUtils.parseAddress(vo.getUserAddress()));
+                }
+                if (!StringUtils.isEmpty(vo.getJsonInfo())) {
+                    try {
+                        StoreOrderProductDTO orderProductDTO = JSONObject.parseObject(vo.getJsonInfo(), StoreOrderProductDTO.class);
+                        BeanUtil.copyProperties(orderProductDTO, vo);
+                    } catch (Exception e) {
+                    }
+                }
+            }
+        }
+        ExcelUtil<FsStoreOrderItemExportVO> util = new ExcelUtil<FsStoreOrderItemExportVO>(FsStoreOrderItemExportVO.class);
+        return util.exportExcel(list, "订单明细数据");
+    }
+
+
+    @GetMapping("/orderItemsNum")
+    public R orderItemsNum(FsStoreOrderParam param) {
+
+        if(!StringUtils.isEmpty(param.getCreateTimeRange())){
+            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getPayTimeRange())){
+            param.setPayTimeList(param.getPayTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
+            param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliverySendTimeRange())){
+            param.setDeliverySendTimeList(param.getDeliverySendTimeRange().split("--"));
+        }
+        param.setNotHealth(1);
+        Long orderItemsNum = orderItemService.countFsStoreOrderItemListExportVO(param);
+        return R.ok().put("orderItemsNum","订单明细数目:"+orderItemsNum);
+    }
+
+    /**
+     * 获取订单详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:query')")
+    @GetMapping(value = "/{id}")
+    public R getInfo(@PathVariable("id") Long id) {
+        FsStoreOrderScrm order = fsStoreOrderService.selectFsStoreOrderById(id);
+        order.setUserPhone(ParseUtils.parsePhone(order.getUserPhone()));
+        order.setUserAddress(ParseUtils.parseAddress(order.getUserAddress()));
+        FsUser user = userService.selectFsUserById(order.getUserId());
+        if (user != null) {
+            user.setPhone(ParseUtils.parsePhone(user.getPhone()));
+        }
+        FsStoreOrderItemScrm itemMap = new FsStoreOrderItemScrm();
+        itemMap.setOrderId(order.getId());
+        List<FsStoreOrderItemScrm> items = orderItemService.selectFsStoreOrderItemList(itemMap);
+        FsStoreOrderStatusScrm statusMap = new FsStoreOrderStatusScrm();
+        statusMap.setOrderId(order.getId());
+        List<FsStoreOrderStatusScrm> logs = orderStatusService.selectFsStoreOrderStatusList(statusMap);
+        List<FsStorePaymentScrm> payments=paymentService.selectFsStorePaymentByOrderId(order.getId());
+        List<CompanyStoreOrderMoneyLogsVO> tuiMoneyLogs=new ArrayList<>();
+        if(order.getCompanyId()!=null){
+            CompanyStoreOrderMoneyLogsListParam moneyLogsMap=new CompanyStoreOrderMoneyLogsListParam();
+            moneyLogsMap.setCompanyId(order.getCompanyId());
+            moneyLogsMap.setBusinessId(order.getId().toString());
+            tuiMoneyLogs=moneyLogsService.selectCompanyStoreOrderMoneyLogsList(moneyLogsMap);
+        }
+
+        List<FsStoreOrderAuditLogVO> auditLogs = orderAuditLogService.selectStoreOrderAuditLogVOByOrderId(order.getId());
+        return R.ok().put("order", order).put("items", items).put("logs", logs).put("user", user).put("payments",payments).put("tuiMoneyLogs",tuiMoneyLogs)
+                .put("auditLogs",auditLogs);
+    }
+
+    @GetMapping(value = "/queryAddress/{id}")
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:queryAddress')")
+    public R getAddress(@PathVariable("id") Long id)
+    {
+        FsStoreOrderScrm order = fsStoreOrderService.selectFsStoreOrderById(id);
+        String address = order.getUserAddress();
+        return R.ok().put("address",address);
+    }
+
+    @GetMapping(value = "/queryPhone/{id}")
+    @Log(title = "查看电话", businessType = BusinessType.GRANT)
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:queryPhone')")
+    public R getPhone(@PathVariable("id") Long id)
+    {
+        FsStoreOrderScrm order = fsStoreOrderService.selectFsStoreOrderById(id);
+        String userPhone = order.getUserPhone();
+        return R.ok().put("userPhone",userPhone);
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:express')")
+    @GetMapping(value = "/getExpress/{id}")
+    public R getExpress(@PathVariable("id") Long id) {
+        FsStoreOrderScrm order = fsStoreOrderService.selectFsStoreOrderById(id);
+        ExpressInfoDTO expressInfoDTO = null;
+        if (StringUtils.isNotEmpty(order.getDeliveryId())) {
+            String lastFourNumber = "";
+            if (order.getDeliverySn().equals(ShipperCodeEnum.SF.getValue())) {
+                lastFourNumber = order.getUserPhone();
+                if (lastFourNumber.length() == 11) {
+                    lastFourNumber = StrUtil.sub(lastFourNumber, lastFourNumber.length(), -4);
+                }
+            }
+            expressInfoDTO = expressService.getExpressInfo(order.getOrderCode(), order.getDeliverySn(), order.getDeliveryId(), lastFourNumber);
+        }
+        return R.ok().put("data", expressInfoDTO);
+    }
+
+    /**
+     * 新增订单
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:add')")
+    @Log(title = "订单", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreOrderScrm fsStoreOrder) {
+        return toAjax(fsStoreOrderService.insertFsStoreOrder(fsStoreOrder));
+    }
+
+    /**
+     * 修改订单
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:edit')")
+    @Log(title = "订单", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreOrderScrm fsStoreOrder) {
+        return toAjax(fsStoreOrderService.updateFsStoreOrder(fsStoreOrder));
+    }
+
+    /**
+     * 修改物流
+     * @param fsStoreOrder
+     * @return
+     */
+    @Log(title = "修改物流", businessType = BusinessType.UPDATE)
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:editDeliveryId')")
+    @PutMapping("/editDeliveryId")
+    public AjaxResult editDeliveryId(@RequestBody FsStoreOrderScrm fsStoreOrder) {
+        return toAjax(fsStoreOrderService.updateFsStoreOrder(fsStoreOrder));
+    }
+
+    @Log(title = "同步管易物流单号", businessType = BusinessType.UPDATE)
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:updateErpOrder')")
+    @PostMapping("/updateErpOrder")
+    public R updateErpOrder(@Validated @RequestBody FsStoreOrderExpressEditParam param) {
+        FsStoreOrderScrm order = fsStoreOrderService.selectFsStoreOrderById(param.getOrderId());
+        FsErpConfig erpConfig = configUtil.getErpConfig();
+        List<Long> noErpCompany = erpConfig.getNoErpCompany();
+        if (noErpCompany.contains(order.getCompanyId())) {
+            logger.info("订单:{},相关公司不推送erp", order.getOrderCode());
+            return R.ok("订单:"+ order.getOrderCode()+"相关公司不推送erp");
+        }
+        IErpOrderService erpOrderService = getErpService();
+        ErpOrderQueryRequert request = new ErpOrderQueryRequert();
+        request.setCode(order.getExtendOrderId());
+        ErpOrderQueryResponse response = erpOrderService.getOrder(request);
+        if(response.getOrders()!=null&&response.getOrders().size()>0){
+            for(ErpOrderQuery orderQuery : response.getOrders()){
+                if(orderQuery.getDeliverys()!=null&&orderQuery.getDeliverys().size()>0){
+                    for(ErpDeliverys delivery:orderQuery.getDeliverys()){
+                        if(delivery.getDelivery()&& StringUtils.isNotEmpty(delivery.getMail_no())){
+                            //更新商订单状态
+                            fsStoreOrderService.updateDeliveryOrder(param.getOrderId(), delivery.getMail_no(),delivery.getExpress_code(),delivery.getExpress_name());
+                            return R.ok();
+                        }
+                    }
+
+                }
+            }
+        }
+        return R.error("未查询到快递信息");
+    }
+
+    /**
+     * 删除订单
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:remove')")
+    @Log(title = "订单", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(fsStoreOrderService.deleteFsStoreOrderByIds(ids));
+    }
+
+
+    @PostMapping("/createUserOrder")
+    public R createUserOrder(@Validated @RequestBody FsStoreOrderCreateUserParam param, HttpServletRequest request) {
+        return fsStoreOrderService.createUserOrder(param);
+    }
+
+    @Log(title = "确认订单", businessType = BusinessType.UPDATE)
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:finishOrder')")
+    @PostMapping("/finishOrder")
+    public R finishOrder(@Validated @RequestBody FsStoreOrderFinishParam param, HttpServletRequest request) {
+        return fsStoreOrderService.finishOrder(param.getOrderId());
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:auditPayRemain')")
+    @PostMapping("/auditPayRemain")
+    public R auditPayRemain(@Validated @RequestBody FsStoreOrderAuditPayRemainParam param, HttpServletRequest request) {
+        return fsStoreOrderService.auditPayRemain(param.getOrderId());
+    }
+
+
+    @Log(title = "导入", businessType = BusinessType.IMPORT)
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:importExpress')")
+    @PostMapping("/importExpress")
+    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
+        ExcelUtil<StoreOrderExpressExportDTO> util = new ExcelUtil<StoreOrderExpressExportDTO>(StoreOrderExpressExportDTO.class);
+        List<StoreOrderExpressExportDTO> list = util.importExcel(file.getInputStream());
+        String message = fsStoreOrderService.importExpress(list, updateSupport);
+        return AjaxResult.success(message);
+    }
+
+    //下载模板
+    @GetMapping("/importTemplate")
+    public AjaxResult importTemplate() {
+        ExcelUtil<StoreOrderExpressExportDTO> util = new ExcelUtil<StoreOrderExpressExportDTO>(StoreOrderExpressExportDTO.class);
+        return util.importTemplateExcel("物流回单数据");
+    }
+
+
+    @GetMapping("/getStoreOrder")
+    public R getStoreOrder(@RequestParam("orderCode") String orderCode) {
+        FsStoreOrderVO vo = fsStoreOrderService.selectFsStoreOrderVOByOrderCode(orderCode);
+        return R.ok().put("data", vo);
+    }
+
+    @Log(title = "冻结、解冻佣金", businessType = BusinessType.UPDATE)
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:editTuiMoney')")
+    @PostMapping("/editTuiMoney")
+    public R editTuiMoney(@Validated @RequestBody FsStoreOrderEditTuiMoneyParam param, HttpServletRequest request) {
+        return fsStoreOrderService.editTuiMoney(param);
+    }
+
+    @Log(title = "退款", businessType = BusinessType.UPDATE)
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:refundOrderMoney')")
+    @PostMapping("/refundOrderMoney")
+    public synchronized R refundOrderMoney(@Validated @RequestBody FsStoreOrderRefundParam param, HttpServletRequest request) {
+        return fsStoreOrderService.refundOrderMoney(param.getOrderId());
+    }
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:getEroOrder')")
+    @GetMapping("/getEroOrder")
+    public R getEroOrder(@RequestParam("extendOrderId") String extendOrderId) {
+        IErpOrderService erpOrderService = getErpService();
+        ErpOrderQueryRequert request = new ErpOrderQueryRequert();
+        request.setCode(extendOrderId);
+        ErpOrderQueryResponse response = erpOrderService.getOrder(request);
+        return R.ok().put("data",response);
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:updateExpress')")
+    @PostMapping("/updateExpress")
+    public R updateExpress(@Validated @RequestBody FsStoreOrderExpressEditParam param, HttpServletRequest request) {
+        return fsStoreOrderService.updateExpress(param);
+    }
+
+    @Log(title = "同步物流", businessType = BusinessType.UPDATE)
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:syncExpress')")
+    @PostMapping("/syncExpress")
+    public R syncExpress(@Validated @RequestBody FsStoreOrderExpressEditParam param, HttpServletRequest request) {
+        return fsStoreOrderService.syncExpress(param);
+    }
+
+
+    @Log(title = "分佣", businessType = BusinessType.UPDATE)
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:addTuiMoney')")
+    @PostMapping("/addTuiMoney")
+    public R addTuiMoney(@Validated @RequestBody FsStoreOrderAddTuiMoneyParam param, HttpServletRequest request) {
+        return fsStoreOrderService.addTuiMoney(param);
+    }
+
+
+    @GetMapping("/getCustomerOrderList")
+    public TableDataInfo getCustomerOrderList(FsStoreOrderParam param) {
+        startPage();
+        List<FsStoreOrderVO> list = fsStoreOrderService.selectFsCustomerStoreOrderListVO(param);
+        if (list != null) {
+            for (FsStoreOrderVO vo : list) {
+                if(vo.getPhone()!=null){
+                    vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{1})", "$1****$2"));
+                    vo.setUserPhone(vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{1})", "$1****$2"));
+                }
+
+            }
+        }
+        return getDataTable(list);
+    }
+
+    @Log(title = "手动推管易", businessType = BusinessType.INSERT)
+    @ApiOperation("创建ERP订单")
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:createErpOrder')")
+    @GetMapping("/createErpOrder")
+    public R createErpOrder(@RequestParam("orderCode") String orderCode) throws Exception
+    {
+        logger.info("手动推管易订单号:{}",orderCode);
+        FsStoreOrderScrm order=fsStoreOrderService.selectFsStoreOrderByOrderCode(orderCode);
+        return fsStoreOrderService.createOmsOrder(order.getId());
+    }
+
+    /**
+     * 订单维度分页查询接口
+     * @param param 查询条件
+     * @return AjaxResult
+     * **/
+    @GetMapping("/orderDimensionStatisticsList")
+    public TableDataInfo orderDimensionStatisticsList(OrderStatisticsParam param){
+        return getDataTable(fsStoreOrderService.selectOrderDimensionStatisticsList(param));
+    }
+
+    /**
+     * 导出订单维度统计接口
+     * @param param 查询条件
+     * @return AjaxResult
+     * **/
+    @Log(title = "订单维度统计", businessType = BusinessType.EXPORT)
+    @GetMapping("/orderDimensionStatisticsExport")
+    public AjaxResult orderDimensionStatisticsExport(OrderStatisticsParam param){
+        List<OrderStatisticsVo> list = fsStoreOrderService.selectOrderDimensionStatisticsList(param);
+//        switch (param.getGroupType()){
+//            case 2:
+//                List<OrderCateStatisticsVo> cateStatisticsVoList = convertTo(list,OrderCateStatisticsVo.class);
+//                ExcelUtil<OrderCateStatisticsVo> cateUtil = new ExcelUtil<>(OrderCateStatisticsVo.class);
+//                return cateUtil.exportExcel(cateStatisticsVoList, "订单标签维度统计");
+//            case 3:
+//                List<OrderProductStatisticsVo> productStatisticsVoList =  convertTo(list,OrderProductStatisticsVo.class);
+//                ExcelUtil<OrderProductStatisticsVo> productUtil = new ExcelUtil<>(OrderProductStatisticsVo.class);
+//                return productUtil.exportExcel(productStatisticsVoList, "订单商品维度统计");
+//        }
+
+        ExcelUtil<OrderStatisticsVo> util = new ExcelUtil<>(OrderStatisticsVo.class);
+        return util.exportExcel(list, "订单员工维度统计");
+    }
+
+    /**
+     * 对象列表类型转换
+     */
+    public static <T> List<T> convertTo(List<?> sourceList, Class<T> targetClass) {
+        if (sourceList == null || sourceList.isEmpty()) {
+            return Collections.emptyList();
+        }
+
+        List<T> resultList = new ArrayList<>(sourceList.size());
+        try {
+            for (Object source : sourceList) {
+                T target = targetClass.getDeclaredConstructor().newInstance();
+                BeanUtils.copyProperties(source, target);
+                resultList.add(target);
+            }
+        } catch (Exception e) {
+            throw new RuntimeException("数据转换异常", e);
+        }
+        return resultList;
+    }
+}

+ 54 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreOrderStatisticsScrmController.java

@@ -0,0 +1,54 @@
+package com.fs.hisStore;
+
+import com.baomidou.mybatisplus.extension.api.R;
+import com.fs.hisStore.param.FsStoreOrderStatisticsParam;
+import com.fs.hisStore.service.IFsStoreOrderScrmService;
+import com.fs.hisStore.vo.StoreOrderStatisticsVo;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.math.BigDecimal;
+
+
+@RestController
+@RequestMapping("/store/store/storeOrder/statistics")
+public class FsStoreOrderStatisticsScrmController {
+
+    @Autowired
+    private IFsStoreOrderScrmService storeOrderService;
+
+    @ApiOperation("订单统计")
+    @GetMapping("/getStoreOrderStatistics")
+    public R getStoreOrderStatistics(FsStoreOrderStatisticsParam param)
+    {
+        Integer orderCount = storeOrderService.selectFsStoreOrderCount(param);
+        param.setPaid(1);
+        //实际支付金额
+        BigDecimal totalAmount = storeOrderService.selectFsStoreOrderByPayPriceCount(param);
+        //已支付的总订单数
+        Integer orderPayCount = storeOrderService.selectFsStoreOrderCount(param);
+        //已完成订单
+        param.setStatus(5);
+        Integer orderCompleteCount = storeOrderService.selectFsStoreOrderCount(param);
+        //退货成功订单
+        param.setStatus(-2);
+        Integer orderReturnCount = storeOrderService.selectFsStoreOrderCount(param);
+        //成交率
+        int successRate = 0;
+        //退货率
+        int returnRate = 0;
+        if (orderPayCount != null && orderPayCount != 0) {
+            successRate = (int) Math.round((orderCompleteCount != null ? orderCompleteCount : 0) * 100.0 / orderPayCount);
+            returnRate = (int) Math.round((orderReturnCount != null ? orderReturnCount : 0) * 100.0 / orderPayCount);
+        }
+        StoreOrderStatisticsVo storeOrderStatisticsVo = new StoreOrderStatisticsVo();
+        storeOrderStatisticsVo.setOrderCount(orderCount);
+        storeOrderStatisticsVo.setTotalAmount(totalAmount);
+        storeOrderStatisticsVo.setSuccessRate(successRate);
+        storeOrderStatisticsVo.setReturnRate(returnRate);
+        return R.ok(storeOrderStatisticsVo);
+    }
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreOrderStatusScrmController.java

@@ -0,0 +1,97 @@
+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.domain.FsStoreOrderStatusScrm;
+import com.fs.hisStore.service.IFsStoreOrderStatusScrmService;
+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 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/storeOrderStatus")
+public class FsStoreOrderStatusScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreOrderStatusScrmService fsStoreOrderStatusService;
+
+    /**
+     * 查询订单操作记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderStatus:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreOrderStatusScrm fsStoreOrderStatus)
+    {
+        startPage();
+        List<FsStoreOrderStatusScrm> list = fsStoreOrderStatusService.selectFsStoreOrderStatusList(fsStoreOrderStatus);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出订单操作记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderStatus:export')")
+    @Log(title = "订单操作记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreOrderStatusScrm fsStoreOrderStatus)
+    {
+        List<FsStoreOrderStatusScrm> list = fsStoreOrderStatusService.selectFsStoreOrderStatusList(fsStoreOrderStatus);
+        ExcelUtil<FsStoreOrderStatusScrm> util = new ExcelUtil<FsStoreOrderStatusScrm>(FsStoreOrderStatusScrm.class);
+        return util.exportExcel(list, "storeOrderStatus");
+    }
+
+    /**
+     * 获取订单操作记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderStatus:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsStoreOrderStatusService.selectFsStoreOrderStatusById(id));
+    }
+
+    /**
+     * 新增订单操作记录
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderStatus:add')")
+    @Log(title = "订单操作记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreOrderStatusScrm fsStoreOrderStatus)
+    {
+        return toAjax(fsStoreOrderStatusService.insertFsStoreOrderStatus(fsStoreOrderStatus));
+    }
+
+    /**
+     * 修改订单操作记录
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderStatus:edit')")
+    @Log(title = "订单操作记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreOrderStatusScrm fsStoreOrderStatus)
+    {
+        return toAjax(fsStoreOrderStatusService.updateFsStoreOrderStatus(fsStoreOrderStatus));
+    }
+
+    /**
+     * 删除订单操作记录
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderStatus:remove')")
+    @Log(title = "订单操作记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsStoreOrderStatusService.deleteFsStoreOrderStatusByIds(ids));
+    }
+}

+ 298 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStorePaymentScrmController.java

@@ -0,0 +1,298 @@
+package com.fs.hisStore;
+
+import cn.hutool.json.JSONUtil;
+import com.alipay.api.AlipayApiException;
+import com.alipay.api.domain.AlipayTradeRefundModel;
+import com.fs.bean.AliPayBean;
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.ParseUtils;
+import com.fs.common.utils.StringUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.company.service.ICompanyService;
+import com.fs.huifuPay.domain.HuiFuQueryOrderResult;
+import com.fs.huifuPay.domain.HuiFuRefundResult;
+import com.fs.huifuPay.sdk.opps.core.request.V2TradePaymentScanpayQueryRequest;
+import com.fs.huifuPay.sdk.opps.core.request.V2TradePaymentScanpayRefundRequest;
+import com.fs.huifuPay.service.HuiFuService;
+import com.fs.hisStore.domain.FsStorePaymentScrm;
+import com.fs.hisStore.param.FsStorePaymentParam;
+import com.fs.hisStore.service.IFsStoreOrderScrmService;
+import com.fs.hisStore.service.IFsStorePaymentScrmService;
+import com.fs.hisStore.vo.FsStorePaymentVO;
+import com.ijpay.alipay.AliPayApi;
+import com.ijpay.alipay.AliPayApiConfig;
+import com.ijpay.alipay.AliPayApiConfigKit;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
+import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 支付明细Controller
+ *
+ * @author fs
+ * @date 2022-06-25
+ */
+@RestController
+@RequestMapping("/store/store/storePayment")
+public class FsStorePaymentScrmController extends BaseController
+{
+    @Autowired
+    private IFsStorePaymentScrmService fsStorePaymentService;
+    @Autowired
+    private AliPayBean aliPayBean;
+
+    @Autowired
+    private ICompanyService companyService;
+
+    @Autowired
+    private IFsStoreOrderScrmService orderService;
+    @Autowired
+    HuiFuService huiFuService;
+    /**
+     * 查询支付明细列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storePayment:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStorePaymentParam fsStorePayment)
+    {
+        startPage();
+        if(!StringUtils.isEmpty(fsStorePayment.getCreateTimeRange())){
+            fsStorePayment.setCreateTimeList(fsStorePayment.getCreateTimeRange().split("--"));
+        }
+        List<FsStorePaymentVO> list = fsStorePaymentService.selectFsStorePaymentListQuery(fsStorePayment);
+        for (FsStorePaymentVO vo : list){
+            vo.setUserPhone(ParseUtils.parsePhone(vo.getUserPhone()));
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出支付明细列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storePayment:export')")
+    @Log(title = "导出支付明细", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStorePaymentParam fsStorePayment)
+    {
+        if(!StringUtils.isEmpty(fsStorePayment.getCreateTimeRange())){
+            fsStorePayment.setCreateTimeList(fsStorePayment.getCreateTimeRange().split("--"));
+        }
+        List<FsStorePaymentVO> list = fsStorePaymentService.exportFsStorePaymentList(fsStorePayment);
+        for (FsStorePaymentVO vo : list){
+            vo.setUserPhone(ParseUtils.parsePhone(vo.getUserPhone()));
+        }
+        ExcelUtil<FsStorePaymentVO> util = new ExcelUtil<FsStorePaymentVO>(FsStorePaymentVO.class);
+        return util.exportExcel(list, "storePayment");
+    }
+
+    /**
+     * 获取支付明细详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storePayment:query')")
+    @GetMapping(value = "/{paymentId}")
+    public AjaxResult getInfo(@PathVariable("paymentId") Long paymentId)
+    {
+        return AjaxResult.success(fsStorePaymentService.selectFsStorePaymentById(paymentId));
+    }
+
+
+    @ApiOperation("支付手动通知")
+    @PreAuthorize("@ss.hasPermi('store:storePayment:payNotify')")
+    @PostMapping("/returnPayStatus")
+    public R returnPayStatus(@RequestBody FsStorePaymentScrm fsStorePayment) throws Exception
+    {
+        FsStorePaymentScrm payment=  fsStorePaymentService.selectFsStorePaymentByTradeNo(fsStorePayment.getTradeNo());
+        String payMode = payment.getPayMode();
+        logger.info("手动查询"+payment);
+        if (payMode.equals("hf")){
+            V2TradePaymentScanpayQueryRequest request = new V2TradePaymentScanpayQueryRequest();
+            request.setOrgReqDate(new SimpleDateFormat("yyyyMMdd").format(payment.getCreateTime()));
+            request.setOrgHfSeqId(payment.getTradeNo());
+            HuiFuQueryOrderResult o = null;
+            try {
+                o = huiFuService.queryOrder(request);
+            } catch (Exception e) {
+                throw new RuntimeException(e);
+            }
+            logger.info("汇付返回"+o);
+            if ("00000000".equals(o.getResp_code())) {
+                if (o.getTrans_stat().equals("S")) {
+                    String[] order=o.getOrg_req_seq_id().split("-");
+                    switch (order[0]) {
+                        case "store":
+                            orderService.payConfirm(1,null,order[1], o.getOrg_hf_seq_id(),o.getOut_trans_id(),o.getParty_order_id());
+                            break;
+                        case "store_remain":
+                            orderService.payRemainConfirm( order[1], o.getOrg_hf_seq_id(),o.getOut_trans_id(),o.getParty_order_id());
+                            break;
+                        case "payment":
+                            fsStorePaymentService.payConfirm(order[1],o.getOrg_hf_seq_id(),o.getOut_trans_id(),o.getParty_order_id());
+                            break;
+                    }
+                    return R.ok();
+                }
+            }
+        }
+        return R.error("请检查外部订单号");
+    }
+
+
+
+    /**
+     * 新增支付明细
+     */
+    @PreAuthorize("@ss.hasPermi('store:storePayment:add')")
+    @Log(title = "支付明细", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStorePaymentScrm fsStorePayment)
+    {
+        return toAjax(fsStorePaymentService.insertFsStorePayment(fsStorePayment));
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storePayment:refund')")
+    @PostMapping("refundStorePayment")
+    @Transactional
+    public R refundStorePayment(@RequestBody FsStorePaymentScrm fsStorePayment)
+    {
+        FsStorePaymentScrm payment=fsStorePaymentService.selectFsStorePaymentById(fsStorePayment.getPaymentId());
+        if(payment.getStatus()!=1){
+            return R.error("非法操作");
+        }
+        if(fsStorePayment.getRefundMoney().compareTo(new BigDecimal(0))<1){
+            return R.error("退款金额必须大于0");
+        }
+        if(payment.getPayMoney().compareTo(fsStorePayment.getRefundMoney())==-1){
+            return R.error("退款金额必须小于等于付款金额");
+        }
+        if(payment.getPayTypeCode().equals("weixin")){
+
+            if (payment.getPayMode()!=null&&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_party_order_id", payment.getBankSerialNo());
+                request.setExtendInfo(extendInfoMap);
+                HuiFuRefundResult refund = huiFuService.refund(request);
+                logger.info("退款:"+refund);
+                if((refund.getResp_code().equals("00000000")||refund.getResp_code().equals("00000100"))&&(refund.getTrans_stat().equals("S")||refund.getTrans_stat().equals("P"))){
+                    payment.setRefundMoney(fsStorePayment.getRefundMoney());
+                    payment.setStatus(-1);
+                    payment.setRefundTime(new Date());
+                    fsStorePaymentService.updateFsStorePayment(payment);
+                    //收款 减去所有
+                    if(payment.getCompanyId()!=null&&payment.getCompanyId()>0){
+                        companyService.subCompanyPaymentMoney(payment);
+                    }
+                    return R.ok();
+                }else {
+                    TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                    return R.error(refund.getResp_desc());
+                }
+
+            }else if (payment.getPayMode()!=null&&payment.getPayMode().equals("wx")){
+
+            }
+
+            //小雨点退款
+//            payment.setRefundMoney(fsStorePayment.getRefundMoney());
+//            fsStorePaymentService.updateFsStorePayment(payment);
+//
+//            RefundDTO refundDTO=new RefundDTO();
+//            refundDTO.setMerchOrderNo(Ids.oid());
+//            refundDTO.setAmount(fsStorePayment.getRefundMoney().toString());
+//            refundDTO.setOrigMerchOrderNo("payment-"+payment.getPayCode());
+//            return payService.refundOrder(refundDTO);
+        }
+        else if(payment.getPayTypeCode().equals("alipay")){
+            try {
+                AliPayApiConfig aliPayApiConfig;
+                try {
+                    aliPayApiConfig = AliPayApiConfigKit.getApiConfig(aliPayBean.getAppId());
+                } catch (Exception e) {
+                    aliPayApiConfig = AliPayApiConfig.builder()
+                            .setAppId(aliPayBean.getAppId())
+                            .setAliPayPublicKey(aliPayBean.getPublicKey())
+                            .setAppCertPath(aliPayBean.getAppCertPath())
+                            .setAliPayCertPath(aliPayBean.getAliPayCertPath())
+                            .setAliPayRootCertPath(aliPayBean.getAliPayRootCertPath())
+                            .setCharset("UTF-8")
+                            .setPrivateKey(aliPayBean.getPrivateKey())
+                            .setServiceUrl(aliPayBean.getServerUrl())
+                            .setSignType("RSA2")
+                            // 普通公钥方式
+                            .build();
+                    // 证书模式
+//					.buildByCert();
+                }
+                AliPayApiConfigKit.putApiConfig(aliPayApiConfig);
+                AlipayTradeRefundModel model = new AlipayTradeRefundModel();
+                model.setOutTradeNo("payment-"+payment.getPayCode());
+                model.setTradeNo(payment.getTradeNo());
+                model.setRefundAmount(fsStorePayment.getRefundMoney().toString());
+                model.setRefundReason("退款");
+                String result= AliPayApi.tradeRefundToResponse(model).getBody();
+                cn.hutool.json.JSONObject json= JSONUtil.parseObj(result);
+                cn.hutool.json.JSONObject jsonInfo= (cn.hutool.json.JSONObject) json.get("alipay_trade_refund_response");
+                String code=(String)jsonInfo.get("code");
+                String msg=(String)jsonInfo.get("sub_msg");
+                //{"alipay_trade_refund_response":{"code":"10000","msg":"Success","buyer_logon_id":"270***@qq.com","buyer_user_id":"2088402776950529","fund_change":"Y","gmt_refund_pay":"2022-04-27 18:27:28","out_trade_no":"goods-202204271826530001","refund_fee":"0.10","send_back_fee":"0.00","trade_no":"2022042722001450521456255417"},"sign":"hU+dy17/juMYQEQpO7Yy7jxkx9h5ebSbN3xdZr58msfOfJEUknqra6w4L37pgoZSx1Vj00jK3Ds06vrph6mSEliq3PQ37PwbZiRK3ZHaaKlz+9ndjoBTFYAxP60zLASfTq+W+dczDq4KOrvwhprFGt7YwKXGU42PgfOPb5EOgWyYUP6ivP0r06OzTo0f2lB28w6AQ4m4IQjdIL/tWbDaKl+ld8MPMLIgw5k9BmMcP8LV8ENC6+Gl1u5GwgAMjwHfk0RfB/kTFTHUTa7fgaO22w3pT8YKFMnOdKA0cVuJ2LE4SdxepqlprWJdCtLOeoQUX6PkEtoJGywPWAyjgdJ6Pg=="}
+                if(code.equals("10000")){
+                    payment.setRefundMoney(fsStorePayment.getRefundMoney());
+                    fsStorePaymentService.updateFsStorePayment(payment);
+                    fsStorePaymentService.refund(payment.getPayCode());
+                    return R.ok("退款成功");
+
+                }
+                else{
+                    TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                    return R.error("退款失败:"+msg);
+
+                }
+                //退款成功
+            } catch (AlipayApiException e) {
+                e.printStackTrace();
+            }
+        }
+        return R.error("非法操作");
+    }
+
+
+    /**
+     * 修改支付明细
+     */
+    @PreAuthorize("@ss.hasPermi('store:storePayment:edit')")
+    @Log(title = "支付明细", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStorePaymentScrm fsStorePayment)
+    {
+        return toAjax(fsStorePaymentService.updateFsStorePayment(fsStorePayment));
+    }
+
+    /**
+     * 删除支付明细
+     */
+    @PreAuthorize("@ss.hasPermi('store:storePayment:remove')")
+    @Log(title = "支付明细", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{paymentIds}")
+    public AjaxResult remove(@PathVariable Long[] paymentIds)
+    {
+        return toAjax(fsStorePaymentService.deleteFsStorePaymentByIds(paymentIds));
+    }
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreProductAttrScrmController.java

@@ -0,0 +1,97 @@
+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.domain.FsStoreProductAttrScrm;
+import com.fs.hisStore.service.IFsStoreProductAttrScrmService;
+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 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/storeProductAttr")
+public class FsStoreProductAttrScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreProductAttrScrmService fsStoreProductAttrService;
+
+    /**
+     * 查询商品属性列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductAttr:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreProductAttrScrm fsStoreProductAttr)
+    {
+        startPage();
+        List<FsStoreProductAttrScrm> list = fsStoreProductAttrService.selectFsStoreProductAttrList(fsStoreProductAttr);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出商品属性列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductAttr:export')")
+    @Log(title = "商品属性", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreProductAttrScrm fsStoreProductAttr)
+    {
+        List<FsStoreProductAttrScrm> list = fsStoreProductAttrService.selectFsStoreProductAttrList(fsStoreProductAttr);
+        ExcelUtil<FsStoreProductAttrScrm> util = new ExcelUtil<FsStoreProductAttrScrm>(FsStoreProductAttrScrm.class);
+        return util.exportExcel(list, "storeProductAttr");
+    }
+
+    /**
+     * 获取商品属性详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductAttr:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsStoreProductAttrService.selectFsStoreProductAttrById(id));
+    }
+
+    /**
+     * 新增商品属性
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductAttr:add')")
+    @Log(title = "商品属性", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreProductAttrScrm fsStoreProductAttr)
+    {
+        return toAjax(fsStoreProductAttrService.insertFsStoreProductAttr(fsStoreProductAttr));
+    }
+
+    /**
+     * 修改商品属性
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductAttr:edit')")
+    @Log(title = "商品属性", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreProductAttrScrm fsStoreProductAttr)
+    {
+        return toAjax(fsStoreProductAttrService.updateFsStoreProductAttr(fsStoreProductAttr));
+    }
+
+    /**
+     * 删除商品属性
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductAttr:remove')")
+    @Log(title = "商品属性", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsStoreProductAttrService.deleteFsStoreProductAttrByIds(ids));
+    }
+}

+ 99 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreProductAttrValueScrmController.java

@@ -0,0 +1,99 @@
+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.domain.FsStoreProductAttrValueScrm;
+import com.fs.hisStore.service.IFsStoreProductAttrValueScrmService;
+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 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/storeProductAttrValue")
+public class FsStoreProductAttrValueScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreProductAttrValueScrmService fsStoreProductAttrValueService;
+
+    /**
+     * 查询商品属性值列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductAttrValue:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreProductAttrValueScrm fsStoreProductAttrValue)
+    {
+        startPage();
+        List<FsStoreProductAttrValueScrm> list = fsStoreProductAttrValueService.selectFsStoreProductAttrValueList(fsStoreProductAttrValue);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出商品属性值列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductAttrValue:export')")
+    @Log(title = "商品属性值", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreProductAttrValueScrm fsStoreProductAttrValue)
+    {
+        List<FsStoreProductAttrValueScrm> list = fsStoreProductAttrValueService.selectFsStoreProductAttrValueList(fsStoreProductAttrValue);
+        ExcelUtil<FsStoreProductAttrValueScrm> util = new ExcelUtil<FsStoreProductAttrValueScrm>(FsStoreProductAttrValueScrm.class);
+        return util.exportExcel(list, "storeProductAttrValue");
+    }
+
+    /**
+     * 获取商品属性值详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductAttrValue:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsStoreProductAttrValueService.selectFsStoreProductAttrValueById(id));
+    }
+
+    /**
+     * 新增商品属性值
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductAttrValue:add')")
+    @Log(title = "商品属性值", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreProductAttrValueScrm fsStoreProductAttrValue)
+    {
+        return toAjax(fsStoreProductAttrValueService.insertFsStoreProductAttrValue(fsStoreProductAttrValue));
+    }
+
+    /**
+     * 修改商品属性值
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductAttrValue:edit')")
+    @Log(title = "商品属性值", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreProductAttrValueScrm fsStoreProductAttrValue)
+    {
+        return toAjax(fsStoreProductAttrValueService.updateFsStoreProductAttrValue(fsStoreProductAttrValue));
+    }
+
+    /**
+     * 删除商品属性值
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductAttrValue:remove')")
+    @Log(title = "商品属性值", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsStoreProductAttrValueService.deleteFsStoreProductAttrValueByIds(ids));
+    }
+
+
+}

+ 105 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreProductCategoryScrmController.java

@@ -0,0 +1,105 @@
+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.domain.R;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.hisStore.domain.FsStoreProductCategoryScrm;
+import com.fs.hisStore.service.IFsStoreProductCategoryScrmService;
+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 2022-03-16
+ */
+@RestController
+@RequestMapping("/store/store/storeProductCategory")
+public class FsStoreProductCategoryScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreProductCategoryScrmService fsStoreProductCategoryService;
+
+    /**
+     * 查询商品分类列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductCategory:list')")
+    @GetMapping("/list")
+    public AjaxResult list(FsStoreProductCategoryScrm fsStoreProductCategory)
+    {
+        List<FsStoreProductCategoryScrm> list = fsStoreProductCategoryService.selectFsStoreProductCategoryList(fsStoreProductCategory);
+        return AjaxResult.success(list);
+    }
+
+    /**
+     * 导出商品分类列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductCategory:export')")
+    @Log(title = "商品分类", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreProductCategoryScrm fsStoreProductCategory)
+    {
+        List<FsStoreProductCategoryScrm> list = fsStoreProductCategoryService.selectFsStoreProductCategoryList(fsStoreProductCategory);
+        ExcelUtil<FsStoreProductCategoryScrm> util = new ExcelUtil<FsStoreProductCategoryScrm>(FsStoreProductCategoryScrm.class);
+        return util.exportExcel(list, "storeProductCategory");
+    }
+
+    /**
+     * 获取商品分类详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductCategory:query')")
+    @GetMapping(value = "/{cateId}")
+    public AjaxResult getInfo(@PathVariable("cateId") Long cateId)
+    {
+        return AjaxResult.success(fsStoreProductCategoryService.selectFsStoreProductCategoryById(cateId));
+    }
+
+    /**
+     * 新增商品分类
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductCategory:add')")
+    @Log(title = "商品分类", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreProductCategoryScrm fsStoreProductCategory)
+    {
+        return toAjax(fsStoreProductCategoryService.insertFsStoreProductCategory(fsStoreProductCategory));
+    }
+
+    /**
+     * 修改商品分类
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductCategory:edit')")
+    @Log(title = "商品分类", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreProductCategoryScrm fsStoreProductCategory)
+    {
+        return toAjax(fsStoreProductCategoryService.updateFsStoreProductCategory(fsStoreProductCategory));
+    }
+
+    /**
+     * 删除商品分类
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductCategory:remove')")
+    @Log(title = "商品分类", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{cateIds}")
+    public AjaxResult remove(@PathVariable Long[] cateIds)
+    {
+        return toAjax(fsStoreProductCategoryService.deleteFsStoreProductCategoryByIds(cateIds));
+    }
+
+    @GetMapping("/getAllList")
+    public R getAllList(FsStoreProductCategoryScrm fsStoreProductCategory)
+    {
+        fsStoreProductCategory.setIsShow(1);
+        fsStoreProductCategory.setIsDel(0);
+        List<FsStoreProductCategoryScrm> list = fsStoreProductCategoryService.selectFsStoreProductCategoryList(fsStoreProductCategory);
+        return R.ok().put("data", list);
+    }
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreProductDetailsScrmController.java

@@ -0,0 +1,97 @@
+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.domain.FsStoreProductDetailsScrm;
+import com.fs.hisStore.service.IFsStoreProductDetailsScrmService;
+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 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/storeProductDetails")
+public class FsStoreProductDetailsScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreProductDetailsScrmService fsStoreProductDetailsService;
+
+    /**
+     * 查询商品详情列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductDetails:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreProductDetailsScrm fsStoreProductDetails)
+    {
+        startPage();
+        List<FsStoreProductDetailsScrm> list = fsStoreProductDetailsService.selectFsStoreProductDetailsList(fsStoreProductDetails);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出商品详情列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductDetails:export')")
+    @Log(title = "商品详情", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreProductDetailsScrm fsStoreProductDetails)
+    {
+        List<FsStoreProductDetailsScrm> list = fsStoreProductDetailsService.selectFsStoreProductDetailsList(fsStoreProductDetails);
+        ExcelUtil<FsStoreProductDetailsScrm> util = new ExcelUtil<FsStoreProductDetailsScrm>(FsStoreProductDetailsScrm.class);
+        return util.exportExcel(list, "storeProductDetails");
+    }
+
+    /**
+     * 获取商品详情详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductDetails:query')")
+    @GetMapping(value = "/{detailsId}")
+    public AjaxResult getInfo(@PathVariable("detailsId") Long detailsId)
+    {
+        return AjaxResult.success(fsStoreProductDetailsService.selectFsStoreProductDetailsById(detailsId));
+    }
+
+    /**
+     * 新增商品详情
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductDetails:add')")
+    @Log(title = "商品详情", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreProductDetailsScrm fsStoreProductDetails)
+    {
+        return toAjax(fsStoreProductDetailsService.insertFsStoreProductDetails(fsStoreProductDetails));
+    }
+
+    /**
+     * 修改商品详情
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductDetails:edit')")
+    @Log(title = "商品详情", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreProductDetailsScrm fsStoreProductDetails)
+    {
+        return toAjax(fsStoreProductDetailsService.updateFsStoreProductDetails(fsStoreProductDetails));
+    }
+
+    /**
+     * 删除商品详情
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductDetails:remove')")
+    @Log(title = "商品详情", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{detailsIds}")
+    public AjaxResult remove(@PathVariable Long[] detailsIds)
+    {
+        return toAjax(fsStoreProductDetailsService.deleteFsStoreProductDetailsByIds(detailsIds));
+    }
+}

+ 133 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreProductGroupScrmController.java

@@ -0,0 +1,133 @@
+package com.fs.hisStore;
+
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONUtil;
+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.domain.FsStoreProductScrm;
+import com.fs.hisStore.domain.FsStoreProductAttrValueScrm;
+import com.fs.hisStore.domain.FsStoreProductGroupScrm;
+import com.fs.hisStore.dto.StoreProductGroupDTO;
+import com.fs.hisStore.service.IFsStoreProductAttrValueScrmService;
+import com.fs.hisStore.service.IFsStoreProductGroupScrmService;
+import com.fs.hisStore.service.IFsStoreProductScrmService;
+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 2022-11-23
+ */
+@RestController
+@RequestMapping("/store/store/storeProductGroup")
+public class FsStoreProductGroupScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreProductGroupScrmService fsStoreProductGroupService;
+    @Autowired
+    private IFsStoreProductAttrValueScrmService attrValueService;
+    @Autowired
+    private IFsStoreProductScrmService storeProductService;
+    /**
+     * 查询商品组合列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductGroup:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreProductGroupScrm fsStoreProductGroup)
+    {
+        startPage();
+        List<FsStoreProductGroupScrm> list = fsStoreProductGroupService.selectFsStoreProductGroupList(fsStoreProductGroup);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出商品组合列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductGroup:export')")
+    @Log(title = "商品组合", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreProductGroupScrm fsStoreProductGroup)
+    {
+        List<FsStoreProductGroupScrm> list = fsStoreProductGroupService.selectFsStoreProductGroupList(fsStoreProductGroup);
+        ExcelUtil<FsStoreProductGroupScrm> util = new ExcelUtil<FsStoreProductGroupScrm>(FsStoreProductGroupScrm.class);
+        return util.exportExcel(list, "storeProductGroup");
+    }
+
+    /**
+     * 获取商品组合详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductGroup:query')")
+    @GetMapping(value = "/{groupId}")
+    public AjaxResult getInfo(@PathVariable("groupId") Long groupId)
+    {
+        FsStoreProductGroupScrm storeProductGroup=fsStoreProductGroupService.selectFsStoreProductGroupById(groupId);
+        JSONArray jsonArray=JSONUtil.parseArray(storeProductGroup.getProducts());
+        List<StoreProductGroupDTO> productGroupDTOS=JSONUtil.toList(jsonArray, StoreProductGroupDTO.class);
+        for(StoreProductGroupDTO dto:productGroupDTOS){
+            FsStoreProductAttrValueScrm attrValue=attrValueService.selectFsStoreProductAttrValueById(dto.getId());
+            if(attrValue!=null){
+                FsStoreProductScrm product=storeProductService.selectFsStoreProductById(attrValue.getProductId());
+                if(product!=null){
+                    dto.setProductId(attrValue.getProductId());
+                    dto.setId(dto.getId());
+                    dto.setBarCode(attrValue.getBarCode());
+                    dto.setPrice(attrValue.getPrice());
+                    dto.setCount(dto.getCount());
+                    dto.setSku(attrValue.getSku());
+                    dto.setImage(attrValue.getImage());
+                    dto.setProductName(product.getProductName());
+                }
+
+            }
+
+        }
+        storeProductGroup.setProductList(productGroupDTOS);
+        return AjaxResult.success(storeProductGroup);
+    }
+
+    /**
+     * 新增商品组合
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductGroup:add')")
+    @Log(title = "商品组合", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreProductGroupScrm fsStoreProductGroup)
+    {
+        String products=JSONUtil.toJsonStr(fsStoreProductGroup.getProductList());
+        fsStoreProductGroup.setProducts(products);
+        return toAjax(fsStoreProductGroupService.insertFsStoreProductGroup(fsStoreProductGroup));
+    }
+
+    /**
+     * 修改商品组合
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductGroup:edit')")
+    @Log(title = "商品组合", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreProductGroupScrm fsStoreProductGroup)
+    {
+        String products=JSONUtil.toJsonStr(fsStoreProductGroup.getProductList());
+        fsStoreProductGroup.setProducts(products);
+        return toAjax(fsStoreProductGroupService.updateFsStoreProductGroup(fsStoreProductGroup));
+    }
+
+    /**
+     * 删除商品组合
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductGroup:remove')")
+    @Log(title = "商品组合", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{groupIds}")
+    public AjaxResult remove(@PathVariable Long[] groupIds)
+    {
+        return toAjax(fsStoreProductGroupService.deleteFsStoreProductGroupByIds(groupIds));
+    }
+}

+ 200 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreProductPackageScrmController.java

@@ -0,0 +1,200 @@
+package com.fs.hisStore;
+
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONUtil;
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.hisStore.domain.FsStoreProductScrm;
+import com.fs.hisStore.domain.FsStoreProductAttrValueScrm;
+import com.fs.hisStore.domain.FsStoreProductPackageScrm;
+import com.fs.hisStore.dto.StoreOrderProductDTO;
+import com.fs.hisStore.dto.StorePackageProductDTO;
+import com.fs.hisStore.param.FsStoreProductPackageModifyParam;
+import com.fs.hisStore.service.IFsStoreProductAttrValueScrmService;
+import com.fs.hisStore.service.IFsStoreProductPackageScrmService;
+import com.fs.hisStore.service.IFsStoreProductScrmService;
+import com.fs.hisStore.vo.FsStoreProductPacketExportVO;
+import com.fs.hisStore.vo.FsStoreProductPacketVO;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 商品组合套餐Controller
+ *
+ * @author fs
+ * @date 2022-07-14
+ */
+@RestController
+@RequestMapping("/store/store/storeProductPackage")
+public class FsStoreProductPackageScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreProductPackageScrmService fsStoreProductPackageService;
+    @Autowired
+    private IFsStoreProductAttrValueScrmService attrValueService;
+    @Autowired
+    private IFsStoreProductScrmService storeProductService;
+    /**
+     * 查询商品组合套餐列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductPackage:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreProductPackageScrm fsStoreProductPackage)
+    {
+        startPage();
+        List<FsStoreProductPacketVO> list = fsStoreProductPackageService.selectFsStoreProductPackageListVO(fsStoreProductPackage);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出商品组合套餐列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductPackage:export')")
+    @Log(title = "商品组合套餐", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreProductPackageScrm fsStoreProductPackage)
+    {
+        List<FsStoreProductPacketVO> list = fsStoreProductPackageService.selectFsStoreProductPackageListVO(fsStoreProductPackage);
+        List<FsStoreProductPacketExportVO> sorList=new ArrayList<>();
+
+        for(FsStoreProductPacketVO productPackage:list){
+            //List<StoreOrderProductDTO> productList=new ArrayList<>();
+            JSONArray jsonArray=JSONUtil.parseArray(productPackage.getProducts());
+            List<StorePackageProductDTO> goodsList=JSONUtil.toList(jsonArray, StorePackageProductDTO.class);
+            for(StorePackageProductDTO dto:goodsList){
+                //StoreOrderProductDTO productDTO=new StoreOrderProductDTO();
+                FsStoreProductAttrValueScrm attrValue=attrValueService.selectFsStoreProductAttrValueById(dto.getId());
+                if(attrValue!=null){
+                    FsStoreProductScrm product=storeProductService.selectFsStoreProductById(attrValue.getProductId());
+                    if(product!=null){
+                        FsStoreProductPacketExportVO packetExportVO= new FsStoreProductPacketExportVO();
+                        BeanUtils.copyProperties(productPackage,packetExportVO);
+                        packetExportVO.setProductId(attrValue.getProductId());
+                        packetExportVO.setId(dto.getId());
+                        packetExportVO.setBarCode(attrValue.getBarCode());
+                        packetExportVO.setPrice(attrValue.getPrice());
+                        packetExportVO.setCount(dto.getCount());
+                        packetExportVO.setSku(attrValue.getSku());
+                        packetExportVO.setImage(attrValue.getImage());
+                        packetExportVO.setProductName(product.getProductName());
+                        sorList.add(packetExportVO);
+                        //productList.add(productDTO);
+
+                    }
+                }
+            }
+
+        }
+        ExcelUtil<FsStoreProductPacketExportVO> util = new ExcelUtil<FsStoreProductPacketExportVO>(FsStoreProductPacketExportVO.class);
+        return util.exportExcel(sorList, "storeProductPackage");
+    }
+
+    /**
+     * 获取商品组合套餐详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductPackage:query')")
+    @GetMapping(value = "/{packageId}")
+    public AjaxResult getInfo(@PathVariable("packageId") Long packageId)
+    {
+        FsStoreProductPackageScrm productPackage=fsStoreProductPackageService.selectFsStoreProductPackageById(packageId);
+        List<StoreOrderProductDTO> productList=new ArrayList<>();
+        JSONArray jsonArray=JSONUtil.parseArray(productPackage.getProducts());
+        List<StorePackageProductDTO> goodsList=JSONUtil.toList(jsonArray, StorePackageProductDTO.class);
+        for(StorePackageProductDTO dto:goodsList){
+            StoreOrderProductDTO productDTO=new StoreOrderProductDTO();
+            FsStoreProductAttrValueScrm attrValue=attrValueService.selectFsStoreProductAttrValueById(dto.getId());
+            if(attrValue!=null){
+                FsStoreProductScrm product=storeProductService.selectFsStoreProductById(attrValue.getProductId());
+                if(product!=null){
+                    productDTO.setProductId(attrValue.getProductId());
+                    productDTO.setId(dto.getId());
+                    productDTO.setBarCode(attrValue.getBarCode());
+                    productDTO.setPrice(attrValue.getPrice());
+                    productDTO.setCount(dto.getCount());
+                    productDTO.setSku(attrValue.getSku());
+                    productDTO.setImage(attrValue.getImage());
+                    productDTO.setProductName(product.getProductName());
+                    productList.add(productDTO);
+                }
+            }
+        }
+        productPackage.setProductList(productList);
+        return AjaxResult.success(productPackage);
+    }
+
+    /**
+     * 批量修改商品组合套餐
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductPackage:edit')")
+    @Log(title = "商品组合套餐", businessType = BusinessType.UPDATE)
+    @PostMapping("/modifyMore")
+    public AjaxResult modifyMore(@RequestBody FsStoreProductPackageModifyParam param) {
+        return toAjax(fsStoreProductPackageService.updateFsStoreProductPackages(param.getPackageIds(),param.getStatus(),param.getCompanyId()));
+    }
+
+    /**
+     * 新增商品组合套餐
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductPackage:add')")
+    @Log(title = "商品组合套餐", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreProductPackageScrm fsStoreProductPackage)
+    {
+        JSONArray jsonArray=JSONUtil.parseArray(fsStoreProductPackage.getProductList());
+        List<StorePackageProductDTO> goodsList=JSONUtil.toList(jsonArray, StorePackageProductDTO.class);
+        fsStoreProductPackage.setProducts(JSONUtil.toJsonStr(goodsList));
+        fsStoreProductPackage.setCompanyId(0l);
+        return toAjax(fsStoreProductPackageService.insertFsStoreProductPackage(fsStoreProductPackage));
+    }
+
+    /**
+     * 修改商品组合套餐
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductPackage:edit')")
+    @Log(title = "商品组合套餐", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreProductPackageScrm fsStoreProductPackage)
+    {
+        JSONArray jsonArray=JSONUtil.parseArray(fsStoreProductPackage.getProductList());
+        List<StorePackageProductDTO> goodsList=JSONUtil.toList(jsonArray, StorePackageProductDTO.class);
+        fsStoreProductPackage.setProducts(JSONUtil.toJsonStr(goodsList));
+        return toAjax(fsStoreProductPackageService.updateFsStoreProductPackage(fsStoreProductPackage));
+    }
+
+    /**
+     * 删除商品组合套餐
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductPackage:remove')")
+    @Log(title = "商品组合套餐", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{packageIds}")
+    public AjaxResult remove(@PathVariable Long[] packageIds)
+    {
+        return toAjax(fsStoreProductPackageService.deleteFsStoreProductPackageByIds(packageIds));
+    }
+
+
+    @GetMapping("/listBySearch")
+    public R listBySearCh(FsStoreProductPackageScrm productPackage)
+    {
+        List<FsStoreProductScrm> products = new ArrayList<>();
+        List<FsStoreProductPackageScrm> list = fsStoreProductPackageService.selectFsStoreProductPackageList(productPackage);
+
+        for (FsStoreProductPackageScrm fsStoreProductPackage : list){
+            FsStoreProductScrm product = new FsStoreProductScrm();
+            product.setProductId(fsStoreProductPackage.getPackageId());
+            product.setProductName(fsStoreProductPackage.getTitle());
+            products.add(product);
+        }
+        return R.ok().put("data",products);
+    }
+}

+ 58 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreProductRelationScrmController.java

@@ -0,0 +1,58 @@
+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.param.FsStoreProductRelationParam;
+import com.fs.hisStore.service.IFsStoreProductRelationScrmService;
+import com.fs.hisStore.vo.FsStoreProductRelationQueryVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+
+@RestController
+@RequestMapping("/store/store/storeProductRelation")
+public class FsStoreProductRelationScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreProductRelationScrmService fsStoreProductRelationService;
+
+    @PreAuthorize("@ss.hasPermi('store:storeProductRelation:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreProductRelationParam param)
+    {
+        startPage();
+        List<FsStoreProductRelationQueryVO> list = fsStoreProductRelationService.selectFsStoreProductRelationListVO(param);
+        for (FsStoreProductRelationQueryVO vo : list){
+            vo.setPhone(ParseUtils.parsePhone(vo.getPhone()));
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出商品点赞和收藏列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductRelation:export')")
+    @Log(title = "商品浏览记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreProductRelationParam param)
+    {
+        List<FsStoreProductRelationQueryVO> list = fsStoreProductRelationService.selectFsStoreProductRelationListVO(param);
+        for (FsStoreProductRelationQueryVO vo : list){
+            vo.setPhone(ParseUtils.parsePhone(vo.getPhone()));
+        }
+        ExcelUtil<FsStoreProductRelationQueryVO> util = new ExcelUtil<FsStoreProductRelationQueryVO>(FsStoreProductRelationQueryVO.class);
+        return util.exportExcel(list, "商品浏览记录");
+    }
+
+
+}

+ 110 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreProductReplyScrmController.java

@@ -0,0 +1,110 @@
+package com.fs.hisStore;
+
+import cn.hutool.core.date.DateTime;
+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.domain.FsStoreProductReplyScrm;
+import com.fs.hisStore.service.IFsStoreProductReplyScrmService;
+import com.fs.hisStore.vo.FsStoreProductReplyVO;
+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 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/storeProductReply")
+public class FsStoreProductReplyScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreProductReplyScrmService fsStoreProductReplyService;
+
+    /**
+     * 查询评论列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductReply:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreProductReplyScrm fsStoreProductReply)
+    {
+        startPage();
+        fsStoreProductReply.setIsDel(0);
+        List<FsStoreProductReplyVO> list = fsStoreProductReplyService.selectFsStoreProductReplyListVO(fsStoreProductReply);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出评论列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductReply:export')")
+    @Log(title = "评论", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreProductReplyScrm fsStoreProductReply)
+    {
+        List<FsStoreProductReplyScrm> list = fsStoreProductReplyService.selectFsStoreProductReplyList(fsStoreProductReply);
+        ExcelUtil<FsStoreProductReplyScrm> util = new ExcelUtil<FsStoreProductReplyScrm>(FsStoreProductReplyScrm.class);
+        return util.exportExcel(list, "storeProductReply");
+    }
+
+    /**
+     * 获取评论详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductReply:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsStoreProductReplyService.selectFsStoreProductReplyById(id));
+    }
+
+    /**
+     * 新增评论
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductReply:add')")
+    @Log(title = "评论", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreProductReplyScrm fsStoreProductReply)
+    {
+        return toAjax(fsStoreProductReplyService.insertFsStoreProductReply(fsStoreProductReply));
+    }
+
+    /**
+     * 修改评论
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductReply:edit')")
+    @Log(title = "评论", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreProductReplyScrm fsStoreProductReply)
+    {
+        return toAjax(fsStoreProductReplyService.updateFsStoreProductReply(fsStoreProductReply));
+    }
+
+    /**
+     * 删除评论
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductReply:remove')")
+    @Log(title = "评论", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsStoreProductReplyService.deleteFsStoreProductReplyByIds(ids));
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeProductReply:reply')")
+    @Log(title = "评论回复", businessType = BusinessType.INSERT)
+    @PostMapping("/reply")
+    public AjaxResult reply(@RequestBody FsStoreProductReplyScrm fsStoreProductReply)
+    {
+        fsStoreProductReply.setIsReply(1);
+        fsStoreProductReply.setReplyTime(new DateTime());
+        return toAjax(fsStoreProductReplyService.updateFsStoreProductReply(fsStoreProductReply));
+    }
+}

+ 119 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreProductRuleScrmController.java

@@ -0,0 +1,119 @@
+package com.fs.hisStore;
+
+import cn.hutool.json.JSONUtil;
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.hisStore.domain.FsStoreProductRuleScrm;
+import com.fs.hisStore.param.FsStoreProductRuleParam;
+import com.fs.hisStore.service.IFsStoreProductRuleScrmService;
+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 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/storeProductRule")
+public class FsStoreProductRuleScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreProductRuleScrmService fsStoreProductRuleService;
+
+    /**
+     * 查询商品规则值(规格)列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductRule:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreProductRuleScrm fsStoreProductRule)
+    {
+        startPage();
+        fsStoreProductRule.setIsDel(0);
+        List<FsStoreProductRuleScrm> list = fsStoreProductRuleService.selectFsStoreProductRuleList(fsStoreProductRule);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出商品规则值(规格)列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductRule:export')")
+    @Log(title = "商品规则值(规格)", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreProductRuleScrm fsStoreProductRule)
+    {
+        List<FsStoreProductRuleScrm> list = fsStoreProductRuleService.selectFsStoreProductRuleList(fsStoreProductRule);
+        ExcelUtil<FsStoreProductRuleScrm> util = new ExcelUtil<FsStoreProductRuleScrm>(FsStoreProductRuleScrm.class);
+        return util.exportExcel(list, "storeProductRule");
+    }
+
+    /**
+     * 获取商品规则值(规格)详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductRule:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Integer id)
+    {
+        return AjaxResult.success(fsStoreProductRuleService.selectFsStoreProductRuleById(id));
+    }
+
+    /**
+     * 新增商品规则值(规格)
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductRule:add')")
+    @Log(title = "商品规则值(规格)", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreProductRuleParam fsStoreProductRule)
+    {
+        FsStoreProductRuleScrm rule=new FsStoreProductRuleScrm();
+        rule.setRuleName(fsStoreProductRule.getRuleName());
+        rule.setRuleValue(JSONUtil.toJsonStr(fsStoreProductRule.getRuleValue()));
+        rule.setIsDel(0);
+        return toAjax(fsStoreProductRuleService.insertFsStoreProductRule(rule));
+    }
+
+    /**
+     * 修改商品规则值(规格)
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductRule:edit')")
+    @Log(title = "商品规则值(规格)", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreProductRuleParam fsStoreProductRule)
+    {FsStoreProductRuleScrm rule=new FsStoreProductRuleScrm();
+        rule
+        .setId(fsStoreProductRule.getId());
+        rule.setRuleName(fsStoreProductRule.getRuleName());
+        rule.setRuleValue(JSONUtil.toJsonStr(fsStoreProductRule.getRuleValue()));
+        rule.setIsDel(0);
+        return toAjax(fsStoreProductRuleService.updateFsStoreProductRule(rule));
+    }
+
+    /**
+     * 删除商品规则值(规格)
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductRule:remove')")
+    @Log(title = "商品规则值(规格)", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Integer[] ids)
+    {
+        return toAjax(fsStoreProductRuleService.deleteFsStoreProductRuleByIds(ids));
+    }
+
+
+    @GetMapping("/getAllList")
+    public R getAllList(FsStoreProductRuleScrm fsStoreProductRule)
+    {
+        fsStoreProductRule.setIsDel(0);
+        List<FsStoreProductRuleScrm> list = fsStoreProductRuleService.selectFsStoreProductRuleList(fsStoreProductRule);
+        return R.ok().put("data",list);
+    }
+}

+ 189 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreProductScrmController.java

@@ -0,0 +1,189 @@
+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.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.hisStore.vo.FsStoreProductAttrValueVO;
+import com.fs.hisStore.vo.FsStoreProductExportVO;
+import com.fs.hisStore.vo.FsStoreProductListVO;
+import com.fs.hisStore.vo.FsStoreTuiProductAttrValueVO;
+import com.fs.statis.dto.ModifyMoreDTO;
+import com.fs.hisStore.domain.FsStoreProductScrm;
+import com.fs.hisStore.domain.FsStoreProductAttrScrm;
+import com.fs.hisStore.param.FsProductAttrValueParam;
+import com.fs.hisStore.param.FsStoreProductAddEditParam;
+import com.fs.hisStore.param.FsStoreTuiProductAttrValueParam;
+import com.fs.hisStore.service.IFsStoreProductAttrScrmService;
+import com.fs.hisStore.service.IFsStoreProductAttrValueScrmService;
+import com.fs.hisStore.service.IFsStoreProductScrmService;
+import com.mysql.cj.util.StringUtils;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 商品Controller
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/storeProduct")
+public class FsStoreProductScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreProductScrmService fsStoreProductService;
+
+    @Autowired
+    private IFsStoreProductAttrScrmService attrService;
+
+    @Autowired
+    private IFsStoreProductAttrValueScrmService attrValueService;
+
+
+    /**
+     * 批量修改商品
+     * @param modifyMoreDTO
+     * @return
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProduct:list')")
+    @PostMapping("/batchModify")
+    public R batchModify(@RequestBody ModifyMoreDTO modifyMoreDTO){
+        fsStoreProductService.batchModify(modifyMoreDTO);
+        return R.ok();
+    }
+
+    /**
+     * 查询商品列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProduct:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreProductScrm fsStoreProduct)
+    {
+        startPage();
+        List<FsStoreProductListVO> list;
+        if(StringUtils.isNullOrEmpty(fsStoreProduct.getBarCode())){
+            list = fsStoreProductService.selectFsStoreProductListVO(fsStoreProduct);
+        }else{
+            list = fsStoreProductService.selectFsStoreProductBarCodeListVO(fsStoreProduct);
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出商品列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProduct:export')")
+    @Log(title = "商品", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreProductScrm fsStoreProduct)
+    {
+        List<FsStoreProductExportVO> list = fsStoreProductService.selectFsStoreProductExportList(fsStoreProduct);
+        ExcelUtil<FsStoreProductExportVO> util = new ExcelUtil<FsStoreProductExportVO>(FsStoreProductExportVO.class);
+        return util.exportExcel(list, "storeProduct");
+    }
+
+
+    @Log(title = "商品导入", businessType = BusinessType.IMPORT)
+    @PreAuthorize("@ss.hasPermi('store:storeProduct:import')")
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
+    {
+        ExcelUtil<FsStoreProductExportVO> util = new ExcelUtil<>(FsStoreProductExportVO.class);
+        List<FsStoreProductExportVO> list = util.importExcel(file.getInputStream());
+        String message = fsStoreProductService.importStoreProduct(list, updateSupport);
+        return AjaxResult.success(message);
+    }
+
+
+    @GetMapping("/importTemplate")
+    public AjaxResult importTemplate()
+    {
+        ExcelUtil<FsStoreProductExportVO> util = new ExcelUtil<>(FsStoreProductExportVO.class);
+        return util.importTemplateExcel("商品数据");
+    }
+
+    /**
+     * 获取商品详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProduct:query')")
+    @GetMapping(value = "/{productId}")
+    public R getInfo(@PathVariable("productId") Long productId)
+    {
+        FsStoreProductScrm product=fsStoreProductService.selectFsStoreProductById(productId);
+        List<FsStoreProductAttrScrm> attrs=attrService.selectFsStoreProductAttrByProductId(productId);
+        return R.ok().put("data",product).put("attrs", attrs);
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeProduct:add')")
+    @Log(title = "商品", businessType = BusinessType.INSERT)
+    @PostMapping(value = "/addOrEdit")
+    public R addOrEdit(@RequestBody FsStoreProductAddEditParam fsStoreProduct)
+    {
+        if (fsStoreProduct.getIsShow() ==1){
+            logger.info("商品上架:{}",fsStoreProduct.getProductName()+new Date());
+        }
+
+        if (fsStoreProduct.getIsDisplay() ==1){
+            logger.info("商品前端展示:{}",fsStoreProduct.getProductName()+new Date());
+        }
+        return fsStoreProductService.addOrEdit(fsStoreProduct);
+    }
+
+
+
+
+    /**
+     * 删除商品
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProduct:remove')")
+    @Log(title = "商品", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{productIds}")
+    public AjaxResult remove(@PathVariable Long[] productIds)
+    {
+        return toAjax(fsStoreProductService.deleteFsStoreProductByIds(productIds));
+    }
+
+    @ApiOperation(value = "生成属性")
+    @PostMapping(value = "/genFormatAttr/{productId}")
+    public ResponseEntity genFormatAttr(@PathVariable Long productId, @RequestBody String jsonStr){
+        return new ResponseEntity<>(fsStoreProductService.getFormatAttr(productId,jsonStr), HttpStatus.OK);
+    }
+
+
+    @GetMapping("/getStoreProductAttrValueList")
+    public TableDataInfo getStoreProductAttrValueList(FsProductAttrValueParam param)
+    {
+        startPage();
+        List<FsStoreProductAttrValueVO> list=attrValueService.selectFsStoreProductAttrValueListVO(param);
+        return getDataTable(list);
+    }
+
+    @ApiOperation("获取推广商品列表")
+    @GetMapping("/getStoreTuiProductAttrValueList")
+    public TableDataInfo getStoreTuiProductAttrValueList(FsStoreTuiProductAttrValueParam param, HttpServletRequest request){
+        startPage();
+        List<FsStoreTuiProductAttrValueVO> list=attrValueService.selectStoreTuiProductAttrValueVOList(param);
+        return getDataTable(list);
+    }
+
+    @GetMapping("/listBySearch")
+    public R listBySearCh(FsStoreProductScrm product)
+    {
+        List<FsStoreProductScrm> list = fsStoreProductService.selectFsStoreProductList(product);
+        return R.ok().put("data",list);
+    }
+
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreProductTemplateScrmController.java

@@ -0,0 +1,97 @@
+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.domain.FsStoreProductTemplateScrm;
+import com.fs.hisStore.service.IFsStoreProductTemplateScrmService;
+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 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/storeProductTemplate")
+public class FsStoreProductTemplateScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreProductTemplateScrmService fsStoreProductTemplateService;
+
+    /**
+     * 查询商品模板列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductTemplate:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreProductTemplateScrm fsStoreProductTemplate)
+    {
+        startPage();
+        List<FsStoreProductTemplateScrm> list = fsStoreProductTemplateService.selectFsStoreProductTemplateList(fsStoreProductTemplate);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出商品模板列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductTemplate:export')")
+    @Log(title = "商品模板", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreProductTemplateScrm fsStoreProductTemplate)
+    {
+        List<FsStoreProductTemplateScrm> list = fsStoreProductTemplateService.selectFsStoreProductTemplateList(fsStoreProductTemplate);
+        ExcelUtil<FsStoreProductTemplateScrm> util = new ExcelUtil<FsStoreProductTemplateScrm>(FsStoreProductTemplateScrm.class);
+        return util.exportExcel(list, "storeProductTemplate");
+    }
+
+    /**
+     * 获取商品模板详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductTemplate:query')")
+    @GetMapping(value = "/{tempId}")
+    public AjaxResult getInfo(@PathVariable("tempId") Long tempId)
+    {
+        return AjaxResult.success(fsStoreProductTemplateService.selectFsStoreProductTemplateById(tempId));
+    }
+
+    /**
+     * 新增商品模板
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductTemplate:add')")
+    @Log(title = "商品模板", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreProductTemplateScrm fsStoreProductTemplate)
+    {
+        return toAjax(fsStoreProductTemplateService.insertFsStoreProductTemplate(fsStoreProductTemplate));
+    }
+
+    /**
+     * 修改商品模板
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductTemplate:edit')")
+    @Log(title = "商品模板", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreProductTemplateScrm fsStoreProductTemplate)
+    {
+        return toAjax(fsStoreProductTemplateService.updateFsStoreProductTemplate(fsStoreProductTemplate));
+    }
+
+    /**
+     * 删除商品模板
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductTemplate:remove')")
+    @Log(title = "商品模板", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{tempIds}")
+    public AjaxResult remove(@PathVariable Long[] tempIds)
+    {
+        return toAjax(fsStoreProductTemplateService.deleteFsStoreProductTemplateByIds(tempIds));
+    }
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreShopScrmController.java

@@ -0,0 +1,97 @@
+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.domain.FsStoreShopScrm;
+import com.fs.hisStore.service.IFsStoreShopScrmService;
+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 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/storeShop")
+public class FsStoreShopScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreShopScrmService fsStoreShopService;
+
+    /**
+     * 查询门店自提列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeShop:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreShopScrm fsStoreShop)
+    {
+        startPage();
+        List<FsStoreShopScrm> list = fsStoreShopService.selectFsStoreShopList(fsStoreShop);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出门店自提列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeShop:export')")
+    @Log(title = "门店自提", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreShopScrm fsStoreShop)
+    {
+        List<FsStoreShopScrm> list = fsStoreShopService.selectFsStoreShopList(fsStoreShop);
+        ExcelUtil<FsStoreShopScrm> util = new ExcelUtil<FsStoreShopScrm>(FsStoreShopScrm.class);
+        return util.exportExcel(list, "storeShop");
+    }
+
+    /**
+     * 获取门店自提详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeShop:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsStoreShopService.selectFsStoreShopById(id));
+    }
+
+    /**
+     * 新增门店自提
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeShop:add')")
+    @Log(title = "门店自提", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreShopScrm fsStoreShop)
+    {
+        return toAjax(fsStoreShopService.insertFsStoreShop(fsStoreShop));
+    }
+
+    /**
+     * 修改门店自提
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeShop:edit')")
+    @Log(title = "门店自提", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreShopScrm fsStoreShop)
+    {
+        return toAjax(fsStoreShopService.updateFsStoreShop(fsStoreShop));
+    }
+
+    /**
+     * 删除门店自提
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeShop:remove')")
+    @Log(title = "门店自提", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsStoreShopService.deleteFsStoreShopByIds(ids));
+    }
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreShopStaffScrmController.java

@@ -0,0 +1,97 @@
+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.domain.FsStoreShopStaffScrm;
+import com.fs.hisStore.service.IFsStoreShopStaffScrmService;
+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 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/storeShopStaff")
+public class FsStoreShopStaffScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreShopStaffScrmService fsStoreShopStaffService;
+
+    /**
+     * 查询门店店员列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeShopStaff:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreShopStaffScrm fsStoreShopStaff)
+    {
+        startPage();
+        List<FsStoreShopStaffScrm> list = fsStoreShopStaffService.selectFsStoreShopStaffList(fsStoreShopStaff);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出门店店员列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeShopStaff:export')")
+    @Log(title = "门店店员", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreShopStaffScrm fsStoreShopStaff)
+    {
+        List<FsStoreShopStaffScrm> list = fsStoreShopStaffService.selectFsStoreShopStaffList(fsStoreShopStaff);
+        ExcelUtil<FsStoreShopStaffScrm> util = new ExcelUtil<FsStoreShopStaffScrm>(FsStoreShopStaffScrm.class);
+        return util.exportExcel(list, "storeShopStaff");
+    }
+
+    /**
+     * 获取门店店员详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeShopStaff:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsStoreShopStaffService.selectFsStoreShopStaffById(id));
+    }
+
+    /**
+     * 新增门店店员
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeShopStaff:add')")
+    @Log(title = "门店店员", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreShopStaffScrm fsStoreShopStaff)
+    {
+        return toAjax(fsStoreShopStaffService.insertFsStoreShopStaff(fsStoreShopStaff));
+    }
+
+    /**
+     * 修改门店店员
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeShopStaff:edit')")
+    @Log(title = "门店店员", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreShopStaffScrm fsStoreShopStaff)
+    {
+        return toAjax(fsStoreShopStaffService.updateFsStoreShopStaff(fsStoreShopStaff));
+    }
+
+    /**
+     * 删除门店店员
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeShopStaff:remove')")
+    @Log(title = "门店店员", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsStoreShopStaffService.deleteFsStoreShopStaffByIds(ids));
+    }
+}

+ 174 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreStatisticsScrmController.java

@@ -0,0 +1,174 @@
+package com.fs.hisStore;
+
+import com.alibaba.fastjson.JSONObject;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.R;
+import com.fs.common.utils.StringUtils;
+import com.fs.common.utils.TimeUtils;
+import com.fs.company.domain.CompanyUser;
+import com.fs.company.service.ICompanyUserService;
+import com.fs.framework.web.service.TokenService;
+import com.fs.hisStore.param.FsStoreStatisticsParam;
+import com.fs.hisStore.service.IFsStoreOrderScrmService;
+import com.fs.hisStore.service.IFsStorePaymentScrmService;
+import com.fs.hisStore.vo.FsStoreOrderCountsVO;
+import com.fs.hisStore.vo.FsStoreProductCountsVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 统计
+ *
+ * @author fs
+ * @date 2021-03-22
+ */
+@RestController
+@RequestMapping("/store/store/statistics")
+public class FsStoreStatisticsScrmController extends BaseController
+{
+
+
+    @Autowired
+    private ICompanyUserService userService;
+    @Autowired
+    private IFsStoreOrderScrmService storeOrderService;
+    @Autowired
+    private IFsStorePaymentScrmService paymentService;
+    @Autowired
+    private TokenService tokenService;
+    @PreAuthorize("@ss.hasPermi('store:statistics:storeOrder')")
+    @GetMapping("/storeOrder")
+    public R storeOrder(FsStoreStatisticsParam param)
+    {
+        if(StringUtils.isNotEmpty(param.getUserIds())){
+            String[] userIds=param.getUserIds().split(",");
+            Long[] ids=new Long[userIds.length];
+            for(int i=0;i<ids.length; i++){
+                ids[i]=Long.parseLong(userIds[i]);
+            }
+            param.setUsers(ids);
+        }
+        else{
+            //获取部门下的所有用户
+            CompanyUser usermap=new CompanyUser();
+            usermap.setDeptId(param.getDeptId());
+            List<CompanyUser> users = userService.getUserListByDeptId(usermap);
+            List<Long> userIds = users.stream().map(element -> element.getUserId()).collect(Collectors.toList());
+            param.setUsers(userIds.toArray(new Long[userIds.size()]));
+        }
+        if(param.getUsers()!=null&&param.getUsers().length>0){
+            TimeUtils.TimeEntity timeEntity=TimeUtils.parseTime(param.getType()==null?null:param.getType().toString(),param.getStartTime(),param.getEndTime());
+            timeEntity.setUserIds(param.getUsers());
+            Integer cycleNum = timeEntity.getCycleNum();
+            Integer beginTime = timeEntity.getBeginTime();
+            List<Integer> timeList = new ArrayList<>();
+            for (int i = 1; i <= cycleNum; i++) {
+                timeList.add(beginTime);
+                beginTime = TimeUtils.formatTime(beginTime);
+            }
+            List<JSONObject> jsonObjectList = storeOrderService.selectFsStoreOrderCounts(timeEntity.toMap());
+            List<String> dates = jsonObjectList.stream().map(jsonObject -> jsonObject.getString("type")).collect(Collectors.toList());
+            List<Integer> orderCount = jsonObjectList.stream().map(jsonObject -> jsonObject.getInteger("orderCount")).collect(Collectors.toList());
+            List<Integer> payPrice = jsonObjectList.stream().map(jsonObject -> jsonObject.getInteger("payPrice")).collect(Collectors.toList());
+            //表格数据
+            List<FsStoreOrderCountsVO> tableData = storeOrderService.selectFsStoreOrderCountsByDept(timeEntity.toMap(),param.getDeptId());
+            return R.ok().put("dates",dates).put("orderCount",orderCount).put("payPrice",payPrice).put("tableData",tableData);
+        }
+        else {
+            return R.ok("未查找到数据");
+        }
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:statistics:storeProduct')")
+    @GetMapping("/storeProduct")
+    public R storeProduct(FsStoreStatisticsParam param)
+    {
+        if(StringUtils.isNotEmpty(param.getUserIds())){
+            String[] userIds=param.getUserIds().split(",");
+            Long[] ids=new Long[userIds.length];
+            for(int i=0;i<ids.length; i++){
+                ids[i]=Long.parseLong(userIds[i]);
+            }
+            param.setUsers(ids);
+        }
+        else{
+            //获取部门下的所有用户
+            CompanyUser usermap=new CompanyUser();
+            usermap.setDeptId(param.getDeptId());
+            List<CompanyUser> users = userService.getUserListByDeptId(usermap);
+            List<Long> userIds = users.stream().map(element -> element.getUserId()).collect(Collectors.toList());
+            param.setUsers(userIds.toArray(new Long[userIds.size()]));
+        }
+        if(param.getUsers()!=null&&param.getUsers().length>0){
+            TimeUtils.TimeEntity timeEntity=TimeUtils.parseTime(param.getType()==null?null:param.getType().toString(),param.getStartTime(),param.getEndTime());
+            timeEntity.setUserIds(param.getUsers());
+            Integer cycleNum = timeEntity.getCycleNum();
+            Integer beginTime = timeEntity.getBeginTime();
+            List<Integer> timeList = new ArrayList<>();
+            for (int i = 1; i <= cycleNum; i++) {
+                timeList.add(beginTime);
+                beginTime = TimeUtils.formatTime(beginTime);
+            }
+            List<JSONObject> jsonObjectList = storeOrderService.selectFsStoreOrderCounts(timeEntity.toMap());
+            List<String> dates = jsonObjectList.stream().map(jsonObject -> jsonObject.getString("type")).collect(Collectors.toList());
+            List<Integer> orderCount = jsonObjectList.stream().map(jsonObject -> jsonObject.getInteger("orderCount")).collect(Collectors.toList());
+            List<Integer> payPrice = jsonObjectList.stream().map(jsonObject -> jsonObject.getInteger("payPrice")).collect(Collectors.toList());
+            //表格数据
+            List<FsStoreProductCountsVO> tableData = storeOrderService.selectFsStoreProductCountsByDept(timeEntity.toMap(),param.getDeptId());
+            return R.ok().put("dates",dates).put("orderCount",orderCount).put("payPrice",payPrice).put("tableData",tableData);
+        }
+        else {
+            return R.ok("未查找到数据");
+        }
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:statistics:storePayment')")
+    @GetMapping("/storePayment")
+    public R storePayment(FsStoreStatisticsParam param)
+    {
+        if(StringUtils.isNotEmpty(param.getUserIds())){
+            String[] userIds=param.getUserIds().split(",");
+            Long[] ids=new Long[userIds.length];
+            for(int i=0;i<ids.length; i++){
+                ids[i]=Long.parseLong(userIds[i]);
+            }
+            param.setUsers(ids);
+        }
+        else{
+            //获取部门下的所有用户
+            CompanyUser usermap=new CompanyUser();
+            usermap.setDeptId(param.getDeptId());
+            List<CompanyUser> users = userService.getUserListByDeptId(usermap);
+            List<Long> userIds = users.stream().map(element -> element.getUserId()).collect(Collectors.toList());
+            param.setUsers(userIds.toArray(new Long[userIds.size()]));
+        }
+        if(param.getUsers()!=null&&param.getUsers().length>0){
+
+            TimeUtils.TimeEntity timeEntity=TimeUtils.parseTime(param.getType().toString(),param.getStartTime(),param.getEndTime());
+            timeEntity.setUserIds(param.getUsers());
+            Integer cycleNum = timeEntity.getCycleNum();
+            Integer beginTime = timeEntity.getBeginTime();
+            List<Integer> timeList = new ArrayList<>();
+            for (int i = 1; i <= cycleNum; i++) {
+                timeList.add(beginTime);
+                beginTime = TimeUtils.formatTime(beginTime);
+            }
+            List<JSONObject> jsonObjectList = paymentService.selectFsStorePaymentCounts(timeEntity.toMap());
+            List<String> dates = jsonObjectList.stream().map(jsonObject -> jsonObject.getString("type")).collect(Collectors.toList());
+            List<Integer> orderCount = jsonObjectList.stream().map(jsonObject -> jsonObject.getInteger("orderCount")).collect(Collectors.toList());
+            List<Integer> payMoney = jsonObjectList.stream().map(jsonObject -> jsonObject.getInteger("payMoney")).collect(Collectors.toList());
+            return R.ok().put("dates",dates).put("orderCount",orderCount).put("payMoney",payMoney);
+        }
+        else {
+            return R.ok("未查找到数据");
+        }
+    }
+
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreVisitScrmController.java

@@ -0,0 +1,97 @@
+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.domain.FsStoreVisitScrm;
+import com.fs.hisStore.service.IFsStoreVisitScrmService;
+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 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/storeVisit")
+public class FsStoreVisitScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreVisitScrmService fsStoreVisitService;
+
+    /**
+     * 查询产品浏览分析列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeVisit:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreVisitScrm fsStoreVisit)
+    {
+        startPage();
+        List<FsStoreVisitScrm> list = fsStoreVisitService.selectFsStoreVisitList(fsStoreVisit);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出产品浏览分析列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeVisit:export')")
+    @Log(title = "产品浏览分析", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreVisitScrm fsStoreVisit)
+    {
+        List<FsStoreVisitScrm> list = fsStoreVisitService.selectFsStoreVisitList(fsStoreVisit);
+        ExcelUtil<FsStoreVisitScrm> util = new ExcelUtil<FsStoreVisitScrm>(FsStoreVisitScrm.class);
+        return util.exportExcel(list, "storeVisit");
+    }
+
+    /**
+     * 获取产品浏览分析详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeVisit:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsStoreVisitService.selectFsStoreVisitById(id));
+    }
+
+    /**
+     * 新增产品浏览分析
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeVisit:add')")
+    @Log(title = "产品浏览分析", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreVisitScrm fsStoreVisit)
+    {
+        return toAjax(fsStoreVisitService.insertFsStoreVisit(fsStoreVisit));
+    }
+
+    /**
+     * 修改产品浏览分析
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeVisit:edit')")
+    @Log(title = "产品浏览分析", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreVisitScrm fsStoreVisit)
+    {
+        return toAjax(fsStoreVisitService.updateFsStoreVisit(fsStoreVisit));
+    }
+
+    /**
+     * 删除产品浏览分析
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeVisit:remove')")
+    @Log(title = "产品浏览分析", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsStoreVisitService.deleteFsStoreVisitByIds(ids));
+    }
+}

+ 10 - 0
fs-admin/src/main/resources/pay/alipay.properties

@@ -0,0 +1,10 @@
+alipay.appId=2021003175603885
+alipay.privateKey=MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCQ6KdwrikzvXJOVJGqqD1wqNmnbatbkjguDhzkPYIVYX4A8lDEhcz0mQfJsnTAjebZMgSny8KqvK+8JnePwk+U25ZKxY/78dBmB1m4hxoDYuixULOpBlIU76H2e77KYV2ZUIbUKNrkcZ/fEh10+/u5msVE/67u389dQApIMAWPAjcRALWuJleUpfBSe6RwP/JtRY6C8mhnIXPpd2viEu8Lkxjs37HnWN/9KWfZIvdxrx/PjDu3DKi1kiSS+FWwGeQUwrYOk6yclWseI+A3dohwsvVzd/7X3OmmGph6S1Sv8Luoq7KlZ25uvlFiAYxV2fTyJ1gTRomuqzBG+4l/n9BjAgMBAAECggEAAdt5ifAxhwA+ntJmq5FMeE0xvPui3qGZJr33kNVY/X0qaEiy0FIGtnvfpa4r4OvwsYf6l0v9SsLwXbEAh08uRfIqkvrFRa1rxmMBu2O/6Zsy8FLgeqIiGzKXGNmtMFrfID/v+ngrlhH+wpUw23b/Wvmo3aGJVHZ56fAQMayr5ZFUw0F6FktB0lGQjLw2yS6nwy6GvsCA3KeclP3AQGPxVZC3uuw2oVDkqHBBeHk0L5XA3x8DgeJ73zsWlWRD7dPOrhjiLzFl9WdGQobP2TTNzVH3uolUtxkC4o9I8B6BdARqLDn2yqalF6MzzlOlKTo8/I+htQ8qxcudQzZ+2CjiQQKBgQDDYzrwnk0DPWDp2lThZ8gy/c4dX/RgIH+YndW9DYhDkTH6Bhb+bGKFWL4zods3RIEWZgQWzKTXzm7UhoN6QOu/0xl3l4OIyd9OjTaX9BTm2mT3IB7mHq+7trJgHldZiP325uZr1pH4hJ9FW/tOYKP5sA2fy1ka2+t/tKbjHVJzPQKBgQC93KICFYjWTHw6L/6t4jzyE1co0sOivfRf/ObKNzmv5Qe8RKr4f/vZBHHvuh9SOMd/ZLDKbqzEMJkB4iP/XjGk5SWARTWUVzY21hYBjYthjJ9ZmbrZM8Ys2M2N38edvFJn6fUeZFbCBNm7GbJIqdAgMhB+xnEkKwMGQyqTSgEMHwKBgQCoWxpwNpa5Uevt1LkKuDgi59rwKLwTEC2hvW5sRfrB7ZwYiaLKe22w5LSPHModJyPrvt+LHa50XWXWLkmfz8zTLvxkteMavIdz0e3WpPRVrp0M61p0gsB9iIDOnZY6ifX7Bx5IkUyZzPzH8Ofrsw3XmcFDjR4sLI8RLQIX9C4VKQKBgQCzNCbuVKkdrH+s5FQ8h8gCrWKdM6JYX3bjiu/DejDG5yRP/XhqqVJrWhi4rzKVBua2RbHgwGntm/kvn+VeSegNvgOReMHDzDVtuNB4ksM2Rea6SbHlBUtOVSxfdxMQvQoC7v7futFwu+dPBEgU8cNyQA71uhRckQR/yrHK6BTo/QKBgGyYgL97kQX1CR4LDXVMn2ebhIcadjVCKlZe2v1gtd9HkYh5zqJhtNsFO5HgBB+tW1/EFD+wHeZ+5LcYgNc6fU6gJEvnYG0ezUGfnrNg2oKW22oDE9h2tPap6BYIJboohiY0gq6pgu3wEAwCEwtRjYYNwr4ZDRM9Wq/RlgBalY5S
+alipay.publicKey=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxq6z6GPljO9YCrOptYhWSXO5ts4phovkcVXHc2NBLBq8p1jS/pyQj5k3Oay0lRI3cE7Apl6b/nqMCa1sxg5P/muqNAr6S1wy4X/uvWZwMKK2Woe6OJqfY7DLiRqjpQ4Tp5GIgY5AI7D91hHbQHTRVzKz4SwCwNTHriVuzfXgqnoq6kaQn/EtP0edf1qqb5gdBcK4Z9SgZLLxXMXqiCfUcvkfgjEwDq0HIbX/DdrPvJ9WmoT0uIWTMWk3fx549wnmG0rCxwERldFVJ5Rvn4Q3PzHkt1YITmxigryPMyDfk+U5CHysJ8O2cBtlpNGBRYZyh0Ul+eCcA1zI0fWimZORfQIDAQAB
+alipay.appCertPath=C:/App/cert/alipay/appCertPublicKey_2021002106618710.crt
+alipay.aliPayCertPath=C:/App/cert/alipay/alipayCertPublicKey_RSA2.crt
+alipay.aliPayRootCertPath=C:/App/cert/alipay/alipayRootCert.crt
+alipay.serverUrl=https://openapi.alipay.com/gateway.do
+alipay.domain=https://api.yjf.runtzh.com
+alipay.returnDomain=http://alipay.yjf.runtzh.com
+

+ 8 - 0
fs-admin/src/main/resources/pay/alipay1.properties

@@ -0,0 +1,8 @@
+alipay.appId=2021001183651266
+alipay.privateKey=MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDHxLTvAARsNy8Vx3UAD+N1xc0bME315mB+p7tuhGxqoGgOhFDQ4ozKs/HQ+lRXzzLSkKvZMQqK3GRP4mx4ziihZ8qLSzyxKC6yRVujMd4igq26/POERUlzbAl50SBWGDiVxMJBidtvq0EmoFYGzalix8gD3QhitQGeUl93k1omNDDFP7qQEGhUMA3BHVj4JTwMHT7s5EzZ/189d00OC3atYzF5mcswTYCEJY7WIPDCB9+1Hr63jYufTSlDYkZBwvObxQU7sLlj64gd2u/n/QydunXp1PwZN5aUnTE3MW0Gzx+MeIf7myB3DFfOqTP6mC/sXSVGnbO1Agnfohl6gEQpAgMBAAECggEBAIkV7oe3/lD4iYIrjpmNTazrIPYQbt9YyU0A83lCvFdrXhzgJclCPhV36HBc6HYdhKXEi3kO00o5NUkwevlnl7AzVmXCKpLznR/OwrS5qtMJ1AhmPwG8vkvLjrEelk8ebe4wyJFK9d+qqJnGG2KtzRgxOouUKYX66nJn2oVnA80EeVNJQ3PqMbT2Q6p/sm+BJVb54t9KoPyuXe6MqHr9fWiUoJ47bE/JgqQg9pSs9lHRvqWcCIBnUY+Y4ZuE1HsFWg+mtLt+qFktFO+3xbj0jhrbzqsVR/pjHq6wxumidA9yaSMEvRqECi7x6VTH7OquOYMNCZW5Fdw+KMg9mvrx+lECgYEA/IcvtH62bQxHg9uOuuNFFPGeyuhYJk950PDdWmBKXOIfLNm1PL6UcY8vSP4rWpk4VrXdt0bt9suME+zmXWwymFwESKl0Kmcy1c3hsFBKnJApfxbULzDUFXGbMd/0WqPBibx98iLxpdlHxREg/vcuOB+ZUIPI7px5dNkgL5JfR70CgYEAyoPS+ahUmr/57kaxt3TpsDDIotvVT+k3hD3MSmBZu2AXPcPFapqydWdBHHfhq1GnEN7QvfYQOgBRF3+l9WRuKBefmu8sLsPzHbLoVBBK594yBmBQmy6C+g83/zOqTxK57YLk9abtc9Y6ssXQGkR2/DRCYm1CtqQmB/fElKlPDt0CgYBnJYzNy+gVuKtJZ5fwLD6eZGb4+FhxJYtbVdcEQEp/j/kt56sIqcuWaubkiLUKp4UEnfp3DyjJ4rBPvzcFN9metA8n4tdJLqfr/tFNpC4lrxjUCW4X7HjkXWgHwjNcBoFaEjzbd3x+wrZ2/x0cJ7igQf/sjDe5hv5xRPLJm58BfQKBgF+iky4tDQ8rW7bnkaNmRblbwFQQZpLfOsVrfZ8eEyIGhdM4MXFfbqk8wqXUAzEpVTEFWCRtIEqTvbfQIypYbCDozwmWqxHGnXfH9ilErGsFJjCWqVovQ9EdAL+2wVWoLT95kfBkDTynzX6BJf5RmLMPZs4edOPVbtRScHYX4mrNAoGBAMVkGQuSIM4Mf/bMvEqPMc9GpYJ6tA6BqBsLY9yyXnArHaR9dGvKmN59+JmxM9sYCXunhtyLu83bkB2XtfIUGj8TYJxWUxvAwcx8JAE5qb6E5oStKbxb0hKh5CG59gqFlAVpcqMIwpeCDQhBin5AlMTgrmV8S6gTBp0efHTn9G4N
+alipay.publicKey=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArqkO4WGHLHufhdMMOsckp964jUWNncwY9r4XB2HVEeHIDOcThp61/TJXGKxmQctAQ9CDNK1aP4SPWHd3rItN8HIX1Fo+oXsDkHrlRqh5p2DOdvmsaGbceyCT/OF4nX+km/WJ9TXBQ3SaI5h8xqESeX0srs0j7QjXafGQrprO2wlih84Ri2FbaDIJvlReZcJZLpxlYBKGXfepp1wvBEMmHH66JArWZ2w03zaFODW7vbEZZplKOZMijPE0V2SUsqwqqbPajKaO3cXf/pE9bzIGi9VLcpr0cWSkzdEUF0yQ1w/dxkdfMdgyurSb7CpuYU7/QEHWNJp5w5euGySDS1U4xQIDAQAB
+alipay.appCertPath=
+alipay.aliPayCertPath=
+alipay.aliPayRootCertPath=
+alipay.serverUrl=https://openapi.alipay.com/gateway.do
+alipay.domain=http://http://api.qinpeilian.com/

BIN
fs-admin/src/main/resources/pay/cert/apiclient_cert.p12


+ 26 - 0
fs-admin/src/main/resources/pay/cert/apiclient_cert.pem

@@ -0,0 +1,26 @@
+-----BEGIN CERTIFICATE-----
+MIIEazCCA9SgAwIBAgIDPfFVMA0GCSqGSIb3DQEBBQUAMIGKMQswCQYDVQQGEwJD
+TjESMBAGA1UECBMJR3Vhbmdkb25nMREwDwYDVQQHEwhTaGVuemhlbjEQMA4GA1UE
+ChMHVGVuY2VudDEMMAoGA1UECxMDV1hHMRMwEQYDVQQDEwpNbXBheW1jaENBMR8w
+HQYJKoZIhvcNAQkBFhBtbXBheW1jaEB0ZW5jZW50MB4XDTE2MDgyMjEwMDAyN1oX
+DTI2MDgyMDEwMDAyN1owgZsxCzAJBgNVBAYTAkNOMRIwEAYDVQQIEwlHdWFuZ2Rv
+bmcxETAPBgNVBAcTCFNoZW56aGVuMRAwDgYDVQQKEwdUZW5jZW50MQ4wDAYDVQQL
+EwVNTVBheTEwMC4GA1UEAxQn5YyX5Lqs5b+r5a6i5pyN56eR5oqA5Y+R5bGV5pyJ
+6ZmQ5YWs5Y+4MREwDwYDVQQEEwgxMzk5MzgzMjCCASIwDQYJKoZIhvcNAQEBBQAD
+ggEPADCCAQoCggEBAMRbFxBzC0GQ14Hxh4Uspdt3B7mQSAsa2hLvqWYsPYXbQ9Rh
+Jb/pdUOF9zwh4i9CTrWLqSazgs7Rqf7EEyhdT08KDQbF9uDRHW3m/XSGb8XyQKX0
+yu8yEUDH6SvUGQQ3U4DOOsHooa9jTIZeohAtwe9+GQX2WjRzjr3RlW2DIyTGwjYi
+QB5CU1uivt+tfEDW+wP4gjnWecShYPfeK1uIybinFzmy4tUGGuNl7N9H4IrMi2TT
+BpqMGbEukoDjzYv4h23MPuh6f1AHGpsI39BJJs8TjYeccMIrOqzXSv1bcRVsH+FZ
+4AkYhgeCt6MudedjGy5J9IEU957esxmXtSuDt10CAwEAAaOCAUYwggFCMAkGA1Ud
+EwQCMAAwLAYJYIZIAYb4QgENBB8WHSJDRVMtQ0EgR2VuZXJhdGUgQ2VydGlmaWNh
+dGUiMB0GA1UdDgQWBBTOrb+vqp/rqP6DZntwZEmzL+ickTCBvwYDVR0jBIG3MIG0
+gBQ+BSb2ImK0FVuIzWR+sNRip+WGdKGBkKSBjTCBijELMAkGA1UEBhMCQ04xEjAQ
+BgNVBAgTCUd1YW5nZG9uZzERMA8GA1UEBxMIU2hlbnpoZW4xEDAOBgNVBAoTB1Rl
+bmNlbnQxDDAKBgNVBAsTA1dYRzETMBEGA1UEAxMKTW1wYXltY2hDQTEfMB0GCSqG
+SIb3DQEJARYQbW1wYXltY2hAdGVuY2VudIIJALtUlyu8AOhXMA4GA1UdDwEB/wQE
+AwIGwDAWBgNVHSUBAf8EDDAKBggrBgEFBQcDAjANBgkqhkiG9w0BAQUFAAOBgQBC
+n8MEDVIVlyC2jkRfy4UezLlbnGTkYb+Nb4oMZRvIjNTFzqQ+6SOPKEqlU0FOZwuI
+pr+pDG+H484PQjt6b8ftUOBuKKeaMDMauRz2jqXJkKWcDa4U/CJ+/CboolU4T0xO
+Lp+zNqa7epBvU3HQtX4MEzZEnI5auPVde9nsJbo2QA==
+-----END CERTIFICATE-----

+ 28 - 0
fs-admin/src/main/resources/pay/cert/apiclient_key.pem

@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDEWxcQcwtBkNeB
+8YeFLKXbdwe5kEgLGtoS76lmLD2F20PUYSW/6XVDhfc8IeIvQk61i6kms4LO0an+
+xBMoXU9PCg0Gxfbg0R1t5v10hm/F8kCl9MrvMhFAx+kr1BkEN1OAzjrB6KGvY0yG
+XqIQLcHvfhkF9lo0c4690ZVtgyMkxsI2IkAeQlNbor7frXxA1vsD+II51nnEoWD3
+3itbiMm4pxc5suLVBhrjZezfR+CKzItk0waajBmxLpKA482L+IdtzD7oen9QBxqb
+CN/QSSbPE42HnHDCKzqs10r9W3EVbB/hWeAJGIYHgrejLnXnYxsuSfSBFPee3rMZ
+l7Urg7ddAgMBAAECggEAZt2FhrOOOQoFLGj44xaRyRhhbqAcbdziU7tEFmekz2Qf
+87n1CcXnDbm33MOvd6yYCVmiAslWBL0n/nR/yMyhSLnuOxcoj3xdm37AVvQ6yAty
+PL6yNX8YNMTF7ZUOifvl/fuMIpuZYIV3yIj5A9rE149K0qnNdd73749FZfqmRZQD
+rwh4Xh8M+mj8CulpGsjwKVfUrCWsXaVh9pL7XNMYXBRnGdrCFOs7uPjAUcOZlXjx
+LboQqjmVbveeGJ2lptRjDu5y934T7msQPugss/aCZAbaNN1RklBGJ3FtxgRAQ8z5
+zKCaWzDFyXGWENY/+ZHai9pHK2QS0IPhb+qV/qiYzQKBgQDgaWNOqb14QwbwshFr
+C3Ib5s2XqhTFBTxrtJceWUZZiHDL3Z5ecSPSeBREpxLn/miVIXBc/zyGGF5E2SPB
+zPuj9xrtI8HlxETZG4NuUbgqfFdPUKwroAPMvhqM7ZaanYqRiVTkvmVHtuL4aFk3
+LCKuhjHiSkW2ZaKlgqAkdcGGAwKBgQDf/renwmIC7Lh6sJewsRKe3h3UhzG0XW8t
+HIbx7b5cqKRTrdkPeBLN4w64D37kEK9mmoLsYkZuHA2YJndDGyu6+R2tI69s3vyr
+8hfJBDK0WaVEps2BUQ5KXDrbquYVbBGA6Q7anpVhekXILKBQRxUd7UaRqTvCL04R
+bH7NZzN/HwKBgE5j4gG/f2T8HPeFbFo1NFYUyKp7CihMjO+etM8wJkfuRmCgeMrK
+wNWrhoD4z7zkfMnjVWnW6uB4sK1iIIB5R0nebrR5sii958LjPoUR3MBSkPku2AWh
+LtKdcY7bC6nU8GuoSlRhQeXMN/rIEKoaK79FNzWx9ioh1K/2MlSqIcDbAoGADBQi
+NyumOV4mfIc1RtPlmyeDGEjKB13aduZI6JbXYwu9AL4pLEpfSTbrPkWnpAi6TKAc
+Wz7ZaWqd2QyJ9dZrP0Pbs9Buz0IfAe6mFbLiQRNsdA1Cm6yRRrU+f0Xx7knLj9YB
+dQyEJaOAS9EMPAf5PYnj+krT7B686Peexti/0CUCgYB9uACIaTlN0XQvoXuFktv4
+4xqyOLCfTZW38e1UJ4bqyOJUP0EKfo/03j8Lp/vsZmCK2bIdudG+4rZbuiQXOe31
+cfGo7dQhCorOlrUig0CWwq8oXPbKmvOO7K+UGnK5e46BUbopxU1dTwhxAUA6hbcb
+mFh3iSvhn4JJG2ddomXY3A==
+-----END PRIVATE KEY-----

+ 18 - 0
fs-admin/src/main/resources/pay/cert/证书使用说明.txt

@@ -0,0 +1,18 @@
+欢迎使用微信支付!
+附件中的三份文件(证书pkcs12格式、证书pem格式、证书密钥pem格式),为接口中强制要求时需携带的证书文件。
+证书属于敏感信息,请妥善保管不要泄露和被他人复制。
+不同开发语言下的证书格式不同,以下为说明指引:
+    证书pkcs12格式(apiclient_cert.p12)
+        包含了私钥信息的证书文件,为p12(pfx)格式,由微信支付签发给您用来标识和界定您的身份
+        部分安全性要求较高的API需要使用该证书来确认您的调用身份
+        windows上可以直接双击导入系统,导入过程中会提示输入证书密码,证书密码默认为您的商户ID(如:10010000)
+    证书pem格式(apiclient_cert.pem)
+        从apiclient_cert.p12中导出证书部分的文件,为pem格式,请妥善保管不要泄漏和被他人复制
+        部分开发语言和环境,不能直接使用p12文件,而需要使用pem,所以为了方便您使用,已为您直接提供
+        您也可以使用openssl命令来自己导出:openssl pkcs12 -clcerts -nokeys -in apiclient_cert.p12 -out apiclient_cert.pem
+    证书密钥pem格式(apiclient_key.pem)
+        从apiclient_cert.p12中导出密钥部分的文件,为pem格式
+        部分开发语言和环境,不能直接使用p12文件,而需要使用pem,所以为了方便您使用,已为您直接提供
+        您也可以使用openssl命令来自己导出:openssl pkcs12 -nocerts -in apiclient_cert.p12 -out apiclient_key.pem
+备注说明:  
+        由于绝大部分操作系统已内置了微信支付服务器证书的根CA证书,  2018年3月6日后, 不再提供CA证书文件(rootca.pem)下载 

+ 8 - 0
fs-admin/src/main/resources/pay/wxpay.properties

@@ -0,0 +1,8 @@
+wxpay.appId=wxbe53e91d9ad11ca6
+wxpay.appSecret=58d70c9be43047ef3275339a3f4b5ee0
+wxpay.mchId=1581878681
+wxpay.partnerKey=8cab128997a3547c1363b0898b877f38
+wxpay.certPath=pay/cert/apiclient_cert.p12
+wxpay.domain= https://api.hospital.ifeiyu100.com
+
+

+ 9 - 0
fs-admin/src/main/resources/pay/wxpay_v3.properties

@@ -0,0 +1,9 @@
+v3.appId=\u5E94\u7528\u7F16\u53F7
+v3.keyPath=key.pem
+v3.certPath=cert.pem
+v3.certP12Path=cert.p12
+v3.platformCertPath=wx_cert.pem
+v3.mchId=\u5FAE\u4FE1\u5546\u6237\u53F7
+v3.apiKey3= Api-v3 \u5BC6\u94A5
+v3.apiKey= Api \u5BC6\u94A5
+v3.domain=  http://qbhdat.natappfree.cc

+ 14 - 0
fs-common/src/main/java/com/fs/common/config/FSConfig.java

@@ -34,6 +34,12 @@ public class FSConfig
 
     private static String h5CommonApi;
 
+    private String url;
+
+    public String getUrl() {
+        return url;
+    }
+
     public static String getH5CommonApi() {
         return h5CommonApi;
     }
@@ -153,4 +159,12 @@ public class FSConfig
     {
         return getProfile() + "/qr";
     }
+
+    /**
+     * 获取用户推广海报地址
+     */
+    public static String getTuiImgPath()
+    {
+        return getProfile() + "/tui";
+    }
 }

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

@@ -0,0 +1,304 @@
+package com.fs.common.config;
+
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * 读取项目相关配置
+ *
+ */
+@Component
+@ConfigurationProperties(prefix = "fs-config")
+public class FSSysConfig
+{
+    //快递鸟
+    String kdnId;
+    String kdnKeyId;
+    String kdnUrl;
+    String kdnSubscribeUrl;
+    String kdnAddressUrl;
+    //腾讯云IM
+    Long sdkAppId;
+    String sdkAppKey;
+    //处方接口
+    String prescribeUrl;
+    String actId;
+    String appId;
+    String manuId;
+    String callbackUrl;
+    //erp接口
+//    Integer erpOpen;//是否开启ERP
+//    String erpAppKey;
+//    String erpSessionKey;
+//    String erpSecret;
+//    String erpUrl;
+//    String erpShopCode;//店铺CODE
+    //支付接口
+    Integer payOpen;//是否开启
+    String payPartnerId;
+    String payKey;
+    String payGateWayUrl;
+    String payNotifyUrl;
+    String refundNotifyUrl;
+    //金博erp
+//    private String kingbosan;//账套名称
+//    private String kingbosSecret;//金博密钥
+//    private String kingbosUrl;//金博地址
+//    private String corgid;//机构编码
+//    private String cwarehouseCode;
+//    private String cwarehouseName;
+
+
+
+    String commonApi;
+
+    public String getKdnId() {
+        return kdnId;
+    }
+
+    public void setKdnId(String kdnId) {
+        this.kdnId = kdnId;
+    }
+
+    public String getKdnKeyId() {
+        return kdnKeyId;
+    }
+
+    public void setKdnKeyId(String kdnKeyId) {
+        this.kdnKeyId = kdnKeyId;
+    }
+
+    public String getKdnUrl() {
+        return kdnUrl;
+    }
+
+    public void setKdnUrl(String kdnUrl) {
+        this.kdnUrl = kdnUrl;
+    }
+
+    public String getKdnSubscribeUrl() {
+        return kdnSubscribeUrl;
+    }
+
+    public void setKdnSubscribeUrl(String kdnSubscribeUrl) {
+        this.kdnSubscribeUrl = kdnSubscribeUrl;
+    }
+
+    public String getKdnAddressUrl() {
+        return kdnAddressUrl;
+    }
+
+    public void setKdnAddressUrl(String kdnAddressUrl) {
+        this.kdnAddressUrl = kdnAddressUrl;
+    }
+
+    public Long getSdkAppId() {
+        return sdkAppId;
+    }
+
+    public void setSdkAppId(Long sdkAppId) {
+        this.sdkAppId = sdkAppId;
+    }
+
+    public String getSdkAppKey() {
+        return sdkAppKey;
+    }
+
+    public void setSdkAppKey(String sdkAppKey) {
+        this.sdkAppKey = sdkAppKey;
+    }
+
+    public String getPrescribeUrl() {
+        return prescribeUrl;
+    }
+
+    public void setPrescribeUrl(String prescribeUrl) {
+        this.prescribeUrl = prescribeUrl;
+    }
+
+    public String getActId() {
+        return actId;
+    }
+
+    public void setActId(String actId) {
+        this.actId = actId;
+    }
+
+    public String getAppId() {
+        return appId;
+    }
+
+    public void setAppId(String appId) {
+        this.appId = appId;
+    }
+
+    public String getManuId() {
+        return manuId;
+    }
+
+    public void setManuId(String manuId) {
+        this.manuId = manuId;
+    }
+
+    public String getCallbackUrl() {
+        return callbackUrl;
+    }
+
+    public void setCallbackUrl(String callbackUrl) {
+        this.callbackUrl = callbackUrl;
+    }
+
+//    public Integer getErpOpen() {
+//        return erpOpen;
+//    }
+//
+//    public void setErpOpen(Integer erpOpen) {
+//        this.erpOpen = erpOpen;
+//    }
+//
+//    public String getErpAppKey() {
+//        return erpAppKey;
+//    }
+//
+//    public void setErpAppKey(String erpAppKey) {
+//        this.erpAppKey = erpAppKey;
+//    }
+//
+//    public String getErpSessionKey() {
+//        return erpSessionKey;
+//    }
+//
+//    public void setErpSessionKey(String erpSessionKey) {
+//        this.erpSessionKey = erpSessionKey;
+//    }
+//
+//    public String getErpSecret() {
+//        return erpSecret;
+//    }
+//
+//    public void setErpSecret(String erpSecret) {
+//        this.erpSecret = erpSecret;
+//    }
+//
+//    public String getErpUrl() {
+//        return erpUrl;
+//    }
+//
+//    public void setErpUrl(String erpUrl) {
+//        this.erpUrl = erpUrl;
+//    }
+//
+//    public String getErpShopCode() {
+//        return erpShopCode;
+//    }
+//
+//    public void setErpShopCode(String erpShopCode) {
+//        this.erpShopCode = erpShopCode;
+//    }
+
+    public Integer getPayOpen() {
+        return payOpen;
+    }
+
+    public void setPayOpen(Integer payOpen) {
+        this.payOpen = payOpen;
+    }
+
+    public String getPayPartnerId() {
+        return payPartnerId;
+    }
+
+    public void setPayPartnerId(String payPartnerId) {
+        this.payPartnerId = payPartnerId;
+    }
+
+    public String getPayKey() {
+        return payKey;
+    }
+
+    public void setPayKey(String payKey) {
+        this.payKey = payKey;
+    }
+
+    public String getPayGateWayUrl() {
+        return payGateWayUrl;
+    }
+
+    public void setPayGateWayUrl(String payGateWayUrl) {
+        this.payGateWayUrl = payGateWayUrl;
+    }
+
+    public String getPayNotifyUrl() {
+        return payNotifyUrl;
+    }
+
+    public void setPayNotifyUrl(String payNotifyUrl) {
+        this.payNotifyUrl = payNotifyUrl;
+    }
+
+    public String getRefundNotifyUrl() {
+        return refundNotifyUrl;
+    }
+
+    public void setRefundNotifyUrl(String refundNotifyUrl) {
+        this.refundNotifyUrl = refundNotifyUrl;
+    }
+
+//    public String getKingbosan() {
+//        return kingbosan;
+//    }
+//
+//    public void setKingbosan(String kingbosan) {
+//        this.kingbosan = kingbosan;
+//    }
+//
+//    public String getCorgid() {
+//        return corgid;
+//    }
+//
+//    public void setCorgid(String corgid) {
+//        this.corgid = corgid;
+//    }
+//
+//    public String getKingbosUrl() {
+//        return kingbosUrl;
+//    }
+//
+//    public void setKingbosUrl(String kingbosUrl) {
+//        this.kingbosUrl = kingbosUrl;
+//    }
+//
+//    public String getKingbosSecret() {
+//        return kingbosSecret;
+//    }
+//
+//    public void setKingbosSecret(String kingbosSecret) {
+//        this.kingbosSecret = kingbosSecret;
+//    }
+//
+//    public String getCwarehouseCode() {
+//        return cwarehouseCode;
+//    }
+//
+//    public void setCwarehouseCode(String cwarehouseCode) {
+//        this.cwarehouseCode = cwarehouseCode;
+//    }
+//
+//    public String getCwarehouseName() {
+//        return cwarehouseName;
+//    }
+//
+//    public void setCwarehouseName(String cwarehouseName) {
+//        this.cwarehouseName = cwarehouseName;
+//    }
+
+    public String getCommonApi() {
+        return commonApi;
+    }
+
+    public void setCommonApi(String commonApi) {
+        this.commonApi = commonApi;
+    }
+
+}

+ 35 - 0
fs-common/src/main/java/com/fs/common/utils/http/HttpUtils.java

@@ -16,6 +16,14 @@ import javax.net.ssl.SSLContext;
 import javax.net.ssl.SSLSession;
 import javax.net.ssl.TrustManager;
 import javax.net.ssl.X509TrustManager;
+
+import org.apache.http.HttpResponse;
+import org.apache.http.HttpStatus;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.util.EntityUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import com.fs.common.constant.Constants;
@@ -177,6 +185,33 @@ public class HttpUtils
         return result.toString();
     }
 
+    /**
+     * json request
+     *
+     * @param url
+     * @param json
+     * @return
+     */
+    public static String doPost(String url, String json) {
+        CloseableHttpClient httpclient = HttpClientBuilder.create().build();
+        HttpPost post = new HttpPost(url);
+        String response = null;
+        try {
+            StringEntity s = new StringEntity(json,"UTF-8");
+//			s.setContentEncoding("UTF-8");
+            // 发送json数据需要设置contentType
+            s.setContentType("application/json");
+            post.setEntity(s);
+            HttpResponse res = httpclient.execute(post);
+            if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
+                response = EntityUtils.toString(res.getEntity());// 返回json格式:
+            }
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+        return response;
+    }
+
     public static String sendSSLPost(String url, String param)
     {
         StringBuilder result = new StringBuilder();

+ 59 - 0
fs-company/src/main/java/com/fs/hisStore/controller/FsCityScrmController.java

@@ -0,0 +1,59 @@
+package com.fs.hisStore.controller;
+
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.R;
+import com.fs.hisStore.domain.FsCityScrm;
+import com.fs.hisStore.service.IFsCityScrmService;
+import com.fs.store.utils.CityTreeUtil;
+import com.fs.store.vo.CityVO;
+import com.google.common.collect.Lists;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import springfox.documentation.annotations.Cacheable;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+
+/**
+ * 城市Controller
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/city")
+public class FsCityScrmController extends BaseController
+{
+    @Autowired
+    private IFsCityScrmService fsCityService;
+
+//
+//    @GetMapping("/getAllList")
+//    @Cacheable("citys")
+//    public R getAllList(FsCityScrm fsCity)
+//    {
+//        List<FsCityScrm> list = fsCityService.selectFsCityList(fsCity);
+//        return R.ok().put("data",list);
+//    }
+
+
+    @ApiOperation("获取城市数据")
+    @GetMapping("/getCitys")
+    @Cacheable("citys")
+    public R getCitys(HttpServletRequest request){
+        List<FsCityScrm> list=fsCityService.selectFsCitys();
+        List<CityVO> cityVOS = Lists.newArrayList();
+        for (FsCityScrm city : list){
+            CityVO cityVO = new CityVO();
+            cityVO.setValue(Long.parseLong(city.getCityId()));
+            cityVO.setLabel(city.getCityName());
+            cityVO.setPid(Long.parseLong(city.getParentId()));
+            cityVOS.add(cityVO);
+        }
+        return R.ok().put("data", CityTreeUtil.list2TreeConverter(cityVOS, 0));
+
+    }
+}

+ 156 - 0
fs-company/src/main/java/com/fs/hisStore/controller/FsStoreAfterSalesScrmController.java

@@ -0,0 +1,156 @@
+package com.fs.hisStore.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.ParseUtils;
+import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.company.service.ICompanyService;
+import com.fs.company.service.ICompanyUserService;
+import com.fs.framework.security.LoginUser;
+import com.fs.framework.service.TokenService;
+import com.fs.his.domain.FsUser;
+import com.fs.his.service.IFsUserService;
+import com.fs.hisStore.domain.FsStoreAfterSalesItemScrm;
+import com.fs.hisStore.domain.FsStoreAfterSalesScrm;
+import com.fs.hisStore.domain.FsStoreAfterSalesStatusScrm;
+import com.fs.hisStore.domain.FsStoreOrderScrm;
+import com.fs.hisStore.service.IFsStoreAfterSalesItemScrmService;
+import com.fs.hisStore.service.IFsStoreAfterSalesScrmService;
+import com.fs.hisStore.service.IFsStoreAfterSalesStatusScrmService;
+import com.fs.hisStore.service.IFsStoreOrderScrmService;
+import com.fs.hisStore.vo.FsStoreAfterSalesVO;
+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 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/storeAfterSales")
+public class FsStoreAfterSalesScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreOrderScrmService fsStoreOrderService;
+    @Autowired
+    private TokenService tokenService;
+    @Autowired
+    private IFsUserService userService;
+    @Autowired
+    private IFsStoreAfterSalesScrmService fsStoreAfterSalesService;
+    @Autowired
+    private IFsStoreAfterSalesItemScrmService fsStoreAfterSalesItemService;
+    @Autowired
+    private IFsStoreAfterSalesStatusScrmService storeAfterSalesStatusService;
+    @Autowired
+    private ICompanyUserService companyUserService;
+    @Autowired
+    private ICompanyService companyService;
+
+
+    /**
+     * 查询售后记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSales:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreAfterSalesScrm fsStoreAfterSales)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fsStoreAfterSales.setCompanyId(loginUser.getCompany().getCompanyId());
+        startPage();
+        List<FsStoreAfterSalesVO> list = fsStoreAfterSalesService.selectFsStoreAfterSalesListVO(fsStoreAfterSales);
+        for (FsStoreAfterSalesVO vo : list){
+            vo.setUserPhone(ParseUtils.parsePhone(vo.getUserPhone()));
+        }
+        return getDataTable(list);
+    }
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSales:myList')")
+    @GetMapping("/myList")
+    public TableDataInfo myList(FsStoreAfterSalesScrm fsStoreAfterSales)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fsStoreAfterSales.setCompanyId(loginUser.getCompany().getCompanyId());
+        fsStoreAfterSales.setCompanyUserId(loginUser.getUser().getUserId());
+        startPage();
+        List<FsStoreAfterSalesVO> list = fsStoreAfterSalesService.selectFsStoreAfterSalesListVO(fsStoreAfterSales);
+        for (FsStoreAfterSalesVO vo : list){
+            vo.setUserPhone(ParseUtils.parsePhone(vo.getUserPhone()));
+        }
+        return getDataTable(list);
+    }
+
+
+    /**
+     * 导出售后记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSales:export')")
+    @Log(title = "售后记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreAfterSalesScrm fsStoreAfterSales)
+    {
+        if (fsStoreAfterSales.getBeginTime().equals("") && fsStoreAfterSales.getEndTime().equals("")){
+            fsStoreAfterSales.setBeginTime(null);
+            fsStoreAfterSales.setEndTime(null);
+        }
+        if (fsStoreAfterSalesService.isEntityNull(fsStoreAfterSales)){
+            return AjaxResult.error("请筛选数据导出");
+        }
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fsStoreAfterSales.setCompanyId(loginUser.getCompany().getCompanyId());
+        List<FsStoreAfterSalesVO> list = fsStoreAfterSalesService.selectFsStoreAfterSalesListVO(fsStoreAfterSales);
+        for (FsStoreAfterSalesVO vo : list){
+            vo.setUserPhone(ParseUtils.parsePhone(vo.getUserPhone()));
+        }
+        ExcelUtil<FsStoreAfterSalesVO> util = new ExcelUtil<FsStoreAfterSalesVO>(FsStoreAfterSalesVO.class);
+        return util.exportExcel(list, "storeAfterSales");
+    }
+
+    /**
+     * 获取售后记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSales:query')")
+    @GetMapping(value = "/{id}")
+    public R getInfo(@PathVariable("id") Long id)
+    {
+        FsStoreAfterSalesScrm afterSales=fsStoreAfterSalesService.selectFsStoreAfterSalesById(id);
+        FsStoreAfterSalesItemScrm map=new FsStoreAfterSalesItemScrm();
+        map.setStoreAfterSalesId(id);
+        List<FsStoreAfterSalesItemScrm> items=fsStoreAfterSalesItemService.selectFsStoreAfterSalesItemList(map);
+        FsStoreAfterSalesStatusScrm statusMap=new FsStoreAfterSalesStatusScrm();
+        statusMap.setStoreAfterSalesId(id);
+        List<FsStoreAfterSalesStatusScrm> logs=storeAfterSalesStatusService.selectFsStoreAfterSalesStatusList(statusMap);
+        FsUser user=userService.selectFsUserById(afterSales.getUserId());
+        user.setPhone(ParseUtils.parsePhone(user.getPhone()));
+        FsStoreOrderScrm order=fsStoreOrderService.selectFsStoreOrderByOrderCode(afterSales.getOrderCode());
+        return R.ok().put("afterSales",afterSales).put("items",items).put("logs",logs).put("user",user).put("order",order);
+    }
+
+    /**
+     * 修改售后记录
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSales:edit')")
+    @Log(title = "售后记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreAfterSalesScrm fsStoreAfterSales)
+    {
+        if ((!"".equals(fsStoreAfterSales.getDeliveryName()) && !"".equals(fsStoreAfterSales.getDeliverySn())) || (fsStoreAfterSales.getDeliveryName() == null && fsStoreAfterSales.getDeliverySn() == null)){
+            fsStoreAfterSales.setStatus(2);
+        }
+        return toAjax(fsStoreAfterSalesService.updateFsStoreAfterSales(fsStoreAfterSales));
+    }
+
+
+
+
+
+}

+ 43 - 0
fs-company/src/main/java/com/fs/hisStore/controller/FsStoreOrderAuditScrmController.java

@@ -0,0 +1,43 @@
+package com.fs.hisStore.controller;
+
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.company.domain.CompanyUser;
+import com.fs.framework.security.SecurityUtils;
+import com.fs.hisStore.param.FsStoreOrderAuditParam;
+import com.fs.hisStore.param.FsStoreOrderAuditReviewParam;
+import com.fs.hisStore.service.IFsStoreOrderAuditScrmService;
+import com.fs.hisStore.vo.FsStoreOrderAuditVO;
+import lombok.AllArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.List;
+
+@RestController
+@RequestMapping("/store/store/storeOrderAudit")
+@AllArgsConstructor
+public class FsStoreOrderAuditScrmController extends BaseController {
+
+    private final IFsStoreOrderAuditScrmService fsStoreOrderAuditService;
+
+    @PreAuthorize("@ss.hasAnyPermi('store:storeOrderAudit:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreOrderAuditParam param) {
+        startPage();
+        CompanyUser user = SecurityUtils.getLoginUser().getUser();
+        param.setCompanyId(user.getCompanyId());
+        List<FsStoreOrderAuditVO> list = fsStoreOrderAuditService.selectStoreOrderAuditVOList(param);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasAnyPermi('store:storeOrderAudit:audit')")
+    @PostMapping("/audit")
+    public AjaxResult audit(@Valid @RequestBody FsStoreOrderAuditReviewParam param) {
+        CompanyUser user = SecurityUtils.getLoginUser().getUser();
+        fsStoreOrderAuditService.audit(param, user.getUserId(), false);
+        return AjaxResult.success();
+    }
+}

+ 169 - 0
fs-company/src/main/java/com/fs/hisStore/controller/FsStoreOrderOfflineScrmController.java

@@ -0,0 +1,169 @@
+package com.fs.hisStore.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.ParseUtils;
+import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.crm.domain.CrmCustomer;
+import com.fs.crm.service.ICrmCustomerService;
+import com.fs.framework.security.LoginUser;
+import com.fs.framework.service.TokenService;
+import com.fs.hisStore.domain.*;
+import com.fs.hisStore.param.FsStoreOrderOfflineCreateParam;
+import com.fs.hisStore.param.FsStoreOrderOfflineParam;
+import com.fs.hisStore.service.IFsStoreOrderOfflineItemScrmService;
+import com.fs.hisStore.service.IFsStoreOrderOfflineScrmService;
+import com.fs.hisStore.vo.FsStoreOrderOfflineListVO;
+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 2024-10-29
+ */
+@RestController
+@RequestMapping("/store/store/storeOrderOffline")
+public class FsStoreOrderOfflineScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreOrderOfflineScrmService fsStoreOrderOfflineService;
+    @Autowired
+    private IFsStoreOrderOfflineItemScrmService fsStoreOrderOfflineItemService;
+    @Autowired
+    private TokenService tokenService;
+    @Autowired
+    private ICrmCustomerService crmCustomerService;
+
+    /**
+     * 查询线下订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderOffline:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreOrderOfflineParam param)
+    {
+        startPage();
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        List<FsStoreOrderOfflineListVO> list = fsStoreOrderOfflineService.selectFsStoreOrderOfflineListVO(param);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeOrderOffline:list')")
+    @GetMapping("/myList")
+    public TableDataInfo myList(FsStoreOrderOfflineParam param)
+    {
+        startPage();
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        param.setCompanyUserId(loginUser.getUser().getUserId());
+        List<FsStoreOrderOfflineListVO> list = fsStoreOrderOfflineService.selectFsStoreOrderOfflineListVO(param);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出线下订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderOffline:export')")
+    @Log(title = "线下订单", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreOrderOfflineScrm fsStoreOrderOffline)
+    {
+        List<FsStoreOrderOfflineScrm> list = fsStoreOrderOfflineService.selectFsStoreOrderOfflineList(fsStoreOrderOffline);
+        ExcelUtil<FsStoreOrderOfflineScrm> util = new ExcelUtil<FsStoreOrderOfflineScrm>(FsStoreOrderOfflineScrm.class);
+        return util.exportExcel(list, "storeOrderOffline");
+    }
+
+    /**
+     * 获取线下订单详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderOffline:query')")
+    @GetMapping(value = "/{orderId}")
+    public R getInfo(@PathVariable("orderId") Long orderId)
+    {
+
+        FsStoreOrderOfflineListVO order=fsStoreOrderOfflineService.selectFsStoreOrderOfflineVOById(orderId);
+        order.setMobile(ParseUtils.parsePhone(order.getMobile()));
+        CrmCustomer customer=null;
+        if(order.getCrmId()!=null&&order.getCrmId()>0){
+            customer=crmCustomerService.selectCrmCustomerById(order.getCrmId());
+            customer.setMobile(ParseUtils.parsePhone(customer.getMobile()));
+        }
+        FsStoreOrderOfflineItemScrm itemMap=new FsStoreOrderOfflineItemScrm();
+        itemMap.setOrderId(order.getOrderId());
+        List<FsStoreOrderOfflineItemScrm> items=fsStoreOrderOfflineItemService.selectFsStoreOrderOfflineItemList(itemMap);
+        return R.ok().put("order", order).put("items", items).put("customer",customer) ;
+    }
+
+
+    @GetMapping(value = "/queryPhone/{orderId}")
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:queryPhone')")
+    @Log(title = "查看电话", businessType = BusinessType.GRANT)
+    public R getPhone(@PathVariable("orderId") Long orderId)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        if (loginUser.getUser().getUserType().equals("00")){
+            FsStoreOrderOfflineListVO order=fsStoreOrderOfflineService.selectFsStoreOrderOfflineVOById(orderId);
+            String userPhone = order.getMobile();
+            return R.ok().put("userPhone",userPhone);
+        }
+        return R.error("无权查看");
+    }
+
+    /**
+     * 新增线下订单
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderOffline:add')")
+    @Log(title = "线下订单", businessType = BusinessType.INSERT)
+    @PostMapping("/createOrder")
+    public R add(@RequestBody FsStoreOrderOfflineCreateParam param)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        param.setCompanyUserId(loginUser.getUser().getUserId());
+        return fsStoreOrderOfflineService.createOrder(param);
+    }
+
+    /**
+     * 修改线下订单
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderOffline:edit')")
+    @Log(title = "线下订单", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreOrderOfflineScrm fsStoreOrderOffline)
+    {
+        return toAjax(fsStoreOrderOfflineService.updateFsStoreOrderOffline(fsStoreOrderOffline));
+    }
+
+    /**
+     * 删除线下订单
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrderOffline:remove')")
+    @Log(title = "线下订单", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{orderIds}")
+    public AjaxResult remove(@PathVariable Long[] orderIds)
+    {
+        return toAjax(fsStoreOrderOfflineService.deleteFsStoreOrderOfflineByIds(orderIds));
+    }
+
+    @Log(title = "订单凭证上传", businessType = BusinessType.UPDATE)
+    @PreAuthorize("@ss.hasPermi('store:storeOrderOffline:uploadCredentials')")
+    @PostMapping("/uploadCredentials")
+    public R UploadCredentials(@RequestBody FsStoreOrderOfflineScrm order)
+    {
+        if (order.getCertificates() == null ){
+            return R.error("请选择图片上传");
+        }
+        fsStoreOrderOfflineService.uploadCredentials(order);
+        return R.ok();
+    }
+}

+ 459 - 0
fs-company/src/main/java/com/fs/hisStore/controller/FsStoreOrderScrmController.java

@@ -0,0 +1,459 @@
+package com.fs.hisStore.controller;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.fs.common.annotation.DataScope;
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.ParseUtils;
+import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.StringUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.crm.domain.CrmCustomer;
+import com.fs.crm.service.ICrmCustomerService;
+import com.fs.framework.security.LoginUser;
+import com.fs.framework.service.TokenService;
+import com.fs.his.domain.FsUser;
+import com.fs.his.service.IFsUserService;
+import com.fs.hisStore.config.StoreConfig;
+import com.fs.hisStore.domain.FsStoreOrderItemScrm;
+import com.fs.hisStore.domain.FsStoreOrderScrm;
+import com.fs.hisStore.domain.FsStoreOrderStatusScrm;
+import com.fs.hisStore.domain.FsStorePaymentScrm;
+import com.fs.hisStore.dto.ExpressInfoDTO;
+import com.fs.hisStore.dto.StoreOrderProductDTO;
+import com.fs.hisStore.enums.OrderLogEnum;
+import com.fs.hisStore.enums.ShipperCodeEnum;
+import com.fs.hisStore.param.FsStoreOrderBindCustomerParam;
+import com.fs.hisStore.param.FsStoreOrderCreateUserParam;
+import com.fs.hisStore.param.FsStoreOrderFinishParam;
+import com.fs.hisStore.param.FsStoreOrderParam;
+import com.fs.hisStore.service.*;
+import com.fs.hisStore.vo.FsStoreOrderAuditLogVO;
+import com.fs.hisStore.vo.FsStoreOrderExportVO;
+import com.fs.hisStore.vo.FsStoreOrderItemExportVO;
+import com.fs.hisStore.vo.FsStoreOrderVO;
+import com.fs.system.service.ISysConfigService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.ParseException;
+import java.util.List;
+
+/**
+ * 订单Controller
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+
+@RestController
+@RequestMapping("/store/store/storeOrder")
+public class FsStoreOrderScrmController extends BaseController
+{
+    @Autowired
+    private IFsExpressScrmService expressService;
+    @Autowired
+    private IFsStoreOrderScrmService fsStoreOrderService;
+    @Autowired
+    private IFsStoreOrderItemScrmService orderItemService;
+
+    @Autowired
+    private IFsUserService userService;
+
+    @Autowired
+    private IFsStoreOrderStatusScrmService orderStatusService;
+    @Autowired
+    private IFsStorePaymentScrmService fsStorePaymentService;
+    @Autowired
+    private TokenService tokenService;
+    @Autowired
+    private ICrmCustomerService crmCustomerService;
+    @Autowired
+    private IFsStoreOrderAuditLogScrmService orderAuditLogService;
+    @Autowired
+    private ISysConfigService configService;
+
+    /**
+     * 查询订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:list')")
+    @GetMapping("/list")
+    @DataScope(deptAlias = "cu",userAlias = "cu")
+    public TableDataInfo list(FsStoreOrderParam param)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        startPage();
+        if(!StringUtils.isEmpty(param.getCreateTimeRange())){
+            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getPayTimeRange())){
+            param.setPayTimeList(param.getPayTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
+            param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
+        }
+        List<FsStoreOrderVO> list = fsStoreOrderService.selectFsStoreOrderListVO(param);
+        return getDataTable(list);
+    }
+
+
+    @GetMapping("/allList")
+    public TableDataInfo allList(FsStoreOrderParam param)
+    {
+        startPage();
+        if(!StringUtils.isEmpty(param.getCreateTimeRange())){
+            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getPayTimeRange())){
+            param.setPayTimeList(param.getPayTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
+            param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
+        }
+        List<FsStoreOrderVO> list = fsStoreOrderService.selectFsStoreOrderAllListVO(param);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:myList')")
+    @GetMapping("/myList")
+    public TableDataInfo myList(FsStoreOrderParam param)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        param.setCompanyUserId(loginUser.getUser().getUserId());
+        startPage();
+        if(!StringUtils.isEmpty(param.getCreateTimeRange())){
+            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getPayTimeRange())){
+            param.setPayTimeList(param.getPayTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
+            param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
+        }
+        List<FsStoreOrderVO> list = fsStoreOrderService.selectFsStoreOrderListVO(param);
+        return getDataTable(list);
+    }
+
+
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:export')")
+    @Log(title = "订单", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    @DataScope(deptAlias = "cu",userAlias = "cu")
+    public AjaxResult export (FsStoreOrderParam param)
+    {
+        if (param.getBeginTime().equals("") && param.getEndTime().equals("")){
+            param.setBeginTime(null);
+            param.setEndTime(null);
+        }
+        if (fsStoreOrderService.isEntityNull(param)){
+            return AjaxResult.error("请筛选数据导出");
+        }
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        if(!StringUtils.isEmpty(param.getCreateTimeRange())){
+            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getPayTimeRange())){
+            param.setPayTimeList(param.getPayTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
+            param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
+        }
+        List<FsStoreOrderExportVO> list = fsStoreOrderService.selectFsStoreOrderListVOByExport(param);
+        //对手机号脱敏
+        if(list!=null){
+            for(FsStoreOrderExportVO vo:list){
+                if (vo.getPhone() != null) {
+                    vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+                if (vo.getUserPhone() != null) {
+                    vo.setUserPhone(vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+                if (vo.getUserAddress()!=null){
+                    vo.setUserAddress(ParseUtils.parseAddress(vo.getUserAddress()));
+                }
+
+            }
+        }
+        ExcelUtil<FsStoreOrderExportVO> util = new ExcelUtil<FsStoreOrderExportVO>(FsStoreOrderExportVO.class);
+        return util.exportExcel(list,"订单数据");
+    }
+
+
+    /**
+     * 获取订单详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:query')")
+    @GetMapping(value = "/{id}")
+    public R getInfo(@PathVariable("id") Long id)
+    {
+        FsStoreOrderScrm order=fsStoreOrderService.selectFsStoreOrderById(id);
+        order.setUserPhone(ParseUtils.parsePhone(order.getUserPhone()));
+        order.setUserAddress(ParseUtils.parseAddress(order.getUserAddress()));
+        FsUser user=userService.selectFsUserById(order.getUserId());
+        user.setPhone(ParseUtils.parsePhone(user.getPhone()));
+        FsStoreOrderItemScrm itemMap=new FsStoreOrderItemScrm();
+        itemMap.setOrderId(order.getId());
+        List<FsStoreOrderItemScrm> items=orderItemService.selectFsStoreOrderItemList(itemMap);
+        FsStoreOrderStatusScrm statusMap=new FsStoreOrderStatusScrm();
+        statusMap.setOrderId(order.getId());
+        List<FsStoreOrderStatusScrm> logs=orderStatusService.selectFsStoreOrderStatusList(statusMap);
+        List<FsStorePaymentScrm> payments=fsStorePaymentService.selectFsStorePaymentByOrderId(order.getId());
+
+        CrmCustomer customer=null;
+        if(order.getCustomerId()!=null&&order.getCustomerId()>0){
+            customer=crmCustomerService.selectCrmCustomerById(order.getCustomerId());
+        }
+
+        List<FsStoreOrderAuditLogVO> auditLogs = orderAuditLogService.selectStoreOrderAuditLogVOByOrderId(order.getId());
+        return R.ok().put("order", order).put("items", items).put("logs",logs).put("user",user).put("customer",customer).put("payments",payments)
+                .put("auditLogs", auditLogs);
+    }
+
+    @GetMapping(value = "/queryAddress/{id}")
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:queryAddress')")
+    public R getAddress(@PathVariable("id") Long id)
+    {
+        FsStoreOrderScrm order = fsStoreOrderService.selectFsStoreOrderById(id);
+        String address = order.getUserAddress();
+        return R.ok().put("address",address);
+    }
+
+    @GetMapping(value = "/queryPhone/{id}")
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:queryPhone')")
+    @Log(title = "查看电话", businessType = BusinessType.GRANT)
+    public R getPhone(@PathVariable("id") Long id)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        if (loginUser.getUser().getUserType().equals("00")){
+            FsStoreOrderScrm order = fsStoreOrderService.selectFsStoreOrderById(id);
+            String userPhone = order.getUserPhone();
+            return R.ok().put("userPhone",userPhone);
+        }
+        return R.error("无权查看");
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:express')")
+    @GetMapping(value = "/getExpress/{id}")
+    public R getExpress(@PathVariable("id") Long id)
+    {
+        FsStoreOrderScrm order=fsStoreOrderService.selectFsStoreOrderById(id);
+        ExpressInfoDTO expressInfoDTO=null;
+        if(StringUtils.isNotEmpty(order.getDeliveryId())){
+
+            String lastFourNumber = "";
+            if (order.getDeliverySn().equals(ShipperCodeEnum.SF.getValue())) {
+                lastFourNumber = order.getUserPhone();
+                if (lastFourNumber.length() == 11) {
+                    lastFourNumber = StrUtil.sub(lastFourNumber, lastFourNumber.length(), -4);
+                }
+            }
+            expressInfoDTO=expressService.getExpressInfo(order.getOrderCode(),order.getDeliverySn(),order.getDeliveryId(),lastFourNumber);
+        }
+        return R.ok().put("data",expressInfoDTO);
+    }
+
+    /**
+     * 新增订单
+     */
+
+    @Log(title = "订单", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreOrderScrm fsStoreOrder)
+    {
+        return toAjax(fsStoreOrderService.insertFsStoreOrder(fsStoreOrder));
+    }
+
+    /**
+     * 修改订单
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:edit')")
+    @Log(title = "订单", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreOrderScrm fsStoreOrder)
+    {
+        return toAjax(fsStoreOrderService.updateFsStoreOrder(fsStoreOrder));
+    }
+
+    /**
+     * 删除订单
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:remove')")
+    @Log(title = "订单", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsStoreOrderService.deleteFsStoreOrderByIds(ids));
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:add')")
+    @PostMapping("/createUserOrder")
+    public R createUserOrder(@Validated @RequestBody FsStoreOrderCreateUserParam param, HttpServletRequest request){
+
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        param.setCompanyUserId(loginUser.getUser().getUserId());
+        return fsStoreOrderService.createUserOrder(param);
+    }
+
+
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:editPayPrice')")
+    @PostMapping("/editPayPrice")
+    public R editPayPrice(@RequestBody FsStoreOrderScrm fsStoreOrder)
+    {
+
+        if(fsStoreOrderService.updateFsStoreOrder(fsStoreOrder)>0){
+            //写日志
+            orderStatusService.create(fsStoreOrder.getId(), OrderLogEnum.ORDER_EDIT.getValue(),
+                    OrderLogEnum.ORDER_EDIT.getDesc());
+            return R.ok("操作成功");
+        }
+        else{
+            return R.error("操作失败");
+        }
+
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:finishOrder')")
+    @PostMapping("/finishOrder")
+    public R finishOrder(@Validated @RequestBody FsStoreOrderFinishParam param, HttpServletRequest request){
+        return fsStoreOrderService.finishOrder(param.getOrderId());
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:exportItems')")
+    @Log(title = "订单明细导出", businessType = BusinessType.EXPORT)
+    @GetMapping("/exportItems")
+    public AjaxResult exportItems(FsStoreOrderParam param)
+    {
+        if (param.getBeginTime().equals("") && param.getEndTime().equals("")){
+            param.setBeginTime(null);
+            param.setEndTime(null);
+        }
+        if (fsStoreOrderService.isEntityNull(param)){
+            return AjaxResult.error("请筛选数据导出");
+        }
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+
+        if(!StringUtils.isEmpty(param.getCreateTimeRange())){
+            param.setCreateTimeList(param.getCreateTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getPayTimeRange())){
+            param.setPayTimeList(param.getPayTimeRange().split("--"));
+        }
+        if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
+            param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
+        }
+
+        List<FsStoreOrderItemExportVO> list=orderItemService.selectFsStoreOrderItemListExportVO(param);
+        //对手机号脱敏
+        if(list!=null){
+            for(FsStoreOrderItemExportVO vo:list){
+                if(vo.getUserPhone()!=null){
+                    String phone = vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{1})", "$1****$2");
+                    vo.setUserPhone(phone);
+                }
+                if (vo.getUserAddress()!=null){
+                    vo.setUserAddress(ParseUtils.parseAddress(vo.getUserAddress()));
+                }
+                if(!StringUtils.isEmpty(vo.getJsonInfo())){
+                    try {
+                        StoreOrderProductDTO orderProductDTO = JSONObject.parseObject(vo.getJsonInfo(), StoreOrderProductDTO.class);
+                        BeanUtil.copyProperties(orderProductDTO,vo);
+                    }
+                    catch (Exception e){
+                    }
+                }
+            }
+        }
+        ExcelUtil<FsStoreOrderItemExportVO> util = new ExcelUtil<FsStoreOrderItemExportVO>(FsStoreOrderItemExportVO.class);
+        return util.exportExcel(list, "订单明细数据");
+    }
+
+
+    @GetMapping("/getCustomerOrderList")
+    public TableDataInfo getCustomerOrderList(FsStoreOrderParam param) {
+        startPage();
+        List<FsStoreOrderVO> list = fsStoreOrderService.selectFsCustomerStoreOrderListVO(param);
+        if (list != null) {
+            for (FsStoreOrderVO vo : list) {
+                if(vo.getPhone()!=null){
+                    vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{1})", "$1****$2"));
+                    vo.setUserPhone(vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{1})", "$1****$2"));
+                }
+
+            }
+        }
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:bindCustomer')")
+    @PostMapping("/bindCustomer")
+    public R bindCustomer(@RequestBody FsStoreOrderBindCustomerParam param)
+    {
+        if(param.getCustomerIds().length>1){
+            return R.error("只能关联一个客户");
+        }
+        for(Long customerId:param.getCustomerIds()){
+            FsStoreOrderScrm order=new FsStoreOrderScrm();
+            order.setId(param.getOrderId());
+            order.setCustomerId(customerId);
+            fsStoreOrderService.updateFsStoreOrder(order);
+            //更新CRM客户订单数
+            crmCustomerService.updateBuyCount(customerId);
+        }
+        return R.ok("操作成功");
+
+    }
+
+    @Log(title = "订单凭证上传", businessType = BusinessType.UPDATE)
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:uploadCredentials')")
+    @PostMapping("/uploadCredentials")
+    public R UploadCredentials(@RequestBody FsStoreOrderScrm order)
+    {
+//        String[] imageUrls = order.getCredentials().split(",");
+        if (order.getCertificates() == null ){
+            return R.error("请选择图片上传");
+        }
+        fsStoreOrderService.uploadCredentials(order);
+        return R.ok();
+    }
+
+    @Log(title = "修改地址", businessType = BusinessType.UPDATE)
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:editAddress')")
+    @PostMapping("/editAddress")
+    public R editAddress(@RequestBody FsStoreOrderScrm order) throws ParseException
+    {
+        FsStoreOrderScrm storeOrder = fsStoreOrderService.selectFsStoreOrderById(order.getId());
+
+        int a = fsStoreOrderService.updateFsStoreOrder(order);
+        if (storeOrder.getExtendOrderId()!=null && a>0){
+            fsStoreOrderService.createOmsOrder(storeOrder.getId());
+        }
+
+        return R.ok();
+    }
+
+    /**
+     * 获取下单类型
+     */
+    @GetMapping("/getCreateOrderType")
+    public R getCreateOrderType() {
+        String json=configService.selectConfigByKey("store.config");
+        StoreConfig config= JSONUtil.toBean(json,StoreConfig.class);
+        Integer createSalesOrderType = config.getCreateSalesOrderType();
+        return R.ok().put("createSalesOrderType",createSalesOrderType);
+    }
+}

+ 144 - 0
fs-company/src/main/java/com/fs/hisStore/controller/FsStorePaymentScrmController.java

@@ -0,0 +1,144 @@
+package com.fs.hisStore.controller;
+
+import java.util.List;
+
+import com.fs.common.core.domain.R;
+import com.fs.common.utils.ParseUtils;
+import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.framework.security.LoginUser;
+import com.fs.framework.service.TokenService;
+import com.fs.hisStore.domain.FsStorePaymentScrm;
+import com.fs.hisStore.param.FsStorePaymentParam;
+import com.fs.hisStore.service.IFsStorePaymentScrmService;
+import com.fs.hisStore.vo.FsStorePaymentVO;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+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.core.page.TableDataInfo;
+
+/**
+ * 支付明细Controller
+ *
+ * @author fs
+ * @date 2022-06-20
+ */
+@RestController
+@RequestMapping("/store/store/storePayment")
+public class FsStorePaymentScrmController extends BaseController
+{
+    @Autowired
+    private IFsStorePaymentScrmService fsStorePaymentService;
+    @Autowired
+    private TokenService tokenService;
+    /**
+     * 查询支付明细列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storePayment:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStorePaymentParam fsStorePayment)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fsStorePayment.setBusinessType(1);
+        fsStorePayment.setCompanyId(loginUser.getCompany().getCompanyId());
+        startPage();
+        List<FsStorePaymentVO> list = fsStorePaymentService.selectFsStorePaymentListQueryVO(fsStorePayment);
+        for (FsStorePaymentVO vo : list){
+            vo.setUserPhone(ParseUtils.parsePhone(vo.getUserPhone()));
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出支付明细列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storePayment:export')")
+    @Log(title = "支付明细", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStorePaymentParam fsStorePayment)
+    {
+        fsStorePayment.setBusinessType(1);
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fsStorePayment.setCompanyId(loginUser.getCompany().getCompanyId());
+        List<FsStorePaymentVO> list = fsStorePaymentService.selectFsStorePaymentListQueryVO(fsStorePayment);
+        for (FsStorePaymentVO vo : list){
+            vo.setUserPhone(ParseUtils.parsePhone(vo.getUserPhone()));
+        }
+        ExcelUtil<FsStorePaymentVO> util = new ExcelUtil<FsStorePaymentVO>(FsStorePaymentVO.class);
+        return util.exportExcel(list, "storePayment");
+    }
+
+    /**
+     * 获取支付明细详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storePayment:query')")
+    @GetMapping(value = "/{paymentId}")
+    public AjaxResult getInfo(@PathVariable("paymentId") Long paymentId)
+    {
+        return AjaxResult.success(fsStorePaymentService.selectFsStorePaymentById(paymentId));
+    }
+
+    /**
+     * 新增支付明细
+     */
+    @PreAuthorize("@ss.hasPermi('store:storePayment:add')")
+    @Log(title = "支付明细", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStorePaymentScrm fsStorePayment)
+    {
+        return toAjax(fsStorePaymentService.insertFsStorePayment(fsStorePayment));
+    }
+
+    /**
+     * 修改支付明细
+     */
+    @PreAuthorize("@ss.hasPermi('store:storePayment:edit')")
+    @Log(title = "支付明细", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStorePaymentScrm fsStorePayment)
+    {
+        return toAjax(fsStorePaymentService.updateFsStorePayment(fsStorePayment));
+    }
+
+    /**
+     * 删除支付明细
+     */
+    @PreAuthorize("@ss.hasPermi('store:storePayment:remove')")
+    @Log(title = "支付明细", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{paymentIds}")
+    public AjaxResult remove(@PathVariable Long[] paymentIds)
+    {
+        return toAjax(fsStorePaymentService.deleteFsStorePaymentByIds(paymentIds));
+    }
+    @GetMapping("/getStorePaymentList")
+    public R getStorePaymentList(FsStorePaymentParam fsStorePayment)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fsStorePayment.setCompanyId(loginUser.getCompany().getCompanyId());
+        List<FsStorePaymentVO> list = fsStorePaymentService.selectFsStorePaymentListQueryVO(fsStorePayment);
+        return R.ok().put("data",list);
+    }
+
+    @GetMapping("/getMyPaymentList")
+    public TableDataInfo getMyPaymentList(FsStorePaymentParam fsStorePayment)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fsStorePayment.setCompanyId(loginUser.getCompany().getCompanyId());
+        fsStorePayment.setCompanyUserId(loginUser.getUser().getUserId());
+        startPage();
+        fsStorePayment.setStatus(1);
+        List<FsStorePaymentVO> list = fsStorePaymentService.selectFsMyStorePaymentListQueryVO(fsStorePayment);
+        return getDataTable(list);
+    }
+}

+ 33 - 0
fs-company/src/main/java/com/fs/hisStore/controller/FsStoreProductCategoryScrmController.java

@@ -0,0 +1,33 @@
+package com.fs.hisStore.controller;
+
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.R;
+import com.fs.hisStore.domain.FsStoreProductCategoryScrm;
+import com.fs.hisStore.service.IFsStoreProductCategoryScrmService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 商品分类Controller
+ *
+ * @author fs
+ * @date 2022-03-16
+ */
+@RestController
+@RequestMapping("/store/store/storeProductCategory")
+public class FsStoreProductCategoryScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreProductCategoryScrmService fsStoreProductCategoryService;
+
+    @GetMapping("/getAllList")
+    public R getAllList(FsStoreProductCategoryScrm fsStoreProductCategory)
+    {
+        fsStoreProductCategory.setIsShow(1);
+        fsStoreProductCategory.setIsDel(0);
+        List<FsStoreProductCategoryScrm> list = fsStoreProductCategoryService.selectFsStoreProductCategoryList(fsStoreProductCategory);
+        return R.ok().put("data", list);
+    }
+}

+ 169 - 0
fs-company/src/main/java/com/fs/hisStore/controller/FsStoreProductPackageScrmController.java

@@ -0,0 +1,169 @@
+package com.fs.hisStore.controller;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONUtil;
+import com.fs.common.core.domain.R;
+import com.fs.common.utils.ServletUtils;
+import com.fs.framework.security.LoginUser;
+import com.fs.framework.service.TokenService;
+import com.fs.hisStore.domain.FsStoreProductScrm;
+import com.fs.hisStore.domain.FsStoreProductAttrValueScrm;
+import com.fs.hisStore.dto.StoreOrderProductDTO;
+import com.fs.hisStore.dto.StorePackageProductDTO;
+import com.fs.hisStore.service.IFsStoreProductAttrValueScrmService;
+import com.fs.hisStore.service.IFsStoreProductScrmService;
+import com.fs.hisStore.vo.FsStoreProductPacketVO;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+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.hisStore.domain.FsStoreProductPackageScrm;
+import com.fs.hisStore.service.IFsStoreProductPackageScrmService;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.core.page.TableDataInfo;
+
+/**
+ * 商品组合套餐Controller
+ *
+ * @author fs
+ * @date 2022-07-14
+ */
+@RestController
+@RequestMapping("/store/store/storeProductPackage")
+public class FsStoreProductPackageScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreProductPackageScrmService fsStoreProductPackageService;
+    @Autowired
+    private IFsStoreProductAttrValueScrmService attrValueService;
+    @Autowired
+    private TokenService tokenService;
+    @Autowired
+    private IFsStoreProductScrmService productService;
+    /**
+     * 查询商品组合套餐列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductPackage:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreProductPackageScrm fsStoreProductPackage)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fsStoreProductPackage.setCompanyId(loginUser.getCompany().getCompanyId());
+        startPage();
+        List<FsStoreProductPacketVO> list = fsStoreProductPackageService.selectFsStoreProductPackageListVO(fsStoreProductPackage);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出商品组合套餐列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductPackage:export')")
+    @Log(title = "商品组合套餐", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreProductPackageScrm fsStoreProductPackage)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fsStoreProductPackage.setCompanyId(loginUser.getCompany().getCompanyId());
+        List<FsStoreProductPacketVO> list = fsStoreProductPackageService.selectFsStoreProductPackageListVO(fsStoreProductPackage);
+        ExcelUtil<FsStoreProductPacketVO> util = new ExcelUtil<FsStoreProductPacketVO>(FsStoreProductPacketVO.class);
+        return util.exportExcel(list, "storeProductPackage");
+    }
+
+    /**
+     * 获取商品组合套餐详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductPackage:query')")
+    @GetMapping(value = "/{packageId}")
+    public R getInfo(@PathVariable("packageId") Long packageId)
+    {
+        FsStoreProductPackageScrm productPackage=fsStoreProductPackageService.selectFsStoreProductPackageById(packageId);
+
+        List<StoreOrderProductDTO> productList=new ArrayList<>();
+        JSONArray jsonArray=JSONUtil.parseArray(productPackage.getProducts());
+        List<StorePackageProductDTO> goodsList=JSONUtil.toList(jsonArray, StorePackageProductDTO.class);
+        for(StorePackageProductDTO dto:goodsList){
+            StoreOrderProductDTO productDTO=new StoreOrderProductDTO();
+            FsStoreProductAttrValueScrm attrValue=attrValueService.selectFsStoreProductAttrValueById(dto.getId());
+            if(attrValue!=null){
+                FsStoreProductScrm product=productService.selectFsStoreProductById(attrValue.getProductId());
+                if(product!=null){
+                    productDTO.setProductId(product.getProductId());
+                    productDTO.setId(dto.getId());
+                    productDTO.setBarCode(attrValue.getBarCode());
+                    productDTO.setPrice(attrValue.getPrice());
+                    productDTO.setCount(dto.getCount());
+                    productDTO.setSku(attrValue.getSku());
+                    productDTO.setImage(attrValue.getImage());
+                    productDTO.setProductName(product.getProductName());
+                    productList.add(productDTO);
+                }
+            }
+        }
+        return R.ok().put("productPckage",productPackage).put("productList",productList);
+    }
+
+    /**
+     * 新增商品组合套餐
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductPackage:add')")
+    @Log(title = "商品组合套餐", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreProductPackageScrm fsStoreProductPackage)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fsStoreProductPackage.setCompanyId(loginUser.getCompany().getCompanyId());
+        fsStoreProductPackage.setDeptId(loginUser.getUser().getDeptId());
+        for(StoreOrderProductDTO dto:fsStoreProductPackage.getProductList()){
+            FsStoreProductAttrValueScrm attrValue=attrValueService.selectFsStoreProductAttrValueById(dto.getId());
+            if(attrValue!=null){
+                dto.setBarCode(attrValue.getBarCode());
+            }
+        }
+        fsStoreProductPackage.setProducts(JSONUtil.toJsonStr(fsStoreProductPackage.getProductList()));
+
+        return toAjax(fsStoreProductPackageService.insertFsStoreProductPackage(fsStoreProductPackage));
+    }
+
+    /**
+     * 修改商品组合套餐
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductPackage:edit')")
+    @Log(title = "商品组合套餐", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreProductPackageScrm fsStoreProductPackage)
+    {
+        for(StoreOrderProductDTO dto:fsStoreProductPackage.getProductList()){
+            FsStoreProductAttrValueScrm attrValue=attrValueService.selectFsStoreProductAttrValueById(dto.getId());
+            if(attrValue!=null){
+                dto.setBarCode(attrValue.getBarCode());
+            }
+        }
+        fsStoreProductPackage.setProducts(JSONUtil.toJsonStr(fsStoreProductPackage.getProductList()));
+
+        return toAjax(fsStoreProductPackageService.updateFsStoreProductPackage(fsStoreProductPackage));
+    }
+
+    /**
+     * 删除商品组合套餐
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProductPackage:remove')")
+    @Log(title = "商品组合套餐", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{packageIds}")
+    public AjaxResult remove(@PathVariable Long[] packageIds)
+    {
+        return toAjax(fsStoreProductPackageService.deleteFsStoreProductPackageByIds(packageIds));
+    }
+}

+ 71 - 0
fs-company/src/main/java/com/fs/hisStore/controller/FsStoreProductScrmController.java

@@ -0,0 +1,71 @@
+package com.fs.hisStore.controller;
+
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.framework.security.SecurityUtils;
+import com.fs.hisStore.domain.FsStoreProductAttrValueScrm;
+import com.fs.hisStore.domain.FsStoreProductScrm;
+import com.fs.hisStore.param.FsProductAttrValueParam;
+import com.fs.hisStore.service.IFsStoreProductAttrValueScrmService;
+import com.fs.hisStore.service.IFsStoreProductScrmService;
+import com.fs.hisStore.vo.FsStoreProductAttrValueVO;
+import com.fs.hisStore.vo.FsStoreProductListVO;
+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 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/storeProduct")
+public class FsStoreProductScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreProductScrmService fsStoreProductService;
+
+
+    @Autowired
+    private IFsStoreProductAttrValueScrmService attrValueService;
+
+    /**
+     * 查询商品列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProduct:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreProductScrm fsStoreProduct)
+    {
+        startPage();
+        fsStoreProduct.setIsDel(0);
+        // 只能展示属于本公司的产品
+        fsStoreProduct.setCompanyIds(String.valueOf(SecurityUtils.getLoginUser().getCompany().getCompanyId()));
+        List<FsStoreProductListVO> list = fsStoreProductService.selectFsStoreProductListVO(fsStoreProduct);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeProduct:query')")
+    @GetMapping(value = "/{productId}")
+    public R getInfo(@PathVariable("productId") Long productId)
+    {
+        FsStoreProductScrm product=fsStoreProductService.selectFsStoreProductById(productId);
+        FsStoreProductAttrValueScrm map=new FsStoreProductAttrValueScrm();
+        map.setProductId(productId);
+        List<FsStoreProductAttrValueScrm> values=attrValueService.selectFsStoreProductAttrValueList(map);
+        return R.ok().put("product", product).put("values",values);
+    }
+
+    @GetMapping("/getStoreProductAttrValueList")
+    public TableDataInfo getStoreProductAttrValueList(FsProductAttrValueParam param)
+    {
+        startPage();
+        List<FsStoreProductAttrValueVO> list=attrValueService.selectFsStoreProductAttrValueListVO(param);
+        return getDataTable(list);
+    }
+
+}

+ 189 - 0
fs-company/src/main/java/com/fs/hisStore/controller/FsStoreStatisticsScrmController.java

@@ -0,0 +1,189 @@
+package com.fs.hisStore.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.utils.StringUtils;
+import com.fs.common.utils.TimeUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.company.domain.CompanyUser;
+import com.fs.company.service.ICompanyUserService;
+import com.fs.framework.service.TokenService;
+import com.fs.hisStore.param.FsStoreStatisticsParam;
+import com.fs.hisStore.service.IFsStoreOrderScrmService;
+import com.fs.hisStore.service.IFsStorePaymentScrmService;
+import com.fs.hisStore.vo.FsStoreOrderStatisticsVO;
+import com.fs.hisStore.vo.FsStorePaymentStatisticsVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 统计
+ *
+ * @author fs
+ * @date 2021-03-22
+ */
+@RestController
+@RequestMapping("/store/store/statistics")
+public class FsStoreStatisticsScrmController extends BaseController
+{
+
+    @Autowired
+    private ICompanyUserService userService;
+
+    @Autowired
+    private IFsStoreOrderScrmService storeOrderService;
+    @Autowired
+    private IFsStorePaymentScrmService storePaymentService;
+    @Autowired
+    private TokenService tokenService;
+    @PreAuthorize("@ss.hasPermi('store:statistics:storeOrder')")
+    @GetMapping("/storeOrder")
+    public R storeOrder(FsStoreStatisticsParam param)
+    {
+        if(StringUtils.isNotEmpty(param.getUserIds())){
+            String[] userIds=param.getUserIds().split(",");
+            Long[] ids=new Long[userIds.length];
+            for(int i=0;i<ids.length; i++){
+                ids[i]=Long.parseLong(userIds[i]);
+            }
+            param.setUsers(ids);
+        }
+        else{
+            //获取部门下的所有用户
+            CompanyUser usermap=new CompanyUser();
+            usermap.setDeptId(param.getDeptId());
+            List<CompanyUser> users = userService.getUserListByDeptId(usermap);
+            List<Long> userIds = users.stream().map(element -> element.getUserId()).collect(Collectors.toList());
+            param.setUsers(userIds.toArray(new Long[userIds.size()]));
+        }
+        if(param.getUsers()!=null&&param.getUsers().length>0){
+            List<FsStoreOrderStatisticsVO> list= storeOrderService.selectFsStoreOrderStatisticsList(param);
+
+            TimeUtils.TimeEntity timeEntity=TimeUtils.parseTime(param.getType().toString(),param.getStartTime(),param.getEndTime());
+            timeEntity.setUserIds(param.getUsers());
+            Integer cycleNum = timeEntity.getCycleNum();
+            Integer beginTime = timeEntity.getBeginTime();
+            List<Integer> timeList = new ArrayList<>();
+            for (int i = 1; i <= cycleNum; i++) {
+                timeList.add(beginTime);
+                beginTime = TimeUtils.formatTime(beginTime);
+            }
+            List<JSONObject> jsonObjectList = storeOrderService.selectFsStoreOrderCounts(timeEntity.toMap());
+            List<String> dates = jsonObjectList.stream().map(jsonObject -> jsonObject.getString("type")).collect(Collectors.toList());
+            List<Integer> orderCount = jsonObjectList.stream().map(jsonObject -> jsonObject.getInteger("orderCount")).collect(Collectors.toList());
+            List<Integer> payPrice = jsonObjectList.stream().map(jsonObject -> jsonObject.getInteger("payPrice")).collect(Collectors.toList());
+            return R.ok().put("list",list).put("dates",dates).put("orderCount",orderCount).put("payPrice",payPrice);
+        }
+        else {
+            return R.ok("未查找到数据");
+        }
+    }
+    @PreAuthorize("@ss.hasPermi('store:statistics:exportStoreOrder')")
+    @GetMapping("/exportStoreOrder")
+    public AjaxResult exportStoreOrder(FsStoreStatisticsParam param)
+    {
+        if(StringUtils.isNotEmpty(param.getUserIds())){
+            String[] userIds=param.getUserIds().split(",");
+            Long[] ids=new Long[userIds.length];
+            for(int i=0;i<ids.length; i++){
+                ids[i]=Long.parseLong(userIds[i]);
+            }
+            param.setUsers(ids);
+        }
+        else{
+            //获取所有员工
+            CompanyUser usermap=new CompanyUser();
+            usermap.setDeptId(param.getDeptId());
+            List<CompanyUser> users = userService.getUserListByDeptId(usermap);
+            List<Long> userIds = users.stream().map(element -> element.getUserId()).collect(Collectors.toList());
+            param.setUsers(userIds.toArray(new Long[userIds.size()]));
+        }
+
+        List<FsStoreOrderStatisticsVO> list= storeOrderService.selectFsStoreOrderStatisticsList(param);
+
+        ExcelUtil<FsStoreOrderStatisticsVO> util = new ExcelUtil<FsStoreOrderStatisticsVO>(FsStoreOrderStatisticsVO.class);
+        return util.exportExcel(list, "orderLogs");
+    }
+
+
+    @PreAuthorize("@ss.hasPermi('store:statistics:storePayment')")
+    @GetMapping("/storePayment")
+    public R storePayment(FsStoreStatisticsParam param)
+    {
+        if(StringUtils.isNotEmpty(param.getUserIds())){
+            String[] userIds=param.getUserIds().split(",");
+            Long[] ids=new Long[userIds.length];
+            for(int i=0;i<ids.length; i++){
+                ids[i]=Long.parseLong(userIds[i]);
+            }
+            param.setUsers(ids);
+        }
+        else{
+            //获取部门下的所有用户
+            CompanyUser usermap=new CompanyUser();
+            usermap.setDeptId(param.getDeptId());
+            List<CompanyUser> users = userService.getUserListByDeptId(usermap);
+            List<Long> userIds = users.stream().map(element -> element.getUserId()).collect(Collectors.toList());
+            param.setUsers(userIds.toArray(new Long[userIds.size()]));
+        }
+        if(param.getUsers()!=null&&param.getUsers().length>0){
+            List<FsStorePaymentStatisticsVO> list= storePaymentService.selectFsStorePaymentStatisticsList(param);
+            TimeUtils.TimeEntity timeEntity=TimeUtils.parseTime(param.getType().toString(),param.getStartTime(),param.getEndTime());
+            timeEntity.setUserIds(param.getUsers());
+            Integer cycleNum = timeEntity.getCycleNum();
+            Integer beginTime = timeEntity.getBeginTime();
+            List<Integer> timeList = new ArrayList<>();
+            for (int i = 1; i <= cycleNum; i++) {
+                timeList.add(beginTime);
+                beginTime = TimeUtils.formatTime(beginTime);
+            }
+            List<JSONObject> jsonObjectList = storePaymentService.selectFsStorePaymentCounts(timeEntity.toMap());
+            List<String> dates = jsonObjectList.stream().map(jsonObject -> jsonObject.getString("type")).collect(Collectors.toList());
+            List<Integer> orderCount = jsonObjectList.stream().map(jsonObject -> jsonObject.getInteger("orderCount")).collect(Collectors.toList());
+            List<Integer> payMoney = jsonObjectList.stream().map(jsonObject -> jsonObject.getInteger("payMoney")).collect(Collectors.toList());
+            return R.ok().put("list",list).put("dates",dates).put("orderCount",orderCount).put("payMoney",payMoney);
+        }
+        else {
+            return R.ok("未查找到数据");
+        }
+    }
+    @PreAuthorize("@ss.hasPermi('store:statistics:exportStorePayment')")
+    @GetMapping("/exportStorePayment")
+    public AjaxResult exportStorePayment(FsStoreStatisticsParam param)
+    {
+        if(StringUtils.isNotEmpty(param.getUserIds())){
+            String[] userIds=param.getUserIds().split(",");
+            Long[] ids=new Long[userIds.length];
+            for(int i=0;i<ids.length; i++){
+                ids[i]=Long.parseLong(userIds[i]);
+            }
+            param.setUsers(ids);
+        }
+        else{
+            //获取所有员工
+            CompanyUser usermap=new CompanyUser();
+            usermap.setDeptId(param.getDeptId());
+            List<CompanyUser> users = userService.getUserListByDeptId(usermap);
+            List<Long> userIds = users.stream().map(element -> element.getUserId()).collect(Collectors.toList());
+            param.setUsers(userIds.toArray(new Long[userIds.size()]));
+        }
+
+        List<FsStorePaymentStatisticsVO> list= storePaymentService.selectFsStorePaymentStatisticsList(param);
+
+        ExcelUtil<FsStorePaymentStatisticsVO> util = new ExcelUtil<FsStorePaymentStatisticsVO>(FsStorePaymentStatisticsVO.class);
+        return util.exportExcel(list, "paymentLogs");
+    }
+
+
+
+
+}

+ 87 - 0
fs-company/src/main/java/com/fs/hisStore/utils/CityTreeUtil.java

@@ -0,0 +1,87 @@
+package com.fs.store.utils;
+import com.fs.store.vo.CityVO;
+import org.springframework.util.CollectionUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @ClassName 树形工具类
+ **/
+public class CityTreeUtil {
+    /**
+     * 获得指定节点下所有归档
+     *
+     * @param list
+     * @param parentId
+     * @return
+     */
+    public static List<CityVO> list2TreeConverter(List<CityVO> list, int parentId) {
+        List<CityVO> returnList = new ArrayList<>();
+
+        for (CityVO res : list) {
+            //判断对象是否为根节点
+
+            if (res.getPid() == parentId) {
+                //该节点为根节点,开始递归
+                //通过递归为节点设置childList
+                recursionFn(list, res);
+                returnList.add(res);
+            }
+        }
+
+        return returnList;
+    }
+
+    /**
+     * 递归列表
+     * 通过递归,给指定t节点设置childList
+     *
+     * @param list
+     * @param t
+     */
+    public static void recursionFn(List<CityVO> list, CityVO t) {
+        //只能获取当前t节点的子节点集,并不是所有子节点集
+        List<CityVO> childsList = getChildList(list, t);
+
+        if(childsList!=null&&childsList.size()>0){
+            //设置他的子集对象集
+            t.setChildren(childsList);
+        }
+
+
+
+        //迭代子集对象集
+
+        //遍历完,则退出递归
+        for (CityVO nextChild : childsList) {
+
+            //判断子集对象是否还有子节点
+            if (!CollectionUtils.isEmpty(childsList)) {
+                //有下一个子节点,继续递归
+                recursionFn(list, nextChild);
+            }
+        }
+    }
+
+    /**
+     * 获得指定节点下的所有子节点
+     *
+     * @param list
+     * @param t
+     * @return
+     */
+    public static List<CityVO> getChildList(List<CityVO> list, CityVO t) {
+        List<CityVO> childsList = new ArrayList<>();
+        //遍历集合元素,如果元素的Parentid==指定元素的id,则说明是该元素的子节点
+        for (CityVO t1 : list) {
+            if (t1.getPid().equals(t.getValue())) {
+                childsList.add(t1);
+            }
+        }
+
+        return childsList;
+    }
+
+
+}

+ 19 - 0
fs-company/src/main/java/com/fs/hisStore/vo/CityVO.java

@@ -0,0 +1,19 @@
+package com.fs.store.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Getter
+@Setter
+@ToString
+public class CityVO implements Serializable {
+    private static final long serialVersionUID = 1L;
+    private Long value;
+    private String label;
+    private Long pid;
+    private List<CityVO> children; //子集
+}

+ 7 - 0
fs-company/src/main/java/com/fs/hisStore/vo/FsStoreOrderOfflineVO.java

@@ -0,0 +1,7 @@
+package com.fs.store.vo;
+
+import lombok.Data;
+
+@Data
+public class FsStoreOrderOfflineVO {
+}

+ 1 - 1
fs-company/src/main/resources/application.yml

@@ -11,4 +11,4 @@ spring:
 #    active: druid-yzt
 #    active: druid-myhk
 #    active: druid-sft
-    active: druid-hzyy
+    active: dev

+ 2 - 2
fs-service/pom.xml

@@ -15,9 +15,9 @@
         service模块
     </description>
     <properties>
-        <weixin-java-cp.version>4.4.0</weixin-java-cp.version>
+        <weixin-java-cp.version>4.7.0</weixin-java-cp.version>
         <weixin-java-miniapp.version>4.7.0</weixin-java-miniapp.version>
-        <weixin-java-mp.version>4.4.0</weixin-java-mp.version>
+        <weixin-java-mp.version>4.7.0</weixin-java-mp.version>
     </properties>
 
     <dependencies>

+ 9 - 0
fs-service/src/main/java/com/fs/api/param/ExpressParam.java

@@ -0,0 +1,9 @@
+package com.fs.api.param;
+
+import lombok.Data;
+
+import java.io.Serializable;
+@Data
+public class ExpressParam implements Serializable {
+    private String packageno;
+}

+ 13 - 0
fs-service/src/main/java/com/fs/api/param/OrderListParam.java

@@ -0,0 +1,13 @@
+package com.fs.api.param;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class OrderListParam implements Serializable
+{
+    private String startTime;
+    private String endTime;
+    private Long companyId;
+}

+ 14 - 0
fs-service/src/main/java/com/fs/api/vo/ExpressVO.java

@@ -0,0 +1,14 @@
+package com.fs.api.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class ExpressVO implements Serializable {
+    private String location;
+    private String tracedate;
+    private String remark;
+    private String status;
+
+}

+ 23 - 0
fs-service/src/main/java/com/fs/api/vo/OrderListVO.java

@@ -0,0 +1,23 @@
+package com.fs.api.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class OrderListVO implements Serializable
+{
+    private Long orderid;
+    private String ordercode;
+    private Date orderdate;
+    List<ProductListVO> productList;
+    private BigDecimal amount;
+    private String customername;
+    private String tel;
+    private String address;
+    private String express;
+    private String packageno;
+}

+ 16 - 0
fs-service/src/main/java/com/fs/api/vo/ProductListVO.java

@@ -0,0 +1,16 @@
+package com.fs.api.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+@Data
+public class ProductListVO implements Serializable
+{
+    private String productname;
+    private Long productid;
+    private BigDecimal productprice;
+    private Integer productqty;
+
+}

+ 28 - 0
fs-service/src/main/java/com/fs/common/event/TemplateBean.java

@@ -0,0 +1,28 @@
+package com.fs.common.event;
+
+import lombok.*;
+
+import java.util.Date;
+
+
+@Getter
+@Setter
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+public class TemplateBean {
+    private String templateType;
+    private String orderId;
+    private String orderCode;
+    private String remark;
+    private Date finishTime;
+    private String deliveryName;
+    private String deliveryId;
+    private Long userId;
+    private String rpId;
+    private Date rpCreateTime;
+    private String rpStatus;
+
+
+
+}

+ 22 - 0
fs-service/src/main/java/com/fs/common/event/TemplateEvent.java

@@ -0,0 +1,22 @@
+package com.fs.common.event;
+
+import lombok.Getter;
+import org.springframework.context.ApplicationEvent;
+
+/**
+ * 微信模板事件
+ */
+@Getter
+public class TemplateEvent extends ApplicationEvent {
+
+	private TemplateBean templateBean;
+	/**
+	 * 重写构造函数
+	 * @param source 发生事件的对象
+	 * @param templateBean 自定义
+	 */
+	public TemplateEvent(Object source, TemplateBean templateBean) {
+		super(source);
+		this.templateBean = templateBean;
+	}
+}

+ 29 - 0
fs-service/src/main/java/com/fs/common/event/TemplateListenEnum.java

@@ -0,0 +1,29 @@
+package com.fs.common.event;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.stream.Stream;
+
+
+/**
+ * 模板监听枚举
+ */
+@Getter
+@AllArgsConstructor
+public enum TemplateListenEnum {
+    TYPE_1("1","订单取消通知"),
+    TYPE_2("2","发货通知"),
+    TYPE_3("3","签收通知"),
+    TYPE_4("4","处方开方通知");
+    private String value;
+    private String desc;
+
+    public static TemplateListenEnum toType(String value) {
+        return Stream.of(TemplateListenEnum.values())
+                .filter(p -> p.value.equals(value))
+                .findAny()
+                .orElse(null);
+    }
+}

+ 229 - 0
fs-service/src/main/java/com/fs/company/domain/Company.java

@@ -120,6 +120,235 @@ public class Company extends BaseEntity
     @TableField(exist = false)
     private List<String> miniAppServer;
 
+    /** 后台制单是否需要付款 默认1 0-否 1-是*/
+    private Integer isPay;
+
+//    public String getDoctorIds() {
+//        return doctorIds;
+//    }
+//
+//    public void setDoctorIds(String doctorIds) {
+//        this.doctorIds = doctorIds;
+//    }
+//
+//    public String getFollowDoctorIds() {
+//        return followDoctorIds;
+//    }
+//
+//    public void setFollowDoctorIds(String followDoctorIds) {
+//        this.followDoctorIds = followDoctorIds;
+//    }
+//
+//    public String getManager() {
+//        return manager;
+//    }
+//
+//    public void setManager(String manager) {
+//        this.manager = manager;
+//    }
+//
+//    public String getOmsCode() {
+//        return omsCode;
+//    }
+//
+//    public void setOmsCode(String omsCode) {
+//        this.omsCode = omsCode;
+//    }
+//
+//    public Integer getVoiceCallerNumber() {
+//        return voiceCallerNumber;
+//    }
+//
+//    public void setVoiceCallerNumber(Integer voiceCallerNumber) {
+//        this.voiceCallerNumber = voiceCallerNumber;
+//    }
+//
+//    public Integer getIsDel() {
+//        return isDel;
+//    }
+//
+//    public void setIsDel(Integer isDel) {
+//        this.isDel = isDel;
+//    }
+//
+//    public BigDecimal getTuiMoney() {
+//        return tuiMoney;
+//    }
+//
+//    public void setTuiMoney(BigDecimal tuiMoney) {
+//        this.tuiMoney = tuiMoney;
+//    }
+//
+//    @Override
+//    public String getRemark() {
+//        return remark;
+//    }
+//
+//    @Override
+//    public void setRemark(String remark) {
+//        this.remark = remark;
+//    }
+//
+//    public String getLinkName() {
+//        return linkName;
+//    }
+//
+//    public void setLinkName(String linkName) {
+//        this.linkName = linkName;
+//    }
+//
+//    public Integer getLimitUserCount() {
+//        return limitUserCount;
+//    }
+//
+//    public void setLimitUserCount(Integer limitUserCount) {
+//        this.limitUserCount = limitUserCount;
+//    }
+//
+//    public Date getLimitTime() {
+//        return limitTime;
+//    }
+//
+//    public void setLimitTime(Date limitTime) {
+//        this.limitTime = limitTime;
+//    }
+//
+//    public String getAppId() {
+//        return appId;
+//    }
+//
+//    public void setAppId(String appId) {
+//        this.appId = appId;
+//    }
+//
+//    public String getAppKey() {
+//        return appKey;
+//    }
+//
+//    public void setAppKey(String appKey) {
+//        this.appKey = appKey;
+//    }
+//
+//    public Long getUserId() {
+//        return userId;
+//    }
+//
+//    public void setUserId(Long userId) {
+//        this.userId = userId;
+//    }
+//
+//    public String getAddressId() {
+//        return addressId;
+//    }
+//
+//    public void setAddressId(String addressId) {
+//        this.addressId = addressId;
+//    }
+//
+//    public Integer getCompanyType() {
+//        return companyType;
+//    }
+//
+//    public void setCompanyType(Integer companyType) {
+//        this.companyType = companyType;
+//    }
+//
+//    public static long getSerialVersionUID() {
+//        return serialVersionUID;
+//    }
+//
+//
+//
+//    public String getUserName() {
+//        return userName;
+//    }
+//
+//    public void setUserName(String userName) {
+//        this.userName = userName;
+//    }
+//
+//    public String getPassword() {
+//        return password;
+//    }
+//
+//    public void setPassword(String password) {
+//        this.password = password;
+//    }
+//
+//    public void setCompanyId(Long companyId)
+//    {
+//        this.companyId = companyId;
+//    }
+//
+//    public Long getCompanyId()
+//    {
+//        return companyId;
+//    }
+//    public void setCompanyName(String companyName)
+//    {
+//        this.companyName = companyName;
+//    }
+//
+//    public String getCompanyName()
+//    {
+//        return companyName;
+//    }
+//    public void setCompanyMobile(String companyMobile)
+//    {
+//        this.companyMobile = companyMobile;
+//    }
+//
+//    public String getCompanyMobile()
+//    {
+//        return companyMobile;
+//    }
+//    public void setCompanyAddress(String companyAddress)
+//    {
+//        this.companyAddress = companyAddress;
+//    }
+//
+//    public String getCompanyAddress()
+//    {
+//        return companyAddress;
+//    }
+//    public void setStatus(Integer status)
+//    {
+//        this.status = status;
+//    }
+//
+//    public Integer getStatus()
+//    {
+//        return status;
+//    }
+//    public void setStartTime(Date startTime)
+//    {
+//        this.startTime = startTime;
+//    }
+//
+//    public Date getStartTime()
+//    {
+//        return startTime;
+//    }
+//
+//    public void setMoney(BigDecimal money)
+//    {
+//        this.money = money;
+//    }
+//
+//    public BigDecimal getMoney()
+//    {
+//        return money;
+//    }
+//
+//    public void setVoiceApiId(Long voiceApiId)
+//    {
+//        this.voiceApiId = voiceApiId;
+//    }
+//
+//    public Long getVoiceApiId()
+//    {
+//        return voiceApiId;
+//    }
 
 
 }

+ 2 - 1
fs-service/src/main/java/com/fs/company/domain/CompanyUser.java

@@ -3,13 +3,14 @@ package com.fs.company.domain;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.BaseEntity;
+import lombok.Data;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
 import java.util.Date;
 import java.util.List;
 
-
+@Data
 public class CompanyUser extends BaseEntity
 {
     private static final long serialVersionUID = 1L;

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

@@ -14,6 +14,9 @@ import com.fs.his.domain.FsInquiryOrder;
 import com.fs.his.domain.FsStoreOrder;
 import com.fs.his.domain.FsStorePayment;
 import com.fs.his.vo.OptionsVO;
+import com.fs.hisStore.domain.FsStoreOrderScrm;
+import com.fs.hisStore.domain.FsStorePaymentScrm;
+import org.springframework.transaction.annotation.Transactional;
 
 
 /**
@@ -84,19 +87,33 @@ public interface ICompanyService
     void addCompanyTuiMoney(FsStoreOrder order);
 
 
+    @Transactional
+    void addCompanyTuiMoney(FsStoreOrderScrm order);
 
     void addCompanyMoney(FsStoreOrder order);
 
+    @Transactional
+    void addCompanyMoney(FsStoreOrderScrm order);
+
     void subCompanyMoney(FsStoreOrder order);
 
+    @Transactional
+    void subCompanyMoney(FsStoreOrderScrm order);
+
     Company selectCompanyByAppId(String appId);
 
     void resetMoney(Long companyId);
 
     void addCompanyPaymentMoney(FsStorePayment storePayment);
 
+    @Transactional
+    void addCompanyPaymentMoney(FsStorePaymentScrm storePayment);
+
     void subCompanyPaymentMoney(FsStorePayment payment);
 
+    @Transactional
+    void subCompanyPaymentMoney(FsStorePaymentScrm payment);
+
     String selectOmsCodeByCompanyId(Long companyId);
 
     void updateOmsCodeByCompanyIds(List<Long> companyIds,String omsCode);

+ 2 - 1
fs-service/src/main/java/com/fs/company/service/impl/CompanyRechargeOrderServiceImpl.java

@@ -5,9 +5,9 @@ import com.fs.common.utils.IpUtil;
 import com.fs.company.constant.PaymentStatus;
 import com.fs.company.domain.CompanyRechargeOrder;
 import com.fs.company.mapper.CompanyRechargeOrderMapper;
+import com.fs.company.util.OrderUtils;
 import com.fs.company.service.CompanyRechargeOrderService;
 import com.fs.core.config.WxPayProperties;
-import com.fs.wx.utils.OrderUtils;
 import com.github.binarywang.wxpay.bean.order.WxPayNativeOrderResult;
 import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest;
 import com.github.binarywang.wxpay.config.WxPayConfig;
@@ -23,6 +23,7 @@ import java.time.LocalDateTime;
 import java.util.List;
 
 @Service
+//public class CompanyRechargeOrderServiceImpl implements ICompanyRechargeOrderService {
 public class CompanyRechargeOrderServiceImpl implements CompanyRechargeOrderService {
     @Autowired
     private CompanyRechargeOrderMapper companyRechargeOrderMapper;

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

@@ -27,6 +27,9 @@ import com.fs.his.domain.FsStorePayment;
 import com.fs.his.dto.InquiryConfigDTO;
 import com.fs.his.mapper.FsStoreOrderMapper;
 import com.fs.his.vo.OptionsVO;
+import com.fs.hisStore.domain.FsStoreOrderScrm;
+import com.fs.hisStore.domain.FsStorePaymentScrm;
+import com.fs.hisStore.mapper.FsStoreOrderScrmMapper;
 import com.fs.store.config.CompanyMenuConfig;
 import com.fs.system.domain.SysConfig;
 import com.fs.system.mapper.SysConfigMapper;
@@ -76,6 +79,9 @@ public class CompanyServiceImpl implements ICompanyService
     private CompanyMoneyLogsMapper moneyLogsMapper;
     @Autowired
     private FsStoreOrderMapper storeOrderMapper;
+
+    @Autowired
+    private FsStoreOrderScrmMapper storeOrderScrmMapper;
     @Autowired
     private ICompanyProfitService companyProfitService;
     @Autowired
@@ -338,6 +344,28 @@ public class CompanyServiceImpl implements ICompanyService
         }
     }
 
+    @Override
+    @Transactional
+    public void addCompanyTuiMoney(FsStoreOrderScrm order) {
+        if(order.getCompanyId()!=null&&order.getCompanyId()>0){
+            Company company=companyMapper.selectCompanyByIdForUpdate(order.getCompanyId());
+            if(company!=null){
+                String json =configService.selectConfigByKey("his.store");
+                StoreConfig config= JSONUtil.toBean(json,StoreConfig.class);
+                //支付金额-(订单金额*rate%)
+                Double rate=config.getTuiMoneyRate()/100d;
+                BigDecimal tuiMoney=order.getPayPrice().subtract(order.getTotalPrice().multiply(new BigDecimal(rate)));
+                logger.info("写入公司推广佣金:"+tuiMoney);
+                company.setTuiMoney(company.getTuiMoney().add(tuiMoney));
+                companyMapper.updateCompany(company);
+                FsStoreOrderScrm storeOrderMap=new FsStoreOrderScrm();
+                storeOrderMap.setId(order.getId());
+                storeOrderMap.setTuiMoney(tuiMoney);
+                storeOrderScrmMapper.updateFsStoreOrder(storeOrderMap);
+            }
+        }
+    }
+
     @Override
     @Transactional
     public void addCompanyMoney(FsStoreOrder order) {
@@ -368,6 +396,36 @@ public class CompanyServiceImpl implements ICompanyService
         }
     }
 
+    @Override
+    @Transactional
+    public void addCompanyMoney(FsStoreOrderScrm order) {
+        if(order.getCompanyId()!=null&&order.getCompanyId()>0){
+            Company company=companyMapper.selectCompanyByIdForUpdate(order.getCompanyId());
+            if(company!=null){
+                FsStoreOrder orderMap=new FsStoreOrder();
+                orderMap.setOrderId(order.getId());
+                orderMap.setTuiMoneyStatus(1);
+                storeOrderMapper.updateFsStoreOrder(orderMap);
+                BigDecimal money = order.getPayMoney().add(order.getPayRemain());
+                company.setMoney(company.getMoney().add(money));
+                companyMapper.updateCompany(company);
+                CompanyMoneyLogs log=new CompanyMoneyLogs();
+                log.setCompanyId(company.getCompanyId());
+                log.setRemark("佣金入账");
+                log.setMoney(money);
+                log.setLogsType(3);
+                log.setBalance(company.getMoney());
+                log.setCreateTime(new Date());
+                log.setBusinessId(order.getId().toString());
+                moneyLogsMapper.insertCompanyMoneyLogs(log);
+                FsStoreOrderScrm fsStoreOrder = new FsStoreOrderScrm();
+                fsStoreOrder.setId(order.getId());
+                fsStoreOrder.setTuiMoneyStatus(1);
+                storeOrderScrmMapper.updateFsStoreOrder(fsStoreOrder);
+            }
+        }
+    }
+
     @Override
     @Transactional
     public void subCompanyMoney(FsStoreOrder order) {
@@ -390,6 +448,32 @@ public class CompanyServiceImpl implements ICompanyService
 
 
 
+            }
+        }
+    }
+
+    @Override
+    @Transactional
+    public void subCompanyMoney(FsStoreOrderScrm order) {
+        if(order.getCompanyId()>0){
+            Company company=companyMapper.selectCompanyByIdForUpdate(order.getCompanyId());
+            if(company!=null){
+                company.setMoney(company.getMoney().subtract(order.getTuiMoney()));
+                company.setTuiMoney(company.getTuiMoney().subtract(order.getTuiMoney()));
+                companyMapper.updateCompany(company);
+                //写入日志
+                CompanyMoneyLogs log=new CompanyMoneyLogs();
+                log.setCompanyId(order.getCompanyId());
+                log.setRemark("订单佣金退款");
+                log.setMoney(order.getTuiMoney().multiply(new BigDecimal(-1)));
+                log.setLogsType(4);
+                log.setBalance(company.getMoney());
+                log.setCreateTime(new Date());
+                log.setBusinessId(order.getId().toString());
+                moneyLogsMapper.insertCompanyMoneyLogs(log);
+
+
+
             }
         }
     }
@@ -474,6 +558,30 @@ public class CompanyServiceImpl implements ICompanyService
 
     }
 
+    @Override
+    @Transactional
+    public void addCompanyPaymentMoney(FsStorePaymentScrm storePayment) {
+        Company company=companyMapper.selectCompanyByIdForUpdate(storePayment.getCompanyId());
+        if(company!=null){
+            company.setMoney(company.getMoney().add(storePayment.getPayMoney()));
+            company.setTuiMoney(company.getTuiMoney().add(storePayment.getPayMoney()));
+            companyMapper.updateCompany(company);
+            //写入日志
+            CompanyMoneyLogs log=new CompanyMoneyLogs();
+            log.setCompanyId(storePayment.getCompanyId());
+            log.setRemark("收款佣金入帐");
+            log.setMoney(storePayment.getPayMoney());
+            log.setLogsType(8);
+            log.setBalance(company.getMoney());
+            log.setCreateTime(new Date());
+            log.setBusinessId(storePayment.getPaymentId().toString());
+            moneyLogsMapper.insertCompanyMoneyLogs(log);
+
+
+        }
+
+    }
+
     @Override
     @Transactional
     public void subCompanyPaymentMoney(FsStorePayment payment) {
@@ -495,6 +603,27 @@ public class CompanyServiceImpl implements ICompanyService
         }
     }
 
+    @Override
+    @Transactional
+    public void subCompanyPaymentMoney(FsStorePaymentScrm payment) {
+        Company company=companyMapper.selectCompanyByIdForUpdate(payment.getCompanyId());
+        if(company!=null){
+            company.setMoney(company.getMoney().subtract(payment.getRefundMoney()));
+            company.setTuiMoney(company.getTuiMoney().subtract(payment.getRefundMoney()));
+            companyMapper.updateCompany(company);
+            //写入日志
+            CompanyMoneyLogs log=new CompanyMoneyLogs();
+            log.setCompanyId(payment.getCompanyId());
+            log.setRemark("收款佣金退款");
+            log.setMoney(payment.getRefundMoney().multiply(new BigDecimal(-1)));
+            log.setLogsType(9);
+            log.setBalance(company.getMoney());
+            log.setCreateTime(new Date());
+            log.setBusinessId(payment.getPaymentId().toString());
+            moneyLogsMapper.insertCompanyMoneyLogs(log);
+        }
+    }
+
     @Override
     public String selectOmsCodeByCompanyId(Long companyId) {
         return companyMapper.selectOmsCodeByCompanyId(companyId);

+ 64 - 54
fs-service/src/main/java/com/fs/core/config/WxMpConfiguration.java

@@ -1,6 +1,8 @@
 package com.fs.core.config;
 
+import com.fs.wx.mp.handler.*;
 import lombok.AllArgsConstructor;
+import me.chanjar.weixin.mp.api.WxMpMessageRouter;
 import me.chanjar.weixin.mp.api.WxMpService;
 import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
 import me.chanjar.weixin.mp.config.impl.WxMpDefaultConfigImpl;
@@ -11,21 +13,29 @@ import org.springframework.context.annotation.Configuration;
 import java.util.List;
 import java.util.stream.Collectors;
 
+import static me.chanjar.weixin.common.api.WxConsts.EventType;
+import static me.chanjar.weixin.common.api.WxConsts.EventType.SUBSCRIBE;
+import static me.chanjar.weixin.common.api.WxConsts.EventType.UNSUBSCRIBE;
+import static me.chanjar.weixin.common.api.WxConsts.XmlMsgType;
+import static me.chanjar.weixin.common.api.WxConsts.XmlMsgType.EVENT;
+import static me.chanjar.weixin.mp.constant.WxMpEventConstants.CustomerService.*;
+import static me.chanjar.weixin.mp.constant.WxMpEventConstants.POI_CHECK_NOTIFY;
+
 
 @AllArgsConstructor
 @Configuration
 @EnableConfigurationProperties(WxMpProperties.class)
 public class WxMpConfiguration {
-//    private final LogHandler logHandler;
-//    private final NullHandler nullHandler;
-//    private final KfSessionHandler kfSessionHandler;
-//    private final StoreCheckNotifyHandler storeCheckNotifyHandler;
-//    private final LocationHandler locationHandler;
-//    private final MenuHandler menuHandler;
-//    private final MsgHandler msgHandler;
-//    private final UnsubscribeHandler unsubscribeHandler;
-//    private final SubscribeHandler subscribeHandler;
-//    private final ScanHandler scanHandler;
+    private final LogHandler logHandler;
+    private final NullHandler nullHandler;
+    private final KfSessionHandler kfSessionHandler;
+    private final StoreCheckNotifyHandler storeCheckNotifyHandler;
+    private final LocationHandler locationHandler;
+    private final MenuHandler menuHandler;
+    private final MsgHandler msgHandler;
+    private final UnsubscribeHandler unsubscribeHandler;
+    private final SubscribeHandler subscribeHandler;
+    private final ScanHandler scanHandler;
     private final WxMpProperties properties;
 
     @Bean
@@ -59,49 +69,49 @@ public class WxMpConfiguration {
         return service;
     }
 
-//    @Bean
-//    public WxMpMessageRouter messageRouter(WxMpService wxMpService) {
-//        final WxMpMessageRouter newRouter = new WxMpMessageRouter(wxMpService);
-//
-//        // 记录所有事件的日志 (异步执行)
-//        newRouter.rule().handler(this.logHandler).next();
-//
-//        // 接收客服会话管理事件
-//        newRouter.rule().async(false).msgType(EVENT).event(KF_CREATE_SESSION)
-//            .handler(this.kfSessionHandler).end();
-//        newRouter.rule().async(false).msgType(EVENT).event(KF_CLOSE_SESSION)
-//            .handler(this.kfSessionHandler).end();
-//        newRouter.rule().async(false).msgType(EVENT).event(KF_SWITCH_SESSION)
-//            .handler(this.kfSessionHandler).end();
-//
-//        // 门店审核事件
-//        newRouter.rule().async(false).msgType(EVENT).event(POI_CHECK_NOTIFY).handler(this.storeCheckNotifyHandler).end();
-//
-//        // 自定义菜单事件
-//        newRouter.rule().async(false).msgType(EVENT).event(EventType.CLICK).handler(this.menuHandler).end();
-//
-//        // 点击菜单连接事件
-//        newRouter.rule().async(false).msgType(EVENT).event(EventType.VIEW).handler(this.nullHandler).end();
-//
-//        // 关注事件
-//        newRouter.rule().async(false).msgType(EVENT).event(SUBSCRIBE).handler(this.subscribeHandler).end();
-//
-//        // 取消关注事件
-//        newRouter.rule().async(false).msgType(EVENT).event(UNSUBSCRIBE).handler(this.unsubscribeHandler).end();
-//
-//        // 上报地理位置事件
-//        newRouter.rule().async(false).msgType(EVENT).event(EventType.LOCATION).handler(this.locationHandler).end();
-//
-//        // 接收地理位置消息
-//        newRouter.rule().async(false).msgType(XmlMsgType.LOCATION).handler(this.locationHandler).end();
-//
-//        // 扫码事件
-//        newRouter.rule().async(false).msgType(EVENT).event(EventType.SCAN).handler(this.scanHandler).end();
-//
-//        // 默认
-//        newRouter.rule().async(false).handler(this.msgHandler).end();
-//
-//        return newRouter;
-//    }
+    @Bean
+    public WxMpMessageRouter messageRouter(WxMpService wxMpService) {
+        final WxMpMessageRouter newRouter = new WxMpMessageRouter(wxMpService);
+
+        // 记录所有事件的日志 (异步执行)
+        newRouter.rule().handler(this.logHandler).next();
+
+        // 接收客服会话管理事件
+        newRouter.rule().async(false).msgType(EVENT).event(KF_CREATE_SESSION)
+            .handler(this.kfSessionHandler).end();
+        newRouter.rule().async(false).msgType(EVENT).event(KF_CLOSE_SESSION)
+            .handler(this.kfSessionHandler).end();
+        newRouter.rule().async(false).msgType(EVENT).event(KF_SWITCH_SESSION)
+            .handler(this.kfSessionHandler).end();
+
+        // 门店审核事件
+        newRouter.rule().async(false).msgType(EVENT).event(POI_CHECK_NOTIFY).handler(this.storeCheckNotifyHandler).end();
+
+        // 自定义菜单事件
+        newRouter.rule().async(false).msgType(EVENT).event(EventType.CLICK).handler(this.menuHandler).end();
+
+        // 点击菜单连接事件
+        newRouter.rule().async(false).msgType(EVENT).event(EventType.VIEW).handler(this.nullHandler).end();
+
+        // 关注事件
+        newRouter.rule().async(false).msgType(EVENT).event(SUBSCRIBE).handler(this.subscribeHandler).end();
+
+        // 取消关注事件
+        newRouter.rule().async(false).msgType(EVENT).event(UNSUBSCRIBE).handler(this.unsubscribeHandler).end();
+
+        // 上报地理位置事件
+        newRouter.rule().async(false).msgType(EVENT).event(EventType.LOCATION).handler(this.locationHandler).end();
+
+        // 接收地理位置消息
+        newRouter.rule().async(false).msgType(XmlMsgType.LOCATION).handler(this.locationHandler).end();
+
+        // 扫码事件
+        newRouter.rule().async(false).msgType(EVENT).event(EventType.SCAN).handler(this.scanHandler).end();
+
+        // 默认
+        newRouter.rule().async(false).handler(this.msgHandler).end();
+
+        return newRouter;
+    }
 
 }

+ 57 - 1
fs-service/src/main/java/com/fs/core/config/WxPayProperties.java

@@ -3,8 +3,8 @@ package com.fs.core.config;
 import lombok.Data;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 
-@Data
 @ConfigurationProperties(prefix = "wx.pay")
+@Data
 public class WxPayProperties {
   /**
    * 设置微信公众号或者小程序等的appid
@@ -47,4 +47,60 @@ public class WxPayProperties {
   private String certSerialNo;
 
   private String nativeNotifyUrl;
+
+  public String getAppId() {
+    return appId;
+  }
+
+  public void setAppId(String appId) {
+    this.appId = appId;
+  }
+
+  public String getMchId() {
+    return mchId;
+  }
+
+  public void setMchId(String mchId) {
+    this.mchId = mchId;
+  }
+
+  public String getMchKey() {
+    return mchKey;
+  }
+
+  public void setMchKey(String mchKey) {
+    this.mchKey = mchKey;
+  }
+
+  public String getSubAppId() {
+    return subAppId;
+  }
+
+  public void setSubAppId(String subAppId) {
+    this.subAppId = subAppId;
+  }
+
+  public String getSubMchId() {
+    return subMchId;
+  }
+
+  public void setSubMchId(String subMchId) {
+    this.subMchId = subMchId;
+  }
+
+  public String getKeyPath() {
+    return keyPath;
+  }
+
+  public void setKeyPath(String keyPath) {
+    this.keyPath = keyPath;
+  }
+
+  public String getNotifyUrl() {
+    return notifyUrl;
+  }
+
+  public void setNotifyUrl(String notifyUrl) {
+    this.notifyUrl = notifyUrl;
+  }
 }

+ 2 - 0
fs-service/src/main/java/com/fs/course/config/RedPacketConfig.java

@@ -50,6 +50,8 @@ public class RedPacketConfig implements Serializable {
 
     private String notifyUrl;
 
+    private String notifyUrlScrm;
+
     private Integer isNew;//0:老商户 商家转账到零钱 1:新商户 商家转账
 
 }

+ 1 - 0
fs-service/src/main/java/com/fs/course/domain/FsCourseRedPacketLog.java

@@ -3,6 +3,7 @@ package com.fs.course.domain;
 import java.math.BigDecimal;
 import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.BaseEntity;
+import com.fs.common.core.domain.R;
 import lombok.Data;
 
 /**

+ 8 - 0
fs-service/src/main/java/com/fs/course/mapper/FsCourseRedPacketLogMapper.java

@@ -160,4 +160,12 @@ public interface FsCourseRedPacketLogMapper
     @Select("select * from fs_course_red_packet_log where video_id = #{videoId} and user_id = #{userId} and period_id = #{periodId} limit 1")
     FsCourseRedPacketLog selectUserFsCourseRedPacketLog(@Param("videoId") Long videoId, @Param("userId")Long userId, @Param("periodId")Long periodId);
 
+    @Select("SELECT * FROM fs_course_red_packet_log \n" +
+            "WHERE create_time <= DATE_SUB(NOW(), INTERVAL 10 MINUTE)  -- 10 分钟前或更早\n" +
+            "AND create_time >= DATE(NOW())  -- 但必须是今天\n" +
+            "AND status = 0;")
+    List<FsCourseRedPacketLog> selectFail();
+
+    @Select("SELECT * FROM fs_course_red_packet_log WHERE status = 0 and create_time > DATE_SUB(NOW(), INTERVAL 2 day) and company_user_id =#{userId}")
+    List<FsCourseRedPacketLog> selectFail(@Param("userId") Long userId);
 }

+ 2 - 0
fs-service/src/main/java/com/fs/course/service/IFsCourseRedPacketLogService.java

@@ -66,6 +66,8 @@ public interface IFsCourseRedPacketLogService
 
     R syncRedPacket(String outBatchNo);
 
+    R syncRedPacket(String outBatchNo, String batchId);
+
     List<FsCourseRedPacketLogListPVO> selectFsCourseRedPacketLogListVO(FsCourseRedPacketLogParam fsCourseRedPacketLog);
     List<FsCourseRedPacketLogListPVO> selectFsCourseRedPacketLogListVONew(FsCourseRedPacketLogParam fsCourseRedPacketLog);
 

+ 2 - 0
fs-service/src/main/java/com/fs/course/service/IFsUserCourseVideoService.java

@@ -180,6 +180,8 @@ public interface IFsUserCourseVideoService
 
     String selectFsUserCourseVideoByVideoForTitle(Long videoId);
 
+    R checkUserInfo(long l);
+
     R updateVideo();
 
     R checkUserInfo(Long userId);

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

@@ -1,7 +1,6 @@
 package com.fs.course.service.impl;
 
 import java.math.BigDecimal;
-import java.util.Collections;
 import java.util.Date;
 import java.util.List;
 
@@ -135,6 +134,19 @@ public class FsCourseRedPacketLogServiceImpl implements IFsCourseRedPacketLogSer
         return R.error("批次不存在");
     }
 
+    @Override
+    public R syncRedPacket(String outBatchNo, String batchId) {
+        FsCourseRedPacketLog log = fsCourseRedPacketLogMapper.selectFsCourseRedPacketLogByBatchNo(outBatchNo);
+        if (log!=null){
+            log.setStatus(1);
+            log.setUpdateTime(new Date());
+            log.setBatchId(batchId);
+            fsCourseRedPacketLogMapper.updateFsCourseRedPacketLog(log);
+            return R.ok();
+        }
+        return R.error("批次不存在");
+    }
+
     @Override
     public List<FsCourseRedPacketLogListPVO> selectFsCourseRedPacketLogListVO(FsCourseRedPacketLogParam fsCourseRedPacketLog) {
         return fsCourseRedPacketLogMapper.selectFsCourseRedPacketLogListVO(fsCourseRedPacketLog);

+ 21 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -2300,6 +2300,27 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
         return fsUserCourseVideoMapper.selectFsUserCourseVideoByVideoForTitle(videoId);
     }
 
+    @Override
+    public R checkUserInfo(long userId) {
+        FsUser user=fsUserService.selectFsUserById(userId);
+        if (user==null) {
+            return R.error(404,"用户不存在!");
+        }
+        //读取配置给前端返回
+        String json = sysConfigService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+        if (StringUtils.isEmpty(user.getNickName())){
+            Map<String,Object> map = new HashMap<>();
+            map.put("authType",config.getMiniAppAuthType());
+            if (config.getMiniAppAuthType()==2){
+                map.put("domain",config.getUserCourseAuthDomain());
+            }
+            map.put("code",500);
+            return R.ok(map);
+        }
+        return R.ok().put("user",user);
+    }
+
     /**
      * 获取视频时长(优先从Redis获取,不存在则查数据库)
      */

+ 2 - 0
fs-service/src/main/java/com/fs/crm/service/ICrmCustomerService.java

@@ -162,5 +162,7 @@ public interface ICrmCustomerService
 
     List<JSONObject> selectCrmCustomerCycleCounts(Map<String, Object> map);
 
+    void computePayMoney();
+
     List<CrmMyCustomerListQueryVO> selectCrmMyAssistListQuery(CrmMyCustomerListQueryParam param);
 }

+ 28 - 0
fs-service/src/main/java/com/fs/crm/service/impl/CrmCustomerServiceImpl.java

@@ -26,6 +26,8 @@ import com.fs.crm.param.*;
 import com.fs.crm.service.ICrmCustomerService;
 import com.fs.crm.service.ICrmMsgService;
 import com.fs.crm.vo.*;
+import com.fs.hisStore.domain.FsStoreOrderScrm;
+import com.fs.hisStore.mapper.FsStoreOrderScrmMapper;
 import com.fs.jpush.service.JpushService;
 import com.fs.qwApi.param.QwCustomerDetailParam;
 import com.fs.system.service.ISysDictDataService;
@@ -40,6 +42,7 @@ import org.springframework.transaction.annotation.Transactional;
 import java.math.BigDecimal;
 import java.util.*;
 import java.util.concurrent.CompletableFuture;
+import java.util.stream.Collectors;
 
 /**
  * 客户Service业务层处理
@@ -78,6 +81,9 @@ public class CrmCustomerServiceImpl extends ServiceImpl<CrmCustomerMapper, CrmCu
     private CrmIndexDataMapper crmIndexDataMapper;
     @Autowired
     private ISysDictTypeService dictTypeService;
+
+    @Autowired
+    private FsStoreOrderScrmMapper fsStoreOrderMapper;
     /**
      * 查询客户
      *
@@ -981,6 +987,28 @@ public class CrmCustomerServiceImpl extends ServiceImpl<CrmCustomerMapper, CrmCu
         return crmCustomerMapper.selectCrmCustomerCycleCounts(map);
     }
 
+    @Override
+    public void computePayMoney() {
+        //1.查询用户
+        CrmCustomer crmCustomer = new CrmCustomer();
+        crmCustomer.setIsDel(0);
+        List<CrmCustomer> crmCustomers = selectCrmCustomerList(crmCustomer);
+//        crmCustomers = crmCustomers.stream().filter(item -> item.getUserId() != null).collect(Collectors.toList());
+        List<Long> customerIds = crmCustomers.stream().map(CrmCustomer::getCustomerId).collect(Collectors.toList());
+        if (!customerIds.isEmpty()){
+            List<FsStoreOrderScrm> map = fsStoreOrderMapper.computePayMoney(customerIds);
+            if (map != null && !map.isEmpty()){
+                map.forEach(item ->{
+                    CrmCustomer addParam = new CrmCustomer();
+                    addParam.setCustomerId(item.getCustomerId());
+                    addParam.setPayMoney(item.getPayPrice());
+                    crmCustomerMapper.updateCrmCustomer(addParam);
+                });
+
+            }
+        }
+    }
+
     @Override
     public List<CrmMyCustomerListQueryVO> selectCrmMyAssistListQuery(CrmMyCustomerListQueryParam param) {
         List<CrmMyCustomerListQueryVO> vos = crmCustomerMapper.selectCrmMyAssistListQuery(param);

+ 3 - 0
fs-service/src/main/java/com/fs/erp/domain/ErpRefundOrder.java

@@ -14,4 +14,7 @@ public class ErpRefundOrder {
     String orderCode;
     Long afterSalesId;
 
+    //运单号
+    String deliverySn;
+
 }

+ 29 - 0
fs-service/src/main/java/com/fs/erp/domain/KbStockRequest.java

@@ -0,0 +1,29 @@
+package com.fs.erp.domain;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import lombok.Builder;
+import lombok.Data;
+
+@Data
+@Builder
+public class KbStockRequest {
+
+    /**
+     * 单据ID
+     */
+    @JSONField(name = "key", ordinal = 1)
+    @Builder.Default
+    private String key = "GoodStock";
+
+    /**
+     * 仓库编码
+     */
+    @JSONField(name = "ckid", ordinal = 2)
+    private String stockCode;
+
+    /**
+     * 商品编码 【注:不传值,默认查询对应仓库所有商品库存;传值查询对应商品库存。传值格式为:商品编码+英文逗号。如:123,456,789】
+     */
+    @JSONField(name = "cgoodsid", ordinal = 3)
+    private String goodsCode;
+}

+ 48 - 0
fs-service/src/main/java/com/fs/erp/domain/KbStockResponse.java

@@ -0,0 +1,48 @@
+package com.fs.erp.domain;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.annotation.JSONField;
+import lombok.Data;
+
+@Data
+public class KbStockResponse {
+
+    /**
+     * true:请求成功;false:请求失败;
+     */
+    @JSONField(name = "IsSuccess")
+    private Boolean success;
+
+    /**
+     * 提示消息
+     */
+    @JSONField(name = "errmsg")
+    private String msg;
+
+    /**
+     * 返回数据
+     */
+    @JSONField(name = "data")
+    private String data;
+
+    /**
+     * 库存
+     */
+    private Integer stock;
+
+    public Integer getStock() {
+        int stocks = 0;
+        JSONArray dataArray = JSON.parseArray(this.data);
+        for (int i = 0; i < dataArray.size(); i++) {
+            JSONObject base = dataArray.getJSONObject(i);
+            for (Object item : base.getJSONArray("base")) {
+                JSONObject json = (JSONObject) item;
+                stocks += json.getIntValue("fqty");
+            }
+        }
+
+        return stocks;
+    }
+}

+ 33 - 0
fs-service/src/main/java/com/fs/erp/domain/KingbosOrderD1Data.java

@@ -0,0 +1,33 @@
+package com.fs.erp.domain;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class KingbosOrderD1Data {
+    // OMS发货单号
+    private String cdo_id;
+    // OMS订单号
+    private String co_id;
+    // 药品编码
+    private String csku_id;
+    // ERP药品编码
+    private String cgoodsid;
+    // 药品名称
+    private String cname;
+    // 规格代码
+    private String cshop_sku_id;
+    // 数量
+    private BigDecimal iqty;
+    // 单价
+    private BigDecimal fprice;
+    // 总金额
+    private BigDecimal famount;
+    // 订单来源平台
+    private String cordersource;
+    // 是否退款
+    private Integer isreturn;
+    // 优惠金额
+    private BigDecimal fpromoamount;
+}

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません