785834757 1 год назад
Родитель
Сommit
8f4cfc8027

+ 6 - 0
authentication/dependency-reduced-pom.xml

@@ -182,5 +182,11 @@
       <version>2.0.43</version>
       <scope>provided</scope>
     </dependency>
+    <dependency>
+      <groupId>de.siegmar</groupId>
+      <artifactId>logback-gelf</artifactId>
+      <version>5.0.0</version>
+      <scope>provided</scope>
+    </dependency>
   </dependencies>
 </project>

+ 2 - 1
authentication/src/main/java/com/jzg/AuthenticationApplication.java

@@ -3,8 +3,9 @@ package com.jzg;
 
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 
-
+@EnableDiscoveryClient
 @SpringBootApplication
 public class AuthenticationApplication {
 

+ 20 - 19
authentication/src/main/resources/application-dev.yml

@@ -1,23 +1,24 @@
-
+server:
+  port: 8081
 spring:
-  redis:
-    redisson:
-      address: redis://192.168.0.250:6379
-      password: 123456
-      database: 0
-
-  datasource:
-    url: jdbc:mysql://39.98.239.48:3366/platform?serverTimezone=Asia/Shanghai&allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true
-    username: root
-    password: '@RqGHG#KZ*C9ytkQ'
-    driverClassName: com.mysql.cj.jdbc.Driver
-
+  application:
+    name: jzg-auth
+  cloud:
+    nacos:
+      server-addr: 192.168.0.250:8848
+      username: nacos
+      password: nacos
+      config:
+        file-extension: yaml
+        namespace: bfe09cf4-508a-4443-acfa-b354be6f4bac
+        group: DEFAULT_GROUP
+      discovery:
+        namespace: bfe09cf4-508a-4443-acfa-b354be6f4bac
+  config:
+    import:
+      - nacos:mysql
+      - nacos:redisson
+      - nacos:minio
 config:
   sso: 0
 
-
-minio:
-  url: http://192.168.0.250:9000
-  access-key: v7Zb8XhyLcYNcSHlxvyK
-  secret-key: 58YibMwpxGKtXcekPL065OM4GonC1hf2tFMjI9EN
-  bucket-name: jzg

+ 2 - 1
authentication/src/main/resources/application-test.yml

@@ -1,4 +1,5 @@
-
+server:
+  port: 9081
 spring:
   redis:
     redisson:

+ 0 - 1
authentication/src/main/resources/application.yml

@@ -1,7 +1,6 @@
 spring:
   profiles:
     active: dev
-
   main:
     allow-bean-definition-overriding: true
 

+ 0 - 1
commons/src/main/java/com/jzg/commons/config/RedissonConfig.java

@@ -2,7 +2,6 @@ package com.jzg.commons.config;
 
 import org.redisson.Redisson;
 import org.redisson.api.RedissonClient;
-import org.redisson.codec.JsonJacksonCodec;
 import org.redisson.config.Config;
 import org.redisson.config.SingleServerConfig;
 import org.springframework.beans.factory.annotation.Value;

+ 1 - 1
gateway/src/main/resources/application-dev.yml

@@ -10,7 +10,7 @@ spring:
         - id: platform_route
           uri: http://localhost:8083/
           predicates:
-            - Path=/userRole/**,/system/**,/file/**,/user/**,/esmInsCompany/**,/jyxConfig/**,/qrBarcode/**,/sysDept/**
+            - Path=/userRole/**,/system/**,/file/**,/user/**,/esmInsCompany/**,/jyxConfig/**,/qrBarcode/**,/sysDept/**,/manager/**
 
         - id: tenant_route
           uri: http://localhost:8084/

+ 5 - 0
platform/pom.xml

@@ -24,6 +24,11 @@
 <!--            <groupId>org.springframework.cloud</groupId>-->
 <!--            <artifactId>spring-cloud-starter-zipkin</artifactId>-->
 <!--            <version>2.2.8.RELEASE</version>-->
+<!--        </dependency>-->
+
+<!--        <dependency>-->
+<!--            <groupId>io.seata</groupId>-->
+<!--            <artifactId>seata-spring-boot-starter</artifactId>-->
 <!--        </dependency>-->
 
         <dependency>

+ 8 - 3
platform/src/main/java/com/jzg/controller/ClauseController.java

@@ -1,5 +1,7 @@
 package com.jzg.controller;
 
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.po.InsCompanyClause;
@@ -16,6 +18,9 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * 特别约定管理
  */
@@ -68,13 +73,13 @@ public class ClauseController {
 
     /**
      * 删除特别约定
-     * @param id
+     * @param ids
      * @return
      */
     @Operation(summary = "删除特别约定")
     @PostMapping(value = "deleteClause")
-    public HttpResult deleteClause(@RequestSingleParam(value = "id") String id){
-        return insCompanyClauseService.removeById(id)? HttpResult.ok("删除特约成功") : HttpResult.error("删除特约失败");
+    public HttpResult deleteClause(@RequestBody List<String> ids){
+        return insCompanyClauseService.removeByIds(ids)? HttpResult.ok("删除特约成功") : HttpResult.error("删除特约失败");
     }
 
 }

+ 1 - 0
platform/src/main/java/com/jzg/service/impl/SysDeptServiceImpl.java

@@ -15,6 +15,7 @@ import com.jzg.commons.util.StringUtils;
 import com.jzg.commons.util.idgen.IdGenerate;
 import com.jzg.mapper.SysDeptMapper;
 import com.jzg.service.*;
+//import io.seata.spring.annotation.GlobalTransactional;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;

+ 34 - 21
platform/src/main/resources/application-dev.yml

@@ -1,34 +1,47 @@
 server:
   port: 8083
 spring:
-
-#  zipkin:
-#    base-url: http://192.168.0.250:9411
-#  sleuth:
-#    sampler:
-#      probability: 1.0
-  redis:
-    redisson:
-      address: redis://192.168.0.250:6379
-      password: 123456
+  application:
+    name: jzg-platform
+  cloud:
+    nacos:
+      server-addr: 192.168.0.250:8848
+      username: nacos
+      password: nacos
+      config:
+        file-extension: yaml
+        namespace: bfe09cf4-508a-4443-acfa-b354be6f4bac
+        group: DEFAULT_GROUP
+      discovery:
+        namespace: bfe09cf4-508a-4443-acfa-b354be6f4bac
+  config:
+    import:
+      - nacos:mysql
+      - nacos:redisson
+      - nacos:minio
   servlet:
     multipart:
       max-file-size: 5MB
       max-request-size: 5MB
 
-  datasource:
-      url: jdbc:mysql://39.98.239.48:3366/platform?serverTimezone=Asia/Shanghai&allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true
-      username: root
-      password: '@RqGHG#KZ*C9ytkQ'
-      driverClassName: com.mysql.cj.jdbc.Driver
-
 config:
   sso: 1
 
 
-minio:
-  url: http://192.168.0.250:9000
-  access-key: v7Zb8XhyLcYNcSHlxvyK
-  secret-key: 58YibMwpxGKtXcekPL065OM4GonC1hf2tFMjI9EN
-  bucket-name: jzg
+#seata:
+#  application-id: platform-service
+#  tx-service-group: my_global_tx_group  # 事务服务组
+#  enable-auto-data-source-proxy: true  # 启用数据源代理
+#  service:
+#    vgroup-mapping:
+#      my_global_tx_group: default  # 事务组与 Seata Server 绑定
+#  store:
+#    mode: db  # 存储模式,可以是 db 或 file 等
+#    db:
+#      datasource:
+#        driver-class-name: com.mysql.cj.jdbc.Driver
+#        url: jdbc:mysql://39.98.239.48:3306/seata
+#        username: root
+#        password: '@RqGHG#KZ*C9ytkQ'
+
 

+ 30 - 0
pom.xml

@@ -38,6 +38,7 @@
     <guava.version>29.0-jre</guava.version>
     <rocketmq.version>2.2.1</rocketmq.version>
     <rocket.version>1.0-SNAPSHOT</rocket.version>
+    <seate.version>1.7.0</seate.version>
   </properties>
 
 
@@ -82,10 +83,37 @@
       <version>5.0.0</version>
     </dependency>
 
+    <!--配置中心-->
+    <dependency>
+      <groupId>com.alibaba.cloud</groupId>
+      <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
+    </dependency>
+
+    <!--服务发现-->
+    <dependency>
+      <groupId>com.alibaba.cloud</groupId>
+      <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+    </dependency>
+
   </dependencies>
   <dependencyManagement>
     <dependencies>
 
+      <dependency>
+        <groupId>com.alibaba.cloud</groupId>
+        <artifactId>spring-cloud-alibaba-dependencies</artifactId>
+        <version>2022.0.0.0</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+
+
+      <dependency>
+        <groupId>io.seata</groupId>
+        <artifactId>seata-spring-boot-starter</artifactId>
+        <version>${seate.version}</version>
+      </dependency>
+
       <!-- Spring Boot Starter Web -->
       <dependency>
         <groupId>org.springframework.boot</groupId>
@@ -204,11 +232,13 @@
         <artifactId>rocketmq-spring-boot-starter</artifactId>
         <version>${rocketmq.version}</version>
       </dependency>
+
       <dependency>
         <groupId>com.jzg</groupId>
         <artifactId>rocketmq</artifactId>
         <version>${rocket.version}</version>
       </dependency>
+
     </dependencies>
   </dependencyManagement>
 

+ 4 - 4
tenant/openfeign/pom.xml

@@ -17,10 +17,10 @@
             <version>3.0.0</version>
         </dependency>
 
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-starter-openfeign</artifactId>
-        </dependency>
+<!--        <dependency>-->
+<!--            <groupId>org.springframework.cloud</groupId>-->
+<!--            <artifactId>spring-cloud-starter-openfeign</artifactId>-->
+<!--        </dependency>-->
 
     </dependencies>
     <build>

+ 2 - 2
tenant/openfeign/src/main/java/com/jzg/openfeign/OpenFeignApplication.java

@@ -3,11 +3,11 @@ package com.jzg.openfeign;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.cloud.openfeign.EnableFeignClients;
+//import org.springframework.cloud.openfeign.EnableFeignClients;
 import org.springframework.context.annotation.ComponentScan;
 
 @SpringBootApplication
-@EnableFeignClients
+//@EnableFeignClients
 @ComponentScan(basePackages = "com.jzg")
 @MapperScan("com.jzg")
 public class OpenFeignApplication {

+ 9 - 9
tenant/openfeign/src/main/java/com/jzg/openfeign/client/SystemClient.java

@@ -1,9 +1,9 @@
-package com.jzg.openfeign.client;
-
-import org.springframework.cloud.openfeign.FeignClient;
-
-@FeignClient("system")
-public interface SystemClient {
-
-
-}
+//package com.jzg.openfeign.client;
+//
+//import org.springframework.cloud.openfeign.FeignClient;
+//
+//@FeignClient("system")
+//public interface SystemClient {
+//
+//
+//}

+ 27 - 27
tenant/openfeign/src/main/java/com/jzg/openfeign/config/FeignConfig.java

@@ -1,27 +1,27 @@
-package com.jzg.openfeign.config;
-
-import feign.RequestInterceptor;
-import jakarta.servlet.http.HttpServletRequest;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.context.request.RequestAttributes;
-import org.springframework.web.context.request.RequestContextHolder;
-import org.springframework.web.context.request.ServletRequestAttributes;
-
-@Configuration
-public class FeignConfig {
-    @Bean
-    public RequestInterceptor requestInterceptor() {
-        //拦截器 设置Token
-        return requestTemplate -> {
-            RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
-            if (requestAttributes instanceof ServletRequestAttributes) {
-                HttpServletRequest request = ((ServletRequestAttributes) requestAttributes).getRequest();
-                String token = request.getHeader("Authorization");
-                if (token != null) {
-                    requestTemplate.header("Authorization", token);
-                }
-            }
-        };
-    }
-}
+//package com.jzg.openfeign.config;
+//
+//import feign.RequestInterceptor;
+//import jakarta.servlet.http.HttpServletRequest;
+//import org.springframework.context.annotation.Bean;
+//import org.springframework.context.annotation.Configuration;
+//import org.springframework.web.context.request.RequestAttributes;
+//import org.springframework.web.context.request.RequestContextHolder;
+//import org.springframework.web.context.request.ServletRequestAttributes;
+//
+//@Configuration
+//public class FeignConfig {
+//    @Bean
+//    public RequestInterceptor requestInterceptor() {
+//        //拦截器 设置Token
+//        return requestTemplate -> {
+//            RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
+//            if (requestAttributes instanceof ServletRequestAttributes) {
+//                HttpServletRequest request = ((ServletRequestAttributes) requestAttributes).getRequest();
+//                String token = request.getHeader("Authorization");
+//                if (token != null) {
+//                    requestTemplate.header("Authorization", token);
+//                }
+//            }
+//        };
+//    }
+//}

+ 4 - 4
tenant/organization/pom.xml

@@ -16,10 +16,10 @@
             <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
 
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-openfeign-core</artifactId>
-        </dependency>
+<!--        <dependency>-->
+<!--            <groupId>org.springframework.cloud</groupId>-->
+<!--            <artifactId>spring-cloud-openfeign-core</artifactId>-->
+<!--        </dependency>-->
 
         <dependency>
             <groupId>com.jzg</groupId>

+ 18 - 47
tenant/organization/src/main/resources/application-dev.yml

@@ -1,16 +1,24 @@
 server:
   port: 8084
 spring:
-  redis:
-    redisson:
-      address: redis://192.168.0.250:6379
-      password: 123456
-
-  datasource:
-      url: jdbc:mysql://39.98.239.48:3366/platform?serverTimezone=Asia/Shanghai&allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true
-      username: root
-      password: '@RqGHG#KZ*C9ytkQ'
-      driverClassName: com.mysql.cj.jdbc.Driver
+  application:
+    name: jzg-platform
+  cloud:
+    nacos:
+      server-addr: 192.168.0.250:8848
+      username: nacos
+      password: nacos
+      config:
+        file-extension: yaml
+        namespace: bfe09cf4-508a-4443-acfa-b354be6f4bac
+        group: DEFAULT_GROUP
+      discovery:
+        namespace: bfe09cf4-508a-4443-acfa-b354be6f4bac
+  config:
+    import:
+      - nacos:mysql
+      - nacos:redisson
+      - nacos:minio
 
 mybatis-plus:
   mapper-locations: classpath*:/mapper/*Mapper.xml
@@ -25,43 +33,6 @@ mybatis-plus:
 config:
   sso: 1
 
-#多租户配置
-tenant:
-  enable: true
-  column: system_code
-  filterTables:
-  ignoreTables:
-    - sys_system
-    - sys_role_perms
-    - sys_area
-    - sys_dict
-    - sys_dict_type
-    - sys_user
-    - sys_user_jzg_info_bank_card
-    - sys_user_role
-    - sys_user_jzg_info_file
-    - sys_organization
-    - sys_organization_user_link
-    - sys_upload_files
-    - sys_config
-    - sys_activity
-    - sys_activity_award
-    - sys_poster_org
-    - sys_message_template
-    - sys_message_user
-    - sys_notice_user
-  ignoreLoginNames:
-
-data-scope:
-  tables:
-    - sys_user_jzg_info
-    - sys_dept
-
-minio:
-  url: http://192.168.0.250:9000
-  access-key: v7Zb8XhyLcYNcSHlxvyK
-  secret-key: 58YibMwpxGKtXcekPL065OM4GonC1hf2tFMjI9EN
-  bucket-name: jzg
 
 rocketmq:
   consumer:

+ 2 - 34
tenant/organization/src/main/resources/application-test.yml

@@ -26,38 +26,6 @@ mybatis-plus:
 config:
   sso: 1
 
-#多租户配置
-tenant:
-  enable: true
-  column: system_code
-  filterTables:
-  ignoreTables:
-    - sys_system
-    - sys_role_perms
-    - sys_area
-    - sys_dict
-    - sys_dict_type
-    - sys_user
-    - sys_user_jzg_info_bank_card
-    - sys_user_role
-    - sys_user_jzg_info_file
-    - sys_organization
-    - sys_organization_user_link
-    - sys_upload_files
-    - sys_config
-    - sys_activity
-    - sys_activity_award
-    - sys_poster_org
-    - sys_message_template
-    - sys_message_user
-    - sys_notice_user
-  ignoreLoginNames:
-
-data-scope:
-  tables:
-    - sys_user_jzg_info
-    - sys_dept
-
 minio:
   url: http://test-api.baoxianzhanggui.com
   access-key: N8hf40VDM3Uf2xJ5vnvE
@@ -70,7 +38,7 @@ rocketmq:
     group: springboot_consumer_group
     # 一次拉取消息最大值,注意是拉取消息的最大值而非消费最大值
     pull-batch-size: 10
-  name-server: 127.0.0.1:9876
+  name-server: 39.98.199.213:9876
   producer:
     # 发送同一类消息的设置为同一个group,保证唯一
     group: springboot_producer_group
@@ -91,4 +59,4 @@ rocketmq:
     # 启动后会自动在topic上拼接激活的配置文件,达到自动隔离的效果
     enabledIsolation: true
     # 隔离环境名称,拼接到topic后,topic_dev,默认空字符串
-    environment: test
+    environment: dev

+ 1 - 2
tenant/organization/src/main/resources/application.yml

@@ -29,7 +29,6 @@ tenant:
     - sys_user_jzg_info_bank_card
     - sys_user_role
     - sys_user_jzg_info_file
-    - sys_organization
     - sys_organization_user_link
     - sys_upload_files
     - sys_config
@@ -43,7 +42,7 @@ tenant:
     - sys_notice_user
   ignoreLoginNames:
 
-ata-scope:
+data-scope:
   tables:
     - sys_user_jzg_info
     - sys_dept

+ 1 - 9
tenant/pom.xml

@@ -51,6 +51,7 @@
             <groupId>org.apache.rocketmq</groupId>
             <artifactId>rocketmq-spring-boot-starter</artifactId>
         </dependency>
+
         <dependency>
             <groupId>com.jzg</groupId>
             <artifactId>rocketmq</artifactId>
@@ -60,15 +61,6 @@
 
     <dependencyManagement>
 
-        <dependencies>
-            <dependency>
-                <groupId>org.springframework.cloud</groupId>
-                <artifactId>spring-cloud-dependencies</artifactId>
-                <version>${cloud.version}</version>
-                <type>pom</type>
-                <scope>import</scope>
-            </dependency>
-        </dependencies>
 
     </dependencyManagement>
     <build>