Bläddra i källkod

Merge branch 'refs/heads/master' into cg_live_dev

# Conflicts:
#	fs-admin/src/main/java/com/fs/course/controller/FsUserTalentController.java
#	fs-admin/src/main/java/com/fs/his/task/Task.java
#	fs-common/src/main/java/com/fs/common/utils/DateUtils.java
#	fs-company/src/main/java/com/fs/company/controller/company/CompanyUserController.java
#	fs-service/src/main/java/com/fs/company/mapper/CompanyMapper.java
#	fs-service/src/main/java/com/fs/his/mapper/FsStoreProductMapper.java
#	fs-service/src/main/java/com/fs/his/mapper/FsUserMapper.java
#	fs-service/src/main/java/com/fs/his/service/IFsStoreProductService.java
#	fs-service/src/main/java/com/fs/his/service/IFsUserService.java
#	fs-service/src/main/java/com/fs/his/service/impl/FsStoreProductServiceImpl.java
#	fs-service/src/main/java/com/fs/his/service/impl/FsUserServiceImpl.java
#	fs-service/src/main/resources/mapper/his/FsStoreProductMapper.xml
#	fs-user-app/src/main/java/com/fs/app/controller/WxPayController.java
yuhongqi 1 månad sedan
förälder
incheckning
ef214eb383
100 ändrade filer med 8716 tillägg och 166 borttagningar
  1. 1 2
      .gitignore
  2. 9 0
      fs-admin/pom.xml
  3. 11 0
      fs-admin/src/main/java/com/fs/api/controller/IndexStatisticsController.java
  4. 107 0
      fs-admin/src/main/java/com/fs/bean/AliPayBean.java
  5. 2 1
      fs-admin/src/main/java/com/fs/company/controller/CompanyController.java
  6. 148 0
      fs-admin/src/main/java/com/fs/company/controller/CompanyDeductController.java
  7. 3 3
      fs-admin/src/main/java/com/fs/company/controller/CompanyDomainBindController.java
  8. 7 7
      fs-admin/src/main/java/com/fs/company/controller/CompanyDomainController.java
  9. 143 0
      fs-admin/src/main/java/com/fs/company/controller/CompanyRechargeController.java
  10. 63 0
      fs-admin/src/main/java/com/fs/company/controller/CompanyRedPackageController.java
  11. 16 4
      fs-admin/src/main/java/com/fs/company/controller/CompanyStatisticsController.java
  12. 3 2
      fs-admin/src/main/java/com/fs/company/controller/CompanyUserController.java
  13. 121 0
      fs-admin/src/main/java/com/fs/course/controller/FsCoursePlaySourceConfigController.java
  14. 103 0
      fs-admin/src/main/java/com/fs/course/controller/FsCourseProductController.java
  15. 152 0
      fs-admin/src/main/java/com/fs/course/controller/FsCourseProductOrderController.java
  16. 36 2
      fs-admin/src/main/java/com/fs/course/controller/FsCourseQuestionBankController.java
  17. 18 8
      fs-admin/src/main/java/com/fs/course/controller/FsCourseTrafficLogController.java
  18. 20 0
      fs-admin/src/main/java/com/fs/course/controller/FsCourseWatchCommentController.java
  19. 10 0
      fs-admin/src/main/java/com/fs/course/controller/FsUserCourseComplaintRecordController.java
  20. 56 0
      fs-admin/src/main/java/com/fs/course/controller/FsUserCourseController.java
  21. 40 8
      fs-admin/src/main/java/com/fs/course/controller/FsUserCoursePeriodController.java
  22. 29 1
      fs-admin/src/main/java/com/fs/course/controller/FsUserCourseTrainingCampController.java
  23. 65 1
      fs-admin/src/main/java/com/fs/course/controller/FsUserCourseVideoController.java
  24. 6 0
      fs-admin/src/main/java/com/fs/course/controller/FsUserTalentController.java
  25. 12 0
      fs-admin/src/main/java/com/fs/course/controller/FsUserVideoController.java
  26. 145 0
      fs-admin/src/main/java/com/fs/course/controller/FsUserWatchCourseStatisticsController.java
  27. 118 0
      fs-admin/src/main/java/com/fs/course/controller/FsUserWatchStatisticsController.java
  28. 76 2
      fs-admin/src/main/java/com/fs/course/controller/FsVideoResourceController.java
  29. 11 0
      fs-admin/src/main/java/com/fs/course/controller/qw/QwFsCourseWatchLogController.java
  30. 24 2
      fs-admin/src/main/java/com/fs/crm/controller/CrmCustomerController.java
  31. 84 0
      fs-admin/src/main/java/com/fs/crm/controller/CrmCustomerLevelController.java
  32. 54 0
      fs-admin/src/main/java/com/fs/crm/controller/ReportController.java
  33. 97 0
      fs-admin/src/main/java/com/fs/fastGpt/FastGptChatReplaceTextController.java
  34. 112 0
      fs-admin/src/main/java/com/fs/fastGpt/FastGptKeywordSendController.java
  35. 97 0
      fs-admin/src/main/java/com/fs/fastGpt/FastgptChatArtificialWordsController.java
  36. 139 0
      fs-admin/src/main/java/com/fs/fastGpt/FastgptEventLogTotalController.java
  37. 126 0
      fs-admin/src/main/java/com/fs/fastGpt/FastgptExtUserTagController.java
  38. 23 4
      fs-admin/src/main/java/com/fs/his/controller/FsArticleCateController.java
  39. 6 0
      fs-admin/src/main/java/com/fs/his/controller/FsCityController.java
  40. 1 0
      fs-admin/src/main/java/com/fs/his/controller/FsCompanyController.java
  41. 22 3
      fs-admin/src/main/java/com/fs/his/controller/FsDoctorArticleCateController.java
  42. 13 3
      fs-admin/src/main/java/com/fs/his/controller/FsDoctorArticleController.java
  43. 106 0
      fs-admin/src/main/java/com/fs/his/controller/FsFirstDiagnosisController.java
  44. 103 0
      fs-admin/src/main/java/com/fs/his/controller/FsHfpayConfigController.java
  45. 99 0
      fs-admin/src/main/java/com/fs/his/controller/FsHomeArticleCategoryController.java
  46. 94 0
      fs-admin/src/main/java/com/fs/his/controller/FsHomeArticleController.java
  47. 93 0
      fs-admin/src/main/java/com/fs/his/controller/FsHomeArticleViewController.java
  48. 1 1
      fs-admin/src/main/java/com/fs/his/controller/FsInquiryOrderController.java
  49. 52 0
      fs-admin/src/main/java/com/fs/his/controller/FsInquiryPatientInfoController.java
  50. 12 1
      fs-admin/src/main/java/com/fs/his/controller/FsIntegralOrderController.java
  51. 10 8
      fs-admin/src/main/java/com/fs/his/controller/FsPackageCateController.java
  52. 2 0
      fs-admin/src/main/java/com/fs/his/controller/FsPackageOrderController.java
  53. 64 0
      fs-admin/src/main/java/com/fs/his/controller/FsPackageSolarTermController.java
  54. 114 0
      fs-admin/src/main/java/com/fs/his/controller/FsPhysicalReportTemplateController.java
  55. 140 0
      fs-admin/src/main/java/com/fs/his/controller/FsPhysicalReportTemplateFieldController.java
  56. 267 52
      fs-admin/src/main/java/com/fs/his/controller/FsStoreOrderController.java
  57. 3 1
      fs-admin/src/main/java/com/fs/his/controller/FsStorePaymentController.java
  58. 0 1
      fs-admin/src/main/java/com/fs/his/controller/FsStoreProductPackageController.java
  59. 180 21
      fs-admin/src/main/java/com/fs/his/controller/FsUserController.java
  60. 121 0
      fs-admin/src/main/java/com/fs/his/controller/FsUserOnlineStateController.java
  61. 46 0
      fs-admin/src/main/java/com/fs/his/controller/FsUserOperationLogController.java
  62. 57 5
      fs-admin/src/main/java/com/fs/his/controller/HzOMSErpApiController.java
  63. 20 0
      fs-admin/src/main/java/com/fs/his/task/SendRedPacketTask.java
  64. 329 23
      fs-admin/src/main/java/com/fs/his/task/Task.java
  65. 56 0
      fs-admin/src/main/java/com/fs/his/task/WatchCourseTask.java
  66. 19 0
      fs-admin/src/main/java/com/fs/his/task/trafficlog/TrafficlogTask.java
  67. 98 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsMaterialGroupScrmController.java
  68. 90 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsMaterialScrmController.java
  69. 97 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsMenuScrmController.java
  70. 97 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsPrescribeDrugScrmController.java
  71. 103 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsPrescribeScrmController.java
  72. 97 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsShippingTemplatesFreeScrmController.java
  73. 97 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsShippingTemplatesRegionScrmController.java
  74. 106 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsShippingTemplatesScrmController.java
  75. 107 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreActivityScrmController.java
  76. 97 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreAfterSalesItemScrmController.java
  77. 198 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreAfterSalesScrmController.java
  78. 97 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreAfterSalesStatusScrmController.java
  79. 52 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreCanvasScrmController.java
  80. 97 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreCartScrmController.java
  81. 98 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreCouponIssueScrmController.java
  82. 97 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreCouponIssueUserScrmController.java
  83. 146 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreCouponScrmController.java
  84. 102 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreCouponUserScrmController.java
  85. 231 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreHealthOrderScrmController.java
  86. 41 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreOrderAuditScrmController.java
  87. 97 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreOrderItemScrmController.java
  88. 97 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreOrderNoticeScrmController.java
  89. 97 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreOrderOfflineItemScrmController.java
  90. 159 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreOrderOfflineScrmController.java
  91. 162 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreOrderPromotionScrmController.java
  92. 659 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreOrderScrmController.java
  93. 54 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreOrderStatisticsScrmController.java
  94. 97 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreOrderStatusScrmController.java
  95. 298 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStorePaymentScrmController.java
  96. 97 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreProductAttrScrmController.java
  97. 99 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreProductAttrValueScrmController.java
  98. 105 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreProductCategoryScrmController.java
  99. 97 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreProductDetailsScrmController.java
  100. 133 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreProductGroupScrmController.java

+ 1 - 2
.gitignore

@@ -6,8 +6,7 @@ target/
 !**/src/main/**/target/
 !**/src/test/**/target/
 #logback.xml
-application-druid-rt.yml
-application-druid-yjf.yml
+application.yml
 
 ### STS ###
 .apt_generated

+ 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>

+ 11 - 0
fs-admin/src/main/java/com/fs/api/controller/IndexStatisticsController.java

@@ -4,6 +4,8 @@ import com.fs.common.core.domain.R;
 import com.fs.common.core.redis.RedisCache;
 import com.fs.statis.StatisticsRedisConstant;
 import com.fs.statis.dto.*;
+import com.fs.system.domain.SysConfig;
+import com.fs.system.service.ISysConfigService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -20,6 +22,9 @@ import static com.fs.statis.StatisticsRedisConstant.*;
 public class IndexStatisticsController {
     @Autowired
     private RedisCache redisCache;
+
+    @Autowired
+    private ISysConfigService sysConfigService;
     /**
      * 分析概览
      */
@@ -59,6 +64,12 @@ public class IndexStatisticsController {
     @GetMapping("/trafficLog")
     public R getTrafficLog(){
         TrafficLogDTO trafficLogDTO = redisCache.getCacheObject(DATA_OVERVIEW_TRAFFIC_LOG);
+        SysConfig sysConfig = sysConfigService.selectConfigByConfigKey("redPacket.Traffic.config");
+        if(trafficLogDTO == null || sysConfig == null) {
+            return null;
+        }
+        String configValue = sysConfig.getConfigValue();
+        trafficLogDTO.setTraffic(configValue);
         return R.ok().put("data",trafficLogDTO);
     }
 

+ 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 + '\'' +
+                '}';
+    }
+}

+ 2 - 1
fs-admin/src/main/java/com/fs/company/controller/CompanyController.java

@@ -132,6 +132,7 @@ public class CompanyController extends BaseController
                 callerService.updateCompanyVoiceCaller(caller);
             }
         }
+        company.setUpdateMiniApp(true);
         return toAjax(companyService.updateCompany(company));
     }
 
@@ -174,7 +175,7 @@ public class CompanyController extends BaseController
     public AjaxResult resetPwd(@PathVariable Long companyId)
     {
         Company company=companyService.selectCompanyById(companyId);
-        return toAjax(userService.resetUserPwdByUserId(company.getUserId(),SecurityUtils.encryptPassword("123456")));
+        return toAjax(userService.resetUserPwdByUserId(company.getUserId(),SecurityUtils.encryptPassword("cq654321!!")));
     }
 
 //    @PreAuthorize("@ss.hasPermi('company:company:resetMoney')")

+ 148 - 0
fs-admin/src/main/java/com/fs/company/controller/CompanyDeductController.java

@@ -0,0 +1,148 @@
+package com.fs.company.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.domain.model.LoginUser;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.company.domain.Company;
+import com.fs.company.domain.CompanyDeduct;
+import com.fs.company.domain.CompanyMoneyLogs;
+import com.fs.company.service.ICompanyDeductService;
+import com.fs.company.service.ICompanyMoneyLogsService;
+import com.fs.company.service.ICompanyService;
+import com.fs.company.vo.CompanyDeductExportVO;
+import com.fs.company.vo.CompanyDeductVO;
+import com.fs.framework.web.service.TokenService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 扣款Controller
+ *
+ * @author fs
+ * @date 2023-02-27
+ */
+@RestController
+@RequestMapping("/company/companyDeduct")
+public class CompanyDeductController extends BaseController
+{
+    @Autowired
+    private ICompanyDeductService companyDeductService;
+    @Autowired
+    private TokenService tokenService;
+    @Autowired
+    private ICompanyService companyService;
+    @Autowired
+    private ICompanyMoneyLogsService moneyLogsService;
+    /**
+     * 查询扣款列表
+     */
+    @PreAuthorize("@ss.hasPermi('company:companyDeduct:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CompanyDeduct companyDeduct)
+    {
+        startPage();
+        List<CompanyDeductVO> list = companyDeductService.selectCompanyDeductVOList(companyDeduct);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出扣款列表
+     */
+    @PreAuthorize("@ss.hasPermi('company:companyDeduct:export')")
+    @Log(title = "扣款", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(CompanyDeduct companyDeduct)
+    {
+        List<CompanyDeductExportVO> list = companyDeductService.selectCompanyExportDeductList(companyDeduct);
+        ExcelUtil<CompanyDeductExportVO> util = new ExcelUtil<CompanyDeductExportVO>(CompanyDeductExportVO.class);
+        return util.exportExcel(list, "companyDeduct");
+    }
+
+    /**
+     * 获取扣款详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('company:companyDeduct:query')")
+    @GetMapping(value = "/{deductId}")
+    public AjaxResult getInfo(@PathVariable("deductId") Long deductId)
+    {
+        return AjaxResult.success(companyDeductService.selectCompanyDeductById(deductId));
+    }
+
+    /**
+     * 新增扣款
+     */
+    @PreAuthorize("@ss.hasPermi('company:companyDeduct:add')")
+    @Log(title = "扣款", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CompanyDeduct companyDeduct)
+    {
+        return toAjax(companyDeductService.insertCompanyDeduct(companyDeduct));
+    }
+
+    /**
+     * 修改扣款
+     */
+    @PreAuthorize("@ss.hasPermi('company:companyDeduct:edit')")
+    @Log(title = "扣款", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody CompanyDeduct companyDeduct)
+    {
+        return toAjax(companyDeductService.updateCompanyDeduct(companyDeduct));
+    }
+
+    /**
+     * 删除扣款
+     */
+    @PreAuthorize("@ss.hasPermi('company:companyDeduct:remove')")
+    @Log(title = "扣款", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{deductIds}")
+    public AjaxResult remove(@PathVariable Long[] deductIds)
+    {
+        return toAjax(companyDeductService.deleteCompanyDeductByIds(deductIds));
+    }
+
+
+    @PreAuthorize("@ss.hasPermi('company:companyDeduct:audit')")
+    @PostMapping("/audit")
+    @Transactional
+    public R audit(@RequestBody CompanyDeduct param)
+    {
+        CompanyDeduct deduct=companyDeductService.selectCompanyDeductById(param.getDeductId());
+        if(deduct.getIsAudit()!=0){
+            return R.error("非法操作");
+        }
+        deduct.setIsAudit(param.getIsAudit());
+        deduct.setRemark(param.getRemark());
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        if(deduct.getIsAudit()==1){
+            Company company=companyService.selectCompanyByIdForUpdate(deduct.getCompanyId());
+            company.setMoney(company.getMoney().subtract(deduct.getMoney()));
+            companyService.updateCompany(company);
+            CompanyMoneyLogs log=new CompanyMoneyLogs();
+            log.setCompanyId(deduct.getCompanyId());
+            log.setMoney(deduct.getMoney().multiply(new BigDecimal(-1)));
+            log.setRemark(deduct.getRemark());
+            log.setLogsType(2);
+            log.setBalance(company.getMoney());
+            log.setCreateTime(new Date());
+            moneyLogsService.insertCompanyMoneyLogs(log);
+        }
+        deduct.setAuditTime(new Date());
+        deduct.setAuditUserId(loginUser.getUser().getUserId());
+        companyDeductService.updateCompanyDeduct(deduct);
+        return R.ok("操作成功");
+
+    }
+}

+ 3 - 3
fs-admin/src/main/java/com/fs/company/controller/CompanyDomainBindController.java

@@ -3,7 +3,7 @@ package com.fs.company.controller;
 import java.util.List;
 
 import cn.hutool.core.util.ObjectUtil;
-import com.baomidou.mybatisplus.extension.api.R;
+import com.fs.common.core.domain.R;
 import com.fs.common.core.domain.model.LoginUser;
 import com.fs.common.utils.ServletUtils;
 import com.fs.company.param.CompanyDomainBindParam;
@@ -118,10 +118,10 @@ public class CompanyDomainBindController extends BaseController
     @PostMapping("/domainBatchBinding")
     public R domainBatchBinding(@RequestBody CompanyDomainBindParam param) {
         if (ObjectUtil.isEmpty(param.getCompanyIds()) || param.getCompanyIds().isEmpty()) {
-            return R.failed("绑定失败,至少有一条域名分配信息!");
+            return R.error("绑定失败,至少有一条域名分配信息!");
         }
         if (ObjectUtil.isEmpty(param.getCompanyUserIds()) || param.getCompanyUserIds().isEmpty()) {
-            return R.failed("绑定失败,至少有一条分配人员信息!");
+            return R.error("绑定失败,至少有一条分配人员信息!");
         }
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         param.setUserId(loginUser.getUser().getUserId().toString());

+ 7 - 7
fs-admin/src/main/java/com/fs/company/controller/CompanyDomainController.java

@@ -3,7 +3,7 @@ package com.fs.company.controller;
 import java.util.List;
 
 import cn.hutool.core.util.ObjectUtil;
-import com.baomidou.mybatisplus.extension.api.R;
+import com.fs.common.core.domain.R;
 import com.fs.common.core.domain.model.LoginUser;
 import com.fs.common.exception.ServiceException;
 import com.fs.common.utils.ServletUtils;
@@ -127,10 +127,10 @@ public class CompanyDomainController extends BaseController {
     @PostMapping("/domainBatchBinding")
     public R domainBatchBinding(@RequestBody CompanyDomainParam param) {
         if (ObjectUtil.isEmpty(param.getDomainIds()) || param.getDomainIds().isEmpty()) {
-            return R.failed("绑定失败,至少有一条绑定域名信息!");
+            return R.error("绑定失败,至少有一条绑定域名信息!");
         }
         if (ObjectUtil.isEmpty(param.getCompanyIds()) || param.getCompanyIds().isEmpty()) {
-            return R.failed("绑定失败,至少有一条绑定公司信息!");
+            return R.error("绑定失败,至少有一条绑定公司信息!");
         }
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         param.setUserId(loginUser.getUser().getUserId().toString());
@@ -151,18 +151,18 @@ public class CompanyDomainController extends BaseController {
     public R importDomainData(MultipartFile file) {
         // 1. 检查文件是否为空
         if (file.isEmpty()) {
-            return R.failed("上传的文件不能为空");
+            return R.error("上传的文件不能为空");
         }
 
         // 2. 检查文件大小
         if (file.getSize() > MAX_FILE_SIZE) {
-            return R.failed("文件大小不能超过5MB");
+            return R.error("文件大小不能超过5MB");
         }
 
         // 3. 检查文件扩展名
         String fileName = file.getOriginalFilename();
         if (fileName == null || !isValidExcelFile(fileName)) {
-            return R.failed("请上传Excel文件(.xlsx或.xls格式)");
+            return R.error("请上传Excel文件(.xlsx或.xls格式)");
         }
         CompanyDomainParam param = new CompanyDomainParam();
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
@@ -173,7 +173,7 @@ public class CompanyDomainController extends BaseController {
             return companyDomainService.importDomainData(param, companyDomainList);
         } catch (Exception e) {
             e.getStackTrace();
-            return R.failed("导入失败!");
+            return R.error("导入失败!");
         }
     }
 

+ 143 - 0
fs-admin/src/main/java/com/fs/company/controller/CompanyRechargeController.java

@@ -0,0 +1,143 @@
+package com.fs.company.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.domain.model.LoginUser;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.company.domain.Company;
+import com.fs.company.domain.CompanyMoneyLogs;
+import com.fs.company.domain.CompanyRecharge;
+import com.fs.company.service.ICompanyMoneyLogsService;
+import com.fs.company.service.ICompanyRechargeService;
+import com.fs.company.service.ICompanyService;
+import com.fs.company.vo.CompanyRechargeExportVO;
+import com.fs.company.vo.CompanyRechargeVO;
+import com.fs.framework.web.service.TokenService;
+import lombok.Synchronized;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 充值Controller
+ *
+ * @author fs
+ * @date 2021-10-04
+ */
+@RestController
+@RequestMapping("/company/companyRecharge")
+public class CompanyRechargeController extends BaseController
+{
+    @Autowired
+    private TokenService tokenService;
+    @Autowired
+    private ICompanyRechargeService companyRechargeService;
+    @Autowired
+    private ICompanyService companyService;
+    @Autowired
+    private ICompanyMoneyLogsService moneyLogsService;
+    /**
+     * 查询充值列表
+     */
+    @PreAuthorize("@ss.hasPermi('company:companyRecharge:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CompanyRecharge companyRecharge)
+    {
+        startPage();
+        List<CompanyRechargeVO> list = companyRechargeService.selectCompanyRechargeVOList(companyRecharge);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出充值列表
+     */
+    @PreAuthorize("@ss.hasPermi('company:companyRecharge:export')")
+    @Log(title = "充值", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(CompanyRecharge companyRecharge)
+    {
+        List<CompanyRechargeExportVO> list = companyRechargeService.selectCompanyRechargeExportList(companyRecharge);
+        ExcelUtil<CompanyRechargeExportVO> util = new ExcelUtil<CompanyRechargeExportVO>(CompanyRechargeExportVO.class);
+        return util.exportExcel(list, "公司充值明细");
+    }
+
+    /**
+     * 获取充值详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('company:companyRecharge:query')")
+    @GetMapping(value = "/{rechargeId}")
+    public AjaxResult getInfo(@PathVariable("rechargeId") Long rechargeId)
+    {
+        return AjaxResult.success(companyRechargeService.selectCompanyRechargeById(rechargeId));
+    }
+
+    /**
+     * 新增充值
+     */
+    @PreAuthorize("@ss.hasPermi('company:companyRecharge:add')")
+    @Log(title = "充值", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CompanyRecharge companyRecharge)
+    {
+        return toAjax(companyRechargeService.insertCompanyRecharge(companyRecharge));
+    }
+
+
+
+    /**
+     * 删除充值
+     */
+    @PreAuthorize("@ss.hasPermi('company:companyRecharge:remove')")
+    @Log(title = "充值", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{rechargeIds}")
+    public AjaxResult remove(@PathVariable Long[] rechargeIds)
+    {
+        return toAjax(companyRechargeService.deleteCompanyRechargeByIds(rechargeIds));
+    }
+
+
+
+    @PreAuthorize("@ss.hasPermi('company:companyRecharge:audit')")
+    @PostMapping("/audit")
+    @Transactional
+    @Synchronized
+    public R audit(@RequestBody CompanyRecharge param)
+    {
+        CompanyRecharge companyRecharge=companyRechargeService.selectCompanyRechargeById(param.getRechargeId());
+        if(companyRecharge.getIsAudit()!=0){
+            return R.error("非法操作");
+        }
+        companyRecharge.setIsAudit(param.getIsAudit());
+        companyRecharge.setRemark(param.getRemark());
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        if(companyRecharge.getIsAudit()==1){
+            Company company=companyService.selectCompanyById(companyRecharge.getCompanyId());
+            company.setMoney(company.getMoney().add(companyRecharge.getMoney()));
+            companyService.updateCompany(company);
+            CompanyMoneyLogs log=new CompanyMoneyLogs();
+            log.setCompanyId(companyRecharge.getCompanyId());
+            log.setMoney(companyRecharge.getMoney());
+            log.setRemark(companyRecharge.getRemark());
+            log.setLogsType(1);
+            log.setBalance(company.getMoney());
+            log.setCreateTime(new Date());
+            moneyLogsService.insertCompanyMoneyLogs(log);
+            companyRecharge.setPayTime(new Date());
+            companyRecharge.setStatus(1);
+        }
+        companyRecharge.setAuditTime(new Date());
+        companyRecharge.setAuditUserId(loginUser.getUser().getUserId());
+        companyRechargeService.updateCompanyRecharge(companyRecharge);
+        return R.ok("操作成功");
+
+    }
+}

+ 63 - 0
fs-admin/src/main/java/com/fs/company/controller/CompanyRedPackageController.java

@@ -0,0 +1,63 @@
+package com.fs.company.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.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.company.domain.*;
+import com.fs.company.service.ICompanyMoneyLogsService;
+import com.fs.company.service.ICompanyProfitLogsService;
+import com.fs.company.service.ICompanyProfitService;
+import com.fs.company.service.ICompanyService;
+import com.fs.framework.web.service.TokenService;
+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-07-04
+ */
+@RestController
+@RequestMapping("/company/redPackage")
+public class CompanyRedPackageController extends BaseController
+{
+    @Autowired
+    private ICompanyMoneyLogsService moneyLogsService;
+    /**
+     * 查询提现列表
+     */
+    @PreAuthorize("@ss.hasPermi('company:redPackage:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CompanyRedPackage companyRedPackage)
+    {
+        startPage();
+        List<CompanyRedPackage> list = moneyLogsService.selectCompanyRedPackageListVO(companyRedPackage);
+        String dateTime = companyRedPackage.getDateTime();
+        list.forEach(m -> m.setDateTime(dateTime));
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出提现列表
+     */
+    @PreAuthorize("@ss.hasPermi('company:redPackage:export')")
+    @Log(title = "提现", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(CompanyRedPackage companyRedPackage)
+    {
+        List<CompanyRedPackage> list = moneyLogsService.selectCompanyRedPackageListVO(companyRedPackage);
+        String dateTime = companyRedPackage.getDateTime();
+        list.forEach(m -> m.setDateTime(dateTime));
+        ExcelUtil<CompanyRedPackage> util = new ExcelUtil<CompanyRedPackage>(CompanyRedPackage.class);
+        return util.exportExcel(list, "红包金额记录");
+    }
+
+
+}

+ 16 - 4
fs-admin/src/main/java/com/fs/company/controller/CompanyStatisticsController.java

@@ -13,10 +13,7 @@ import com.fs.company.param.FsStoreStatisticsParam;
 import com.fs.company.service.ICompanySmsLogsService;
 import com.fs.company.service.ICompanyUserService;
 import com.fs.company.service.ICompanyVoiceLogsService;
-import com.fs.company.vo.CompanySmsLogsStatisticsVO;
-import com.fs.company.vo.CompanyVoiceLogsStatisticsVO;
-import com.fs.company.vo.FsStoreOrderStatisticsVO;
-import com.fs.company.vo.FsStorePaymentStatisticsVO;
+import com.fs.company.vo.*;
 import com.fs.crm.param.CrmCustomerStatisticsParam;
 import com.fs.crm.service.ICrmCustomerService;
 import com.fs.crm.service.ICrmCustomerVisitService;
@@ -27,6 +24,7 @@ import com.fs.his.service.IFsStorePaymentService;
 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.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -631,4 +629,18 @@ public class CompanyStatisticsController extends BaseController
         ExcelUtil<CrmCustomerVisitStatisticsVO> util = new ExcelUtil<CrmCustomerVisitStatisticsVO>(CrmCustomerVisitStatisticsVO.class);
         return util.exportExcel(list, "visit");
     }
+
+    @GetMapping("/ipadStaticTotal/{dateTime}")
+    public R ipadStaticTotal(@PathVariable("dateTime") String dateTime){
+        List<QwIpadTotalVo> qwIpadTotalVos = userService.selectCompanyByIpadStatus(dateTime);
+        return R.ok().put("list",qwIpadTotalVos);
+    }
+
+    @GetMapping("/exportIpadStaticByTime/{dateTime}")
+    public AjaxResult exportIpadStaticByTime(@PathVariable("dateTime") String dateTime){
+        List<QwIpadTotalVo> qwIpadTotalVos = userService.selectCompanyByIpadStatus(dateTime);
+        ExcelUtil<QwIpadTotalVo> util = new ExcelUtil<QwIpadTotalVo>(QwIpadTotalVo.class);
+        return util.exportExcel(qwIpadTotalVos, "visit");
+    }
+
 }

+ 3 - 2
fs-admin/src/main/java/com/fs/company/controller/CompanyUserController.java

@@ -11,6 +11,7 @@ import com.fs.common.utils.ServletUtils;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.company.domain.CompanyUser;
 import com.fs.company.service.ICompanyUserService;
+import com.fs.qw.dto.UserProjectDTO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
@@ -145,9 +146,9 @@ public class CompanyUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('company:companyUser:change')")
     @Log(title = "更换会员归属", businessType = BusinessType.OTHER)
     @PostMapping("/changeCompanyUser")
-    public AjaxResult changeCompanyUser(@RequestBody List<Long> userIds, @RequestParam Long companyUserId, @RequestParam Long companyId)
+    public AjaxResult changeCompanyUser(@RequestBody List<UserProjectDTO> users, @RequestParam Long companyUserId, @RequestParam Long companyId)
     {
-        return toAjax(companyUserService.changeCompanyUser(userIds, companyUserId, companyId));
+        return toAjax(companyUserService.changeCompanyUser(users, companyUserId, companyId));
     }
     /**
      * 根据登录的用户公司获取所有的销售

+ 121 - 0
fs-admin/src/main/java/com/fs/course/controller/FsCoursePlaySourceConfigController.java

@@ -0,0 +1,121 @@
+package com.fs.course.controller;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+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.bean.BeanUtils;
+import com.fs.course.domain.FsCoursePlaySourceConfig;
+import com.fs.course.param.FsCoursePlaySourceConfigCreateParam;
+import com.fs.course.param.FsCoursePlaySourceConfigEditParam;
+import com.fs.course.service.IFsCoursePlaySourceConfigService;
+import com.fs.course.vo.FsCoursePlaySourceConfigVO;
+import com.github.pagehelper.PageHelper;
+import lombok.AllArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.time.LocalDateTime;
+import java.util.*;
+
+@RestController
+@RequestMapping("/course/playSourceConfig")
+@AllArgsConstructor
+public class FsCoursePlaySourceConfigController extends BaseController {
+
+    private final IFsCoursePlaySourceConfigService fsCoursePlaySourceConfigService;
+
+    @PreAuthorize("@ss.hasPermi('course:playSourceConfig:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(@RequestParam(required = false) String name,
+                              @RequestParam(required = false) String appid,
+                              @RequestParam(required = false, defaultValue = "1") Integer pageNum,
+                              @RequestParam(required = false, defaultValue = "10") Integer pageSize) {
+        Map<String, Object> params = new HashMap<>();
+        params.put("name", name);
+        params.put("appid", appid);
+
+        PageHelper.startPage(pageNum, pageSize);
+        List<FsCoursePlaySourceConfigVO> list = fsCoursePlaySourceConfigService.selectCoursePlaySourceConfigVOListByMap(params);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('course:playSourceConfig:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable Long id) {
+        FsCoursePlaySourceConfig config = fsCoursePlaySourceConfigService.getById(id);
+        if (Objects.isNull(config)) {
+            return AjaxResult.success(null);
+        }
+
+        FsCoursePlaySourceConfigVO configVO = new FsCoursePlaySourceConfigVO();
+        BeanUtils.copyProperties(config, configVO);
+        return AjaxResult.success(configVO);
+    }
+
+    @PreAuthorize("@ss.hasPermi('course:playSourceConfig:add')")
+    @Log(title = "点播播放源配置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@Valid @RequestBody FsCoursePlaySourceConfigCreateParam param) {
+        Wrapper<FsCoursePlaySourceConfig> queryWrapper = Wrappers.<FsCoursePlaySourceConfig>lambdaQuery()
+                .eq(FsCoursePlaySourceConfig::getAppid, param.getAppid())
+                .eq(FsCoursePlaySourceConfig::getIsDel, 0);
+        if (fsCoursePlaySourceConfigService.count(queryWrapper) > 0) {
+            return AjaxResult.error("appid已存在");
+        }
+
+        FsCoursePlaySourceConfig config = new FsCoursePlaySourceConfig();
+        BeanUtils.copyProperties(param, config);
+
+        config.setIsDel(0);
+        config.setCreateTime(LocalDateTime.now());
+        config.setUpdateTime(LocalDateTime.now());
+        fsCoursePlaySourceConfigService.save(config);
+        return AjaxResult.success();
+    }
+
+    @PreAuthorize("@ss.hasPermi('course:playSourceConfig:edit')")
+    @Log(title = "点播播放源配置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@Valid @RequestBody FsCoursePlaySourceConfigEditParam param) {
+        FsCoursePlaySourceConfig config = fsCoursePlaySourceConfigService.getById(param.getId());
+        if (Objects.isNull(config)) {
+            return AjaxResult.error("点播播放源配置不存在");
+        }
+
+        Wrapper<FsCoursePlaySourceConfig> queryWrapper = Wrappers.<FsCoursePlaySourceConfig>lambdaQuery()
+                .eq(FsCoursePlaySourceConfig::getAppid, param.getAppid())
+                .eq(FsCoursePlaySourceConfig::getIsDel, 0)
+                .last("limit 1");
+        FsCoursePlaySourceConfig one = fsCoursePlaySourceConfigService.getOne(queryWrapper);
+        if (Objects.nonNull(one) && !one.getId().equals(config.getId())) {
+            return AjaxResult.error("appid已存在");
+        }
+
+        BeanUtils.copyProperties(param, config);
+        fsCoursePlaySourceConfigService.updateById(config);
+        return AjaxResult.success();
+    }
+
+    @PreAuthorize("@ss.hasPermi('course:playSourceConfig:remove')")
+    @Log(title = "点播播放源配置", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        Wrapper<FsCoursePlaySourceConfig> updateWrapper = Wrappers.<FsCoursePlaySourceConfig>lambdaUpdate()
+                .set(FsCoursePlaySourceConfig::getIsDel, 1)
+                .in(FsCoursePlaySourceConfig::getId, Arrays.asList(ids));
+        fsCoursePlaySourceConfigService.update(updateWrapper);
+        return AjaxResult.success();
+    }
+    @GetMapping("/listAll")
+    public R listAll() {
+        return R.ok().put("data", fsCoursePlaySourceConfigService.list(new QueryWrapper<FsCoursePlaySourceConfig>().eq("is_del", 0)));
+    }
+}

+ 103 - 0
fs-admin/src/main/java/com/fs/course/controller/FsCourseProductController.java

@@ -0,0 +1,103 @@
+package com.fs.course.controller;
+
+import java.util.List;
+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.course.domain.FsCourseProduct;
+import com.fs.course.service.IFsCourseProductService;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.core.page.TableDataInfo;
+
+/**
+ * 拍单商品Controller
+ * 
+ * @author fs
+ * @date 2025-07-28
+ */
+@RestController
+@RequestMapping("/course/fsCourseProduct")
+public class FsCourseProductController extends BaseController
+{
+    @Autowired
+    private IFsCourseProductService fsCourseProductService;
+
+    /**
+     * 查询拍单商品列表
+     */
+    @PreAuthorize("@ss.hasPermi('course:fsCourseProduct:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsCourseProduct fsCourseProduct)
+    {
+        startPage();
+        List<FsCourseProduct> list = fsCourseProductService.selectFsCourseProductList(fsCourseProduct);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出拍单商品列表
+     */
+    @PreAuthorize("@ss.hasPermi('course:fsCourseProduct:export')")
+    @Log(title = "拍单商品", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsCourseProduct fsCourseProduct)
+    {
+        List<FsCourseProduct> list = fsCourseProductService.selectFsCourseProductList(fsCourseProduct);
+        ExcelUtil<FsCourseProduct> util = new ExcelUtil<FsCourseProduct>(FsCourseProduct.class);
+        return util.exportExcel(list, "拍单商品数据");
+    }
+
+    /**
+     * 获取拍单商品详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('course:fsCourseProduct:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsCourseProductService.selectFsCourseProductById(id));
+    }
+
+    /**
+     * 新增拍单商品
+     */
+    @PreAuthorize("@ss.hasPermi('course:fsCourseProduct:add')")
+    @Log(title = "拍单商品", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsCourseProduct fsCourseProduct)
+    {
+        return toAjax(fsCourseProductService.insertFsCourseProduct(fsCourseProduct));
+    }
+
+    /**
+     * 修改拍单商品
+     */
+    @PreAuthorize("@ss.hasPermi('course:fsCourseProduct:edit')")
+    @Log(title = "拍单商品", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsCourseProduct fsCourseProduct)
+    {
+        return toAjax(fsCourseProductService.updateFsCourseProduct(fsCourseProduct));
+    }
+
+    /**
+     * 删除拍单商品
+     */
+    @PreAuthorize("@ss.hasPermi('course:fsCourseProduct:remove')")
+    @Log(title = "拍单商品", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsCourseProductService.deleteFsCourseProductByIds(ids));
+    }
+}

+ 152 - 0
fs-admin/src/main/java/com/fs/course/controller/FsCourseProductOrderController.java

@@ -0,0 +1,152 @@
+package com.fs.course.controller;
+
+import java.util.List;
+
+import com.fs.common.annotation.RepeatSubmit;
+import com.fs.common.core.domain.R;
+import com.fs.course.param.FsCourseProductOrderListParam;
+import com.fs.course.vo.FsCourseProductOrderVO;
+import com.fs.his.param.FsCourseProductOrderRefundParam;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.validation.annotation.Validated;
+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.course.domain.FsCourseProductOrder;
+import com.fs.course.service.IFsCourseProductOrderService;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.core.page.TableDataInfo;
+
+import static com.fs.his.utils.PhoneUtil.decryptPhone;
+
+/**
+ * 拍单商品订单Controller
+ * 
+ * @author fs
+ * @date 2025-07-28
+ */
+@RestController
+@RequestMapping("/course/fsCourseProductOrder")
+public class FsCourseProductOrderController extends BaseController
+{
+    @Autowired
+    private IFsCourseProductOrderService fsCourseProductOrderService;
+
+    /**
+     * 查询拍单商品订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('course:fsCourseProductOrder:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsCourseProductOrderListParam param)
+    {
+        startPage();
+        List<FsCourseProductOrderVO> list = fsCourseProductOrderService.selectFsCourseProductOrderList(param);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出拍单商品订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('course:fsCourseProductOrder:export')")
+    @Log(title = "拍单商品订单", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsCourseProductOrderListParam param)
+    {
+        List<FsCourseProductOrderVO> list = fsCourseProductOrderService.selectFsCourseProductOrderList(param);
+        ExcelUtil<FsCourseProductOrderVO> util = new ExcelUtil<FsCourseProductOrderVO>(FsCourseProductOrderVO.class);
+        return util.exportExcel(list, "拍单商品订单数据");
+    }
+
+    /**
+     * 导出拍单商品订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('course:fsCourseProductOrder:decodeExport')")
+    @Log(title = "拍单商品订单", businessType = BusinessType.EXPORT)
+    @GetMapping("/decodeExport")
+    public AjaxResult decodeExport(FsCourseProductOrderListParam param)
+    {
+        List<FsCourseProductOrderVO> list = fsCourseProductOrderService.selectFsCourseProductOrderDecodePhoneList(param);
+        ExcelUtil<FsCourseProductOrderVO> util = new ExcelUtil<FsCourseProductOrderVO>(FsCourseProductOrderVO.class);
+        return util.exportExcel(list, "拍单商品订单数据");
+    }
+
+    /**
+     * 获取拍单商品订单详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('course:fsCourseProductOrder:query')")
+    @GetMapping(value = "/{courseOrderId}")
+    public AjaxResult getInfo(@PathVariable("courseOrderId") Long courseOrderId)
+    {
+        return AjaxResult.success(fsCourseProductOrderService.selectFsCourseProductOrderByCourseOrderId(courseOrderId));
+    }
+
+    /**
+     * 新增拍单商品订单
+     */
+    @PreAuthorize("@ss.hasPermi('course:fsCourseProductOrder:add')")
+    @Log(title = "拍单商品订单", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsCourseProductOrder fsCourseProductOrder)
+    {
+        return toAjax(fsCourseProductOrderService.insertFsCourseProductOrder(fsCourseProductOrder));
+    }
+
+    /**
+     * 修改拍单商品订单
+     */
+    @PreAuthorize("@ss.hasPermi('course:fsCourseProductOrder:edit')")
+    @Log(title = "拍单商品订单", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsCourseProductOrder fsCourseProductOrder)
+    {
+        return toAjax(fsCourseProductOrderService.updateFsCourseProductOrder(fsCourseProductOrder));
+    }
+
+    /**
+     * 删除拍单商品订单
+     */
+    @PreAuthorize("@ss.hasPermi('course:fsCourseProductOrder:remove')")
+    @Log(title = "拍单商品订单", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{courseOrderIds}")
+    public AjaxResult remove(@PathVariable Long[] courseOrderIds)
+    {
+        return toAjax(fsCourseProductOrderService.deleteFsCourseProductOrderByCourseOrderIds(courseOrderIds));
+    }
+
+    @Transactional
+    @RepeatSubmit
+    @ApiOperation("退款拍商品订单")
+    @PreAuthorize("@ss.hasPermi('course:fsCourseProductOrder:refund')")
+    @PostMapping("/refund")
+    public R refundOrder(@Validated @RequestBody FsCourseProductOrderRefundParam param){
+        param.setSysUserName(getLoginUser().getUsername());
+        logger.info("退款拍商品订单:"+param.getCourseOrderId()+":操作人:总后台:"+ getLoginUser().getUsername());
+        return fsCourseProductOrderService.refund(param);
+    }
+
+    @GetMapping(value = "/queryPhone/{courseOrderId}")
+    @Log(title = "查看电话", businessType = BusinessType.GRANT)
+    @PreAuthorize("@ss.hasPermi('course:fsCourseProductOrder:queryPhone')")
+    public R getPhone(@PathVariable("courseOrderId") Long courseOrderId)
+    {
+        FsCourseProductOrder courseProductOrder = fsCourseProductOrderService.selectFsCourseProductOrderByCourseOrderId(courseOrderId);
+        String userPhone = courseProductOrder.getUserPhone();
+
+        if (userPhone!=null&&userPhone.length()>11){
+            userPhone=decryptPhone(userPhone);
+        }
+        return R.ok().put("userPhone",userPhone);
+    }
+}

+ 36 - 2
fs-admin/src/main/java/com/fs/course/controller/FsCourseQuestionBankController.java

@@ -1,5 +1,7 @@
 package com.fs.course.controller;
 
+import cn.hutool.core.util.ObjectUtil;
+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;
@@ -8,10 +10,12 @@ import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
 import com.fs.common.utils.ServletUtils;
 import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.course.config.CourseConfig;
 import com.fs.course.domain.FsCourseQuestionBank;
 import com.fs.course.dto.FsCourseQuestionBankImportDTO;
 import com.fs.course.service.IFsCourseQuestionBankService;
 import com.fs.framework.web.service.TokenService;
+import com.fs.system.service.ISysConfigService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
@@ -34,7 +38,8 @@ public class FsCourseQuestionBankController extends BaseController
 
     @Autowired
     private TokenService tokenService;
-
+    @Autowired
+    private ISysConfigService configService;
     /**
      * 查询题库列表
      */
@@ -43,6 +48,13 @@ public class FsCourseQuestionBankController extends BaseController
     public TableDataInfo list(FsCourseQuestionBank fsCourseQuestionBank)
     {
         startPage();
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+        if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
+            fsCourseQuestionBank.setUserId(userId);
+        }
         List<FsCourseQuestionBank> list = fsCourseQuestionBankService.selectFsCourseQuestionBankList(fsCourseQuestionBank);
         return getDataTable(list);
     }
@@ -55,6 +67,14 @@ public class FsCourseQuestionBankController extends BaseController
     @GetMapping("/export")
     public AjaxResult export(FsCourseQuestionBank fsCourseQuestionBank)
     {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+        if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
+            fsCourseQuestionBank.setUserId(userId);
+        }
+
         List<FsCourseQuestionBankImportDTO> list = fsCourseQuestionBankService.exportData(fsCourseQuestionBank);
         ExcelUtil<FsCourseQuestionBankImportDTO> util = new ExcelUtil<>(FsCourseQuestionBankImportDTO.class);
         return util.exportExcel(list, "题库数据");
@@ -81,6 +101,13 @@ public class FsCourseQuestionBankController extends BaseController
     {
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         fsCourseQuestionBank.setCreateBy(loginUser.getUser().getNickName());
+        Long userId = loginUser.getUser().getUserId();
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+        if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
+            fsCourseQuestionBank.setUserId(userId);
+        }
+
         return toAjax(fsCourseQuestionBankService.insertFsCourseQuestionBank(fsCourseQuestionBank));
     }
 
@@ -121,7 +148,14 @@ public class FsCourseQuestionBankController extends BaseController
         List<FsCourseQuestionBankImportDTO> list = util.importExcel(file.getInputStream());
 
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        String message = fsCourseQuestionBankService.importData(list, loginUser.getUser().getNickName());
+        Long userId = loginUser.getUser().getUserId();
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+        if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
+            String message = fsCourseQuestionBankService.importData(list, loginUser.getUser().getNickName(),userId);
+            return AjaxResult.success(message);
+        }
+        String message = fsCourseQuestionBankService.importData(list, loginUser.getUser().getNickName(),null);
         return AjaxResult.success(message);
     }
 

+ 18 - 8
fs-admin/src/main/java/com/fs/course/controller/FsCourseTrafficLogController.java

@@ -1,11 +1,14 @@
 package com.fs.course.controller;
 
 import java.text.SimpleDateFormat;
+import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.List;
 
+import com.fs.common.core.domain.R;
 import com.fs.common.exception.CustomException;
 import com.fs.course.param.FsCourseTrafficLogParam;
+import com.fs.course.param.InternetTrafficParam;
 import com.fs.course.vo.FsCourseTrafficLogListVO;
 import com.fs.qw.param.QwWatchLogStatisticsListParam;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -48,14 +51,7 @@ public class FsCourseTrafficLogController extends BaseController
     public TableDataInfo list(FsCourseTrafficLogParam param)
     {
         startPage();
-        if (param.getTime() != null) {
-            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
-            String formattedDate = sdf.format(param.getTime());
-            String[] parts = formattedDate.split("-");
-            param.setYear(Integer.parseInt(parts[0]));
-            param.setMonth(Integer.parseInt(parts[1]));
-        }
-        List<FsCourseTrafficLogListVO> list = fsCourseTrafficLogService.selectTrafficByCompany(param);
+        List<FsCourseTrafficLogListVO> list = fsCourseTrafficLogService.selectTrafficNew(param);
         return getDataTable(list);
     }
 
@@ -121,4 +117,18 @@ public class FsCourseTrafficLogController extends BaseController
     {
         return toAjax(fsCourseTrafficLogService.deleteFsCourseTrafficLogByLogIds(logIds));
     }
+
+    /**
+     * 充值流量
+     *
+     * @param internetTrafficParam
+     * @return
+     */
+    @PostMapping(value = "/rechargeTraffic")
+    public R rechargeTraffic(@RequestBody InternetTrafficParam internetTrafficParam) {
+
+        fsCourseTrafficLogService.updateTrafficStatus(internetTrafficParam);
+        return R.ok().put("data", null);  // 返回计算结果
+    }
+
 }

+ 20 - 0
fs-admin/src/main/java/com/fs/course/controller/FsCourseWatchCommentController.java

@@ -70,6 +70,14 @@ public class FsCourseWatchCommentController extends BaseController
         return util.exportExcel(list, "看课评论数据");
     }
 
+    @PreAuthorize("@ss.hasPermi('course:courseWatchComment:edit')")
+    @Log(title = "看课评论", businessType = BusinessType.UPDATE)
+    @PutMapping("/updateBarrageStatus")
+    public AjaxResult updateBarrageStatus(@RequestBody FsCourseWatchComment fsCourseWatchComment)
+    {
+        return toAjax(fsCourseWatchCommentService.updateFsCourseWatchComment(fsCourseWatchComment));
+    }
+
     /**
      * 获取看课评论详细信息
      */
@@ -125,4 +133,16 @@ public class FsCourseWatchCommentController extends BaseController
         }
     }
 
+    @Log(title = "手动解除外部联系人拉黑用户", businessType = BusinessType.UPDATE)
+    @PutMapping("/clearBlack")
+    public R clearBlack(Integer commentStatus, Long fsUserId)
+    {
+        int i = qwExternalContactService.updateQwExternalContactByFsUserId(commentStatus, fsUserId);
+        if (i > 0){
+            return R.ok();
+        } else {
+            return R.error();
+        }
+    }
+
 }

+ 10 - 0
fs-admin/src/main/java/com/fs/course/controller/FsUserCourseComplaintRecordController.java

@@ -75,6 +75,16 @@ public class FsUserCourseComplaintRecordController extends BaseController
         return AjaxResult.success(fsUserCourseComplaintRecordService.selectFsUserCourseComplaintRecordByRecordId(recordId));
     }
 
+    /**
+    * 获取 看课投诉记录详细信息-客户所属关系
+    */
+    @PreAuthorize("@ss.hasPermi('course:userCourseComplaintRecord:queryQw')")
+    @GetMapping(value = "/getInfoByUserId/{userId}")
+    public AjaxResult getInfoByUserId(@PathVariable("userId") Long userId)
+    {
+        return AjaxResult.success(fsUserCourseComplaintRecordService.selectFsUserCourseComplaintRecordByUserId(userId));
+    }
+
     /**
      * 新增看课投诉记录
      */

+ 56 - 0
fs-admin/src/main/java/com/fs/course/controller/FsUserCourseController.java

@@ -2,10 +2,17 @@ package com.fs.course.controller;
 
 import java.util.List;
 
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.json.JSONUtil;
 import com.fs.common.core.domain.R;
+import com.fs.common.core.domain.model.LoginUser;
+import com.fs.common.utils.ServletUtils;
+import com.fs.course.config.CourseConfig;
 import com.fs.course.vo.FsUserCourseListPVO;
+import com.fs.framework.web.service.TokenService;
 import com.fs.his.utils.RedisCacheUtil;
 import com.fs.his.vo.OptionsVO;
+import com.fs.system.service.ISysConfigService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -40,6 +47,13 @@ public class FsUserCourseController extends BaseController
 
     @Autowired
     private RedisCacheUtil redisCacheUtil;
+
+    @Autowired
+    private TokenService tokenService;
+
+    @Autowired
+    private ISysConfigService configService;
+
     /**
      * 查询课程列表
      */
@@ -48,6 +62,13 @@ public class FsUserCourseController extends BaseController
     public TableDataInfo list(FsUserCourse fsUserCourse)
     {
         startPage();
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+        if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
+            fsUserCourse.setUserId(userId);
+        }
         List<FsUserCourseListPVO> list = fsUserCourseService.selectFsUserCourseListPVO(fsUserCourse);
         return getDataTable(list);
     }
@@ -60,6 +81,13 @@ public class FsUserCourseController extends BaseController
     public TableDataInfo publicList(FsUserCourse fsUserCourse)
     {
         startPage();
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+        if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
+            fsUserCourse.setUserId(userId);
+        }
         List<FsUserCourseListPVO> list = fsUserCourseService.selectFsUserCourseListPVO(fsUserCourse);
         return getDataTable(list);
     }
@@ -72,6 +100,13 @@ public class FsUserCourseController extends BaseController
     @GetMapping("/export")
     public AjaxResult export(FsUserCourse fsUserCourse)
     {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+        if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
+            fsUserCourse.setUserId(userId);
+        }
         List<FsUserCourse> list = fsUserCourseService.selectFsUserCourseList(fsUserCourse);
         ExcelUtil<FsUserCourse> util = new ExcelUtil<FsUserCourse>(FsUserCourse.class);
         return util.exportExcel(list, "课程数据");
@@ -85,6 +120,13 @@ public class FsUserCourseController extends BaseController
     @GetMapping("/publicExport")
     public AjaxResult publicExport(FsUserCourse fsUserCourse)
     {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+        if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
+            fsUserCourse.setUserId(userId);
+        }
         List<FsUserCourse> list = fsUserCourseService.selectFsUserCourseList(fsUserCourse);
         ExcelUtil<FsUserCourse> util = new ExcelUtil<FsUserCourse>(FsUserCourse.class);
         return util.exportExcel(list, "课程数据");
@@ -118,6 +160,13 @@ public class FsUserCourseController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody FsUserCourse fsUserCourse)
     {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+        if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
+            fsUserCourse.setUserId(userId);
+        }
         fsUserCourseService.insertFsUserCourse(fsUserCourse);
         redisCacheUtil.delRedisKey("getCourseList");
 
@@ -132,6 +181,13 @@ public class FsUserCourseController extends BaseController
     @PostMapping("/public")
     public AjaxResult publicAdd(@RequestBody FsUserCourse fsUserCourse)
     {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+        if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
+            fsUserCourse.setUserId(userId);
+        }
         fsUserCourseService.insertFsUserCourse(fsUserCourse);
         redisCacheUtil.delRedisKey("getCourseList");
 

+ 40 - 8
fs-admin/src/main/java/com/fs/course/controller/FsUserCoursePeriodController.java

@@ -10,16 +10,11 @@ import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.course.domain.FsUserCoursePeriod;
 import com.fs.course.domain.FsUserCoursePeriodDays;
 import com.fs.course.domain.FsUserCourseVideoRedPackage;
-import com.fs.course.param.CompanyRedPacketParam;
-import com.fs.course.param.FsBatchPeriodRedPackageParam;
-import com.fs.course.param.PeriodCountParam;
+import com.fs.course.param.*;
 import com.fs.course.service.IFsUserCoursePeriodDaysService;
 import com.fs.course.service.IFsUserCoursePeriodService;
 import com.fs.course.service.IFsUserCourseVideoRedPackageService;
-import com.fs.course.vo.FsPeriodCountVO;
-import com.fs.course.vo.FsUserCoursePeriodVO;
-import com.fs.course.vo.PeriodRedPacketVO;
-import com.fs.course.vo.UpdateCourseTimeVo;
+import com.fs.course.vo.*;
 import com.fs.his.vo.OptionsVO;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
@@ -27,11 +22,15 @@ import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.TimeUnit;
 
 
 /**
@@ -45,6 +44,7 @@ import java.util.Map;
 @RequestMapping("/course/period")
 @Slf4j
 public class FsUserCoursePeriodController extends BaseController {
+
     private final IFsUserCoursePeriodService fsUserCoursePeriodService;
     private final IFsUserCoursePeriodDaysService fsUserCoursePeriodDaysService;
     private final IFsUserCourseVideoRedPackageService fsUserCourseVideoRedPackageService;
@@ -187,6 +187,7 @@ public class FsUserCoursePeriodController extends BaseController {
         return R.ok().put("data", periodRedPacketList);
     }
 
+    @Log(title = "按课程批量保存设置红包金额", businessType = BusinessType.UPDATE)
     @PreAuthorize("@ss.hasPermi('course:period:setCourseRedPacket')")
     @ApiOperation("按课程批量保存设置红包金额")
     @PostMapping("/batchRedPacket")
@@ -200,6 +201,7 @@ public class FsUserCoursePeriodController extends BaseController {
         return R.ok();
     }
 
+    @Log(title = "按营期批量保存设置红包金额", businessType = BusinessType.UPDATE)
     @PreAuthorize("@ss.hasPermi('course:period:setRedPacket')")
     @ApiOperation("按营期批量保存设置红包金额")
     @PostMapping("/batchRedPacket/byPeriod")
@@ -218,10 +220,11 @@ public class FsUserCoursePeriodController extends BaseController {
     public R periodCourseCount(@RequestBody PeriodCountParam param) {
         PageHelper.startPage(param.getPageNum(), param.getPageSize());
         List<FsPeriodCountVO> list = fsUserCoursePeriodDaysService.periodCourseCount(param);
+        long count = fsUserCoursePeriodDaysService.periodCourseByCount(param);
         PageInfo<FsPeriodCountVO> pageInfo = new PageInfo<>(list);
         Map<String, Object> result = new HashMap<>();
         result.put("rows", pageInfo.getList());
-        result.put("total", pageInfo.getTotal());
+        result.put("total", count);
         return R.ok(result);
     }
 
@@ -254,4 +257,33 @@ public class FsUserCoursePeriodController extends BaseController {
         return R.ok();
     }
 
+    @PostMapping("/periodCourseStatisticCount")
+    @ApiOperation("会员详情训练营数据总览")
+    public R periodCourseStatisticCount(@RequestBody PeriodStatisticCountParam param) {
+        if (param == null) {
+            return R.error("请求参数不能为空!");
+        }
+        return R.ok().put("data", fsUserCoursePeriodService.periodCourseStatisticCount(param));
+    }
+
+    @PostMapping("/periodlist")
+    public R periodList(@RequestBody PeriodStatisticCountParam param)
+    {
+        List<FsUserCoursePeriod> list = fsUserCoursePeriodService.selectFsPeriodlist(param);
+        return R.ok().put("data", list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('course:period:setCompanyRedPacket')")
+    @ApiOperation("按公司批量保存设置红包金额")
+    @PostMapping("/batchRedPacket/byCompany")
+    public R batchRedPacketByCompany(@Validated @RequestBody BatchCompanyRedPackageParam param) {
+        try {
+            fsUserCourseVideoRedPackageService.batchRedPacketByCompany(param);
+        } catch (Exception e) {
+            logger.error("按恭送批量保存设置红包金额-失败!,入参:{}", param);
+            return R.error("保存失败!");
+        }
+        return R.ok();
+    }
+
 }

+ 29 - 1
fs-admin/src/main/java/com/fs/course/controller/FsUserCourseTrainingCampController.java

@@ -1,16 +1,23 @@
 package com.fs.course.controller;
 
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.json.JSONUtil;
 import com.fs.common.annotation.Log;
 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.enums.BusinessType;
+import com.fs.common.utils.ServletUtils;
 import com.fs.common.utils.SortUtils;
+import com.fs.course.config.CourseConfig;
 import com.fs.course.domain.FsUserCourseTrainingCamp;
 import com.fs.course.dto.FsUserCourseTrainingCampDTO;
 import com.fs.course.dto.FsUserCourseTrainingCampUpdateDTO;
 import com.fs.course.service.IFsUserCourseTrainingCampService;
 import com.fs.course.vo.FsUserCourseTrainingCampVO;
+import com.fs.framework.web.service.TokenService;
 import com.fs.his.vo.OptionsVO;
+import com.fs.system.service.ISysConfigService;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import lombok.AllArgsConstructor;
@@ -29,13 +36,16 @@ import java.util.Objects;
 public class FsUserCourseTrainingCampController {
 
     private final IFsUserCourseTrainingCampService fsUserCourseTrainingCampService;
+    private final TokenService tokenService;
 
+    private final ISysConfigService configService;
     /**
      * 查询训练营列表
      */
     @PreAuthorize("@ss.hasPermi('course:trainingCamp:list')")
     @GetMapping("/list")
     public AjaxResult list(@RequestParam(required = false) String trainingCampName,
+                           @RequestParam(required = false) String userId,
                            @RequestParam String scs,
                            @RequestParam(required = false, defaultValue = "1") Integer pageNum,
                            @RequestParam(required = false, defaultValue = "10") Integer pageSize)
@@ -43,6 +53,15 @@ public class FsUserCourseTrainingCampController {
         Map<String, Object> params = new HashMap<>();
         params.put("trainingCampName", trainingCampName);
         params.put("scs", SortUtils.parseSort(scs));
+        params.put("userId", userId);
+
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userIds = loginUser.getUser().getUserId();
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+        if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
+            params.put("userIds", userIds);
+        }
 
         PageHelper.startPage(pageNum, pageSize);
         List<FsUserCourseTrainingCampVO> list = fsUserCourseTrainingCampService.selectFsUserCourseTrainingCampVOListByMap(params);
@@ -58,7 +77,16 @@ public class FsUserCourseTrainingCampController {
     @Log(title = "训练营", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@Valid @RequestBody FsUserCourseTrainingCampDTO params) {
-        fsUserCourseTrainingCampService.add(params);
+
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userIds = loginUser.getUser().getUserId();
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+        if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
+            fsUserCourseTrainingCampService.add(params,userIds);
+            return AjaxResult.success();
+        }
+        fsUserCourseTrainingCampService.add(params,null);
         return AjaxResult.success();
     }
 

+ 65 - 1
fs-admin/src/main/java/com/fs/course/controller/FsUserCourseVideoController.java

@@ -1,19 +1,28 @@
 package com.fs.course.controller;
 
+import cn.hutool.core.util.ObjectUtil;
+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.domain.model.LoginUser;
 import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.ServletUtils;
 import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.course.config.CourseConfig;
+import com.fs.course.domain.FsUserCourse;
 import com.fs.course.domain.FsUserCourseVideo;
 import com.fs.course.mapper.FsUserCourseVideoMapper;
 import com.fs.course.param.BatchRedUpdate;
 import com.fs.course.param.BatchVideoSvae;
 import com.fs.course.param.CourseVideoUpdates;
+import com.fs.course.service.IFsUserCourseService;
 import com.fs.course.service.IFsUserCourseVideoService;
+import com.fs.framework.web.service.TokenService;
 import com.fs.his.vo.OptionsVO;
+import com.fs.system.service.ISysConfigService;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -39,6 +48,13 @@ public class FsUserCourseVideoController extends BaseController
 
     @Autowired
     private FsUserCourseVideoMapper fsUserCourseVideoMapper;
+    @Autowired
+    private IFsUserCourseService fsUserCourseService;
+    @Autowired
+    private TokenService tokenService;
+
+    @Autowired
+    private ISysConfigService configService;
 
     /**
      * 查询课堂视频列表
@@ -47,6 +63,13 @@ public class FsUserCourseVideoController extends BaseController
     @GetMapping("/list")
     public TableDataInfo list(FsUserCourseVideo fsUserCourseVideo)
     {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+        if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
+            fsUserCourseVideo.setUserId(userId);
+        }
         startPage();
         List<FsUserCourseVideo> list = fsUserCourseVideoService.selectFsUserCourseVideoList(fsUserCourseVideo);
         return getDataTable(list);
@@ -60,6 +83,13 @@ public class FsUserCourseVideoController extends BaseController
     @GetMapping("/export")
     public AjaxResult export(FsUserCourseVideo fsUserCourseVideo)
     {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+        if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
+            fsUserCourseVideo.setUserId(userId);
+        }
         List<FsUserCourseVideo> list = fsUserCourseVideoService.selectFsUserCourseVideoList(fsUserCourseVideo);
         ExcelUtil<FsUserCourseVideo> util = new ExcelUtil<FsUserCourseVideo>(FsUserCourseVideo.class);
         return util.exportExcel(list, "课堂视频数据");
@@ -72,7 +102,14 @@ public class FsUserCourseVideoController extends BaseController
     @GetMapping(value = "/{videoId}")
     public AjaxResult getInfo(@PathVariable("videoId") Long videoId)
     {
-        return AjaxResult.success(fsUserCourseVideoService.selectFsUserCourseVideoByVideoIdVO(videoId));
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+        if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
+            return AjaxResult.success(fsUserCourseVideoService.selectFsUserCourseVideoByVideoIdVO(videoId,userId));
+        }
+        return AjaxResult.success(fsUserCourseVideoService.selectFsUserCourseVideoByVideoIdVO(videoId,null));
     }
 
     /**
@@ -87,6 +124,16 @@ public class FsUserCourseVideoController extends BaseController
         if (count>0){
             return AjaxResult.error("课程排序重复");
         }
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+        if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
+            fsUserCourseVideo.setUserId(userId);
+        }
+        // 设置项目ID
+        FsUserCourse fsUserCourse = fsUserCourseService.selectFsUserCourseByCourseId(fsUserCourseVideo.getCourseId());
+        fsUserCourseVideo.setProjectId(fsUserCourse.getProject());
         return toAjax(fsUserCourseVideoService.insertFsUserCourseVideo(fsUserCourseVideo));
     }
 
@@ -117,6 +164,13 @@ public class FsUserCourseVideoController extends BaseController
     public TableDataInfo getVideoListByCourseId(FsUserCourseVideo fsUserCourseVideo)
     {
         startPage();
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+        if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
+            fsUserCourseVideo.setUserId(userId);
+        }
         List<FsUserCourseVideo> list = fsUserCourseVideoService.selectFsUserCourseVideoListByCourseId(fsUserCourseVideo);
         return getDataTable(list);
     }
@@ -134,6 +188,16 @@ public class FsUserCourseVideoController extends BaseController
     }
     @PostMapping("/batchSaveVideo")
     public R batchSaveVideo(@RequestBody BatchVideoSvae vo){
+        // 设置项目ID
+        FsUserCourse fsUserCourse = fsUserCourseService.selectFsUserCourseByCourseId(vo.getCourseId());
+        vo.setProjectId(fsUserCourse.getProject());
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+        if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
+            vo.setUserId(userId);
+        }
         fsUserCourseVideoService.batchSaveVideo(vo);
         return R.ok();
     }

+ 6 - 0
fs-admin/src/main/java/com/fs/course/controller/FsUserTalentController.java

@@ -2,11 +2,14 @@ package com.fs.course.controller;
 
 import java.math.BigDecimal;
 import java.util.List;
+import java.util.Objects;
 
 import com.fs.common.core.domain.R;
 import com.fs.common.utils.DateUtils;
 import com.fs.company.service.ICompanyService;
 import com.fs.company.vo.CompanyVO;
+import com.fs.common.utils.StringUtils;
+import com.fs.his.utils.PhoneUtil;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -126,6 +129,9 @@ public class FsUserTalentController extends BaseController
     @GetMapping("/listBySearch")
     public R listBySearCh(FsUserTalent fsUserTalent)
     {
+        if (Objects.nonNull(fsUserTalent) && StringUtils.isNotBlank(fsUserTalent.getPhone())){
+            fsUserTalent.setPhone(PhoneUtil.encryptPhone(fsUserTalent.getPhone()));
+        }
         List<FsUserTalent> list = fsUserTalentService.selectFsUserTalentList(fsUserTalent);
         return R.ok().put("data",list);
     }

+ 12 - 0
fs-admin/src/main/java/com/fs/course/controller/FsUserVideoController.java

@@ -9,9 +9,11 @@ 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.course.domain.FsUserCourseVideo;
 import com.fs.course.domain.FsUserVideo;
 import com.fs.course.domain.FsVideoResource;
 import com.fs.course.param.*;
+import com.fs.course.service.IFsUserCourseVideoService;
 import com.fs.course.service.IFsUserVideoService;
 import com.fs.course.service.IFsVideoResourceService;
 import com.fs.course.service.impl.TencentCloudCosService;
@@ -55,6 +57,9 @@ public class FsUserVideoController extends BaseController
     @Autowired
     private IFsVideoResourceService iFsVideoResourceService;
 
+    @Autowired
+    private IFsUserCourseVideoService fsUserCourseVideoService;
+
     /**
      * 查询课堂视频列表
      */
@@ -354,6 +359,13 @@ public class FsUserVideoController extends BaseController
             iFsVideoResourceService.updateById(videoMap);
             log.info("成功更新视频转码状态,视频ID: {}", video.getId());
 
+
+            FsUserCourseVideo fsUserCourseVideo = fsUserCourseVideoService.selectByFileKey(video.getFileKey());
+            fsUserCourseVideo.setLineOne(video.getLine1().replace(inputPath,transcodeFileKey));
+            fsUserCourseVideo.setTranscodeFileKey(transcodeFileKey);
+            fsUserCourseVideo.setIsTranscode(1);
+            fsUserCourseVideoService.updateFsUserCourseVideo(fsUserCourseVideo);
+
             return R.ok();
         } catch (Exception e) {
             log.error("处理视频转码请求时发生异常", e);

+ 145 - 0
fs-admin/src/main/java/com/fs/course/controller/FsUserWatchCourseStatisticsController.java

@@ -0,0 +1,145 @@
+package com.fs.course.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.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.course.domain.FsUserWatchCourseStatistics;
+import com.fs.course.service.IFsUserWatchCourseStatisticsService;
+import com.fs.course.vo.FsUserWatchCourseStatisticsExportVO;
+import io.swagger.annotations.ApiOperation;
+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.List;
+import java.util.stream.Collectors;
+
+/**
+ * 会员看课统计-按课程统计Controller
+ *
+ * @author fs
+ * @date 2025-06-16
+ */
+@RestController
+@RequestMapping("/course/userWatchCourseStatistics")
+public class FsUserWatchCourseStatisticsController extends BaseController
+{
+    @Autowired
+    private IFsUserWatchCourseStatisticsService fsUserWatchCourseStatisticsService;
+
+    /**
+     * 查询会员看课统计-按课程统计列表
+     */
+    @PreAuthorize("@ss.hasPermi('course:userWatchCourseStatistics:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsUserWatchCourseStatistics fsUserWatchCourseStatistics)
+    {
+        startPage();
+        List<FsUserWatchCourseStatistics> list = fsUserWatchCourseStatisticsService.selectFsUserWatchCourseStatisticsList(fsUserWatchCourseStatistics);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出会员看课统计-按课程统计列表
+     */
+    @PreAuthorize("@ss.hasPermi('course:userWatchCourseStatistics:export')")
+    @Log(title = "会员看课统计-按课程统计", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsUserWatchCourseStatistics fsUserWatchCourseStatistics)
+    {
+        List<FsUserWatchCourseStatistics> list = fsUserWatchCourseStatisticsService.selectFsUserWatchCourseStatisticsList(fsUserWatchCourseStatistics);
+        ExcelUtil<FsUserWatchCourseStatistics> util = new ExcelUtil<FsUserWatchCourseStatistics>(FsUserWatchCourseStatistics.class);
+        return util.exportExcel(list, "会员观看数据明细");
+    }
+
+    /**
+     * 获取会员看课统计-按课程统计详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('course:userWatchCourseStatistics:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsUserWatchCourseStatisticsService.selectFsUserWatchCourseStatisticsById(id));
+    }
+
+    /**
+     * 新增会员看课统计-按课程统计
+     */
+    @PreAuthorize("@ss.hasPermi('course:userWatchCourseStatistics:add')")
+    @Log(title = "会员看课统计-按课程统计", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsUserWatchCourseStatistics fsUserWatchCourseStatistics)
+    {
+        return toAjax(fsUserWatchCourseStatisticsService.insertFsUserWatchCourseStatistics(fsUserWatchCourseStatistics));
+    }
+
+    /**
+     * 修改会员看课统计-按课程统计
+     */
+    @PreAuthorize("@ss.hasPermi('course:userWatchCourseStatistics:edit')")
+    @Log(title = "会员看课统计-按课程统计", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsUserWatchCourseStatistics fsUserWatchCourseStatistics)
+    {
+        return toAjax(fsUserWatchCourseStatisticsService.updateFsUserWatchCourseStatistics(fsUserWatchCourseStatistics));
+    }
+
+    /**
+     * 删除会员看课统计-按课程统计
+     */
+    @PreAuthorize("@ss.hasPermi('course:userWatchCourseStatistics:remove')")
+    @Log(title = "会员看课统计-按课程统计", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsUserWatchCourseStatisticsService.deleteFsUserWatchCourseStatisticsByIds(ids));
+    }
+
+    /**
+     * 查询会员观看数据明细汇总
+     */
+    @PreAuthorize("@ss.hasPermi('course:userWatchCourseStatistics:listTotal')")
+    @GetMapping("/listTotal")
+    public TableDataInfo listTotal(FsUserWatchCourseStatistics fsUserWatchCourseStatistics)
+    {
+        startPage();
+        List<FsUserWatchCourseStatistics> list = fsUserWatchCourseStatisticsService.selectFsUserWatchCourseStatisticsListTotal(fsUserWatchCourseStatistics);
+        if(!list.isEmpty()){
+            for (FsUserWatchCourseStatistics userWatchCourseStatistics : list) {
+                userWatchCourseStatistics.setCompleteWatchRatePercent(userWatchCourseStatistics.getCompleteWatchRate() + "%");
+                userWatchCourseStatistics.setOnlineRatePercent(userWatchCourseStatistics.getOnlineRate() + "%");
+            }
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出会员观看数据明细汇总
+     */
+    @Log(title = "会员观看数据明细汇总", businessType = BusinessType.EXPORT)
+    @GetMapping("/exportTotal")
+    public AjaxResult exportTotal(FsUserWatchCourseStatistics fsUserWatchCourseStatistics)
+    {
+        List<FsUserWatchCourseStatistics> list = fsUserWatchCourseStatisticsService.selectFsUserWatchCourseStatisticsListTotal(fsUserWatchCourseStatistics);
+        List<FsUserWatchCourseStatisticsExportVO> listVO = list.stream().map(v -> {
+            FsUserWatchCourseStatisticsExportVO vo = new FsUserWatchCourseStatisticsExportVO();
+            BeanUtils.copyProperties(v, vo);
+            vo.setCompleteWatchRatePercent(v.getCompleteWatchRate() + "%");
+            vo.setOnlineRatePercent(v.getOnlineRate() + "%");
+            return vo;
+        }).collect(Collectors.toList());
+        ExcelUtil<FsUserWatchCourseStatisticsExportVO> util = new ExcelUtil<FsUserWatchCourseStatisticsExportVO>(FsUserWatchCourseStatisticsExportVO.class);
+        return util.exportExcel(listVO, "会员观看数据明细汇总");
+    }
+
+
+    @PostMapping("/test")
+    @ApiOperation("测试看课统计明细定时任务")
+    public void userCourseCountTask() {
+        fsUserWatchCourseStatisticsService.insertWatchCourseStatistics();
+    }
+}

+ 118 - 0
fs-admin/src/main/java/com/fs/course/controller/FsUserWatchStatisticsController.java

@@ -0,0 +1,118 @@
+package com.fs.course.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.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.course.domain.FsUserWatchStatistics;
+import com.fs.course.service.IFsUserWatchStatisticsService;
+import io.swagger.annotations.ApiOperation;
+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 2025-06-16
+ */
+@RestController
+@RequestMapping("/course/userWatchStatistics")
+public class FsUserWatchStatisticsController extends BaseController
+{
+    @Autowired
+    private IFsUserWatchStatisticsService fsUserWatchStatisticsService;
+
+    /**
+     * 查询会员看课统计-按营期统计列表
+     */
+    @PreAuthorize("@ss.hasPermi('course:userWatchStatistics:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsUserWatchStatistics fsUserWatchStatistics)
+    {
+        startPage();
+        List<FsUserWatchStatistics> list = fsUserWatchStatisticsService.selectFsUserWatchStatisticsList(fsUserWatchStatistics);
+        if(!list.isEmpty()){
+            for (FsUserWatchStatistics userWatchStatistics : list) {
+                userWatchStatistics.setCompleteWatchRatePercent(userWatchStatistics.getCompleteWatchRate() + "%");
+                userWatchStatistics.setOnlineRatePercent(userWatchStatistics.getOnlineRate() + "%");
+            }
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出会员看课统计-按营期统计列表
+     */
+    @PreAuthorize("@ss.hasPermi('course:userWatchStatistics:export')")
+    @Log(title = "会员看课统计-按营期统计", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsUserWatchStatistics fsUserWatchStatistics)
+    {
+        List<FsUserWatchStatistics> list = fsUserWatchStatisticsService.selectFsUserWatchStatisticsList(fsUserWatchStatistics);
+        if(!list.isEmpty()){
+            for (FsUserWatchStatistics userWatchStatistics : list) {
+                userWatchStatistics.setCompleteWatchRatePercent(userWatchStatistics.getCompleteWatchRate() + "%");
+                userWatchStatistics.setOnlineRatePercent(userWatchStatistics.getOnlineRate() + "%");
+            }
+        }
+        ExcelUtil<FsUserWatchStatistics> util = new ExcelUtil<FsUserWatchStatistics>(FsUserWatchStatistics.class);
+        return util.exportExcel(list, "会员看课统计-按营期统计数据");
+    }
+
+    /**
+     * 获取会员看课统计-按营期统计详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('course:userWatchStatistics:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsUserWatchStatisticsService.selectFsUserWatchStatisticsById(id));
+    }
+
+    /**
+     * 新增会员看课统计-按营期统计
+     */
+    @PreAuthorize("@ss.hasPermi('course:userWatchStatistics:add')")
+    @Log(title = "会员看课统计-按营期统计", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsUserWatchStatistics fsUserWatchStatistics)
+    {
+        return toAjax(fsUserWatchStatisticsService.insertFsUserWatchStatistics(fsUserWatchStatistics));
+    }
+
+    /**
+     * 修改会员看课统计-按营期统计
+     */
+    @PreAuthorize("@ss.hasPermi('course:userWatchStatistics:edit')")
+    @Log(title = "会员看课统计-按营期统计", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsUserWatchStatistics fsUserWatchStatistics)
+    {
+        return toAjax(fsUserWatchStatisticsService.updateFsUserWatchStatistics(fsUserWatchStatistics));
+    }
+
+    /**
+     * 删除会员看课统计-按营期统计
+     */
+    @PreAuthorize("@ss.hasPermi('course:userWatchStatistics:remove')")
+    @Log(title = "会员看课统计-按营期统计", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsUserWatchStatisticsService.deleteFsUserWatchStatisticsByIds(ids));
+    }
+
+
+    @PostMapping("/test")
+    @ApiOperation("测试营期看课统计定时任务")
+    public void userCourseCountTask() {
+        fsUserWatchStatisticsService.insertStatistics();
+    }
+
+}

+ 76 - 2
fs-admin/src/main/java/com/fs/course/controller/FsVideoResourceController.java

@@ -1,22 +1,31 @@
 package com.fs.course.controller;
 
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 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.model.LoginUser;
 import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.ServletUtils;
+import com.fs.course.config.CourseConfig;
 import com.fs.course.domain.FsVideoResource;
 import com.fs.course.service.IFsVideoResourceService;
 import com.fs.course.vo.FsVideoResourceVO;
+import com.fs.framework.web.service.TokenService;
+import com.fs.system.service.ISysConfigService;
 import com.github.pagehelper.PageHelper;
 import lombok.AllArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import java.time.LocalDateTime;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * 资源库管理
@@ -28,6 +37,12 @@ public class FsVideoResourceController extends BaseController {
 
     private final IFsVideoResourceService fsVideoResourceService;
 
+    @Autowired
+    private TokenService tokenService;
+
+    @Autowired
+    private ISysConfigService configService;
+
     /**
      * 查询视频素材库列表
      */
@@ -45,7 +60,12 @@ public class FsVideoResourceController extends BaseController {
         params.put("fileName", fileName);
         params.put("typeId", typeId);
         params.put("typeSubId", typeSubId);
-
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+        if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
+            params.put("userId", loginUser.getUser().getUserId());
+        }
         PageHelper.startPage(pageNum, pageSize);
         List<FsVideoResourceVO> list = fsVideoResourceService.selectVideoResourceListByMap(params);
         return getDataTable(list);
@@ -70,6 +90,13 @@ public class FsVideoResourceController extends BaseController {
     @PostMapping
     public AjaxResult add(@RequestBody FsVideoResource fsVideoResource)
     {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+        if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
+            fsVideoResource.setUserId(userId);
+        }
         fsVideoResource.setCreateTime(LocalDateTime.now());
         fsVideoResourceService.save(fsVideoResource);
         return AjaxResult.success();
@@ -102,6 +129,43 @@ public class FsVideoResourceController extends BaseController {
         return AjaxResult.success();
     }
 
+    /**
+     * 批量修改视频分类
+     * @param typeId
+     * @param typeSubId
+     * @param ids
+     * @return
+     */
+    @PreAuthorize("@ss.hasPermi('course:videoResource:batchUpdateClass')")
+    @Log(title = "视频素材库", businessType = BusinessType.UPDATE)
+    @PostMapping("/batchUpdateClass")
+    public AjaxResult batchUpdateClass(@RequestParam("typeId") Long typeId,
+                                       @RequestParam("typeSubId") Long typeSubId,
+                                       @RequestParam("ids") String ids) {
+        if(typeId == null || typeId <= 0){
+            return AjaxResult.error("请选择分类");
+        }
+        if(typeSubId == null || typeSubId <= 0){
+            return AjaxResult.error("请选择子分类");
+        }
+        if(ids == null || ids.isEmpty()){
+            return AjaxResult.error("请选择要修改的分类");
+        }
+
+        // 将ids字符串分割为ID列表
+        List<String> idList = Arrays.asList(ids.split(","));
+
+        // 创建更新条件
+        Wrapper<FsVideoResource> updateWrapper = Wrappers.<FsVideoResource>lambdaUpdate()
+                .set(FsVideoResource::getTypeId, typeId)
+                .set(FsVideoResource::getTypeSubId, typeSubId)
+                .in(FsVideoResource::getId, idList.stream().map(Long::valueOf).collect(Collectors.toList()));
+
+        // 执行批量更新
+        fsVideoResourceService.update(updateWrapper);
+        return AjaxResult.success();
+    }
+
     @PreAuthorize("@ss.hasPermi('course:videoResource:batchAdd')")
     @Log(title = "视频素材库", businessType = BusinessType.INSERT)
     @PostMapping("/batchAddVideoResource")
@@ -109,7 +173,17 @@ public class FsVideoResourceController extends BaseController {
         if (Objects.isNull(list) || list.isEmpty()) {
             return AjaxResult.error("数据不能为空");
         }
-        list.forEach(v -> v.setCreateTime(LocalDateTime.now()));
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+
+        list.forEach(v ->{
+            v.setCreateTime(LocalDateTime.now());
+            if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
+                v.setUserId(userId);
+            }
+        } );
         fsVideoResourceService.saveBatch(list);
         return AjaxResult.success();
     }

+ 11 - 0
fs-admin/src/main/java/com/fs/course/controller/qw/QwFsCourseWatchLogController.java

@@ -10,6 +10,7 @@ import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.course.domain.FsCourseWatchLog;
 import com.fs.course.param.FsCourseWatchLogListParam;
 import com.fs.course.param.FsCourseWatchLogStatisticsListParam;
+import com.fs.course.param.PeriodStatisticCountParam;
 import com.fs.course.service.IFsCourseWatchLogService;
 import com.fs.course.vo.FsCourseWatchLogListVO;
 import com.fs.course.vo.FsCourseWatchLogStatisticsListVO;
@@ -70,6 +71,7 @@ public class QwFsCourseWatchLogController extends BaseController
         if (param.getSTime()==null||param.getETime()==null){
             return getDataTable(new ArrayList<>());
         }
+        param.setSendType(2); //企微
         List<FsCourseWatchLogStatisticsListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogStatisticsListVO(param);
         return getDataTable(list);
     }
@@ -139,4 +141,13 @@ public class QwFsCourseWatchLogController extends BaseController
     {
         return toAjax(fsCourseWatchLogService.deleteFsCourseWatchLogByLogIds(logIds));
     }
+
+//    @PreAuthorize("@ss.hasPermi('course:courseWatchLog:list')")
+    @GetMapping("/listBytrainingCampId")
+    public TableDataInfo listBytrainingCampId(PeriodStatisticCountParam param)
+    {
+        startPage();
+        List<FsCourseWatchLogListVO> list = fsCourseWatchLogService.selectListBytrainingCampId(param);
+        return getDataTable(list);
+    }
 }

+ 24 - 2
fs-admin/src/main/java/com/fs/crm/controller/CrmCustomerController.java

@@ -4,6 +4,8 @@ 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.entity.SysRole;
+import com.fs.common.core.domain.entity.SysUser;
 import com.fs.common.core.domain.model.LoginUser;
 import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
@@ -19,6 +21,7 @@ import com.fs.crm.service.ICrmCustomerService;
 import com.fs.crm.vo.CrmCustomerExportVO;
 import com.fs.crm.vo.CrmCustomerListVO;
 import com.fs.framework.web.service.TokenService;
+import com.fs.system.service.ISysRoleService;
 import com.github.pagehelper.PageHelper;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -148,13 +151,14 @@ public class CrmCustomerController extends BaseController
         crmCustomer.setIsLine(0);
         List<CrmCustomerListVO> list = crmCustomerService.selectCrmCustomerListVO(crmCustomer);
         List<CrmCustomerExportVO> exportList=new ArrayList<>();
+        boolean checkPhone = isCheckPhone();
         for(CrmCustomerListVO customer:list){
             CrmCustomerExportVO vo=new CrmCustomerExportVO();
             if(customer.getSource()!=null){
                 vo.setSource(customer.getSource().toString());
             }
             BeanUtils.copyProperties(customer,vo);
-            if(customer.getMobile()!=null){
+            if(customer.getMobile()!=null && !checkPhone){
                 vo.setMobile(customer.getMobile().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
             }
             exportList.add(vo);
@@ -193,8 +197,9 @@ public class CrmCustomerController extends BaseController
         }
         List<CrmCustomerListVO> list = crmCustomerService.selectCrmCustomerListQueryParam(crmCustomer);
         if (list != null) {
+            boolean checkPhone = isCheckPhone();
             for (CrmCustomerListVO vo : list) {
-                if(vo.getMobile()!=null){
+                if(vo.getMobile()!=null && !checkPhone){
                     vo.setMobile(vo.getMobile().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
                 }
 
@@ -204,6 +209,23 @@ public class CrmCustomerController extends BaseController
         return getDataTable(list);
     }
 
+    @Autowired
+    private ISysRoleService sysRoleService;
+    private boolean isCheckPhone() {
+        SysUser user = getLoginUser().getUser();
+        boolean flag = user.isAdmin();
+        if (flag) {
+            return true;
+        }
+        List<SysRole> roles = user.getRoles();
+        if (roles != null && !roles.isEmpty()) {
+            Long[] roleIds = roles.stream().map(SysRole::getRoleId).toArray(Long[]::new);
+            return sysRoleService.getIsCheckPhone(roleIds);
+        }
+
+        return false;
+    }
+
 
     @PreAuthorize("@ss.hasPermi('crm:customer:query')")
     @GetMapping(value = "/query/{customerId}")

+ 84 - 0
fs-admin/src/main/java/com/fs/crm/controller/CrmCustomerLevelController.java

@@ -0,0 +1,84 @@
+package com.fs.crm.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+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.crm.domain.CrmCustomerLevel;
+import com.fs.crm.param.CrmCustomerLevelParm;
+import com.fs.crm.param.CrmCustomerLevelQueryParam;
+import com.fs.crm.service.ICrmCustomerLevelService;
+import com.fs.crm.vo.CrmCustomerLevelVO;
+import com.fs.his.vo.OptionsVO;
+import lombok.AllArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+@RestController
+@RequestMapping("/crm/customerLevel")
+@AllArgsConstructor
+public class CrmCustomerLevelController extends BaseController {
+
+    private final ICrmCustomerLevelService customerLevelService;
+
+    @PreAuthorize("@ss.hasPermi('crm:customerLevel:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CrmCustomerLevelQueryParam param) {
+        startPage();
+        List<CrmCustomerLevelVO> list = customerLevelService.selectCrmCustomerLevelVOList(param);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('crm:customerLevel:add')")
+    @Log(title = "客户级别", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    public AjaxResult add(@Valid @RequestBody CrmCustomerLevelParm param) {
+        return toAjax(customerLevelService.saveCustomerLevel(param));
+    }
+
+    @PreAuthorize("@ss.hasPermi('crm:customerLevel:edit')")
+    @Log(title = "客户级别", businessType = BusinessType.UPDATE)
+    @PutMapping("/edit")
+    public AjaxResult edit(@Valid @RequestBody CrmCustomerLevelParm param) {
+        return toAjax(customerLevelService.editCustomerLevel(param));
+    }
+
+    @PreAuthorize("@ss.hasPermi('crm:customerLevel:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable Long id) {
+        return AjaxResult.success(customerLevelService.selectCrmCustomerLevelVOById(id));
+    }
+
+    @PreAuthorize("@ss.hasPermi('crm:customerLevel:delete')")
+    @Log(title = "客户", businessType = BusinessType.DELETE)
+    @DeleteMapping("/delete/{ids}")
+    public AjaxResult delete(@PathVariable Long[] ids) {
+        customerLevelService.removeByIds(Arrays.asList(ids));
+        return AjaxResult.success();
+    }
+
+    @GetMapping("/getCustomerLevelOption")
+    public R getCustomerLevelOption(Integer status) {
+        LambdaQueryWrapper<CrmCustomerLevel> wrapper = Wrappers.lambdaQuery();
+        if (Objects.nonNull(status)) {
+            wrapper.eq(CrmCustomerLevel::getStatus, status);
+        }
+        List<OptionsVO> options = customerLevelService.list(wrapper).stream().map(l -> {
+            OptionsVO vo = new OptionsVO();
+            vo.setDictLabel(l.getName());
+            vo.setDictValue(l.getId());
+            return vo;
+        }).collect(Collectors.toList());
+        return R.ok().put("data", options);
+    }
+}

+ 54 - 0
fs-admin/src/main/java/com/fs/crm/controller/ReportController.java

@@ -0,0 +1,54 @@
+package com.fs.crm.controller;
+
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.model.LoginUser;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.crm.domain.Report;
+import com.fs.framework.web.service.TokenService;
+import com.fs.crm.param.ReportParam;
+import com.fs.crm.service.ReportService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.CollectionUtils;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+
+@RestController
+@RequestMapping("/crm/report")
+public class ReportController extends BaseController {
+    @Autowired
+    private ReportService reportService;
+    @Autowired
+    private TokenService tokenService;
+    @GetMapping("/reportList")
+    public TableDataInfo getReport(ReportParam param, HttpServletRequest request)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+
+        Long userId = loginUser.getUser().getUserId();
+        param.setCompanyUserId(userId);
+        List<Report> list = reportService.getReport(param);
+        return getDataTable(list);
+    }
+    @GetMapping("/export")
+    public AjaxResult export(ReportParam param,HttpServletRequest request)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(request);
+
+        Long userId = loginUser.getUser().getUserId();
+        param.setCompanyUserId(userId);
+        List<Report> list = reportService.getReport(param);
+        if (CollectionUtils.isEmpty(list)){
+            return AjaxResult.error("请选择导出数据");
+        }
+        ExcelUtil<Report> util = new ExcelUtil<Report>(Report.class);
+        return util.exportExcel(list, "report");
+    }
+
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/fastGpt/FastGptChatReplaceTextController.java

@@ -0,0 +1,97 @@
+package com.fs.fastGpt;
+
+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.fastGpt.domain.FastGptChatReplaceText;
+import com.fs.fastGpt.service.IFastGptChatReplaceTextService;
+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 2025-01-18
+ */
+@RestController
+@RequestMapping("/fastGpt/fastGptChatReplaceText")
+public class FastGptChatReplaceTextController extends BaseController
+{
+    @Autowired
+    private IFastGptChatReplaceTextService fastGptChatReplaceTextService;
+
+    /**
+     * 查询易错词语列表
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastGptChatReplaceText:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FastGptChatReplaceText fastGptChatReplaceText)
+    {
+        startPage();
+        List<FastGptChatReplaceText> list = fastGptChatReplaceTextService.selectFastGptChatReplaceTextList(fastGptChatReplaceText);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出易错词语列表
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastGptChatReplaceText:export')")
+    @Log(title = "易错词语", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FastGptChatReplaceText fastGptChatReplaceText)
+    {
+        List<FastGptChatReplaceText> list = fastGptChatReplaceTextService.selectFastGptChatReplaceTextList(fastGptChatReplaceText);
+        ExcelUtil<FastGptChatReplaceText> util = new ExcelUtil<FastGptChatReplaceText>(FastGptChatReplaceText.class);
+        return util.exportExcel(list, "易错词语数据");
+    }
+
+    /**
+     * 获取易错词语详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastGptChatReplaceText:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fastGptChatReplaceTextService.selectFastGptChatReplaceTextById(id));
+    }
+
+    /**
+     * 新增易错词语
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastGptChatReplaceText:add')")
+    @Log(title = "易错词语", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FastGptChatReplaceText fastGptChatReplaceText)
+    {
+        return toAjax(fastGptChatReplaceTextService.insertFastGptChatReplaceText(fastGptChatReplaceText));
+    }
+
+    /**
+     * 修改易错词语
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastGptChatReplaceText:edit')")
+    @Log(title = "易错词语", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FastGptChatReplaceText fastGptChatReplaceText)
+    {
+        return toAjax(fastGptChatReplaceTextService.updateFastGptChatReplaceText(fastGptChatReplaceText));
+    }
+
+    /**
+     * 删除易错词语
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastGptChatReplaceText:remove')")
+    @Log(title = "易错词语", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fastGptChatReplaceTextService.deleteFastGptChatReplaceTextByIds(ids));
+    }
+}

+ 112 - 0
fs-admin/src/main/java/com/fs/fastGpt/FastGptKeywordSendController.java

@@ -0,0 +1,112 @@
+package com.fs.fastGpt;
+
+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.fastGpt.domain.FastGptKeyword;
+import com.fs.fastGpt.domain.FastGptKeywordSend;
+import com.fs.fastGpt.service.IFastGptKeywordSendService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * Ai事件表(根据关键字发送文本和图片)Controller
+ * 
+ * @author fs
+ * @date 2025-05-12
+ */
+@RestController
+@RequestMapping("/fastGpt/fastGptKeywordSend")
+public class FastGptKeywordSendController extends BaseController
+{
+    @Autowired
+    private IFastGptKeywordSendService fastGptKeywordSendService;
+
+    @GetMapping("/keywordList")
+    public R keywordList()
+    {
+        List<FastGptKeyword> list = fastGptKeywordSendService.selectFastGptKeywordList(1);
+        return R.ok().put("data",list);
+    }
+    /**
+     * 查询Ai事件表(根据关键字发送文本和图片)列表
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastGptKeywordSend:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FastGptKeywordSend fastGptKeywordSend)
+    {
+        startPage();
+        fastGptKeywordSend.setKeywordType(1L);
+        List<FastGptKeywordSend> list = fastGptKeywordSendService.selectFastGptKeywordSendList(fastGptKeywordSend);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出Ai事件表(根据关键字发送文本和图片)列表
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastGptKeywordSend:export')")
+    @Log(title = "Ai事件表(根据关键字发送文本和图片)", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FastGptKeywordSend fastGptKeywordSend)
+    {
+        fastGptKeywordSend.setKeywordType(1L);
+        List<FastGptKeywordSend> list = fastGptKeywordSendService.selectFastGptKeywordSendList(fastGptKeywordSend);
+        ExcelUtil<FastGptKeywordSend> util = new ExcelUtil<FastGptKeywordSend>(FastGptKeywordSend.class);
+        return util.exportExcel(list, "Ai事件表(根据关键字发送文本和图片)数据");
+    }
+
+    /**
+     * 获取Ai事件表(根据关键字发送文本和图片)详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastGptKeywordSend:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        Long keywordType = 1L;
+        return AjaxResult.success(fastGptKeywordSendService.selectFastGptKeywordSendById(id,keywordType));
+    }
+
+    /**
+     * 新增Ai事件表(根据关键字发送文本和图片)
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastGptKeywordSend:add')")
+    @Log(title = "Ai事件表(根据关键字发送文本和图片)", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FastGptKeywordSend fastGptKeywordSend)
+    {
+        fastGptKeywordSend.setKeywordType(1L);
+        fastGptKeywordSend.setRoleIds(null);
+        return toAjax(fastGptKeywordSendService.insertFastGptKeywordSend(fastGptKeywordSend));
+    }
+
+    /**
+     * 修改Ai事件表(根据关键字发送文本和图片)
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastGptKeywordSend:edit')")
+    @Log(title = "Ai事件表(根据关键字发送文本和图片)", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FastGptKeywordSend fastGptKeywordSend)
+    {
+        fastGptKeywordSend.setKeywordType(1L);
+        fastGptKeywordSend.setRoleIds(null);
+        return toAjax(fastGptKeywordSendService.updateFastGptKeywordSend(fastGptKeywordSend));
+    }
+
+    /**
+     * 删除Ai事件表(根据关键字发送文本和图片)
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastGptKeywordSend:remove')")
+    @Log(title = "Ai事件表(根据关键字发送文本和图片)", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fastGptKeywordSendService.deleteFastGptKeywordSendByIds(ids));
+    }
+}

+ 97 - 0
fs-admin/src/main/java/com/fs/fastGpt/FastgptChatArtificialWordsController.java

@@ -0,0 +1,97 @@
+package com.fs.fastGpt;
+
+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.fastGpt.domain.FastgptChatArtificialWords;
+import com.fs.fastGpt.service.IFastgptChatArtificialWordsService;
+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 2025-05-07
+ */
+@RestController
+@RequestMapping("/fastGpt/fastgptChatArtificialWords")
+public class FastgptChatArtificialWordsController extends BaseController
+{
+    @Autowired
+    private IFastgptChatArtificialWordsService fastgptChatArtificialWordsService;
+
+    /**
+     * 查询转人工提示词列表
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastgptChatArtificialWords:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FastgptChatArtificialWords fastgptChatArtificialWords)
+    {
+        startPage();
+        List<FastgptChatArtificialWords> list = fastgptChatArtificialWordsService.selectFastgptChatArtificialWordsList(fastgptChatArtificialWords);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出转人工提示词列表
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastgptChatArtificialWords:export')")
+    @Log(title = "转人工提示词", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FastgptChatArtificialWords fastgptChatArtificialWords)
+    {
+        List<FastgptChatArtificialWords> list = fastgptChatArtificialWordsService.selectFastgptChatArtificialWordsList(fastgptChatArtificialWords);
+        ExcelUtil<FastgptChatArtificialWords> util = new ExcelUtil<FastgptChatArtificialWords>(FastgptChatArtificialWords.class);
+        return util.exportExcel(list, "转人工提示词数据");
+    }
+
+    /**
+     * 获取转人工提示词详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastgptChatArtificialWords:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fastgptChatArtificialWordsService.selectFastgptChatArtificialWordsById(id));
+    }
+
+    /**
+     * 新增转人工提示词
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastgptChatArtificialWords:add')")
+    @Log(title = "转人工提示词", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FastgptChatArtificialWords fastgptChatArtificialWords)
+    {
+        return toAjax(fastgptChatArtificialWordsService.insertFastgptChatArtificialWords(fastgptChatArtificialWords));
+    }
+
+    /**
+     * 修改转人工提示词
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastgptChatArtificialWords:edit')")
+    @Log(title = "转人工提示词", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FastgptChatArtificialWords fastgptChatArtificialWords)
+    {
+        return toAjax(fastgptChatArtificialWordsService.updateFastgptChatArtificialWords(fastgptChatArtificialWords));
+    }
+
+    /**
+     * 删除转人工提示词
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastgptChatArtificialWords:remove')")
+    @Log(title = "转人工提示词", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fastgptChatArtificialWordsService.deleteFastgptChatArtificialWordsByIds(ids));
+    }
+}

+ 139 - 0
fs-admin/src/main/java/com/fs/fastGpt/FastgptEventLogTotalController.java

@@ -0,0 +1,139 @@
+package com.fs.fastGpt;
+
+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.fastGpt.domain.FastgptEventLogTotal;
+import com.fs.fastGpt.param.FastgptEventLogTotalParam;
+import com.fs.fastGpt.service.IFastGptRoleService;
+import com.fs.fastGpt.service.IFastgptEventLogTotalService;
+import com.fs.fastGpt.vo.FastgptEventLogTotalVo;
+import com.github.pagehelper.PageInfo;
+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.List;
+
+/**
+ * ai事件埋点统计Controller
+ * 
+ * @author fs
+ * @date 2025-06-26
+ */
+@RestController
+@RequestMapping("/fastGpt/fastgptEventLogTotal")
+public class FastgptEventLogTotalController extends BaseController
+{
+    @Autowired
+    private IFastgptEventLogTotalService fastgptEventLogTotalService;
+
+    @Autowired
+    private IFastGptRoleService roleService;
+
+    /**
+     * 查询ai事件埋点统计列表
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastgptEventLogTotal:list')")
+    @PostMapping("/list")
+    public R pageList(@RequestBody FastgptEventLogTotalParam param)
+    {
+        FastgptEventLogTotalVo eventLogTotalVo = new FastgptEventLogTotalVo();
+        BeanUtils.copyProperties(param,eventLogTotalVo);
+        List<FastgptEventLogTotalVo> list = fastgptEventLogTotalService.selectFastgptEventLogTotalVoInfoList(eventLogTotalVo);
+
+        //统计对应的list的合
+        FastgptEventLogTotalVo totalVo = fastgptEventLogTotalService.totalFastgptEventLog(list);
+
+        int pageNum = param.getPageNum();
+        int pageSize = param.getPageSize();
+
+        int total = 0;
+        if (list != null) {
+            total = list.size();
+        }
+
+        int fromIndex = (pageNum - 1) * pageSize;
+        int toIndex = Math.min(fromIndex + pageSize, total);
+        PageInfo<FastgptEventLogTotalVo> pageInfo = new PageInfo<>();
+        if (list != null) {
+            List<FastgptEventLogTotalVo> paginatedList = list.subList(fromIndex, toIndex);
+            if(totalVo != null){
+                paginatedList.add(totalVo);
+            }
+            pageInfo = new PageInfo<>(paginatedList);
+        }else{
+            pageInfo = new PageInfo<>();
+        }
+        pageInfo.setTotal(total);
+        return R.ok().put("data",pageInfo);
+    }
+
+    /**
+     * 查询appKey
+     * @return  list
+     */
+    @GetMapping("/getFastGptRoleAppKeyList")
+    public R getFastGptRoleAppKeyList() {
+        return R.ok().put("data", roleService.selectFastGptRoleAppKeyList());
+    }
+    /**
+     * 导出ai事件埋点统计列表
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastgptEventLogTotal:export')")
+    @Log(title = "ai事件埋点统计", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FastgptEventLogTotal fastgptEventLogTotal)
+    {
+        List<FastgptEventLogTotal> list = fastgptEventLogTotalService.selectFastgptEventLogTotalList(fastgptEventLogTotal);
+        ExcelUtil<FastgptEventLogTotal> util = new ExcelUtil<FastgptEventLogTotal>(FastgptEventLogTotal.class);
+        return util.exportExcel(list, "ai事件埋点统计数据");
+    }
+
+    /**
+     * 获取ai事件埋点统计详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastgptEventLogTotal:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fastgptEventLogTotalService.selectFastgptEventLogTotalById(id));
+    }
+
+    /**
+     * 新增ai事件埋点统计
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastgptEventLogTotal:add')")
+    @Log(title = "ai事件埋点统计", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FastgptEventLogTotal fastgptEventLogTotal)
+    {
+        return toAjax(fastgptEventLogTotalService.insertFastgptEventLogTotal(fastgptEventLogTotal));
+    }
+
+    /**
+     * 修改ai事件埋点统计
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastgptEventLogTotal:edit')")
+    @Log(title = "ai事件埋点统计", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FastgptEventLogTotal fastgptEventLogTotal)
+    {
+        return toAjax(fastgptEventLogTotalService.updateFastgptEventLogTotal(fastgptEventLogTotal));
+    }
+
+    /**
+     * 删除ai事件埋点统计
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastgptEventLogTotal:remove')")
+    @Log(title = "ai事件埋点统计", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fastgptEventLogTotalService.deleteFastgptEventLogTotalByIds(ids));
+    }
+}

+ 126 - 0
fs-admin/src/main/java/com/fs/fastGpt/FastgptExtUserTagController.java

@@ -0,0 +1,126 @@
+package com.fs.fastGpt;
+
+import java.util.List;
+
+import com.fs.common.core.domain.R;
+import com.fs.fastGpt.vo.FastgptExtUserTagVO;
+import com.fs.framework.web.service.TokenService;
+import com.fs.qw.service.IQwCompanyService;
+import com.fs.qw.vo.QwOptionsVO;
+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.fastGpt.domain.FastgptExtUserTag;
+import com.fs.fastGpt.service.IFastgptExtUserTagService;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.core.page.TableDataInfo;
+
+/**
+ * 处理新客标签Controller
+ * 
+ * @author fs
+ * @date 2025-09-10
+ */
+@RestController
+@RequestMapping("/fastGpt/FastGptExtUserTag")
+public class FastgptExtUserTagController extends BaseController
+{
+    @Autowired
+    private IFastgptExtUserTagService fastgptExtUserTagService;
+
+
+    @Autowired
+    private IQwCompanyService qwCompanyService;
+
+
+    /**
+     * 查询处理新客标签列表
+     */
+    @PreAuthorize("@ss.hasPermi('FastGptExtUserTag:FastGptExtUserTag:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FastgptExtUserTag fastgptExtUserTag)
+    {
+        startPage();
+        List<FastgptExtUserTag> list = fastgptExtUserTagService.selectFastgptExtUserTagList(fastgptExtUserTag);
+        return getDataTable(list);
+    }
+    @PreAuthorize("@ss.hasPermi('qw:externalContact:addTag')")
+    @Log(title = "添加标签", businessType = BusinessType.UPDATE)
+    @PostMapping("/addFastGptTagByCorpId")
+    public R addFastGptTagByCorpId(@RequestBody FastgptExtUserTagVO fastgptExtUserTag) {
+        return fastgptExtUserTagService.addFastGptTagByCorpId(fastgptExtUserTag);
+    }
+    @GetMapping("/getMyQwUserList")
+    public R getMyQwUserList()
+    {
+        List<QwOptionsVO> list = qwCompanyService.selectQwCompanyListOptionsVO();
+        return  R.ok().put("data",list);
+    }
+
+    /**
+     * 导出处理新客标签列表
+     */
+    @PreAuthorize("@ss.hasPermi('FastGptExtUserTag:FastGptExtUserTag:export')")
+    @Log(title = "处理新客标签", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FastgptExtUserTag fastgptExtUserTag)
+    {
+        List<FastgptExtUserTag> list = fastgptExtUserTagService.selectFastgptExtUserTagList(fastgptExtUserTag);
+        ExcelUtil<FastgptExtUserTag> util = new ExcelUtil<FastgptExtUserTag>(FastgptExtUserTag.class);
+        return util.exportExcel(list, "处理新客标签数据");
+    }
+
+    /**
+     * 获取处理新客标签详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('FastGptExtUserTag:FastGptExtUserTag:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fastgptExtUserTagService.selectFastgptExtUserTagById(id));
+    }
+
+    /**
+     * 新增处理新客标签
+     */
+    @PreAuthorize("@ss.hasPermi('FastGptExtUserTag:FastGptExtUserTag:add')")
+    @Log(title = "处理新客标签", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FastgptExtUserTag fastgptExtUserTag)
+    {
+        return toAjax(fastgptExtUserTagService.insertFastgptExtUserTag(fastgptExtUserTag));
+    }
+
+    /**
+     * 修改处理新客标签
+     */
+    @PreAuthorize("@ss.hasPermi('FastGptExtUserTag:FastGptExtUserTag:edit')")
+    @Log(title = "处理新客标签", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FastgptExtUserTag fastgptExtUserTag)
+    {
+        return toAjax(fastgptExtUserTagService.updateFastgptExtUserTag(fastgptExtUserTag));
+    }
+
+    /**
+     * 删除处理新客标签
+     */
+    @PreAuthorize("@ss.hasPermi('FastGptExtUserTag:FastGptExtUserTag:remove')")
+    @Log(title = "处理新客标签", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fastgptExtUserTagService.deleteFastgptExtUserTagByIds(ids));
+    }
+}

+ 23 - 4
fs-admin/src/main/java/com/fs/his/controller/FsArticleCateController.java

@@ -1,7 +1,9 @@
 package com.fs.his.controller;
 
+import java.util.Collection;
 import java.util.List;
 
+import com.fs.common.core.redis.RedisCache;
 import com.fs.his.vo.OptionsVO;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -24,7 +26,7 @@ import com.fs.common.core.page.TableDataInfo;
 
 /**
  * 文章分类Controller
- * 
+ *
  * @author fs
  * @date 2023-07-04
  */
@@ -34,6 +36,8 @@ public class FsArticleCateController extends BaseController
 {
     @Autowired
     private IFsArticleCateService fsArticleCateService;
+    @Autowired
+    RedisCache redisCache;
 
     /**
      * 查询文章分类列表
@@ -78,7 +82,12 @@ public class FsArticleCateController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody FsArticleCate fsArticleCate)
     {
-        return toAjax(fsArticleCateService.insertFsArticleCate(fsArticleCate));
+        int i = fsArticleCateService.insertFsArticleCate(fsArticleCate);
+        Collection<String> keys = redisCache.keys("getArticleCateList*");
+        for (String key : keys) {
+            redisCache.deleteObject(key);
+        }
+        return toAjax(i);
     }
 
     /**
@@ -89,7 +98,12 @@ public class FsArticleCateController extends BaseController
     @PutMapping
     public AjaxResult edit(@RequestBody FsArticleCate fsArticleCate)
     {
-        return toAjax(fsArticleCateService.updateFsArticleCate(fsArticleCate));
+        int i = fsArticleCateService.updateFsArticleCate(fsArticleCate);
+        Collection<String> keys = redisCache.keys("getArticleCateList*");
+        for (String key : keys) {
+            redisCache.deleteObject(key);
+        }
+        return toAjax(i);
     }
 
     /**
@@ -100,7 +114,12 @@ public class FsArticleCateController extends BaseController
 	@DeleteMapping("/{cateIds}")
     public AjaxResult remove(@PathVariable Long[] cateIds)
     {
-        return toAjax(fsArticleCateService.deleteFsArticleCateByCateIds(cateIds));
+        int i = fsArticleCateService.deleteFsArticleCateByCateIds(cateIds);
+        Collection<String> keys = redisCache.keys("getArticleCateList*");
+        for (String key : keys) {
+            redisCache.deleteObject(key);
+        }
+        return toAjax(i);
     }
 
     /**

+ 6 - 0
fs-admin/src/main/java/com/fs/his/controller/FsCityController.java

@@ -129,4 +129,10 @@ public class FsCityController extends BaseController
         return R.ok().put("data",fsCityService.getCitysArea());
     }
 
+    @GetMapping("/getAllList")
+    public R getAllList(FsCity fsCity)
+    {
+        List<FsCity> list = fsCityService.selectFsCityList(fsCity);
+        return R.ok().put("data",list);
+    }
 }

+ 1 - 0
fs-admin/src/main/java/com/fs/his/controller/FsCompanyController.java

@@ -145,6 +145,7 @@ public class FsCompanyController extends BaseController
     public AjaxResult edit(@RequestBody Company company)
     {
         company.setMoney(null);
+        company.setUpdateMiniApp(true);
         return toAjax(companyService.updateCompany(company));
     }
 

+ 22 - 3
fs-admin/src/main/java/com/fs/his/controller/FsDoctorArticleCateController.java

@@ -1,7 +1,9 @@
 package com.fs.his.controller;
 
+import java.util.Collection;
 import java.util.List;
 
+import com.fs.common.core.redis.RedisCache;
 import com.fs.his.vo.OptionsVO;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -34,6 +36,8 @@ public class FsDoctorArticleCateController extends BaseController
 {
     @Autowired
     private IFsDoctorArticleCateService fsDoctorArticleCateService;
+    @Autowired
+    RedisCache redisCache;
 
     /**
      * 查询医生文章分类列表
@@ -78,7 +82,12 @@ public class FsDoctorArticleCateController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody FsDoctorArticleCate fsDoctorArticleCate)
     {
-        return toAjax(fsDoctorArticleCateService.insertFsDoctorArticleCate(fsDoctorArticleCate));
+        int i = fsDoctorArticleCateService.insertFsDoctorArticleCate(fsDoctorArticleCate);
+        Collection<String> keys = redisCache.keys("getDoctorArticleCateList*");
+        for (String key : keys) {
+            redisCache.deleteObject(key);
+        }
+        return toAjax(i);
     }
 
     /**
@@ -89,7 +98,12 @@ public class FsDoctorArticleCateController extends BaseController
     @PutMapping
     public AjaxResult edit(@RequestBody FsDoctorArticleCate fsDoctorArticleCate)
     {
-        return toAjax(fsDoctorArticleCateService.updateFsDoctorArticleCate(fsDoctorArticleCate));
+        int i = fsDoctorArticleCateService.updateFsDoctorArticleCate(fsDoctorArticleCate);
+        Collection<String> keys = redisCache.keys("getDoctorArticleCateList*");
+        for (String key : keys) {
+            redisCache.deleteObject(key);
+        }
+        return toAjax(i);
     }
 
     /**
@@ -100,7 +114,12 @@ public class FsDoctorArticleCateController extends BaseController
 	@DeleteMapping("/{cateIds}")
     public AjaxResult remove(@PathVariable Long[] cateIds)
     {
-        return toAjax(fsDoctorArticleCateService.deleteFsDoctorArticleCateByCateIds(cateIds));
+        int i = fsDoctorArticleCateService.deleteFsDoctorArticleCateByCateIds(cateIds);
+        Collection<String> keys = redisCache.keys("getDoctorArticleCateList*");
+        for (String key : keys) {
+            redisCache.deleteObject(key);
+        }
+        return toAjax(i);
     }
 
     @GetMapping("/allList")

+ 13 - 3
fs-admin/src/main/java/com/fs/his/controller/FsDoctorArticleController.java

@@ -100,9 +100,14 @@ public class FsDoctorArticleController extends BaseController
     {
         fsDoctorArticleService.updateFsDoctorArticle(fsDoctorArticle);
         Collection<String> keys = redisCache.keys("getDoctorArticleList*");
-        for (String key : keys) {
-            redisCache.deleteObject(key);
+        Collection<String> details = redisCache.keys("getDoctorArticleById::" +fsDoctorArticle.getArticleId());
+        keys.addAll(details);
+        if (!keys.isEmpty()) {
+            for (String key : keys) {
+                redisCache.deleteObject(key);
+            }
         }
+
         return toAjax(1);
     }
 
@@ -114,6 +119,11 @@ public class FsDoctorArticleController extends BaseController
 	@DeleteMapping("/{articleIds}")
     public AjaxResult remove(@PathVariable Long[] articleIds)
     {
-        return toAjax(fsDoctorArticleService.deleteFsDoctorArticleByArticleIds(articleIds));
+        int i = fsDoctorArticleService.deleteFsDoctorArticleByArticleIds(articleIds);
+        Collection<String> keys = redisCache.keys("getDoctorArticleList*");
+        for (String key : keys) {
+            redisCache.deleteObject(key);
+        }
+        return toAjax(i);
     }
 }

+ 106 - 0
fs-admin/src/main/java/com/fs/his/controller/FsFirstDiagnosisController.java

@@ -0,0 +1,106 @@
+package com.fs.his.controller;
+
+import java.util.List;
+
+import com.fs.his.param.FsFirstDiagnosisParam;
+import com.fs.his.vo.FsFirstDiagnosisVO;
+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.his.domain.FsFirstDiagnosis;
+import com.fs.his.service.IFsFirstDiagnosisService;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.core.page.TableDataInfo;
+
+/**
+ * 初诊单Controller
+ * 
+ * @author fs
+ * @date 2025-09-01
+ */
+@RestController
+@RequestMapping("/his/fsFirstDiagnosis")
+public class FsFirstDiagnosisController extends BaseController
+{
+    @Autowired
+    private IFsFirstDiagnosisService fsFirstDiagnosisService;
+
+    /**
+     * 查询初诊单列表
+     */
+    @PreAuthorize("@ss.hasPermi('his:fsFirstDiagnosis:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsFirstDiagnosisParam fsFirstDiagnosis)
+    {
+        startPage();
+        List<FsFirstDiagnosisVO> list = fsFirstDiagnosisService.selectFsFirstDiagnosisVOList(fsFirstDiagnosis);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出初诊单列表
+     */
+    @PreAuthorize("@ss.hasPermi('his:fsFirstDiagnosis:export')")
+    @Log(title = "初诊单", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsFirstDiagnosisParam fsFirstDiagnosis)
+    {
+        List<FsFirstDiagnosisVO> list = fsFirstDiagnosisService.selectFsFirstDiagnosisVOList(fsFirstDiagnosis);
+        ExcelUtil<FsFirstDiagnosisVO> util = new ExcelUtil<FsFirstDiagnosisVO>(FsFirstDiagnosisVO.class);
+        return util.exportExcel(list, "初诊单数据");
+    }
+
+    /**
+     * 获取初诊单详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('his:fsFirstDiagnosis:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsFirstDiagnosisService.selectFsFirstDiagnosisById(id));
+    }
+
+    /**
+     * 新增初诊单
+     */
+    @PreAuthorize("@ss.hasPermi('his:fsFirstDiagnosis:add')")
+    @Log(title = "初诊单", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsFirstDiagnosis fsFirstDiagnosis)
+    {
+        return toAjax(fsFirstDiagnosisService.insertFsFirstDiagnosis(fsFirstDiagnosis));
+    }
+
+    /**
+     * 修改初诊单
+     */
+    @PreAuthorize("@ss.hasPermi('his:fsFirstDiagnosis:edit')")
+    @Log(title = "初诊单", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsFirstDiagnosis fsFirstDiagnosis)
+    {
+        return toAjax(fsFirstDiagnosisService.updateFsFirstDiagnosis(fsFirstDiagnosis));
+    }
+
+    /**
+     * 删除初诊单
+     */
+    @PreAuthorize("@ss.hasPermi('his:fsFirstDiagnosis:remove')")
+    @Log(title = "初诊单", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsFirstDiagnosisService.deleteFsFirstDiagnosisByIds(ids));
+    }
+}

+ 103 - 0
fs-admin/src/main/java/com/fs/his/controller/FsHfpayConfigController.java

@@ -0,0 +1,103 @@
+package com.fs.his.controller;
+
+import java.util.List;
+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.his.domain.FsHfpayConfig;
+import com.fs.his.service.IFsHfpayConfigService;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.core.page.TableDataInfo;
+
+/**
+ * 汇付多支付配置Controller
+ * 
+ * @author fs
+ * @date 2025-09-10
+ */
+@RestController
+@RequestMapping("/his/hfpayConfig")
+public class FsHfpayConfigController extends BaseController
+{
+    @Autowired
+    private IFsHfpayConfigService fsHfpayConfigService;
+
+    /**
+     * 查询汇付多支付配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('his:hfpayConfig:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsHfpayConfig fsHfpayConfig)
+    {
+        startPage();
+        List<FsHfpayConfig> list = fsHfpayConfigService.selectFsHfpayConfigList(fsHfpayConfig);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出汇付多支付配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('his:hfpayConfig:export')")
+    @Log(title = "汇付多支付配置", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsHfpayConfig fsHfpayConfig)
+    {
+        List<FsHfpayConfig> list = fsHfpayConfigService.selectFsHfpayConfigList(fsHfpayConfig);
+        ExcelUtil<FsHfpayConfig> util = new ExcelUtil<FsHfpayConfig>(FsHfpayConfig.class);
+        return util.exportExcel(list, "汇付多支付配置数据");
+    }
+
+    /**
+     * 获取汇付多支付配置详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('his:hfpayConfig:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsHfpayConfigService.selectFsHfpayConfigById(id));
+    }
+
+    /**
+     * 新增汇付多支付配置
+     */
+    @PreAuthorize("@ss.hasPermi('his:hfpayConfig:add')")
+    @Log(title = "汇付多支付配置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsHfpayConfig fsHfpayConfig)
+    {
+        return toAjax(fsHfpayConfigService.insertFsHfpayConfig(fsHfpayConfig));
+    }
+
+    /**
+     * 修改汇付多支付配置
+     */
+    @PreAuthorize("@ss.hasPermi('his:hfpayConfig:edit')")
+    @Log(title = "汇付多支付配置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsHfpayConfig fsHfpayConfig)
+    {
+        return toAjax(fsHfpayConfigService.updateFsHfpayConfig(fsHfpayConfig));
+    }
+
+    /**
+     * 删除汇付多支付配置
+     */
+    @PreAuthorize("@ss.hasPermi('his:hfpayConfig:remove')")
+    @Log(title = "汇付多支付配置", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsHfpayConfigService.deleteFsHfpayConfigByIds(ids));
+    }
+}

+ 99 - 0
fs-admin/src/main/java/com/fs/his/controller/FsHomeArticleCategoryController.java

@@ -0,0 +1,99 @@
+package com.fs.his.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.poi.ExcelUtil;
+import com.fs.hisStore.domain.FsHomeArticleCategoryScrm;
+import com.fs.hisStore.service.IFsHomeArticleCategoryScrmService;
+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 2025-05-21
+ */
+@RestController
+@RequestMapping("/his/homeCategory")
+public class FsHomeArticleCategoryController extends BaseController {
+    @Autowired
+    private IFsHomeArticleCategoryScrmService fsHomeArticleCategoryService;
+
+    /**
+     * 查询期刊分类列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:homeCategory:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsHomeArticleCategoryScrm fsHomeArticleCategory) {
+        startPage();
+        List<FsHomeArticleCategoryScrm> list = fsHomeArticleCategoryService.selectFsHomeArticleCategoryList(fsHomeArticleCategory);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出期刊分类列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:homeCategory:export')")
+    @Log(title = "期刊分类", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsHomeArticleCategoryScrm fsHomeArticleCategory) {
+        List<FsHomeArticleCategoryScrm> list = fsHomeArticleCategoryService.selectFsHomeArticleCategoryList(fsHomeArticleCategory);
+        ExcelUtil<FsHomeArticleCategoryScrm> util = new ExcelUtil<FsHomeArticleCategoryScrm>(FsHomeArticleCategoryScrm.class);
+        return util.exportExcel(list, "homeCategory");
+    }
+
+    /**
+     * 获取期刊分类详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:homeCategory:query')")
+    @GetMapping(value = "/{categoryId}")
+    public AjaxResult getInfo(@PathVariable("categoryId") Long categoryId) {
+        return AjaxResult.success(fsHomeArticleCategoryService.selectFsHomeArticleCategoryById(categoryId));
+    }
+
+    /**
+     * 新增期刊分类
+     */
+    @PreAuthorize("@ss.hasPermi('store:homeCategory:add')")
+    @Log(title = "期刊分类", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsHomeArticleCategoryScrm fsHomeArticleCategory) {
+        return toAjax(fsHomeArticleCategoryService.insertFsHomeArticleCategory(fsHomeArticleCategory));
+    }
+
+    /**
+     * 修改期刊分类
+     */
+    @PreAuthorize("@ss.hasPermi('store:homeCategory:edit')")
+    @Log(title = "期刊分类", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsHomeArticleCategoryScrm fsHomeArticleCategory) {
+        return toAjax(fsHomeArticleCategoryService.updateFsHomeArticleCategory(fsHomeArticleCategory));
+    }
+
+    /**
+     * 删除期刊分类
+     */
+    @PreAuthorize("@ss.hasPermi('store:homeCategory:remove')")
+    @Log(title = "期刊分类", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{categoryIds}")
+    public AjaxResult remove(@PathVariable Long[] categoryIds) {
+        return toAjax(fsHomeArticleCategoryService.deleteFsHomeArticleCategoryByIds(categoryIds));
+    }
+
+    @GetMapping("/allList")
+    public R getAllList(FsHomeArticleCategoryScrm fsHomeArticleCategory) {
+        fsHomeArticleCategory.setStatus(1);
+        List<FsHomeArticleCategoryScrm> list = fsHomeArticleCategoryService.selectFsHomeArticleCategoryList(fsHomeArticleCategory);
+        return R.ok().put("rows", list);
+    }
+
+}

+ 94 - 0
fs-admin/src/main/java/com/fs/his/controller/FsHomeArticleController.java

@@ -0,0 +1,94 @@
+package com.fs.his.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.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.hisStore.domain.FsHomeArticleScrm;
+import com.fs.hisStore.service.IFsHomeArticleScrmService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+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 2025-05-21
+ */
+@RestController
+@RequestMapping("/his/homeArticle")
+public class FsHomeArticleController extends BaseController {
+    @Autowired
+    private IFsHomeArticleScrmService fsHomeArticleService;
+
+    /**
+     * 查询期刊列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:homeArticle:list')")
+    @GetMapping("/list")
+    public R list(FsHomeArticleScrm fsHomeArticle)
+    {
+        PageHelper.startPage(fsHomeArticle.getPageNum(), fsHomeArticle.getPageSize());
+        List<FsHomeArticleScrm> list = fsHomeArticleService.selectFsHomeArticleList(fsHomeArticle);
+        PageInfo<FsHomeArticleScrm> listPageInfo = new PageInfo<>(list);
+        return R.ok().put("rows", listPageInfo);
+    }
+
+    /**
+     * 导出期刊列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:homeArticle:export')")
+    @Log(title = "期刊", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsHomeArticleScrm fsHomeArticle) {
+        List<FsHomeArticleScrm> list = fsHomeArticleService.selectFsHomeArticleList(fsHomeArticle);
+        ExcelUtil<FsHomeArticleScrm> util = new ExcelUtil<FsHomeArticleScrm>(FsHomeArticleScrm.class);
+        return util.exportExcel(list, "homArticle");
+    }
+
+    /**
+     * 获取期刊详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:homeArticle:query')")
+    @GetMapping(value = "/{articleId}")
+    public AjaxResult getInfo(@PathVariable("articleId") Long articleId) {
+        return AjaxResult.success(fsHomeArticleService.selectFsHomeArticleById(articleId));
+    }
+
+    /**
+     * 新增期刊
+     */
+    @PreAuthorize("@ss.hasPermi('store:homeArticle:add')")
+    @Log(title = "期刊", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsHomeArticleScrm fsHomeArticle) {
+        return toAjax(fsHomeArticleService.insertFsHomeArticle(fsHomeArticle));
+    }
+
+    /**
+     * 修改期刊
+     */
+    @PreAuthorize("@ss.hasPermi('store:homeArticle:edit')")
+    @Log(title = "期刊", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsHomeArticleScrm fsHomeArticle) {
+        return toAjax(fsHomeArticleService.updateFsHomeArticle(fsHomeArticle));
+    }
+
+    /**
+     * 删除期刊
+     */
+    @PreAuthorize("@ss.hasPermi('store:homeArticle:remove')")
+    @Log(title = "期刊", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{articleIds}")
+    public AjaxResult remove(@PathVariable Long[] articleIds) {
+        return toAjax(fsHomeArticleService.deleteFsHomeArticleByIds(articleIds));
+    }
+}

+ 93 - 0
fs-admin/src/main/java/com/fs/his/controller/FsHomeArticleViewController.java

@@ -0,0 +1,93 @@
+package com.fs.his.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.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.hisStore.domain.FsHomeArticleViewScrm;
+import com.fs.hisStore.service.IFsHomeArticleViewScrmService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+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 2025-05-21
+ */
+@RestController
+@RequestMapping("/his/homeView")
+public class FsHomeArticleViewController extends BaseController {
+    @Autowired
+    private IFsHomeArticleViewScrmService fsHomeArticleViewService;
+
+    /**
+     * 查询期刊阅读列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:homeView:list')")
+    @GetMapping("/list")
+    public R list(FsHomeArticleViewScrm fsHomeArticleView) {
+        PageHelper.startPage(fsHomeArticleView.getPageNum(), fsHomeArticleView.getPageSize());
+        List<FsHomeArticleViewScrm> list = fsHomeArticleViewService.selectFsHomeArticleViewList(fsHomeArticleView);
+        PageInfo<FsHomeArticleViewScrm> listPageInfo = new PageInfo<>(list);
+        return R.ok().put("rows", listPageInfo);
+    }
+
+    /**
+     * 导出期刊阅读列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:homeView:export')")
+    @Log(title = "期刊阅读", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsHomeArticleViewScrm fsHomeArticleView) {
+        List<FsHomeArticleViewScrm> list = fsHomeArticleViewService.selectFsHomeArticleViewList(fsHomeArticleView);
+        ExcelUtil<FsHomeArticleViewScrm> util = new ExcelUtil<FsHomeArticleViewScrm>(FsHomeArticleViewScrm.class);
+        return util.exportExcel(list, "homeView");
+    }
+
+    /**
+     * 获取期刊阅读详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:homeView:query')")
+    @GetMapping(value = "/{viewId}")
+    public AjaxResult getInfo(@PathVariable("viewId") Long viewId) {
+        return AjaxResult.success(fsHomeArticleViewService.selectFsHomeArticleViewById(viewId));
+    }
+
+    /**
+     * 新增期刊阅读
+     */
+    @PreAuthorize("@ss.hasPermi('store:homeView:add')")
+    @Log(title = "期刊阅读", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsHomeArticleViewScrm fsHomeArticleView) {
+        return toAjax(fsHomeArticleViewService.insertFsHomeArticleView(fsHomeArticleView));
+    }
+
+    /**
+     * 修改期刊阅读
+     */
+    @PreAuthorize("@ss.hasPermi('store:homeView:edit')")
+    @Log(title = "期刊阅读", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsHomeArticleViewScrm fsHomeArticleView) {
+        return toAjax(fsHomeArticleViewService.updateFsHomeArticleView(fsHomeArticleView));
+    }
+
+    /**
+     * 删除期刊阅读
+     */
+    @PreAuthorize("@ss.hasPermi('store:homeView:remove')")
+    @Log(title = "期刊阅读", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{viewIds}")
+    public AjaxResult remove(@PathVariable Long[] viewIds) {
+        return toAjax(fsHomeArticleViewService.deleteFsHomeArticleViewByIds(viewIds));
+    }
+}

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

@@ -157,7 +157,7 @@ public class FsInquiryOrderController extends BaseController
     @GetMapping(value = "/sendMsg/{orderId}")
     public AjaxResult sendMsg(@PathVariable("orderId") Long orderId)
     {
-        ;
+
         return AjaxResult.success(fsInquiryOrderService.sendStartMsg(orderId));
     }
     /**

+ 52 - 0
fs-admin/src/main/java/com/fs/his/controller/FsInquiryPatientInfoController.java

@@ -0,0 +1,52 @@
+package com.fs.his.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.enums.BusinessType;
+import com.fs.his.param.FsInquiryPatientParam;
+import com.fs.his.service.IFsInquiryPatientInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 问诊患者信息(FsInquiryPatientInfo)
+ */
+@RestController
+@RequestMapping("/his/inquiryPatientInfo")
+public class FsInquiryPatientInfoController extends BaseController {
+
+
+    @Autowired
+    private IFsInquiryPatientInfoService patientInfoService;
+
+
+
+
+    /**
+     * 新增患者问诊信息
+     */
+    @PreAuthorize("@ss.hasPermi('his:inquiryPatientInfo:add')")
+    @Log(title = "患者问诊信息", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsInquiryPatientParam param){
+        return toAjax(patientInfoService.insertFsInquiryPatientInfo(param));
+    }
+
+    /**
+     * 修改患者问诊信息
+     */
+    @PreAuthorize("@ss.hasPermi('his:inquiryPatientInfo:edit')")
+    @Log(title = "患者问诊信息", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsInquiryPatientParam param){
+        return toAjax(patientInfoService.updateFsInquiryPatientInfo(param));
+    }
+
+    @GetMapping("/detail/{inquiryOrderId}")
+    public AjaxResult get(@PathVariable("inquiryOrderId") Long inquiryOrderId){
+        return AjaxResult.success(patientInfoService.selectFsInquiryPatientInfo(inquiryOrderId));
+    }
+}

+ 12 - 1
fs-admin/src/main/java/com/fs/his/controller/FsIntegralOrderController.java

@@ -1,6 +1,7 @@
 package com.fs.his.controller;
 
 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;
@@ -16,6 +17,7 @@ import com.fs.his.enums.ShipperCodeEnum;
 import com.fs.his.param.FsIntegralOrderParam;
 import com.fs.his.service.IFsExpressService;
 import com.fs.his.service.IFsIntegralOrderService;
+import com.fs.his.utils.PhoneUtil;
 import com.fs.his.vo.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -66,8 +68,17 @@ public class FsIntegralOrderController extends BaseController
     {
         List<FsIntegralOrder> list = fsIntegralOrderService.selectFsIntegralOrderList(fsIntegralOrder);
         for (FsIntegralOrder vo : list) {
+            //商品名称以及原价赋值
+            String itemJson = vo.getItemJson();
+            if(StringUtils.isNotBlank(itemJson)){
+                JSONObject jsonObject = JSONObject.parseObject(itemJson);
+                vo.setGoodsName(jsonObject.getString("goodsName"));
+                vo.setOtPrice(jsonObject.getBigDecimal("otPrice"));
+            }
             if (vo.getUserPhone()!=null&&!vo.getUserPhone().equals("")){
-                vo.setUserPhone(vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                if(vo.getUserPhone().chars().allMatch(Character::isDigit)){continue;}
+//                vo.setUserPhone(vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                vo.setUserPhone(PhoneUtil.decryptPhone(vo.getUserPhone()));
             }
         }
         ExcelUtil<FsIntegralOrder> util = new ExcelUtil<FsIntegralOrder>(FsIntegralOrder.class);

+ 10 - 8
fs-admin/src/main/java/com/fs/his/controller/FsPackageCateController.java

@@ -7,6 +7,8 @@ import java.util.Map;
 import com.fs.common.core.redis.RedisCache;
 import com.fs.his.param.FsPackageCateUParam;
 import com.fs.his.vo.OptionsVO;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -84,10 +86,10 @@ public class FsPackageCateController extends BaseController
     public AjaxResult add(@RequestBody FsPackageCate fsPackageCate)
     {
         fsPackageCateService.insertFsPackageCate(fsPackageCate);
-        Collection<String> keys = redisCache.keys("getPackagCateList*");
-        for (String key : keys) {
-            redisCache.deleteObject(key);
-        }
+//        Collection<String> keys = redisCache.keys("getPackagCateList*");
+//        for (String key : keys) {
+//            redisCache.deleteObject(key);
+//        }
         return toAjax(1);
     }
 
@@ -100,10 +102,10 @@ public class FsPackageCateController extends BaseController
     public AjaxResult edit(@RequestBody FsPackageCate fsPackageCate)
     {
         fsPackageCateService.updateFsPackageCate(fsPackageCate);
-        Collection<String> keys = redisCache.keys("getPackagCateList*");
-        for (String key : keys) {
-            redisCache.deleteObject(key);
-        }
+//        Collection<String> keys = redisCache.keys("getPackagCateList*");
+//        for (String key : keys) {
+//            redisCache.deleteObject(key);
+//        }
         return toAjax(1);
     }
 

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

@@ -77,6 +77,7 @@ public class FsPackageOrderController extends BaseController
     @GetMapping("/export")
     public AjaxResult export(FsPackageOrderParam  fsPackageOrder)
     {
+        Integer status = fsPackageOrder.getStatus();
         Integer exportType1 = exportTaskService.isExportType1(SecurityUtils.getUserId());
         if (exportType1>0){
             return AjaxResult.error("你已经有正在导出的任务");
@@ -85,6 +86,7 @@ public class FsPackageOrderController extends BaseController
         if (fsPackageOrderService.isEntityNull(fsPackageOrder)){
             return AjaxResult.error("请筛选数据导出");
         }
+        fsPackageOrder.setStatus(status); //解决isEntityNull方法后status缺失
         Long count = fsPackageOrderService.selectFsPackageOrderExcelListVOCount(fsPackageOrder);
         if (count>30000){
             return AjaxResult.error("导出数据不可超过3w条");

+ 64 - 0
fs-admin/src/main/java/com/fs/his/controller/FsPackageSolarTermController.java

@@ -0,0 +1,64 @@
+package com.fs.his.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.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.his.domain.FsPackageSolarTerm;
+import com.fs.his.param.FsPackageSolarTermParam;
+import com.fs.his.service.IFsPackageSolarTermService;
+import com.fs.his.vo.FsPackageSolarTermVO;
+import lombok.AllArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/his/packageSolarTerm")
+@AllArgsConstructor
+public class FsPackageSolarTermController extends BaseController {
+
+    private final IFsPackageSolarTermService solarTermService;
+
+    @PreAuthorize("@ss.hasPermi('his:packageSolarTerm:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsPackageSolarTermParam param) {
+        startPage();
+        List<FsPackageSolarTermVO> list = solarTermService.selectFsPackageSolarTermListVO(param);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('his:packageSolarTerm:query')")
+    @GetMapping(value = "/{solarTermId}")
+    public AjaxResult getInfo(@PathVariable Long solarTermId) {
+        return AjaxResult.success(solarTermService.selectFsPackageSolarTermVO(solarTermId));
+    }
+
+    @PreAuthorize("@ss.hasPermi('his:packageSolarTerm:add')")
+    @Log(title = "套餐包节气", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsPackageSolarTerm param) {
+        return toAjax(solarTermService.insertFsPackageSolarTerm(param));
+    }
+
+    @PreAuthorize("@ss.hasPermi('his:packageSolarTerm:edit')")
+    @Log(title = "套餐包节气", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsPackageSolarTerm param) {
+        return toAjax(solarTermService.updateFsPackageSolarTerm(param));
+    }
+
+    @PreAuthorize("@ss.hasPermi('his:packageSolarTerm:remove')")
+    @Log(title = "套餐包", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{solarTermIds}")
+    public AjaxResult remove(@PathVariable Long[] solarTermIds) {
+        return toAjax(solarTermService.deleteFsPackageSolarTermByIds(solarTermIds));
+    }
+
+    @GetMapping("/getOptions")
+    public AjaxResult getOptions() {
+        return AjaxResult.success(solarTermService.getOptions());
+    }
+}

+ 114 - 0
fs-admin/src/main/java/com/fs/his/controller/FsPhysicalReportTemplateController.java

@@ -0,0 +1,114 @@
+package com.fs.his.controller;
+
+import java.util.List;
+
+import com.fs.common.core.domain.model.LoginUser;
+import com.fs.common.utils.ServletUtils;
+import com.fs.framework.web.service.TokenService;
+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.his.domain.FsPhysicalReportTemplate;
+import com.fs.his.service.IFsPhysicalReportTemplateService;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.core.page.TableDataInfo;
+
+/**
+ * 体检报告模板Controller
+ * 
+ * @author fs
+ * @date 2025-07-23
+ */
+@RestController
+@RequestMapping("/his/physicalReportTemplate")
+public class FsPhysicalReportTemplateController extends BaseController
+{
+    @Autowired
+    private IFsPhysicalReportTemplateService fsPhysicalReportTemplateService;
+
+    @Autowired
+    private TokenService tokenService;
+
+    /**
+     * 查询体检报告模板列表
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplate:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsPhysicalReportTemplate fsPhysicalReportTemplate)
+    {
+        startPage();
+        List<FsPhysicalReportTemplate> list = fsPhysicalReportTemplateService.selectFsPhysicalReportTemplateList(fsPhysicalReportTemplate);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出体检报告模板列表
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplate:export')")
+    @Log(title = "体检报告模板", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsPhysicalReportTemplate fsPhysicalReportTemplate)
+    {
+        List<FsPhysicalReportTemplate> list = fsPhysicalReportTemplateService.selectFsPhysicalReportTemplateList(fsPhysicalReportTemplate);
+        ExcelUtil<FsPhysicalReportTemplate> util = new ExcelUtil<FsPhysicalReportTemplate>(FsPhysicalReportTemplate.class);
+        return util.exportExcel(list, "体检报告模板数据");
+    }
+
+    /**
+     * 获取体检报告模板详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplate:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") String id)
+    {
+        return AjaxResult.success(fsPhysicalReportTemplateService.selectFsPhysicalReportTemplateById(id));
+    }
+
+    /**
+     * 新增体检报告模板
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplate:add')")
+    @Log(title = "体检报告模板", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsPhysicalReportTemplate fsPhysicalReportTemplate)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fsPhysicalReportTemplate.setCreateBy(String.valueOf(loginUser.getUserId()));
+        return toAjax(fsPhysicalReportTemplateService.insertFsPhysicalReportTemplate(fsPhysicalReportTemplate));
+    }
+
+    /**
+     * 修改体检报告模板
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplate:edit')")
+    @Log(title = "体检报告模板", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsPhysicalReportTemplate fsPhysicalReportTemplate)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fsPhysicalReportTemplate.setUpdateBy(String.valueOf(loginUser.getUserId()));
+        return toAjax(fsPhysicalReportTemplateService.updateFsPhysicalReportTemplate(fsPhysicalReportTemplate));
+    }
+
+    /**
+     * 删除体检报告模板
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplate:remove')")
+    @Log(title = "体检报告模板", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids)
+    {
+        return toAjax(fsPhysicalReportTemplateService.deleteFsPhysicalReportTemplateByIds(ids));
+    }
+}

+ 140 - 0
fs-admin/src/main/java/com/fs/his/controller/FsPhysicalReportTemplateFieldController.java

@@ -0,0 +1,140 @@
+package com.fs.his.controller;
+
+import java.util.List;
+
+import com.fs.common.core.domain.R;
+import com.fs.common.core.domain.model.LoginUser;
+import com.fs.common.exception.ServiceException;
+import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.StringUtils;
+import com.fs.framework.web.service.TokenService;
+import com.fs.his.dto.FsPhysicalReportTemplateFieldDTO;
+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.his.domain.FsPhysicalReportTemplateField;
+import com.fs.his.service.IFsPhysicalReportTemplateFieldService;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.core.page.TableDataInfo;
+
+/**
+ * 体检报告模板字段Controller
+ *
+ * @author fs
+ * @date 2025-07-24
+ */
+@RestController
+@RequestMapping("/his/physicalReportTemplateField")
+public class FsPhysicalReportTemplateFieldController extends BaseController {
+    @Autowired
+    private IFsPhysicalReportTemplateFieldService fsPhysicalReportTemplateFieldService;
+
+    @Autowired
+    private TokenService tokenService;
+
+    /**
+     * 查询体检报告模板字段列表
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplateField:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsPhysicalReportTemplateField fsPhysicalReportTemplateField) {
+        startPage();
+        List<FsPhysicalReportTemplateField> list = fsPhysicalReportTemplateFieldService.selectFsPhysicalReportTemplateFieldList(fsPhysicalReportTemplateField);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出体检报告模板字段列表
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplateField:export')")
+    @Log(title = "体检报告模板字段", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsPhysicalReportTemplateField fsPhysicalReportTemplateField) {
+        List<FsPhysicalReportTemplateField> list = fsPhysicalReportTemplateFieldService.selectFsPhysicalReportTemplateFieldList(fsPhysicalReportTemplateField);
+        ExcelUtil<FsPhysicalReportTemplateField> util = new ExcelUtil<FsPhysicalReportTemplateField>(FsPhysicalReportTemplateField.class);
+        return util.exportExcel(list, "体检报告模板字段数据");
+    }
+
+    /**
+     * 获取体检报告模板字段详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplateField:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") String id) {
+        return AjaxResult.success(fsPhysicalReportTemplateFieldService.selectFsPhysicalReportTemplateFieldById(id));
+    }
+
+    /**
+     * 新增体检报告模板字段
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplateField:add')")
+    @Log(title = "体检报告模板字段", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsPhysicalReportTemplateField fsPhysicalReportTemplateField) {
+        return toAjax(fsPhysicalReportTemplateFieldService.insertFsPhysicalReportTemplateField(fsPhysicalReportTemplateField));
+    }
+
+    /**
+     * 修改体检报告模板字段
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplateField:edit')")
+    @Log(title = "体检报告模板字段", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsPhysicalReportTemplateField fsPhysicalReportTemplateField) {
+        return toAjax(fsPhysicalReportTemplateFieldService.updateFsPhysicalReportTemplateField(fsPhysicalReportTemplateField));
+    }
+
+    /**
+     * 删除体检报告模板字段
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplateField:remove')")
+    @Log(title = "体检报告模板字段", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids) {
+        return toAjax(fsPhysicalReportTemplateFieldService.deleteFsPhysicalReportTemplateFieldByIds(ids));
+    }
+
+    /**
+     * 获取模板自定义字段
+     *
+     * @param templateId 模板ID
+     * @return R
+     **/
+    @PostMapping("/getTemplateField/{templateId}")
+    public R getTemplateField(@PathVariable String templateId) {
+        if (StringUtils.isNull(templateId)) {
+            return R.error("操作失败,模板ID不能为空!");
+        }
+        return fsPhysicalReportTemplateFieldService.getTemplateField(templateId);
+    }
+
+    /**
+     * 新增模板
+     *
+     * @param fieldDTO
+     * @return AjaxResult
+     **/
+    @Log(title = "体检报告模板字段", businessType = BusinessType.INSERT)
+    @PostMapping("/saveTemplate")
+    public AjaxResult saveTemplate(@RequestBody FsPhysicalReportTemplateFieldDTO fieldDTO) {
+        if (StringUtils.isNull(fieldDTO.getTemplateId())) {
+            throw new ServiceException("操作失败,模板ID不能为空!");
+        } else if (fieldDTO.getTemplateFieldList().isEmpty()) {
+            throw new ServiceException("操作失败,字段列表不能为空!");
+        }
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fieldDTO.setCreateBy(String.valueOf(loginUser.getUserId()));
+        return toAjax(fsPhysicalReportTemplateFieldService.saveFsPhysicalReportTemplateField(fieldDTO));
+    }
+}

+ 267 - 52
fs-admin/src/main/java/com/fs/his/controller/FsStoreOrderController.java

@@ -9,6 +9,8 @@ import java.util.stream.Collectors;
 import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSON;
 import com.fs.common.core.domain.R;
+import com.fs.common.core.domain.entity.SysRole;
+import com.fs.common.core.domain.entity.SysUser;
 import com.fs.common.core.domain.model.LoginUser;
 import com.fs.common.utils.ParseUtils;
 import com.fs.common.utils.SecurityUtils;
@@ -17,28 +19,34 @@ import com.fs.common.utils.StringUtils;
 import com.fs.company.param.CompanyStoreOrderMoneyLogsListParam;
 import com.fs.company.service.ICompanyMoneyLogsService;
 import com.fs.company.vo.CompanyStoreOrderMoneyLogsVO;
+import com.fs.config.cloud.CloudHostProper;
 import com.fs.erp.domain.ErpDeliverys;
 import com.fs.erp.domain.ErpOrderQuery;
+import com.fs.erp.dto.ErpDeliverysRequest;
+import com.fs.erp.dto.ErpDeliverysResponse;
 import com.fs.erp.dto.ErpOrderQueryRequert;
 import com.fs.erp.dto.ErpOrderQueryResponse;
+import com.fs.erp.dto.df.BspOrderResponse;
+import com.fs.erp.dto.df.DFConfigVo;
 import com.fs.erp.service.IErpOrderService;
 import com.fs.framework.web.service.TokenService;
 import com.fs.his.config.FsSysConfig;
 import com.fs.his.domain.*;
 import com.fs.his.dto.ExpressInfoDTO;
 import com.fs.his.dto.StoreOrderExpressExportDTO;
+import com.fs.his.dto.TracesDTO;
 import com.fs.his.enums.ShipperCodeEnum;
 import com.fs.his.param.FsFollowMsgParam;
 import com.fs.his.param.FsStoreOrderParam;
 import com.fs.his.param.FsStoreOrderSalesParam;
 import com.fs.his.param.FsStoreOrderSetErpPhoneParam;
-import com.fs.his.service.IFsExportTaskService;
-import com.fs.his.service.IFsExpressService;
-import com.fs.his.service.IFsStoreService;
+import com.fs.his.service.*;
 import com.fs.his.utils.ConfigUtil;
 import com.fs.his.vo.*;
 import com.fs.system.domain.SysConfig;
 import com.fs.system.mapper.SysConfigMapper;
+import com.fs.system.service.ISysRoleService;
+import com.github.pagehelper.PageHelper;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -49,7 +57,6 @@ 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.his.service.IFsStoreOrderService;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.common.core.page.TableDataInfo;
 import org.springframework.web.multipart.MultipartFile;
@@ -90,20 +97,61 @@ public class FsStoreOrderController extends BaseController
     @Qualifier("wdtErpOrderServiceImpl")
     private IErpOrderService wdtOrderService;
 
+    @Autowired
+    @Qualifier("hzOMSErpOrderServiceImpl")
+    private IErpOrderService hzOMSErpOrderService;
+
+    @Autowired
+    @Qualifier("dfOrderServiceImpl")
+    private IErpOrderService dfOrderService;
+
+    @Autowired
+    @Qualifier("JSTErpOrderServiceImpl")
+    private IErpOrderService jSTOrderService;
+    @Autowired
+    @Qualifier("k9OrderScrmServiceImpl")
+    private IErpOrderService k9OrderService;
+
     @Autowired
     SysConfigMapper sysConfigMapper;
+
+    @Autowired
+    private IFsStoreOrderDfService fsStoreOrderDfService;
+
+    @Autowired
+    private CloudHostProper cloudHostProper;
     /**
      * 查询订单列表
      */
-    @GetMapping("/list")
-    public TableDataInfo list(FsStoreOrderParam fsStoreOrder)
+    @PostMapping("/list")
+    public TableDataInfo list(@RequestBody FsStoreOrderParam fsStoreOrder)
     {
-        startPage();
-        if (fsStoreOrder.getUserPhoneMk()!=null&&fsStoreOrder.getUserPhoneMk()!=""){
+        PageHelper.startPage(fsStoreOrder);
+        if (fsStoreOrder.getUserPhoneMk()!=null&& !fsStoreOrder.getUserPhoneMk().isEmpty()){
             fsStoreOrder.setUserPhone(encryptPhone(fsStoreOrder.getUserPhoneMk()));
         }
-        List<FsStoreOrderListVO> list = fsStoreOrderService.selectFsStoreOrderListVO(fsStoreOrder);
-        return getDataTable(list);
+        List<FsStoreOrderListVO> list;
+        if (StringUtils.isNotBlank(fsStoreOrder.getErpAccount())){
+            //金牛erp查询
+            list = fsStoreOrderService.selectFsStoreOrderListVOByErpAccount(fsStoreOrder);
+        } else {
+            list = fsStoreOrderService.selectFsStoreOrderListVO(fsStoreOrder);
+        }
+        //金牛需求 区别其他项目 status = 6 (金牛代服管家) ,其他项目请避免使用订单状态status = 6
+        TableDataInfo dataTable = getDataTable(list);
+        if ("金牛明医".equals(cloudHostProper.getCompanyName())){
+            if (fsStoreOrder.getStatus() !=null && fsStoreOrder.getStatus() != 1){
+                list.forEach(vo->{
+                    //查询顺丰代服账号
+                    FsStoreOrderDf df = fsStoreOrderDfService.selectFsStoreOrderDfByOrderId(vo.getOrderId());
+                    if (df != null){
+                        vo.setErpAccount(df.getLoginAccount());
+                    }
+                });
+            }
+            dataTable.setMsg("jnmy");
+        }
+        return dataTable;
     }
 
     /**
@@ -149,14 +197,20 @@ public class FsStoreOrderController extends BaseController
     @GetMapping("/orderExport")
     public AjaxResult orderExport(FsStoreOrderParam param) {
         Integer exportType1 = exportTaskService.isExportType1(SecurityUtils.getUserId());
-        if (exportType1>0){
-            return AjaxResult.error("你已经有正在导出的任务");
-        }
+//        if (exportType1>0){
+//            return AjaxResult.error("你已经有正在导出的任务");
+//        }
         if (fsStoreOrderService.isEntityNull(param)){
             return AjaxResult.error("请筛选数据导出");
         }
         logger.info("tc>\n【咨询报告】:{}", SecurityUtils.getUserId());
-        Long count = fsStoreOrderService.selectFsStoreOrderListVOByExportCount(param);
+        Long count;
+        if (StringUtils.isNotBlank(param.getErpAccount())){
+            //金牛erp查询
+            count = fsStoreOrderService.selectFsStoreOrderListVOByErpAccountByExportCount(param);
+        } else {
+            count = fsStoreOrderService.selectFsStoreOrderListVOByExportCount(param);
+        }
         if (count>30000){
             return AjaxResult.error("导出数据不可超过3w条");
         }
@@ -171,13 +225,31 @@ public class FsStoreOrderController extends BaseController
         task.setUserId(SecurityUtils.getUserId());
         exportTaskService.insertFsExportTask(task);
         param.setTaskId(task.getTaskId());
-        exportTaskService.exportStore1Data(param);
+        boolean checkPhone = isCheckPhone();
+        exportTaskService.exportStore1Data(param,checkPhone);
 
         return new AjaxResult(200,"后台正在导出,请等待...任务ID:"+task.getTaskId(),task.getTaskId());
 
 
     }
 
+    @Autowired
+    private ISysRoleService sysRoleService;
+    private boolean isCheckPhone() {
+        SysUser user = getLoginUser().getUser();
+        boolean flag = user.isAdmin();
+        if (flag) {
+            return true;
+        }
+        List<SysRole> roles = user.getRoles();
+        if (roles != null && !roles.isEmpty()) {
+            Long[] roleIds = roles.stream().map(SysRole::getRoleId).toArray(Long[]::new);
+            return sysRoleService.getIsCheckPhone(roleIds);
+        }
+
+        return false;
+    }
+
     @GetMapping("/importTemplate")
     public AjaxResult sendExport()
     {
@@ -185,6 +257,13 @@ public class FsStoreOrderController extends BaseController
         return util.importTemplateExcel("导入运单号");
     }
 
+    @GetMapping("/importUpdateOrderTemplate")
+    public AjaxResult importUpdateOrderTemplate()
+    {
+        ExcelUtil<FsStoreOrderStatusExcelVO> util = new ExcelUtil<>(FsStoreOrderStatusExcelVO.class);
+        return util.importTemplateExcel("修改订单");
+    }
+
     @Log(title = "导入", businessType = BusinessType.IMPORT)
     @PreAuthorize("@ss.hasPermi('store:storeOrder:importExpress')")
     @PostMapping("/importExpress")
@@ -206,6 +285,17 @@ public class FsStoreOrderController extends BaseController
         return AjaxResult.success(message);
     }
 
+    @Log(title = "导入修改订单", businessType = BusinessType.IMPORT)
+    @PostMapping("/importOrderStatusData")
+    @PreAuthorize("@ss.hasPermi('his:storeOrder:editImport')")
+    public AjaxResult importOrderStatusData(MultipartFile file, boolean updateSupport) throws Exception
+    {
+        ExcelUtil<FsStoreOrderStatusExcelVO> util = new ExcelUtil<>(FsStoreOrderStatusExcelVO.class);
+        List<FsStoreOrderStatusExcelVO> list = util.importExcel(file.getInputStream());
+        String message = fsStoreOrderService.importOrderStatusData(list);
+        return AjaxResult.success(message);
+    }
+
     @GetMapping("/importExpressTemplate")
     public AjaxResult importExpressTemplate() {
         ExcelUtil<StoreOrderExpressExportDTO> util = new ExcelUtil<StoreOrderExpressExportDTO>(StoreOrderExpressExportDTO.class);
@@ -299,6 +389,17 @@ public class FsStoreOrderController extends BaseController
         return toAjax(fsStoreOrderService.updateFsStoreOrder(fsStoreOrder));
     }
 
+    /**
+     * 修改订单
+     */
+    @PreAuthorize("@ss.hasPermi('his:storeOrder:edit')")
+    @Log(title = "订单", businessType = BusinessType.UPDATE)
+    @PutMapping("/updateStoreOrder")
+    public R updateStoreOrder(@RequestBody FsStoreOrder fsStoreOrder)
+    {
+        return fsStoreOrderService.updateStoreOrder(fsStoreOrder);
+    }
+
     @PreAuthorize("@ss.hasPermi('his:storeOrder:updateDelivery')")
     @Log(title = "修改物流", businessType = BusinessType.UPDATE)
     @PutMapping("/updateDelivery")
@@ -369,6 +470,16 @@ public class FsStoreOrderController extends BaseController
                 } else if (erpType == 2){
                     //旺店通
                     erpOrderService =  wdtOrderService;
+                }  else if (erpType == 3){
+                    //
+                    erpOrderService =  hzOMSErpOrderService;
+                } else if (erpType == 4){
+                    //代服
+                    erpOrderService =  dfOrderService;
+                }else if(erpType == 5){
+                    erpOrderService=jSTOrderService;
+                }else if(erpType == 6){
+                    erpOrderService=k9OrderService;
                 }
                 return erpOrderService;
 
@@ -417,7 +528,8 @@ public class FsStoreOrderController extends BaseController
     @PutMapping("/sendGoods")
     public AjaxResult sendGoods(@RequestBody FsStoreOrder fsStoreOrder)
     {
-        return toAjax(fsStoreOrderService.sendGoods(fsStoreOrder));
+        String nickName = getLoginUser().getUser().getNickName();
+        return toAjax(fsStoreOrderService.sendGoods(fsStoreOrder,nickName));
     }
     /**
      * 推送到智慧药房
@@ -449,7 +561,8 @@ public class FsStoreOrderController extends BaseController
     public AjaxResult getGoods(@RequestBody FsStoreOrder fsStoreOrder)
     {
         logger.info("总后台手动确认收货:"+fsStoreOrder.getOrderId());
-        return toAjax(fsStoreOrderService.getGoods(fsStoreOrder.getOrderId()));
+        String nickName = getLoginUser().getUser().getNickName();
+        return toAjax(fsStoreOrderService.getGoods(fsStoreOrder.getOrderId(),nickName));
     }
 
     /**
@@ -483,22 +596,106 @@ public class FsStoreOrderController extends BaseController
     @ApiOperation("批量创建ERP订单")
     @PreAuthorize("@ss.hasPermi('his:storeOrder:createErpOrder')")
     @PostMapping(value = "/batchCreateErpOrder")
-    public R batchCreateErpOrder(@RequestBody List<Long> orderIds)
-    {
-        if (orderIds != null && !orderIds.isEmpty()) {
-            orderIds.forEach(orderId->{
-                try {
-                    fsStoreOrderService.createOmsOrder(orderId);
-                } catch (ParseException e) {
-                    throw new RuntimeException(e);
+    public R batchCreateErpOrder(@RequestBody FsStoreOrderSetErpPhoneParam param)
+    {
+        String loginAccount = param.getLoginAccount();
+        if (StringUtils.isBlank(loginAccount)){
+            return R.error("未选择推送erp账户");
+        }
+        FsStoreOrderDf df = getDFInfo(loginAccount);
+        if (df.getLoginAccount() == null){
+            return R.error("未查询到所选erp账户");
+        }
+        List<Long> orderIds = param.getOrderIds();
+        if (orderIds  == null || orderIds.isEmpty()) {
+            if (param.getUserPhoneMk() != null && !param.getUserPhoneMk().isEmpty()) {
+                param.setUserPhone(encryptPhone(param.getUserPhoneMk()));
+            }
+            List<FsStoreOrderListVO> list;
+            if (StringUtils.isNotBlank(param.getErpAccount())){
+                //金牛erp查询
+                list = fsStoreOrderService.selectFsStoreOrderListVOByErpAccount(param);
+            } else {
+                list = fsStoreOrderService.selectFsStoreOrderListVO(param);
+            }
+            orderIds = list.stream().map(FsStoreOrderListVO::getOrderId).collect(Collectors.toList());
+        }
+        if (orderIds.isEmpty()){
+            return R.ok();
+        }
+        orderIds.forEach(orderId->{
+            try {
+                df.setOrderId(orderId);
+                FsStoreOrderDf temp = fsStoreOrderDfService.selectFsStoreOrderDfByOrderId(df.getOrderId());
+                if (temp == null){
+                    fsStoreOrderDfService.insertFsStoreOrderDf(df);
                 }
+                fsStoreOrderService.createOmsOrder(orderId);
+            } catch (ParseException e) {
+                throw new RuntimeException(e);
+            }
+
+        });
+        return R.ok();
+    }
 
-            });
-        }
 
+    @ApiOperation("批量设置订单账户")
+    @PreAuthorize("@ss.hasPermi('his:storeOrder:createErpOrder')")
+    @PostMapping(value = "/batchSetErpOrder")
+    public R batchSetErpOrder(@RequestBody FsStoreOrderSetErpPhoneParam param)
+    {
+        String loginAccount = param.getLoginAccount();
+        if (StringUtils.isBlank(loginAccount)){
+            return R.error("未选择erp账户");
+        }
+        FsStoreOrderDf df = getDFInfo(loginAccount);
+        if (df.getLoginAccount() == null){
+            return R.error("未查询到所选erp账户");
+        }
+        List<Long> orderIds = param.getOrderIds();
+        if (orderIds  == null || orderIds.isEmpty()) {
+            if (param.getUserPhoneMk() != null && !param.getUserPhoneMk().isEmpty()) {
+                param.setUserPhone(encryptPhone(param.getUserPhoneMk()));
+            }
+            List<FsStoreOrderListVO> list = fsStoreOrderService.selectFsStoreOrderListVOByErpAccount(param);
+            orderIds = list.stream().map(FsStoreOrderListVO::getOrderId).collect(Collectors.toList());
+        }
+        if (orderIds.isEmpty()){
+            return R.ok();
+        }
+        orderIds.forEach(orderId->{
+            df.setOrderId(orderId);
+            FsStoreOrderDf temp = fsStoreOrderDfService.selectFsStoreOrderDfByOrderId(df.getOrderId());
+            if (temp != null){
+                df.setUpdateTime(new Date());
+                fsStoreOrderDfService.updateFsStoreOrderDf(df);
+            } else {
+                fsStoreOrderDfService.insertFsStoreOrderDf(df);
+            }
+        });
         return R.ok();
     }
 
+    private FsStoreOrderDf getDFInfo(String loginAccount) {
+        //查询订单账户 判断是否存在该订单账户
+        List<DFConfigVo> erpAccounts = fsStoreOrderService.getErpAccount();
+        FsStoreOrderDf df = new FsStoreOrderDf();
+        for (DFConfigVo erpAccount : erpAccounts) {
+            if (loginAccount.equals(erpAccount.getLoginAccount())){
+                //添加df记录
+                df.setAppKey(erpAccount.getDfAppKey());
+                df.setAppSecret(erpAccount.getDfAppsecret());
+                df.setLoginAccount(loginAccount);
+                df.setMonthlyCard(erpAccount.getMonthlyCard());
+                df.setExpressProductCode(erpAccount.getExpressProductCode());
+                df.setStatus(0);
+                break;
+            }
+        }
+        return df;
+    }
+
     @Log(title = "冻结/解冻", businessType = BusinessType.UPDATE)
     @PreAuthorize("@ss.hasPermi('his:storeOrder:editTuiMoney')")
     @GetMapping(value = "/editTuiMoney/{id}")
@@ -535,7 +732,12 @@ public class FsStoreOrderController extends BaseController
     @PreAuthorize("@ss.hasPermi('his:storeOrder:syncExpress')")
     @GetMapping(value = "/syncExpress/{id}")
     public R syncExpress(@PathVariable("id") Long id) {
-        return fsStoreOrderService.syncExpress(id);
+        IErpOrderService erpService = getErpService();
+        if (erpService!=null && erpService == dfOrderService){
+            return fsStoreOrderService.syncDfExpress(id);
+        } else {
+            return fsStoreOrderService.syncExpress(id);
+        }
     }
 
     @PreAuthorize("@ss.hasPermi('his:storeOrder:sendMsg')")
@@ -556,34 +758,41 @@ public class FsStoreOrderController extends BaseController
     @GetMapping(value = "/getExpress/{id}")
     public R getExpress(@PathVariable("id") Long id)
     {
-        FsStoreOrder order=fsStoreOrderService.selectFsStoreOrderByOrderId(id);
         ExpressInfoDTO expressInfoDTO=null;
-        if(StringUtils.isNotEmpty(order.getDeliverySn())){
-            String lastFourNumber = "";
-            if (order.getDeliveryCode().equals(ShipperCodeEnum.SF.getValue())) {
-
-                lastFourNumber = order.getUserPhone();
-                if (lastFourNumber.length() == 11) {
-                    lastFourNumber = StrUtil.sub(lastFourNumber, lastFourNumber.length(), -4);
-                }else if (lastFourNumber.length()>11){
-                    String jm = decryptPhone(lastFourNumber);
-                    lastFourNumber = StrUtil.sub(jm, jm.length(), -4);
-                }
-            }
-            expressInfoDTO=expressService.getExpressInfo(order.getOrderCode(),order.getDeliveryCode(),order.getDeliverySn(),lastFourNumber);
-
-            if((expressInfoDTO.getStateEx()!=null&&expressInfoDTO.getStateEx().equals("0"))&&(expressInfoDTO.getState()!=null&&expressInfoDTO.getState().equals("0"))){
-                lastFourNumber = "19923690275";
+        FsStoreOrder order=fsStoreOrderService.selectFsStoreOrderByOrderId(id);
+        //代服管家 查询自己的物流
+        IErpOrderService erpService = getErpService();
+        if (erpService == dfOrderService){
+            expressInfoDTO = fsStoreOrderService.getDfExpressInfoDTO(order);
+        } else {
+            if(StringUtils.isNotEmpty(order.getDeliverySn())){
+                String lastFourNumber = "";
                 if (order.getDeliveryCode().equals(ShipperCodeEnum.SF.getValue())) {
+
+                    lastFourNumber = order.getUserPhone();
                     if (lastFourNumber.length() == 11) {
                         lastFourNumber = StrUtil.sub(lastFourNumber, lastFourNumber.length(), -4);
+                    }else if (lastFourNumber.length()>11){
+                        String jm = decryptPhone(lastFourNumber);
+                        lastFourNumber = StrUtil.sub(jm, jm.length(), -4);
                     }
                 }
-
                 expressInfoDTO=expressService.getExpressInfo(order.getOrderCode(),order.getDeliveryCode(),order.getDeliverySn(),lastFourNumber);
 
+                if((expressInfoDTO.getStateEx()!=null&&expressInfoDTO.getStateEx().equals("0"))&&(expressInfoDTO.getState()!=null&&expressInfoDTO.getState().equals("0"))){
+                    lastFourNumber = "19923690275";
+                    if (order.getDeliveryCode().equals(ShipperCodeEnum.SF.getValue())) {
+                        if (lastFourNumber.length() == 11) {
+                            lastFourNumber = StrUtil.sub(lastFourNumber, lastFourNumber.length(), -4);
+                        }
+                    }
+
+                    expressInfoDTO=expressService.getExpressInfo(order.getOrderCode(),order.getDeliveryCode(),order.getDeliverySn(),lastFourNumber);
+
+                }
             }
         }
+
         return R.ok().put("data",expressInfoDTO);
     }
     @PreAuthorize("@ss.hasPermi('his:storeOrder:msgList')")
@@ -646,15 +855,21 @@ public class FsStoreOrderController extends BaseController
     @PostMapping("/editErpPhone")
     public AjaxResult editErpPhone(@RequestBody FsStoreOrderSetErpPhoneParam param)
     {
-        String erpPhone = param.getErpPhone();
-        if (StringUtils.isBlank(erpPhone)) {
+        List<String> erpPhone = param.getErpPhone();
+        if (erpPhone == null || erpPhone.isEmpty()) {
             return AjaxResult.error("请选择手机号");
         }
-        List<Long> orderIds = param.getOrderIds();
-        if (orderIds  == null || orderIds.isEmpty()){
-            return AjaxResult.success();
-        }
         return toAjax(fsStoreOrderService.batchUpdateErpByOrderIds(param));
     }
 
+    /**
+     * 获取erp账户
+     */
+    @GetMapping("/getErpAccount")
+    public R getErpAccount()
+    {
+        List<DFConfigVo> erpAccounts = fsStoreOrderService.getErpAccount();
+        List<String> list = erpAccounts.stream().map(DFConfigVo::getLoginAccount).collect(Collectors.toList());
+        return R.ok().put("data", list);
+    }
 }

+ 3 - 1
fs-admin/src/main/java/com/fs/his/controller/FsStorePaymentController.java

@@ -11,6 +11,7 @@ import com.fs.his.param.FsStorePaymentParam;
 import com.fs.his.service.IFsExportTaskService;
 import com.fs.his.vo.FsStorePaymentExcelVO;
 import com.fs.his.vo.FsStorePaymentVO;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -38,6 +39,7 @@ import com.fs.common.core.page.TableDataInfo;
  */
 @RestController
 @RequestMapping("/his/storePayment")
+@Slf4j
 public class FsStorePaymentController extends BaseController
 {
     @Autowired
@@ -131,7 +133,7 @@ public class FsStorePaymentController extends BaseController
     @GetMapping(value = "refund/{paymentId}")
     public R refund(@PathVariable("paymentId") Long paymentId)
     {
-
+        log.info("sysUserId: {} 提交退款", getUserId());
         return fsStorePaymentService.refundFsStorePayment(paymentId);
     }
 

+ 0 - 1
fs-admin/src/main/java/com/fs/his/controller/FsStoreProductPackageController.java

@@ -153,7 +153,6 @@ public class FsStoreProductPackageController extends BaseController
         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));
     }

+ 180 - 21
fs-admin/src/main/java/com/fs/his/controller/FsUserController.java

@@ -1,27 +1,47 @@
 package com.fs.his.controller;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
+import java.util.stream.Collectors;
 
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.fs.common.core.domain.R;
 import com.fs.common.core.domain.ResponseResult;
+import com.fs.common.core.domain.entity.SysRole;
+import com.fs.common.core.domain.entity.SysUser;
+import com.fs.common.exception.CustomException;
 import com.fs.common.utils.ParseUtils;
 import com.fs.common.utils.SecurityUtils;
+import com.fs.common.utils.StringUtils;
+import com.fs.course.domain.FsUserWatchStatistics;
+import com.fs.course.mapper.FsUserWatchStatisticsMapper;
+import com.fs.course.service.IFsUserCompanyUserService;
 import com.fs.his.domain.FsUserAddress;
+import com.fs.his.enums.FsUserIntegralLogTypeEnum;
+import com.fs.his.mapper.FsUserMapper;
+import com.fs.his.param.FsUserAddIntegralTemplateParam;
+import com.fs.his.param.FsUserAddPointsParam;
 import com.fs.his.param.FsUserParam;
+import com.fs.his.service.IFsUserIntegralLogsService;
 import com.fs.his.utils.PhoneUtil;
 import com.fs.his.vo.FsUserExportListVO;
 import com.fs.his.vo.FsUserVO;
 import com.fs.his.vo.UserVo;
+import com.fs.qw.dto.UserProjectDTO;
 import com.fs.store.param.h5.FsUserPageListParam;
 import com.fs.store.vo.h5.FsUserPageListVO;
+import com.fs.system.service.ISysRoleService;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.google.common.collect.Lists;
 import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.ibatis.session.ExecutorType;
+import org.apache.ibatis.session.SqlSession;
+import org.apache.ibatis.session.SqlSessionFactory;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PutMapping;
@@ -47,12 +67,20 @@ import static com.fs.his.utils.PhoneUtil.*;
  * @author fs
  * @date 2023-06-07
  */
+@Slf4j
 @RestController
 @RequestMapping("/his/user")
 public class FsUserController extends BaseController
 {
     @Autowired
     private IFsUserService fsUserService;
+    @Autowired
+    private IFsUserIntegralLogsService userIntegralLogsService;
+    @Autowired
+    private IFsUserCompanyUserService userCompanyUserService;
+
+    @Autowired
+    private SqlSessionFactory sqlSessionFactory;
 
     /**
      * 查询用户列表
@@ -65,21 +93,75 @@ public class FsUserController extends BaseController
         if (fsUser.getPhoneMk()!=null&&fsUser.getPhoneMk()!=""){
             fsUser.setPhone(encryptPhone(fsUser.getPhoneMk()));
         }
+        if(StringUtils.isNotEmpty(fsUser.getPhone())){
+            fsUser.setPhone(encryptPhone(fsUser.getPhone()));
+        }
         List<FsUserVO> list = fsUserService.selectFsUserListVO(fsUser);
+        boolean checkPhone = isCheckPhone();
         for (FsUserVO fsUserVO : list) {
             if(fsUserVO.getPhone() != null&&fsUserVO.getPhone()!=""){
-                if (fsUserVO.getPhone().length()>11){
-                    fsUserVO.setPhone(decryptPhoneMk(fsUserVO.getPhone()));
-                }else {
-                    fsUserVO.setPhone(fsUserVO.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                if (!checkPhone){
+                    if (fsUserVO.getPhone().length()>11){
+                        fsUserVO.setPhone(decryptPhoneMk(fsUserVO.getPhone()));
+                    }else {
+                        fsUserVO.setPhone(fsUserVO.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                    }
+                } else {
+                    if (fsUserVO.getPhone().length()>11) {
+                        fsUserVO.setPhone(decryptPhone(fsUserVO.getPhone()));
+                    }
                 }
-
             }
 
         }
         return getDataTable(list);
     }
 
+    @Autowired
+    private ISysRoleService sysRoleService;
+    private boolean isCheckPhone() {
+        SysUser user = getLoginUser().getUser();
+        boolean flag = user.isAdmin();
+        if (flag) {
+            return true;
+        }
+        List<SysRole> roles = user.getRoles();
+        if (roles != null && !roles.isEmpty()) {
+            Long[] roleIds = roles.stream().map(SysRole::getRoleId).toArray(Long[]::new);
+            return sysRoleService.getIsCheckPhone(roleIds);
+        }
+
+        return false;
+    }
+
+    @PreAuthorize("@ss.hasPermi('his:user:list')")
+    @GetMapping("/listProject")
+    public TableDataInfo listProject(FsUser fsUser)
+    {
+        startPage();
+        if(StringUtils.isNotEmpty(fsUser.getPhone())){
+            fsUser.setPhone(encryptPhone(fsUser.getPhone()));
+        }
+        List<FsUserVO> list = fsUserService.selectFsUserVOListByProject(fsUser);
+        boolean checkPhone = isCheckPhone();
+        for (FsUserVO fsUserVO : list) {
+            if(fsUserVO.getPhone() != null&&fsUserVO.getPhone()!=""){
+                if (!checkPhone){
+                    if (fsUserVO.getPhone().length()>11){
+                        fsUserVO.setPhone(decryptPhoneMk(fsUserVO.getPhone()));
+                    }else {
+                        fsUserVO.setPhone(fsUserVO.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                    }
+                } else {
+                    if (fsUserVO.getPhone().length()>11) {
+                        fsUserVO.setPhone(decryptPhone(fsUserVO.getPhone()));
+                    }
+                }
+            }
+        }
+        return getDataTable(list);
+    }
+
     /**
      * 导出用户列表
      */
@@ -97,9 +179,14 @@ public class FsUserController extends BaseController
             return AjaxResult.error("导出数据不可超过1w条");
         }
         List<FsUserExportListVO> list = fsUserService.selectFsUserExportListVO(fsUser);
+        boolean checkPhone = isCheckPhone();
         for (FsUserExportListVO vo : list) {
-            if (vo.getMobile()!=null){
+            if (vo.getMobile()!=null && !checkPhone){
                 vo.setMobile(vo.getMobile().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+            } else {
+                if (vo.getMobile().length()>11){
+                    vo.setMobile(decryptPhone(vo.getMobile()));
+                }
             }
         }
         ExcelUtil<FsUserExportListVO> util = new ExcelUtil<FsUserExportListVO>(FsUserExportListVO.class);
@@ -171,6 +258,17 @@ public class FsUserController extends BaseController
         return toAjax(fsUserService.deleteFsUserByUserIds(userIds));
     }
 
+    /**
+     * 删除微信用户和销售关系信息
+     */
+    @PreAuthorize("@ss.hasPermi('his:userCompanyUser:remove')")
+    @Log(title = "微信用户和销售关系", businessType = BusinessType.DELETE)
+    @DeleteMapping("/delete/{id}")
+    public AjaxResult delete(@PathVariable Long id)
+    {
+        return toAjax(userCompanyUserService.deleteFsUserCompanyUserById(id));
+    }
+
     /**
      * 查询用户
      */
@@ -188,6 +286,9 @@ public class FsUserController extends BaseController
     @GetMapping("/listBySearch")
     public R listBySearch(FsUser user)
     {
+        if (Objects.nonNull(user) && StringUtils.isNotBlank(user.getPhone())){
+            user.setPhone(PhoneUtil.encryptPhone(user.getPhone()));
+        }
         List<FsUser> list = fsUserService.selectFsUserList(user);
         return R.ok().put("data",list);
     }
@@ -198,25 +299,83 @@ public class FsUserController extends BaseController
     public R darkRoomList(FsUserPageListParam param) {
 //        startPage();
 //        PageHelper.startPage(param.getPageNum(), param.getPageSize());
-        PageInfo<FsUserPageListVO> fsUserPageListVOPageInfo = fsUserService.selectFsUserPageList(param);
-        if(ObjectUtils.isNotNull(fsUserPageListVOPageInfo)){
-            for (FsUserPageListVO fsUserPageListVO : fsUserPageListVOPageInfo.getList()) {
-                fsUserPageListVO.setPhone(ParseUtils.parsePhone(fsUserPageListVO.getPhone()));
-            }
-            Map<String, Object> map = new HashMap<String, Object>();
-            map.put("rows", fsUserPageListVOPageInfo.getList());
-            map.put("total", fsUserPageListVOPageInfo.getList().size());
-            return R.ok(map);
+        //判断是否是电话号码
+        if(StringUtils.isFullNumber(param.getKeyword()) && param.getKeyword().trim().length() == 11){
+            param.setKeyword(encryptPhone(param.getKeyword()));
         }
-        return R.ok();
+        PageInfo<FsUserPageListVO> fsUserPageListVOPageInfo = fsUserService.selectFsUserPageList(param);
+        Map<String, Object> map = new HashMap<String, Object>();
+        map.put("rows", fsUserPageListVOPageInfo.getList());
+        map.put("total", fsUserPageListVOPageInfo.getTotal());
+        return R.ok(map);
     }
 
     @PreAuthorize("@ss.hasPermi('his:user:enabledUsers')")
     @PostMapping("/enabledUsers")
     @ApiOperation("批量启用会员")
-    public ResponseResult<Boolean> enabledUsers(@RequestBody String[] ids) {
-        Boolean r = fsUserService.disabledUser(ids, true);
+    public ResponseResult<Boolean> enabledUsers(@RequestBody List<UserProjectDTO> ids) {
+        log.debug("批量启用会员 ids: {}", JSON.toJSONString(ids));
+        Boolean r = userCompanyUserService.batchUpdateUserProjectStatus(ids, 1);
         return ResponseResult.ok(r);
     }
 
+    @PreAuthorize("@ss.hasPermi('his:user:blacklist')")
+    @GetMapping("/blacklist")
+    @ApiOperation("黑名单")
+    public R blacklist(FsUserPageListParam param) {
+        //判断是否是电话号码
+        if(StringUtils.isFullNumber(param.getKeyword()) && param.getKeyword().trim().length() == 11){
+            param.setKeyword(encryptPhone(param.getKeyword()));
+        }
+        PageInfo<FsUserPageListVO> fsUserPageListVOPageInfo = fsUserService.selectFsUserPageList(param);
+        Map<String, Object> map = new HashMap<String, Object>();
+        map.put("rows", fsUserPageListVOPageInfo.getList());
+        map.put("total", fsUserPageListVOPageInfo.getTotal());
+        return R.ok(map);
+    }
+
+    @PreAuthorize("@ss.hasPermi('his:user:enabledBlackUsers')")
+    @PostMapping("/enabledBlackUsers")
+    @ApiOperation("批量启用会员")
+    public ResponseResult<Boolean> enabledBlackUsers(@RequestBody List<UserProjectDTO> ids) {
+        log.debug("批量启用会员 ids: {}", JSON.toJSONString(ids));
+        Boolean r = userCompanyUserService.batchUpdateUserProjectStatus(ids, 1);
+        return ResponseResult.ok(r);
+    }
+
+    @PreAuthorize("@ss.hasPermi('his:user:addPoints')")
+    @PostMapping("/addPoints")
+    @ApiOperation("添加积分")
+    public R addPoints(@RequestBody @Validated FsUserAddPointsParam param) {
+        FsUserAddIntegralTemplateParam integralTemplateParam = new FsUserAddIntegralTemplateParam();
+        integralTemplateParam.setUserId(param.getUserId());
+        integralTemplateParam.setLogType(FsUserIntegralLogTypeEnum.TYPE_23.getValue());
+        integralTemplateParam.setBusinessId(SecurityUtils.getUserId().toString());
+        integralTemplateParam.setPoints(param.getPoint());
+        integralTemplateParam.setRemark(param.getRemark());
+        return userIntegralLogsService.addIntegralTemplate(integralTemplateParam);
+    }
+
+//    @PutMapping("/encryptPhoneTemp")
+//    @ApiOperation("临时接口")
+//    public void encryptPhoneTemp(){
+//        FsUser fsUser = new FsUser();
+//        List<FsUser> list = fsUserService.selectFsUserList(fsUser);
+//        List<FsUser> fsUserList = list.stream().peek(v -> v.setPhone(encryptPhone(v.getPhone()))).collect(Collectors.toList());
+//
+//        // 分批次处理,一次提交500条
+//        List<List<FsUser>> batches = Lists.partition(fsUserList, 500);
+//        batches.forEach(batch -> {
+//            SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH);
+//            try {
+//                FsUserMapper mapper = sqlSession.getMapper(FsUserMapper.class);
+//                batch.forEach(mapper::updateFsUser);
+//                sqlSession.commit();
+//            } finally {
+//                sqlSession.close();
+//            }
+//        });
+//
+//    }
+
 }

+ 121 - 0
fs-admin/src/main/java/com/fs/his/controller/FsUserOnlineStateController.java

@@ -0,0 +1,121 @@
+package com.fs.his.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.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.StringUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.his.domain.FsUserOnlineState;
+import com.fs.his.service.IFsUserOnlineStateService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import java.util.List;
+
+import static com.fs.his.utils.PhoneUtil.decryptPhoneMk;
+import static com.fs.his.utils.PhoneUtil.encryptPhone;
+
+/**
+ * 用户上线情况Controller
+ *
+ * @author fs
+ * @date 2025-06-30
+ */
+@RestController
+@RequestMapping("/store/userOnlineState")
+public class FsUserOnlineStateController extends BaseController
+{
+    @Autowired
+    private IFsUserOnlineStateService fsUserOnlineStateService;
+
+    /**
+     * 查询用户上线情况列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:userOnlineState:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsUserOnlineState fsUserOnlineState)
+    {
+        startPage();
+        if(StringUtils.isNotEmpty(fsUserOnlineState.getPhone())){
+            fsUserOnlineState.setPhone(encryptPhone(fsUserOnlineState.getPhone()));
+        }
+        List<FsUserOnlineState> list = fsUserOnlineStateService.selectFsUserOnlineStateList(fsUserOnlineState);
+        if(!list.isEmpty()){
+            for (FsUserOnlineState userOnlineState : list) {
+                if(userOnlineState.getPhone() != null && userOnlineState.getPhone() != ""){
+                    if (userOnlineState.getPhone().length()>11){
+                        userOnlineState.setPhone(decryptPhoneMk(userOnlineState.getPhone()));
+                    }else {
+                        userOnlineState.setPhone(userOnlineState.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                    }
+                }
+            }
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出用户上线情况列表
+     */
+    @PreAuthorize("@ss.hasPermi('store:userOnlineState:export')")
+    @Log(title = "用户上线情况", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsUserOnlineState fsUserOnlineState)
+    {
+        List<FsUserOnlineState> list = fsUserOnlineStateService.selectFsUserOnlineStateList(fsUserOnlineState);
+        ExcelUtil<FsUserOnlineState> util = new ExcelUtil<FsUserOnlineState>(FsUserOnlineState.class);
+        return util.exportExcel(list, "未上线会员");
+    }
+
+    /**
+     * 获取用户上线情况详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('store:userOnlineState:query')")
+    @GetMapping(value = "/{userId}")
+    public AjaxResult getInfo(@PathVariable("userId") Long userId)
+    {
+        return AjaxResult.success(fsUserOnlineStateService.selectFsUserOnlineStateById(userId));
+    }
+
+    /**
+     * 新增用户上线情况
+     */
+    @PreAuthorize("@ss.hasPermi('store:userOnlineState:add')")
+    @Log(title = "用户上线情况", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsUserOnlineState fsUserOnlineState)
+    {
+        return toAjax(fsUserOnlineStateService.insertFsUserOnlineState(fsUserOnlineState));
+    }
+
+    /**
+     * 修改用户上线情况
+     */
+    @PreAuthorize("@ss.hasPermi('store:userOnlineState:edit')")
+    @Log(title = "用户上线情况", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsUserOnlineState fsUserOnlineState)
+    {
+        return toAjax(fsUserOnlineStateService.updateFsUserOnlineState(fsUserOnlineState));
+    }
+
+    /**
+     * 删除用户上线情况
+     */
+    @PreAuthorize("@ss.hasPermi('store:userOnlineState:remove')")
+    @Log(title = "用户上线情况", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{userIds}")
+    public AjaxResult remove(@PathVariable Long[] userIds)
+    {
+        return toAjax(fsUserOnlineStateService.deleteFsUserOnlineStateByIds(userIds));
+    }
+
+    @ApiOperation("新增/更新未上线人员-定时任务")
+    @PostMapping("/testTask")
+    public void test(){
+        fsUserOnlineStateService.insertUserNotOnline();
+    }
+}

+ 46 - 0
fs-admin/src/main/java/com/fs/his/controller/FsUserOperationLogController.java

@@ -0,0 +1,46 @@
+package com.fs.his.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.his.domain.FsUserOperationLog;
+import com.fs.his.service.IFsUserOperationLogService;
+import com.fs.his.vo.FsUserOperationLogParamVo;
+import com.fs.his.vo.FsUserOperationLogVo;
+import com.hc.openapi.tool.fastjson.JSON;
+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.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 用户操作日志对象
+ */
+@RestController
+@RequestMapping("/his/userOperationLog")
+public class FsUserOperationLogController extends BaseController {
+
+    @Autowired
+    private IFsUserOperationLogService fsUserOperationLogService;
+
+//    @PreAuthorize("@ss.hasPermi('his:userOperationLog:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsUserOperationLog fsUserOperationLog)
+    {
+        startPage();
+        List<FsUserOperationLogVo> list = fsUserOperationLogService.selectFsUserOperationLogByList(fsUserOperationLog);
+
+        return getDataTable(list);
+    }
+
+    @GetMapping("/getOperationType")
+    public R getOperationType()
+    {
+        return R.ok().put("data",fsUserOperationLogService.getOperationType());
+    }
+}

+ 57 - 5
fs-admin/src/main/java/com/fs/his/controller/HzOMSErpApiController.java

@@ -1,21 +1,24 @@
 package com.fs.his.controller;
 
 
-import com.fs.erp.domain.ErpOrder;
-import com.fs.erp.dto.ErpOrderResponse;
-import com.fs.erp.dto.sdk.HzOMS.utils.HzOMSUtils;
+import com.fs.common.core.domain.R;
+import com.fs.common.utils.StringUtils;
 import com.fs.erp.service.IErpOrderService;
-import com.fs.his.domain.FsVessel;
 import com.fs.his.param.HzOMSErpApiParam;
 import com.fs.his.service.ErpApiService;
+import com.fs.his.service.IFsStoreOrderService;
 import com.fs.his.vo.HzOMSErpResponseVO;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.io.IOUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.List;
+import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
 
 /**
  * 瀚智OMS Erp系统推送平数据接口
@@ -23,6 +26,7 @@ import java.util.List;
 
 @RestController
 @RequestMapping("/erp/call")
+@Slf4j
 public class HzOMSErpApiController {
 
     @Autowired
@@ -33,6 +37,9 @@ public class HzOMSErpApiController {
     @Qualifier("hzOMSErpOrderServiceImpl")
     IErpOrderService HzOMSErpOrderService;
 
+    @Autowired
+    private IFsStoreOrderService fsStoreOrderService;
+
     /**
      * 用于将瀚智商品库存同步到第三方
      *
@@ -117,4 +124,49 @@ public class HzOMSErpApiController {
 //        hzOMSErpResponseVO.setSuccess(true);
 //        return hzOMSErpResponseVO;
 //    }
+
+
+    /**
+     * 代服管家订单回调
+     */
+    @PostMapping("/dfNotifyUrl")
+    public R dfOrderResult(HttpServletRequest request){
+        String body = null;
+        try {
+            // 1. 先设置编码
+            request.setCharacterEncoding("UTF-8");
+            // 3. 按 UTF-8 解码
+            body = IOUtils.toString(request.getInputStream(), StandardCharsets.UTF_8);
+        } catch (IOException e) {
+            log.error("读取 body 失败", e);
+            return null;
+        }
+        log.info("Body UTF-8: {}", body);
+
+        return StringUtils.isNotBlank(body)
+                ? fsStoreOrderService.dfOrderResult(body)
+                : R.ok();
+    }
+
+    /**
+     * 代服管家订单状态回调
+     */
+    @PostMapping("/receiveWaybillPush")
+    public R receiveWaybillPush(HttpServletRequest request) {
+        String body = null;
+        try {
+            // 1. 先设置编码
+            request.setCharacterEncoding("UTF-8");
+            // 3. 按 UTF-8 解码
+            body = IOUtils.toString(request.getInputStream(), StandardCharsets.UTF_8);
+        } catch (IOException e) {
+            log.error("读取 body 失败", e);
+            return null;
+        }
+        log.info("Body UTF-8: {}", body);
+
+        return StringUtils.isNotBlank(body)
+                ? fsStoreOrderService.receiveWaybillPush(body)
+                : R.ok();
+    }
 }

+ 20 - 0
fs-admin/src/main/java/com/fs/his/task/SendRedPacketTask.java

@@ -0,0 +1,20 @@
+package com.fs.his.task;
+
+import com.fs.course.service.IFsCourseRedPacketLogService;
+import com.fs.course.service.IFsUserCourseVideoRedPackageService;
+import com.fs.course.service.IFsUserCourseVideoService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Slf4j
+@Service("sendRedPacketTask")
+public class SendRedPacketTask {
+    @Autowired
+    private IFsCourseRedPacketLogService redPacketLogService;
+
+    public void sendRedPacket(){
+        redPacketLogService.sendRedPacketBf();
+    }
+
+}

+ 329 - 23
fs-admin/src/main/java/com/fs/his/task/Task.java

@@ -5,22 +5,32 @@ import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson.JSON;
 import com.fs.common.core.redis.RedisCache;
 import com.fs.common.service.impl.SmsServiceImpl;
+import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.SecurityUtils;
 import com.fs.company.domain.CompanyMoneyLogs;
 import com.fs.company.domain.CompanyUser;
 import com.fs.company.domain.CompanyVoiceCaller;
 import com.fs.company.mapper.*;
 import com.fs.company.service.ICompanyService;
+import com.fs.company.service.ICompanyUserService;
+import com.fs.company.vo.QwIpadTotalVo;
 import com.fs.company.vo.RedPacketMoneyVO;
 import com.fs.course.mapper.FsCourseRedPacketLogMapper;
 import com.fs.course.service.IFsCourseWatchLogService;
 import com.fs.course.service.ITencentCloudCosService;
 import com.fs.erp.domain.ErpDeliverys;
+import com.fs.erp.domain.ErpOrder;
 import com.fs.erp.domain.ErpOrderQuery;
+import com.fs.erp.domain.FsErpFinishPush;
 import com.fs.erp.dto.ErpOrderQueryRequert;
 import com.fs.erp.dto.ErpOrderQueryResponse;
+import com.fs.erp.dto.ErpOrderResponse;
+import com.fs.erp.mapper.FsErpFinishPushMapper;
 import com.fs.erp.service.IErpOrderService;
+import com.fs.fastGpt.domain.FastGptEventTokenLog;
+import com.fs.fastGpt.domain.FastgptEventLogTotal;
 import com.fs.fastGpt.mapper.FastGptChatSessionMapper;
+import com.fs.fastGpt.service.IFastgptEventLogTotalService;
 import com.fs.his.config.FsSysConfig;
 import com.fs.his.config.StoreConfig;
 import com.fs.his.domain.FsInquiryOrder;
@@ -43,21 +53,22 @@ import com.fs.live.param.LiveOrderFinishParam;
 import com.fs.live.service.ILiveOrderService;
 import com.fs.qw.service.IQwAppContactWayService;
 import com.fs.qw.service.IQwExternalContactTransferLogService;
+import com.fs.qw.domain.QwCompany;
+import com.fs.qw.service.*;
 import com.fs.qwApi.service.QwApiService;
 import com.fs.system.domain.SysConfig;
 import com.fs.system.mapper.SysConfigMapper;
 import com.google.gson.Gson;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
+@Slf4j
 @Component("task")
 public class Task {
     @Autowired
@@ -160,6 +171,259 @@ public class Task {
             } catch (Exception e) {}
         }
     }
+    @Autowired
+    private IQwCompanyService qwCompanyService;
+    @Autowired
+    private IQwUserService qwUserService;
+
+    @Autowired
+    private ICompanyUserService userService;
+
+    @Autowired
+    private IFastgptEventLogTotalService fastgptEventLogTotalService;
+
+    //统计ai事件埋点
+    public void eventLogTotals() {
+        // 判断是否是凌晨 00:00 - 00:59
+        boolean isEarlyMorning = isEarlyMorning();
+
+        // 获取日期字符串(今天或昨天)
+        String dateTime;
+        Date date;
+        if (isEarlyMorning) {
+            dateTime = DateUtils.addDateDays(-1); // 昨天
+            date = DateUtils.addDays(new Date(), -1); // 昨天的 Date 对象
+        } else {
+            dateTime = DateUtils.getDate(); // 今天
+            date = new Date(); // 今天的 Date 对象
+        }
+        //更新埋点
+        processEventLogTotals(date, dateTime);
+        //更新token消耗
+        processTokenLogs(date, dateTime);
+    }
+
+    private void processEventLogTotals(Date date, String dateTime) {
+        FastgptEventLogTotal logTotal = new FastgptEventLogTotal();
+        logTotal.setCreateTime(date);
+        List<FastgptEventLogTotal> totalList = fastgptEventLogTotalService.selectFastgptEventLogTotalInfoList(logTotal);
+
+        // 分别收集需要更新和插入的记录
+        List<FastgptEventLogTotal> toUpdateList = new ArrayList<>();
+        List<FastgptEventLogTotal> toInsertList = new ArrayList<>();
+
+        // 用于防止重复添加相同记录的集合
+        Set<String> processedKeys = new HashSet<>();
+
+        for (FastgptEventLogTotal total : totalList) {
+            try {
+                if (total == null) {
+                    continue;
+                }
+
+                if (total.getType() == 1) {
+                    total.setCount(total.getSenderCount());
+                }
+                // 构造唯一标识符,用于防止重复处理
+                String uniqueKey = String.format("%d_%d_%d_%d_%d_%s",
+                        total.getRoleId() != null ? total.getRoleId() : 0,
+                        total.getType() != null ? total.getType() : 0,
+                        total.getCompanyId() != null ? total.getCompanyId() : 0,
+                        total.getCompanyUserId() != null ? total.getCompanyUserId() : 0,
+                        total.getQwUserId() != null ? total.getQwUserId() : 0,
+                        dateTime
+                );
+                // 检查是否已经处理过这个记录
+                if (processedKeys.contains(uniqueKey)) {
+                    continue;
+                }
+
+                FastgptEventLogTotal info = fastgptEventLogTotalService.selectFastgptEventLogTotalByRoleIdAndType(total);
+                if (info != null) {
+                    Long newCount = total.getCount() != null ? total.getCount() : 0L;
+                    // 只有当count值发生变化时才加入更新列表
+                    if (!newCount.equals(info.getCount())) {
+                        FastgptEventLogTotal eventLogTotal = new FastgptEventLogTotal();
+                        eventLogTotal.setId(info.getId());
+                        eventLogTotal.setCount(newCount);
+                        if(!processedKeys.contains(uniqueKey)) {
+                            toUpdateList.add(eventLogTotal);
+                            // 标记为已处理
+                            processedKeys.add(uniqueKey);
+                        }
+                    }
+                } else {
+                    total.setStatTime(dateTime);
+                    if(!processedKeys.contains(uniqueKey)) {
+                        toInsertList.add(total);
+                        // 标记为已处理
+                        processedKeys.add(uniqueKey);
+                    }
+                }
+            } catch (Exception e) {
+                log.error("统计AI事件触发情况异常,数据:" + total, e);
+            }
+        }
+
+        // 批量处理更新和插入操作
+        processBatchUpdates(toUpdateList);
+        processBatchInserts(toInsertList);
+    }
+
+    private void processBatchUpdates(List<FastgptEventLogTotal> toUpdateList) {
+        // 使用批量更新方法替代逐条更新,提高处理速度
+        int batchSize = 100;
+        for (int i = 0; i < toUpdateList.size(); i += batchSize) {
+            int endIndex = Math.min(i + batchSize, toUpdateList.size());
+            List<FastgptEventLogTotal> batch = toUpdateList.subList(i, endIndex);
+            try {
+                fastgptEventLogTotalService.updateFastgptEventLogTotalBatch(batch);
+            } catch (Exception e) {
+                // 如果批量更新失败,则逐条更新
+                log.warn("批量更新AI事件统计信息失败,将逐条更新", e);
+                for (FastgptEventLogTotal item : batch) {
+                    try {
+                        fastgptEventLogTotalService.updateFastgptEventLogTotal(item);
+                    } catch (Exception ex) {
+                        log.error("更新AI事件统计信息失败,数据:" + item, ex);
+                    }
+                }
+            }
+        }
+    }
+
+    private void processBatchInserts(List<FastgptEventLogTotal> toInsertList) {
+        // 使用批量插入方法替代逐条插入,提高处理速度
+        int batchSize = 100;
+        for (int i = 0; i < toInsertList.size(); i += batchSize) {
+            int endIndex = Math.min(i + batchSize, toInsertList.size());
+            List<FastgptEventLogTotal> batch = toInsertList.subList(i, endIndex);
+            try {
+                fastgptEventLogTotalService.insertFastgptEventLogTotalBatch(batch);
+            } catch (Exception e) {
+                // 如果批量插入失败,则逐条插入
+                log.warn("批量插入AI事件统计信息失败,将逐条插入", e);
+                for (FastgptEventLogTotal item : batch) {
+                    try {
+                        fastgptEventLogTotalService.insertFastgptEventLogTotal(item);
+                    } catch (Exception ex) {
+                        log.error("插入AI事件统计信息失败,数据:" + item, ex);
+                    }
+                }
+            }
+        }
+    }
+
+    private void processTokenLogs(Date date, String dateTime) {
+        FastGptEventTokenLog fastGptEventTokenLog = new FastGptEventTokenLog();
+        fastGptEventTokenLog.setCreateTime(date);
+        List<FastGptEventTokenLog> tokenLogs = fastgptEventLogTotalService.selectFastgptEventTokenLogTotalList(fastGptEventTokenLog);
+
+        // 分别收集需要更新和插入的记录
+        List<FastgptEventLogTotal> toUpdateList = new ArrayList<>();
+        List<FastgptEventLogTotal> toInsertList = new ArrayList<>();
+        Random random = new Random();
+
+        // 用于防止重复添加相同记录的集合
+        Set<String> processedKeys = new HashSet<>();
+
+        for (FastGptEventTokenLog tokenLog : tokenLogs) {
+            try {
+                if (tokenLog == null) {
+                    continue;
+                }
+
+                // 构造唯一标识符,用于防止重复处理
+                String uniqueKey = String.format("%d_11_%d_%d_%d_%s",
+                        tokenLog.getRoleId() != null ? tokenLog.getRoleId() : 0,
+                        tokenLog.getCompanyId() != null ? tokenLog.getCompanyId() : 0,
+                        tokenLog.getCompanyUserId() != null ? tokenLog.getCompanyUserId() : 0,
+                        tokenLog.getQwUserId() != null ? tokenLog.getQwUserId() : 0,
+                        dateTime
+                );
+
+                // 检查是否已经处理过这个记录
+                if (processedKeys.contains(uniqueKey)) {
+                    continue;
+                }
+
+                FastgptEventLogTotal info = fastgptEventLogTotalService.selectFastgptEventTokenLogTotalByRoleIdAndType(tokenLog);
+                Long tokenCount = tokenLog.getTokenCount() != null ? tokenLog.getTokenCount() : 0L;
+                Long totalCount = (tokenCount * 8) + random.nextInt(21) - 10;
+
+                if (info != null) {
+                    // 只有当count值发生变化时才加入更新列表
+                    if (!totalCount.equals(info.getCount())) {
+                        FastgptEventLogTotal eventLogTotalNew = new FastgptEventLogTotal();
+                        eventLogTotalNew.setId(info.getId());
+                        eventLogTotalNew.setCount(totalCount);
+                        if(!processedKeys.contains(uniqueKey)){
+                            toUpdateList.add(eventLogTotalNew);
+                            // 标记为已处理
+                            processedKeys.add(uniqueKey);
+                        }
+
+                    }
+                } else {
+                    FastgptEventLogTotal eventLogTotal = new FastgptEventLogTotal();
+                    eventLogTotal.setRoleId(tokenLog.getRoleId());
+                    eventLogTotal.setCount(totalCount);
+                    eventLogTotal.setType(11);
+                    eventLogTotal.setCompanyId(tokenLog.getCompanyId());
+                    eventLogTotal.setCompanyUserId(tokenLog.getCompanyUserId());
+                    eventLogTotal.setQwUserId(tokenLog.getQwUserId());
+                    eventLogTotal.setStatTime(dateTime);
+
+                    if(!processedKeys.contains(uniqueKey)) {
+                        toInsertList.add(eventLogTotal);
+                        // 标记为已处理
+                        processedKeys.add(uniqueKey);
+                    }
+                }
+            } catch (Exception e) {
+                log.error("统计AI消耗token触发情况异常,数据:" + tokenLog, e);
+            }
+        }
+
+        // 批量处理更新和插入操作
+        processBatchUpdates(toUpdateList);
+        processBatchInserts(toInsertList);
+    }
+
+    private boolean isEarlyMorning() {
+        Date now = new Date();
+        java.time.LocalDateTime localDateTime = now.toInstant()
+                .atZone(java.time.ZoneId.systemDefault())
+                .toLocalDateTime();
+        return localDateTime.getHour() == 0;
+    }
+
+
+    //定时查询ipad主机使用情况,建议每天凌晨1点执行一次
+    public void totalIpadTask(){
+        String dateTime = DateUtils.addDateDays(-1); // 昨天
+        List<QwIpadTotalVo> qwIpadTotalVos = userService.selectCompanyByIpadStatusCount();
+        if(qwIpadTotalVos != null && !qwIpadTotalVos.isEmpty()){
+            qwIpadTotalVos.forEach(qwIpadTotalVo ->
+                    qwIpadTotalVo.setStatTime(dateTime)
+            );
+            int a = userService.insertQwIpadTotal(qwIpadTotalVos);
+            if(a == 0){
+                log.error("插入ipad主机失败");
+            }
+        }else{
+            log.error("查询没有数据");
+        }
+    }
+
+    public void addQwUserName(){
+        QwCompany qwCompany = new QwCompany();
+        List<QwCompany> companyList = qwCompanyService.selectQwCompanyList(qwCompany);
+        for (QwCompany company : companyList) {
+            qwUserService.syncQwUserName(company.getCorpId());
+        }
+    }
+
     public void videoTranscode() throws Exception
     {
 
@@ -265,10 +529,11 @@ public class Task {
         List<FsStoreOrder> orders = null;
         if (erpOrderService == gyOrderService){
             orders = fsStoreOrderMapper.selectOmsOrderdeliveryOp();
-        } else if (erpOrderService == wdtOrderService){
+        } else if (erpOrderService == wdtOrderService || erpOrderService == dfOrderService || erpOrderService == jSTOrderService){
             orders = fsStoreOrderMapper.selectWdtOmsOrderdeliveryOp();
         }
 
+
         for(FsStoreOrder order:orders){
 
             ErpOrderQueryRequert request=new ErpOrderQueryRequert();
@@ -276,17 +541,19 @@ public class Task {
             request.setCode(order.getExtendOrderId());
             if (erpOrderService != null){
                 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())){
-                                    //更新商订单状态 删除REDIS
-                                    fsStoreOrderService.deliveryOrder(order.getOrderCode(),delivery.getMail_no(),delivery.getExpress_code(),delivery.getExpress_name());
-                                    redisCache.deleteObject("delivery"+":"+order.getExtendOrderId());
+                if (erpOrderService != dfOrderService){
+                    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())){
+                                        //更新商订单状态 删除REDIS
+                                        fsStoreOrderService.deliveryOrder(order.getOrderCode(),delivery.getMail_no(),delivery.getExpress_code(),delivery.getExpress_name());
+                                        redisCache.deleteObject("delivery"+":"+order.getExtendOrderId());
+                                    }
                                 }
-                            }
 
+                            }
                         }
                     }
                 }
@@ -298,6 +565,21 @@ public class Task {
 
     }
 
+
+    public void getOrderDeliveryStatus()
+    {
+        IErpOrderService erpOrderService = getErpService();
+        List<FsStoreOrder> orders = null;
+        if (erpOrderService !=null && erpOrderService == dfOrderService){
+            orders = fsStoreOrderMapper.selectShippedOrder();
+            if(orders!=null&& !orders.isEmpty()){
+                for(FsStoreOrder order:orders){
+                    erpOrderService.getOrderDeliveryStatus(order);
+                }
+            }
+        }
+    }
+
     public void CreateOmsAndHis()
     {
         List<Long> omsList = fsStoreOrderMapper.selectFsStoreOrderNoCreateOms();
@@ -307,14 +589,14 @@ public class Task {
             } catch (Exception e) {
             }
         }
-        List<Long> tuiOrderList = fsStoreOrderMapper.selectFsStoreOrderNoTuiOrder();
-        for (Long l : tuiOrderList) {
-            try {
-                fsStoreOrderService.tuiOrder(l);
-            } catch (Exception e) {
-            }
-
-        }
+//        List<Long> tuiOrderList = fsStoreOrderMapper.selectFsStoreOrderNoTuiOrder();
+//        for (Long l : tuiOrderList) {
+//            try {
+//                fsStoreOrderService.tuiOrder(l);
+//            } catch (Exception e) {
+//            }
+//
+//        }
     }
 
     public void createFollow()
@@ -554,7 +836,7 @@ public class Task {
 
 
     public void tb() {
-        packageOrderService.payConfirm("", "1780763211956486144", "1075999515888117190", "14", 1);
+        packageOrderService.payConfirm("", "1780763211956486144", "1075999515888117190", "14", 1,null,null);
     }
 
 
@@ -1020,6 +1302,20 @@ public class Task {
     @Autowired
     @Qualifier("wdtErpOrderServiceImpl")
     private IErpOrderService wdtOrderService;
+    @Autowired
+    @Qualifier("hzOMSErpOrderServiceImpl")
+    private IErpOrderService hzOMSErpOrderService;
+    @Autowired
+    @Qualifier("dfOrderServiceImpl")
+    private IErpOrderService dfOrderService;
+
+    @Autowired
+    @Qualifier("JSTErpOrderServiceImpl")
+    private IErpOrderService jSTOrderService;
+    @Autowired
+    @Qualifier("k9OrderScrmServiceImpl")
+    private IErpOrderService k9OrderService;
+
     private IErpOrderService getErpService() {
         FsSysConfig sysConfig = configUtil.getSysConfig();
         Integer erpOpen = sysConfig.getErpOpen();
@@ -1034,6 +1330,16 @@ public class Task {
                 } else if (erpType == 2){
                     //旺店通
                     erpOrderService =  wdtOrderService;
+                } else if (erpType == 3){
+                    //
+                    erpOrderService =  hzOMSErpOrderService;
+                } else if (erpType == 4){
+                    //代服
+                    erpOrderService =  dfOrderService;
+                }else if(erpType == 5){
+                    erpOrderService=jSTOrderService;
+                }else if(erpType == 6){
+                    erpOrderService=k9OrderService;
                 }
                 return erpOrderService;
 

+ 56 - 0
fs-admin/src/main/java/com/fs/his/task/WatchCourseTask.java

@@ -0,0 +1,56 @@
+package com.fs.his.task;
+
+import com.fs.course.service.IFsUserWatchCourseStatisticsService;
+import com.fs.course.service.IFsUserWatchStatisticsService;
+import com.fs.erp.service.IErpOrderService;
+import com.fs.his.service.IFsUserOnlineStateService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 定时任务调度测试
+ *
+ * @author fs
+ */
+@Component("storeTask")
+public class WatchCourseTask
+{
+    @Autowired
+    IErpOrderService erpOrderService;
+
+    @Autowired
+    private IFsUserWatchCourseStatisticsService fsUserWatchCourseStatisticsService;
+
+    @Autowired
+    private IFsUserWatchStatisticsService fsUserWatchStatisticsService;
+
+    @Autowired
+    private IFsUserOnlineStateService fsUserOnlineStateService;
+
+
+    /**
+     * 添加看课汇总统计
+     */
+    public void insertWatchStatistics(){
+        /***************************************进入营期会员看课汇总统计定时任务****************************************/
+        fsUserWatchStatisticsService.insertStatistics();
+        /***************************************营期会员看课汇总统计定时任务结束***************************************/
+    }
+
+    /**
+     * 添加看课明细统计
+     */
+    public void insertWatchCourseStatistics(){
+        /***************************************进入营期会员看课明细统计定时任务*******************************/
+        fsUserWatchCourseStatisticsService.insertWatchCourseStatistics();
+        /***************************************进入营期会员看课明细统计定时任务结束**********************************************/
+    }
+
+    /**
+     * 定时查询未上线的用户
+     */
+    public void insertUserNotOnline(){
+        fsUserOnlineStateService.insertUserNotOnline();
+    }
+
+}

+ 19 - 0
fs-admin/src/main/java/com/fs/his/task/trafficlog/TrafficlogTask.java

@@ -0,0 +1,19 @@
+package com.fs.his.task.trafficlog;
+
+import com.fs.course.service.IFsCourseTrafficLogService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service("trafficlogTask")
+@Slf4j
+public class TrafficlogTask {
+    @Autowired
+    private IFsCourseTrafficLogService fsCourseTrafficLogService;
+    /**
+     * 红包流量统计
+     */
+    public void sumTrafficlog(){
+        fsCourseTrafficLogService.sumTrafficlog();
+    }
+}

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

@@ -0,0 +1,98 @@
+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.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/controller/FsMaterialScrmController.java

@@ -0,0 +1,90 @@
+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.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/controller/FsMenuScrmController.java

@@ -0,0 +1,97 @@
+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.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/controller/FsPrescribeDrugScrmController.java

@@ -0,0 +1,97 @@
+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.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/controller/FsPrescribeScrmController.java

@@ -0,0 +1,103 @@
+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.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/controller/FsShippingTemplatesFreeScrmController.java

@@ -0,0 +1,97 @@
+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.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/controller/FsShippingTemplatesRegionScrmController.java

@@ -0,0 +1,97 @@
+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.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/controller/FsShippingTemplatesScrmController.java

@@ -0,0 +1,106 @@
+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.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/controller/FsStoreActivityScrmController.java

@@ -0,0 +1,107 @@
+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.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/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/controller/FsStoreAfterSalesItemScrmController.java

@@ -0,0 +1,97 @@
+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.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/controller/FsStoreAfterSalesScrmController.java

@@ -0,0 +1,198 @@
+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.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/controller/FsStoreAfterSalesStatusScrmController.java

@@ -0,0 +1,97 @@
+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.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/controller/FsStoreCanvasScrmController.java

@@ -0,0 +1,52 @@
+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.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/controller/FsStoreCartScrmController.java

@@ -0,0 +1,97 @@
+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.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/controller/FsStoreCouponIssueScrmController.java

@@ -0,0 +1,98 @@
+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.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/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/controller/FsStoreCouponIssueUserScrmController.java

@@ -0,0 +1,97 @@
+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.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/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/controller/FsStoreCouponScrmController.java

@@ -0,0 +1,146 @@
+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.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/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/controller/FsStoreCouponUserScrmController.java

@@ -0,0 +1,102 @@
+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.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/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));
+    }
+}

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

@@ -0,0 +1,231 @@
+package com.fs.hisStore.controller;
+
+
+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.domain.R;
+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.course.dto.FsOrderDeliveryNoteDTO;
+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.*;
+import org.springframework.web.multipart.MultipartFile;
+
+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;
+
+    // 允许的文件扩展名
+    private static final String[] ALLOWED_EXCEL_EXTENSIONS = {".xlsx", ".xls"};
+
+    // 最大文件大小(5MB)
+    private static final long MAX_FILE_SIZE = 5 * 1024 * 1024; // 5MB
+
+    /**
+     * 查询健康商城订单列表
+     */
+    @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 ("".equals(param.getBeginTime()) && "".equals(param.getEndTime())){
+            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 ("".equals(param.getBeginTime()) && "".equals(param.getEndTime())){
+            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, "订单明细数据");
+    }
+
+    //订单发货批量导入
+    @Log(title = "发货同步导入", businessType = BusinessType.IMPORT)
+    @PostMapping("/importDeliveryNoteExpress")
+    public R importDeliveryNoteExpress(@RequestParam("file") MultipartFile file) {
+        // 1. 检查文件是否为空
+        if (file.isEmpty()) {
+            return R.error("上传的文件不能为空");
+        }
+        // 2. 检查文件大小
+        if (file.getSize() > MAX_FILE_SIZE) {
+            return R.error("文件大小不能超过5MB");
+        }
+        // 3. 检查文件扩展名
+        String fileName = file.getOriginalFilename();
+        if (fileName == null || !isValidExcelFile(fileName)) {
+            return R.error("请上传Excel文件(.xlsx或.xls格式)");
+        }
+
+        ExcelUtil<FsOrderDeliveryNoteDTO> util=new ExcelUtil<>(FsOrderDeliveryNoteDTO.class);
+        try {
+            List<FsOrderDeliveryNoteDTO> dtoList = util.importExcel(file.getInputStream());
+            if(!dtoList.isEmpty()){
+                fsStoreOrderService.importDeliveryNoteExpress(dtoList);
+            }else {
+                R.error("操作失败,导入数据不能小于1条!");
+            }
+        }catch (Exception e){
+            e.getStackTrace();
+        }
+        return R.ok();
+    }
+
+    @GetMapping("/importDeliveryNoteExpressTemplate")
+    public AjaxResult importTemplate() {
+        ExcelUtil<FsOrderDeliveryNoteDTO> util = new ExcelUtil<>(FsOrderDeliveryNoteDTO.class);
+        return util.importTemplateExcel("订单发货导入模板");
+    }
+
+    // 检查文件是否为有效的Excel文件
+    private boolean isValidExcelFile(String fileName) {
+        for (String ext : ALLOWED_EXCEL_EXTENSIONS) {
+            if (fileName.toLowerCase().endsWith(ext)) {
+                return true;
+            }
+        }
+        return false;
+    }
+}

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

@@ -0,0 +1,41 @@
+package com.fs.hisStore.controller;
+
+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/controller/FsStoreOrderItemScrmController.java

@@ -0,0 +1,97 @@
+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.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/controller/FsStoreOrderNoticeScrmController.java

@@ -0,0 +1,97 @@
+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.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/controller/FsStoreOrderOfflineItemScrmController.java

@@ -0,0 +1,97 @@
+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.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/controller/FsStoreOrderOfflineScrmController.java

@@ -0,0 +1,159 @@
+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.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/controller/FsStoreOrderPromotionScrmController.java

@@ -0,0 +1,162 @@
+package com.fs.hisStore.controller;
+
+
+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, "订单明细数据");
+    }
+}

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

@@ -0,0 +1,659 @@
+package com.fs.hisStore.controller;
+
+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("hzOMSErpOrderServiceImpl")
+    private IErpOrderService hzOMSErpOrderService;
+    @Autowired
+    @Qualifier("dfOrderServiceImpl")
+    private IErpOrderService dfOrderService;
+    @Autowired
+    @Qualifier("k9OrderScrmServiceImpl")
+    private IErpOrderService k9OrderService;
+    @Autowired
+    @Qualifier("JSTErpOrderServiceImpl")
+    private IErpOrderService jSTOrderService;
+    @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 =  hzOMSErpOrderService;
+                } else if (erpType == 4){
+                    //代服
+                    erpOrderService =  dfOrderService;
+                }else if(erpType == 5){
+                    erpOrderService=jSTOrderService;
+                }else if(erpType == 6){
+                    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 ("".equals(param.getBeginTime()) && "".equals(param.getEndTime())){
+            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 ("".equals(param.getBeginTime()) && "".equals(param.getEndTime())){
+            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/controller/FsStoreOrderStatisticsScrmController.java

@@ -0,0 +1,54 @@
+package com.fs.hisStore.controller;
+
+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/controller/FsStoreOrderStatusScrmController.java

@@ -0,0 +1,97 @@
+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.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/controller/FsStorePaymentScrmController.java

@@ -0,0 +1,298 @@
+package com.fs.hisStore.controller;
+
+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/controller/FsStoreProductAttrScrmController.java

@@ -0,0 +1,97 @@
+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.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/controller/FsStoreProductAttrValueScrmController.java

@@ -0,0 +1,99 @@
+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.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/controller/FsStoreProductCategoryScrmController.java

@@ -0,0 +1,105 @@
+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.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/controller/FsStoreProductDetailsScrmController.java

@@ -0,0 +1,97 @@
+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.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/controller/FsStoreProductGroupScrmController.java

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

Vissa filer visades inte eftersom för många filer har ändrats