Bläddra i källkod

Merge remote-tracking branch 'origin/master'

ct 1 månad sedan
förälder
incheckning
3b3ff02c24
59 ändrade filer med 705 tillägg och 521 borttagningar
  1. 1 1
      docs/user-app更改.md
  2. 1 1
      docs/user-app模块SaaS改造说明.md
  3. 3 7
      fs-ad-api/src/main/java/com/fs/framework/config/DataSourceConfig.java
  4. 3 7
      fs-ad-new-api/src/main/java/com/fs/framework/config/DataSourceConfig.java
  5. 21 0
      fs-common/src/main/java/com/fs/common/annotation/TenantDataScope.java
  6. 0 2
      fs-common/src/main/java/com/fs/common/enums/DataSourceType.java
  7. 6 0
      fs-common/src/main/java/com/fs/common/enums/TenantIdType.java
  8. 2 7
      fs-company-app/src/main/java/com/fs/core/config/DataSourceConfig.java
  9. 3 7
      fs-company/src/main/java/com/fs/framework/config/DataSourceConfig.java
  10. 3 7
      fs-framework/src/main/java/com/fs/framework/config/DataSourceConfig.java
  11. 1 0
      fs-ipad-task/src/main/java/com/fs/FsIpadTaskApplication.java
  12. 100 30
      fs-ipad-task/src/main/java/com/fs/app/task/SendMsg.java
  13. 175 0
      fs-ipad-task/src/main/java/com/fs/framework/aspectj/TenantDataSourceAspect.java
  14. 3 7
      fs-ipad-task/src/main/java/com/fs/framework/config/DataSourceConfig.java
  15. 102 0
      fs-ipad-task/src/main/java/com/fs/framework/datasource/TenantDataSourceManager.java
  16. 2 5
      fs-ipad-task/src/main/resources/application.yml
  17. 3 7
      fs-live-app/src/main/java/com/fs/framework/config/DataSourceConfig.java
  18. 3 7
      fs-qw-api-msg/src/main/java/com/fs/framework/config/DataSourceConfig.java
  19. 3 7
      fs-qw-api/src/main/java/com/fs/framework/config/DataSourceConfig.java
  20. 3 7
      fs-qw-task/src/main/java/com/fs/framework/config/DataSourceConfig.java
  21. 1 1
      fs-qw-voice/src/main/java/com/fs/app/controller/VoiceController.java
  22. 1 1
      fs-qw-voice/src/main/java/com/fs/app/mq/RocketMQConsumerService.java
  23. 3 3
      fs-qw-voice/src/main/java/com/fs/app/task/Task.java
  24. 3 7
      fs-qw-voice/src/main/java/com/fs/framework/config/DataSourceConfig.java
  25. 3 7
      fs-qwhook-msg/src/main/java/com/fs/framework/config/DataSourceConfig.java
  26. 3 7
      fs-qwhook-sop/src/main/java/com/fs/framework/config/DataSourceConfig.java
  27. 3 7
      fs-qwhook/src/main/java/com/fs/framework/config/DataSourceConfig.java
  28. 3 7
      fs-redis/src/main/java/com/fs/framework/config/DataSourceConfig.java
  29. 1 1
      fs-service/src/main/java/com/fs/course/mapper/FsUserCourseMapper.java
  30. 52 52
      fs-service/src/main/java/com/fs/sop/mapper/QwSopLogsMapper.java
  31. 38 39
      fs-service/src/main/java/com/fs/sop/mapper/QwSopMapper.java
  32. 0 1
      fs-service/src/main/java/com/fs/sop/mapper/QwSopTagLogsMapper.java
  33. 0 1
      fs-service/src/main/java/com/fs/sop/mapper/QwSopTagMapper.java
  34. 0 1
      fs-service/src/main/java/com/fs/sop/mapper/QwSopTempContentMapper.java
  35. 0 1
      fs-service/src/main/java/com/fs/sop/mapper/QwSopTempDayMapper.java
  36. 0 1
      fs-service/src/main/java/com/fs/sop/mapper/QwSopTempMapper.java
  37. 2 3
      fs-service/src/main/java/com/fs/sop/mapper/QwSopTempRulesMapper.java
  38. 2 3
      fs-service/src/main/java/com/fs/sop/mapper/QwSopTempVoiceMapper.java
  39. 41 41
      fs-service/src/main/java/com/fs/sop/mapper/SopUserLogsInfoMapper.java
  40. 47 48
      fs-service/src/main/java/com/fs/sop/mapper/SopUserLogsMapper.java
  41. 0 1
      fs-service/src/main/java/com/fs/sop/mapper/SopUserLogsWxMapper.java
  42. 0 1
      fs-service/src/main/java/com/fs/sop/service/IQwSopTempContentService.java
  43. 0 1
      fs-service/src/main/java/com/fs/sop/service/IQwSopTempRulesService.java
  44. 1 1
      fs-service/src/main/java/com/fs/sop/service/impl/QwSopLogsServiceImpl.java
  45. 3 3
      fs-service/src/main/java/com/fs/sop/service/impl/QwSopServiceImpl.java
  46. 8 8
      fs-service/src/main/java/com/fs/sop/service/impl/QwSopTempContentServiceImpl.java
  47. 14 15
      fs-service/src/main/java/com/fs/sop/service/impl/QwSopTempDayServiceImpl.java
  48. 11 11
      fs-service/src/main/java/com/fs/sop/service/impl/QwSopTempRulesServiceImpl.java
  49. 4 4
      fs-service/src/main/java/com/fs/sop/service/impl/QwSopTempServiceImpl.java
  50. 6 6
      fs-service/src/main/java/com/fs/sop/service/impl/QwSopTempVoiceServiceImpl.java
  51. 2 3
      fs-service/src/main/java/com/fs/sop/service/impl/SopUserLogsWxServiceImpl.java
  52. 1 1
      fs-service/src/main/java/com/fs/statis/mapper/FsStatisSalerWatchMapper.java
  53. 2 2
      fs-service/src/main/java/com/fs/statis/mapper/FsStatisTempParamMapper.java
  54. 0 49
      fs-service/src/main/resources/application-dev-test.yml
  55. 1 51
      fs-service/src/main/resources/application-dev.yml
  56. 3 7
      fs-user-app/src/main/java/com/fs/framework/config/DataSourceConfig.java
  57. 2 2
      fs-user-app/src/main/java/com/fs/framework/config/DruidConfig.java
  58. 3 7
      fs-watch/src/main/java/com/fs/framework/config/DataSourceConfig.java
  59. 3 7
      fs-wx-api/src/main/java/com/fs/framework/config/DataSourceConfig.java

+ 1 - 1
docs/user-app更改.md

@@ -17,7 +17,7 @@
   ```java
   targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
   targetDataSources.put(DataSourceType.SLAVE.name(), slaveDataSource);
-  targetDataSources.put(DataSourceType.SOP.name(), sopDataSource);
+  
   ```
 - **原因**:`DynamicDataSourceContextHolder.setDataSourceType()` 传的是字符串(如 `"MASTER"`),以前 `targetDataSources` 用的是 `DataSourceType.MASTER`(枚举),两者不相等,后面做动态切库会出问题,所以先把 key 统一成字符串。
 

+ 1 - 1
docs/user-app模块SaaS改造说明.md

@@ -54,7 +54,7 @@ Controller / Service / Mapper
 // 使用字符串 key(MASTER/SLAVE),与 DynamicDataSourceContextHolder 中 setDataSourceType 保持一致
 targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
 targetDataSources.put(DataSourceType.SLAVE.name(), slaveDataSource);
-targetDataSources.put(DataSourceType.SOP.name(), sopDataSource);
+
 ```
 
 **效果**:  

+ 3 - 7
fs-ad-api/src/main/java/com/fs/framework/config/DataSourceConfig.java

@@ -22,11 +22,7 @@ import java.util.Map;
 @Configuration
 public class DataSourceConfig {
 
-    @Bean
-    @ConfigurationProperties(prefix = "spring.datasource.sop.druid.master")
-    public DataSource sopDataSource() {
-        return new DruidDataSource();
-    }
+    
 
     @Bean
     @ConfigurationProperties(prefix = "spring.datasource.mysql.druid.master")
@@ -38,9 +34,9 @@ public class DataSourceConfig {
 
     @Bean
     @Primary
-    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource, @Qualifier("sopDataSource") DataSource sopDataSource) {
+    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource) {
         Map<Object, Object> targetDataSources = new HashMap<>();
-        targetDataSources.put(DataSourceType.SOP.name(), sopDataSource);
+        
         return new DynamicDataSource(masterDataSource, targetDataSources);
     }
 

+ 3 - 7
fs-ad-new-api/src/main/java/com/fs/framework/config/DataSourceConfig.java

@@ -22,11 +22,7 @@ import java.util.Map;
 @Configuration
 public class DataSourceConfig {
 
-    @Bean
-    @ConfigurationProperties(prefix = "spring.datasource.sop.druid.master")
-    public DataSource sopDataSource() {
-        return new DruidDataSource();
-    }
+    
 
     @Bean
     @ConfigurationProperties(prefix = "spring.datasource.mysql.druid.master")
@@ -38,9 +34,9 @@ public class DataSourceConfig {
 
     @Bean
     @Primary
-    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource, @Qualifier("sopDataSource") DataSource sopDataSource) {
+    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource) {
         Map<Object, Object> targetDataSources = new HashMap<>();
-        targetDataSources.put(DataSourceType.SOP.name(), sopDataSource);
+        
         return new DynamicDataSource(masterDataSource, targetDataSources);
     }
 

+ 21 - 0
fs-common/src/main/java/com/fs/common/annotation/TenantDataScope.java

@@ -0,0 +1,21 @@
+package com.fs.common.annotation;
+
+import com.fs.common.enums.TenantIdType;
+
+import java.lang.annotation.*;
+
+/**
+ * 数据权限过滤注解
+ * 
+
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface TenantDataScope
+{
+    /**
+     * 部门表的别名
+     */
+    TenantIdType type() default TenantIdType.YML;
+}

+ 0 - 2
fs-common/src/main/java/com/fs/common/enums/DataSourceType.java

@@ -13,8 +13,6 @@ public enum DataSourceType
     MASTER,
 
     CLICKHOUSE,
-
-    SOP,
     /**
      * 从库
      */

+ 6 - 0
fs-common/src/main/java/com/fs/common/enums/TenantIdType.java

@@ -0,0 +1,6 @@
+package com.fs.common.enums;
+
+public enum TenantIdType {
+    YML,
+    REQUEST
+}

+ 2 - 7
fs-company-app/src/main/java/com/fs/core/config/DataSourceConfig.java

@@ -23,11 +23,7 @@ import java.util.Map;
 @Configuration
 public class DataSourceConfig {
 
-    @Bean
-    @ConfigurationProperties(prefix = "spring.datasource.sop.druid.master")
-    public DataSource sopDataSource() {
-        return new DruidDataSource();
-    }
+    
 
     @Bean
     @ConfigurationProperties(prefix = "spring.datasource.mysql.druid.master")
@@ -39,10 +35,9 @@ public class DataSourceConfig {
 
     @Bean
     @Primary
-    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource, @Qualifier("sopDataSource") DataSource sopDataSource) {
+    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource) {
         Map<Object, Object> targetDataSources = new HashMap<>();
         targetDataSources.put(DataSourceType.MASTER, masterDataSource);
-        targetDataSources.put(DataSourceType.SOP.name(), sopDataSource);
         return new DynamicDataSource(masterDataSource, targetDataSources);
     }
 

+ 3 - 7
fs-company/src/main/java/com/fs/framework/config/DataSourceConfig.java

@@ -22,11 +22,7 @@ import java.util.Map;
 @Configuration
 public class DataSourceConfig {
 
-    @Bean
-    @ConfigurationProperties(prefix = "spring.datasource.sop.druid.master")
-    public DataSource sopDataSource() {
-        return new DruidDataSource();
-    }
+    
 
     @Bean
     @ConfigurationProperties(prefix = "spring.datasource.mysql.druid.master")
@@ -38,10 +34,10 @@ public class DataSourceConfig {
 
     @Bean
     @Primary
-    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource, @Qualifier("sopDataSource") DataSource sopDataSource) {
+    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource) {
         Map<Object, Object> targetDataSources = new HashMap<>();
         targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
-        targetDataSources.put(DataSourceType.SOP.name(), sopDataSource);
+        
         return new DynamicDataSource(masterDataSource, targetDataSources);
     }
 

+ 3 - 7
fs-framework/src/main/java/com/fs/framework/config/DataSourceConfig.java

@@ -21,11 +21,7 @@ import java.util.Map;
 
 @Configuration
 public class DataSourceConfig {
-    @Bean
-    @ConfigurationProperties(prefix = "spring.datasource.sop.druid.master")
-    public DataSource sopDataSource() {
-        return new DruidDataSource();
-    }
+    
 
     @Bean
     @ConfigurationProperties(prefix = "spring.datasource.mysql.druid.master")
@@ -41,10 +37,10 @@ public class DataSourceConfig {
 
     @Bean
     @Primary
-    public DynamicDataSource dataSource(@Qualifier("clickhouseDataSource") DataSource clickhouseDataSource,@Qualifier("masterDataSource") DataSource masterDataSource, @Qualifier("sopDataSource") DataSource sopDataSource) {
+    public DynamicDataSource dataSource(@Qualifier("clickhouseDataSource") DataSource clickhouseDataSource,@Qualifier("masterDataSource") DataSource masterDataSource) {
         Map<Object, Object> targetDataSources = new HashMap<>();
         targetDataSources.put(DataSourceType.MASTER, masterDataSource);
-        targetDataSources.put(DataSourceType.SOP.name(), sopDataSource);
+        
         targetDataSources.put(DataSourceType.CLICKHOUSE.name(), clickhouseDataSource);
         return new DynamicDataSource(masterDataSource, targetDataSources);
     }

+ 1 - 0
fs-ipad-task/src/main/java/com/fs/FsIpadTaskApplication.java

@@ -3,6 +3,7 @@ package com.fs;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
 import org.springframework.scheduling.annotation.EnableAsync;
 import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.transaction.annotation.EnableTransactionManagement;

+ 100 - 30
fs-ipad-task/src/main/java/com/fs/app/task/SendMsg.java

@@ -5,13 +5,14 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.fs.app.service.IpadSendServer;
+import com.fs.common.annotation.TenantDataScope;
 import com.fs.common.core.redis.RedisCacheT;
 import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.PubFun;
-import com.fs.company.service.ICompanyMiniappService;
 import com.fs.course.config.CourseConfig;
 import com.fs.course.domain.FsCoursePlaySourceConfig;
 import com.fs.course.service.IFsCoursePlaySourceConfigService;
+import com.fs.framework.aspectj.TenantDataSourceAspect;
 import com.fs.ipad.vo.BaseVo;
 import com.fs.qw.domain.QwIpadServer;
 import com.fs.qw.domain.QwPushCount;
@@ -45,6 +46,7 @@ import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ThreadLocalRandom;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.stream.Collectors;
 
 @Component
@@ -59,21 +61,46 @@ public class SendMsg {
     private final QwIpadServerMapper qwIpadServerMapper;
     private final RedisCacheT<Long> redisCache;
     private final AsyncSopTestService asyncSopTestService;
-    private final ICompanyMiniappService companyMiniappService;
     private final IFsCoursePlaySourceConfigService fsCoursePlaySourceConfigService;
     private final QwPushCountMapper qwPushCountMapper;
     private final QwRestrictionPushRecordMapper qwRestrictionPushRecordMapper;
+    private final TenantDataSourceAspect tenantDataSourceAspect;
 
     @Value("${group-no}")
     private String groupNo;
+    @Value("${tenant-id}")
+    private Long tenantId;
     private final List<QwUser> qwUserList = Collections.synchronizedList(new ArrayList<>());
-    private final Map<Long, Long> qwMap = new ConcurrentHashMap<>();
+    private final Map<Long, TaskContext> qwMap = new ConcurrentHashMap<>();
+    private static final long TASK_TIMEOUT_MS = 3 * 60 * 1000L;
+
+    private static class TaskContext {
+        final long startTime;
+        final AtomicBoolean cancelled;
+
+        TaskContext() {
+            this.startTime = System.currentTimeMillis();
+            this.cancelled = new AtomicBoolean(false);
+        }
+
+        boolean isTimeout() {
+            return System.currentTimeMillis() - startTime > TASK_TIMEOUT_MS;
+        }
+
+        void cancel() {
+            cancelled.set(true);
+        }
+
+        boolean isCancelled() {
+            return cancelled.get();
+        }
+    }
 
     @Autowired
     @Qualifier("customThreadPool")
     private ThreadPoolTaskExecutor customThreadPool;
 
-    public SendMsg(QwUserMapper qwUserMapper, QwSopLogsMapper qwSopLogsMapper, IpadSendServer sendServer, SysConfigMapper sysConfigMapper, IQwSopLogsService qwSopLogsService, QwIpadServerMapper qwIpadServerMapper, RedisCacheT<Long> redisCache, AsyncSopTestService asyncSopTestService, ICompanyMiniappService companyMiniappService, IFsCoursePlaySourceConfigService fsCoursePlaySourceConfigService, QwPushCountMapper qwPushCountMapper, QwRestrictionPushRecordMapper qwRestrictionPushRecordMapper) {
+    public SendMsg(QwUserMapper qwUserMapper, QwSopLogsMapper qwSopLogsMapper, IpadSendServer sendServer, SysConfigMapper sysConfigMapper, IQwSopLogsService qwSopLogsService, QwIpadServerMapper qwIpadServerMapper, RedisCacheT<Long> redisCache, AsyncSopTestService asyncSopTestService, IFsCoursePlaySourceConfigService fsCoursePlaySourceConfigService, QwPushCountMapper qwPushCountMapper, QwRestrictionPushRecordMapper qwRestrictionPushRecordMapper, TenantDataSourceAspect tenantDataSourceAspect) {
         this.qwUserMapper = qwUserMapper;
         this.qwSopLogsMapper = qwSopLogsMapper;
         this.sendServer = sendServer;
@@ -82,10 +109,10 @@ public class SendMsg {
         this.qwIpadServerMapper = qwIpadServerMapper;
         this.redisCache = redisCache;
         this.asyncSopTestService = asyncSopTestService;
-        this.companyMiniappService = companyMiniappService;
         this.fsCoursePlaySourceConfigService = fsCoursePlaySourceConfigService;
         this.qwPushCountMapper = qwPushCountMapper;
         this.qwRestrictionPushRecordMapper = qwRestrictionPushRecordMapper;
+        this.tenantDataSourceAspect = tenantDataSourceAspect;
     }
     private List<QwUser> getQwUserList() {
         if (qwUserList.isEmpty()) {
@@ -104,16 +131,16 @@ public class SendMsg {
 
     private Map<String, FsCoursePlaySourceConfig> getMiniMap() {
         List<FsCoursePlaySourceConfig> list = fsCoursePlaySourceConfigService.list(new QueryWrapper<FsCoursePlaySourceConfig>().ne("type", 2).eq("is_del", 0));
-//        log.info("获取到的小程序配置:{}", JSON.toJSONString(list));
-//        log.info("获取到的小程序配置:{}", JSON.toJSONString(list));
         return PubFun.listToMapByGroupObject(list, FsCoursePlaySourceConfig::getAppid);
     }
 
 
-    @Scheduled(fixedRate = 50000) // 每50秒执行一次
+//    @Scheduled(fixedRate = 50000) // 每50秒执行一次
     public void refulsQwUserList() {
         qwUserList.clear();
     }
+
+    @TenantDataScope
     @Scheduled(fixedDelay = 20000) // 每20秒执行一次
     public void sendMsg2() {
         log.info("执行日志:{}", LocalDateTime.now());
@@ -129,8 +156,8 @@ public class SendMsg {
         int delayEnd;
         if (config.getDelayStart() == null || config.getDelayEnd() == null) {
             log.debug("消息发送延迟为空手动设置1000ms - 2000ms");
-            delayStart = 1000;
-            delayEnd = 2000;
+            delayStart = 500;
+            delayEnd = 1000;
         } else {
             delayStart = config.getDelayStart();
             delayEnd = config.getDelayEnd();
@@ -139,23 +166,40 @@ public class SendMsg {
         Map<String, FsCoursePlaySourceConfig> miniMap = getMiniMap();
         // 获取 pad 发送的企微
         getQwUserList().forEach(e -> {
-            // 如果没有值就执行后面的方法 并且入值
-            qwMap.computeIfAbsent(e.getId(), k -> {
-                // 线程启动
-                CompletableFuture.runAsync(() -> {
-                    try {
-                        log.info("开始任务:{}", e.getQwUserName());
-                        // 开始任务
-                        processUser(e, delayStart, delayEnd, miniMap);
-                    } catch (Exception exception) {
-                        log.error("发送错误:", exception);
-                    } finally {
-                        log.info("删除任务:{}", e.getQwUserName());
-                        qwMap.remove(e.getId());
-//                        removeQwMap.putIfAbsent(e.getId(), System.currentTimeMillis());
-                    }
-                }, customThreadPool);
-                return System.currentTimeMillis(); // 占位值
+            TaskContext ctx = qwMap.get(e.getId());
+            if (ctx != null) {
+                if (ctx.isTimeout()) {
+                    log.warn("任务超时,标记取消:{}, 已运行: {}ms", e.getQwUserName(), System.currentTimeMillis() - ctx.startTime);
+                    ctx.cancel();
+                } else {
+                    log.debug("任务正在执行中,跳过:{}", e.getQwUserName());
+                    return;
+                }
+            }
+            if (customThreadPool.getActiveCount() >= customThreadPool.getMaxPoolSize()) {
+                log.warn("线程池已满,跳过任务:{}, 活跃线程: {}/{}", e.getQwUserName(), customThreadPool.getActiveCount(), customThreadPool.getMaxPoolSize());
+                return;
+            }
+            TaskContext newCtx = new TaskContext();
+            qwMap.put(e.getId(), newCtx);
+            CompletableFuture.runAsync(() -> {
+                try {
+                    log.info("开始任务:{}", e.getQwUserName());
+                    // 手动切换数据源到配置的租户
+                    tenantDataSourceAspect.switchTenant(tenantId);
+                    processUser(e, delayStart, delayEnd, miniMap, newCtx);
+                } catch (Exception exception) {
+                    log.error("发送错误:", exception);
+                } finally {
+                    log.info("删除任务:{}", e.getQwUserName());
+                    // 清理数据源
+                    tenantDataSourceAspect.clear();
+                    qwMap.remove(e.getId());
+                }
+            }, customThreadPool).exceptionally(ex -> {
+                log.error("任务提交失败:{}, 错误: {}", e.getQwUserName(), ex.getMessage());
+                qwMap.remove(e.getId());
+                return null;
             });
         });
     }
@@ -166,8 +210,9 @@ public class SendMsg {
      * @param delayStart 随机延迟 最小值
      * @param delayEnd   随机延迟 最大值
      * @param miniMap    小程序配置
+     * @param ctx        任务上下文(用于取消检查)
      */
-    private void processUser(QwUser qwUser, int delayStart, int delayEnd, Map<String, FsCoursePlaySourceConfig> miniMap) {
+    private void processUser(QwUser qwUser, int delayStart, int delayEnd, Map<String, FsCoursePlaySourceConfig> miniMap, TaskContext ctx) {
         long start1 = System.currentTimeMillis();
         // 获取当前企微待发送记录
         List<QwSopLogs> qwSopLogList = qwSopLogsMapper.selectByQwUserId(qwUser.getId());
@@ -180,15 +225,25 @@ public class SendMsg {
         BaseVo parentVo = new BaseVo();
         parentVo.setCorpCode(qwUser.getCorpId());
         long end1 = System.currentTimeMillis();
+        // 检查是否被取消
+        if (ctx.isCancelled()) {
+            log.info("任务被取消,退出:{}", qwUser.getQwUserName());
+            return;
+        }
         // 判断这个企微是否需要发送
         if (!sendServer.isSend(user, parentVo)) {
             log.info("当前这个企微不需要发送 数据{}",user);
             return;
         }
-        log.info("销售:{}, 消息:{}, 耗时: {}, 时间:{}", user.getQwUserName(), qwSopLogList.size(), end1 - start1, qwMap.get(qwUser.getId()));
+        log.info("销售:{}, 消息:{}, 耗时: {}, 时间:{}", user.getQwUserName(), qwSopLogList.size(), end1 - start1, ctx.startTime);
         long start3 = System.currentTimeMillis();
         // 循环代发送消息
         for (QwSopLogs qwSopLogs : qwSopLogList) {
+            // 检查是否被取消
+            if (ctx.isCancelled()) {
+                log.info("任务被取消,中断发送:{}, 已发送部分消息", qwUser.getQwUserName());
+                return;
+            }
             long start2 = System.currentTimeMillis();
             QwSopCourseFinishTempSetting setting = JSON.parseObject(qwSopLogs.getContentJson(), QwSopCourseFinishTempSetting.class);
             //直播的sendType:20单独走判断 其他的走以前的逻辑
@@ -200,7 +255,7 @@ public class SendMsg {
                 }
             }
             else{
-                // 判断消息状态是否满足发送条件
+                // 判断消息状态是否满足发isSendLogs送条件
                 if (!sendServer.isSendLogs(qwSopLogs, setting, user)) {
                     log.info("销售:{}, 消息发送条件未满足:{}", user.getQwUserName(), qwSopLogs.getId());
                     continue;
@@ -219,6 +274,11 @@ public class SendMsg {
             Map<Integer, List<QwPushCount>> pushMap = pushCountList.stream().collect(Collectors.groupingBy(QwPushCount::getType));
             // 循环发送消息里面的每一条消息
             for (QwSopCourseFinishTempSetting.Setting content : setting.getSetting()) {
+                // 检查是否被取消
+                if (ctx.isCancelled()) {
+                    log.info("任务被取消,中断发送:{}", qwUser.getQwUserName());
+                    return;
+                }
                 long start4 = System.currentTimeMillis();
                 //判断当前销售推送客户消息限制
                 Long qwUserId = qwUser.getId();//销售的Id
@@ -270,11 +330,16 @@ public class SendMsg {
                         return;
                     }
                     try {
+                        if (ctx.isCancelled()) {
+                            return;
+                        }
                         int delay = ThreadLocalRandom.current().nextInt(300, 1000);
                         log.debug("pad发送消息等待:{}ms", delay);
                         Thread.sleep(delay);
                     } catch (InterruptedException e) {
                         log.error("线程等待错误!");
+                        Thread.currentThread().interrupt();
+                        return;
                     }
                 }
             }
@@ -330,11 +395,16 @@ public class SendMsg {
             int i = qwSopLogsService.updateQwSopLogsSendType(updateQwSop);
             log.info("销售:{}, 修改条数{}, 发送方消息完成:{}, 耗时: {}", user.getQwUserName(), i, qwSopLogs.getId(), end2 - start2);
             try {
+                if (ctx.isCancelled()) {
+                    return;
+                }
                 int delay = ThreadLocalRandom.current().nextInt(delayStart, delayEnd);
                 log.debug("企微发送消息等待:{}ms", delay);
                 Thread.sleep(delay);
             } catch (InterruptedException e) {
                 log.error("线程等待错误!");
+                Thread.currentThread().interrupt();
+                return;
             }
         }
         long end3 = System.currentTimeMillis();

+ 175 - 0
fs-ipad-task/src/main/java/com/fs/framework/aspectj/TenantDataSourceAspect.java

@@ -0,0 +1,175 @@
+package com.fs.framework.aspectj;
+
+import com.alibaba.druid.pool.DruidDataSource;
+import com.fs.common.annotation.TenantDataScope;
+import com.fs.common.core.redis.RedisCacheT;
+import com.fs.common.enums.TenantIdType;
+import com.fs.common.utils.StringUtils;
+import com.fs.framework.datasource.DynamicDataSource;
+import com.fs.framework.datasource.DynamicDataSourceContextHolder;
+import com.fs.tenant.domain.TenantInfo;
+import com.fs.tenant.mapper.TenantInfoMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.core.annotation.AnnotationUtils;
+import org.springframework.core.annotation.Order;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import javax.sql.DataSource;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.Map;
+import java.util.Objects;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * 多数据源处理
+ *
+ */
+@Slf4j
+@Aspect
+@Order(1)
+@Component
+public class TenantDataSourceAspect {
+    private static final String TENANT_KEY = "tenant:info:";
+    @Resource
+    private DynamicDataSource dynamicDataSource;
+    @Value("${tenant-id}")
+    private Long ymlTenantId;
+    @Autowired
+    private TenantInfoMapper tenantInfoMapper;
+    @Autowired
+    private RedisCacheT<TenantInfo> redis;
+    /**
+     * 租户数据源缓存
+     */
+    private static final Map<String, DataSource> TENANT_DS_CACHE = new ConcurrentHashMap<>();
+
+    @Pointcut("@annotation(com.fs.common.annotation.TenantDataScope)"
+            + "|| @within(com.fs.common.annotation.TenantDataScope)")
+    public void dsPointCut() {
+
+    }
+
+    @Around("dsPointCut()")
+    public Object around(ProceedingJoinPoint point) throws Throwable {
+        MethodSignature signature = (MethodSignature) point.getSignature();
+        Method targetMethod = signature.getMethod(); // 拿到目标方法对象
+        log.info("执行方法:{}", targetMethod.getName());
+        TenantDataScope dataSource = getDataSource(point);
+        TenantIdType type = dataSource.type();
+        Long tenantId = 0L;
+        if(type.equals(TenantIdType.YML)){
+            tenantId = ymlTenantId;
+        }
+        if(type.equals(TenantIdType.REQUEST)){
+
+        }
+        switchTenant(tenantId);
+        try {
+            return point.proceed();
+        } finally {
+            // 销毁数据源 在执行方法之后
+            DynamicDataSourceContextHolder.clearDataSourceType();
+        }
+    }
+
+    public void switchTenant(Long id) {
+        TenantInfo tenantInfo = redis.getCacheObject(TENANT_KEY + id);
+        if(tenantInfo == null){
+            tenantInfo = tenantInfoMapper.selectById(id);
+            redis.setCacheObject(TENANT_KEY + id, tenantInfo);
+        }
+        // 用租户主键作为唯一标识
+        String tenantKey = buildTenantKey(tenantInfo.getId());
+
+        if (!TENANT_DS_CACHE.containsKey(tenantKey)) {
+            synchronized (this) {
+                if (!TENANT_DS_CACHE.containsKey(tenantKey)) {
+
+                    javax.sql.DataSource tenantDs = createTenantDataSource(tenantInfo);
+                    TENANT_DS_CACHE.put(tenantKey, tenantDs);
+
+                    // 动态追加到已解析的数据源
+                    Map<Object, DataSource> resolvedMap = getResolvedDataSources();
+                    resolvedMap.put(tenantKey, tenantDs);
+                }
+            }
+        }
+
+        // ThreadLocal 切库
+        DynamicDataSourceContextHolder.setDataSourceType(tenantKey);
+    }
+
+    private String buildTenantKey(Long tenantId) {
+        return "tenant:" + tenantId;
+    }
+
+
+
+    /**
+     * 清理 ThreadLocal
+     */
+    public void clear() {
+        DynamicDataSourceContextHolder.clearDataSourceType();
+    }
+
+    /**
+     * 创建租户数据源(MySQL + Druid)
+     */
+    private DataSource createTenantDataSource(TenantInfo tenant) {
+
+        DruidDataSource ds = new DruidDataSource();
+        ds.setUrl(tenant.getDbUrl());
+        ds.setUsername(tenant.getDbAccount());
+        ds.setPassword(tenant.getDbPwd());
+
+        // 统一 MySQL
+        ds.setDriverClassName("com.mysql.cj.jdbc.Driver");
+
+        ds.setInitialSize(5);
+        ds.setMinIdle(10);
+        ds.setMaxActive(20);
+        ds.setMaxWait(60000);
+
+        return ds;
+    }
+
+    /**
+     * 反射获取 AbstractRoutingDataSource.resolvedDataSources
+     */
+    @SuppressWarnings("unchecked")
+    private Map<Object, DataSource> getResolvedDataSources() {
+        try {
+            Field field = org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
+                    .class.getDeclaredField("resolvedDataSources");
+            field.setAccessible(true);
+            return (Map<Object, DataSource>) field.get(dynamicDataSource);
+        } catch (Exception e) {
+            throw new IllegalStateException("获取 resolvedDataSources 失败", e);
+        }
+    }
+
+    /**
+     * 获取需要切换的数据源
+     */
+    public TenantDataScope getDataSource(ProceedingJoinPoint point) {
+        MethodSignature signature = (MethodSignature) point.getSignature();
+        TenantDataScope dataSource = AnnotationUtils.findAnnotation(signature.getMethod(), TenantDataScope.class);
+        if (Objects.nonNull(dataSource)) {
+            return dataSource;
+        }
+
+        return AnnotationUtils.findAnnotation(signature.getDeclaringType(), TenantDataScope.class);
+    }
+}

+ 3 - 7
fs-ipad-task/src/main/java/com/fs/framework/config/DataSourceConfig.java

@@ -21,11 +21,7 @@ import java.util.Map;
 
 @Configuration
 public class DataSourceConfig {
-    @Bean
-    @ConfigurationProperties(prefix = "spring.datasource.sop.druid.master")
-    public DataSource sopDataSource() {
-        return new DruidDataSource();
-    }
+    
 
     @Bean
     @ConfigurationProperties(prefix = "spring.datasource.sop.druid.read")
@@ -57,7 +53,7 @@ public class DataSourceConfig {
     @Primary
     public DynamicDataSource dataSource(@Qualifier("clickhouseDataSource") DataSource clickhouseDataSource,
                                         @Qualifier("masterDataSource") DataSource masterDataSource,
-                                        @Qualifier("sopDataSource") DataSource sopDataSource,
+                                        
                                         @Qualifier("slaveDataSource") DataSource slaveDataSource,
                                         @Qualifier("sopReadDataSource") DataSource sopReadDataSource
                                         ) {
@@ -65,7 +61,7 @@ public class DataSourceConfig {
         targetDataSources.put(DataSourceType.MASTER, masterDataSource);
 
         targetDataSources.put(DataSourceType.SLAVE.name(), slaveDataSource);
-        targetDataSources.put(DataSourceType.SOP.name(), sopDataSource);
+        
         targetDataSources.put(DataSourceType.SopREAD.name(), sopReadDataSource);
         targetDataSources.put(DataSourceType.CLICKHOUSE.name(), clickhouseDataSource); // Ensure matching key
         return new DynamicDataSource(masterDataSource, targetDataSources);

+ 102 - 0
fs-ipad-task/src/main/java/com/fs/framework/datasource/TenantDataSourceManager.java

@@ -0,0 +1,102 @@
+package com.fs.framework.datasource;
+
+import com.alibaba.druid.pool.DruidDataSource;
+import com.fs.tenant.domain.TenantInfo;
+import com.fs.tenant.mapper.TenantInfoMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import javax.sql.DataSource;
+import java.lang.reflect.Field;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+@Component
+public class TenantDataSourceManager {
+
+    @Resource
+    private DynamicDataSource dynamicDataSource;
+    @Autowired
+    private TenantInfoMapper tenantInfoMapper;
+
+    /**
+     * 租户数据源缓存
+     */
+    private static final Map<String, DataSource> TENANT_DS_CACHE = new ConcurrentHashMap<>();
+
+    /**
+     * 切换到租户数据源(不存在则创建)
+     */
+    public void switchTenant(Long id) {
+        TenantInfo tenantInfo = tenantInfoMapper.selectById(id);
+        // 用租户主键作为唯一标识
+        String tenantKey = buildTenantKey(tenantInfo.getId());
+
+        if (!TENANT_DS_CACHE.containsKey(tenantKey)) {
+            synchronized (this) {
+                if (!TENANT_DS_CACHE.containsKey(tenantKey)) {
+
+                    DataSource tenantDs = createTenantDataSource(tenantInfo);
+                    TENANT_DS_CACHE.put(tenantKey, tenantDs);
+
+                    // 动态追加到已解析的数据源
+                    Map<Object, DataSource> resolvedMap = getResolvedDataSources();
+                    resolvedMap.put(tenantKey, tenantDs);
+                }
+            }
+        }
+
+        // ThreadLocal 切库
+        DynamicDataSourceContextHolder.setDataSourceType(tenantKey);
+    }
+
+    private String buildTenantKey(Long tenantId) {
+        return "tenant:" + tenantId;
+    }
+
+
+
+    /**
+     * 清理 ThreadLocal
+     */
+    public void clear() {
+        DynamicDataSourceContextHolder.clearDataSourceType();
+    }
+
+    /**
+     * 创建租户数据源(MySQL + Druid)
+     */
+    private DataSource createTenantDataSource(TenantInfo tenant) {
+
+        DruidDataSource ds = new DruidDataSource();
+        ds.setUrl(tenant.getDbUrl());
+        ds.setUsername(tenant.getDbAccount());
+        ds.setPassword(tenant.getDbPwd());
+
+        // 统一 MySQL
+        ds.setDriverClassName("com.mysql.cj.jdbc.Driver");
+
+        ds.setInitialSize(5);
+        ds.setMinIdle(10);
+        ds.setMaxActive(20);
+        ds.setMaxWait(60000);
+
+        return ds;
+    }
+
+    /**
+     * 反射获取 AbstractRoutingDataSource.resolvedDataSources
+     */
+    @SuppressWarnings("unchecked")
+    private Map<Object, DataSource> getResolvedDataSources() {
+        try {
+            Field field = org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
+                    .class.getDeclaredField("resolvedDataSources");
+            field.setAccessible(true);
+            return (Map<Object, DataSource>) field.get(dynamicDataSource);
+        } catch (Exception e) {
+            throw new IllegalStateException("获取 resolvedDataSources 失败", e);
+        }
+    }
+}

+ 2 - 5
fs-ipad-task/src/main/resources/application.yml

@@ -5,8 +5,5 @@ server:
 spring:
   profiles:
     active: dev
-#    active: druid-hdt
-#    active: druid-yzt
-#    active: druid-sxjz
-#    active: druid-sft
-group-no: 2
+group-no: 1
+tenant-id: 11

+ 3 - 7
fs-live-app/src/main/java/com/fs/framework/config/DataSourceConfig.java

@@ -22,11 +22,7 @@ import java.util.Map;
 @Configuration
 public class DataSourceConfig {
 
-    @Bean
-    @ConfigurationProperties(prefix = "spring.datasource.sop.druid.master")
-    public DataSource sopDataSource() {
-        return new DruidDataSource();
-    }
+    
 
     @Bean
     @ConfigurationProperties(prefix = "spring.datasource.mysql.druid.master")
@@ -38,9 +34,9 @@ public class DataSourceConfig {
 
     @Bean
     @Primary
-    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource, @Qualifier("sopDataSource") DataSource sopDataSource) {
+    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource) {
         Map<Object, Object> targetDataSources = new HashMap<>();
-        targetDataSources.put(DataSourceType.SOP.name(), sopDataSource);
+        
         return new DynamicDataSource(masterDataSource, targetDataSources);
     }
     /**

+ 3 - 7
fs-qw-api-msg/src/main/java/com/fs/framework/config/DataSourceConfig.java

@@ -21,11 +21,7 @@ import java.util.Map;
 
 @Configuration
 public class DataSourceConfig {
-    @Bean
-    @ConfigurationProperties(prefix = "spring.datasource.sop.druid.master")
-    public DataSource sopDataSource() {
-        return new DruidDataSource();
-    }
+    
     @Bean
     @ConfigurationProperties(prefix = "spring.datasource.clickhouse")
     public DataSource clickhouseDataSource() {
@@ -50,13 +46,13 @@ public class DataSourceConfig {
     @Primary
     public DynamicDataSource dataSource(@Qualifier("clickhouseDataSource") DataSource clickhouseDataSource,
                                         @Qualifier("masterDataSource") DataSource masterDataSource,
-                                        @Qualifier("sopDataSource") DataSource sopDataSource,
+                                        
                                         @Qualifier("slaveDataSource") DataSource slaveDataSource) {
         Map<Object, Object> targetDataSources = new HashMap<>();
         targetDataSources.put(DataSourceType.MASTER, masterDataSource);
 
         targetDataSources.put(DataSourceType.SLAVE, slaveDataSource);
-        targetDataSources.put(DataSourceType.SOP.name(), sopDataSource);
+        
         targetDataSources.put(DataSourceType.CLICKHOUSE.name(), clickhouseDataSource); // Ensure matching key
         return new DynamicDataSource(masterDataSource, targetDataSources);
     }

+ 3 - 7
fs-qw-api/src/main/java/com/fs/framework/config/DataSourceConfig.java

@@ -22,11 +22,7 @@ import java.util.Map;
 @Configuration
 public class DataSourceConfig {
 
-    @Bean
-    @ConfigurationProperties(prefix = "spring.datasource.sop.druid.master")
-    public DataSource sopDataSource() {
-        return new DruidDataSource();
-    }
+    
 
     @Bean
     @ConfigurationProperties(prefix = "spring.datasource.mysql.druid.master")
@@ -38,10 +34,10 @@ public class DataSourceConfig {
 
     @Bean
     @Primary
-    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource, @Qualifier("sopDataSource") DataSource sopDataSource) {
+    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource) {
         Map<Object, Object> targetDataSources = new HashMap<>();
         targetDataSources.put(DataSourceType.MASTER, masterDataSource);
-        targetDataSources.put(DataSourceType.SOP.name(), sopDataSource);
+        
         return new DynamicDataSource(masterDataSource, targetDataSources);
     }
 

+ 3 - 7
fs-qw-task/src/main/java/com/fs/framework/config/DataSourceConfig.java

@@ -22,11 +22,7 @@ import java.util.Map;
 @Configuration
 public class DataSourceConfig {
 
-    @Bean
-    @ConfigurationProperties(prefix = "spring.datasource.sop.druid.master")
-    public DataSource sopDataSource() {
-        return new DruidDataSource();
-    }
+    
 
     @Bean
     @ConfigurationProperties(prefix = "spring.datasource.mysql.druid.master")
@@ -38,10 +34,10 @@ public class DataSourceConfig {
 
     @Bean
     @Primary
-    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource, @Qualifier("sopDataSource") DataSource sopDataSource) {
+    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource) {
         Map<Object, Object> targetDataSources = new HashMap<>();
         targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
-        targetDataSources.put(DataSourceType.SOP.name(), sopDataSource);
+        
         return new DynamicDataSource(masterDataSource, targetDataSources);
     }
 

+ 1 - 1
fs-qw-voice/src/main/java/com/fs/app/controller/VoiceController.java

@@ -46,7 +46,7 @@ public class VoiceController {
 //    private final QwSopMapper qwSopMapper;
 //
 //    @GetMapping("/synchronousTemp")
-//    @DataSource(DataSourceType.SOP)
+//    
 //    public void synchronousTemp(Long dayId){
 //        QwSopTempDay day = qwSopTempDayService.getById(dayId);
 //        List<QwSopTempContent> contents = qwSopTempContentMapper.listByTempAndDay(day.getTempId(), dayId);

+ 1 - 1
fs-qw-voice/src/main/java/com/fs/app/mq/RocketMQConsumerService.java

@@ -38,7 +38,7 @@ public class RocketMQConsumerService implements RocketMQListener<String> {
     private final IQwSopService qwSopService;
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public void onMessage(String message) {
         log.info("消息队列接收到消息:{}",  message);
         VoiceVo vo = JSON.parseObject(message, VoiceVo.class);

+ 3 - 3
fs-qw-voice/src/main/java/com/fs/app/task/Task.java

@@ -37,7 +37,7 @@ public class Task {
     public final static String VOICE_CACHE_KEY = "voice:cache:";
 
     @Scheduled(cron = "0 * * * * *")
-    @DataSource(DataSourceType.SOP)
+    
     public void scheduled() {
         List<VoiceVo> list = redisCache.getCacheListByPattern(VOICE_CACHE_KEY + "*");
         if (list.isEmpty()) return;
@@ -52,14 +52,14 @@ public class Task {
     }
 
 
-    @DataSource(DataSourceType.SOP)
+    
     public void synchronousTemp(Long dayId) {
         QwSopTempDay day = qwSopTempDayService.getById(dayId);
         List<QwSopTempContent> contents = qwSopTempContentMapper.listByTempAndDay(day.getTempId(), dayId);
         qwSopTempVoiceService.synchronousTemp(contents, day);
     }
 
-    @DataSource(DataSourceType.SOP)
+    
     public void synchronousSop(String sopId) {
         QwSop qwSop = qwSopMapper.selectQwSopById(sopId);
         QwSopTagsParam qwSopTagsParam = new QwSopTagsParam();

+ 3 - 7
fs-qw-voice/src/main/java/com/fs/framework/config/DataSourceConfig.java

@@ -21,11 +21,7 @@ import java.util.Map;
 
 @Configuration
 public class DataSourceConfig {
-    @Bean
-    @ConfigurationProperties(prefix = "spring.datasource.sop.druid.master")
-    public DataSource sopDataSource() {
-        return new DruidDataSource();
-    }
+    
 
     @Bean
     @ConfigurationProperties(prefix = "spring.datasource.mysql.druid.master")
@@ -44,13 +40,13 @@ public class DataSourceConfig {
     @Bean
     @Primary
     public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource,
-                                        @Qualifier("sopDataSource") DataSource sopDataSource,
+                                        
                                         @Qualifier("slaveDataSource") DataSource slaveDataSource) {
         Map<Object, Object> targetDataSources = new HashMap<>();
         targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
 
         targetDataSources.put(DataSourceType.SLAVE.name(), slaveDataSource);
-        targetDataSources.put(DataSourceType.SOP.name(), sopDataSource);
+        
         return new DynamicDataSource(masterDataSource, targetDataSources);
     }
 

+ 3 - 7
fs-qwhook-msg/src/main/java/com/fs/framework/config/DataSourceConfig.java

@@ -22,11 +22,7 @@ import java.util.Map;
 @Configuration
 public class DataSourceConfig {
 
-    @Bean
-    @ConfigurationProperties(prefix = "spring.datasource.sop.druid.master")
-    public DataSource sopDataSource() {
-        return new DruidDataSource();
-    }
+    
 
     @Bean
     @ConfigurationProperties(prefix = "spring.datasource.mysql.druid.master")
@@ -38,9 +34,9 @@ public class DataSourceConfig {
 
     @Bean
     @Primary
-    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource, @Qualifier("sopDataSource") DataSource sopDataSource) {
+    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource) {
         Map<Object, Object> targetDataSources = new HashMap<>();
-        targetDataSources.put(DataSourceType.SOP.name(), sopDataSource);
+        
         return new DynamicDataSource(masterDataSource, targetDataSources);
     }
     /**

+ 3 - 7
fs-qwhook-sop/src/main/java/com/fs/framework/config/DataSourceConfig.java

@@ -22,11 +22,7 @@ import java.util.Map;
 @Configuration
 public class DataSourceConfig {
 
-    @Bean
-    @ConfigurationProperties(prefix = "spring.datasource.sop.druid.master")
-    public DataSource sopDataSource() {
-        return new DruidDataSource();
-    }
+    
 
     @Bean
     @ConfigurationProperties(prefix = "spring.datasource.mysql.druid.master")
@@ -38,10 +34,10 @@ public class DataSourceConfig {
 
     @Bean
     @Primary
-    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource, @Qualifier("sopDataSource") DataSource sopDataSource) {
+    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource) {
         Map<Object, Object> targetDataSources = new HashMap<>();
         targetDataSources.put(DataSourceType.MASTER, masterDataSource);
-        targetDataSources.put(DataSourceType.SOP.name(), sopDataSource);
+        
         return new DynamicDataSource(masterDataSource, targetDataSources);
     }
 

+ 3 - 7
fs-qwhook/src/main/java/com/fs/framework/config/DataSourceConfig.java

@@ -22,11 +22,7 @@ import java.util.Map;
 @Configuration
 public class DataSourceConfig {
 
-    @Bean
-    @ConfigurationProperties(prefix = "spring.datasource.sop.druid.master")
-    public DataSource sopDataSource() {
-        return new DruidDataSource();
-    }
+    
 
     @Bean
     @ConfigurationProperties(prefix = "spring.datasource.mysql.druid.master")
@@ -38,10 +34,10 @@ public class DataSourceConfig {
 
     @Bean
     @Primary
-    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource, @Qualifier("sopDataSource") DataSource sopDataSource) {
+    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource) {
         Map<Object, Object> targetDataSources = new HashMap<>();
         targetDataSources.put(DataSourceType.MASTER, masterDataSource);
-        targetDataSources.put(DataSourceType.SOP.name(), sopDataSource);
+        
         return new DynamicDataSource(masterDataSource, targetDataSources);
     }
     /**

+ 3 - 7
fs-redis/src/main/java/com/fs/framework/config/DataSourceConfig.java

@@ -23,11 +23,7 @@ import java.util.Map;
 public class DataSourceConfig {
 
 
-    @Bean
-    @ConfigurationProperties(prefix = "spring.datasource.sop.druid.master")
-    public DataSource sopDataSource() {
-        return new DruidDataSource();
-    }
+    
 
     @Bean
     @ConfigurationProperties(prefix = "spring.datasource.mysql.druid.master")
@@ -39,9 +35,9 @@ public class DataSourceConfig {
 
     @Bean
     @Primary
-    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource, @Qualifier("sopDataSource") DataSource sopDataSource) {
+    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource) {
         Map<Object, Object> targetDataSources = new HashMap<>();
-        targetDataSources.put(DataSourceType.SOP.name(), sopDataSource);
+        
         return new DynamicDataSource(masterDataSource, targetDataSources);
     }
     /**

+ 1 - 1
fs-service/src/main/java/com/fs/course/mapper/FsUserCourseMapper.java

@@ -294,7 +294,7 @@ public interface FsUserCourseMapper
             "</script> ")
     List<FsCourseListBySidebarVO> getFsCourseListBySidebarFilterCourseId(@Param("courseIds")  List<Long> courseIds);
 
-    @DataSource(DataSourceType.SOP)
+    
     @Select(" select  " +
             "l.start_time,\n" +
             "qstd.day_num,\n" +

+ 52 - 52
fs-service/src/main/java/com/fs/sop/mapper/QwSopLogsMapper.java

@@ -2,6 +2,7 @@ package com.fs.sop.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.common.annotation.DataSource;
+import com.fs.common.annotation.TenantDataScope;
 import com.fs.common.enums.DataSourceType;
 import com.fs.qw.domain.QwApiSopLogToken;
 import com.fs.qw.param.SopMsgParam;
@@ -35,7 +36,7 @@ public interface QwSopLogsMapper extends BaseMapper<QwSopLogs> {
      * @param id 企业微信SOP  定时任务主键
      * @return 企业微信SOP  定时任务
      */
-    @DataSource(DataSourceType.SOP)
+    
     public QwSopLogs selectQwSopLogsById(String id);
 
     /**
@@ -44,13 +45,13 @@ public interface QwSopLogsMapper extends BaseMapper<QwSopLogs> {
      * @param qwSopLogs 企业微信SOP  定时任务
      * @return 企业微信SOP  定时任务集合
      */
-    @DataSource(DataSourceType.SOP)
+    
     public List<QwSopLogs> selectQwSopLogsList(QwSopLogs qwSopLogs);
 
     /**
      * 获取单条规则 的 执行记录历史
      */
-    @DataSource(DataSourceType.SOP)
+    
     public List<QwSopLogsListCVO> selectQwSopLogsListByQwSopId(@Param("map") QwSopLogsParam param);
 
 
@@ -68,7 +69,7 @@ public interface QwSopLogsMapper extends BaseMapper<QwSopLogs> {
 //            "</script>")
 //    public CompanyUserVo selectQwSopLogsListByGwSopId(@Param("map") QwSopsListParamByCompanyName param);
 
-    @DataSource(DataSourceType.SOP)
+    
     @Select("<script> " +
         "SELECT\n" +
         "\tqst.* \n" +
@@ -89,7 +90,7 @@ public interface QwSopLogsMapper extends BaseMapper<QwSopLogs> {
      * @param qwSopLogs 企业微信SOP  定时任务
      * @return 结果
      */
-    @DataSource(DataSourceType.SOP)
+    
     public int insertQwSopLogs(@Param("data")QwSopLogs qwSopLogs);
 
 
@@ -99,7 +100,7 @@ public interface QwSopLogsMapper extends BaseMapper<QwSopLogs> {
      * @param qwSopLogs 企业微信SOP  定时任务
      * @return 结果
      */
-    @DataSource(DataSourceType.SOP)
+    
     public int updateQwSopLogs(@Param("data") QwSopLogs qwSopLogs);
 
     /**
@@ -108,7 +109,7 @@ public interface QwSopLogsMapper extends BaseMapper<QwSopLogs> {
      * @param ids 需要删除的数据主键集合
      * @return 结果
      */
-    @DataSource(DataSourceType.SOP)
+    
     public int editCourseQwSopLogs(String[] ids);
 
 
@@ -118,10 +119,10 @@ public interface QwSopLogsMapper extends BaseMapper<QwSopLogs> {
      * @param ids 需要删除的数据主键集合
      * @return 结果
      */
-    @DataSource(DataSourceType.SOP)
+    
     public int deleteQwSopLogsByIds(String[] ids);
 
-    @DataSource(DataSourceType.SOP)
+    
     public int deleteQwSopLogsBySopID(String[] ids);
 
     @DataSource(DataSourceType.MASTER)
@@ -157,7 +158,7 @@ public interface QwSopLogsMapper extends BaseMapper<QwSopLogs> {
 //            "</script>")
 //    List<QwSopLogsListVO> selectSopSendCustomerLogsListVO(@Param("map") QwSopParam qwSopParam);
 
-        @DataSource(DataSourceType.SOP)
+        
         @Select("<script>" +
             "SELECT cc.weixin, cc.mobile,cu.nick_name as userName,qu.qw_user_name, qu.id as qwId,cu.user_id as companyUserId, qecc.external_user_name as externalUserName " +
             "FROM  qw_user qu " +
@@ -193,148 +194,147 @@ public interface QwSopLogsMapper extends BaseMapper<QwSopLogs> {
      * @param id 企业微信SOP  定时任务主键
      * @return 结果
      */
-    @DataSource(DataSourceType.SOP)
+    
     public int deleteQwSopLogsById(String id);
 
 
-    @DataSource(DataSourceType.SOP)
+    
     public List<QwSopLogs> checkQwSopLogs();
 
 
-    @DataSource(DataSourceType.SOP)
+    
     public List<QwSopLogs> createCorpMassSending(@Param("date") String date);
 
-    @DataSource(DataSourceType.SOP)
+    
     public List<QwSopLogs> selectSopLogsByCreateCorpMassSending(@Param("taskStartTime") String taskStartTime,@Param("taskEndTime") String taskEndTime);
 
     /**
     * 为了避免一直轮询无效(发送不了,给不了反馈的)数据,只查与定时的时间过后,之前3天内的的数据反馈
     */
-    @DataSource(DataSourceType.SOP)
+    
     public List<QwSopLogs> qwSopLogsResult();
 
-    @DataSource(DataSourceType.SOP)
+    
     public int updateQwSopLogsByWatchLogType(@Param("id") String id,@Param("remark") String remark);
 
 
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSopLogsDoSendListTVO> selectQwSopLogsDoSendList(@Param("qwUserId") String qwUserId,@Param("corpId") String corpId);
 
-    @DataSource(DataSourceType.SOP)
+    
     int updateQwSopLogsBySendStatus();
 
 
-    @DataSource(DataSourceType.SOP)
+    
     int updateQwSopLogsBycollectIds(@Param("collectIds") List<String> collectIds,@Param("sendStatus") Long sendStatus,@Param("msgId") String msgId);
 
 
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSopLogsDoSendListTVO> getQwSopLogsByJsApiAll(@Param("data") GetQwSopLogsByJsApiParam param);
 
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSopLogsDoSendListTVO> getQwSopLogsByJsApi(@Param("data") GetQwSopLogsByJsApiParam param);
 
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSopLogsDoSendListTVO> getQwSopLogsByJsApiOver(@Param("data") GetQwSopLogsByJsApiParam param);
 
 
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSopLogsDoSendListTVO> getExpiredMessagesByQwSopLogs();
 
 
-    @DataSource(DataSourceType.SOP)
+    
     QwSopLogs getQwSopLogsByJsApiNext(@Param("data") GetQwSopLogsByJsApiParam param);
 
 
-    @DataSource(DataSourceType.SOP)
+    
     public boolean deleteQwSopLogsByJsApi(@Param("data") GetQwSopLogsByJsApiParam param);
 
-    @DataSource(DataSourceType.SOP)
+    
     public boolean deleteQwSopLogsByRemoveSop(@Param("qwUserId") String qwUserId , @Param("corpId") String corpId, @Param("sopId") String sopId);
 
-    @DataSource(DataSourceType.SOP)
+    
     public boolean deleteQwSopLogsByExternalUserIdList(@Param("data") DeleteQwSopParam param);
 
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSopLogs> selectQwSopLogsListVO(SopMsgParam param);
 
-    @DataSource(DataSourceType.SOP)
+    
     void batchInsertQwSopLogs(@Param("qwSopLogs") List<QwSopLogs> logsToInsert);
 
 
-    @DataSource(DataSourceType.SOP)
+    
     void batchInsertQwSopLogsOneTouch(@Param("qwSopLogs") List<QwSopLogs> logsToInsert);
 
-    @DataSource(DataSourceType.SOP)
+    
     void batchUpdateQwSopLogsByTakeRecordsList(@Param("data")List<QwSopLogsDoSendListTVO> listTVOList);
 
-    @DataSource(DataSourceType.SOP)
+    
     void batchUpdateQwSopLogsBySendTime(@Param("data")List<QwSopLogsDoSendListTVO> listTVOList);
 
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSopLogs> selectQwSopLogsByCancel();
 
     //批量更新过期的记录
-    @DataSource(DataSourceType.SOP)
+    
     void batchUpdateQwSopLogsByCancel(@Param("data") List<QwSopLogs> logs);
 
 
-    @DataSource(DataSourceType.SOP)
+    
     void deleteQwSopLogsByDate();
 
-    @DataSource(DataSourceType.SOP)
+    
     void updateQwSopLogsByDayBefore();
 
-    @DataSource(DataSourceType.SOP)
+    
     int updateQwSopLogsByDeleted(@Param("data")GetQwSopLogsByJsApiParam param);
 
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSopLogs> getWxMsgByAccountId(@Param("accountId") long accountId);
 
-    @DataSource(DataSourceType.SOP)
+    
     void batchUpdateStatus(@Param("list") List<QwSopLogs> updateList);
 
-    @DataSource(DataSourceType.SOP)
+    
     void batchUpdateStatusByQwResult(@Param("list") List<QwSopLogs> updateList);
 
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSopLogs> selectSopLogsByCreateCorpMassSendResult();
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSopLogsListCVO> selectQwSopLogsListByChatSopId(@Param("map") QwSopLogsParam param);
-    @DataSource(DataSourceType.SOP)
+    
     String queryPeriodNameById(@Param("periodId") String periodId);
 
-    @DataSource(DataSourceType.SOP)
+    
     @MapKey("id")
     Map<String,QwSopLogs> queryAllPeriod();
 
-    @DataSource(DataSourceType.SOP)
+    
     Long selectQwSopLogsCountByQwUserId(@Param("data") List<String> qwUserIdList,
                                         @Param("periodId") String periodId,
                                         @Param("previousDay") LocalDate previousDay);
 
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSopLogs> selectByQwUserIdIn(@Param("qwUserIds") List<Long> qwUserIds, @Param("startTime") String startTime);
 
-    @DataSource(DataSourceType.SOP)
+    
     void batchUpdateQwSopLogsIpadSendStatus(@Param("ids") List<String> ids);
 
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSopLogs> selectIpadByCorpId(@Param("corpId") String corpId, @Param("now") LocalDateTime now);
 
-    @DataSource(DataSourceType.SOP)
     List<QwSopLogs> selectByQwUserId(@Param("id") Long id);
 
     @Select("select * from qw_sop_logs where send_type=8 and send_status=3 and  create_time <= DATE_SUB(NOW(), INTERVAL 2 HOUR) ")
     List<QwSopLogs> selectExpireAiMsg();
 
-    @DataSource(DataSourceType.SOP)
+    
     void batchUpdateQwSopLogsById(@Param("data") List<QwSopLogs> logs);
 
-    @DataSource(DataSourceType.SOP)
+    
     void batchUpdateQwSopLogsNewUserById(@Param("data")List<QwSopLogs> qwSopLogsList);
 
-    @DataSource(DataSourceType.SOP)
+    
     @Select("<script>" +
             "SELECT\n" +
             "  qw_user_key as qw_user_id,\n" +

+ 38 - 39
fs-service/src/main/java/com/fs/sop/mapper/QwSopMapper.java

@@ -33,7 +33,6 @@ import java.util.Set;
  * @date 2024-07-31
  */
 @Repository
-@DataSource(DataSourceType.SOP)
 public interface QwSopMapper extends BaseMapper<QwSop> {
     /**
      * 查询企微sop
@@ -41,7 +40,7 @@ public interface QwSopMapper extends BaseMapper<QwSop> {
      * @param id 企微sop主键
      * @return 企微sop
      */
-    @DataSource(DataSourceType.SOP)
+    
     public QwSop selectQwSopById(String id);
 
     /**
@@ -65,10 +64,10 @@ public interface QwSopMapper extends BaseMapper<QwSop> {
      * @param qwSop 企微sop
      * @return 企微sop集合
      */
-    @DataSource(DataSourceType.SOP)
+    
     public List<QwSop> selectQwSopList(QwSop qwSop);
 
-    @DataSource(DataSourceType.SOP)
+    
     @Select("<script>" +
             "select * from qw_sop" +
             " where 1=1 " +
@@ -106,7 +105,7 @@ public interface QwSopMapper extends BaseMapper<QwSop> {
      * @param qwSop 企微sop
      * @return 结果
      */
-    @DataSource(DataSourceType.SOP)
+    
     public int insertQwSop(@Param("data") QwSop qwSop);
 
     /**
@@ -115,13 +114,13 @@ public interface QwSopMapper extends BaseMapper<QwSop> {
      * @param qwSop 企微sop
      * @return 结果
      */
-    @DataSource(DataSourceType.SOP)
+    
     public int updateQwSop(@Param("data") QwSop qwSop);
 
-    @DataSource(DataSourceType.SOP)
+    
     public int updateAutoSopTime(@Param("map") QwSopAutoTime param);
 
-    @DataSource(DataSourceType.SOP)
+    
     public int updateSopStatus(@Param("map") QwSopUpdateStatus param);
 
     /**
@@ -130,7 +129,7 @@ public interface QwSopMapper extends BaseMapper<QwSop> {
      * @param id 企微sop主键
      * @return 结果
      */
-    @DataSource(DataSourceType.SOP)
+    
     public int deleteQwSopById(String id);
 
     /**
@@ -139,10 +138,10 @@ public interface QwSopMapper extends BaseMapper<QwSop> {
      * @param ids 需要删除的数据主键集合
      * @return 结果
      */
-    @DataSource(DataSourceType.SOP)
+    
     public int deleteQwSopByIds(String[] ids);
 
-    @DataSource(DataSourceType.SOP)
+    
     public int deleteQwSopByIdsUpdate(@Param("ids") String[] ids);
 
 //    @Select("SELECT * FROM qw_sop " +
@@ -155,7 +154,7 @@ public interface QwSopMapper extends BaseMapper<QwSop> {
 //            "create_time DESC ")
 //    List<QwSopVO> getSopList( @Param("map") QwSopParam QwSopParam);
 
-    @DataSource(DataSourceType.SOP)
+    
     @Select("<script>" +
             "SELECT * FROM qw_sop " +
             "<where> " +
@@ -198,7 +197,7 @@ public interface QwSopMapper extends BaseMapper<QwSop> {
 //            "WHERE\n" +
 //            "\tqs.STATUS = 1 \n" +
 //            "\tAND qs.start_time <= NOW()")
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSopRuleTimeVO> checkSopRuleTime();
 
 
@@ -277,9 +276,9 @@ public interface QwSopMapper extends BaseMapper<QwSop> {
     public List<QwFilterSopCustomersResult> selectFilterQwSopCustomers(@Param("map") QwSopTagsParam qwSopTagsParam);
 
 
-    @DataSource(DataSourceType.SOP)
+    
     public List<QwSopRuleTimeVO> executeSopByIds(@Param("ids") String[] ids);
-    @DataSource(DataSourceType.SOP)
+    
     public List<WxSopRuleTimeVO> executeSopWxByIds(@Param("ids") String[] ids);
 
 //    @Select("<script> " +
@@ -304,11 +303,11 @@ public interface QwSopMapper extends BaseMapper<QwSop> {
 //            "</script>")
 //    public List<QwSopRuleTimeVO> executeSopByIds(String[] ids);
 
-    @DataSource(DataSourceType.SOP)
+    
     public int updateStatusQwSopById(@Param("ids") String[] ids);
 
 
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSop> selectStatusQwSopById(@Param("ids") String[] ids);
 
 
@@ -342,16 +341,16 @@ public interface QwSopMapper extends BaseMapper<QwSop> {
 //            "</script>")
 
 
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSopRuleTimeVO> selectQwSopByQwUserId(@Param("map") QwSopAutoByTags qwSopAutoByTags);
 
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSopRuleTimeVO> selectQwSopAutoByTagsByForeach(@Param("map") QwSopAutoByTags qwSopAutoByTags);
 
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSopRuleTimeVO> selectQwSopAutoByTagsByForeachNotAuto(@Param("map") QwSopAutoByTags qwSopAutoByTags);
 
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSopRuleTimeVO> selectQwSopAutoByTagsByForeachRemoveNotAuto(@Param("map") QwSopAutoByTags qwSopAutoByTags);
 
 //    @Select("SELECT\n" +
@@ -368,46 +367,46 @@ public interface QwSopMapper extends BaseMapper<QwSop> {
 //            "\tqw_sop qs\n" +
 //            "\tLEFT JOIN qw_sop_temp qst ON qs.temp_id = qst.id \n " +
 //            "where qs.id= #{id} ")
-    @DataSource(DataSourceType.SOP)
+    
     QwSopRuleTimeVO selectQwSopByClickHouseId(@Param("id") String id);
 
-    @DataSource(DataSourceType.SOP)
+    
     void updateMinSendStatus(@Param("id") String id);
 
-    @DataSource(DataSourceType.SOP)
+    
     void updateMaxSendStatus(@Param("id") String id);
 
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSop> selectAiChatQwSopList(QwSop qwSop);
 
 
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSop> selectChatQwSopList();
 
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSopRuleTimeVO> selectQwAiSopAutoByTagsByForeach(@Param("map") QwSopAutoByTags qwSopAutoByTags);
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSop> selectByTemplateId(@Param("tempId") String tempId);
 
     List<QwSop> selectWxSop();
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSop> selectQwSopByIsRating();
-    @DataSource(DataSourceType.SOP)
+    
     @Select("select * FROM qw_sop where is_rating = 1 and send_type in(2,3) and min_conversion_day is not null and max_conversion_day is not null order by create_time desc")
     List<QwSop> selectQwSopByIsRatingNotNull();
 
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSop> selectQwSopAllList(GetSOPTaskDataParam param);
 
-    @DataSource(DataSourceType.SOP)
+    
     public List<ChatSopRuleTimeVO> executeSopChatByIds(@Param("ids") String[] ids);
 
-    @DataSource(DataSourceType.SOP)
+    
     public int updateStatusQwSopById2(@Param("ids") List<String> ids);
 
     List<QwSop> selectQwSopByTempId(@Param("tempId") String tempId);
 
-    @DataSource(DataSourceType.SOP)
+    
     @Select("select name from qw_sop where id=#{sopId} limit 1")
     String selectQwSopNameBySopId(@Param("sopId") String sopId);
 
@@ -415,7 +414,7 @@ public interface QwSopMapper extends BaseMapper<QwSop> {
      * 批量更新sop表的chId
      * @param sopList 更新数据
      * **/
-    @DataSource(DataSourceType.SOP)
+    
     void batchUpdateSopChatIdById(@Param("sopList") List<QwSop> sopList);
 
     /**
@@ -423,15 +422,15 @@ public interface QwSopMapper extends BaseMapper<QwSop> {
      * @param ids id
      * @return 结果
      * **/
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSop> getQwSopInfoById(@Param("ids") Set<String> ids);
 
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSop> selectAllQwSopInfo(QwSop qwSop);
 
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSop> selectGroup(@Param("now")LocalDate now);
 
-    @DataSource(DataSourceType.SOP)
+    
     void updateSopGroupIds(@Param("id") String id, @Param("chatId") String chatId);
 }

+ 0 - 1
fs-service/src/main/java/com/fs/sop/mapper/QwSopTagLogsMapper.java

@@ -13,7 +13,6 @@ import java.util.List;
  * @author fs
  * @date 2025-02-20
  */
-@DataSource(DataSourceType.SOP)
 public interface QwSopTagLogsMapper extends BaseMapper<QwSopTagLogs>{
     /**
      * 查询打标签详细

+ 0 - 1
fs-service/src/main/java/com/fs/sop/mapper/QwSopTagMapper.java

@@ -14,7 +14,6 @@ import java.util.List;
  * @author fs
  * @date 2025-02-20
  */
-@DataSource(DataSourceType.SOP)
 public interface QwSopTagMapper extends BaseMapper<QwSopTag>{
     /**
      * 查询sop打标签

+ 0 - 1
fs-service/src/main/java/com/fs/sop/mapper/QwSopTempContentMapper.java

@@ -16,7 +16,6 @@ import java.util.List;
  * @author fs
  * @date 2025-02-06
  */
-@DataSource(DataSourceType.SOP)
 public interface QwSopTempContentMapper extends BaseMapper<QwSopTempContent>{
     /**
      * 查询sop任务模板内容

+ 0 - 1
fs-service/src/main/java/com/fs/sop/mapper/QwSopTempDayMapper.java

@@ -12,7 +12,6 @@ import org.apache.ibatis.annotations.Param;
  * @author fs
  * @date 2025-02-06
  */
-@DataSource(DataSourceType.SOP)
 public interface QwSopTempDayMapper extends BaseMapper<QwSopTempDay>{
 
     QwSopTempDay info(@Param("id") Long id);

+ 0 - 1
fs-service/src/main/java/com/fs/sop/mapper/QwSopTempMapper.java

@@ -15,7 +15,6 @@ import java.util.List;
  * @author fs
  * @date 2024-09-26
  */
-@DataSource(DataSourceType.SOP)
 public interface QwSopTempMapper extends BaseMapper<QwSopTemp> {
     /**
      * 查询sop模板

+ 2 - 3
fs-service/src/main/java/com/fs/sop/mapper/QwSopTempRulesMapper.java

@@ -16,7 +16,6 @@ import java.util.List;
  * @author fs
  * @date 2025-02-06
  */
-@DataSource(DataSourceType.SOP)
 @Repository
 public interface QwSopTempRulesMapper extends BaseMapper<QwSopTempRules> {
     /**
@@ -70,7 +69,7 @@ public interface QwSopTempRulesMapper extends BaseMapper<QwSopTempRules> {
     @Select("select * from qw_sop_temp_rules where day_num is null ")
     List<QwSopTempRules> rulesNull();
 
-    @DataSource(DataSourceType.SOP)
+    
     @Select("<script>" +
             "select tr.* from qw_sop_temp_rules tr " +
             "left join qw_sop_temp st on tr.temp_id=st.id " +
@@ -79,7 +78,7 @@ public interface QwSopTempRulesMapper extends BaseMapper<QwSopTempRules> {
             "</script>")
     List<QwSopTempRules> listByCourseId(@Param("courseId") Long courseId);
 
-    @DataSource(DataSourceType.SOP)
+    
     @Select("<script>" +
             "select tr.* from qw_sop_temp_rules tr " +
             "left join qw_sop_temp st on tr.temp_id=st.id " +

+ 2 - 3
fs-service/src/main/java/com/fs/sop/mapper/QwSopTempVoiceMapper.java

@@ -14,7 +14,6 @@ import java.util.List;
  * @author fs
  * @date 2025-02-13
  */
-@DataSource(DataSourceType.SOP)
 public interface QwSopTempVoiceMapper extends BaseMapper<QwSopTempVoice>{
     /**
      * 查询模板对应的销售语音文件
@@ -84,10 +83,10 @@ public interface QwSopTempVoiceMapper extends BaseMapper<QwSopTempVoice>{
 
     List<QwSopTempVoice> selectQwSopTempVoiceListLimit(QwSopTempVoice sopTempVoice);
 
-    @DataSource(DataSourceType.SOP)
+    
     QwSopTempVoice selectQwSopTempVoiceByIdAndUserVoiceUrl(@Param("id")Long id);
 
-    @DataSource(DataSourceType.SOP)
+    
     List<QwSopTempVoice> selectQwSopTempVoiceNewList(QwSopTempVoice sopTempVoice);
 
 }

+ 41 - 41
fs-service/src/main/java/com/fs/sop/mapper/SopUserLogsInfoMapper.java

@@ -24,7 +24,7 @@ public interface SopUserLogsInfoMapper {
      * @param sopUserLogsInfo 实体对象
      * @return 影响行数
      */
-    @DataSource(DataSourceType.SOP)
+    
     int insertSopUserLogsInfo(SopUserLogsInfo sopUserLogsInfo);
 
     /**
@@ -32,7 +32,7 @@ public interface SopUserLogsInfoMapper {
      * @param sopUserLogsInfo 实体对象
      * @return 影响行数
      */
-    @DataSource(DataSourceType.SOP)
+    
     int insertChatSopUserLogsInfo(SopUserLogsInfo sopUserLogsInfo);
 
     /**
@@ -40,14 +40,14 @@ public interface SopUserLogsInfoMapper {
      * @param id 主键ID
      * @return 查询结果
      */
-    @DataSource(DataSourceType.SOP)
+    
     SopUserLogsInfo selectById(String id);
 
     /**
      * 查询所有记录
      * @return 记录列表
      */
-    @DataSource(DataSourceType.SOP)
+    
     List<SopUserLogsInfo> selectAll();
 
     /**
@@ -55,70 +55,70 @@ public interface SopUserLogsInfoMapper {
      * @param id 主键ID
      * @return 影响行数
      */
-    @DataSource(DataSourceType.SOP)
+    
     int deleteById(String id);
 
-    @DataSource(DataSourceType.SOP)
+    
     int deleteSopUserLogsInfoByIds(String[] ids);
 
     /**
     * 根据员工id删除
     */
-    @DataSource(DataSourceType.SOP)
+    
     int deleteByQwUserIdAndCorpIdToContactId(@Param("qwUserId") String qwUserId, @Param("corpId") String corpId, @Param("externalContactId") String externalContactId);
 
 
-    @DataSource(DataSourceType.SOP)
+    
     int deleteByQwUserIdAndCorpIdToContactIdByChat(@Param("qwUserId") String qwUserId, @Param("corpId") String corpId, @Param("externalContactId") String externalContactId);
 
 
     /**
      * 根据员工id删除
      */
-    @DataSource(DataSourceType.SOP)
+    
     int deleteByQwUserIdAndCorpIdToContactIdList(@Param("data") DeleteQwSopParam param);
 
 
-    @DataSource(DataSourceType.SOP)
+    
     int deleteByQwUserIdAndCorpIdToContactIdByChatList(@Param("data") DeleteQwSopParam param);
 
 
     /**
      * 根据sop任务-标签-删除对应的客户的营期-
      */
-    @DataSource(DataSourceType.SOP)
+    
     int deleteBySopIdToContactId(@Param("data") SopUserLogsInfoDelParam logsInfoDelParam);
 
-    @DataSource(DataSourceType.SOP)
+    
     int deleteBySopIdToContactIdChat(@Param("data") SopUserLogsInfoDelParam logsInfoDelParam);
 
 
     /**
     * 批量删除
     */
-    @DataSource(DataSourceType.SOP)
+    
     int deleteSopUserLogsInfoBySopIds(@Param("sopIds") String[] sopIds);
 
     /**
      * 批量删除
      */
-    @DataSource(DataSourceType.SOP)
+    
     int deleteSopUserLogsInfoByUserLogsIds(@Param("userLogsIds") String[] userLogsIds);
     /**
      * 根据ID修改记录
      * @return 影响行数
      */
-    @DataSource(DataSourceType.SOP)
+    
     int updateById(SopUserLogsInfo info);
 
     /**
      * 查询某个SOP的任务的营期的客户列表
      * @return 记录列表
      */
-    @DataSource(DataSourceType.SOP)
+    
     List<SopUserLogsInfo> selectSopUserLogsInfoList(SopUserLogsInfo info);
 
-    @DataSource(DataSourceType.SOP)
+    
     @Select("<script> SELECT li.*,ul.start_time FROM sop_user_logs_info li left join  sop_user_logs ul on li.user_logs_id=ul.id  " +
             "        <where>\n" +
             "            <if test=\"data.sopId != null\">and li.sop_id = #{data.sopId}</if>\n" +
@@ -137,28 +137,28 @@ public interface SopUserLogsInfoMapper {
     List<SopUserLogsInfoVOE> selectSopUserLogsInfoListVO(@Param("data") SopUserLogsInfo info);
 
 
-    @DataSource(DataSourceType.SOP)
+    
     SopUserLogsInfo selectSopUserLogsInfo(SopUserLogsInfo info);
 
-    @DataSource(DataSourceType.SOP)
+    
     SopUserLogsInfo selectSopUserLogsInfoByCheckJobTransfer(SopUserLogsInfo info);
 
-    @DataSource(DataSourceType.SOP)
+    
     SopUserLogsInfo selectChatSopUserLogsInfo(SopUserLogsInfo info);
 
-    @DataSource(DataSourceType.SOP)
+    
     List<SopUserLogsInfo> selectSopUserLogsInfoListBySopId(@Param("sopId") String sopId, @Param("userLogsId") String userLogsId);
 
-    @DataSource(DataSourceType.SOP)
+    
     List<SopUserLogsInfo> selectRestoreByIsDaysNotStudy(@Param("sopId") String sopId, @Param("userLogsId") String userLogsId);
 
 
 
-    @DataSource(DataSourceType.SOP)
+    
     void batchInsertSopUserLogsInfo(@Param("SopUserLogsInfo") List<SopUserLogsInfo> logsToInsert);
 
 
-    @DataSource(DataSourceType.SOP)
+    
     @Update("<script>" +
             "UPDATE sop_user_logs_info " +
             "SET is_days_not_study = CASE " +
@@ -175,7 +175,7 @@ public interface SopUserLogsInfoMapper {
             "</script>")
     void batchUpdateSopUserLogsInfoByMoreStudy(@Param("contactList") List<QwExternalContact> contactList);
 
-    @DataSource(DataSourceType.SOP)
+    
     @Update("<script>" +
             "UPDATE sop_user_logs_info " +
             "SET is_days_not_study = 0 " +
@@ -186,7 +186,7 @@ public interface SopUserLogsInfoMapper {
             "</script>")
     void batchUpdateSopUserLogsInfoByIsDaysNotStudy(@Param("contactList") List<QwExternalContact> contactList);
 
-    @DataSource(DataSourceType.SOP)
+    
     @Update("<script>" +
             "UPDATE sop_user_logs_info " +
             "SET grade = CASE external_id " +
@@ -205,7 +205,7 @@ public interface SopUserLogsInfoMapper {
 
 
 
-    @DataSource(DataSourceType.SOP)
+    
     void batchUpdateSopUserLogsInfoToTime(BatchSopUserLogsInfoParamU paramU);
 
     /**
@@ -214,10 +214,10 @@ public interface SopUserLogsInfoMapper {
      * @param id sopUserLogsInfo主键
      * @return sopUserLogsInfo
      */
-    @DataSource(DataSourceType.SOP)
+    
     public SopUserLogsInfo selectSopUserLogsInfoById(String id);
 
-    @DataSource(DataSourceType.SOP)
+    
     public List<SopUserLogsInfo> selectSopUserLogsInfoByIds(@Param("ids") String[] ids);
 
     /**
@@ -226,46 +226,46 @@ public interface SopUserLogsInfoMapper {
      * @param sopUserLogsInfo sopUserLogsInfo
      * @return 结果
      */
-    @DataSource(DataSourceType.SOP)
+    
     public int updateSopUserLogsInfoToTime(@Param("data") SopUserLogsInfo sopUserLogsInfo);
 
-    @DataSource(DataSourceType.SOP)
+    
     List<SopUserLogsInfo> selectChatSopUserLogsByQwUserId(@Param("qwUserId")String qwUserId,@Param("corpId") String corpId);
 
-    @DataSource(DataSourceType.SOP)
+    
     List<SopUserLogsInfo> selectEerGroup();
 
-    @DataSource(DataSourceType.SOP)
+    
     List<SopUserLogsInfo> selectSopUserLogsInfoListByUserLogsId(String id);
 
-    @DataSource(DataSourceType.SOP)
+    
     @Update("update sop_user_logs_info set fs_user_id=null where external_id =#{externalId}")
     int updateQwExternalContactUnBindUserId(@Param("externalId") Long externalId);
 
-    @DataSource(DataSourceType.SOP)
+    
     @Update("update sop_user_logs_info set fs_user_id=#{fsUserId} where external_id =#{externalId}")
     int updateQwExternalContactChangeUserId(@Param("externalId") Long externalId,@Param("fsUserId") Long fsUserId);
 
-    @DataSource(DataSourceType.SOP)
+    
     @Select("SELECT external_id  FROM `sop_user_logs_info` where sop_id = #{sopId}  and Date(create_time) = Date(#{minDay})")
     List<SopUserLogsInfo> selectDayBySopId(@Param("sopId")String sopId, @Param("minDay")String minDay);
 
-    @DataSource(DataSourceType.SOP)
+    
     @Select("SELECT external_id,create_time  FROM sop_user_logs_info where sop_id = #{sopId} ")
     List<SopUserLogsInfo> selectSopUserLogsInfoBySopId(@Param("sopId")String sopId);
 
-    @DataSource(DataSourceType.SOP)
+    
     @Select("SELECT id  FROM sop_user_logs_info where external_id = #{extId} ")
     List<String> selectSopUserLogsInfoByExtId(@Param("extId")Long extId );
 
-    @DataSource(DataSourceType.SOP)
+    
     void updateSopUserLogsInfoFsUserIdById(@Param("data")List<String> list,  @Param("userId") Long userId);
 
-    @DataSource(DataSourceType.SOP)
+    
     @Select("SELECT create_time,fs_user_id  FROM sop_user_logs_info where sop_id = #{sopId} ")
     List<SopUserLogsInfo> selectFsUserIdSopUserLogsInfoBySopId(@Param("sopId")String sopId);
 
-    @DataSource(DataSourceType.SOP)
+    
     @Select("<script>" +
             "SELECT\n" +
             "  qs.id as sopId,\n" +

+ 47 - 48
fs-service/src/main/java/com/fs/sop/mapper/SopUserLogsMapper.java

@@ -20,86 +20,86 @@ import java.util.List;
 @Repository
 public interface SopUserLogsMapper {
 
-    @DataSource(DataSourceType.SOP)
+    
     public int insertSopUserLogsByList(@Param("data") SopUserLogsList userLogsList);
 
-    @DataSource(DataSourceType.SOP)
+    
     public int deleteSopUserLogsById(String id);
 
-    @DataSource(DataSourceType.SOP)
+    
     public int deleteSopUserLogsByIds(String[] ids);
 
-    @DataSource(DataSourceType.SOP)
+    
     public int insertSopUserLogsByDate(@Param("data") SopUserLogsParamByDate logsParamByDate);
 
-    @DataSource(DataSourceType.SOP)
+    
     public int updateSopUserLogsByStatus(@Param("data") SopUserLogs sopUserLogs);
 
-//    @DataSource(DataSourceType.SOP)
+//    
 //    public int updateSopUserLogsDistinct(@Param("data") SopUserLogs sopUserLogs);
 
-//    @DataSource(DataSourceType.SOP)
+//    
 //    public int updateSopUserLogsByexternalContactId(@Param("data") SopUserLogsUpdateList userLogsUpdateList);
 
-    @DataSource(DataSourceType.SOP)
+    
     public int deleteSopUserLogsBySopId(@Param("sopId") String sopId);
 
-    @DataSource(DataSourceType.SOP)
+    
     public int deleteSopUserLogsByRemoveSop(@Param("sopId") String sopId,@Param("qwUserId") String qwUserId , @Param("corpId") String corpId);
 
-    @DataSource(DataSourceType.SOP)
+    
     public int updateSopUserLogsByTempId(@Param("sopTempId") String sopTempId,@Param("sopId") String sopId);
 
-//    @DataSource(DataSourceType.SOP)
+//    
 //    int updateSopUserLogsDistinctByList(@Param("data") SopUserLogsArray userLogsArray);
 
-    @DataSource(DataSourceType.SOP)
+    
     public List<SopUserLogsVo> selectSopUserLogsListByTime(@Param("sopIds") List<String> sopidList);
 
-    @DataSource(DataSourceType.SOP)
+    
     public List<SopUserLogs> meetsTheRatingByUserInfo();
 
-    @DataSource(DataSourceType.SOP)
+    
     public List<SopUserLogs> meetsTheRatingByUserInfoWithPagination(@Param("offset") int offset,@Param("pageSize") int pageSize);
 
-    @DataSource(DataSourceType.SOP)
+    
     public List<SopUserLogs> meetsTheRatingByUserInfoWithPaginationStudyDays(@Param("offset") int offset,@Param("pageSize") int pageSize,@Param("notStudyDays") Integer notStudyDays);
 
-    @DataSource(DataSourceType.SOP)
+    
     public List<SopUserLogs> meetsTherestoreByIsDaysNotStudy(@Param("offset") int offset,@Param("pageSize") int pageSize,@Param("notStudyDays") Integer notStudyDays);
 
 
-    @DataSource(DataSourceType.SOP)
+    
     public List<SopUserLogs> meetsTheRatingByUserInfoBySopId(@Param("sopId") String sopId);
 
 
-    @DataSource(DataSourceType.SOP)
+    
     public List<SopUserLogsVo> selectSopUserLogsListByTest();
 
     /**
      * 根据时间查询sopUserInfoLogs
      * @return
      */
-    @DataSource(DataSourceType.SOP)
+    
     public List<SopUserLogsInfoVo> selectSopUserInfoLogsListByTime();
 
-    @DataSource(DataSourceType.SOP)
+    
     public String selectSopUserLogsByUnionSopId(@Param("data") SopUserLogs sopUserLogs) ;
 
-    @DataSource(DataSourceType.SOP)
+    
     public String selectSopUserLogsByUpdate(@Param("data") SopUserLogs sopUserLogs) ;
 
-    @DataSource(DataSourceType.SOP)
+    
     int  deleteSopUserLogsBySopIds(@Param("sopIds") String[] sopIds) ;
 
-    @DataSource(DataSourceType.SOP)
+    
     List<SopUserLogsInfoVo> selectSopUserLogsInfoListByTime();
 
 
-    @DataSource(DataSourceType.SOP)
+    
     List<SopUserLogsVO> selectSopUserLogsListBySopId(@Param("data") SopUserLogs sopUserLogs);
 
-    @DataSource(DataSourceType.SOP)
+    
     List<SopUserLogs> selectSopUserLogsList(SopUserLogs sopUserLogs);
 
     /**
@@ -108,11 +108,11 @@ public interface SopUserLogsMapper {
      * @param id sopUserLogs主键
      * @return sopUserLogs
      */
-    @DataSource(DataSourceType.SOP)
+    
     public SopUserLogs selectSopUserLogsById(String id);
 
 
-    @DataSource(DataSourceType.SOP)
+    
     @Select("<script>" +
             "select li.sop_id,li.external_contact_id,li.qw_user_id,li.corp_id,li.external_id,li.external_user_name,li.fs_user_id,ul.start_time,li.is_days_not_study " +
             "from sop_user_logs ul  " +
@@ -124,30 +124,30 @@ public interface SopUserLogsMapper {
             "</script>")
     public List<SopUserLogsInfo> selectSopUserLogsByIds(@Param("ids") String[] ids);
 
-    @DataSource(DataSourceType.SOP)
+    
     public List<SopUserLogs> selectSopUserLogsBySopId(@Param("sopId") String sopId);
 
 
 
-    @DataSource(DataSourceType.SOP)
+    
     List<String> selectSopUserLogsByDate(@Param("scheduleStartTime") String scheduleStartTime, @Param("scheduleEndTime") String scheduleEndTime);
 
-    @DataSource(DataSourceType.SOP)
+    
     List<SopUserLogsVO> selectQwSopLogsMessSendList(@Param("sopIds") List<String> sopIds);
 
-    @DataSource(DataSourceType.SOP)
+    
     void updateSopUserLogsByStartTime(@Param("data") SopUserLogs param);
 
-    @DataSource(DataSourceType.SOP)
+    
     void updateSopUserLogsByCompanyInfo(@Param("data") SopUserLogs param);
 
-    @DataSource(DataSourceType.SOP)
+    
     List<SopUserLogs> repairSopUserLogsList();
 
-    @DataSource(DataSourceType.SOP)
+    
     SopUserLogs selectSopUserLogsByDateAndIds(SopUserLogsParamByDate sopUserLogs);
 
-//    @DataSource(DataSourceType.SOP)
+//    
 //    @Select({"<script> " +
 //            "SELECT DISTINCT\n" +
 //            "            l.id,\n" +
@@ -188,7 +188,7 @@ public interface SopUserLogsMapper {
 //            "</script>"})
 //    List<SopUserLogsVO> selectSopUserLogsListByParam(@Param("maps") SopUserLogsParam param);
 
-    @DataSource(DataSourceType.SOP)
+    
     @Select({"<script> " +
             "SELECT DISTINCT\n" +
             "            l.id,\n" +
@@ -245,7 +245,7 @@ public interface SopUserLogsMapper {
             "</script>"})
     List<SopUserLogsVO> selectSopUserLogsListByParam(@Param("maps") SopUserLogsParam param);
 
-//    @DataSource(DataSourceType.SOP)
+//    
 //    @Select({"<script> " +
 //            "SELECT DISTINCT\n" +
 //            "            l.id,\n" +
@@ -285,7 +285,6 @@ public interface SopUserLogsMapper {
 //            "order by start_time desc" +
 //            "</script>"})
 //    List<SopUserLogsVO> selectSopUserLogsGroupListByParam(@Param("maps") SopUserLogsParam param);
-@DataSource(DataSourceType.SOP)
 @Select({"<script> " +
         "SELECT DISTINCT\n" +
         "            l.id,\n" +
@@ -330,10 +329,10 @@ public interface SopUserLogsMapper {
         "</script>"})
 List<SopUserLogsVO> selectSopUserLogsGroupListByParam(@Param("maps") SopUserLogsParam param);
 
-    @DataSource(DataSourceType.SOP)
+    
     void batchInsertSopUserLogs(@Param("list") List<SopUserLogs> list);
 
-    @DataSource(DataSourceType.SOP)
+    
     List<String> selectSopUserLogsByQwUserIds(@Param("qwUserIds") List<String> qwUserIdList);
 
     /**
@@ -341,7 +340,7 @@ List<SopUserLogsVO> selectSopUserLogsGroupListByParam(@Param("maps") SopUserLogs
      *  否则按进线时间每天创建
      * @return
      */
-    @DataSource(DataSourceType.SOP)
+    
     @Select(" SELECT log.id, log.qw_user_id,log.sop_id,log.corp_id, qw_sop.is_auto_sop,log.start_time\n" +
             "            FROM sop_user_logs log\n" +
             "            LEFT JOIN qw_sop ON log.sop_id = qw_sop.id\n" +
@@ -350,19 +349,19 @@ List<SopUserLogsVO> selectSopUserLogsGroupListByParam(@Param("maps") SopUserLogs
             "             AND qw_sop.status in(2,3)")
     List<SopUserLogs> queryAllSopUserLogs();
 
-    @DataSource(DataSourceType.SOP)
+    
     List<SopUserLogs> selectSopUserLogsListByIds(@Param("ids") List<String> ids);
 
-    @DataSource(DataSourceType.SOP)
+    
     void updateSopuserLogsDateById(UpdateSopUserLogDateVo vo);
 
-    @DataSource(DataSourceType.SOP)
+    
     List<SopUserLogs> querySopUserLogsByParam(GetSOPTaskDataParam param);
 
-    @DataSource(DataSourceType.SOP)
+    
     List<SopUserLogs> getSopUserLogsInfoById(@Param("ids") String[] ids);
 
-    @DataSource(DataSourceType.SOP)
+    
     @Select({"<script> " +
             "SELECT id FROM sop_user_logs " +
             "WHERE corp_id = #{param.corpId} " +
@@ -375,7 +374,7 @@ List<SopUserLogsVO> selectSopUserLogsGroupListByParam(@Param("maps") SopUserLogs
             "</script>"})
     List<String> getSopUserLogsIds(@Param("param")SendUserLogsInfoMsgParam param);
 
-    @DataSource(DataSourceType.SOP)
+    
     @Select("<script>" +
             "UPDATE sop_user_logs " +
             "SET actual_qw_user_id = " +
@@ -395,7 +394,7 @@ List<SopUserLogsVO> selectSopUserLogsGroupListByParam(@Param("maps") SopUserLogs
             "</script>")
     void replaceUser(@Param("vo") ReplaceUserDto vo);
 
-    @DataSource(DataSourceType.SOP)
+    
     @Select("<script>" +"SELECT * FROM sop_user_logs WHERE sop_id = #{sopId} AND qw_user_id = #{qwUserId} " +
             "<if test=\"chatId != null and chatId != ''\"> and chat_id = #{chatId} </if>" +
             " limit 1 " +

+ 0 - 1
fs-service/src/main/java/com/fs/sop/mapper/SopUserLogsWxMapper.java

@@ -13,7 +13,6 @@ import java.util.List;
  * @author fs
  * @date 2025-03-12
  */
-@DataSource(DataSourceType.SOP)
 public interface SopUserLogsWxMapper extends BaseMapper<SopUserLogsWx>{
     /**
      * 查询个微sop营期

+ 0 - 1
fs-service/src/main/java/com/fs/sop/service/IQwSopTempContentService.java

@@ -16,7 +16,6 @@ import java.util.Set;
  * @author fs
  * @date 2025-02-06
  */
-@DataSource(DataSourceType.SOP)
 public interface IQwSopTempContentService extends IService<QwSopTempContent>{
     /**
      * 查询sop任务模板内容

+ 0 - 1
fs-service/src/main/java/com/fs/sop/service/IQwSopTempRulesService.java

@@ -17,7 +17,6 @@ import java.util.Set;
  * @author fs
  * @date 2025-02-06
  */
-@DataSource(DataSourceType.SOP)
 public interface IQwSopTempRulesService extends IService<QwSopTempRules>{
     /**
      * 查询sop任务模板规则

+ 1 - 1
fs-service/src/main/java/com/fs/sop/service/impl/QwSopLogsServiceImpl.java

@@ -1604,7 +1604,7 @@ public class QwSopLogsServiceImpl extends ServiceImpl<QwSopLogsMapper, QwSopLogs
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public void updateBatch(List<QwSopLogs> collect) {
         super.updateBatchById(collect);
     }

+ 3 - 3
fs-service/src/main/java/com/fs/sop/service/impl/QwSopServiceImpl.java

@@ -192,7 +192,7 @@ public class QwSopServiceImpl implements IQwSopService
      * @return 结果
      */
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public int insertQwSop(QwSop qwSop)
     {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -1096,7 +1096,7 @@ public class QwSopServiceImpl implements IQwSopService
 
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public List<QwSop> selectQwSopByTempId(String tempId) {
         return qwSopMapper.selectQwSopByTempId(tempId);
     }
@@ -1116,7 +1116,7 @@ public class QwSopServiceImpl implements IQwSopService
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public int deleteQwSopLogsBySopIds(String[] ids) {
         if(ids == null || ids.length == 0){
             return 0;

+ 8 - 8
fs-service/src/main/java/com/fs/sop/service/impl/QwSopTempContentServiceImpl.java

@@ -101,7 +101,7 @@ public class QwSopTempContentServiceImpl extends ServiceImpl<QwSopTempContentMap
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public void insertBatch(List<QwSopTempContent> list) {
         super.saveBatch(list);
     }
@@ -122,12 +122,12 @@ public class QwSopTempContentServiceImpl extends ServiceImpl<QwSopTempContentMap
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public void saveList(List<QwSopTempContent> contentList) {
         super.saveBatch(contentList);
     }
 
-    @Override@DataSource(DataSourceType.SOP)
+    @Override
     public void removeByDayId(Long dayId) {
         super.remove(new QueryWrapper<QwSopTempContent>().eq("day_id", dayId));
     }
@@ -148,31 +148,31 @@ public class QwSopTempContentServiceImpl extends ServiceImpl<QwSopTempContentMap
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public List<QwSopTempContent> selectQwSopTempContentByTempId(String tempId) {
         return baseMapper.selectQwSopTempContentByTempId(tempId);
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public void removeByTempIds(Collection<String> tempIds) {
         this.remove(new QueryWrapper<QwSopTempContent>().in("temp_id", tempIds));
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public List<QwSopTempContent> listByTempIds(Collection<String> tempIds) {
         return baseMapper.selectList(new QueryWrapper<QwSopTempContent>().in("temp_id", tempIds));
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public List<QwSopTempContent> listByTempId(String tempId) {
         return baseMapper.selectList(new QueryWrapper<QwSopTempContent>().eq("temp_id", tempId));
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public void removeByWrapper(LambdaQueryWrapper<QwSopTempContent> wrapper) {
         this.remove(wrapper);
     }

+ 14 - 15
fs-service/src/main/java/com/fs/sop/service/impl/QwSopTempDayServiceImpl.java

@@ -27,7 +27,6 @@ import java.util.List;
  */
 @Service
 @AllArgsConstructor
-@DataSource(DataSourceType.SOP)
 public class QwSopTempDayServiceImpl extends ServiceImpl<QwSopTempDayMapper, QwSopTempDay> implements IQwSopTempDayService {
 
 
@@ -35,30 +34,30 @@ public class QwSopTempDayServiceImpl extends ServiceImpl<QwSopTempDayMapper, QwS
     private QwSopTempDayMapper qwSopTempDayMapper;
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public void saveList(List<QwSopTempDay> list) {
         super.saveBatch(list);
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public List<QwSopTempDay> listByTempId(String id) {
         return list(new QueryWrapper<QwSopTempDay>().eq("temp_id", id).orderByAsc("day_num"));
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public void insertBatch(List<QwSopTempDay> dayList) {
         super.saveBatch(dayList);
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public QwSopTempDay info(Long id) {
         return getById(id);
     }
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public boolean saveOrUpdate(QwSopTempDay day) {
         if(day.getId() == null){
             return baseMapper.insert(day) > 0;
@@ -68,56 +67,56 @@ public class QwSopTempDayServiceImpl extends ServiceImpl<QwSopTempDayMapper, QwS
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public void addOrUpdateBatch(List<QwSopTempDay> days) {
         super.saveOrUpdateBatch(days);
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public void removeById(Long id) {
         super.removeById(id);
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public List<QwSopTempDay> listById(List<Long> dayIds) {
         return list(new QueryWrapper<QwSopTempDay>().in("id", dayIds));
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public int getDayNumByIdLimitOne(String tempId) {
         return  qwSopTempDayMapper.getDayNumByIdLimitOne(tempId);
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public void removeByTempIds(Collection<String> tempIds) {
         this.remove(new QueryWrapper<QwSopTempDay>().in("temp_id", tempIds));
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public void removeByWrapper(LambdaQueryWrapper<QwSopTempDay> wrapper) {
         this.remove(wrapper);
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public List<QwSopTempDay> listByTempIds(LambdaQueryWrapper<QwSopTempDay> wrapper) {
         return this.list(wrapper);
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public List<QwSopTempDay> listByTempById(LambdaQueryWrapper<QwSopTempDay> wrapper) {
         return this.list(wrapper);
     }
 
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public void updateByWrapper(UpdateWrapper<QwSopTempDay> wrapper) {
         this.update(wrapper);
     }

+ 11 - 11
fs-service/src/main/java/com/fs/sop/service/impl/QwSopTempRulesServiceImpl.java

@@ -126,14 +126,14 @@ public class QwSopTempRulesServiceImpl extends ServiceImpl<QwSopTempRulesMapper,
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public void insertBatch(List<QwSopTempRules> rulesList) {
 
         super.saveBatch(rulesList);
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public List<QwSopTempRules> listByTempId(String id) {
         List<QwSopTempDay> dayList = qwSopTempDayService.list(new QueryWrapper<QwSopTempDay>().eq("temp_id", id).orderByAsc("day_num"));
         if (dayList.isEmpty()) return Collections.emptyList();
@@ -149,7 +149,7 @@ public class QwSopTempRulesServiceImpl extends ServiceImpl<QwSopTempRulesMapper,
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public List<QwSopTempDay> listByTempIdAll(String id) {
         List<QwSopTempRules> rulesList = listByTempId(id);
         List<QwSopTempDay> list = qwSopTempDayService.listByTempId(id);
@@ -171,25 +171,25 @@ public class QwSopTempRulesServiceImpl extends ServiceImpl<QwSopTempRulesMapper,
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public void saveList(List<QwSopTempRules> list) {
         super.saveBatch(list);
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public List<QwSopTempRules> listByDayId(Long id) {
         return list(new QueryWrapper<QwSopTempRules>().eq("day_id", id));
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public void removeByIds(List<Long> id) {
         super.removeByIds(id);
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public void removeByDayId(Long id) {
         remove(new QueryWrapper<QwSopTempRules>().eq("day_id", id));
     }
@@ -211,7 +211,7 @@ public class QwSopTempRulesServiceImpl extends ServiceImpl<QwSopTempRulesMapper,
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public List<QwSopTempRules> listById(List<Long> rulesIds) {
         return list(new QueryWrapper<QwSopTempRules>().in("id", rulesIds));
     }
@@ -254,19 +254,19 @@ public class QwSopTempRulesServiceImpl extends ServiceImpl<QwSopTempRulesMapper,
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public void removeByTempIds(Collection<String> tempIds) {
         this.remove(new QueryWrapper<QwSopTempRules>().in("temp_id", tempIds));
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public List<QwSopTempRules> selectListByDayId(Long id) {
         return list(new QueryWrapper<QwSopTempRules>().eq("day_id", id));
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public void removeByWrapper(LambdaQueryWrapper<QwSopTempRules> wrapper) {
         this.remove(wrapper);
     }

+ 4 - 4
fs-service/src/main/java/com/fs/sop/service/impl/QwSopTempServiceImpl.java

@@ -217,7 +217,7 @@ public class QwSopTempServiceImpl implements IQwSopTempService {
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public int update(QwSopTemp qwSopTemp) {
         QwSopTemp temp = qwSopTempMapper.selectById(qwSopTemp.getId());
         int i = qwSopTempMapper.updateById(qwSopTemp);
@@ -392,13 +392,13 @@ public class QwSopTempServiceImpl implements IQwSopTempService {
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public List<QwSopTemp> listTemp() {
         return qwSopTempMapper.selectList(new QueryWrapper<>());
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public void sortDay(List<SortDayVo> list) {
         Collection<QwSopTempDay> days = qwSopTempDayService.listByIds(PubFun.listToNewList(list, SortDayVo::getId));
         Map<Long, Integer> dayMap = list.stream().collect(Collectors.toMap(SortDayVo::getId, SortDayVo::getDayNum));
@@ -415,7 +415,7 @@ public class QwSopTempServiceImpl implements IQwSopTempService {
     }
 
 
-    @DataSource(DataSourceType.SOP)
+    
     private void reorder(String tempId) {
         QwSopTemp qwSopTemp = qwSopTempMapper.selectQwSopTempById(tempId);
         List<QwSopTempDay> days = qwSopTempDayService.listByTempId(tempId);

+ 6 - 6
fs-service/src/main/java/com/fs/sop/service/impl/QwSopTempVoiceServiceImpl.java

@@ -227,7 +227,7 @@ public class QwSopTempVoiceServiceImpl extends ServiceImpl<QwSopTempVoiceMapper,
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public List<QwSopTempVoice> listByTempIdAndCompanyId(String tempId, List<Long> longs) {
         return list(new QueryWrapper<QwSopTempVoice>().eq("temp_id", tempId).in("company_user_id", longs));
     }
@@ -277,18 +277,18 @@ public class QwSopTempVoiceServiceImpl extends ServiceImpl<QwSopTempVoiceMapper,
         return voice;
     }
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public QwSopTempVoice selectQwSopTempVoiceByCompanyUserIdAndVoiceTxt(Long companyUserId, String voiceTxt) {
         return qwSopTempVoiceMapper.selectQwSopTempVoiceByCompanyUserIdAndVoiceTxt(companyUserId,voiceTxt);
     }
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public QwSopTempVoice selectQwSopTempVoiceByCompanyUserIdAndQwUserId(Long companyUserId, Long qwUserId) {
         return qwSopTempVoiceMapper.selectQwSopTempVoiceByCompanyUserIdAndQwUserId(companyUserId,qwUserId);
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public List<QwSopTempVoice> selectQwSopTempVoiceListLimit(QwSopTempVoice sopTempVoice) {
         return qwSopTempVoiceMapper.selectQwSopTempVoiceListLimit(sopTempVoice);
     }
@@ -320,13 +320,13 @@ public class QwSopTempVoiceServiceImpl extends ServiceImpl<QwSopTempVoiceMapper,
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public QwSopTempVoice selectQwSopTempVoiceByIdAndUserVoiceUrl(Long id) {
         return qwSopTempVoiceMapper.selectQwSopTempVoiceByIdAndUserVoiceUrl(id);
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public List<QwSopTempVoice> selectQwSopTempVoiceNewList(QwSopTempVoice sopTempVoice) {
         return qwSopTempVoiceMapper.selectQwSopTempVoiceNewList(sopTempVoice);
     }

+ 2 - 3
fs-service/src/main/java/com/fs/sop/service/impl/SopUserLogsWxServiceImpl.java

@@ -18,7 +18,6 @@ import java.util.List;
  * @date 2025-03-12
  */
 @Service
-@DataSource(DataSourceType.SOP)
 public class SopUserLogsWxServiceImpl extends ServiceImpl<SopUserLogsWxMapper, SopUserLogsWx> implements ISopUserLogsWxService {
 
     /**
@@ -94,13 +93,13 @@ public class SopUserLogsWxServiceImpl extends ServiceImpl<SopUserLogsWxMapper, S
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public void insertList(List<SopUserLogsWx> collect) {
         super.saveBatch(collect);
     }
 
     @Override
-    @DataSource(DataSourceType.SOP)
+    
     public List<SopUserLogsWx> listBySopId(String id) {
         return list(new QueryWrapper<SopUserLogsWx>().eq("sop_id", id));
     }

+ 1 - 1
fs-service/src/main/java/com/fs/statis/mapper/FsStatisSalerWatchMapper.java

@@ -103,7 +103,7 @@ public interface FsStatisSalerWatchMapper {
 
     List<FsStatisSalerWatch> generateSopData(@Param("date") String date);
 
-    @DataSource(DataSourceType.SOP)
+    
     List<FsStatisTempFsuser> querySopRepeatData(@Param("date") String date);
 
     @Delete("delete from fs_statis_saler_watch where data_date=#{date}")

+ 2 - 2
fs-service/src/main/java/com/fs/statis/mapper/FsStatisTempParamMapper.java

@@ -21,7 +21,7 @@ public interface FsStatisTempParamMapper {
 
     void batchSave(List<FsStatisTempParam> list);
 
-    @DataSource(DataSourceType.SOP)
+    
     void batchSaveToSop(List<FsStatisTempParam> list);
 
     /**
@@ -78,7 +78,7 @@ public interface FsStatisTempParamMapper {
     @Delete("truncate table fs_statis_temp_param")
     void clear();
 
-    @DataSource(DataSourceType.SOP)
+    
     @Delete("truncate table fs_statis_temp_param")
     void clearSop();
 

+ 0 - 49
fs-service/src/main/resources/application-dev-test.yml

@@ -85,55 +85,6 @@ spring:
                     wall:
                         config:
                             multi-statement-allow: true
-        sop:
-            type: com.alibaba.druid.pool.DruidDataSource
-            driverClassName: com.mysql.cj.jdbc.Driver
-            druid:
-                # 主库数据源
-                master:
-                    url: jdbc:mysql://cq-cdb-8fjmemkb.sql.tencentcdb.com:27220/his_sop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-                    username: root
-                    password: Ylrz_1q2w3e4r5t6y
-                # 初始连接数
-                initialSize: 5
-                # 最小连接池数量
-                minIdle: 10
-                # 最大连接池数量
-                maxActive: 20
-                # 配置获取连接等待超时的时间
-                maxWait: 60000
-                # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
-                timeBetweenEvictionRunsMillis: 60000
-                # 配置一个连接在池中最小生存的时间,单位是毫秒
-                minEvictableIdleTimeMillis: 300000
-                # 配置一个连接在池中最大生存的时间,单位是毫秒
-                maxEvictableIdleTimeMillis: 900000
-                # 配置检测连接是否有效
-                validationQuery: SELECT 1 FROM DUAL
-                testWhileIdle: true
-                testOnBorrow: false
-                testOnReturn: false
-                webStatFilter:
-                    enabled: true
-                statViewServlet:
-                    enabled: true
-                    # 设置白名单,不填则允许所有访问
-                    allow:
-                    url-pattern: /druid/*
-                    # 控制台管理用户名和密码
-                    login-username: fs
-                    login-password: 123456
-                filter:
-                    stat:
-                        enabled: true
-                        # 慢SQL记录
-                        log-slow-sql: true
-                        slow-sql-millis: 1000
-                        merge-sql: true
-                    wall:
-                        config:
-                            multi-statement-allow: true
-
 rocketmq:
     name-server: rmq-1243b25nj.rocketmq.gz.public.tencenttdmq.com:8080 # RocketMQ NameServer 地址
     producer:

+ 1 - 51
fs-service/src/main/resources/application-dev.yml

@@ -74,54 +74,4 @@ spring:
                         merge-sql: true
                     wall:
                         config:
-                            multi-statement-allow: true
-        sop:
-            type: com.alibaba.druid.pool.DruidDataSource
-            driverClassName: com.mysql.cj.jdbc.Driver
-            druid:
-                # 主库数据源
-                master:
-                    url: jdbc:mysql://139.186.77.83:3306/his_sop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-                    username: Rtroot
-                    password: Rtroot
-                # 初始连接数
-                initialSize: 5
-                # 最小连接池数量
-                minIdle: 10
-                # 最大连接池数量
-                maxActive: 20
-                # 配置获取连接等待超时的时间
-                maxWait: 60000
-                # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
-                timeBetweenEvictionRunsMillis: 60000
-                # 配置一个连接在池中最小生存的时间,单位是毫秒
-                minEvictableIdleTimeMillis: 300000
-                # 配置一个连接在池中最大生存的时间,单位是毫秒
-                maxEvictableIdleTimeMillis: 900000
-                # 配置检测连接是否有效
-                validationQuery: SELECT 1 FROM DUAL
-                testWhileIdle: true
-                testOnBorrow: false
-                testOnReturn: false
-                webStatFilter:
-                    enabled: true
-                statViewServlet:
-                    enabled: true
-                    # 设置白名单,不填则允许所有访问
-                    allow:
-                    url-pattern: /druid/*
-                    # 控制台管理用户名和密码
-                    login-username: fs
-                    login-password: 123456
-                filter:
-                    stat:
-                        enabled: true
-                        # 慢SQL记录
-                        log-slow-sql: true
-                        slow-sql-millis: 1000
-                        merge-sql: true
-                    wall:
-                        config:
-                            multi-statement-allow: true
-
-
+                            multi-statement-allow: true

+ 3 - 7
fs-user-app/src/main/java/com/fs/framework/config/DataSourceConfig.java

@@ -22,11 +22,7 @@ import java.util.Map;
 @Configuration
 public class DataSourceConfig {
 
-    @Bean
-    @ConfigurationProperties(prefix = "spring.datasource.sop.druid.master")
-    public DataSource sopDataSource() {
-        return new DruidDataSource();
-    }
+    
 
     @Bean
     @ConfigurationProperties(prefix = "spring.datasource.mysql.druid.master")
@@ -43,12 +39,12 @@ public class DataSourceConfig {
 
     @Bean
     @Primary
-    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource, @Qualifier("slaveDataSource") DataSource slaveDataSource, @Qualifier("sopDataSource") DataSource sopDataSource) {
+    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource, @Qualifier("slaveDataSource") DataSource slaveDataSource) {
         Map<Object, Object> targetDataSources = new HashMap<>();
         // 使用字符串 key(MASTER/SLAVE),与 DynamicDataSourceContextHolder 中 setDataSourceType 保持一致
         targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
         targetDataSources.put(DataSourceType.SLAVE.name(), slaveDataSource);
-        targetDataSources.put(DataSourceType.SOP.name(), sopDataSource);
+        
         return new DynamicDataSource(masterDataSource, targetDataSources);
     }
 

+ 2 - 2
fs-user-app/src/main/java/com/fs/framework/config/DruidConfig.java

@@ -50,9 +50,9 @@
 //
 //    @Bean
 //    @Primary
-//    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource, @Qualifier("sopDataSource") DataSource sopDataSource) {
+//    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource) {
 //        Map<Object, Object> targetDataSources = new HashMap<>();
-//        targetDataSources.put(DataSourceType.SOP.name(), sopDataSource);
+//        
 //        return new DynamicDataSource(masterDataSource, targetDataSources);
 //    }
 //

+ 3 - 7
fs-watch/src/main/java/com/fs/framework/config/DataSourceConfig.java

@@ -23,11 +23,7 @@ import java.util.Map;
 public class DataSourceConfig {
 
 
-    @Bean
-    @ConfigurationProperties(prefix = "spring.datasource.sop.druid.master")
-    public DataSource sopDataSource() {
-        return new DruidDataSource();
-    }
+    
 
     @Bean
     @ConfigurationProperties(prefix = "spring.datasource.mysql.druid.master")
@@ -39,9 +35,9 @@ public class DataSourceConfig {
 
     @Bean
     @Primary
-    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource, @Qualifier("sopDataSource") DataSource sopDataSource) {
+    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource) {
         Map<Object, Object> targetDataSources = new HashMap<>();
-        targetDataSources.put(DataSourceType.SOP.name(), sopDataSource);
+        
         return new DynamicDataSource(masterDataSource, targetDataSources);
     }
     /**

+ 3 - 7
fs-wx-api/src/main/java/com/fs/framework/config/DataSourceConfig.java

@@ -22,11 +22,7 @@ import java.util.Map;
 @Configuration
 public class DataSourceConfig {
 
-    @Bean
-    @ConfigurationProperties(prefix = "spring.datasource.sop.druid.master")
-    public DataSource sopDataSource() {
-        return new DruidDataSource();
-    }
+    
 
     @Bean
     @ConfigurationProperties(prefix = "spring.datasource.mysql.druid.master")
@@ -38,9 +34,9 @@ public class DataSourceConfig {
 
     @Bean
     @Primary
-    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource, @Qualifier("sopDataSource") DataSource sopDataSource) {
+    public DynamicDataSource dataSource(@Qualifier("masterDataSource") DataSource masterDataSource) {
         Map<Object, Object> targetDataSources = new HashMap<>();
-        targetDataSources.put(DataSourceType.SOP.name(), sopDataSource);
+        
         return new DynamicDataSource(masterDataSource, targetDataSources);
     }
     /**