Просмотр исходного кода

Merge branch 'saas-api' of http://1.14.104.71:10880/txl/ylrz_saas_his_scrm into saas-api

云联一号 1 неделя назад
Родитель
Сommit
c20fc4d9ff
100 измененных файлов с 5729 добавлено и 194 удалено
  1. 0 2
      fs-admin-saas/src/main/java/com/fs/FsSaasAdminApplication.java
  2. 12 4
      fs-admin-saas/src/main/java/com/fs/api/controller/IndexStatisticsController.java
  3. 0 45
      fs-admin-saas/src/main/java/com/fs/company/controller/company/FsRedPacketController.java
  4. 56 0
      fs-admin-saas/src/main/java/com/fs/his/controller/FsRedPacketController.java
  5. 1 1
      fs-admin-saas/src/main/java/com/fs/web/controller/common/CaptchaController.java
  6. 56 1
      fs-admin-saas/src/main/java/com/fs/web/controller/system/SysLoginController.java
  7. 7 1
      fs-admin-saas/src/main/java/com/fs/web/controller/system/SysProfileController.java
  8. 23 0
      fs-admin-saas/src/main/resources/application.yml
  9. 1 1
      fs-admin/src/main/java/com/fs/admin/controller/AdminCompanyBridgeController.java
  10. 0 138
      fs-admin/src/main/java/com/fs/admin/controller/ArticleAdminController.java
  11. 1 0
      fs-admin/src/main/java/com/fs/admin/controller/audit/AdminLiveVideoController.java
  12. 2 1
      fs-admin/src/main/java/com/fs/admin/controller/audit/AdminStoreOrderAdminController.java
  13. 1 0
      fs-admin/src/main/java/com/fs/admin/controller/audit/AdminVideoResourceController.java
  14. 120 0
      fs-admin/src/main/java/com/fs/admin/controller/audit/ArticleAdminController.java
  15. 1 0
      fs-admin/src/main/java/com/fs/admin/controller/audit/LiveAdminController.java
  16. 2 0
      fs-admin/src/main/java/com/fs/admin/controller/audit/ProductAdminController.java
  17. 6 0
      fs-agent/Dockerfile
  18. 256 0
      fs-agent/pom.xml
  19. 40 0
      fs-agent/src/main/java/com/fs/FSAgentApplication.java
  20. 14 0
      fs-agent/src/main/java/com/fs/FSServletInitializer.java
  21. 31 0
      fs-agent/src/main/java/com/fs/ad/controller/AdAccountController.java
  22. 108 0
      fs-agent/src/main/java/com/fs/ad/controller/AdDomainController.java
  23. 105 0
      fs-agent/src/main/java/com/fs/ad/controller/AdDyAccountController.java
  24. 116 0
      fs-agent/src/main/java/com/fs/ad/controller/AdDyApiController.java
  25. 99 0
      fs-agent/src/main/java/com/fs/ad/controller/AdHtmlClickLogController.java
  26. 105 0
      fs-agent/src/main/java/com/fs/ad/controller/AdHtmlTemplateController.java
  27. 108 0
      fs-agent/src/main/java/com/fs/ad/controller/AdIqiyiAccountController.java
  28. 111 0
      fs-agent/src/main/java/com/fs/ad/controller/AdSiteController.java
  29. 99 0
      fs-agent/src/main/java/com/fs/ad/controller/AdUploadLogController.java
  30. 108 0
      fs-agent/src/main/java/com/fs/ad/controller/AdYoukuAccountController.java
  31. 143 0
      fs-agent/src/main/java/com/fs/ad/controller/BdAccountController.java
  32. 218 0
      fs-agent/src/main/java/com/fs/ad/controller/MockAppController.java
  33. 86 0
      fs-agent/src/main/java/com/fs/ad/controller/StatisticsController.java
  34. 26 0
      fs-agent/src/main/java/com/fs/ad/controller/task/BaiduTask.java
  35. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AdminAdController.java
  36. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AdminAiWorkflowBridgeController.java
  37. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AdminCommissionRecordController.java
  38. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AdminCompanyBridgeController.java
  39. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AdminConsumeRecordController.java
  40. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AdminCourseBridgeController.java
  41. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AdminCrmController.java
  42. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AdminHisBridgeController.java
  43. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AdminLiveBridgeController.java
  44. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AdminLiveVideoController.java
  45. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AdminLobsterBridgeController.java
  46. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AdminMiscBridge2Controller.java
  47. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AdminMissingApisBridgeController.java
  48. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AdminModuleUsageController.java
  49. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AdminProxyController.java
  50. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AdminRechargeRecordController.java
  51. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AdminServiceCostController.java
  52. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AdminSopController.java
  53. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AdminStatisticsController.java
  54. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AdminStoreMiscController.java
  55. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AdminStoreOrderAdminController.java
  56. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AdminStoreOrderController.java
  57. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AdminStoreProductController.java
  58. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AdminVideoResourceController.java
  59. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AdminWithdrawalController.java
  60. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AiChatQualityController.java
  61. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/AiProviderAdminController.java
  62. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/ArticleAdminController.java
  63. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/CallRecordAdminController.java
  64. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/CompanyAdminController.java
  65. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/CompanyUserAdminController.java
  66. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/CourseAdminController.java
  67. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/DbConfigController.java
  68. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/LiveAdminController.java
  69. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/LobsterAdminController.java
  70. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/ProductAdminController.java
  71. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/ProxyOperLogController.java
  72. 0 0
      fs-agent/src/main/java/com/fs/admin/controller/QwExternalContactAdminController.java
  73. 82 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsAdvScrmBridgeController.java
  74. 82 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsMenuScrmBridgeController.java
  75. 82 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsPrescribeDrugScrmBridgeController.java
  76. 82 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsPrescribeScrmBridgeController.java
  77. 82 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsShippingTemplatesFreeScrmBridgeController.java
  78. 82 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsShippingTemplatesRegionScrmBridgeController.java
  79. 93 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsShippingTemplatesScrmBridgeController.java
  80. 93 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreActivityScrmBridgeController.java
  81. 82 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreAfterSalesItemScrmBridgeController.java
  82. 233 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreAfterSalesScrmBridgeController.java
  83. 82 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreAfterSalesStatusScrmBridgeController.java
  84. 82 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreCartScrmBridgeController.java
  85. 83 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreCouponIssueScrmBridgeController.java
  86. 82 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreCouponIssueUserScrmBridgeController.java
  87. 131 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreCouponScrmBridgeController.java
  88. 82 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreCouponUserScrmBridgeController.java
  89. 96 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreOrderAuditScrmBridgeController.java
  90. 90 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreOrderItemScrmBridgeController.java
  91. 82 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreOrderNoticeScrmBridgeController.java
  92. 134 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreOrderOfflineScrmBridgeController.java
  93. 141 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreOrderPromotionScrmBridgeController.java
  94. 1062 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreOrderScrmBridgeController.java
  95. 82 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreOrderStatusScrmBridgeController.java
  96. 82 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreProductAttrScrmBridgeController.java
  97. 82 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreProductAttrValueScrmBridgeController.java
  98. 82 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreProductCategoryScrmBridgeController.java
  99. 82 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreProductDetailsScrmBridgeController.java
  100. 117 0
      fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreProductGroupScrmBridgeController.java

+ 0 - 2
fs-admin-saas/src/main/java/com/fs/FsSaasAdminApplication.java

@@ -1,6 +1,5 @@
 package com.fs;
 
-import com.fs.config.OverridingBeanNameGenerator;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
@@ -17,7 +16,6 @@ import org.springframework.transaction.annotation.Transactional;
 @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, RedissonAutoConfiguration.class})
 @ComponentScan(
     basePackages = "com.fs",
-    nameGenerator = OverridingBeanNameGenerator.class,
     excludeFilters = {
         @ComponentScan.Filter(type = FilterType.REGEX, pattern = {
             "com\\.fs\\.framework\\.service\\.PermissionService",

+ 12 - 4
fs-admin-saas/src/main/java/com/fs/api/controller/IndexStatisticsController.java

@@ -193,13 +193,17 @@ public class IndexStatisticsController {
         TrafficLogDTO result = new TrafficLogDTO();
         if(!medicalMallConfig.isStatics() || (param.getCompanyId() == null && param.getDeptId() == null) || (param.getCompanyId() == null && param.getDeptId() == 1)) {
             result = redisCache.getCacheObject(DATA_OVERVIEW_TRAFFIC_LOG);
+            if (result == null) {
+                result = new TrafficLogDTO();
+            }
             if (!medicalMallConfig.isStatics()) {
                 SysConfig sysConfig = sysConfigService.selectConfigByConfigKey("redPacket.Traffic.config");
-                if(result == null || sysConfig == null) {
-                    return null;
+                if (result == null) {
+                    result = new TrafficLogDTO();
+                }
+                if (sysConfig != null && sysConfig.getConfigValue() != null) {
+                    result.setTraffic(sysConfig.getConfigValue());
                 }
-                String configValue = sysConfig.getConfigValue();
-                result.setTraffic(configValue);
             } else {
                 //所有部门流量之和
                 SysDept dept = new SysDept();
@@ -220,6 +224,9 @@ public class IndexStatisticsController {
         }else{
             getTrafficLogResult(result,CompanyTrafficConstants.CACHE_KEY+":"+param.getDeptId());
         }
+        if (result == null) {
+            result = new TrafficLogDTO();
+        }
         return R.ok().put("data",result);
     }
 
@@ -728,6 +735,7 @@ public class IndexStatisticsController {
                     );
                 }
             }
+            authorizationInfoDTO = authorizationInfoDTO1;
         }
 
         return R.ok().put("data", authorizationInfoDTO);

+ 0 - 45
fs-admin-saas/src/main/java/com/fs/company/controller/company/FsRedPacketController.java

@@ -1,45 +0,0 @@
-package com.fs.company.controller.company;
-
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.R;
-import com.fs.common.utils.ServletUtils;
-import com.fs.company.domain.Company;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import com.fs.his.domain.FsRedPacket;
-import com.fs.his.service.IFsRedPacketService;
-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 org.springframework.context.annotation.Profile;
-
-/**
- * @description: 红包信息
- * @author: Xgb
- * @createDate: 2025/11/4
- * @version: 1.0
- */
-@Profile("company")
-@RestController
-@RequestMapping("/his/redPacket")
-public class FsRedPacketController extends BaseController {
-
-    @Autowired
-    private IFsRedPacketService fsRedPacketService;
-
-    @Autowired
-    private TokenService tokenService;
-
-    @GetMapping("/info")
-    public R info() {
-        com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
-
-        Company company = loginUser.getCompany();
-        FsRedPacket redPacket=fsRedPacketService.getInfo(company.getCompanyId());
-        return  R.ok().put("data",redPacket);
-    }
-
-
-
-}

+ 56 - 0
fs-admin-saas/src/main/java/com/fs/his/controller/FsRedPacketController.java

@@ -0,0 +1,56 @@
+package com.fs.his.controller;
+
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.redis.RedisCache;
+import com.fs.company.domain.Company;
+import com.fs.company.service.ICompanyService;
+import com.fs.his.domain.FsRedPacket;
+import com.fs.his.service.IFsRedPacketService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Profile;
+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;
+import java.util.List;
+
+/**
+ * @description: 红包信息
+ * @author: Xgb
+ * @createDate: 2025/11/4
+ * @version: 1.0
+ */
+@RestController
+@RequestMapping("/his/redPacket")
+public class FsRedPacketController extends BaseController {
+
+    @Autowired
+    private IFsRedPacketService fsRedPacketService;
+
+    @Autowired
+    private ICompanyService companyService;
+
+    @GetMapping("/info")
+    public R info() {
+        FsRedPacket result;
+
+        result = new FsRedPacket();
+        BigDecimal totalBalance = BigDecimal.ZERO;
+        BigDecimal totalTodayConsumption = BigDecimal.ZERO;
+        List<Company> companies = companyService.selectCompanyList(new Company());
+        for (Company c : companies) {
+            FsRedPacket info = fsRedPacketService.getInfo(c.getCompanyId());
+            if (info.getRedBalance() != null) {
+                totalBalance = totalBalance.add(info.getRedBalance());
+            }
+            if (info.getRedTodayComsumption() != null) {
+                totalTodayConsumption = totalTodayConsumption.add(info.getRedTodayComsumption());
+            }
+        }
+        result.setRedBalance(totalBalance);
+        result.setRedTodayComsumption(totalTodayConsumption);
+        return R.ok().put("data", result);
+    }
+}

+ 1 - 1
fs-admin-saas/src/main/java/com/fs/web/controller/common/CaptchaController.java

@@ -25,7 +25,7 @@ import org.springframework.context.annotation.Profile;
  *
 
  */
-//@Profile("admin")
+@Profile("admin")
 @RestController
 public class CaptchaController
 {

+ 56 - 1
fs-admin-saas/src/main/java/com/fs/web/controller/system/SysLoginController.java

@@ -16,6 +16,8 @@ import com.fs.common.utils.ip.IpUtils;
 import com.fs.framework.web.service.TokenService;
 import com.fs.his.utils.ConfigUtil;
 import com.fs.hisStore.config.MedicalMallConfig;
+import com.fs.system.domain.SysConfig;
+import com.fs.system.service.ISysConfigService;
 import com.fs.system.service.ISysRoleService;
 import com.fs.system.service.ISysUserService;
 import lombok.Synchronized;
@@ -36,13 +38,15 @@ import com.fs.framework.web.service.SysLoginService;
 import com.fs.framework.web.service.SysPermissionService;
 import com.fs.system.service.ISysMenuService;
 import com.fs.system.service.IAdminMenuService;
+import com.fs.system.service.ISysConfigService;
+import com.fs.system.domain.SysConfig;
 
 /**
  * 登录验证
  *
 
  */
-//@Profile("admin")
+@Profile("admin")
 @RestController
 public class SysLoginController
 {
@@ -71,6 +75,9 @@ public class SysLoginController
     @Autowired
     RedisCache redisCache;
 
+    @Autowired
+    private ISysConfigService configService;
+
     @Autowired
     private ISysUserService userService;
 
@@ -80,6 +87,9 @@ public class SysLoginController
     @Autowired
     private UserDetailsService userDetailsService;
 
+//    @Autowired
+//    private ISysConfigService configService;
+
     /**
      * 登录方法
      *
@@ -166,6 +176,51 @@ public class SysLoginController
         return AjaxResult.success(adminMenuService.buildAdminMenus(menus));
     }
 
+//    @GetMapping("getFirstLogin")
+//    public AjaxResult getFirstLogin()
+//    {
+//        SysConfig config = configService.selectConfigByConfigKey("his.login");
+//        if (config != null && config.getConfigValue() != null) {
+//            String configValue = config.getConfigValue();
+//            JSONObject jsonObject = JSONObject.parseObject(configValue);
+//            Boolean disabled = jsonObject.getBoolean("disabled");
+//            if (Boolean.TRUE.equals(disabled)) {
+//                LoginUser loginUser = SecurityUtils.getLoginUser();
+//                Boolean isFirstLogin = redisCache.getCacheObject("firstLogin:admin:" + loginUser.getUser().getUserId());
+//                return AjaxResult.success(isFirstLogin != null && isFirstLogin);
+//            }
+//        }
+//        return AjaxResult.success(false);
+//    }
+
+    /**
+     * 租户总后台:根据 his.login 配置判断是否需要首次登录改密(与 company 端逻辑对齐,使用 SysUser)
+     */
+    @GetMapping("getFirstLogin")
+    public AjaxResult getFirstLogin()
+    {
+        SysConfig config = configService.selectConfigByConfigKey("his.login");
+        if (config == null || config.getConfigValue() == null) {
+            return AjaxResult.success(false);
+        }
+        JSONObject jsonObject = JSONObject.parseObject(config.getConfigValue());
+        Boolean enabled = jsonObject.getBoolean("disabled");
+        if (!Boolean.TRUE.equals(enabled)) {
+            return AjaxResult.success(false);
+        }
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        if (loginUser == null || loginUser.getUser() == null) {
+            return AjaxResult.success(false);
+        }
+        Long tenantId = loginUser.getTenantId();
+        String cacheKey = "newSysUser:" + (tenantId != null ? tenantId : 0) + ":" + loginUser.getUsername();
+        Long flaggedUserId = redisCache.getCacheObject(cacheKey);
+        if (flaggedUserId != null && flaggedUserId.equals(loginUser.getUserId())) {
+            return AjaxResult.success(true);
+        }
+        return AjaxResult.success(false);
+    }
+
     @PostMapping("/checkIsNeedCheck")
     public boolean checkIsNeedCheck(@RequestBody LoginBody loginBody)
     {

+ 7 - 1
fs-admin-saas/src/main/java/com/fs/web/controller/system/SysProfileController.java

@@ -24,12 +24,13 @@ import com.fs.common.enums.BusinessType;
 import com.fs.common.utils.SecurityUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.common.utils.file.FileUploadUtils;
+import com.fs.common.core.redis.RedisCache;
 import com.fs.framework.web.service.TokenService;
 import com.fs.system.service.ISysUserService;
 
 /**
  * 个人信息 业务处理
- * 
+ *
 
  */
 @Profile({"admin", "company"})
@@ -43,6 +44,9 @@ public class SysProfileController extends BaseController
     @Autowired
     private TokenService tokenService;
 
+    @Autowired
+    private RedisCache redisCache;
+
     /**
      * 个人信息
      */
@@ -119,6 +123,8 @@ public class SysProfileController extends BaseController
             // 更新缓存用户密码
             loginUser.getUser().setPassword(SecurityUtils.encryptPassword(newPassword));
             tokenService.setLoginUser(loginUser);
+            Long tenantId = loginUser.getTenantId();
+            redisCache.deleteObject("newSysUser:" + (tenantId != null ? tenantId : 0) + ":" + userName);
             return AjaxResult.success();
         }
         return AjaxResult.error("修改密码异常,请联系管理员");

+ 23 - 0
fs-admin-saas/src/main/resources/application.yml

@@ -0,0 +1,23 @@
+server:
+  # 服务器的HTTP端口,默认为8080
+  port: 8004
+# Spring配置
+spring:
+  main:
+    allow-bean-definition-overriding: true
+  profiles:
+#    active: dev-test
+#    active: druid-hdt
+#    active: druid-yzt
+#    active: druid-sxjz-test
+#    active: druid-sft
+#    active: druid-fby
+    active: dev,admin
+    include: common,config-dev
+
+# SaaS 模式下定时任务:仅注册租户任务分发器,由分发器每分钟按租户切库执行各租户 sys_job(需主库有 tenant_info)
+saas:
+  quartz:
+    tenant-dispatcher-only: true
+    dispatcher-cron: "0 * * * * ?"
+

+ 1 - 1
fs-admin/src/main/java/com/fs/admin/controller/audit/AdminCompanyBridgeController.java → fs-admin/src/main/java/com/fs/admin/controller/AdminCompanyBridgeController.java

@@ -1,4 +1,4 @@
-package com.fs.admin.controller.audit;
+package com.fs.admin.controller;
 
 import com.fs.common.annotation.Log;
 import com.fs.common.core.controller.BaseController;

+ 0 - 138
fs-admin/src/main/java/com/fs/admin/controller/ArticleAdminController.java

@@ -1,138 +0,0 @@
-package com.fs.admin.controller;
-
-import java.util.*;
-
-import com.fs.admin.helper.AdminCrossTenantHelper;
-import com.fs.common.annotation.Excel;
-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 lombok.Data;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
-
-/**
- * 总后台文章内容审计控制器
- * 遍历所有租户库查询 fs_article 数据
- */
-@RestController
-@RequestMapping("/admin/article")
-public class ArticleAdminController extends BaseController {
-
-    @Autowired
-    private AdminCrossTenantHelper crossTenantHelper;
-
-    private String str(Object o) { return o == null ? "" : o.toString(); }
-
-    @Data
-    public static class ArticleExportVO {
-        @Excel(name = "租户名称") private String companyName;
-        @Excel(name = "文章标题") private String articleTitle;
-        @Excel(name = "分类") private String categoryName;
-        @Excel(name = "作者") private String author;
-        @Excel(name = "状态") private String status;
-        @Excel(name = "创建时间") private String createTime;
-    }
-
-    @Log(title = "导出文章", businessType = BusinessType.EXPORT)
-    @PreAuthorize("@ss.hasPermi('admin:article:list')")
-    @GetMapping("/export")
-    public AjaxResult export(@RequestParam(required = false) String articleTitle,
-                             @RequestParam(required = false) Long companyId,
-                             @RequestParam(required = false) String companyName) {
-        List<Map<String, Object>> allList = crossTenantHelper.queryAcrossTenants(
-                companyId, companyName, (tenant, jdbc) -> {
-                    StringBuilder sql = new StringBuilder(
-                            "SELECT a.article_id, a.article_title, a.category_name, a.author, " +
-                            "a.create_time, a.status " +
-                            "FROM fs_article a WHERE 1=1");
-                    List<Object> params = new ArrayList<>();
-                    if (articleTitle != null && !articleTitle.isEmpty()) {
-                        sql.append(" AND a.article_title LIKE ?");
-                        params.add("%" + articleTitle + "%");
-                    }
-                    sql.append(" ORDER BY a.create_time DESC");
-                    return params.isEmpty()
-                            ? jdbc.queryForList(sql.toString())
-                            : jdbc.queryForList(sql.toString(), params.toArray());
-                });
-        List<ArticleExportVO> voList = new ArrayList<>();
-        for (Map<String, Object> m : allList) {
-            ArticleExportVO vo = new ArticleExportVO();
-            vo.setCompanyName(str(m.get("company_name")));
-            vo.setArticleTitle(str(m.get("article_title")));
-            vo.setCategoryName(str(m.get("category_name")));
-            vo.setAuthor(str(m.get("author")));
-            vo.setStatus(str(m.get("status")));
-            vo.setCreateTime(str(m.get("create_time")));
-            voList.add(vo);
-        }
-        ExcelUtil<ArticleExportVO> util = new ExcelUtil<>(ArticleExportVO.class);
-        return util.exportExcel(voList, "文章数据");
-    }
-
-    /**
-     * 查询所有租户的文章列表
-     */
-    @PreAuthorize("@ss.hasPermi('admin:article:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(@RequestParam(required = false) String articleTitle,
-                              @RequestParam(required = false) Long companyId,
-                              @RequestParam(required = false) String companyName) {
-        List<Map<String, Object>> allList = crossTenantHelper.queryAcrossTenants(
-                companyId, companyName, (tenant, jdbc) -> {
-                    StringBuilder sql = new StringBuilder(
-                            "SELECT a.article_id, a.article_title, a.category_name, a.author, " +
-                            "a.create_time, a.status " +
-                            "FROM fs_article a WHERE 1=1");
-                    List<Object> params = new ArrayList<>();
-                    if (articleTitle != null && !articleTitle.isEmpty()) {
-                        sql.append(" AND a.article_title LIKE ?");
-                        params.add("%" + articleTitle + "%");
-                    }
-                    sql.append(" ORDER BY a.create_time DESC LIMIT 200");
-                    return params.isEmpty()
-                            ? jdbc.queryForList(sql.toString())
-                            : jdbc.queryForList(sql.toString(), params.toArray());
-                });
-        return getDataTable(allList);
-    }
-
-    /**
-     * 查询待审计文章列表
-     */
-    @PreAuthorize("@ss.hasPermi('admin:article:list')")
-    @GetMapping("/pending")
-    public TableDataInfo pendingList(@RequestParam(required = false) Long companyId,
-                                     @RequestParam(required = false) String companyName) {
-        List<Map<String, Object>> allList = crossTenantHelper.queryAcrossTenants(
-                companyId, companyName, (tenant, jdbc) ->
-                        jdbc.queryForList(
-                                "SELECT a.article_id, a.article_title, a.category_name, a.author, " +
-                                "a.create_time, a.status " +
-                                "FROM fs_article a WHERE a.status = 0 ORDER BY a.create_time DESC LIMIT 200"));
-        return getDataTable(allList);
-    }
-
-    /**
-     * 文章统计信息
-     */
-    @PreAuthorize("@ss.hasPermi('admin:article:query')")
-    @GetMapping("/statistics")
-    public AjaxResult statistics(@RequestParam(required = false) Long companyId,
-                                 @RequestParam(required = false) String companyName) {
-        List<Map<String, Object>> allList = crossTenantHelper.queryAcrossTenants(
-                companyId, companyName, (tenant, jdbc) ->
-                        jdbc.queryForList("SELECT article_id, status FROM fs_article"));
-        Map<String, Object> result = new HashMap<>();
-        result.put("totalCount", allList.size());
-        result.put("pendingCount", allList.stream().filter(r -> "0".equals(String.valueOf(r.get("status")))).count());
-        result.put("approvedCount", allList.stream().filter(r -> "1".equals(String.valueOf(r.get("status")))).count());
-        result.put("rejectedCount", allList.stream().filter(r -> "2".equals(String.valueOf(r.get("status")))).count());
-        return AjaxResult.success(result);
-    }
-}

+ 1 - 0
fs-admin/src/main/java/com/fs/admin/controller/audit/AdminLiveVideoController.java

@@ -22,6 +22,7 @@ public class AdminLiveVideoController extends BaseController {
     public TableDataInfo list(@RequestParam(required = false) Long companyId,
                               @RequestParam(required = false) String companyName,
                               @RequestParam(required = false) String videoTitle) {
+        startPage();
         List<Map<String, Object>> allList = adminLiveVideoService.selectLiveVideoList(companyId, companyName, videoTitle);
         return getDataTable(allList);
     }

+ 2 - 1
fs-admin/src/main/java/com/fs/admin/controller/AdminStoreOrderAdminController.java → fs-admin/src/main/java/com/fs/admin/controller/audit/AdminStoreOrderAdminController.java

@@ -1,4 +1,4 @@
-package com.fs.admin.controller;
+package com.fs.admin.controller.audit;
 
 import java.util.*;
 
@@ -59,6 +59,7 @@ public class AdminStoreOrderAdminController extends BaseController {
     @PreAuthorize("@ss.hasPermi('admin:storeOrder:list')")
     @GetMapping("/list")
     public TableDataInfo list(@RequestParam(required = false) String orderNo) {
+        startPage();
         List<Map<String, Object>> allList = adminStoreOrderService.selectStoreOrderList(orderNo);
         return getDataTable(allList);
     }

+ 1 - 0
fs-admin/src/main/java/com/fs/admin/controller/audit/AdminVideoResourceController.java

@@ -28,6 +28,7 @@ public class AdminVideoResourceController extends BaseController {
     @GetMapping("/list")
     public TableDataInfo list(@RequestParam(required = false) Long tenantId,
                               @RequestParam(required = false) String videoName) {
+        startPage();
         List<AdminVideoResourceVO> list = adminVideoResourceService.selectVideoResourceList(videoName);
         return getDataTable(list);
     }

+ 120 - 0
fs-admin/src/main/java/com/fs/admin/controller/audit/ArticleAdminController.java

@@ -0,0 +1,120 @@
+package com.fs.admin.controller.audit;
+
+import java.util.*;
+
+import com.fs.admin.service.IAdminArticleService;
+import com.fs.common.annotation.Excel;
+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 lombok.Data;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@RequestMapping("/admin/article")
+public class ArticleAdminController extends BaseController {
+
+    @Autowired
+    private IAdminArticleService adminArticleService;
+
+    private String str(Object o) { return o == null ? "" : o.toString(); }
+
+    @Data
+    public static class ArticleExportVO {
+        @Excel(name = "租户名称") private String companyName;
+        @Excel(name = "文章标题") private String articleTitle;
+        @Excel(name = "分类") private String categoryName;
+        @Excel(name = "作者") private String author;
+        @Excel(name = "状态") private String status;
+        @Excel(name = "创建时间") private String createTime;
+    }
+
+    @Log(title = "导出文章", businessType = BusinessType.EXPORT)
+    @PreAuthorize("@ss.hasPermi('admin:article:list')")
+    @GetMapping("/export")
+    public AjaxResult export(@RequestParam(required = false) String articleTitle,
+                             @RequestParam(required = false) Integer status) {
+        List<Map<String, Object>> allList = adminArticleService.selectArticleListForExport(articleTitle, status);
+        List<ArticleExportVO> voList = new ArrayList<>();
+        for (Map<String, Object> m : allList) {
+            ArticleExportVO vo = new ArticleExportVO();
+            vo.setCompanyName(str(m.get("companyName")));
+            vo.setArticleTitle(str(m.get("articleTitle")));
+            vo.setCategoryName(str(m.get("categoryName")));
+            vo.setAuthor(str(m.get("author")));
+            vo.setStatus(statusText(str(m.get("status"))));
+            vo.setCreateTime(str(m.get("createTime")));
+            voList.add(vo);
+        }
+        ExcelUtil<ArticleExportVO> util = new ExcelUtil<>(ArticleExportVO.class);
+        return util.exportExcel(voList, "文章数据");
+    }
+
+    @PreAuthorize("@ss.hasPermi('admin:article:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(@RequestParam(required = false) String articleTitle,
+                              @RequestParam(required = false) Integer status) {
+        startPage();
+        List<Map<String, Object>> allList = adminArticleService.selectArticleList(articleTitle, status);
+        return getDataTable(allList);
+    }
+
+    @PreAuthorize("@ss.hasPermi('admin:article:list')")
+    @GetMapping("/pending")
+    public TableDataInfo pendingList() {
+        startPage();
+        List<Map<String, Object>> allList = adminArticleService.selectPendingArticleList();
+        return getDataTable(allList);
+    }
+
+    @PreAuthorize("@ss.hasPermi('admin:article:query')")
+    @GetMapping("/{articleId}")
+    public AjaxResult getInfo(@PathVariable Long articleId) {
+        Map<String, Object> data = adminArticleService.selectArticleById(articleId);
+        if (data == null) return AjaxResult.error("文章不存在");
+        return AjaxResult.success(data);
+    }
+
+    @PreAuthorize("@ss.hasPermi('admin:article:audit')")
+    @PutMapping("/audit/{articleId}")
+    public AjaxResult audit(@PathVariable Long articleId,
+                            @RequestParam Integer status,
+                            @RequestParam(required = false) String auditRemark) {
+        int rows = adminArticleService.auditArticle(articleId, status);
+        return rows > 0 ? AjaxResult.success("操作成功") : AjaxResult.error("操作失败");
+    }
+
+    @PreAuthorize("@ss.hasPermi('admin:article:remove')")
+    @DeleteMapping("/{articleId}")
+    public AjaxResult remove(@PathVariable Long articleId) {
+        int rows = adminArticleService.deleteArticle(articleId);
+        return rows > 0 ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败");
+    }
+
+    @PreAuthorize("@ss.hasPermi('admin:article:query')")
+    @GetMapping("/statistics")
+    public AjaxResult statistics() {
+        List<Map<String, Object>> allList = adminArticleService.selectArticleListForStatistics();
+        Map<String, Object> result = new HashMap<>();
+        result.put("totalCount", allList.size());
+        result.put("pendingCount", allList.stream().filter(r -> "0".equals(str(r.get("status")))).count());
+        result.put("approvedCount", allList.stream().filter(r -> "1".equals(str(r.get("status")))).count());
+        result.put("rejectedCount", allList.stream().filter(r -> "2".equals(str(r.get("status")))).count());
+        return AjaxResult.success(result);
+    }
+
+    private String statusText(String status) {
+        if (status == null || status.isEmpty()) return "";
+        switch (status) {
+            case "0": return "待审计";
+            case "1": return "已通过";
+            case "2": return "已拒绝";
+            default: return status;
+        }
+    }
+}

+ 1 - 0
fs-admin/src/main/java/com/fs/admin/controller/audit/LiveAdminController.java

@@ -79,6 +79,7 @@ public class LiveAdminController extends BaseController {
                               @RequestParam(required = false) Long companyId,
                               @RequestParam(required = false) String companyName,
                               @RequestParam(required = false) Integer status) {
+        startPage();
         List<Map<String, Object>> allList = adminLiveService.selectLiveList(companyId, companyName, liveTitle, status);
         return getDataTable(allList);
     }

+ 2 - 0
fs-admin/src/main/java/com/fs/admin/controller/audit/ProductAdminController.java

@@ -61,6 +61,7 @@ public class ProductAdminController extends BaseController {
     @GetMapping("/list")
     public TableDataInfo list(@RequestParam(required = false) String productName,
                               @RequestParam(required = false) String status) {
+        startPage();
         List<Map<String, Object>> allList = adminProductService.selectProductList(productName, status);
         return getDataTable(allList);
     }
@@ -68,6 +69,7 @@ public class ProductAdminController extends BaseController {
     @PreAuthorize("@ss.hasPermi('admin:product:list')")
     @GetMapping("/pending")
     public TableDataInfo pendingList() {
+        startPage();
         List<Map<String, Object>> allList = adminProductService.selectProductPendingList();
         return getDataTable(allList);
     }

+ 6 - 0
fs-agent/Dockerfile

@@ -0,0 +1,6 @@
+FROM openjdk:8-jre
+# java版本,最好使用openjdk,而不是类似于Java:1.8
+COPY ./target/fs-admin.jar fs-admin.jar
+# 向外暴露的接口,最好与项目yml文件中的端口一致
+ENTRYPOINT ["java","-jar","fs-admin.jar"]
+# 执行启动命令java -jar

+ 256 - 0
fs-agent/pom.xml

@@ -0,0 +1,256 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>fs</artifactId>
+        <groupId>com.fs</groupId>
+        <version>1.1.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <packaging>jar</packaging>
+    <artifactId>fs-agent</artifactId>
+
+    <description>
+        web服务入口
+    </description>
+
+    <dependencies>
+        <!-- Spring 5.3 @Resource.lookup() 需要 javax.annotation-api 1.3+,勿用 tomcat 6.0.53 旧包 -->
+        <dependency>
+            <groupId>javax.annotation</groupId>
+            <artifactId>javax.annotation-api</artifactId>
+        </dependency>
+
+        <!-- 验证码 -->
+        <dependency>
+            <groupId>com.github.penggle</groupId>
+            <artifactId>kaptcha</artifactId>
+            <exclusions>
+                <exclusion>
+                    <artifactId>javax.servlet-api</artifactId>
+                    <groupId>javax.servlet</groupId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.apache.tomcat</groupId>
+                    <artifactId>annotations-api</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>com.github.javen205</groupId>
+            <artifactId>IJPay-All</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.tomcat</groupId>
+                    <artifactId>annotations-api</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>com.alipay.sdk</groupId>
+            <artifactId>alipay-sdk-java</artifactId>
+            <version>4.8.62.ALL</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.tomcat</groupId>
+                    <artifactId>annotations-api</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <!-- spring-boot-devtools -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-devtools</artifactId>
+            <optional>true</optional> <!-- 表示依赖不会传递 -->
+        </dependency>
+         <!-- Mysql驱动包 -->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+
+        <!-- 核心模块-->
+        <dependency>
+            <groupId>com.fs</groupId>
+            <artifactId>fs-framework</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>javax.annotation</groupId>
+                    <artifactId>annotations-api</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.apache.tomcat</groupId>
+                    <artifactId>annotations-api</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+
+
+        <!-- 定时任务-->
+        <dependency>
+            <groupId>com.fs</groupId>
+            <artifactId>fs-quartz</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.tomcat</groupId>
+                    <artifactId>annotations-api</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <!-- lombok -->
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>1.18.32</version>
+        </dependency>
+
+        <!-- 代码生成-->
+        <dependency>
+            <groupId>com.fs</groupId>
+            <artifactId>fs-generator</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.tomcat</groupId>
+                    <artifactId>annotations-api</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <!-- swagger2-->
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.clickhouse</groupId>
+            <artifactId>clickhouse-jdbc</artifactId>
+            <version>0.4.6</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.tomcat</groupId>
+                    <artifactId>annotations-api</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <!-- swagger2-UI-->
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger-ui</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.github.xiaoymin</groupId>
+            <artifactId>swagger-bootstrap-ui</artifactId>
+            <version>1.9.3</version>
+        </dependency>
+        <dependency>
+            <groupId>com.tencentcloudapi</groupId>
+            <artifactId>tencentcloud-sdk-java</artifactId>
+            <version>3.1.322</version>
+            <scope>compile</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>com.squareup.okio</groupId>
+                    <artifactId>okio</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>com.squareup.okhttp</groupId>
+                    <artifactId>okhttp</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.apache.tomcat</groupId>
+                    <artifactId>annotations-api</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>com.squareup.okio</groupId>
+            <artifactId>okio</artifactId>
+            <version>2.10.0</version>
+        </dependency>
+        <!-- https://mvnrepository.com/artifact/com.qcloud/qcloud-java-sdk -->
+        <dependency>
+            <groupId>com.qcloud</groupId>
+            <artifactId>qcloud-java-sdk</artifactId>
+            <version>2.0.1</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.tomcat</groupId>
+                    <artifactId>annotations-api</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.11.0</version>
+                <configuration>
+                    <source>${java.version}</source>
+                    <target>${java.version}</target>
+                    <encoding>${project.build.sourceEncoding}</encoding>
+                    <annotationProcessorPaths>
+                        <path>
+                            <groupId>org.projectlombok</groupId>
+                            <artifactId>lombok</artifactId>
+                            <version>${lombok.version}</version>
+                        </path>
+                        <path>
+                            <groupId>org.mapstruct</groupId>
+                            <artifactId>mapstruct-processor</artifactId>
+                            <version>${org.mapstruct.version}</version>
+                        </path>
+                        <path>
+                            <groupId>org.projectlombok</groupId>
+                            <artifactId>lombok-mapstruct-binding</artifactId>
+                            <version>0.2.0</version>
+                        </path>
+                    </annotationProcessorPaths>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>2.7.18</version>
+                <configuration>
+                    <fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
+                    <excludes>
+                        <exclude>
+                            <groupId>org.apache.tomcat</groupId>
+                            <artifactId>annotations-api</artifactId>
+                        </exclude>
+                    </excludes>
+                    <classifier>exec</classifier> <!-- repackage后的fat jar带exec后缀,原始jar保持普通格式可被其他项目依赖 -->
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-war-plugin</artifactId>
+                <version>3.1.0</version>
+                <configuration>
+                    <failOnMissingWebXml>false</failOnMissingWebXml>
+                    <warName>${project.artifactId}</warName>
+                </configuration>
+           </plugin>
+        </plugins>
+        <finalName>${project.artifactId}</finalName>
+    </build>
+
+</project>

+ 40 - 0
fs-agent/src/main/java/com/fs/FSAgentApplication.java

@@ -0,0 +1,40 @@
+package com.fs;
+
+import com.fs.config.OverridingBeanNameGenerator;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.redisson.spring.starter.RedissonAutoConfiguration;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.FilterType;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 启动程序
+ */
+@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, RedissonAutoConfiguration.class})
+@ComponentScan(
+    basePackages = "com.fs",
+    nameGenerator = OverridingBeanNameGenerator.class,
+    excludeFilters = {
+        @ComponentScan.Filter(type = FilterType.REGEX, pattern = {
+            "com\\.fs\\.framework\\.service\\.PermissionService",
+            "com\\.fs\\.framework\\.service\\.UserDetailsServiceImpl",
+            "com\\.fs\\.company\\.controller\\..*",
+            "com\\.fs\\.hisStore\\.controller\\..*",
+            "com\\.fs\\.his\\.controller\\.FsAiWorkflowController"
+        })
+    }
+)
+@Transactional
+@EnableAsync
+@EnableScheduling
+public class FSAgentApplication {
+    public static void main(String[] args) {
+        // System.setProperty("spring.devtools.restart.enabled", "false");
+        SpringApplication.run(FSAgentApplication.class, args);
+        System.out.println("admin启动成功");
+    }
+}

+ 14 - 0
fs-agent/src/main/java/com/fs/FSServletInitializer.java

@@ -0,0 +1,14 @@
+package com.fs;
+
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
+
+
+public class FSServletInitializer extends SpringBootServletInitializer
+{
+    @Override
+    protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
+    {
+        return application.sources(FSAgentApplication.class);
+    }
+}

+ 31 - 0
fs-agent/src/main/java/com/fs/ad/controller/AdAccountController.java

@@ -0,0 +1,31 @@
+package com.fs.ad.controller;
+
+import com.fs.ad.service.IAdAccountService;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.R;
+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 org.springframework.context.annotation.Profile;
+
+/**
+ * 站点管理Controller
+ * 
+ * @author fs
+ * @date 2025-03-04
+ */
+@Profile({"admin", "company"})
+@RestController
+@RequestMapping("/ad/adAccount")
+public class AdAccountController extends BaseController
+{
+    @Autowired
+    private IAdAccountService adAccountService;
+
+    @GetMapping("/listAll")
+    public R listAll(){
+        return R.ok().put("data", adAccountService.listAll());
+    }
+
+}

+ 108 - 0
fs-agent/src/main/java/com/fs/ad/controller/AdDomainController.java

@@ -0,0 +1,108 @@
+package com.fs.ad.controller;
+
+import com.fs.ad.domain.AdDomain;
+import com.fs.ad.service.IAdDomainService;
+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 org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 广告域名Controller
+ * 
+ * @author fs
+ * @date 2025-03-04
+ */
+@Profile({"admin", "company"})
+@RestController
+@RequestMapping("/ad/adDomain")
+public class AdDomainController extends BaseController
+{
+    @Autowired
+    private IAdDomainService adDomainService;
+
+    /**
+     * 查询广告域名列表
+     */
+    @PreAuthorize("@ss.hasPermi('ad:adDomain:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(AdDomain adDomain)
+    {
+        startPage();
+        List<AdDomain> list = adDomainService.selectAdDomainList(adDomain);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出广告域名列表
+     */
+    @PreAuthorize("@ss.hasPermi('ad:adDomain:export')")
+    @Log(title = "广告域名", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(AdDomain adDomain)
+    {
+        List<AdDomain> list = adDomainService.selectAdDomainList(adDomain);
+        ExcelUtil<AdDomain> util = new ExcelUtil<AdDomain>(AdDomain.class);
+        return util.exportExcel(list, "广告域名数据");
+    }
+
+    /**
+     * 获取广告域名详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('ad:adDomain:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(adDomainService.selectAdDomainById(id));
+    }
+
+    /**
+     * 新增广告域名
+     */
+    @PreAuthorize("@ss.hasPermi('ad:adDomain:add')")
+    @Log(title = "广告域名", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody AdDomain adDomain)
+    {
+        return toAjax(adDomainService.insertAdDomain(adDomain));
+    }
+
+    /**
+     * 修改广告域名
+     */
+    @PreAuthorize("@ss.hasPermi('ad:adDomain:edit')")
+    @Log(title = "广告域名", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody AdDomain adDomain)
+    {
+        return toAjax(adDomainService.updateAdDomain(adDomain));
+    }
+
+    /**
+     * 删除广告域名
+     */
+    @PreAuthorize("@ss.hasPermi('ad:adDomain:remove')")
+    @Log(title = "广告域名", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(adDomainService.deleteAdDomainByIds(ids));
+    }
+
+
+
+
+    @GetMapping(value = "/listAll")
+    public R listAll(){
+        return R.ok().put("data", adDomainService.list());
+    }
+}

+ 105 - 0
fs-agent/src/main/java/com/fs/ad/controller/AdDyAccountController.java

@@ -0,0 +1,105 @@
+package com.fs.ad.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.ad.domain.AdDyAccount;
+import com.fs.ad.service.IAdDyAccountService;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.core.page.TableDataInfo;
+import org.springframework.context.annotation.Profile;
+
+/**
+ * 抖音账户Controller
+ * 
+ * @author 吴树波
+ * @date 2025-05-27
+ */
+@Profile({"admin", "company"})
+@RestController
+@RequestMapping("/ad/AdDyAccount")
+public class AdDyAccountController extends BaseController
+{
+    @Autowired
+    private IAdDyAccountService adDyAccountService;
+
+    /**
+     * 查询抖音账户列表
+     */
+    @PreAuthorize("@ss.hasPermi('ad:AdDyAccount:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(AdDyAccount adDyAccount)
+    {
+        startPage();
+        List<AdDyAccount> list = adDyAccountService.selectAdDyAccountList(adDyAccount);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出抖音账户列表
+     */
+    @PreAuthorize("@ss.hasPermi('ad:AdDyAccount:export')")
+    @Log(title = "抖音账户", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(AdDyAccount adDyAccount)
+    {
+        List<AdDyAccount> list = adDyAccountService.selectAdDyAccountList(adDyAccount);
+        ExcelUtil<AdDyAccount> util = new ExcelUtil<AdDyAccount>(AdDyAccount.class);
+        return util.exportExcel(list, "抖音账户数据");
+    }
+
+    /**
+     * 获取抖音账户详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('ad:AdDyAccount:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(adDyAccountService.selectAdDyAccountById(id));
+    }
+
+    /**
+     * 新增抖音账户
+     */
+    @PreAuthorize("@ss.hasPermi('ad:AdDyAccount:add')")
+    @Log(title = "抖音账户", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody AdDyAccount adDyAccount)
+    {
+        return toAjax(adDyAccountService.insertAdDyAccount(adDyAccount));
+    }
+
+    /**
+     * 修改抖音账户
+     */
+    @PreAuthorize("@ss.hasPermi('ad:AdDyAccount:edit')")
+    @Log(title = "抖音账户", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody AdDyAccount adDyAccount)
+    {
+        return toAjax(adDyAccountService.updateAdDyAccount(adDyAccount));
+    }
+
+    /**
+     * 删除抖音账户
+     */
+    @PreAuthorize("@ss.hasPermi('ad:AdDyAccount:remove')")
+    @Log(title = "抖音账户", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(adDyAccountService.deleteAdDyAccountByIds(ids));
+    }
+}

+ 116 - 0
fs-agent/src/main/java/com/fs/ad/controller/AdDyApiController.java

@@ -0,0 +1,116 @@
+package com.fs.ad.controller;
+
+import java.util.List;
+import org.springframework.context.annotation.Profile;
+
+import com.fs.ad.vo.DyAuthorizedVo;
+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.ad.domain.AdDyApi;
+import com.fs.ad.service.IAdDyApiService;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.core.page.TableDataInfo;
+
+/**
+ * 抖音投流API信息Controller
+ * 
+ * @author 吴树波
+ * @date 2025-05-27
+ */
+@Profile({"admin", "company"})
+@RestController
+@RequestMapping("/ad/adDyApi")
+public class AdDyApiController extends BaseController
+{
+    @Autowired
+    private IAdDyApiService adDyApiService;
+
+    /**
+     * 查询抖音投流API信息列表
+     */
+    @PreAuthorize("@ss.hasPermi('ad:adDyApi:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(AdDyApi adDyApi)
+    {
+        startPage();
+        List<AdDyApi> list = adDyApiService.selectAdDyApiList(adDyApi);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出抖音投流API信息列表
+     */
+    @PreAuthorize("@ss.hasPermi('ad:adDyApi:export')")
+    @Log(title = "抖音投流API信息", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(AdDyApi adDyApi)
+    {
+        List<AdDyApi> list = adDyApiService.selectAdDyApiList(adDyApi);
+        ExcelUtil<AdDyApi> util = new ExcelUtil<AdDyApi>(AdDyApi.class);
+        return util.exportExcel(list, "抖音投流API信息数据");
+    }
+
+    /**
+     * 获取抖音投流API信息详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('ad:adDyApi:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(adDyApiService.selectAdDyApiById(id));
+    }
+
+    /**
+     * 新增抖音投流API信息
+     */
+    @PreAuthorize("@ss.hasPermi('ad:adDyApi:add')")
+    @Log(title = "抖音投流API信息", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody AdDyApi adDyApi)
+    {
+        return toAjax(adDyApiService.insertAdDyApi(adDyApi));
+    }
+
+    /**
+     * 修改抖音投流API信息
+     */
+    @PreAuthorize("@ss.hasPermi('ad:adDyApi:edit')")
+    @Log(title = "抖音投流API信息", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody AdDyApi adDyApi)
+    {
+        return toAjax(adDyApiService.updateAdDyApi(adDyApi));
+    }
+
+    /**
+     * 删除抖音投流API信息
+     */
+    @PreAuthorize("@ss.hasPermi('ad:adDyApi:remove')")
+    @Log(title = "抖音投流API信息", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(adDyApiService.deleteAdDyApiByIds(ids));
+    }
+    /**
+     * 删除抖音投流API信息
+     */
+    @Log(title = "抖音API授权", businessType = BusinessType.UPDATE)
+	@GetMapping("/authorized")
+    public String authorized(DyAuthorizedVo vo){
+        System.out.println(vo);
+        return "授权成功";
+    }
+}

+ 99 - 0
fs-agent/src/main/java/com/fs/ad/controller/AdHtmlClickLogController.java

@@ -0,0 +1,99 @@
+package com.fs.ad.controller;
+
+import com.fs.ad.domain.AdHtmlClickLog;
+import com.fs.ad.service.IAdHtmlClickLogService;
+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 org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 广告点击Controller
+ * 
+ * @author fs
+ * @date 2025-01-09
+ */
+@Profile({"admin", "company"})
+@RestController
+@RequestMapping("/ad/clickLog")
+public class AdHtmlClickLogController extends BaseController
+{
+    @Autowired
+    private IAdHtmlClickLogService adHtmlClickLogService;
+
+    /**
+     * 查询广告点击列表
+     */
+    @PreAuthorize("@ss.hasPermi('ad:clickLog:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(AdHtmlClickLog adHtmlClickLog)
+    {
+        startPage();
+        List<AdHtmlClickLog> list = adHtmlClickLogService.selectAdHtmlClickLogList(adHtmlClickLog);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出广告点击列表
+     */
+    @PreAuthorize("@ss.hasPermi('ad:clickLog:export')")
+    @Log(title = "广告点击", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(AdHtmlClickLog adHtmlClickLog)
+    {
+        List<AdHtmlClickLog> list = adHtmlClickLogService.selectAdHtmlClickLogList(adHtmlClickLog);
+        ExcelUtil<AdHtmlClickLog> util = new ExcelUtil<AdHtmlClickLog>(AdHtmlClickLog.class);
+        return util.exportExcel(list, "广告点击数据");
+    }
+
+    /**
+     * 获取广告点击详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('ad:clickLog:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(adHtmlClickLogService.selectAdHtmlClickLogById(id));
+    }
+
+    /**
+     * 新增广告点击
+     */
+    @PreAuthorize("@ss.hasPermi('ad:clickLog:add')")
+    @Log(title = "广告点击", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody AdHtmlClickLog adHtmlClickLog)
+    {
+        return toAjax(adHtmlClickLogService.insertAdHtmlClickLog(adHtmlClickLog));
+    }
+
+    /**
+     * 修改广告点击
+     */
+    @PreAuthorize("@ss.hasPermi('ad:clickLog:edit')")
+    @Log(title = "广告点击", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody AdHtmlClickLog adHtmlClickLog)
+    {
+        return toAjax(adHtmlClickLogService.updateAdHtmlClickLog(adHtmlClickLog));
+    }
+
+    /**
+     * 删除广告点击
+     */
+    @PreAuthorize("@ss.hasPermi('ad:clickLog:remove')")
+    @Log(title = "广告点击", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(adHtmlClickLogService.deleteAdHtmlClickLogByIds(ids));
+    }
+}

+ 105 - 0
fs-agent/src/main/java/com/fs/ad/controller/AdHtmlTemplateController.java

@@ -0,0 +1,105 @@
+package com.fs.ad.controller;
+
+import com.fs.ad.domain.AdHtmlTemplate;
+import com.fs.ad.service.IAdHtmlTemplateService;
+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 org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 广告信息流链接Controller
+ * 
+ * @author fs
+ * @date 2024-12-31
+ */
+@Profile({"admin", "company"})
+@RestController
+@RequestMapping("/ad/html/template")
+public class AdHtmlTemplateController extends BaseController
+{
+    @Autowired
+    private IAdHtmlTemplateService adHtmlUrlService;
+
+    /**
+     * 查询广告信息流链接列表
+     */
+    @PreAuthorize("@ss.hasPermi('ad:html:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(AdHtmlTemplate adHtmlTemplate)
+    {
+        startPage();
+        List<AdHtmlTemplate> list = adHtmlUrlService.selectAdHtmlUrlList(adHtmlTemplate);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出广告信息流链接列表
+     */
+    @PreAuthorize("@ss.hasPermi('ad:html:export')")
+    @Log(title = "广告信息流链接", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(AdHtmlTemplate adHtmlTemplate)
+    {
+        List<AdHtmlTemplate> list = adHtmlUrlService.selectAdHtmlUrlList(adHtmlTemplate);
+        ExcelUtil<AdHtmlTemplate> util = new ExcelUtil<AdHtmlTemplate>(AdHtmlTemplate.class);
+        return util.exportExcel(list, "广告信息流链接数据");
+    }
+
+    /**
+     * 获取广告信息流链接详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('ad:html:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(adHtmlUrlService.selectAdHtmlUrlById(id));
+    }
+
+    /**
+     * 新增广告信息流链接
+     */
+    @PreAuthorize("@ss.hasPermi('ad:html:add')")
+    @Log(title = "广告信息流链接", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody AdHtmlTemplate adHtmlTemplate)
+    {
+        return toAjax(adHtmlUrlService.insertAdHtmlUrl(adHtmlTemplate));
+    }
+
+    /**
+     * 修改广告信息流链接
+     */
+    @PreAuthorize("@ss.hasPermi('ad:html:edit')")
+    @Log(title = "广告信息流链接", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody AdHtmlTemplate adHtmlTemplate)
+    {
+        return toAjax(adHtmlUrlService.updateAdHtmlUrl(adHtmlTemplate));
+    }
+
+    /**
+     * 删除广告信息流链接
+     */
+    @PreAuthorize("@ss.hasPermi('ad:html:remove')")
+    @Log(title = "广告信息流链接", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(adHtmlUrlService.deleteAdHtmlUrlByIds(ids));
+    }
+
+    @GetMapping(value = "/listAll")
+    public R listAll(){
+        return R.ok().put("data", adHtmlUrlService.list());
+    }
+}

+ 108 - 0
fs-agent/src/main/java/com/fs/ad/controller/AdIqiyiAccountController.java

@@ -0,0 +1,108 @@
+package com.fs.ad.controller;
+
+import com.fs.ad.domain.AdIqiyiAccount;
+import com.fs.ad.service.IAdIqiyiAccountService;
+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 org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 爱奇艺广告账号Controller
+ * 
+ * @author fs
+ * @date 2025-03-03
+ */
+@Profile({"admin", "company"})
+@RestController
+@RequestMapping("/ad/AdIqiyiAccount")
+public class AdIqiyiAccountController extends BaseController
+{
+    @Autowired
+    private IAdIqiyiAccountService adIqiyiAccountService;
+
+    /**
+     * 查询爱奇艺广告账号列表
+     */
+    @PreAuthorize("@ss.hasPermi('ad:AdIqiyiAccount:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(AdIqiyiAccount adIqiyiAccount)
+    {
+        startPage();
+        List<AdIqiyiAccount> list = adIqiyiAccountService.selectAdIqiyiAccountList(adIqiyiAccount);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出爱奇艺广告账号列表
+     */
+    @PreAuthorize("@ss.hasPermi('ad:AdIqiyiAccount:export')")
+    @Log(title = "爱奇艺广告账号", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(AdIqiyiAccount adIqiyiAccount)
+    {
+        List<AdIqiyiAccount> list = adIqiyiAccountService.selectAdIqiyiAccountList(adIqiyiAccount);
+        ExcelUtil<AdIqiyiAccount> util = new ExcelUtil<AdIqiyiAccount>(AdIqiyiAccount.class);
+        return util.exportExcel(list, "爱奇艺广告账号数据");
+    }
+
+    /**
+     * 获取爱奇艺广告账号详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('ad:AdIqiyiAccount:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(adIqiyiAccountService.selectAdIqiyiAccountById(id));
+    }
+
+    /**
+     * 新增爱奇艺广告账号
+     */
+    @PreAuthorize("@ss.hasPermi('ad:AdIqiyiAccount:add')")
+    @Log(title = "爱奇艺广告账号", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody AdIqiyiAccount adIqiyiAccount)
+    {
+        return toAjax(adIqiyiAccountService.insertAdIqiyiAccount(adIqiyiAccount));
+    }
+
+    /**
+     * 修改爱奇艺广告账号
+     */
+    @PreAuthorize("@ss.hasPermi('ad:AdIqiyiAccount:edit')")
+    @Log(title = "爱奇艺广告账号", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody AdIqiyiAccount adIqiyiAccount)
+    {
+        return toAjax(adIqiyiAccountService.updateAdIqiyiAccount(adIqiyiAccount));
+    }
+
+    /**
+     * 删除爱奇艺广告账号
+     */
+    @PreAuthorize("@ss.hasPermi('ad:AdIqiyiAccount:remove')")
+    @Log(title = "爱奇艺广告账号", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(adIqiyiAccountService.deleteAdIqiyiAccountByIds(ids));
+    }
+    /**
+     * 删除优酷广告账号
+     */
+    @PreAuthorize("@ss.hasPermi('ad:AdYouKuaccount:list')")
+    @GetMapping("/listAll")
+    public R listAll(){
+        return R.ok().put("data", adIqiyiAccountService.listAll());
+    }
+}

+ 111 - 0
fs-agent/src/main/java/com/fs/ad/controller/AdSiteController.java

@@ -0,0 +1,111 @@
+package com.fs.ad.controller;
+
+import com.fs.ad.domain.AdSite;
+import com.fs.ad.service.IAdSiteService;
+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 org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 站点管理Controller
+ * 
+ * @author fs
+ * @date 2025-03-04
+ */
+@Profile({"admin", "company"})
+@RestController
+@RequestMapping("/ad/adSite")
+public class AdSiteController extends BaseController
+{
+    @Autowired
+    private IAdSiteService adSiteService;
+
+    /**
+     * 查询站点管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('ad:adSite:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(AdSite adSite)
+    {
+        startPage();
+        List<AdSite> list = adSiteService.selectAdSiteList(adSite);
+        return getDataTable(list);
+    }
+
+    /**
+     * 查询站点管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('ad:adSite:list')")
+    @GetMapping("/listAll")
+    public R listAll(AdSite adSite){
+        List<AdSite> list = adSiteService.selectAdSiteList(adSite);
+        return R.ok().put("data", list);
+    }
+
+    /**
+     * 导出站点管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('ad:adSite:export')")
+    @Log(title = "站点管理", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(AdSite adSite)
+    {
+        List<AdSite> list = adSiteService.selectAdSiteList(adSite);
+        ExcelUtil<AdSite> util = new ExcelUtil<AdSite>(AdSite.class);
+        return util.exportExcel(list, "站点管理数据");
+    }
+
+    /**
+     * 获取站点管理详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('ad:adSite:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(adSiteService.selectAdSiteById(id));
+    }
+
+    /**
+     * 新增站点管理
+     */
+    @PreAuthorize("@ss.hasPermi('ad:adSite:add')")
+    @Log(title = "站点管理", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody AdSite adSite)
+    {
+        return toAjax(adSiteService.insertAdSite(adSite));
+    }
+
+    /**
+     * 修改站点管理
+     */
+    @PreAuthorize("@ss.hasPermi('ad:adSite:edit')")
+    @Log(title = "站点管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody AdSite adSite)
+    {
+        return toAjax(adSiteService.updateAdSite(adSite));
+    }
+
+    /**
+     * 删除站点管理
+     */
+    @PreAuthorize("@ss.hasPermi('ad:adSite:remove')")
+    @Log(title = "站点管理", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(adSiteService.deleteAdSiteByIds(ids));
+    }
+
+}

+ 99 - 0
fs-agent/src/main/java/com/fs/ad/controller/AdUploadLogController.java

@@ -0,0 +1,99 @@
+package com.fs.ad.controller;
+
+import com.fs.ad.domain.AdUploadLog;
+import com.fs.ad.service.IAdUploadLogService;
+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 org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 百度回传日志Controller
+ * 
+ * @author fs
+ * @date 2025-03-14
+ */
+@Profile({"admin", "company"})
+@RestController
+@RequestMapping("/ad/AdUploadLog")
+public class AdUploadLogController extends BaseController
+{
+    @Autowired
+    private IAdUploadLogService adUploadLogService;
+
+    /**
+     * 查询百度回传日志列表
+     */
+    @PreAuthorize("@ss.hasPermi('ad:AdUploadLog:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(AdUploadLog adUploadLog)
+    {
+        startPage();
+        List<AdUploadLog> list = adUploadLogService.selectAdUploadLogList(adUploadLog);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出百度回传日志列表
+     */
+    @PreAuthorize("@ss.hasPermi('ad:AdUploadLog:export')")
+    @Log(title = "百度回传日志", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(AdUploadLog adUploadLog)
+    {
+        List<AdUploadLog> list = adUploadLogService.selectAdUploadLogList(adUploadLog);
+        ExcelUtil<AdUploadLog> util = new ExcelUtil<AdUploadLog>(AdUploadLog.class);
+        return util.exportExcel(list, "百度回传日志数据");
+    }
+
+    /**
+     * 获取百度回传日志详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('ad:AdUploadLog:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(adUploadLogService.selectAdUploadLogById(id));
+    }
+
+    /**
+     * 新增百度回传日志
+     */
+    @PreAuthorize("@ss.hasPermi('ad:AdUploadLog:add')")
+    @Log(title = "百度回传日志", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody AdUploadLog adUploadLog)
+    {
+        return toAjax(adUploadLogService.insertAdUploadLog(adUploadLog));
+    }
+
+    /**
+     * 修改百度回传日志
+     */
+    @PreAuthorize("@ss.hasPermi('ad:AdUploadLog:edit')")
+    @Log(title = "百度回传日志", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody AdUploadLog adUploadLog)
+    {
+        return toAjax(adUploadLogService.updateAdUploadLog(adUploadLog));
+    }
+
+    /**
+     * 删除百度回传日志
+     */
+    @PreAuthorize("@ss.hasPermi('ad:AdUploadLog:remove')")
+    @Log(title = "百度回传日志", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(adUploadLogService.deleteAdUploadLogByIds(ids));
+    }
+}

+ 108 - 0
fs-agent/src/main/java/com/fs/ad/controller/AdYoukuAccountController.java

@@ -0,0 +1,108 @@
+package com.fs.ad.controller;
+
+import com.fs.ad.domain.AdYoukuAccount;
+import com.fs.ad.service.IAdYoukuAccountService;
+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 org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 优酷广告账号Controller
+ * 
+ * @author fs
+ * @date 2025-02-19
+ */
+@Profile({"admin", "company"})
+@RestController
+@RequestMapping("/ad/AdYouKuAccount")
+public class AdYoukuAccountController extends BaseController
+{
+    @Autowired
+    private IAdYoukuAccountService adYoukuAccountService;
+
+    /**
+     * 查询优酷广告账号列表
+     */
+    @PreAuthorize("@ss.hasPermi('ad:AdYouKuaccount:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(AdYoukuAccount adYoukuAccount)
+    {
+        startPage();
+        List<AdYoukuAccount> list = adYoukuAccountService.selectAdYoukuAccountList(adYoukuAccount);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出优酷广告账号列表
+     */
+    @PreAuthorize("@ss.hasPermi('ad:AdYouKuaccount:export')")
+    @Log(title = "优酷广告账号", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(AdYoukuAccount adYoukuAccount)
+    {
+        List<AdYoukuAccount> list = adYoukuAccountService.selectAdYoukuAccountList(adYoukuAccount);
+        ExcelUtil<AdYoukuAccount> util = new ExcelUtil<AdYoukuAccount>(AdYoukuAccount.class);
+        return util.exportExcel(list, "优酷广告账号数据");
+    }
+
+    /**
+     * 获取优酷广告账号详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('ad:AdYouKuaccount:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(adYoukuAccountService.selectAdYoukuAccountById(id));
+    }
+
+    /**
+     * 新增优酷广告账号
+     */
+    @PreAuthorize("@ss.hasPermi('ad:AdYouKuaccount:add')")
+    @Log(title = "优酷广告账号", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody AdYoukuAccount adYoukuAccount)
+    {
+        return toAjax(adYoukuAccountService.insertAdYoukuAccount(adYoukuAccount));
+    }
+
+    /**
+     * 修改优酷广告账号
+     */
+    @PreAuthorize("@ss.hasPermi('ad:AdYouKuaccount:edit')")
+    @Log(title = "优酷广告账号", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody AdYoukuAccount adYoukuAccount)
+    {
+        return toAjax(adYoukuAccountService.updateAdYoukuAccount(adYoukuAccount));
+    }
+
+    /**
+     * 删除优酷广告账号
+     */
+    @PreAuthorize("@ss.hasPermi('ad:AdYouKuaccount:remove')")
+    @Log(title = "优酷广告账号", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(adYoukuAccountService.deleteAdYoukuAccountByIds(ids));
+    }
+    /**
+     * 删除优酷广告账号
+     */
+    @PreAuthorize("@ss.hasPermi('ad:AdYouKuaccount:list')")
+	@GetMapping("/listAll")
+    public R listAll(){
+        return R.ok().put("data", adYoukuAccountService.listAll());
+    }
+}

+ 143 - 0
fs-agent/src/main/java/com/fs/ad/controller/BdAccountController.java

@@ -0,0 +1,143 @@
+package com.fs.ad.controller;
+
+import com.fs.baidu.api.BaiduApis;
+import com.fs.baidu.domain.*;
+import com.fs.baidu.service.*;
+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 lombok.AllArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.context.annotation.Profile;
+
+import java.util.List;
+import java.util.Optional;
+
+/**
+ * 百度账号Controller
+ * 
+ * @author fs
+ * @date 2025-01-20
+ */
+@Profile({"admin", "company"})
+@RestController
+@AllArgsConstructor
+@RequestMapping("/bd/BdAccount")
+public class BdAccountController extends BaseController {
+    private final IBdAccountService bdAccountService;
+    private final IBdPlanService bdPlanService;
+    private final IBdUnitService bdUnitService;
+    private final IBdCreativeService bdCreativeService;
+    private final IBdApiService bdApiService;
+    private final BaiduApis baiduApis;
+
+    /**
+     * 查询百度账号列表
+     */
+    @PreAuthorize("@ss.hasPermi('baidu:BdAccount:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(BdAccount bdAccount){
+        startPage();
+        List<BdAccount> list = bdAccountService.selectBdAccountList(bdAccount);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出百度账号列表
+     */
+    @PreAuthorize("@ss.hasPermi('baidu:BdAccount:export')")
+    @Log(title = "百度账号", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(BdAccount bdAccount)
+    {
+        List<BdAccount> list = bdAccountService.selectBdAccountList(bdAccount);
+        ExcelUtil<BdAccount> util = new ExcelUtil<BdAccount>(BdAccount.class);
+        return util.exportExcel(list, "百度账号数据");
+    }
+
+    /**
+     * 获取百度账号详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('baidu:BdAccount:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(bdAccountService.selectBdAccountById(id));
+    }
+
+    /**
+     * 新增百度账号
+     */
+    @PreAuthorize("@ss.hasPermi('baidu:BdAccount:add')")
+    @Log(title = "百度账号", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody BdAccount bdAccount)
+    {
+        return toAjax(bdAccountService.insertBdAccount(bdAccount));
+    }
+
+    /**
+     * 修改百度账号
+     */
+    @PreAuthorize("@ss.hasPermi('baidu:BdAccount:edit')")
+    @Log(title = "百度账号", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody BdAccount bdAccount)
+    {
+        return toAjax(bdAccountService.updateBdAccount(bdAccount));
+    }
+
+    /**
+     * 删除百度账号
+     */
+    @PreAuthorize("@ss.hasPermi('baidu:BdAccount:remove')")
+    @Log(title = "百度账号", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(bdAccountService.deleteBdAccountByIds(ids));
+    }
+
+
+    /**
+     * 查询百度账号列表
+     */
+    @GetMapping("/listAll")
+    public R listAll(BdAccount bdAccount){
+        return R.ok().put("data", bdAccountService.selectBdAccountList(bdAccount));
+    }
+    @GetMapping("/listAllPlan")
+    public R listAllPlan(BdPlan plan){
+        return R.ok().put("data", bdPlanService.selectBdPlanList(plan));
+    }
+    @GetMapping("/listAllUnit")
+    public R listAllUnit(BdUnit unit){
+        return R.ok().put("data", bdUnitService.selectBdUnitList(unit));
+    }
+    @GetMapping("/listAllCreative")
+    public R listAllCreative(BdCreative creative){
+        return R.ok().put("data", bdCreativeService.selectBdCreativeList(creative));
+    }
+    @GetMapping("/authorizationUrl")
+    public R authorizationUrl(Long id){
+        Optional<BdApi> first = bdApiService.list().stream().findFirst();
+        if(!first.isPresent()){
+            return R.error("未找到API信息");
+        }
+        return R.ok().put("url", bdApiService.authorizationUrl(first.get().getId()));
+    }
+    @GetMapping("/syncAccount")
+    public R syncAccount(Long id){
+        Optional<BdApi> first = bdApiService.list().stream().findFirst();
+        if(!first.isPresent()){
+            return R.error("未找到API信息");
+        }
+        baiduApis.listAccount(1L, id);
+        return R.ok();
+    }
+}

+ 218 - 0
fs-agent/src/main/java/com/fs/ad/controller/MockAppController.java

@@ -0,0 +1,218 @@
+package com.fs.ad.controller;
+
+import com.fs.baidu.domain.BdApi;
+import com.fs.baidu.service.IBdApiService;
+import com.fs.baidu.utils.SignService;
+import com.fs.huifuPay.sdk.opps.core.exception.BasePayException;
+import com.fs.huifuPay.sdk.opps.core.utils.HttpClientUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.commons.lang3.StringUtils;
+import org.json.JSONObject;
+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 org.springframework.context.annotation.Profile;
+
+import javax.servlet.http.HttpServletRequest;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.TreeMap;
+
+@Profile({"admin", "company"})
+@RestController
+@RequestMapping("/baiduBack")
+public class MockAppController {
+    private static final Logger log = LoggerFactory.getLogger(MockAppController.class);
+    private static final String APPID = "appId";
+    private static final String AUTH_CODE = "authCode";
+    private static final String USERID = "userId";
+    private static final String TIMESTAMP = "timestamp";
+    private static final String SIGNATURE = "signature";
+    private static final String STATE = "state";
+    private static final String ACCESSTOKEN_URL = "https://u.baidu.com/oauth/accessToken";
+
+    @Autowired
+    private IBdApiService bdApiService; // 开发者自定义
+    @Autowired
+    private SignService signService; // 开发者可自定义
+
+    @GetMapping("/callback")
+    public String mockApp(HttpServletRequest request) throws BasePayException {
+
+        // 获取请求参数
+        Map<String, String> params = new HashMap<>();
+        this.fillParams(params, request);
+        log.info("callback: params = {}", JSONObject.valueToString(params));
+        int userIdInt = 0;
+        try {
+            userIdInt = Integer.parseInt(params.get(USERID));
+        } catch (Exception e) {
+            return this.getResponseJson(600011, "参数错误", new Object());
+        }
+        // 对签名内容进行判空
+        if (StringUtils.isBlank(params.get(SIGNATURE))) {
+            return this.getResponseJson(600011, "参数错误", new Object());
+        }
+
+        // 获取应用对应的密钥
+        BdApi app = bdApiService.getAppByAppId(params.get(APPID));
+        String sk = app.getAppSecretKey();
+        // 开发者进行验签
+        // 检查状态码
+//        if (!this.checkState(params.get(APPID), app.getAppUserId(), params.get(STATE))) {
+//            log.info("callback: state check fail");
+//            return this.getResponseJson(600011, "状态码错误", new Object());
+//        }
+
+        // 签名验证
+        if (!this.checkSignature(params, sk)) {
+            log.info("callback: signature check fail");
+            return this.getResponseJson(600011, "签名错误", new Object());
+        }
+
+        // 调用接口换取授权令牌
+        String response = this.getAccessToken(params, sk, userIdInt);
+        log.info("callback:getAccesstoken, response={}", response);
+        String accessToken = null;
+        String refreshToken = null;
+        int uid;
+
+        if (response.length() > 0) {
+            JSONObject res = new JSONObject(response);
+            int code = (int) res.get("code");
+            if (code == 0) {
+                JSONObject data = res.getJSONObject("data");
+                accessToken = (String) data.get("accessToken");
+                // 注释部分为 accessToken 其他信息,各应用开发者酌情使用即可
+                 refreshToken = (String) data.get("refreshToken");
+                String openId = data.getString("openId");
+                int expiresIn = data.getInt("expiresIn");
+                int refreshExpiresIn = data.getInt("refreshExpiresIn");
+                app.setAccessToken(accessToken);
+                app.setRefreshToken(refreshToken);
+                app.setExpiresIn(expiresIn);
+                app.setOpenId(openId);
+                app.setRefreshExpiresIn(refreshExpiresIn);
+                app.setAuthCode(params.get(AUTH_CODE));
+                bdApiService.updateById(app);
+
+                // TODO 相关信息落库处理
+            } else {
+                return this.getResponseJson(600011, "未获取到 access_token", new Object());
+            }
+        }
+        Map<String, String> data = new HashMap<>();
+        data.put("accessToken", accessToken);
+        return this.getResponseJson(0, "success", data);
+    }
+
+    /**
+     * 填充请求参数,开发者可用实体代替map
+     *
+     * @param params
+     * @param request
+     */
+    private void fillParams(Map<String, String> params, HttpServletRequest request) {
+        params.put(APPID, request.getParameter(APPID));
+        params.put(AUTH_CODE, request.getParameter(AUTH_CODE));
+        params.put(USERID, request.getParameter(USERID));
+        params.put(TIMESTAMP, request.getParameter(TIMESTAMP));
+        params.put(SIGNATURE, request.getParameter(SIGNATURE));
+        params.put(STATE, request.getParameter(STATE));
+    }
+
+    /**
+     * 校验状态码是否符合预期
+     *
+     * @param appId  应用ID
+     * @param userId 创建应用的ID
+     * @param state  请求参数中的状态码
+     * @return
+     */
+    private boolean checkState(String appId, Long userId, String state) {
+        // md5util 开发者自行开发即可
+        String newState = md5(appId.concat("_").concat(String.valueOf(userId)));
+        return newState.equals(state);
+    }
+    public static String md5(String input) {
+        try {
+            MessageDigest md = MessageDigest.getInstance("MD5");
+            byte[] messageDigest = md.digest(input.getBytes());
+            StringBuilder hexString = new StringBuilder();
+            for (byte b : messageDigest) {
+                String hex = Integer.toHexString(0xff & b);
+                if (hex.length() == 1) {
+                    hexString.append('0');
+                }
+                hexString.append(hex);
+            }
+            return hexString.toString();
+        } catch (NoSuchAlgorithmException e) {
+            throw new RuntimeException(e);
+        }
+    }
+    /**
+     * 签名验证方法
+     *
+     * @param params
+     * @param sk
+     * @return
+     */
+    private boolean checkSignature(Map<String, String> params, String sk) {
+        // 获取验签字符串:按key自然排序,拼接成 json 字符串,
+        // 示例:str1 = {"appId": xxxxx, "authCode": xxx, "state": xxx,"timestamp": xxx}
+        TreeMap<String, Object> map = new TreeMap<>();
+        map.put(APPID, params.get(APPID));
+        map.put(AUTH_CODE, params.get(AUTH_CODE));
+        map.put(USERID, params.get(USERID));
+        map.put(STATE, params.get(STATE));
+        map.put(TIMESTAMP, params.get(TIMESTAMP));
+        // 根据上述签名算法对接收到的参数签名
+        String sign = signService.paramsSign(sk, map);
+        log.info("callback: signature = {}", sign);
+        // 判断签名和URL传参签名是否一致
+        return params.get(SIGNATURE).equals(sign);
+    }
+
+    /**
+     * 换取授权令牌
+     *
+     * @param params
+     * @param sk
+     * @param userIdInt 授权账户ID
+     * @return
+     */
+    private String getAccessToken(Map<String, String> params, String sk, int userIdInt) throws BasePayException {
+        Map<String, Object> requestMap = new HashMap<>();
+        requestMap.put(APPID, params.get(APPID));
+        requestMap.put("secretKey", sk);
+        requestMap.put(AUTH_CODE, params.get(AUTH_CODE));
+        requestMap.put("grantType", "access_token");
+        requestMap.put("userId", userIdInt);
+
+        String paramsJson = JSONObject.valueToString(requestMap);
+        // 开发者自行增加异常判断
+        return HttpClientUtils.httpPostJson(ACCESSTOKEN_URL, new HashMap<>(), paramsJson);
+    }
+
+    /**
+     * 封装返回json串
+     *
+     * @param code
+     * @param message
+     * @param data
+     * @return
+     */
+    private String getResponseJson(int code, String message, Object data) {
+        // 封装返回字段的map
+        Map<String, Object> responseMap = new HashMap<>();
+        responseMap.put("code", code);
+        responseMap.put("message", message);
+        responseMap.put("data", data);
+        return JSONObject.valueToString(responseMap);
+    }
+}

+ 86 - 0
fs-agent/src/main/java/com/fs/ad/controller/StatisticsController.java

@@ -0,0 +1,86 @@
+package com.fs.ad.controller;
+
+import com.fs.baidu.api.BaiduApis;
+import com.fs.baidu.domain.BdAccount;
+import com.fs.baidu.domain.BdApi;
+import com.fs.baidu.enums.BdTimeUnit;
+import com.fs.baidu.mapper.BdApiMapper;
+import com.fs.baidu.param.QueryReportDataParam;
+import com.fs.baidu.service.IBdAccountService;
+import com.fs.bdAdv.param.FsAdvSemStatisticsByDayParam;
+import com.fs.bdAdv.service.IFsAdvSemService;
+import com.fs.bdAdv.vo.FsAdvSemStatisticsByDayVo;
+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.utils.poi.ExcelUtil;
+import com.fs.qw.param.ConversionStatisticsParam;
+import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.context.annotation.Profile;
+
+import java.time.LocalDate;
+import java.util.List;
+
+@Profile({"admin", "company"})
+@RestController
+@AllArgsConstructor
+@RequestMapping("/baiduStatistics")
+public class StatisticsController extends BaseController {
+
+    private final IFsAdvSemService fsAdvSemService;
+    private final IBdAccountService bdAccountService;
+    private final BaiduApis baiduApis;
+    private final BdApiMapper bdApiMapper;
+
+    @GetMapping("/conversionStatistics")
+    public R conversionStatistics(ConversionStatisticsParam param){
+        return bdAccountService.conversionStatistics(param);
+    }
+
+
+    @GetMapping("/selectFsAdvSemStatisticsByDayVo")
+    public TableDataInfo selectFsAdvSemStatisticsByDayVo(FsAdvSemStatisticsByDayParam param){
+        startPage();
+        return getDataTable(fsAdvSemService.selectFsAdvSemStatisticsByDayVo(param));
+    }
+
+    /**
+     * 导出
+     * @param param
+     * @return
+     */
+    @GetMapping("/fsAdvSemStatisticsExport")
+    public AjaxResult fsAdvSemStatisticsExport(FsAdvSemStatisticsByDayParam param){
+        List<FsAdvSemStatisticsByDayVo> list = fsAdvSemService.selectFsAdvSemStatisticsByDayVo(param);
+        ExcelUtil<FsAdvSemStatisticsByDayVo> util = new ExcelUtil<FsAdvSemStatisticsByDayVo>(FsAdvSemStatisticsByDayVo.class);
+        return util.exportExcel(list, "企微主体数据");
+    }
+
+
+
+    @GetMapping("/getReportData")
+    public R getReportData(Long id, Integer reportType, LocalDate startDate, LocalDate endDate, Integer page, Integer rowCount){
+        QueryReportDataParam param = new QueryReportDataParam();
+        param.setReportType(reportType);
+        param.setStartDate(startDate);
+        param.setEndDate(endDate);
+        param.setPage(page);
+        param.setRowCount(rowCount);
+        param.setTimeUnit(BdTimeUnit.SUMMARY);
+        BdAccount account = bdAccountService.getById(id);
+        BdApi byId = bdApiMapper.selectById(account.getApiId());
+        return baiduApis.getReportData(byId.getAccessToken(), account.getAccountName(), param);
+//        return R.ok();
+    }
+
+    @GetMapping("/bdDataStatic")
+    public R bdDataStatic(){
+        return baiduApis.bdDataStatic();
+    }
+
+
+}

+ 26 - 0
fs-agent/src/main/java/com/fs/ad/controller/task/BaiduTask.java

@@ -0,0 +1,26 @@
+package com.fs.ad.controller.task;
+
+import com.fs.qw.service.IQwWorkUserService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+@Component("baiduTask")
+public class BaiduTask {
+    private static final Logger log = LoggerFactory.getLogger(BaiduTask.class);
+
+    @Autowired
+    private IQwWorkUserService qwWorkUserService;
+
+    /**
+     * 同步完企微客户,然后对加微的数据信息筛选并上传给百度进行投流优化
+     */
+    public void bdUpload(){
+        qwWorkUserService.uploadBd();
+//        qwWorkUserService.uploadYk();
+    }
+
+
+}

+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AdminAdController.java → fs-agent/src/main/java/com/fs/admin/controller/AdminAdController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AdminAiWorkflowBridgeController.java → fs-agent/src/main/java/com/fs/admin/controller/AdminAiWorkflowBridgeController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AdminCommissionRecordController.java → fs-agent/src/main/java/com/fs/admin/controller/AdminCommissionRecordController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AdminCompanyBridgeController.java → fs-agent/src/main/java/com/fs/admin/controller/AdminCompanyBridgeController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AdminConsumeRecordController.java → fs-agent/src/main/java/com/fs/admin/controller/AdminConsumeRecordController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AdminCourseBridgeController.java → fs-agent/src/main/java/com/fs/admin/controller/AdminCourseBridgeController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AdminCrmController.java → fs-agent/src/main/java/com/fs/admin/controller/AdminCrmController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AdminHisBridgeController.java → fs-agent/src/main/java/com/fs/admin/controller/AdminHisBridgeController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AdminLiveBridgeController.java → fs-agent/src/main/java/com/fs/admin/controller/AdminLiveBridgeController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AdminLiveVideoController.java → fs-agent/src/main/java/com/fs/admin/controller/AdminLiveVideoController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AdminLobsterBridgeController.java → fs-agent/src/main/java/com/fs/admin/controller/AdminLobsterBridgeController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AdminMiscBridge2Controller.java → fs-agent/src/main/java/com/fs/admin/controller/AdminMiscBridge2Controller.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AdminMissingApisBridgeController.java → fs-agent/src/main/java/com/fs/admin/controller/AdminMissingApisBridgeController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AdminModuleUsageController.java → fs-agent/src/main/java/com/fs/admin/controller/AdminModuleUsageController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AdminProxyController.java → fs-agent/src/main/java/com/fs/admin/controller/AdminProxyController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AdminRechargeRecordController.java → fs-agent/src/main/java/com/fs/admin/controller/AdminRechargeRecordController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AdminServiceCostController.java → fs-agent/src/main/java/com/fs/admin/controller/AdminServiceCostController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AdminSopController.java → fs-agent/src/main/java/com/fs/admin/controller/AdminSopController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AdminStatisticsController.java → fs-agent/src/main/java/com/fs/admin/controller/AdminStatisticsController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AdminStoreMiscController.java → fs-agent/src/main/java/com/fs/admin/controller/AdminStoreMiscController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AdminStoreOrderAdminController.java → fs-agent/src/main/java/com/fs/admin/controller/AdminStoreOrderAdminController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AdminStoreOrderController.java → fs-agent/src/main/java/com/fs/admin/controller/AdminStoreOrderController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AdminStoreProductController.java → fs-agent/src/main/java/com/fs/admin/controller/AdminStoreProductController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AdminVideoResourceController.java → fs-agent/src/main/java/com/fs/admin/controller/AdminVideoResourceController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AdminWithdrawalController.java → fs-agent/src/main/java/com/fs/admin/controller/AdminWithdrawalController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AiChatQualityController.java → fs-agent/src/main/java/com/fs/admin/controller/AiChatQualityController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/AiProviderAdminController.java → fs-agent/src/main/java/com/fs/admin/controller/AiProviderAdminController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/ArticleAdminController.java → fs-agent/src/main/java/com/fs/admin/controller/ArticleAdminController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/CallRecordAdminController.java → fs-agent/src/main/java/com/fs/admin/controller/CallRecordAdminController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/CompanyAdminController.java → fs-agent/src/main/java/com/fs/admin/controller/CompanyAdminController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/CompanyUserAdminController.java → fs-agent/src/main/java/com/fs/admin/controller/CompanyUserAdminController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/CourseAdminController.java → fs-agent/src/main/java/com/fs/admin/controller/CourseAdminController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/DbConfigController.java → fs-agent/src/main/java/com/fs/admin/controller/DbConfigController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/LiveAdminController.java → fs-agent/src/main/java/com/fs/admin/controller/LiveAdminController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/LobsterAdminController.java → fs-agent/src/main/java/com/fs/admin/controller/LobsterAdminController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/ProductAdminController.java → fs-agent/src/main/java/com/fs/admin/controller/ProductAdminController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/ProxyOperLogController.java → fs-agent/src/main/java/com/fs/admin/controller/ProxyOperLogController.java


+ 0 - 0
fs-admin-saas/src/main/java/com/fs/admin/controller/QwExternalContactAdminController.java → fs-agent/src/main/java/com/fs/admin/controller/QwExternalContactAdminController.java


+ 82 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsAdvScrmBridgeController.java

@@ -0,0 +1,82 @@
+package com.fs.admin.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.hisStore.domain.FsAdvScrm;
+import com.fs.hisStore.service.IFsAdvScrmService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 广告 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsAdvController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2023-06-08
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/store/adv")
+public class FsAdvScrmBridgeController extends BaseController
+{
+    @Autowired
+    private IFsAdvScrmService fsAdvService;
+
+    @PreAuthorize("@ss.hasPermi('store:adv:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsAdvScrm fsAdv)
+    {
+        startPage();
+        List<FsAdvScrm> list = fsAdvService.selectFsAdvList(fsAdv);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:adv:export')")
+    @Log(title = "广告", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsAdvScrm fsAdv)
+    {
+        List<FsAdvScrm> list = fsAdvService.selectFsAdvList(fsAdv);
+        ExcelUtil<FsAdvScrm> util = new ExcelUtil<FsAdvScrm>(FsAdvScrm.class);
+        return util.exportExcel(list, "广告数据");
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:adv:query')")
+    @GetMapping(value = "/{advId}")
+    public AjaxResult getInfo(@PathVariable("advId") Long advId)
+    {
+        return AjaxResult.success(fsAdvService.selectFsAdvById(advId));
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:adv:add')")
+    @Log(title = "广告", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsAdvScrm fsAdv)
+    {
+        return toAjax(fsAdvService.insertFsAdv(fsAdv));
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:adv:edit')")
+    @Log(title = "广告", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsAdvScrm fsAdv)
+    {
+        return toAjax(fsAdvService.updateFsAdv(fsAdv));
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:adv:remove')")
+    @Log(title = "广告", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{advIds}")
+    public AjaxResult remove(@PathVariable Long[] advIds)
+    {
+        return toAjax(fsAdvService.deleteFsAdvByIds(advIds));
+    }
+}

+ 82 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsMenuScrmBridgeController.java

@@ -0,0 +1,82 @@
+package com.fs.admin.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.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 org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 用户端菜单管理 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsMenuScrmController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/store/menu")
+public class FsMenuScrmBridgeController 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));
+    }
+}

+ 82 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsPrescribeDrugScrmBridgeController.java

@@ -0,0 +1,82 @@
+package com.fs.admin.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.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 org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 处方药品 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsPrescribeDrugScrmController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/store/prescribeDrug")
+public class FsPrescribeDrugScrmBridgeController 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));
+    }
+}

+ 82 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsPrescribeScrmBridgeController.java

@@ -0,0 +1,82 @@
+package com.fs.admin.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.hisStore.domain.FsPrescribeScrm;
+import com.fs.hisStore.service.IFsPrescribeScrmService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 处方 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsPrescribeScrmController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/store/prescribe")
+public class FsPrescribeScrmBridgeController extends BaseController
+{
+    @Autowired
+    private IFsPrescribeScrmService fsPrescribeService;
+
+    @PreAuthorize("@ss.hasPermi('store:prescribe:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsPrescribeScrm fsPrescribe)
+    {
+        startPage();
+        List<FsPrescribeScrm> list = fsPrescribeService.selectFsPrescribeList(fsPrescribe);
+        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, "处方数据");
+    }
+
+    @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));
+    }
+}

+ 82 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsShippingTemplatesFreeScrmBridgeController.java

@@ -0,0 +1,82 @@
+package com.fs.admin.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.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 org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 免邮费 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsShippingTemplatesFreeScrmController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/store/shippingTemplatesFree")
+public class FsShippingTemplatesFreeScrmBridgeController 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));
+    }
+}

+ 82 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsShippingTemplatesRegionScrmBridgeController.java

@@ -0,0 +1,82 @@
+package com.fs.admin.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.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 org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 邮费区域 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsShippingTemplatesRegionScrmController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/store/shippingTemplatesRegion")
+public class FsShippingTemplatesRegionScrmBridgeController 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));
+    }
+}

+ 93 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsShippingTemplatesScrmBridgeController.java

@@ -0,0 +1,93 @@
+package com.fs.admin.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.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 org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 运费模板 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsShippingTemplatesScrmController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/store/shippingTemplates")
+public class FsShippingTemplatesScrmBridgeController 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);
+    }
+}

+ 93 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreActivityScrmBridgeController.java

@@ -0,0 +1,93 @@
+package com.fs.admin.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.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 org.springframework.context.annotation.Profile;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 活动 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsStoreActivityScrmController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2022-11-18
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/storeActivity")
+public class FsStoreActivityScrmBridgeController 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));
+    }
+}

+ 82 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreAfterSalesItemScrmBridgeController.java

@@ -0,0 +1,82 @@
+package com.fs.admin.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.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 org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 售后子 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsStoreAfterSalesItemScrmController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/store/storeAfterSalesItem")
+public class FsStoreAfterSalesItemScrmBridgeController 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));
+    }
+}

+ 233 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreAfterSalesScrmBridgeController.java

@@ -0,0 +1,233 @@
+package com.fs.admin.controller.store;
+
+import cn.hutool.core.bean.BeanUtil;
+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.config.saas.ProjectConfig;
+import com.fs.framework.security.LoginUser;
+import com.fs.framework.security.SecurityUtils;
+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 com.fs.hisStore.vo.FsStoreOrderItemExportRefundZMVO;
+import com.fs.system.mapper.SysConfigMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.context.annotation.Profile;
+
+import java.math.BigDecimal;
+import java.text.ParseException;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/**
+ * 售后记录 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsStoreAfterSalesScrmController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/store/storeAfterSales")
+public class FsStoreAfterSalesScrmBridgeController extends BaseController
+{
+    @Autowired
+    private IFsStoreOrderScrmService fsStoreOrderService;
+    @Autowired
+    private IFsUserService userService;
+    @Autowired
+    private IFsStoreAfterSalesScrmService fsStoreAfterSalesService;
+    @Autowired
+    private IFsStoreAfterSalesItemScrmService fsStoreAfterSalesItemService;
+    @Autowired
+    private IFsStoreAfterSalesStatusScrmService storeAfterSalesStatusService;
+    @Autowired
+    private SysConfigMapper sysConfigMapper;
+
+    @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 (StringUtils.isNotEmpty(fsStoreAfterSales.getBeginTime()) && StringUtils.isNotEmpty(fsStoreAfterSales.getEndTime())) {
+            fsStoreAfterSales.setBeginTime(null);
+            fsStoreAfterSales.setEndTime(null);
+        }
+        if (fsStoreAfterSalesService.isEntityNull(fsStoreAfterSales) && Objects.isNull(fsStoreAfterSales.getParams())) {
+            return AjaxResult.error("请筛选数据导出");
+        }
+
+        List<FsStoreAfterSalesVO> list = fsStoreAfterSalesService.selectFsStoreAfterSalesListVOExport(fsStoreAfterSales);
+        if ("北京卓美".equals(ProjectConfig.getFromDB(sysConfigMapper).getCloudHost().getCompanyName())) {
+            List<FsStoreOrderItemExportRefundZMVO> zmvoList = list.stream()
+                    .map(vo -> {
+                        FsStoreOrderItemExportRefundZMVO zmvo = new FsStoreOrderItemExportRefundZMVO();
+                        try {
+                            zmvo.setPayCode(vo.getPayCode());
+                            zmvo.setOrderCode(vo.getOrderCode());
+                            zmvo.setStatus(vo.getOrderStatus().toString());
+                            zmvo.setUserId(vo.getUserId());
+                            zmvo.setProductName(vo.getProductName());
+                            zmvo.setBarCode(vo.getProductBarCode());
+                            zmvo.setSku(vo.getSku());
+                            zmvo.setNum(vo.getNum());
+                            zmvo.setPrice(vo.getPrice());
+                            zmvo.setCost(vo.getCost());
+                            zmvo.setPayMoney(vo.getPayMoney());
+                            zmvo.setPayPostage(vo.getTotalPostage());
+                            zmvo.setCateName(vo.getCateName());
+                            zmvo.setRealName(vo.getUserName());
+                            zmvo.setUserPhone(vo.getUserPhone());
+                            zmvo.setUserAddress(vo.getUserAddress());
+                            zmvo.setCreateTime(vo.getOrderCreateTime());
+                            zmvo.setPayTime(vo.getOrderPayTime());
+                            zmvo.setDeliverySn(vo.getOrderDeliverySn());
+                            zmvo.setDeliveryName(vo.getOrderDeliveryName());
+                            zmvo.setDeliveryId(vo.getOrderDeliveryId());
+                            zmvo.setCompanyName(vo.getCompanyName());
+                            zmvo.setCompanyUserNickName(vo.getCompanyUserNickName());
+                            zmvo.setRefundTime(vo.getCreateTime());
+                            zmvo.setRefundMoney(vo.getRefundAmount());
+                            zmvo.setBankTransactionId(vo.getBankTransactionId());
+                            zmvo.setReasons(vo.getReasons());
+                            zmvo.setExplains(vo.getExplains());
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        return zmvo;
+                    })
+                    .collect(Collectors.toList());
+            for (FsStoreOrderItemExportRefundZMVO vo : zmvoList) {
+                vo.setUserPhone(ParseUtils.parsePhone(vo.getUserPhone()));
+            }
+            ExcelUtil<FsStoreOrderItemExportRefundZMVO> util = new ExcelUtil<FsStoreOrderItemExportRefundZMVO>(FsStoreOrderItemExportRefundZMVO.class);
+            return util.exportExcel(zmvoList, "退款订单导出");
+        }
+        for (FsStoreAfterSalesVO vo : list) {
+            vo.setUserPhone(ParseUtils.parsePhone(vo.getUserPhone()));
+        }
+        ExcelUtil<FsStoreAfterSalesVO> util = new ExcelUtil<FsStoreAfterSalesVO>(FsStoreAfterSalesVO.class);
+        return util.exportExcel(list, "退款订单导出");
+    }
+
+    @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 = SecurityUtils.getLoginUser();
+        param.setOperator(loginUser.getCompanyUser().getNickName());
+        return fsStoreAfterSalesService.audit1(param);
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSales:audit2')")
+    @PostMapping("/audit2")
+    public R audit2(@RequestBody FsStoreAfterSalesAudit2Param param)
+    {
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        param.setOperator(loginUser.getCompanyUser().getNickName());
+        return fsStoreAfterSalesService.audit2(param);
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSales:refund')")
+    @PostMapping("/refund")
+    public R refund(@RequestBody FsStoreAfterSalesRefundParam param)
+    {
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        param.setOperator(loginUser.getCompanyUser().getNickName());
+        return fsStoreAfterSalesService.refundMoney(param);
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeAfterSales:cancel')")
+    @PostMapping("/cancel")
+    public R cancel(@RequestBody FsStoreAfterSalesCancelParam param) throws ParseException
+    {
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        param.setOperator(loginUser.getCompanyUser().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);
+    }
+}

+ 82 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreAfterSalesStatusScrmBridgeController.java

@@ -0,0 +1,82 @@
+package com.fs.admin.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.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 org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 售后订单操作 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsStoreAfterSalesStatusScrmController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/store/storeAfterSalesStatus")
+public class FsStoreAfterSalesStatusScrmBridgeController 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));
+    }
+}

+ 82 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreCartScrmBridgeController.java

@@ -0,0 +1,82 @@
+package com.fs.admin.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.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 org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 购物车 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsStoreCartScrmController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2022-03-21
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/store/storeCart")
+public class FsStoreCartScrmBridgeController 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));
+    }
+}

+ 83 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreCouponIssueScrmBridgeController.java

@@ -0,0 +1,83 @@
+package com.fs.admin.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.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 org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 优惠券发放 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsStoreCouponIssueScrmController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/store/storeCouponIssue")
+public class FsStoreCouponIssueScrmBridgeController 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));
+    }
+}

+ 82 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreCouponIssueUserScrmBridgeController.java

@@ -0,0 +1,82 @@
+package com.fs.admin.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.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 org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 优惠券用户领取记录 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsStoreCouponIssueUserScrmController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/store/storeCouponIssueUser")
+public class FsStoreCouponIssueUserScrmBridgeController 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));
+    }
+}

+ 131 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreCouponScrmBridgeController.java

@@ -0,0 +1,131 @@
+package com.fs.admin.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.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 org.springframework.context.annotation.Profile;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 优惠券 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsStoreCouponScrmController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/storeCoupon")
+public class FsStoreCouponScrmBridgeController 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();
+    }
+}

+ 82 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreCouponUserScrmBridgeController.java

@@ -0,0 +1,82 @@
+package com.fs.admin.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.hisStore.domain.FsStoreCouponUserScrm;
+import com.fs.hisStore.service.IFsStoreCouponUserScrmService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 优惠券发放记录 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsStoreCouponUserScrmController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/store/storeCouponUser")
+public class FsStoreCouponUserScrmBridgeController extends BaseController
+{
+    @Autowired
+    private IFsStoreCouponUserScrmService fsStoreCouponUserService;
+
+    @PreAuthorize("@ss.hasPermi('store:storeCouponUser:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreCouponUserScrm fsStoreCouponUser)
+    {
+        startPage();
+        List<FsStoreCouponUserScrm> list = fsStoreCouponUserService.selectFsStoreCouponUserList(fsStoreCouponUser);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeCouponUser:export')")
+    @Log(title = "优惠券发放记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreCouponUserScrm fsStoreCouponUser)
+    {
+        List<FsStoreCouponUserScrm> list = fsStoreCouponUserService.selectFsStoreCouponUserList(fsStoreCouponUser);
+        ExcelUtil<FsStoreCouponUserScrm> util = new ExcelUtil<FsStoreCouponUserScrm>(FsStoreCouponUserScrm.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));
+    }
+}

+ 96 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreOrderAuditScrmBridgeController.java

@@ -0,0 +1,96 @@
+package com.fs.admin.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.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.FsStoreOrderAuditScrm;
+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 org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.context.annotation.Profile;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * 订单审核 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsStoreOrderAuditScrmController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2023-06-15
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/store/storeOrderAudit")
+public class FsStoreOrderAuditScrmBridgeController extends BaseController
+{
+    @Autowired
+    private IFsStoreOrderAuditScrmService fsStoreOrderAuditService;
+
+    @PreAuthorize("@ss.hasPermi('store:storeOrderAudit:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreOrderAuditParam param)
+    {
+        startPage();
+        List<FsStoreOrderAuditVO> list = fsStoreOrderAuditService.selectStoreOrderAuditVOList(param);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeOrderAudit:export')")
+    @Log(title = "订单审核", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStoreOrderAuditParam param)
+    {
+        List<FsStoreOrderAuditVO> list = fsStoreOrderAuditService.selectStoreOrderAuditVOList(param);
+        ExcelUtil<FsStoreOrderAuditVO> util = new ExcelUtil<FsStoreOrderAuditVO>(FsStoreOrderAuditVO.class);
+        return util.exportExcel(list, "订单审核数据");
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeOrderAudit:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsStoreOrderAuditService.getById(id));
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeOrderAudit:add')")
+    @Log(title = "订单审核", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStoreOrderAuditScrm fsStoreOrderAudit)
+    {
+        return toAjax(fsStoreOrderAuditService.save(fsStoreOrderAudit));
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeOrderAudit:edit')")
+    @Log(title = "订单审核", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStoreOrderAuditScrm fsStoreOrderAudit)
+    {
+        return toAjax(fsStoreOrderAuditService.updateById(fsStoreOrderAudit));
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeOrderAudit:audit')")
+    @Log(title = "订单审核", businessType = BusinessType.UPDATE)
+    @PostMapping("/audit")
+    public AjaxResult audit(@Valid @RequestBody FsStoreOrderAuditReviewParam param)
+    {
+        fsStoreOrderAuditService.audit(param, null, true);
+        return AjaxResult.success();
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeOrderAudit:remove')")
+    @Log(title = "订单审核", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsStoreOrderAuditService.removeByIds(java.util.Arrays.asList(ids)));
+    }
+}

+ 90 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreOrderItemScrmBridgeController.java

@@ -0,0 +1,90 @@
+package com.fs.admin.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.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 org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 订单详情 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsStoreOrderItemScrmController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2022-03-21
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/store/storeOrderItem")
+public class FsStoreOrderItemScrmBridgeController 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));
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeOrderItem:updateNum')")
+    @Log(title = "订单详情修改订单数量", businessType = BusinessType.UPDATE)
+    @PutMapping("/updateNum")
+    public AjaxResult updateNum(@RequestBody FsStoreOrderItemScrm fsStoreOrderItem)
+    {
+        return toAjax(fsStoreOrderItemService.updateFsStoreOrderItemNum(fsStoreOrderItem));
+    }
+}

+ 82 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreOrderNoticeScrmBridgeController.java

@@ -0,0 +1,82 @@
+package com.fs.admin.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.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 org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 订单通知用户 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsStoreOrderNoticeScrmController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/store/storeOrderNotice")
+public class FsStoreOrderNoticeScrmBridgeController 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));
+    }
+}

+ 134 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreOrderOfflineScrmBridgeController.java

@@ -0,0 +1,134 @@
+package com.fs.admin.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.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.poi.ExcelUtil;
+import com.fs.crm.domain.CrmCustomer;
+import com.fs.crm.service.ICrmCustomerService;
+import com.fs.framework.security.SecurityUtils;
+import com.fs.framework.security.LoginUser;
+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 org.springframework.context.annotation.Profile;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 线下订单 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsStoreOrderOfflineScrmController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2024-10-29
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/store/storeOrderOffline")
+public class FsStoreOrderOfflineScrmBridgeController extends BaseController
+{
+    @Autowired
+    private IFsStoreOrderOfflineScrmService fsStoreOrderOfflineService;
+    @Autowired
+    private IFsStoreOrderOfflineItemScrmService fsStoreOrderOfflineItemService;
+    @Autowired
+    private ICrmCustomerService crmCustomerService;
+
+    @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 = SecurityUtils.getLoginUser();
+        FsStoreOrderOfflineScrm fsStoreOrderOffline = new FsStoreOrderOfflineScrm();
+        fsStoreOrderOffline.setOrderId(orderId);
+        fsStoreOrderOffline.setStatus(3L);
+        fsStoreOrderOffline.setAuditBy(loginUser.getCompanyUser().getNickName());
+        fsStoreOrderOffline.setAuditTime(new Date());
+        if (fsStoreOrderOfflineService.updateFsStoreOrderOffline(fsStoreOrderOffline) > 0){
+            return R.ok();
+        }
+        return R.error("审核失败");
+    }
+}

+ 141 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreOrderPromotionScrmBridgeController.java

@@ -0,0 +1,141 @@
+package com.fs.admin.controller.store;
+
+import com.alibaba.fastjson.JSONObject;
+import cn.hutool.core.bean.BeanUtil;
+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.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.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 org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 推广订单 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsStoreOrderPromotionScrmController,供平台总后台跨租户管理
+ * 注意:使用 /PromotionOrder 路径避免与 FsStoreOrderScrmBridgeController 的 /storeOrder 路径冲突
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/store/PromotionOrder")
+public class FsStoreOrderPromotionScrmBridgeController extends BaseController
+{
+    @Autowired
+    private IFsStoreOrderScrmService fsStoreOrderService;
+    @Autowired
+    private IFsStoreOrderItemScrmService orderItemService;
+
+    @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, "订单明细数据");
+    }
+}

+ 1062 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreOrderScrmBridgeController.java

@@ -0,0 +1,1062 @@
+package com.fs.admin.controller.store;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.JSON;
+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.domain.entity.SysRole;
+import com.fs.common.core.domain.entity.SysUser;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.CloudHostUtils;
+import com.fs.common.utils.ParseUtils;
+import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.StringUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.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.ErpOrderQueryRequert;
+import com.fs.erp.dto.ErpOrderQueryResponse;
+import com.fs.erp.dto.df.DFConfigVo;
+import com.fs.erp.service.IErpOrderService;
+import com.fs.framework.security.LoginUser;
+import com.fs.framework.security.SecurityUtils;
+import com.fs.framework.service.TokenService;
+import com.fs.his.domain.FsDfAccount;
+import com.fs.his.domain.FsStoreOrderDf;
+import com.fs.his.domain.FsUser;
+import com.fs.his.enums.FsStoreOrderLogEnum;
+import com.fs.his.param.FsStoreOrderSetErpPhoneParam;
+import com.fs.his.service.IFsDfAccountService;
+import com.fs.his.service.IFsExpressService;
+import com.fs.his.service.IFsStoreOrderDfService;
+import com.fs.his.service.IFsUserService;
+import com.fs.his.utils.ConfigUtil;
+import com.fs.his.vo.FsStoreOrderListAndStatisticsVo;
+import com.fs.his.vo.FsStoreOrderListVO;
+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 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.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 org.springframework.context.annotation.Profile;
+
+import javax.servlet.http.HttpServletRequest;
+import java.math.BigDecimal;
+import java.text.ParseException;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * 订单 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsStoreOrderScrmController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/store/storeOrder")
+public class FsStoreOrderScrmBridgeController 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 CloudHostProper cloudHostProper;
+    @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;
+    @Autowired
+    private TokenService tokenService;
+    @Autowired
+    SysConfigMapper sysConfigMapper;
+    @Autowired
+    private IFsDfAccountService fsDfAccountService;
+    @Autowired
+    private IFsStoreOrderDfService fsStoreOrderDfService;
+    @Autowired
+    private IFsStoreOrderLogsScrmService fsStoreOrderLogsService;
+    @Autowired
+    private ISysRoleService sysRoleService;
+
+    private IErpOrderService getErpService()
+    {
+        IErpOrderService erpOrderService = null;
+        FsErpConfig erpConfig = configUtil.getErpConfig();
+        Integer erpOpen = erpConfig.getErpOpen();
+        if (erpOpen != null && erpOpen == 1) {
+            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')")
+    @PostMapping("/list")
+    public TableDataInfo list(@RequestBody FsStoreOrderParam param)
+    {
+        PageHelper.startPage(param.getPageNum(), param.getPageSize());
+        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);
+        TableDataInfo dataTable = getDataTable(list);
+        if (CloudHostUtils.hasCloudHostName("康年堂")) {
+            dataTable.setMsg("knt");
+        }
+        if (list != null) {
+            LoginUser loginUser = (LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
+            for (FsStoreOrderVO vo : list) {
+                if (vo.getPhone() != null) {
+                    vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+                if (ObjectUtil.isNotEmpty(vo.getUserPhone())) {
+                    vo.setUserPhone(vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+                if (CloudHostUtils.hasCloudHostName("康年堂")) {
+                    FsStoreOrderDf df = fsStoreOrderDfService.selectFsStoreOrderDfByOrderId(vo.getId());
+                    if (df != null) {
+                        vo.setErpAccount(df.getLoginAccount());
+                    }
+                }
+                if ((loginUser.getPermissions().contains("his:storeAfterSales:finance")) || loginUser.getPermissions().contains("*:*:*") && (vo.getCost() != null && vo.getTotalNum() != null)) {
+                    vo.setFPrice(vo.getCost().multiply(BigDecimal.valueOf(vo.getTotalNum())));
+                } else {
+                    vo.setPayPostage(BigDecimal.ZERO);
+                    vo.setCost(BigDecimal.ZERO);
+                    vo.setFPrice(BigDecimal.ZERO);
+                    vo.setPayDelivery(BigDecimal.ZERO);
+                    vo.setBarCode("");
+                    vo.setCateName("");
+                    vo.setBankTransactionId("");
+                }
+            }
+        }
+        FsStoreOrderListAndStatisticsVo vo = new FsStoreOrderListAndStatisticsVo();
+        BeanUtils.copyProperties(dataTable, vo);
+        if (dataTable.getTotal() > 0) {
+            Map<String, BigDecimal> statistics = fsStoreOrderService.selectFsStoreOrderStatistics(param);
+            if (statistics != null && statistics.size() >= 3) {
+                vo.setPayPriceTotal(statistics.get("pay_price").toString());
+                vo.setPayMoneyTotal(statistics.get("pay_money").toString());
+                vo.setPayRemainTotal(statistics.get("pay_remain").toString());
+            } else {
+                vo.setPayPriceTotal("0");
+                vo.setPayMoneyTotal("0");
+                vo.setPayRemainTotal("0");
+            }
+            String productStatistics = fsStoreOrderService.selectFsStoreOrderProductStatistics(param);
+            if (StringUtils.isNotBlank(productStatistics)) {
+                vo.setProductInfo(productStatistics);
+            } else {
+                vo.setProductInfo("");
+            }
+        }
+        return vo;
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:payRemainList')")
+    @GetMapping("/payRemainList")
+    public TableDataInfo payRemainList(FsStoreOrderParam param)
+    {
+        PageHelper.startPage(param.getPageNum(), param.getPageSize());
+        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)
+    @PostMapping("/export")
+    public AjaxResult export(@RequestBody 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<FsStoreOrderErpExportVO> list = fsStoreOrderService.selectFsStoreOrderListVOByExport(param);
+        if (list != null) {
+            SysRole sysRole = isCheckPermission();
+            for (FsStoreOrderErpExportVO vo : list) {
+                if (vo.getPhone() != null && sysRole.getIsCheckPhone() != 1) {
+                    vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+                if (vo.getUserPhone() != null && sysRole.getIsCheckPhone() != 1) {
+                    vo.setUserPhone(vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+                if (vo.getUserAddress() != null && sysRole.getIsCheckAddress() != 1) {
+                    vo.setUserAddress(ParseUtils.parseAddress(vo.getUserAddress()));
+                }
+                String orderItem = orderItemService.selectFsStoreOrderItemByOrderId(vo.getId());
+                vo.setOrderItem(orderItem);
+            }
+        }
+        String filter = param.getFilter();
+        ArrayList<String> filterList = new ArrayList<>();
+        if (StringUtils.isNotBlank(filter)) {
+            String[] filterArr = filter.split("\\s*,\\s*");
+            filterList.addAll(Arrays.asList(filterArr));
+        }
+        ExcelUtil<FsStoreOrderErpExportVO> util = new ExcelUtil<FsStoreOrderErpExportVO>(FsStoreOrderErpExportVO.class);
+        if (filter != null && !filter.isEmpty()) {
+            return util.exportExcelSelectedColumns(list, "订单数据", filterList);
+        } else {
+            return util.exportExcel(list, "订单数据");
+        }
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:export:details')")
+    @Log(title = "订单", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportDetails")
+    public AjaxResult exportDetails(@RequestBody 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<FsStoreOrderErpExportVO> list = fsStoreOrderService.selectFsStoreOrderListVOByExport(param);
+        String filter = param.getFilter();
+        ArrayList<String> filterList = new ArrayList<>();
+        if (StringUtils.isNotBlank(filter)) {
+            String[] filterArr = filter.split("\\s*,\\s*");
+            filterList.addAll(Arrays.asList(filterArr));
+        }
+        ExcelUtil<FsStoreOrderErpExportVO> util = new ExcelUtil<FsStoreOrderErpExportVO>(FsStoreOrderErpExportVO.class);
+        if (filter != null && !filter.isEmpty()) {
+            return util.exportExcelSelectedColumns(list, "订单数据", filterList);
+        } else {
+            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) {
+            SysRole sysRole = isCheckPermission();
+            LoginUser loginUser = (LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
+            for (FsStoreOrderItemExportVO vo : list) {
+                if (vo.getUserPhone() != null && sysRole.getIsCheckPhone() != 1) {
+                    String phone = vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{1})", "$1****$2");
+                    vo.setUserPhone(phone);
+                }
+                if (vo.getUserAddress() != null && sysRole.getIsCheckAddress() != 1) {
+                    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) {
+                    }
+                }
+                if ((loginUser.getPermissions().contains("his:storeAfterSales:finance") || loginUser.getPermissions().contains("*:*:*")) && !Objects.isNull(vo.getCost())) {
+                    vo.setFPrice(vo.getCost().multiply(BigDecimal.valueOf(vo.getTotalNum())));
+                } else {
+                    vo.setPayPostage(BigDecimal.ZERO);
+                    vo.setCost(BigDecimal.ZERO);
+                    vo.setFPrice(BigDecimal.ZERO);
+                    vo.setBarCode("");
+                    vo.setCateName("");
+                    vo.setBankTransactionId("");
+                }
+            }
+        }
+        ExcelUtil<FsStoreOrderItemExportVO> util = new ExcelUtil<FsStoreOrderItemExportVO>(FsStoreOrderItemExportVO.class);
+        return util.exportExcel(list, "订单明细数据");
+    }
+
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:exportItems:details')")
+    @Log(title = "订单明细导出", businessType = BusinessType.EXPORT)
+    @GetMapping("/exportItemsDetails")
+    public AjaxResult exportItemsDetails(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 ("北京卓美".equals(com.fs.config.saas.ProjectConfig.getFromDB(sysConfigMapper).getCloudHost().getCompanyName())) {
+            List<FsStoreOrderItemExportZMVO> zmvoList = list.stream()
+                    .map(vo -> {
+                        FsStoreOrderItemExportZMVO zmvo = new FsStoreOrderItemExportZMVO();
+                        try {
+                            BeanUtil.copyProperties(vo, zmvo);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        return zmvo;
+                    })
+                    .collect(Collectors.toList());
+            if (zmvoList != null) {
+                LoginUser loginUser = (LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
+                for (FsStoreOrderItemExportZMVO vo : zmvoList) {
+                    if (!StringUtils.isEmpty(vo.getJsonInfo())) {
+                        try {
+                            StoreOrderProductDTO orderProductDTO = JSONObject.parseObject(vo.getJsonInfo(), StoreOrderProductDTO.class);
+                            BeanUtil.copyProperties(orderProductDTO, vo);
+                        } catch (Exception e) {
+                        }
+                    }
+                    if ((loginUser.getPermissions().contains("his:storeAfterSales:finance") || loginUser.getPermissions().contains("*:*:*")) && !Objects.isNull(vo.getCost())) {
+                        vo.setFPrice(vo.getCost().multiply(BigDecimal.valueOf(vo.getTotalNum())));
+                    } else {
+                        vo.setPayPostage(BigDecimal.ZERO);
+                        vo.setCost(BigDecimal.ZERO);
+                        vo.setFPrice(BigDecimal.ZERO);
+                        vo.setBarCode("");
+                        vo.setCateName("");
+                        vo.setBankTransactionId("");
+                    }
+                }
+            }
+            ExcelUtil<FsStoreOrderItemExportZMVO> util = new ExcelUtil<FsStoreOrderItemExportZMVO>(FsStoreOrderItemExportZMVO.class);
+            return util.exportExcel(zmvoList, "订单明细数据");
+        }
+        if (list != null) {
+            LoginUser loginUser = (LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
+            for (FsStoreOrderItemExportVO vo : list) {
+                if (!StringUtils.isEmpty(vo.getJsonInfo())) {
+                    try {
+                        StoreOrderProductDTO orderProductDTO = JSONObject.parseObject(vo.getJsonInfo(), StoreOrderProductDTO.class);
+                        BeanUtil.copyProperties(orderProductDTO, vo);
+                    } catch (Exception e) {
+                    }
+                }
+                if ((loginUser.getPermissions().contains("his:storeAfterSales:finance") || loginUser.getPermissions().contains("*:*:*")) && !Objects.isNull(vo.getCost())) {
+                    vo.setFPrice(vo.getCost().multiply(BigDecimal.valueOf(vo.getTotalNum())));
+                } else {
+                    vo.setPayPostage(BigDecimal.ZERO);
+                    vo.setCost(BigDecimal.ZERO);
+                    vo.setFPrice(BigDecimal.ZERO);
+                    vo.setBarCode("");
+                    vo.setCateName("");
+                    vo.setBankTransactionId("");
+                }
+            }
+        }
+        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()) || order.getDeliverySn().equals(ShipperCodeEnum.ZTO.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));
+    }
+
+    @Log(title = "修改订单itemJson", businessType = BusinessType.UPDATE)
+    @GetMapping("/updateStoreOrderItemJson/{orderId}/{backendEditProductType}")
+    public AjaxResult updateStoreOrderItemJson(@PathVariable("orderId") Long orderId, @PathVariable("backendEditProductType") Integer backendEditProductType)
+    {
+        return toAjax(fsStoreOrderService.updateStoreOrderItemJson(orderId, backendEditProductType));
+    }
+
+    @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.getScrmOrder(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.getScrmOrder(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)
+    {
+        PageHelper.startPage(param.getPageNum(), param.getPageSize());
+        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());
+    }
+
+    @GetMapping("/orderDimensionStatisticsList")
+    public TableDataInfo orderDimensionStatisticsList(OrderStatisticsParam param)
+    {
+        if ("广州郑多燕".equals(cloudHostProper.getCompanyName())) {
+            return getDataTable(fsStoreOrderService.selectZDYOrderSaleStatisticsList(param));
+        }
+        return getDataTable(fsStoreOrderService.selectOrderDimensionStatisticsList(param));
+    }
+
+    @Log(title = "订单维度统计", businessType = BusinessType.EXPORT)
+    @GetMapping("/orderDimensionStatisticsExport")
+    public AjaxResult orderDimensionStatisticsExport(OrderStatisticsParam param)
+    {
+        List<OrderStatisticsVo> list = fsStoreOrderService.selectOrderDimensionStatisticsList(param);
+        ExcelUtil<OrderStatisticsVo> util = new ExcelUtil<>(OrderStatisticsVo.class);
+        return util.exportExcel(list, "订单员工维度统计");
+    }
+
+    @GetMapping(value = "/queryErpPhone")
+    public AjaxResult queryErpPhone()
+    {
+        SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("erp.phone");
+        List<String> list = new ArrayList<>();
+        if (sysConfig != null) {
+            String configValue = sysConfig.getConfigValue();
+            if (StringUtils.isNotEmpty(configValue)) {
+                list = JSON.parseArray(configValue, String.class);
+            }
+        }
+        return AjaxResult.success(list);
+    }
+
+    @PostMapping(value = "/saveErpPhone")
+    public AjaxResult saveErpPhone(@RequestBody List<String> phoneList)
+    {
+        phoneList = phoneList.stream().distinct().collect(Collectors.toList());
+        SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("erp.phone");
+        sysConfig.setConfigValue(JSON.toJSONString(phoneList));
+        return AjaxResult.success(sysConfigMapper.updateConfig(sysConfig));
+    }
+
+    @PreAuthorize("@ss.hasPermi('his:storeOrder:createErpOrder')")
+    @Log(title = "订单", businessType = BusinessType.UPDATE)
+    @PostMapping("/editErpPhone")
+    public AjaxResult editErpPhone(@RequestBody FsStoreOrderScrmSetErpPhoneParam param)
+    {
+        param.setOpeName(SecurityUtils.getLoginUser().getUser().getNickName());
+        List<String> erpPhone = param.getErpPhone();
+        if (erpPhone == null || erpPhone.isEmpty()) {
+            return AjaxResult.error("请选择手机号");
+        }
+        return toAjax(fsStoreOrderService.batchUpdateErpByOrderIds(param));
+    }
+
+    @GetMapping("/getErpAccount")
+    public R getErpAccount()
+    {
+        List<String> list = new ArrayList<>();
+        if (CloudHostUtils.hasCloudHostName("金牛明医", "康年堂")) {
+            List<FsDfAccount> erpAccounts = fsDfAccountService.selectFsDfAccountList(null);
+            list = erpAccounts.stream().map(FsDfAccount::getLoginAccount).collect(Collectors.toList());
+        }
+        return R.ok().put("data", list);
+    }
+
+    @Log(title = "手动推管易", businessType = BusinessType.INSERT)
+    @ApiOperation("批量创建ERP订单")
+    @PreAuthorize("@ss.hasPermi('his:storeOrder:createErpOrder')")
+    @PostMapping(value = "/batchCreateErpOrder")
+    public R batchCreateErpOrder(@RequestBody FsStoreOrderScrmSetErpPhoneParam param)
+    {
+        String nickName = SecurityUtils.getLoginUser().getUser().getNickName();
+        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 (!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);
+            orderIds = list.stream().map(FsStoreOrderVO::getId).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) {
+                    df.setParcelQuantity(param.getParcelQuantity());
+                    fsStoreOrderDfService.insertFsStoreOrderDf(df);
+                    fsStoreOrderLogsService.create(orderId, FsStoreOrderLogEnum.SET_PUSH_ACCOUNT.getValue(),
+                            nickName + " " + FsStoreOrderLogEnum.SET_PUSH_ACCOUNT.getDesc() + ":" + df.getLoginAccount());
+                }
+                fsStoreOrderService.createOmsOrder(orderId);
+                fsStoreOrderLogsService.create(orderId, FsStoreOrderLogEnum.PUSH_ORDER_ERP.getValue(),
+                        nickName + " " + FsStoreOrderLogEnum.PUSH_ORDER_ERP.getDesc() + ":" + df.getLoginAccount());
+            } catch (ParseException e) {
+                throw new RuntimeException(e);
+            }
+        });
+        return R.ok();
+    }
+
+    @ApiOperation("批量设置订单账户")
+    @PreAuthorize("@ss.hasPermi('his:storeOrder:createErpOrder')")
+    @PostMapping(value = "/batchSetErpOrder")
+    public R batchSetErpOrder(@RequestBody FsStoreOrderScrmSetErpPhoneParam param)
+    {
+        String nickName = SecurityUtils.getLoginUser().getUser().getNickName();
+        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 (!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);
+            orderIds = list.stream().map(FsStoreOrderVO::getId).collect(Collectors.toList());
+        }
+        if (orderIds.isEmpty()) {
+            return R.ok();
+        }
+        orderIds.forEach(orderId -> {
+            df.setOrderId(orderId);
+            FsStoreOrderDf temp = fsStoreOrderDfService.selectFsStoreOrderDfByOrderId(df.getOrderId());
+            df.setParcelQuantity(param.getParcelQuantity());
+            if (temp != null) {
+                df.setUpdateTime(new Date());
+                fsStoreOrderDfService.updateFsStoreOrderDf(df);
+            } else {
+                fsStoreOrderDfService.insertFsStoreOrderDf(df);
+            }
+            fsStoreOrderLogsService.create(orderId, FsStoreOrderLogEnum.SET_PUSH_ACCOUNT.getValue(),
+                    nickName + " " + FsStoreOrderLogEnum.SET_PUSH_ACCOUNT.getDesc() + ":" + df.getLoginAccount());
+        });
+        return R.ok();
+    }
+
+    @ApiOperation("批量审核订单")
+    @Log(title = "订单管理", businessType = BusinessType.UPDATE)
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:batchAudit')")
+    @PostMapping("/batchAudit")
+    public R batchAuditOrder(@Validated @RequestBody FsStoreOrderBatchAuditParam param)
+    {
+        if (param.getOrderIds() == null || param.getOrderIds().isEmpty()) {
+            return R.error("订单ID列表不能为空");
+        }
+        if (param.getIsAudit() == null) {
+            return R.error("审核状态不能为空");
+        }
+        int count = fsStoreOrderService.batchAuditOrder(param);
+        return R.ok("成功审核 " + count + " 条订单");
+    }
+
+    @ApiOperation("订单备注")
+    @Log(title = "订单管理", businessType = BusinessType.UPDATE)
+    @PreAuthorize("@ss.hasPermi('store:storeOrder:remark')")
+    @PostMapping("/remark")
+    public R remark(@Validated @RequestBody FsStoreOrderScrm param)
+    {
+        if (param.getId() == null || param.getId() < 1) {
+            return R.error("订单ID错误");
+        }
+        if (StringUtils.isEmpty(param.getOrderRemark())) {
+            return R.error("订单备注不能为空");
+        }
+        return fsStoreOrderService.orderRemark(param);
+    }
+
+    private SysRole isCheckPermission()
+    {
+        SysRole sysRole = new SysRole();
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        boolean flag = user.isAdmin();
+        if (flag) {
+            sysRole.setIsCheckPhone(1);
+            sysRole.setIsCheckAddress(1);
+        } else {
+            List<SysRole> roles = user.getRoles();
+            if (roles != null && !roles.isEmpty()) {
+                Long[] roleIds = roles.stream().map(SysRole::getRoleId).toArray(Long[]::new);
+                return sysRoleService.getIsCheckPermission(roleIds);
+            }
+        }
+        return sysRole;
+    }
+
+    private FsStoreOrderDf getDFInfo(String loginAccount)
+    {
+        List<FsDfAccount> erpAccounts = fsDfAccountService.selectFsDfAccountList(null);
+        FsStoreOrderDf df = new FsStoreOrderDf();
+        for (FsDfAccount erpAccount : erpAccounts) {
+            if (loginAccount.equals(erpAccount.getLoginAccount())) {
+                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;
+    }
+}

+ 82 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreOrderStatusScrmBridgeController.java

@@ -0,0 +1,82 @@
+package com.fs.admin.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.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 org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 订单操作记录 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsStoreOrderStatusScrmController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/store/storeOrderStatus")
+public class FsStoreOrderStatusScrmBridgeController 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));
+    }
+}

+ 82 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreProductAttrScrmBridgeController.java

@@ -0,0 +1,82 @@
+package com.fs.admin.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.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 org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 商品属性 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsStoreProductAttrScrmController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/store/storeProductAttr")
+public class FsStoreProductAttrScrmBridgeController 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));
+    }
+}

+ 82 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreProductAttrValueScrmBridgeController.java

@@ -0,0 +1,82 @@
+package com.fs.admin.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.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 org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 商品属性值 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsStoreProductAttrValueScrmController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/store/storeProductAttrValue")
+public class FsStoreProductAttrValueScrmBridgeController 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));
+    }
+}

+ 82 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreProductCategoryScrmBridgeController.java

@@ -0,0 +1,82 @@
+package com.fs.admin.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+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 org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 商品分类 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsStoreProductCategoryScrmController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2022-03-16
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/store/storeProductCategory")
+public class FsStoreProductCategoryScrmBridgeController extends BaseController
+{
+    @Autowired
+    private IFsStoreProductCategoryScrmService fsStoreProductCategoryService;
+
+    @PreAuthorize("@ss.hasPermi('store:storeProductCategory:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreProductCategoryScrm fsStoreProductCategory)
+    {
+        startPage();
+        List<FsStoreProductCategoryScrm> list = fsStoreProductCategoryService.selectFsStoreProductCategoryList(fsStoreProductCategory);
+        return getDataTable(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, "商品分类");
+    }
+
+    @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));
+    }
+}

+ 82 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreProductDetailsScrmBridgeController.java

@@ -0,0 +1,82 @@
+package com.fs.admin.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.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 org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 商品详情 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsStoreProductDetailsScrmController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/store/storeProductDetails")
+public class FsStoreProductDetailsScrmBridgeController 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));
+    }
+}

+ 117 - 0
fs-agent/src/main/java/com/fs/admin/controller/store/FsStoreProductGroupScrmBridgeController.java

@@ -0,0 +1,117 @@
+package com.fs.admin.controller.store;
+
+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 org.springframework.context.annotation.Profile;
+
+import java.util.List;
+
+/**
+ * 商品组合 Bridge Controller (fs-admin端)
+ * 桥接 hisStore.FsStoreProductGroupScrmController,供平台总后台跨租户管理
+ *
+ * @author fs
+ * @date 2022-11-23
+ */
+@Profile("admin")
+@RestController
+@RequestMapping("/store/store/storeProductGroup")
+public class FsStoreProductGroupScrmBridgeController 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));
+    }
+}

Некоторые файлы не были показаны из-за большого количества измененных файлов