785834757 пре 5 месеци
родитељ
комит
e251afff75

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

@@ -17,6 +17,7 @@ spring:
       - nacos:mysql
       - nacos:redisson
       - nacos:minio
+      - nacos:logback
 config:
   sso: 0
 

+ 5 - 0
commons/pom.xml

@@ -132,6 +132,11 @@
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-starter-openfeign</artifactId>
         </dependency>
+        <dependency>
+            <groupId>io.opentelemetry</groupId>
+            <artifactId>opentelemetry-api</artifactId>
+            <version>1.41.0</version>
+        </dependency>
     </dependencies>
 
     <build>

+ 37 - 0
commons/src/main/java/com/jzg/commons/config/OpenTelemetryMDCFilter.java

@@ -0,0 +1,37 @@
+package com.jzg.commons.config;
+
+import io.opentelemetry.api.GlobalOpenTelemetry;
+import io.opentelemetry.api.trace.Span;
+import jakarta.servlet.*;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+import org.springframework.web.filter.OncePerRequestFilter;
+
+import java.io.IOException;
+
+@Component
+public class OpenTelemetryMDCFilter extends OncePerRequestFilter {
+
+    @Value("${spring.application.name}")
+    private String serviceName;
+
+    @Override
+    protected void doFilterInternal(HttpServletRequest request,
+                                    HttpServletResponse response,
+                                    FilterChain filterChain)
+            throws ServletException, IOException {
+        Span span = GlobalOpenTelemetry.getTracer(serviceName)
+                .spanBuilder(request.getRequestURI())
+                .startSpan();
+        try (var scope = span.makeCurrent()) {
+            MDC.put("traceId", span.getSpanContext().getTraceId());
+            filterChain.doFilter(request, response);
+        } finally {
+            MDC.clear();
+            span.end();
+        }
+    }
+}

+ 12 - 9
commons/src/main/java/com/jzg/commons/exception/GlobalExceptionHandler.java

@@ -34,19 +34,19 @@ public class GlobalExceptionHandler {
 
     @ExceptionHandler(value = ValidateException.class)
     @ResponseBody
-    public HttpResult ValidateException(ValidateException validateException) {
+    public HttpResult validateException(ValidateException validateException) {
         return HttpResult.error(Integer.parseInt(validateException.getCode()), validateException.getMessage());
     }
 
     @ExceptionHandler(value = NoneException.class)
     @ResponseBody
-    public HttpResult NoneException(NoneException noneException) {
+    public HttpResult noneException(NoneException noneException) {
         return HttpResult.error(Integer.parseInt(noneException.getCode()), noneException.getMessage());
     }
 
     @ExceptionHandler(value = TokenExpireException.class)
     @ResponseBody
-    public HttpResult TokenExpireException(TokenExpireException tokenExpireException) {
+    public HttpResult tokenExpireException(TokenExpireException tokenExpireException) {
         return HttpResult.error(Integer.parseInt(tokenExpireException.getCode()), tokenExpireException.getMessage());
     }
 
@@ -85,12 +85,15 @@ public class GlobalExceptionHandler {
      * @param e 异常
      * @return
      */
-//    @ExceptionHandler(value = Exception.class)
-//    @ResponseBody
-//    public HttpResult exceptionGet(Exception e) {
-//        LOGGER.error("【系统异常】{}", e);
-//        return HttpResult.error(500, "程序异常,请联系管理员");
-//    }
+    @ExceptionHandler(Exception.class)
+    @ResponseBody
+    public HttpResult handleException(HttpServletRequest request, Exception e) {
+        String uri = request.getRequestURI();
+        String method = request.getMethod();
+
+        LOGGER.error("【系统异常】接口 {} {} 出错", method, uri, e);
+        return HttpResult.error(500, "程序异常,请联系管理员");
+    }
 
 
 }

+ 1 - 0
consoleStatistics/pom.xml

@@ -116,6 +116,7 @@
                             <Class-Path>config/</Class-Path>
                         </manifestEntries>
                     </archive>
+                    <outputDirectory>${project.parent.basedir}/target</outputDirectory>
                 </configuration>
             </plugin>
             <plugin>

+ 36 - 0
consoleStatistics/src/main/resources/application-prod.yml

@@ -0,0 +1,36 @@
+server:
+  port: 8086
+spring:
+  cloud:
+    nacos:
+      server-addr: 172.24.144.227:8848
+      username: nacos
+      password: AnrNjNn6zCS3QdIy
+      config:
+        file-extension: yaml
+        namespace: f9ca025f-b5df-47a9-b3f6-15bcbad3ebd3
+        group: DEFAULT_GROUP
+      discovery:
+        namespace: f9ca025f-b5df-47a9-b3f6-15bcbad3ebd3
+  config:
+    import:
+      - nacos:mysql
+      - nacos:redisson
+      - nacos:minio
+      - nacos:rocketmq
+      - nacos:mongodb
+config:
+  sso: 1
+
+#银联API参数配置
+unionPay:
+  api:
+    appId: 10037e6f8e41423b01912b657e5c116c
+    appKey: 1110043747cb40f4911096480ea93f3e
+    accessTokenUrl: https://test-api-open.chinaums.com/v2/token/access
+    twoFactorVerifyUrl: https://test-api-open.chinaums.com/v1/datacenter/smartverification/encrypted/mobile/2factor/verify
+    threeFactorVerifyUrl: https://test-api-open.chinaums.com/v1/datacenter/smartverification/encrypted/mobile/3factor/verify
+    bankCardVerifyUrl: https://test-api-open.chinaums.com/v1/datacenter/smartverification/encrypted/bankcard/verify
+    publicKey: 0414bb7e9c3914bb65b85079b1dc6e1ca2a0ee04dd9bb55b2f8d31704a6dec0cca695739e128f9c931330e1c0f493be4d56244236434c9d344c4716ba64a4470ba
+    privateKey: 24ebfde60aecb81214605050763926ec342c487859a8da57d5badcd3c1559336
+

+ 2 - 0
gateway/src/main/resources/application-prod.yml

@@ -94,6 +94,8 @@ spring:
                   - /accountCard/**
                   - /amountAuditing/**
                   - /newCarJudgeRules/**
+                  - /sysDistributionSetting/**
+                  - /organization/wechat/**
 
         - id: summary_route
           uri: http://172.24.144.227:9898/

+ 5 - 5
gateway/src/main/resources/application.yml

@@ -10,12 +10,12 @@ spring:
     name: jzg-gateway
   redis:
     redisson:
-#      address: redis://172.24.144.227:6379
-#      password: 123456
-#      database: 0
-
-      address: redis://192.168.5.250:6379
+      address: redis://172.24.144.227:6379
       password: 123456
       database: 0
 
+#      address: redis://192.168.5.250:6379
+#      password: 123456
+#      database: 0
+
 isEncrypted: false

+ 1 - 1
partner/src/main/resources/application.yml

@@ -5,7 +5,7 @@ spring:
     allow-circular-references: true
     allow-bean-definition-overriding: true
   profiles:
-    active: dev
+    active: prod
 
 mybatis-plus:
   mapper-locations: classpath*:/mapper/*Mapper.xml

+ 1 - 0
platform/src/main/resources/application-prod.yml

@@ -17,6 +17,7 @@ spring:
       - nacos:mysql
       - nacos:redisson
       - nacos:minio
+      - nacos:logback
 
 
 config:

+ 33 - 0
pom.xml

@@ -43,6 +43,8 @@
     <seate.version>1.7.0</seate.version>
     <weixin-java.version>4.7.0</weixin-java.version>
     <spring-cloud.version>2022.0.0</spring-cloud.version>
+    <opentelemetry.version>1.41.0</opentelemetry.version>
+    <opentelemetry-instrumentation.version>2.7.0</opentelemetry-instrumentation.version>
   </properties>
 
 
@@ -101,6 +103,35 @@
 
 
 
+    <!-- OpenTelemetry 核心 -->
+    <dependency>
+      <groupId>io.opentelemetry</groupId>
+      <artifactId>opentelemetry-api</artifactId>
+      <version>${opentelemetry.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>io.opentelemetry</groupId>
+      <artifactId>opentelemetry-sdk</artifactId>
+      <version>${opentelemetry.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>io.opentelemetry</groupId>
+      <artifactId>opentelemetry-sdk-logs</artifactId>
+      <version>${opentelemetry.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>io.opentelemetry</groupId>
+      <artifactId>opentelemetry-exporter-otlp</artifactId>
+      <version>${opentelemetry.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>io.opentelemetry</groupId>
+      <artifactId>opentelemetry-sdk-common</artifactId>
+      <version>${opentelemetry.version}</version>
+    </dependency>
+
   </dependencies>
 
   <dependencyManagement>
@@ -252,6 +283,8 @@
         <version>${weixin-java.version}</version>
       </dependency>
 
+
+
     </dependencies>
   </dependencyManagement>
 

+ 1 - 0
tenant/costsorrule/src/main/resources/application-prod.yml

@@ -18,4 +18,5 @@ spring:
       - nacos:redisson
       - nacos:minio
       - nacos:rocketmq
+      - nacos:logback
 

+ 1 - 0
tenant/insurance/quotation-summary/src/main/resources/application-prod.yaml

@@ -18,6 +18,7 @@ spring:
       - nacos:mongodb
       - nacos:identify
       - nacos:crawler-config
+      - nacos:logback
 
 #百度图片识别API
 baidu:

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

@@ -18,6 +18,7 @@ spring:
       - nacos:redisson
       - nacos:minio
       - nacos:rocketmq
+      - nacos:logback
 
 config:
   sso: 1