he2802 2 жил өмнө
parent
commit
43280e46d3
17 өөрчлөгдсөн 468 нэмэгдсэн , 403 устгасан
  1. 2 1
      zhongzheng-admin-saas/src/main/java/com/zhongzheng/AdminSaasApplication.java
  2. 79 54
      zhongzheng-admin-saas/src/main/resources/application-dev.yml
  3. 2 2
      zhongzheng-admin-saas/src/main/resources/application.yml
  4. 2 4
      zhongzheng-admin/src/main/java/com/zhongzheng/ZhongZhengApplication.java
  5. 79 54
      zhongzheng-admin/src/main/resources/application-dev.yml
  6. 2 7
      zhongzheng-api/src/main/java/com/zhongzheng/ZhongZhengApiApplication.java
  7. 80 55
      zhongzheng-api/src/main/resources/application-dev.yml
  8. 7 0
      zhongzheng-common/pom.xml
  9. 121 141
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/config/DruidConfig.java
  10. 1 2
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/config/SecurityConfig.java
  11. 62 64
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/config/properties/DruidProperties.java
  12. 1 1
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/manager/factory/AsyncFactory.java
  13. 9 9
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/security/handle/LogoutSuccessHandlerImpl.java
  14. 2 5
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/SysTenantServiceImpl.java
  15. 15 0
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/TopSysLoginService.java
  16. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/distribution/service/impl/DistributionActivityTemplateServiceImpl.java
  17. 3 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/system/service/impl/SysLogininforServiceImpl.java

+ 2 - 1
zhongzheng-admin-saas/src/main/java/com/zhongzheng/AdminSaasApplication.java

@@ -1,11 +1,12 @@
 package com.zhongzheng;
 
+import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
 
 
-@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
+@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class,DruidDataSourceAutoConfigure.class})
 public class AdminSaasApplication {
 
     public static void main(String[] args)

+ 79 - 54
zhongzheng-admin-saas/src/main/resources/application-dev.yml

@@ -1,60 +1,85 @@
 # 数据源配置
 spring:
     datasource:
-        type: com.alibaba.druid.pool.DruidDataSource
-        driverClassName: com.mysql.cj.jdbc.Driver
-        druid:
-            # 主库数据源
-            master:
-                url: jdbc:mysql://192.168.1.222:3306/zz_edu_sass_top?rewriteBatchedStatements=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
-                username: root
-                password:  zhongzheng2021
-            # 从库数据源
-            slave:
-                # 从数据源开关/默认关闭
-                enabled: true
-                url: jdbc:mysql://192.168.1.222:3306/zz_edu_saas?rewriteBatchedStatements=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
-                username: root
-                password: zhongzheng2021
-            # 初始连接数
-            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: ruoyi
-                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
+        #配置hikari连接池
+        hikari:
+            minimum-idle: 10
+            maximum-pool-size: 20
+            connection-timeout: 10000
+            idle-timeout: 30000
+            connection-init-sql: set names utf8mb4
+        #动态数据源配置
+        dynamic:
+            primary: master #设置默认的数据源或者数据源组,默认值即为master
+            strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候会抛出异常,不启动则使用默认数据源.
+            datasource:
+                #数据源
+                master:
+                    driver-class-name: com.mysql.cj.jdbc.Driver
+                    url: jdbc:mysql://192.168.1.222:3306/zz_edu_sass_top?rewriteBatchedStatements=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
+                    username: root
+                    password: zhongzheng2021
+                #数据源
+                slave:
+                    driver-class-name: com.mysql.cj.jdbc.Driver
+                    url: jdbc:mysql://192.168.1.222:3306/zz_edu_saas?rewriteBatchedStatements=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
+                    username: root
+                    password: zhongzheng2021
+#    datasource:
+#        type: com.alibaba.druid.pool.DruidDataSource
+#        driverClassName: com.mysql.cj.jdbc.Driver
+#        druid:
+#            # 主库数据源
+#            master:
+#                url: jdbc:mysql://192.168.1.222:3306/zz_edu_sass_top?rewriteBatchedStatements=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
+#                username: root
+#                password:  zhongzheng2021
+#            # 从库数据源
+#            slave:
+#                # 从数据源开关/默认关闭
+#                enabled: true
+#                url: jdbc:mysql://192.168.1.222:3306/zz_edu_saas?rewriteBatchedStatements=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
+#                username: root
+#                password: zhongzheng2021
+#            # 初始连接数
+#            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: ruoyi
+#                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
     # redis 配置
     redis:
         # 地址

+ 2 - 2
zhongzheng-admin-saas/src/main/resources/application.yml

@@ -1,7 +1,7 @@
 # 项目相关配置
 zhongzheng:
   # 名称
-  name: zhongzheng
+  name: zhongzheng_saas
   # 版本
   version: 3.4.0
   # 版权年份
@@ -209,7 +209,7 @@ mybatis-plus:
       selectStrategy: NOT_EMPTY
   # 开启多租户
   tenant:
-    enabled-tenant: true
+    enabled-tenant: false
 # PageHelper分页插件
 pagehelper:
   helperDialect: mysql

+ 2 - 4
zhongzheng-admin/src/main/java/com/zhongzheng/ZhongZhengApplication.java

@@ -1,12 +1,10 @@
 package com.zhongzheng;
 
+import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
-import org.springframework.cloud.client.loadbalancer.LoadBalanced;
-import org.springframework.context.annotation.Bean;
 import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.web.client.RestTemplate;
 
 /**
  * 启动程序
@@ -14,7 +12,7 @@ import org.springframework.web.client.RestTemplate;
  * @author zhongzheng
  */
 
-@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
+@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class, DruidDataSourceAutoConfigure.class })
 @EnableScheduling
 public class ZhongZhengApplication
 {

+ 79 - 54
zhongzheng-admin/src/main/resources/application-dev.yml

@@ -1,60 +1,85 @@
 # 数据源配置
 spring:
     datasource:
-        type: com.alibaba.druid.pool.DruidDataSource
-        driverClassName: com.mysql.cj.jdbc.Driver
-        druid:
-            # 主库数据源
-            master:
-                url: jdbc:mysql://192.168.1.222:3306/zz_edu_saas?rewriteBatchedStatements=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
-                username: root
-                password:  zhongzheng2021
-            # 从库数据源
-            slave:
-                # 从数据源开关/默认关闭
-                enabled: false
-                url:
-                username:
-                password:
-            # 初始连接数
-            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: ruoyi
-                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
+        #配置hikari连接池
+        hikari:
+            minimum-idle: 10
+            maximum-pool-size: 20
+            connection-timeout: 10000
+            idle-timeout: 30000
+            connection-init-sql: set names utf8mb4
+        #动态数据源配置
+        dynamic:
+            primary: master #设置默认的数据源或者数据源组,默认值即为master
+            strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候会抛出异常,不启动则使用默认数据源.
+            datasource:
+                #数据源
+                master:
+                    driver-class-name: com.mysql.cj.jdbc.Driver
+                    url: jdbc:mysql://192.168.1.222:3306/zz_edu_saas?rewriteBatchedStatements=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
+                    username: root
+                    password: zhongzheng2021
+                #数据源
+                slave:
+                    driver-class-name: com.mysql.cj.jdbc.Driver
+                    url: jdbc:mysql://192.168.1.222:3306/zz_edu_sass_top?rewriteBatchedStatements=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
+                    username: root
+                    password: zhongzheng2021
+#    datasource:
+#        type: com.alibaba.druid.pool.DruidDataSource
+#        driverClassName: com.mysql.cj.jdbc.Driver
+#        druid:
+#            # 主库数据源
+#            master:
+#                url: jdbc:mysql://192.168.1.222:3306/zz_edu_saas?rewriteBatchedStatements=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
+#                username: root
+#                password:  zhongzheng2021
+#            # 从库数据源
+#            slave:
+#                # 从数据源开关/默认关闭
+#                enabled: false
+#                url:
+#                username:
+#                password:
+#            # 初始连接数
+#            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: ruoyi
+#                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
     # redis 配置
     redis:
         # 地址

+ 2 - 7
zhongzheng-api/src/main/java/com/zhongzheng/ZhongZhengApiApplication.java

@@ -1,18 +1,13 @@
 package com.zhongzheng;
 
 
+import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
 import org.springframework.boot.SpringApplication;
-import org.springframework.boot.SpringBootVersion;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
-import org.springframework.cloud.client.loadbalancer.LoadBalanced;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.core.SpringVersion;
-import org.springframework.web.client.RestTemplate;
 
 
-@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
+@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, DruidDataSourceAutoConfigure.class})
 public class ZhongZhengApiApplication {
 
     public static void main(String[] args)

+ 80 - 55
zhongzheng-api/src/main/resources/application-dev.yml

@@ -1,61 +1,86 @@
 # 数据源配置
 spring:
     datasource:
-        type: com.alibaba.druid.pool.DruidDataSource
-        driverClassName: com.mysql.cj.jdbc.Driver
-        druid:
-            # 主库数据源
-            master:
-                url: jdbc:mysql://192.168.1.222:3306/zz_edu_saas?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
-#                url: jdbc:mysql://192.168.1.222:3306/zz_edu_saas_pre?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
-                username: root
-                password: zhongzheng2021
-            # 从库数据源
-            slave:
-                # 从数据源开关/默认关闭
-                enabled: false
-                url:
-                username:
-                password:
-            # 初始连接数
-            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: ruoyi
-                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
+        #配置hikari连接池
+        hikari:
+            minimum-idle: 10
+            maximum-pool-size: 20
+            connection-timeout: 10000
+            idle-timeout: 30000
+            connection-init-sql: set names utf8mb4
+        #动态数据源配置
+        dynamic:
+            primary: master #设置默认的数据源或者数据源组,默认值即为master
+            strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候会抛出异常,不启动则使用默认数据源.
+            datasource:
+                #数据源
+                master:
+                    driver-class-name: com.mysql.cj.jdbc.Driver
+                    url: jdbc:mysql://192.168.1.222:3306/zz_edu_saas?rewriteBatchedStatements=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
+                    username: root
+                    password: zhongzheng2021
+                #数据源
+                slave:
+                    driver-class-name: com.mysql.cj.jdbc.Driver
+                    url: jdbc:mysql://192.168.1.222:3306/zz_edu_sass_top?rewriteBatchedStatements=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
+                    username: root
+                    password: zhongzheng2021
+#    datasource:
+#        type: com.alibaba.druid.pool.DruidDataSource
+#        driverClassName: com.mysql.cj.jdbc.Driver
+#        druid:
+#            # 主库数据源
+#            master:
+#                url: jdbc:mysql://192.168.1.222:3306/zz_edu_saas?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
+##                url: jdbc:mysql://192.168.1.222:3306/zz_edu_saas_pre?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
+#                username: root
+#                password: zhongzheng2021
+#            # 从库数据源
+#            slave:
+#                # 从数据源开关/默认关闭
+#                enabled: false
+#                url:
+#                username:
+#                password:
+#            # 初始连接数
+#            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: ruoyi
+#                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
     # redis 配置
     redis:
         # 地址

+ 7 - 0
zhongzheng-common/pom.xml

@@ -182,6 +182,13 @@
             <version>3.1.479</version>
         </dependency>
 
+        <!-- dynamic -->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
+            <version>3.0.0</version>
+        </dependency>
+
         <dependency>
             <groupId>com.baomidou</groupId>
             <artifactId>mybatis-plus-boot-starter</artifactId>

+ 121 - 141
zhongzheng-framework/src/main/java/com/zhongzheng/framework/config/DruidConfig.java

@@ -1,26 +1,6 @@
 package com.zhongzheng.framework.config;
 
-import com.alibaba.druid.pool.DruidDataSource;
-import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
-import com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties;
-import com.alibaba.druid.util.Utils;
-import com.zhongzheng.framework.config.properties.DruidProperties;
-import com.zhongzheng.framework.datasource.DynamicDataSource;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.boot.web.servlet.FilterRegistrationBean;
-import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.DependsOn;
-import org.springframework.context.annotation.Primary;
-
-import javax.servlet.*;
-import javax.sql.DataSource;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
 
 /**
  * druid 配置多数据源
@@ -30,133 +10,133 @@ import java.util.Map;
 @Configuration
 public class DruidConfig
 {
-
-    /**
-     * 主库数据源bean名称
-     */
-    public static final String MASTER_DATASOURCE = "masterDataSource";
-    /**
-     * 从库数据源bean名称
-     */
-    public static final String SLAVE_DATASOURCE = "slaveDataSource";
-
-
-    @Bean(MASTER_DATASOURCE)
-    @ConfigurationProperties("spring.datasource.druid.master")
-    public DruidDataSource masterDataSource(DruidProperties druidProperties)
-    {
-        DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
-        return druidProperties.dataSource(dataSource);
-    }
-
-    @Bean(SLAVE_DATASOURCE)
-    @ConfigurationProperties("spring.datasource.druid.slave")
-    @ConditionalOnProperty(prefix = "spring.datasource.druid.slave", name = "enabled", havingValue = "true")
-    public DruidDataSource slaveDataSource(DruidProperties druidProperties)
-    {
-        DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
-        return druidProperties.dataSource(dataSource);
-    }
-
-//    @Bean(name = "dynamicDataSource")
-//    @Primary
-//    public DynamicDataSource dataSource(DataSource masterDataSource)
+//
+//    /**
+//     * 主库数据源bean名称
+//     */
+//    public static final String MASTER_DATASOURCE = "masterDataSource";
+//    /**
+//     * 从库数据源bean名称
+//     */
+//    public static final String SLAVE_DATASOURCE = "slaveDataSource";
+//
+//
+//    @Bean(MASTER_DATASOURCE)
+//    @ConfigurationProperties("spring.datasource.druid.master")
+//    public DruidDataSource masterDataSource(DruidProperties druidProperties)
 //    {
-//        Map<Object, Object> targetDataSources = new HashMap<>();
-//        targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
-//        setDataSource(targetDataSources, DataSourceType.SLAVE.name(), "slaveDataSource");
-//        return new DynamicDataSource(masterDataSource, targetDataSources);
+//        DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
+//        return druidProperties.dataSource(dataSource);
 //    }
-
-    /**
-     * 数据源配置
-     * @param masterDataSource      主库数据源对象
-     * @param slaveDataSource       从库数据源对象
-     * @return                      DataSource
-     * @Primary                     优先使用这个DataSource对象bean
-     */
-    @Bean
-    @Primary
-    @DependsOn(value = {MASTER_DATASOURCE, SLAVE_DATASOURCE})
-    public DataSource routingDataSource(@Qualifier(MASTER_DATASOURCE) DruidDataSource masterDataSource,
-                                        @Qualifier(SLAVE_DATASOURCE) DruidDataSource slaveDataSource) {
-        if (StringUtils.isBlank(slaveDataSource.getUrl())) {
-            return masterDataSource;
-        }
-        Map<Object, Object> map = new HashMap<>();
-        map.put(DruidConfig.MASTER_DATASOURCE, masterDataSource);
-        map.put(DruidConfig.SLAVE_DATASOURCE, slaveDataSource);
-        //设置动态数据源
-        DynamicDataSource routing = new DynamicDataSource(masterDataSource,map);
+//
+//    @Bean(SLAVE_DATASOURCE)
+//    @ConfigurationProperties("spring.datasource.druid.slave")
+//    @ConditionalOnProperty(prefix = "spring.datasource.druid.slave", name = "enabled", havingValue = "true")
+//    public DruidDataSource slaveDataSource(DruidProperties druidProperties)
+//    {
+//        DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
+//        return druidProperties.dataSource(dataSource);
+//    }
+//
+////    @Bean(name = "dynamicDataSource")
+////    @Primary
+////    public DynamicDataSource dataSource(DataSource masterDataSource)
+////    {
+////        Map<Object, Object> targetDataSources = new HashMap<>();
+////        targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
+////        setDataSource(targetDataSources, DataSourceType.SLAVE.name(), "slaveDataSource");
+////        return new DynamicDataSource(masterDataSource, targetDataSources);
+////    }
+//
+//    /**
+//     * 数据源配置
+//     * @param masterDataSource      主库数据源对象
+//     * @param slaveDataSource       从库数据源对象
+//     * @return                      DataSource
+//     * @Primary                     优先使用这个DataSource对象bean
+//     */
+//    @Bean
+//    @Primary
+//    @DependsOn(value = {MASTER_DATASOURCE, SLAVE_DATASOURCE})
+//    public DataSource routingDataSource(@Qualifier(MASTER_DATASOURCE) DruidDataSource masterDataSource,
+//                                        @Qualifier(SLAVE_DATASOURCE) DruidDataSource slaveDataSource) {
+//        if (StringUtils.isBlank(slaveDataSource.getUrl())) {
+//            return masterDataSource;
+//        }
+//        Map<Object, Object> map = new HashMap<>();
+//        map.put(DruidConfig.MASTER_DATASOURCE, masterDataSource);
+//        map.put(DruidConfig.SLAVE_DATASOURCE, slaveDataSource);
 //        //设置动态数据源
-//        routing.setTargetDataSources(map);
-//        //设置默认数据源
-//        routing.setDefaultTargetDataSource(masterDataSource);
-        return routing;
-    }
-    
+//        DynamicDataSource routing = new DynamicDataSource(masterDataSource,map);
+////        //设置动态数据源
+////        routing.setTargetDataSources(map);
+////        //设置默认数据源
+////        routing.setDefaultTargetDataSource(masterDataSource);
+//        return routing;
+//    }
+//
+////    /**
+////     * 设置数据源
+////     *
+////     * @param targetDataSources 备选数据源集合
+////     * @param sourceName 数据源名称
+////     * @param beanName bean名称
+////     */
+////    public void setDataSource(Map<Object, Object> targetDataSources, String sourceName, String beanName)
+////    {
+////        try
+////        {
+////            DataSource dataSource = SpringUtils.getBean(beanName);
+////            targetDataSources.put(sourceName, dataSource);
+////        }
+////        catch (Exception e)
+////        {
+////        }
+////    }
+//
 //    /**
-//     * 设置数据源
-//     *
-//     * @param targetDataSources 备选数据源集合
-//     * @param sourceName 数据源名称
-//     * @param beanName bean名称
+//     * 去除监控页面底部的广告
 //     */
-//    public void setDataSource(Map<Object, Object> targetDataSources, String sourceName, String beanName)
+//    @SuppressWarnings({ "rawtypes", "unchecked" })
+//    @Bean
+//    @ConditionalOnProperty(name = "spring.datasource.druid.statViewServlet.enabled", havingValue = "true")
+//    public FilterRegistrationBean removeDruidFilterRegistrationBean(DruidStatProperties properties)
 //    {
-//        try
-//        {
-//            DataSource dataSource = SpringUtils.getBean(beanName);
-//            targetDataSources.put(sourceName, dataSource);
-//        }
-//        catch (Exception e)
+//        // 获取web监控页面的参数
+//        DruidStatProperties.StatViewServlet config = properties.getStatViewServlet();
+//        // 提取common.js的配置路径
+//        String pattern = config.getUrlPattern() != null ? config.getUrlPattern() : "/druid/*";
+//        String commonJsPattern = pattern.replaceAll("\\*", "js/common.js");
+//        final String filePath = "support/http/resources/js/common.js";
+//        // 创建filter进行过滤
+//        Filter filter = new Filter()
 //        {
-//        }
+//            @Override
+//            public void init(javax.servlet.FilterConfig filterConfig) throws ServletException
+//            {
+//            }
+//            @Override
+//            public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
+//                    throws IOException, ServletException
+//            {
+//                chain.doFilter(request, response);
+//                // 重置缓冲区,响应头不会被重置
+////                response.resetBuffer();
+//                // 获取common.js
+//                String text = Utils.readFromResource(filePath);
+//                // 正则替换banner, 除去底部的广告信息
+//                text = text.replaceAll("<a.*?banner\"></a><br/>", "");
+//                text = text.replaceAll("powered.*?shrek.wang</a>", "");
+//                response.getWriter().write(text);
+//            }
+//            @Override
+//            public void destroy()
+//            {
+//            }
+//        };
+//        FilterRegistrationBean registrationBean = new FilterRegistrationBean();
+//        registrationBean.setFilter(filter);
+//        registrationBean.addUrlPatterns(commonJsPattern);
+//        return registrationBean;
 //    }
-
-    /**
-     * 去除监控页面底部的广告
-     */
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    @Bean
-    @ConditionalOnProperty(name = "spring.datasource.druid.statViewServlet.enabled", havingValue = "true")
-    public FilterRegistrationBean removeDruidFilterRegistrationBean(DruidStatProperties properties)
-    {
-        // 获取web监控页面的参数
-        DruidStatProperties.StatViewServlet config = properties.getStatViewServlet();
-        // 提取common.js的配置路径
-        String pattern = config.getUrlPattern() != null ? config.getUrlPattern() : "/druid/*";
-        String commonJsPattern = pattern.replaceAll("\\*", "js/common.js");
-        final String filePath = "support/http/resources/js/common.js";
-        // 创建filter进行过滤
-        Filter filter = new Filter()
-        {
-            @Override
-            public void init(javax.servlet.FilterConfig filterConfig) throws ServletException
-            {
-            }
-            @Override
-            public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
-                    throws IOException, ServletException
-            {
-                chain.doFilter(request, response);
-                // 重置缓冲区,响应头不会被重置
-//                response.resetBuffer();
-                // 获取common.js
-                String text = Utils.readFromResource(filePath);
-                // 正则替换banner, 除去底部的广告信息
-                text = text.replaceAll("<a.*?banner\"></a><br/>", "");
-                text = text.replaceAll("powered.*?shrek.wang</a>", "");
-                response.getWriter().write(text);
-            }
-            @Override
-            public void destroy()
-            {
-            }
-        };
-        FilterRegistrationBean registrationBean = new FilterRegistrationBean();
-        registrationBean.setFilter(filter);
-        registrationBean.addUrlPatterns(commonJsPattern);
-        return registrationBean;
-    }
 }

+ 1 - 2
zhongzheng-framework/src/main/java/com/zhongzheng/framework/config/SecurityConfig.java

@@ -16,7 +16,6 @@ import org.springframework.security.config.annotation.method.configuration.Enabl
 import org.springframework.security.config.annotation.web.builders.HttpSecurity;
 import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
 import org.springframework.security.config.http.SessionCreationPolicy;
-import org.springframework.security.core.userdetails.UserDetailsService;
 import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
 import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
 import org.springframework.security.web.authentication.logout.LogoutFilter;
@@ -39,7 +38,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
     @Autowired
     private TopUserDetailsServiceImpl topUserDetailsService;
 
-    @Value("${mybatis-plus.tenant.enabled-tenant:true}")
+    @Value("${mybatis-plus.tenant.enabled-tenant:false}")
     private boolean enabledTenant;
 
     /**

+ 62 - 64
zhongzheng-framework/src/main/java/com/zhongzheng/framework/config/properties/DruidProperties.java

@@ -1,8 +1,6 @@
 package com.zhongzheng.framework.config.properties;
 
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Configuration;
-import com.alibaba.druid.pool.DruidDataSource;
 
 /**
  * druid 配置属性
@@ -12,66 +10,66 @@ import com.alibaba.druid.pool.DruidDataSource;
 @Configuration
 public class DruidProperties
 {
-    @Value("${spring.datasource.druid.initialSize}")
-    private int initialSize;
-
-    @Value("${spring.datasource.druid.minIdle}")
-    private int minIdle;
-
-    @Value("${spring.datasource.druid.maxActive}")
-    private int maxActive;
-
-    @Value("${spring.datasource.druid.maxWait}")
-    private int maxWait;
-
-    @Value("${spring.datasource.druid.timeBetweenEvictionRunsMillis}")
-    private int timeBetweenEvictionRunsMillis;
-
-    @Value("${spring.datasource.druid.minEvictableIdleTimeMillis}")
-    private int minEvictableIdleTimeMillis;
-
-    @Value("${spring.datasource.druid.maxEvictableIdleTimeMillis}")
-    private int maxEvictableIdleTimeMillis;
-
-    @Value("${spring.datasource.druid.validationQuery}")
-    private String validationQuery;
-
-    @Value("${spring.datasource.druid.testWhileIdle}")
-    private boolean testWhileIdle;
-
-    @Value("${spring.datasource.druid.testOnBorrow}")
-    private boolean testOnBorrow;
-
-    @Value("${spring.datasource.druid.testOnReturn}")
-    private boolean testOnReturn;
-
-    public DruidDataSource dataSource(DruidDataSource datasource)
-    {
-        /** 配置初始化大小、最小、最大 */
-        datasource.setInitialSize(initialSize);
-        datasource.setMaxActive(maxActive);
-        datasource.setMinIdle(minIdle);
-
-        /** 配置获取连接等待超时的时间 */
-        datasource.setMaxWait(maxWait);
-
-        /** 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 */
-        datasource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
-
-        /** 配置一个连接在池中最小、最大生存的时间,单位是毫秒 */
-        datasource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
-        datasource.setMaxEvictableIdleTimeMillis(maxEvictableIdleTimeMillis);
-
-        /**
-         * 用来检测连接是否有效的sql,要求是一个查询语句,常用select 'x'。如果validationQuery为null,testOnBorrow、testOnReturn、testWhileIdle都不会起作用。
-         */
-        datasource.setValidationQuery(validationQuery);
-        /** 建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。 */
-        datasource.setTestWhileIdle(testWhileIdle);
-        /** 申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 */
-        datasource.setTestOnBorrow(testOnBorrow);
-        /** 归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 */
-        datasource.setTestOnReturn(testOnReturn);
-        return datasource;
-    }
+//    @Value("${spring.datasource.druid.initialSize}")
+//    private int initialSize;
+//
+//    @Value("${spring.datasource.druid.minIdle}")
+//    private int minIdle;
+//
+//    @Value("${spring.datasource.druid.maxActive}")
+//    private int maxActive;
+//
+//    @Value("${spring.datasource.druid.maxWait}")
+//    private int maxWait;
+//
+//    @Value("${spring.datasource.druid.timeBetweenEvictionRunsMillis}")
+//    private int timeBetweenEvictionRunsMillis;
+//
+//    @Value("${spring.datasource.druid.minEvictableIdleTimeMillis}")
+//    private int minEvictableIdleTimeMillis;
+//
+//    @Value("${spring.datasource.druid.maxEvictableIdleTimeMillis}")
+//    private int maxEvictableIdleTimeMillis;
+//
+//    @Value("${spring.datasource.druid.validationQuery}")
+//    private String validationQuery;
+//
+//    @Value("${spring.datasource.druid.testWhileIdle}")
+//    private boolean testWhileIdle;
+//
+//    @Value("${spring.datasource.druid.testOnBorrow}")
+//    private boolean testOnBorrow;
+//
+//    @Value("${spring.datasource.druid.testOnReturn}")
+//    private boolean testOnReturn;
+//
+//    public DruidDataSource dataSource(DruidDataSource datasource)
+//    {
+//        /** 配置初始化大小、最小、最大 */
+//        datasource.setInitialSize(initialSize);
+//        datasource.setMaxActive(maxActive);
+//        datasource.setMinIdle(minIdle);
+//
+//        /** 配置获取连接等待超时的时间 */
+//        datasource.setMaxWait(maxWait);
+//
+//        /** 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 */
+//        datasource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
+//
+//        /** 配置一个连接在池中最小、最大生存的时间,单位是毫秒 */
+//        datasource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
+//        datasource.setMaxEvictableIdleTimeMillis(maxEvictableIdleTimeMillis);
+//
+//        /**
+//         * 用来检测连接是否有效的sql,要求是一个查询语句,常用select 'x'。如果validationQuery为null,testOnBorrow、testOnReturn、testWhileIdle都不会起作用。
+//         */
+//        datasource.setValidationQuery(validationQuery);
+//        /** 建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。 */
+//        datasource.setTestWhileIdle(testWhileIdle);
+//        /** 申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 */
+//        datasource.setTestOnBorrow(testOnBorrow);
+//        /** 归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 */
+//        datasource.setTestOnReturn(testOnReturn);
+//        return datasource;
+//    }
 }

+ 1 - 1
zhongzheng-framework/src/main/java/com/zhongzheng/framework/manager/factory/AsyncFactory.java

@@ -52,7 +52,7 @@ public class AsyncFactory
                 s.append(getBlock(status));
                 s.append(getBlock(message));
                 // 打印信息到日志
-                sys_user_logger.info(s.toString(), args);
+//                sys_user_logger.info(s.toString(), args);
                 // 获取客户端操作系统
                 String os = userAgent.getOs().getName();
                 // 获取客户端浏览器

+ 9 - 9
zhongzheng-framework/src/main/java/com/zhongzheng/framework/security/handle/LogoutSuccessHandlerImpl.java

@@ -40,15 +40,15 @@ public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler
     public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication)
             throws IOException, ServletException
     {
-        LoginUser loginUser = tokenService.getLoginUser(request);
-        if (Validator.isNotNull(loginUser))
-        {
-            String userName = loginUser.getUsername();
-            // 删除用户缓存记录
-            tokenService.delLoginUser(loginUser.getToken());
-            // 记录用户退出日志
-            AsyncManager.me().execute(AsyncFactory.recordLogininfor(userName, Constants.LOGOUT, "退出成功"));
-        }
+            LoginUser loginUser = tokenService.getLoginUser(request);
+            if (Validator.isNotNull(loginUser))
+            {
+                String userName = loginUser.getUsername();
+                // 删除用户缓存记录
+                tokenService.delLoginUser(loginUser.getToken());
+                // 记录用户退出日志
+                AsyncManager.me().execute(AsyncFactory.recordLogininfor(userName, Constants.LOGOUT, "退出成功"));
+            }
         ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(HttpStatus.HTTP_OK, "退出成功")));
     }
 }

+ 2 - 5
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/SysTenantServiceImpl.java

@@ -3,9 +3,9 @@ package com.zhongzheng.framework.web.service;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
-import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
@@ -15,7 +15,6 @@ import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.SecurityUtils;
 import com.zhongzheng.common.utils.ServletUtils;
-import com.zhongzheng.framework.mybatisplus.CustomTenantLineHandler;
 import com.zhongzheng.modules.system.bo.SysTenantAddBo;
 import com.zhongzheng.modules.system.bo.SysTenantAdminBo;
 import com.zhongzheng.modules.system.bo.SysTenantEditBo;
@@ -28,14 +27,11 @@ import com.zhongzheng.modules.system.service.ISysUserService;
 import com.zhongzheng.modules.system.service.ISysWebService;
 import com.zhongzheng.modules.system.vo.SysTenantVo;
 import org.apache.commons.lang3.RandomStringUtils;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Date;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -46,6 +42,7 @@ import java.util.stream.Collectors;
  * @date 2021-08-03
  */
 @Service
+@DS("slave") //指定数据源
 public class SysTenantServiceImpl extends ServiceImpl<SysTenantMapper, SysTenant> implements ISysTenantService {
 
     @Autowired

+ 15 - 0
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/TopSysLoginService.java

@@ -7,6 +7,7 @@ import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.exception.user.CaptchaException;
 import com.zhongzheng.common.exception.user.CaptchaExpireException;
 import com.zhongzheng.common.exception.user.UserPasswordNotMatchException;
+import com.zhongzheng.common.utils.AES;
 import com.zhongzheng.common.utils.MessageUtils;
 import com.zhongzheng.framework.manager.AsyncManager;
 import com.zhongzheng.framework.manager.factory.AsyncFactory;
@@ -19,6 +20,7 @@ import org.springframework.security.core.Authentication;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
+import java.io.InputStream;
 
 /**
  * 登录校验方法
@@ -68,6 +70,19 @@ public class TopSysLoginService
         Authentication authentication = null;
         try
         {
+            String rsaPrivate = null;
+            try {
+                InputStream certStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("config/pri.key");
+                rsaPrivate = AES.getStringByInputStream_1(certStream);
+                certStream.close();
+            } catch (Exception e) {
+                e.printStackTrace();
+
+            }
+            // 该方法会去调用UserDetailsServiceImpl.loadUserByUsername
+            if(password.length()>20){
+                password = AES.decrypt(password,rsaPrivate);
+            }
             // 该方法会去调用UserDetailsServiceImpl.loadUserByUsername
             authentication = authenticationManager
                     .authenticate(new UsernamePasswordAuthenticationToken(username, password));

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/distribution/service/impl/DistributionActivityTemplateServiceImpl.java

@@ -62,6 +62,7 @@ public class DistributionActivityTemplateServiceImpl extends ServiceImpl<Distrib
                 //全部企业
                 vo.setIsAllOrg(1);
             }else {
+                //切数据源
                 List<DistributionActivityTenantVo> activityTenantVos = relationList.stream().map(item -> {
                     SysTenant tenant = iSysTenantService.getById(item.getTenantId());
                     DistributionActivityTenantVo tenantVo = new DistributionActivityTenantVo();

+ 3 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/system/service/impl/SysLogininforServiceImpl.java

@@ -5,12 +5,11 @@ import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zhongzheng.modules.system.domain.SysLogininfor;
-import com.zhongzheng.modules.system.service.ISysLogininforService;
 import com.zhongzheng.modules.system.mapper.SysLogininforMapper;
+import com.zhongzheng.modules.system.service.ISysLogininforService;
 import org.springframework.stereotype.Service;
 
 import java.util.Arrays;
-import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -29,8 +28,8 @@ public class SysLogininforServiceImpl extends ServiceImpl<SysLogininforMapper, S
      */
     @Override
     public void insertLogininfor(SysLogininfor logininfor) {
-        logininfor.setLoginTime(new Date());
-        save(logininfor);
+//        logininfor.setLoginTime(new Date());
+//        save(logininfor);
     }
 
     /**