Sfoglia il codice sorgente

修改log4j版本
修改运政接口返回:返回上游错误码

15810770710@163.com 3 anni fa
parent
commit
0012a6de4e

+ 112 - 89
pom.xml

@@ -12,7 +12,7 @@
 
 	<groupId>info.aspirecn.iov.yysj</groupId>
 	<artifactId>cloud-yysj-product-check</artifactId>
-	<version>1.1.6</version>
+	<version>1.0.0</version>
 	<packaging>jar</packaging>
 
 	<name>cloud-yysj-product-check</name>
@@ -23,8 +23,18 @@
 	</properties>
 	<dependencies>
 		<dependency>
-    				<groupId>org.springframework.boot</groupId>
-  			 <artifactId>spring-boot-starter-actuator</artifactId>
+    		<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-actuator</artifactId>
+			<exclusions>
+				<exclusion>
+					<groupId>org.apache.logging.log4j</groupId>
+					<artifactId>log4j-to-slf4j</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>org.apache.logging.log4j</groupId>
+					<artifactId>log4j-api</artifactId>
+				</exclusion>
+			</exclusions>
 		</dependency>
 		<dependency>
 			<groupId>org.springframework.cloud</groupId>
@@ -72,7 +82,7 @@
 		<dependency>
 			<groupId>com.alibaba</groupId>
 			<artifactId>fastjson</artifactId>
-			<version>1.2.66</version>
+			<version>1.2.76</version>
 		</dependency>
 		<dependency>
 			<groupId>commons-io</groupId>
@@ -108,7 +118,16 @@
 			<groupId>com.google.code.gson</groupId>
 			<artifactId>gson</artifactId>
 		</dependency>
-
+		<dependency>
+			<groupId>org.apache.logging.log4j</groupId>
+			<artifactId>log4j-api</artifactId>
+			<version>2.15.0</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.logging.log4j</groupId>
+			<artifactId>log4j-to-slf4j</artifactId>
+			<version>2.15.0</version>
+		</dependency>
 	</dependencies>
 	<dependencyManagement>
 		<dependencies>
@@ -126,93 +145,97 @@
 	<build>
 		<plugins>
 			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-jar-plugin</artifactId>
-				<configuration>
-					<archive>
-						<manifest>
-							<addClasspath>true</addClasspath>
-							<classpathPrefix>lib/</classpathPrefix>
-						</manifest>
-					</archive>
-				</configuration>
-			</plugin>
-			<plugin>
 				<groupId>org.springframework.boot</groupId>
 				<artifactId>spring-boot-maven-plugin</artifactId>
-				<configuration>
-					<includes>
-						<include>
-							<groupId>info.aspirecn.cloud.yysj</groupId>
-							<artifactId>cloud-yysj-commons-lang</artifactId>
-						</include>
-					</includes>
-				</configuration>
-			</plugin>
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-resources-plugin</artifactId>
-				<executions>
-					<execution>
-						<id>default-resources</id>
-						<phase>validate</phase>
-						<goals>
-							<goal>copy-resources</goal>
-						</goals>
-						<configuration>
-							<outputDirectory>target/classes</outputDirectory>
-							<useDefaultDelimiters>false</useDefaultDelimiters>
-							<delimiters>
-								<delimiter>@</delimiter>
-							</delimiters>
-							<resources>
-								<resource>
-									<directory>src/main/resources/config</directory>
-									<targetPath>config</targetPath>
-									<filtering>true</filtering>
-									<includes>
-										<include>**</include>
-									</includes>
-								</resource>
-							</resources>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-dependency-plugin</artifactId>
-				<executions>
-					<execution>
-						<id>copy-dependencies</id>
-						<phase>prepare-package</phase>
-						<goals>
-							<goal>copy-dependencies</goal>
-						</goals>
-						<configuration>
-							<outputDirectory>${project.build.directory}/lib</outputDirectory>
-							<excludeGroupIds>
-								info.aspirecn.cloud.yysj
-							</excludeGroupIds>
-						</configuration>
-					</execution>
-					<execution>
-						<id>copy</id>
-						<phase>install</phase>
-						<goals>
-							<goal>copy-dependencies</goal>
-						</goals>
-						<configuration>
-							<outputDirectory>
-								${project.build.directory}/lib
-							</outputDirectory>
-							<excludeGroupIds>
-								info.aspirecn.cloud.yysj
-							</excludeGroupIds>
-						</configuration>
-					</execution>
-				</executions>
 			</plugin>
+<!--			<plugin>-->
+<!--				<groupId>org.apache.maven.plugins</groupId>-->
+<!--				<artifactId>maven-jar-plugin</artifactId>-->
+<!--				<configuration>-->
+<!--					<archive>-->
+<!--						<manifest>-->
+<!--							<addClasspath>true</addClasspath>-->
+<!--							<classpathPrefix>lib/</classpathPrefix>-->
+<!--						</manifest>-->
+<!--					</archive>-->
+<!--				</configuration>-->
+<!--			</plugin>-->
+<!--			<plugin>-->
+<!--				<groupId>org.springframework.boot</groupId>-->
+<!--				<artifactId>spring-boot-maven-plugin</artifactId>-->
+<!--				<configuration>-->
+<!--					<includes>-->
+<!--						<include>-->
+<!--							<groupId>info.aspirecn.cloud.yysj</groupId>-->
+<!--							<artifactId>cloud-yysj-commons-lang</artifactId>-->
+<!--						</include>-->
+<!--					</includes>-->
+<!--				</configuration>-->
+<!--			</plugin>-->
+<!--			<plugin>-->
+<!--				<groupId>org.apache.maven.plugins</groupId>-->
+<!--				<artifactId>maven-resources-plugin</artifactId>-->
+<!--				<executions>-->
+<!--					<execution>-->
+<!--						<id>default-resources</id>-->
+<!--						<phase>validate</phase>-->
+<!--						<goals>-->
+<!--							<goal>copy-resources</goal>-->
+<!--						</goals>-->
+<!--						<configuration>-->
+<!--							<outputDirectory>target/classes</outputDirectory>-->
+<!--							<useDefaultDelimiters>false</useDefaultDelimiters>-->
+<!--							<delimiters>-->
+<!--								<delimiter>@</delimiter>-->
+<!--							</delimiters>-->
+<!--							<resources>-->
+<!--								<resource>-->
+<!--									<directory>src/main/resources/config</directory>-->
+<!--									<targetPath>config</targetPath>-->
+<!--									<filtering>true</filtering>-->
+<!--									<includes>-->
+<!--										<include>**</include>-->
+<!--									</includes>-->
+<!--								</resource>-->
+<!--							</resources>-->
+<!--						</configuration>-->
+<!--					</execution>-->
+<!--				</executions>-->
+<!--			</plugin>-->
+<!--			<plugin>-->
+<!--				<groupId>org.apache.maven.plugins</groupId>-->
+<!--				<artifactId>maven-dependency-plugin</artifactId>-->
+<!--				<executions>-->
+<!--					<execution>-->
+<!--						<id>copy-dependencies</id>-->
+<!--						<phase>prepare-package</phase>-->
+<!--						<goals>-->
+<!--							<goal>copy-dependencies</goal>-->
+<!--						</goals>-->
+<!--						<configuration>-->
+<!--							<outputDirectory>${project.build.directory}/lib</outputDirectory>-->
+<!--							<excludeGroupIds>-->
+<!--								info.aspirecn.cloud.yysj-->
+<!--							</excludeGroupIds>-->
+<!--						</configuration>-->
+<!--					</execution>-->
+<!--					<execution>-->
+<!--						<id>copy</id>-->
+<!--						<phase>install</phase>-->
+<!--						<goals>-->
+<!--							<goal>copy-dependencies</goal>-->
+<!--						</goals>-->
+<!--						<configuration>-->
+<!--							<outputDirectory>-->
+<!--								${project.build.directory}/lib-->
+<!--							</outputDirectory>-->
+<!--							<excludeGroupIds>-->
+<!--								info.aspirecn.cloud.yysj-->
+<!--							</excludeGroupIds>-->
+<!--						</configuration>-->
+<!--					</execution>-->
+<!--				</executions>-->
+<!--			</plugin>-->
 
 
 

+ 4 - 3
src/main/java/info/aspirecn/iov/yysj/product/check/common/ZuulHelper.java

@@ -315,9 +315,10 @@ public class ZuulHelper {
 					errorResponse.setResultList(emptyList);
 				} else {
 					// 查询失败
-					result = Constants.inconsistent_code;
-					errorResponse.setCode(Constants.ErrorCode.Exception.getErrorCode());
-					billItemResult.setExceptionInformation(errorResponse);
+					result =Constants.inconsistent_code;
+					inconsistentList.add(Constants.errorInfo + ":" + responseObject.getResultBody());
+					errorResponse.setCode(Constants.ErrorCode.INCONSISTENT_DETAIL_STRING.getErrorCode());
+					errorResponse.setResultList(inconsistentList);
 				}
 			} else if (String.valueOf(productMap.get("clrwyz")).equals(String.valueOf(productId))) {
 				if ("1".equals(responseObject.getResultCode())) {

+ 0 - 1
src/main/java/info/aspirecn/iov/yysj/product/check/pre/WayBillFilter.java

@@ -57,7 +57,6 @@ public class WayBillFilter extends ZuulFilter {
 			String yysjTraceId = request.getHeader(Constants.HEADER_TRACEID_KEY);
 			String userId = request.getHeader(Constants.USER_ID_KEY);
 			log.info("WayBillFilter.userId:{}", userId);
-
 			String body = helper.getCustomBody(request);
 			ProductCheckRequest productCheckRequest = mapper.readValue(body, ProductCheckRequest.class);
 			List<String> sjjhProductIds = productCheckRequest.getSjjhProductId();

+ 1 - 1
src/main/resources/config/cloud-yysj-product-check.yaml

@@ -5,7 +5,7 @@
   productMap: {clxszyz: 30000248,ryjszyz: 30000250,rycyzgyz: 30000251,clyyyz: 30000249,qyyyxkyz_jyxkzh: 30000257,
                qyyyxkyz_tyshdm: 30000255,clrwyz: 30000275,tyrsfyz_person: 30000254,tyrsfyz_enterprise: 30000255,
                zhdwyz: 30000253,xhdwyz: 30000253,czyz: 30000258,sfzyz: 30000077,zxhdwyz: 30000269,clgjhy: 30000270,
-               rycyzgz: 30000273,clcyzgz: 30000272,qycyzgz: 30000274}
+               rycyzgz: 30000273,clcyzgz: 30000272,qycyzgz: 30000274,sjsfyz: 30000276}
   products: {clxszyz: 30000074,ryjszyz: 30000075,qyyyxkyz_jyxkzh: 30000080,qyyyxkyz_tyshdm: 30000082}
   errorCode: 501,502,503,504,505,506,507,510,530,531,532,535,534,536,511,-1003,533,537,538,3
 spring: