Explorar el Código

Merge remote-tracking branch 'origin/master'

Qchen hace 10 meses
padre
commit
a265eaebb6

+ 10 - 0
gateway/src/main/java/com/jzg/GateWayApplication.java

@@ -1,16 +1,26 @@
 package com.jzg;
 
+import com.jzg.factory.MultiPathRoutePredicateFactory;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+import org.springframework.context.annotation.Bean;
 
 @EnableDiscoveryClient
 @SpringBootApplication(exclude ={DataSourceAutoConfiguration.class},scanBasePackages = "com.jzg")
 public class GateWayApplication {
 
+
+
+
     public static void main(String[] args) {
         SpringApplication.run(GateWayApplication.class, args);
     }
 
+
+    @Bean
+    public MultiPathRoutePredicateFactory multiPathPredicateFactory() {
+        return new MultiPathRoutePredicateFactory();
+    }
 }

+ 37 - 0
gateway/src/main/java/com/jzg/factory/MultiPathRoutePredicateFactory.java

@@ -0,0 +1,37 @@
+package com.jzg.factory;
+import lombok.Getter;
+import org.springframework.cloud.gateway.handler.predicate.AbstractRoutePredicateFactory;
+import org.springframework.util.AntPathMatcher;
+import org.springframework.web.server.ServerWebExchange;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.function.Predicate;
+
+@Component
+public class MultiPathRoutePredicateFactory extends AbstractRoutePredicateFactory<MultiPathRoutePredicateFactory.Config> {
+    private final AntPathMatcher antPathMatcher = new AntPathMatcher();
+
+    public MultiPathRoutePredicateFactory() {
+        super(Config.class);
+    }
+
+    @Getter
+    public static class Config {
+        private List<String> paths;
+
+        public void setPaths(List<String> paths) {
+            this.paths = paths;
+        }
+    }
+
+    @Override
+    public Predicate<ServerWebExchange> apply(Config config) {
+        return exchange -> {
+            String path = exchange.getRequest().getURI().getPath();
+            boolean match = config.getPaths().stream()
+                    .anyMatch(pattern -> antPathMatcher.match(pattern, path));
+            return match;
+        };
+    }
+}

+ 77 - 8
gateway/src/main/resources/application-dev.yml

@@ -13,40 +13,109 @@ spring:
         import-check:
           enabled: false
         file-extension: yaml
-        namespace: 1096345e-2a2d-4307-8025-ee1b669e127b
+        namespace: ba488f58-c785-49b4-9c02-b5d9b8a965a5
         group: DEFAULT_GROUP
       discovery:
-        namespace: 1096345e-2a2d-4307-8025-ee1b669e127b
+        namespace: ba488f58-c785-49b4-9c02-b5d9b8a965a5
 
     gateway:
       routes:
         - id: auth_route
           uri: http://localhost:8081/
           predicates:
-            - Path=/auth/**,/send/sendSmsCode,/appAuth/**
+            - name: MultiPath
+              args:
+                paths:
+                  - /auth/**
+                  - /send/sendSmsCode
+                  - /appAuth/**
 
         - id: platform_route
           uri: http://localhost:8083/
           predicates:
-            - Path=/userRole/**,/system/**,/file/**,/user/**,/esmInsCompany/**,/jyxConfig/**,/qrBarcode/**,/sysDept/**,/manager/**
+            - name: MultiPath
+              args:
+                paths:
+                  - /userRole/**
+                  - /system/**
+                  - /file/**
+                  - /user/**
+                  - /esmInsCompany/**
+                  - /jyxConfig/**
+                  - /qrBarcode/**
+                  - /sysDept/**
+                  - /manager/**
 
         - id: tenant_route
           uri: http://localhost:8084/
           predicates:
-            - Path=/tenant/**,/dept/**,/area/**,/dict/**,/userInfo/**,/sysOrganization/**,/activity/**,/message/**,/messageNotice/**,/poster/**,/agreement/**,/pltAgreement/**,/agreementRules/**,/plt/areaLicense/**,/scheme/**,/schemeRules/**,/schemeRulesAttrLink/**,/schemeRulesAttr/**,/schemeRulesDictLable/**,/schemeRulesUndwrt/**,/schemeRulesUndwrtAttrLink/**,/schemeRulesUndwrtAttr/**,/schemeRulesUndwrtDictLable/**,/schemeRulesUndwrtRules/**,/schemeRulesUndwrtRulesAttrLink/**,/schemeRules,/ptlAgreementCost/**,/ptlAgreementCost/**,/ptlAgreementCostExternal/**,/operatorTrajectory/**,/messageTemplate/**,/message/**,/appUser/**,/userBankCard/**,/accountCard/**,/account/**,/amountAuditing/**,/userAccount/**,/receivable/**,/sysDistributionSetting/**,/organization/**
+            - name: MultiPath
+              args:
+                paths:
+                  - /tenant/**
+                  - /dept/**
+                  - /area/**
+                  - /dict/**
+                  - /userInfo/**
+                  - /sysOrganization/**
+                  - /activity/**
+                  - /message/**
+                  - /messageNotice/**
+                  - /poster/**
+                  - /agreement/**
+                  - /pltAgreement/**
+                  - /agreementRules/**
+                  - /plt/areaLicense/**
+                  - /scheme/**
+                  - /schemeRules/**
+                  - /schemeRulesAttrLink/**
+                  - /schemeRulesAttr/**
+                  - /schemeRulesDictLable/**
+                  - /schemeRulesUndwrt/**
+                  - /schemeRulesUndwrtAttrLink/**
+                  - /schemeRulesUndwrtAttr/**
+                  - /schemeRulesUndwrtDictLable/**
+                  - /schemeRulesUndwrtRules/**
+                  - /schemeRulesUndwrtRulesAttrLink/**
+                  - /schemeRules/**
+                  - /ptlAgreementCost/**
+                  - /ptlAgreementCostExternal/**
+                  - /operatorTrajectory/**
+                  - /messageTemplate/**
+                  - /appUser/**
+                  - /userBankCard/**
+                  - /receivable/**
+                  - /ptlAgreementDispatch/**
 
         - id: summary_route
           uri: http://localhost:9898/
           predicates:
-            - Path= /order/identify/** ,/supplementOrder/**,/order/carModel/**,/unify/**,/order/taskImages/**,/order/qrCode/**,/orderTrack/**,/feeAudit/**,/adjust/**
+            - name: MultiPath
+              args:
+                paths:
+                  - /order/identify/**
+                  - /supplementOrder/**
+                  - /order/carModel/**
+                  - /unify/**
+                  - /order/taskImages/**
+                  - /order/qrCode/**
+                  - /orderTrack/**
+                  - /feeAudit/**
+                  - /adjust/**
 
         - id: costsorrule_route
           uri: http://localhost:8085/
           predicates:
-            - Path=/validate/**
+            - name: MultiPath
+              args:
+                paths:
+                  - /validate/**
 
         #控制台添加网关
         - id: console_route
           uri: http://localhost:8086/
           predicates:
-            - Path=/console/**
+            - name: MultiPath
+              args:
+                paths:
+                  - /console/**

+ 80 - 12
gateway/src/main/resources/application-test.yml

@@ -1,7 +1,12 @@
 spring:
+  minio:
+    url: http://192.168.0.250:9000
+    access-key: v7Zb8XhyLcYNcSHlxvyK
+    secret-key: 58YibMwpxGKtXcekPL065OM4GonC1hf2tFMjI9EN
+    bucket-name: jzg
   cloud:
     nacos:
-      server-addr: 172.24.144.223:8848
+      server-addr: 192.168.0.250:8848
       username: nacos
       password: nacos
       config:
@@ -16,23 +21,86 @@ spring:
     gateway:
       routes:
         - id: auth_route
-          uri: http://172.24.144.223:9081/
+          uri: http://192.168.0.250:8081/
           predicates:
-            - Path=/auth/**
+            - name: MultiPath
+              args:
+                paths:
+                  - /auth/**
+                  - /send/sendSmsCode
+                  - /appAuth/**
 
         - id: platform_route
-          uri: http://172.24.144.223:9083/
+          uri: http://192.168.0.250:8083/
           predicates:
-            - Path=/userRole/**,/system/**,/file/**,/user/**,/esmInsCompany/**,/jyxConfig/**,/qrBarcode/**,/sysDept/**,/manager/**,
+            - name: MultiPath
+              args:
+                paths:
+                - /userRole/**
+                - /system/**
+                - /file/**
+                - /user/**
+                - /esmInsCompany/**
+                - /jyxConfig/**
+                - /qrBarcode/**
+                - /sysDept/**
+                - /manager/**
 
         - id: tenant_route
-          uri: http://172.24.144.223:9084/
+          uri: http://192.168.0.250:8084/
           predicates:
-            - Path=/tenant/**,/dept/**,/area/**,/dict/**,/userInfo/**,/sysOrganization/**,/activity/**,/message/**,/messageNotice/**,,/pltAgreement/**,/agreementRules/**,/poster/**,/agreement/**,/ptl/areaLicense/**,/ptlAgreementCost/**,/scheme/**,/ptlAgreementCostExternal/**,/plt/areaLicense/**,/organization/**
-        #数据报表
-        - id: console_route
-          uri: http://172.24.144.223:9085/
-          predicates:
-            - Path=/console/**
+            - name: MultiPath
+              args:
+                paths:
+                  - /tenant/**
+                  - /dept/**
+                  - /area/**
+                  - /dict/**
+                  - /userInfo/**
+                  - /sysOrganization/**
+                  - /activity/**
+                  - /message/**
+                  - /messageNotice/**
+                  - /poster/**
+                  - /agreement/**
+                  - /pltAgreement/**
+                  - /agreementRules/**
+                  - /plt/areaLicense/**
+                  - /scheme/**
+                  - /schemeRules/**
+                  - /schemeRulesAttrLink/**
+                  - /schemeRulesAttr/**
+                  - /schemeRulesDictLable/**
+                  - /schemeRulesUndwrt/**
+                  - /schemeRulesUndwrtAttrLink/**
+                  - /schemeRulesUndwrtAttr/**
+                  - /schemeRulesUndwrtDictLable/**
+                  - /schemeRulesUndwrtRules/**
+                  - /schemeRulesUndwrtRulesAttrLink/**
+                  - /schemeRules,/ptlAgreementCost/**
+                  - /ptlAgreementCost/**
+                  - /ptlAgreementCostExternal/**
+                  - /operatorTrajectory/**
+                  - /messageTemplate/**
+                  - /message/**
 
+        - id: summary_route
+          uri: http://192.168.0.250:9898/
+          predicates:
+            - name: MultiPath
+              args:
+                paths:
+                  - /order/identify/**
+                  - /supplementOrder/**
+                  - /order/carModel/**
+                  - /unify/**
+                  - /order/taskImages/**
+                  - /order/qrCode/**
 
+        - id: costsorrule_route
+          uri: http://192.168.0.250:8085/
+          predicates:
+            - name: MultiPath
+              args:
+                paths:
+                  - /validate/**

+ 9 - 7
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsOrdersServiceImpl.java

@@ -367,13 +367,15 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
 
         // 业务员信息
         SalesmanVo salesmanInfo = orgClient.getUserByMobile(insOrdersVo.getCreateBy(),baseController.getToken(),baseController.getAppSystemCode());
-        InsOrdersVo.Salesman salesman = new InsOrdersVo.Salesman();
-        salesman.setName(salesmanInfo.getName());
-        salesman.setDeptName(salesmanInfo.getDeptName());
-        salesman.setTypeAttr(salesmanInfo.getTypeAttr());
-        salesman.setDeptId(salesmanInfo.getDeptId());
-        salesman.setMobile(salesmanInfo.getMobile());
-        insOrdersVo.setSalesmanInfo(salesman);
+        if(Objects.nonNull(salesmanInfo)) {
+            InsOrdersVo.Salesman salesman = new InsOrdersVo.Salesman();
+            salesman.setName(salesmanInfo.getName());
+            salesman.setDeptName(salesmanInfo.getDeptName());
+            salesman.setTypeAttr(salesmanInfo.getTypeAttr());
+            salesman.setDeptId(salesmanInfo.getDeptId());
+            salesman.setMobile(salesmanInfo.getMobile());
+            insOrdersVo.setSalesmanInfo(salesman);
+        }
         // 2. 处理车辆用户信息列表
         if (CollectionUtil.isNotEmpty(insOrdersVo.getCarUserInfoList())) {
             for (InsOrdersCarUserInfo carUserInfo : insOrdersVo.getCarUserInfoList()) {