2 Commits 228859bf36 ... 519b63724e

Autore SHA1 Messaggio Data
  gaoyu 519b63724e 更改pom+ 2 anni fa
  gaoyu fe8b846ec2 更改pass-cloud框架 2 anni fa
56 ha cambiato i file con 1556 aggiunte e 799 eliminazioni
  1. 96 98
      apm-common/pom.xml
  2. 6 4
      apm-common/src/main/java/com/persagy/apm/common/config/FeignExceptionHandler.java
  3. 17 12
      apm-common/src/main/java/com/persagy/apm/common/config/JacksonConfig.java
  4. 6 4
      apm-common/src/main/java/com/persagy/apm/common/config/PoemsFeignExceptionHandler.java
  5. 4 2
      apm-common/src/main/java/com/persagy/apm/common/config/SwaggerDisplayConfig.java
  6. 0 3
      apm-common/src/main/java/com/persagy/apm/common/context/AppContext.java
  7. 3 1
      apm-common/src/main/java/com/persagy/apm/common/context/DefaultAppContext.java
  8. 0 2
      apm-common/src/main/java/com/persagy/apm/common/context/poems/PoemsContext.java
  9. 12 9
      apm-common/src/main/java/com/persagy/apm/common/exception/ApmExceptionHandler.java
  10. 1 0
      apm-common/src/main/java/com/persagy/apm/common/exception/RpcException.java
  11. 10 8
      apm-common/src/main/java/com/persagy/apm/common/handler/AppContextHandler.java
  12. 3 6
      apm-common/src/main/java/com/persagy/apm/common/handler/PoemsContextFilter.java
  13. 6 11
      apm-common/src/main/java/com/persagy/apm/common/handler/PoemsContextHandler.java
  14. 24 14
      apm-common/src/main/java/com/persagy/apm/common/helper/LockHelper.java
  15. 2 1
      apm-common/src/main/java/com/persagy/apm/common/helper/RedisHelper.java
  16. 2 3
      apm-common/src/main/java/com/persagy/apm/common/model/dto/EnumQueryDTO.java
  17. 1 1
      apm-common/src/main/java/com/persagy/apm/common/model/dto/PageDTO.java
  18. 1 4
      apm-common/src/main/java/com/persagy/apm/common/model/dto/PoemsFeignBaseDTO.java
  19. 5 3
      apm-common/src/main/java/com/persagy/apm/common/model/entity/BaseEntity.java
  20. 3 4
      apm-common/src/main/java/com/persagy/apm/common/model/vo/BaseVo.java
  21. 1 1
      apm-common/src/main/java/com/persagy/apm/common/model/vo/EnumVO.java
  22. 58 4
      apm-common/src/main/java/com/persagy/apm/common/model/vo/OldResponseResult.java
  23. 2 1
      apm-common/src/main/java/com/persagy/apm/common/response/CommonResult.java
  24. 1 0
      apm-common/src/main/java/com/persagy/apm/common/response/PoemsFeignResponse.java
  25. 9 7
      apm-common/src/main/java/com/persagy/apm/common/utils/ListUtil.java
  26. 83 73
      apm-common/src/main/java/com/persagy/apm/common/utils/ResultHelper.java
  27. 1 1
      apm-common/src/main/java/com/persagy/apm/common/utils/SecureAES.java
  28. 2 1
      apm-common/src/main/java/com/persagy/apm/common/utils/TypeConvertUtil.java
  29. 48 0
      apm-common/src/main/java/com/persagy/common/constant/DMPConstant.java
  30. 110 0
      apm-common/src/main/java/com/persagy/common/enums/ResponseCode.java
  31. 109 0
      apm-common/src/main/java/com/persagy/common/exception/BusinessException.java
  32. 128 0
      apm-common/src/main/java/com/persagy/common/utils/DMPResponseUtil.java
  33. 50 0
      apm-common/src/main/java/com/persagy/common/utils/ResponseResult.java
  34. 227 0
      apm-common/src/main/java/com/persagy/common/utils/ResponseResultUtil.java
  35. 9 0
      apm-common/src/main/java/com/persagy/security/exception/AESDecryptException.java
  36. 9 0
      apm-common/src/main/java/com/persagy/security/exception/CipherException.java
  37. 2 12
      apm-mybatis/pom.xml
  38. 4 5
      apm-mybatis/src/main/java/com/persagy/apm/mybatis/aop/FormatMybatisQueryParamsAspect.java
  39. 0 36
      apm-mybatis/src/main/java/com/persagy/apm/mybatis/config/MybatisPlusConfig.java
  40. 2 1
      apm-mybatis/src/main/java/com/persagy/apm/mybatis/handler/DbJsonTypeHandler.java
  41. 13 16
      apm-mybatis/src/main/java/com/persagy/apm/mybatis/handler/DynamicDataSourceHandler.java
  42. 1 1
      apm-package/pom.xml
  43. 413 376
      apm-parent/pom.xml
  44. 7 13
      apm-server/pom.xml
  45. 5 5
      apm-server/src/main/java/com/persagy/ServerApplication.java
  46. 2 17
      apm-translate/pom.xml
  47. 1 0
      apm-translate/src/main/java/com/persagy/apm/translate/dao/ITranslateDao.java
  48. 4 2
      apm-translate/src/main/java/com/persagy/apm/translate/extension/BeanTransWrapperBuilder.java
  49. 1 0
      apm-translate/src/main/java/com/persagy/apm/translate/extension/MapPairResultHandler.java
  50. 1 0
      apm-translate/src/main/java/com/persagy/apm/translate/extension/MapResultHandler.java
  51. 1 0
      apm-translate/src/main/java/com/persagy/apm/translate/helper/EmojiCharsTranslator.java
  52. 10 8
      apm-translate/src/main/java/com/persagy/apm/translate/impl/DBTranslateHandleImpl.java
  53. 11 9
      apm-translate/src/main/java/com/persagy/apm/translate/impl/ServiceTranslateHandleImpl.java
  54. 22 13
      apm-translate/src/main/java/com/persagy/apm/translate/impl/TranslateServiceImpl.java
  55. 6 6
      apm-translate/src/main/java/com/persagy/apm/translate/model/TransMeta.java
  56. 1 1
      pom.xml

+ 96 - 98
apm-common/pom.xml

@@ -1,100 +1,98 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>apm-parent</artifactId>
-        <groupId>com.persagy</groupId>
-        <version>v1.2.0-SNAPSHOT</version>
-        <relativePath>../apm-parent</relativePath>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>apm-common</artifactId>
-    <repositories>
-        <repository>
-            <id>persagy</id>
-            <name>releases Repository</name>
-            <url>http://47.93.132.139:8081/nexus/content/repositories/persagy/</url>
-        </repository>
-        <repository>
-            <id>integrated</id>
-            <name>releases Repository</name>
-            <url>http://47.93.132.139:8081/nexus/content/repositories/integrated/</url>
-        </repository>
-    </repositories>
-    <dependencies>
-        <!-- 集成框架工具类 -->
-        <dependency>
-            <groupId>com.persagy</groupId>
-            <artifactId>integrated-common-core</artifactId>
-        </dependency>
-
-        <!-- 集成框架安全校验类 -->
-        <dependency>
-            <groupId>com.persagy</groupId>
-            <artifactId>integrated-common-security</artifactId>
-        </dependency>
-
-        <!-- web -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
-        </dependency>
-
-        <!-- jackson -->
-        <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-annotations</artifactId>
-            <version>2.11.3</version>
-        </dependency>
-        <!-- google工具类(easyCode模板中使用到了其中的方法) -->
-        <dependency>
-            <groupId>com.google.guava</groupId>
-            <artifactId>guava</artifactId>
-        </dependency>
-        <!-- mysql -->
-        <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-        </dependency>
-        <!-- alibaba druid -->
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>druid-spring-boot-starter</artifactId>
-        </dependency>
-        <!-- mapstruct 优雅的进行bean与dto的转换 -->
-        <dependency>
-            <groupId>org.mapstruct</groupId>
-            <artifactId>mapstruct-jdk8</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.mapstruct</groupId>
-            <artifactId>mapstruct-processor</artifactId>
-        </dependency>
-        <!-- mybatisPlus相关的依赖 end -->
-
-        <!-- redis -->
-        <dependency>
-            <groupId>com.persagy</groupId>
-            <artifactId>integrated-redis-spring-boot-starter</artifactId>
-        </dependency>
-
-        <!-- 拼音库 -->
-        <dependency>
-            <groupId>io.github.biezhi</groupId>
-            <artifactId>TinyPinyin</artifactId>
-            <version>2.0.3.RELEASE</version>
-        </dependency>
-        <dependency>
-            <groupId>io.springfox</groupId>
-            <artifactId>springfox-spi</artifactId>
-            <version>2.9.2</version>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
-            <groupId>com.github.xiaoymin</groupId>
-            <artifactId>knife4j-spring-boot-starter</artifactId>
-            <version>2.0.3</version>
-        </dependency>
-    </dependencies>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<artifactId>apm-parent</artifactId>
+		<groupId>com.persagy</groupId>
+		<version>v1.3.0-SNAPSHOT</version>
+		<relativePath>../apm-parent</relativePath>
+	</parent>
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>apm-common</artifactId>
+	<repositories>
+		<repository>
+			<id>persagy</id>
+			<name>releases Repository</name>
+			<url>http://47.93.132.139:8081/nexus/content/repositories/persagy/</url>
+		</repository>
+		<repository>
+			<id>integrated</id>
+			<name>releases Repository</name>
+			<url>http://47.93.132.139:8081/nexus/content/repositories/integrated/</url>
+		</repository>
+	</repositories>
+	<dependencies>
+		<!-- 集成框架工具类 -->
+		<dependency>
+			<groupId>com.persagy</groupId>
+			<artifactId>starter-cloud</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>com.persagy</groupId>
+			<artifactId>starter-redis</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>com.persagy</groupId>
+			<artifactId>starter-excel</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>com.persagy</groupId>
+			<artifactId>starter-rabbitmq</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>com.persagy</groupId>
+			<artifactId>starter-databases</artifactId>
+			<exclusions>
+				<exclusion>
+					<groupId>org.springframework.boot</groupId>
+					<artifactId>spring-boot-starter-aop</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+		<!-- google工具类(easyCode模板中使用到了其中的方法) -->
+		<dependency>
+			<groupId>com.google.guava</groupId>
+			<artifactId>guava</artifactId>
+		</dependency>
+		<!-- mysql -->
+		<dependency>
+			<groupId>mysql</groupId>
+			<artifactId>mysql-connector-java</artifactId>
+		</dependency>
+		<!-- mapstruct 优雅的进行bean与dto的转换 -->
+		<dependency>
+			<groupId>org.mapstruct</groupId>
+			<artifactId>mapstruct-jdk8</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.mapstruct</groupId>
+			<artifactId>mapstruct-processor</artifactId>
+		</dependency>
+		<!-- 拼音库 -->
+		<dependency>
+			<groupId>io.github.biezhi</groupId>
+			<artifactId>TinyPinyin</artifactId>
+			<version>2.0.3.RELEASE</version>
+		</dependency>
+		<dependency>
+			<groupId>io.springfox</groupId>
+			<artifactId>springfox-spi</artifactId>
+			<version>2.9.2</version>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>com.github.xiaoymin</groupId>
+			<artifactId>knife4j-spring-boot-starter</artifactId>
+			<version>2.0.3</version>
+			<exclusions>
+				<exclusion>
+					<artifactId>javassist</artifactId>
+					<groupId>org.javassist</groupId>
+				</exclusion>
+				<exclusion>
+					<artifactId>jackson-annotations</artifactId>
+					<groupId>com.fasterxml.jackson.core</groupId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+	</dependencies>
 </project>

+ 6 - 4
apm-common/src/main/java/com/persagy/apm/common/config/FeignExceptionHandler.java

@@ -1,13 +1,14 @@
 package com.persagy.apm.common.config;
 
+import org.aspectj.lang.annotation.AfterReturning;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+
 import com.persagy.apm.common.exception.RpcException;
 import com.persagy.apm.common.response.FeignResponseContent;
 import com.persagy.apm.common.response.FeignResponseItem;
 import com.persagy.apm.common.response.FeignResponseMsg;
 import com.persagy.common.enums.ResponseCode;
-import org.aspectj.lang.annotation.AfterReturning;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Pointcut;
 
 /**
  * feign调用接口,如果接口返回了报错信息,将报错信息抛出
@@ -22,7 +23,8 @@ public class FeignExceptionHandler {
     private void pointCutMethod() {
     }
 
-    @AfterReturning(pointcut = "pointCutMethod()", returning = "res")
+    @SuppressWarnings("rawtypes")
+	@AfterReturning(pointcut = "pointCutMethod()", returning = "res")
     public void process(Object res) {
         String respCode = null;
         String resultMsg = null;

+ 17 - 12
apm-common/src/main/java/com/persagy/apm/common/config/JacksonConfig.java

@@ -1,19 +1,24 @@
 package com.persagy.apm.common.config;
 
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.databind.ser.BeanPropertyWriter;
-import com.fasterxml.jackson.databind.ser.BeanSerializerModifier;
+import java.io.IOException;
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
+
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Primary;
 import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
 
-import java.io.IOException;
-import java.util.Date;
-import java.util.List;
-import java.util.Set;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.databind.BeanDescription;
+import com.fasterxml.jackson.databind.JsonSerializer;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationConfig;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import com.fasterxml.jackson.databind.ser.BeanPropertyWriter;
+import com.fasterxml.jackson.databind.ser.BeanSerializerModifier;
 
 /**
  * Jackson统一处理返回值
@@ -22,6 +27,7 @@ import java.util.Set;
  * @version V1.0 2021/4/20 10:15 上午
  */
 @Configuration
+@SuppressWarnings("rawtypes")
 public class JacksonConfig {
     @Bean
     @Primary
@@ -59,7 +65,7 @@ public class JacksonConfig {
             jsonGenerator.writeNull();
         }
     }
-
+    @SuppressWarnings({"unchecked","deprecation"})
     public static class MyBeanSerializerModifier extends BeanSerializerModifier {
         // 数组,集合类型 null -> []
         private JsonSerializer nullArrayJsonSerializer = new MyNullArrayJsonSerializer();
@@ -67,8 +73,7 @@ public class JacksonConfig {
         private JsonSerializer nullObjJsonSerializer = new MyNullObjJsonSerializer();
         // 数字 null -> null;
         private JsonSerializer nullNumberJsonSerializer = new MyNullNumberJsonSerializer();
-
-        @Override
+		@Override
         public List<BeanPropertyWriter> changeProperties(
                 SerializationConfig config, BeanDescription beanDesc,
                 List beanProperties) {
@@ -91,7 +96,7 @@ public class JacksonConfig {
             return clazz.isArray() || clazz.equals(List.class) || clazz.equals(Set.class);
         }
 
-        boolean isBasicType(BeanPropertyWriter writer) {
+		boolean isBasicType(BeanPropertyWriter writer) {
             Class clazz = writer.getPropertyType();
             return clazz.equals(Integer.class) ||
                     clazz.equals(Long.class) ||

+ 6 - 4
apm-common/src/main/java/com/persagy/apm/common/config/PoemsFeignExceptionHandler.java

@@ -1,12 +1,13 @@
 package com.persagy.apm.common.config;
 
-import com.persagy.apm.common.exception.RpcException;
-import com.persagy.apm.common.response.*;
-import com.persagy.common.enums.ResponseCode;
 import org.aspectj.lang.annotation.AfterReturning;
 import org.aspectj.lang.annotation.Aspect;
 import org.aspectj.lang.annotation.Pointcut;
 
+import com.persagy.apm.common.exception.RpcException;
+import com.persagy.apm.common.response.DmpPageResponse;
+import com.persagy.apm.common.response.PoemsFeignResponse;
+
 /**
  * feign调用poems接口,如果接口返回了报错信息,将报错信息抛出
  *
@@ -20,7 +21,8 @@ public class PoemsFeignExceptionHandler {
     private void pointCutMethod() {
     }
 
-    @AfterReturning(pointcut = "pointCutMethod()", returning = "res")
+    @SuppressWarnings("rawtypes")
+	@AfterReturning(pointcut = "pointCutMethod()", returning = "res")
     public void process(Object res) {
         String result = null;
         String reason = null;

+ 4 - 2
apm-common/src/main/java/com/persagy/apm/common/config/SwaggerDisplayConfig.java

@@ -33,7 +33,8 @@ import java.util.stream.Collectors;
 @Primary
 @Slf4j
 public class SwaggerDisplayConfig implements ModelPropertyBuilderPlugin {
-    @Override
+    @SuppressWarnings("rawtypes")
+	@Override
     public void apply(ModelPropertyContext context) {
         //获取当前字段的类型
         final Class fieldType = context.getBeanPropertyDefinition().get().getField().getRawType();
@@ -45,7 +46,8 @@ public class SwaggerDisplayConfig implements ModelPropertyBuilderPlugin {
     /**
      * 为枚举字段设置注释
      */
-    private void descForEnumFields(ModelPropertyContext context, Class fieldType) {
+    @SuppressWarnings("rawtypes")
+	private void descForEnumFields(ModelPropertyContext context, Class fieldType) {
         Optional<ApiModelProperty> annotation = Optional.absent();
 
         if (context.getAnnotatedElement().isPresent()) {

+ 0 - 3
apm-common/src/main/java/com/persagy/apm/common/context/AppContext.java

@@ -1,7 +1,5 @@
 package com.persagy.apm.common.context;
 
-import lombok.extern.slf4j.Slf4j;
-
 import java.io.Serializable;
 
 
@@ -10,7 +8,6 @@ import java.io.Serializable;
  * @author Charlie Yu
  * @version 1.0 2021-03-04
  */
-@Slf4j
 public abstract class AppContext implements Serializable {
 
     /** 序列id */

+ 3 - 1
apm-common/src/main/java/com/persagy/apm/common/context/DefaultAppContext.java

@@ -12,7 +12,9 @@ import lombok.EqualsAndHashCode;
 @Data
 public class DefaultAppContext extends AppContext {
 
-    /**
+    private static final long serialVersionUID = -7934539525174623380L;
+
+	/**
      * 用户主键
      */
     private String accountId;

+ 0 - 2
apm-common/src/main/java/com/persagy/apm/common/context/poems/PoemsContext.java

@@ -1,7 +1,5 @@
 package com.persagy.apm.common.context.poems;
 
-import com.persagy.apm.common.context.DefaultAppContext;
-
 /**
  * poems上下文
  *

+ 12 - 9
apm-common/src/main/java/com/persagy/apm/common/exception/ApmExceptionHandler.java

@@ -1,12 +1,7 @@
 package com.persagy.apm.common.exception;
 
-import com.persagy.common.enums.ResponseCode;
-import com.persagy.common.exception.BusinessException;
-import com.persagy.apm.common.response.CommonResult;
-import com.persagy.apm.common.utils.ResultHelper;
-import com.persagy.security.exception.AESDecryptException;
-import feign.FeignException;
-import lombok.extern.slf4j.Slf4j;
+import javax.validation.ValidationException;
+
 import org.springframework.http.HttpStatus;
 import org.springframework.http.converter.HttpMessageNotReadableException;
 import org.springframework.validation.BindException;
@@ -16,7 +11,14 @@ import org.springframework.web.bind.annotation.ResponseStatus;
 import org.springframework.web.bind.annotation.RestControllerAdvice;
 import org.springframework.web.servlet.NoHandlerFoundException;
 
-import javax.validation.ValidationException;
+import com.persagy.apm.common.response.CommonResult;
+import com.persagy.apm.common.utils.ResultHelper;
+import com.persagy.common.enums.ResponseCode;
+import com.persagy.common.exception.BusinessException;
+import com.persagy.security.exception.AESDecryptException;
+
+import feign.FeignException;
+import lombok.extern.slf4j.Slf4j;
 
 /**
  * @description: 通用异常处理类
@@ -27,11 +29,12 @@ import javax.validation.ValidationException;
  **/
 @RestControllerAdvice
 @Slf4j
+@SuppressWarnings("rawtypes")
 public class ApmExceptionHandler {
     /**
      * feign调用异常
      */
-    @ExceptionHandler({RpcException.class})
+	@ExceptionHandler({RpcException.class})
     public CommonResult handleRpcException(RpcException e) {
         log.error(e.getMessage(), e);
         return ResultHelper.failure(ResponseCode.C0110.getCode(), e.getMessage());

+ 1 - 0
apm-common/src/main/java/com/persagy/apm/common/exception/RpcException.java

@@ -7,6 +7,7 @@ package com.persagy.apm.common.exception;
  * @since: 2021/3/8 11:39 上午
  * @version: V1.0
  **/
+@SuppressWarnings("serial")
 public class RpcException extends RuntimeException{
     public RpcException (String message) {
         super(message);

+ 10 - 8
apm-common/src/main/java/com/persagy/apm/common/handler/AppContextHandler.java

@@ -1,18 +1,20 @@
 package com.persagy.apm.common.handler;
 
+import java.io.UnsupportedEncodingException;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.web.servlet.AsyncHandlerInterceptor;
+import org.springframework.web.servlet.ModelAndView;
+
 import com.alibaba.fastjson.JSONObject;
 import com.persagy.apm.common.constant.AppContextConstants;
 import com.persagy.apm.common.context.AppContext;
 import com.persagy.apm.common.context.DefaultAppContext;
 import com.persagy.apm.common.utils.SecureAES;
 import com.persagy.security.exception.AESDecryptException;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.web.servlet.ModelAndView;
-import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.UnsupportedEncodingException;
 
 /**
  * @description:
@@ -21,7 +23,7 @@ import java.io.UnsupportedEncodingException;
  * @since: 2021/3/8 9:35 上午
  * @version: V1.0
  */
-public class AppContextHandler extends HandlerInterceptorAdapter {
+public class AppContextHandler implements AsyncHandlerInterceptor {
 
     /** 忽略的url - swagger的文档不校验 */
     private static final String[] IGNORE_URL = {".html", ".js", ".css", "/swagger-resources"};

+ 3 - 6
apm-common/src/main/java/com/persagy/apm/common/handler/PoemsContextFilter.java

@@ -1,16 +1,13 @@
 package com.persagy.apm.common.handler;
 
-import com.persagy.apm.common.context.poems.PoemsContext;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.web.filter.OncePerRequestFilter;
-import org.springframework.web.servlet.ModelAndView;
-import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
+import java.io.IOException;
 
 import javax.servlet.FilterChain;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
+
+import org.springframework.web.filter.OncePerRequestFilter;
 
 /**
  * @description:

+ 6 - 11
apm-common/src/main/java/com/persagy/apm/common/handler/PoemsContextHandler.java

@@ -1,18 +1,13 @@
 package com.persagy.apm.common.handler;
 
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.persagy.apm.common.context.poems.PoemsContext;
-import org.apache.commons.io.IOUtils;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.web.servlet.AsyncHandlerInterceptor;
 import org.springframework.web.servlet.ModelAndView;
-import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
 
-import javax.servlet.ServletInputStream;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.util.HashMap;
-import java.util.Map;
+import com.persagy.apm.common.context.poems.PoemsContext;
 
 /**
  * @description:
@@ -21,7 +16,7 @@ import java.util.Map;
  * @since: 2021/3/8 9:35 上午
  * @version: V1.0
  */
-public class PoemsContextHandler extends HandlerInterceptorAdapter {
+public class PoemsContextHandler implements AsyncHandlerInterceptor {
 
     /**
      * 忽略的url - swagger的文档不校验

+ 24 - 14
apm-common/src/main/java/com/persagy/apm/common/helper/LockHelper.java

@@ -1,17 +1,19 @@
 package com.persagy.apm.common.helper;
 
-import com.persagy.common.exception.BusinessException;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.data.redis.connection.RedisConnection;
-import org.springframework.data.redis.core.RedisCallback;
-import org.springframework.data.redis.core.RedisTemplate;
-
 import java.io.UnsupportedEncodingException;
 import java.nio.charset.StandardCharsets;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.springframework.data.redis.connection.RedisConnection;
+import org.springframework.data.redis.core.RedisCallback;
+import org.springframework.data.redis.core.RedisTemplate;
+
+import com.persagy.common.exception.BusinessException;
+
+import lombok.extern.slf4j.Slf4j;
+
 /**
  * 锁助手
  * @author Charlie Yu
@@ -23,7 +25,8 @@ public class LockHelper {
     /**
      * jedis模板
      */
-    private static RedisTemplate redisTemplate = null;
+    @SuppressWarnings("rawtypes")
+	private static RedisTemplate redisTemplate = null;
 
     /**
      * 加锁标志
@@ -57,7 +60,8 @@ public class LockHelper {
      * @param expire  锁过期时间
      * @return 是否锁定成功
      */
-    public static boolean lock(String key,long timeout,int expire){
+    @SuppressWarnings("unchecked")
+	public static boolean lock(String key,long timeout,int expire){
         //解决嵌套加锁
         Map<String,Integer> ls = locks.get();
         if(ls != null){
@@ -100,7 +104,8 @@ public class LockHelper {
     /**
      * 解锁指定的键值
      */
-    public static void unlock(String key){
+    @SuppressWarnings("unchecked")
+	public static void unlock(String key){
         //解决嵌套加锁
         Map<String,Integer> ls = locks.get();
         if(ls == null) {
@@ -140,7 +145,8 @@ public class LockHelper {
      * @param expire 超期时长
      * @return 布尔值
      */
-    public static boolean exclusive(String key, int expire){
+    @SuppressWarnings("unchecked")
+	public static boolean exclusive(String key, int expire){
         Boolean rs = (Boolean) getRedisTemplate().execute(new ExclusiveRedisCallback(key, expire));
         return rs!=null && rs;
     }
@@ -158,7 +164,8 @@ public class LockHelper {
      * 释放排他独占锁
      * @param key 键值
      */
-    public static void releaseExcusive(String key){
+    @SuppressWarnings("unchecked")
+	public static void releaseExcusive(String key){
         getRedisTemplate().execute(new UnLockRedisCallback(key));
     }
 
@@ -166,7 +173,8 @@ public class LockHelper {
      * 获取redis访问模板
      * @return redis访问模板
      */
-    public static RedisTemplate getRedisTemplate(){
+    @SuppressWarnings("rawtypes")
+	public static RedisTemplate getRedisTemplate(){
         if(redisTemplate == null) {
             redisTemplate = SpringHelper.getBean("redisTemplate",RedisTemplate.class);
             if(redisTemplate == null){
@@ -190,7 +198,8 @@ public class LockHelper {
         private byte[] key;
         private int expire;
 
-        public LockRedisCallback(String key,long timeout,int expire) {
+        @SuppressWarnings("unchecked")
+		public LockRedisCallback(String key,long timeout,int expire) {
             this.timeout = timeout;
             this.expire = expire;
             this.key = redisTemplate.getStringSerializer().serialize(key);
@@ -258,7 +267,8 @@ public class LockHelper {
         private byte[] key;
         private int expire;
 
-        public ExclusiveRedisCallback(String key,int expire) {
+        @SuppressWarnings("unchecked")
+		public ExclusiveRedisCallback(String key,int expire) {
             this.expire = expire;
             this.key = redisTemplate.getStringSerializer().serialize(key);
         }

+ 2 - 1
apm-common/src/main/java/com/persagy/apm/common/helper/RedisHelper.java

@@ -20,6 +20,7 @@ import java.util.*;
  * @version 1.0 2021-03-04
  */
 @Slf4j
+@SuppressWarnings({"unchecked","rawtypes"})
 public final class RedisHelper {
 
     /** jedis模板 */
@@ -33,7 +34,7 @@ public final class RedisHelper {
      * 获取缓存模板
      * @return 获取缓存模板
      */
-    public static RedisTemplate getTemplate() {
+	public static RedisTemplate getTemplate() {
         if (redisTemplate == null) {
             redisTemplate = SpringHelper.getBean("redisTemplate", RedisTemplate.class);
             if (redisTemplate == null) {

+ 2 - 3
apm-common/src/main/java/com/persagy/apm/common/model/dto/EnumQueryDTO.java

@@ -1,11 +1,10 @@
 package com.persagy.apm.common.model.dto;
 
+import javax.validation.constraints.NotNull;
+
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
-import lombok.NonNull;
-
-import javax.validation.constraints.NotNull;
 
 /**
  * 枚举类查询DTO

+ 1 - 1
apm-common/src/main/java/com/persagy/apm/common/model/dto/PageDTO.java

@@ -1,10 +1,10 @@
 package com.persagy.apm.common.model.dto;
 
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.persagy.apm.common.constant.PageQueryConstants;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
-import net.minidev.json.annotate.JsonIgnore;
 
 import java.util.List;
 

+ 1 - 4
apm-common/src/main/java/com/persagy/apm/common/model/dto/PoemsFeignBaseDTO.java

@@ -1,13 +1,10 @@
 package com.persagy.apm.common.model.dto;
 
-import com.persagy.apm.common.config.GlobalConfig;
 import com.persagy.apm.common.context.poems.PoemsContext;
+
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.stereotype.Component;
 
 /**
  * Poems上的服务feign调用基础dto类

+ 5 - 3
apm-common/src/main/java/com/persagy/apm/common/model/entity/BaseEntity.java

@@ -1,10 +1,14 @@
 package com.persagy.apm.common.model.entity;
 
+import java.io.Serializable;
+import java.util.Date;
+
 import com.baomidou.mybatisplus.annotation.FieldFill;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
+
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.AccessLevel;
@@ -12,14 +16,12 @@ import lombok.Data;
 import lombok.Getter;
 import lombok.Setter;
 
-import java.io.Serializable;
-import java.util.Date;
-
 /**
  * 实体基类RequiredParamsStorage
  * @author Charlie Yu
  * @version 1.0 2021-03-04
  */
+@SuppressWarnings("rawtypes")
 @Data
 @ApiModel
 public abstract class BaseEntity<T> extends Model implements IBaseEntity,Serializable,Cloneable{

+ 3 - 4
apm-common/src/main/java/com/persagy/apm/common/model/vo/BaseVo.java

@@ -1,15 +1,14 @@
 package com.persagy.apm.common.model.vo;
 
+import javax.validation.constraints.NotBlank;
+
 import com.fasterxml.jackson.annotation.JsonAlias;
 import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
 import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
-import lombok.Builder;
 import lombok.Data;
 import lombok.NoArgsConstructor;
-
-import javax.validation.constraints.NotBlank;
 /***
  * Description: VO基类
  * @author : lijie

+ 1 - 1
apm-common/src/main/java/com/persagy/apm/common/model/vo/EnumVO.java

@@ -1,10 +1,10 @@
 package com.persagy.apm.common.model.vo;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
+
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
-import org.checkerframework.checker.units.qual.K;
 
 /**
  * 枚举vo类

+ 58 - 4
apm-common/src/main/java/com/persagy/apm/common/model/vo/OldResponseResult.java

@@ -4,8 +4,6 @@ import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.persagy.common.utils.ResponseResult;
 import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.ToString;
 
 import java.io.Serializable;
 import java.util.List;
@@ -15,8 +13,6 @@ import java.util.List;
  * @author zhangqiankun
  * @since 2020年8月26日:	下午5:17:08
  */
-@Data
-@ToString
 public class OldResponseResult<T> extends ResponseResult implements Serializable {
 	private static final long serialVersionUID = -5424463986046237843L;
 	/**结果code*/
@@ -77,4 +73,62 @@ public class OldResponseResult<T> extends ResponseResult implements Serializable
 		this.item = item;
 	}
 
+	@Override
+	public String toString() {
+		return "OldResponseResult [respCode=" + respCode + ", result=" + result + ", respMsg=" + respMsg + ", content="
+				+ content + ", item=" + item + ", count=" + count + "]";
+	}
+
+	public String getRespCode() {
+		return respCode;
+	}
+
+	public void setRespCode(String respCode) {
+		this.respCode = respCode;
+	}
+
+	public String getResult() {
+		return result;
+	}
+
+	public void setResult(String result) {
+		this.result = result;
+	}
+
+	public String getRespMsg() {
+		return respMsg;
+	}
+
+	public void setRespMsg(String respMsg) {
+		this.respMsg = respMsg;
+	}
+
+	public List<T> getContent() {
+		return content;
+	}
+
+	public void setContent(List<T> content) {
+		this.content = content;
+	}
+
+	public T getItem() {
+		return item;
+	}
+
+	public void setItem(T item) {
+		this.item = item;
+	}
+
+	public Long getCount() {
+		return count;
+	}
+
+	public void setCount(Long count) {
+		this.count = count;
+	}
+
+	public static long getSerialversionuid() {
+		return serialVersionUID;
+	}
+
 }

+ 2 - 1
apm-common/src/main/java/com/persagy/apm/common/response/CommonResult.java

@@ -18,7 +18,8 @@ import static com.persagy.common.enums.ResponseCode.A00000;
 public class CommonResult<T> {
 
     /** 不需要提示 */
-    public static final CommonResult SUCCESS = new CommonResult();
+    @SuppressWarnings("rawtypes")
+	public static final CommonResult SUCCESS = new CommonResult();
 
     @ApiModelProperty(value = "响应码")
     private String respCode;

+ 1 - 0
apm-common/src/main/java/com/persagy/apm/common/response/PoemsFeignResponse.java

@@ -14,6 +14,7 @@ import java.util.List;
  * @author lixing
  * @version V1.0 2021/5/19 2:41 下午
  **/
+@SuppressWarnings("hiding")
 @ApiModel
 @Data
 public class PoemsFeignResponse<T> {

+ 9 - 7
apm-common/src/main/java/com/persagy/apm/common/utils/ListUtil.java

@@ -1,11 +1,10 @@
 package com.persagy.apm.common.utils;
 
-import org.apache.poi.ss.formula.functions.T;
-import org.assertj.core.util.Lists;
+import java.util.List;
+
 import org.springframework.util.CollectionUtils;
 
-import java.util.ArrayList;
-import java.util.List;
+import com.google.common.collect.Lists;
 
 /**
  * list工具类
@@ -24,7 +23,8 @@ public class ListUtil {
      * @author lixing
      * @version V1.0 2021/4/6 10:58 上午
      */
-    public static <T> List<T> getAddedList(List<T> listBefore, List<T> listAfter) {
+    @SuppressWarnings("hiding")
+	public static <T> List<T> getAddedList(List<T> listBefore, List<T> listAfter) {
         if (CollectionUtils.isEmpty(listAfter)) {
             return null;
         }
@@ -52,11 +52,13 @@ public class ListUtil {
      * @author lixing
      * @version V1.0 2021/4/6 10:58 上午
      */
-    public static <T> List<T> getDeletedList(List<T> listBefore, List<T> listAfter) {
+    @SuppressWarnings("hiding")
+	public static <T> List<T> getDeletedList(List<T> listBefore, List<T> listAfter) {
         return getAddedList(listAfter, listBefore);
     }
 
-    public static <T> Boolean listChanged(List<T> listBefore, List<T> listAfter) {
+    @SuppressWarnings("hiding")
+	public static <T> Boolean listChanged(List<T> listBefore, List<T> listAfter) {
         if (listBefore == null) {
             return listAfter != null;
         }

+ 83 - 73
apm-common/src/main/java/com/persagy/apm/common/utils/ResultHelper.java

@@ -4,94 +4,104 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.persagy.apm.common.response.CommonResult;
 import com.persagy.apm.common.response.PageList;
 import com.persagy.common.enums.ResponseCode;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 
 import java.util.List;
 
 /**
  * 响应结果包装助手
+ * 
  * @author Charlie Yu
  * @date 2021-03-25
  */
+@SuppressWarnings({ "rawtypes", "unchecked" })
 public class ResultHelper {
 
-    /**
-     * 成功消息
-     * @return
-     */
-    public static CommonResult success(){
-        return new CommonResult(ResponseCode.A00000.getCode(), ResponseCode.A00000.getDesc());
-    }
+	/**
+	 * 成功消息
+	 * 
+	 * @return
+	 */
+	public static CommonResult success() {
+		return new CommonResult(ResponseCode.A00000.getCode(), ResponseCode.A00000.getDesc());
+	}
 
-    /**
-     * 成功消息
-     * @return
-     */
-    public static CommonResult success(String respMsg){
-        return new CommonResult(ResponseCode.A00000.getCode(), respMsg);
-    }
+	/**
+	 * 成功消息
+	 * 
+	 * @return
+	 */
+	public static CommonResult success(String respMsg) {
+		return new CommonResult(ResponseCode.A00000.getCode(), respMsg);
+	}
 
-    /**
-     * 失败消息
-     * @param respCode
-     * @param respMsg
-     * @return
-     */
-    public static CommonResult failure(String respCode, String respMsg) {
-        return new CommonResult(respCode, respMsg);
-    }
+	/**
+	 * 失败消息
+	 * 
+	 * @param respCode
+	 * @param respMsg
+	 * @return
+	 */
+	public static CommonResult failure(String respCode, String respMsg) {
+		return new CommonResult(respCode, respMsg);
+	}
 
-    /**
-     * 单个数据
-     * @param content
-     * @param <T>
-     * @return
-     */
-    public static <T> CommonResult<T> single(T content) {
-        return new CommonResult(ResponseCode.A00000.getCode(), ResponseCode.A00000.getDesc(), content);
-    }
+	/**
+	 * 单个数据
+	 * 
+	 * @param content
+	 * @param <T>
+	 * @return
+	 */
+	public static <T> CommonResult<T> single(T content) {
+		return new CommonResult(ResponseCode.A00000.getCode(), ResponseCode.A00000.getDesc(), content);
+	}
 
-    /**
-     * 单个数据
-     * @param content
-     * @param <T>
-     * @return
-     */
-    public static <T> CommonResult<T> single(T content, String desc) {
-        return new CommonResult(ResponseCode.A00000.getCode(), desc, content);
-    }
+	/**
+	 * 单个数据
+	 * 
+	 * @param content
+	 * @param <T>
+	 * @return
+	 */
+	public static <T> CommonResult<T> single(T content, String desc) {
+		return new CommonResult(ResponseCode.A00000.getCode(), desc, content);
+	}
 
-    /**
-     * 多个数据 - 列表
-     * @param records
-     * @param <T>
-     * @return
-     */
-    public static <T> CommonResult<PageList<T>> multi(List<T> records) {
-        return multi(records, CollectionUtils.size(records));
-    }
+	/**
+	 * 多个数据 - 列表
+	 * 
+	 * @param records
+	 * @param <T>
+	 * @return
+	 */
+	public static <T> CommonResult<PageList<T>> multi(List<T> records) {
+		return multi(records, CollectionUtils.size(records));
+	}
 
-    /**
-     * 多个数据 - 分页
-     * @param page
-     * @param <T>
-     * @return
-     */
-    public static <T> CommonResult<PageList<T>> multi(IPage<T> page) {
-        List<T> records = page == null ? null : page.getRecords();
-        long total = page == null ? 0 : page.getTotal();
-        return multi(records, total);
-    }
+	/**
+	 * 多个数据 - 分页
+	 * 
+	 * @param page
+	 * @param <T>
+	 * @return
+	 */
+	public static <T> CommonResult<PageList<T>> multi(IPage<T> page) {
+		List<T> records = page == null ? null : page.getRecords();
+		long total = page == null ? 0 : page.getTotal();
+		return multi(records, total);
+	}
 
-    /**
-     * 多个数据
-     * @param records
-     * @param total
-     * @param <T>
-     * @return
-     */
-    public static <T> CommonResult<PageList<T>> multi(List<T> records, long total) {
-        PageList<T> pageList = new PageList<>(records, total);
-        return new CommonResult(ResponseCode.A00000.getCode(), ResponseCode.A00000.getDesc(), pageList);
-    }
+	/**
+	 * 多个数据
+	 * 
+	 * @param records
+	 * @param total
+	 * @param <T>
+	 * @return
+	 */
+	public static <T> CommonResult<PageList<T>> multi(List<T> records, long total) {
+		PageList<T> pageList = new PageList<>(records, total);
+		return new CommonResult(ResponseCode.A00000.getCode(), ResponseCode.A00000.getDesc(), pageList);
+	}
 }

+ 1 - 1
apm-common/src/main/java/com/persagy/apm/common/utils/SecureAES.java

@@ -4,8 +4,8 @@ import cn.hutool.crypto.Mode;
 import cn.hutool.crypto.Padding;
 import cn.hutool.crypto.SecureUtil;
 import cn.hutool.crypto.symmetric.AES;
+import com.alibaba.csp.sentinel.util.StringUtil;
 import com.alibaba.fastjson.JSONObject;
-import com.persagy.common.utils.StringUtil;
 import com.persagy.security.exception.AESDecryptException;
 
 import java.io.UnsupportedEncodingException;

+ 2 - 1
apm-common/src/main/java/com/persagy/apm/common/utils/TypeConvertUtil.java

@@ -272,7 +272,8 @@ public class TypeConvertUtil {
      * @param obj  未知类型对象
      * @return 目标类型对象
      */
-    public static final Object translate(Class clazz, Object obj) {
+    @SuppressWarnings("rawtypes")
+	public static final Object translate(Class clazz, Object obj) {
         return translate(DataType.parse(clazz), obj);
     }
 

+ 48 - 0
apm-common/src/main/java/com/persagy/common/constant/DMPConstant.java

@@ -0,0 +1,48 @@
+package com.persagy.common.constant;
+/***
+ * @Description: 连接数据中台应用的通用常量值
+ * @author: lijie
+ * @Date:2020/10/19 10:47
+ * Update By lijie 2020/10/19 10:47
+ */
+public interface DMPConstant {
+    /**
+     * 数据中台异常错误结果信息
+     */
+    String DMP_ERROR_MSG = "DMP服务响应异常";
+
+    /**
+     * 数据中台服务响应数据的result success 代表成功
+     */
+    String DMP_RESULT_KEY = "result";
+    String DMP_RESULT_VAL = "success";
+    String DMP_FAIL_RESULT = "fail";
+    String DMP_FAIL_MSG = "message";
+
+    /**
+     * 数据中台服务返回的数据内容-key
+     */
+    String DMP_DATA_KEY = "data";
+
+    /**
+     * 数据中台服务返回的数据条目数-key
+     */
+    String DMP_COUNT_KEY = "count";
+
+    /**
+     * DMP 对接 所需要的header-key
+     */
+    String DMP_HEADER_USERID = "user-id";
+    String DMP_HEADER_GROUPCODE = "group-code";
+    String DMP_HEADER_PROJECTID = "project-id";
+    String DMP_HEADER_APPID = "app-id";
+
+    /**
+     * DMP 对接 所需要的属性key
+     */
+    String DMP_USERID = "userId";
+    String DMP_GROUPCODE = "groupCode";
+    String DMP_PROJECTID = "projectId";
+    String DMP_APPID = "appId";
+
+}

+ 110 - 0
apm-common/src/main/java/com/persagy/common/enums/ResponseCode.java

@@ -0,0 +1,110 @@
+package com.persagy.common.enums;
+
+/**
+ * @description
+ * @author zhangqiankun
+ * @since 2020年8月26日:	下午5:17:08
+ */
+public enum ResponseCode {
+
+    A00000("00000", "success"),
+
+    A10000("10000", "failure"),
+
+    A0001("A0001", "用户端错误"),
+
+    A0100("A0100", "用户注册错误"),
+
+    A0135("A0135", "Method Not Allowed"),
+
+    A0136("A0136", "Unsupported Media Type"),
+
+    A0137("A0137", "Not Acceptable"),
+
+    A0151("A0151", "手机格式校验失败"),
+
+    A0152("A0152", "地址格式校验失败"),
+
+    A0153("A0153", "邮箱格式校验失败"),
+
+    A0154("A0154", "账号名称重复"),
+
+    A0155("A0155", "员工编号重复"),
+
+    A0156("A0156", "手机号重复"),
+
+    A0157("A0157", "邮箱重复"),
+
+    A0201("A0201", "用户账户不存在"),
+
+    A0202("A0202", "用户账户被冻结"),
+
+    A0203("A0203", "用户账户已作废"),
+
+    A0210("A0210", "用户名/密码错误"),
+
+    A0220("A0220", "用户身份校验失败"),
+
+    A0301("A0301", "访问未授权"),
+
+    A0302("A0302", "正在授权中"),
+
+    A0303("A0303", "拒绝授权申请"),
+
+    A0311("A0311", "授权已过期"),
+
+    A0324("A0324", "网关访问受限"),
+
+    A0340("A0340", "签名异常"),
+
+    A0400("A0400", "用户请求参数错误"),
+
+    A0402("A0402", "无效的用户输入"),
+
+    A0403("A0403", "验证码错误,请重新获取"),
+
+    A0422("A0422", "地址不在服务范围"),
+
+    A0427("A0427", "请求JSON 解析失败"),
+
+    B0001("B0001", "系统执行出错"),
+
+    B0300("B0300", "系统资源异常"),
+
+    C0001("C0001", "调用第三方服务出错"),
+
+    C0100("C0100", "中间件服务出错"),
+
+    C0110("C0110", "RPC服务出错"),
+
+    C0134("C0134", "不支持的数据格式"),
+
+    C0320("C0320", "数据不存在"),
+
+    C0341("C0341", "主键冲突"),
+
+    Z9999("Z9999", "系统繁忙");	// 未知异常
+
+    private String code;
+
+    private String desc;
+
+    public String getCode() {
+        return code;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    private ResponseCode(String code, String desc) {
+        this.desc = desc;
+        this.code = code;
+    }
+
+    @Override
+    public String toString() {
+        return this.code + "_" + this.desc;
+    }
+
+}

+ 109 - 0
apm-common/src/main/java/com/persagy/common/exception/BusinessException.java

@@ -0,0 +1,109 @@
+package com.persagy.common.exception;
+
+import com.persagy.common.enums.ResponseCode;
+
+/**
+ * @description
+ * @author zhangqiankun
+ * @since 2020年8月26日:	下午5:17:08
+ */
+public class BusinessException extends RuntimeException {
+    private static final long serialVersionUID = -3325873096967595156L;
+
+    private String errorCode;
+    private String errorDesc;		// 给前端看
+
+    private Object respJson; 		// 响应content中的数据,可加可不加
+
+    public BusinessException() {
+        super();
+    }
+
+    public BusinessException(Throwable e) {
+        super(e);
+    }
+
+    public BusinessException(String message, Throwable e) {
+        super(message, e);
+    }
+
+    /**
+     * @param errorCode 默认 B0001
+     * @param errorDesc
+     */
+    public BusinessException(String errorDesc) {
+        super(errorDesc);
+        this.errorCode = ResponseCode.B0001.getCode();
+        this.errorDesc = errorDesc;
+    }
+
+    /**
+     * 业务异常错误码和错误描述构造器
+     *
+     * @param errorCode
+     * @param errorDesc
+     */
+    public BusinessException(String errorCode, String errorDesc) {
+        super(errorDesc);
+        this.errorCode = errorCode;
+        this.errorDesc = errorDesc;
+    }
+
+    public BusinessException(String errorCode, String errorDesc, Object respJson) {
+        super(errorDesc);
+        this.errorCode = errorCode;
+        this.errorDesc = errorDesc;
+        this.respJson = respJson;
+    }
+
+    /**
+     * 业务异常信息、错误码和错误描述构造器
+     *
+     * @param message 后台日志看
+     * @param errorCode 错误码
+     * @param errorDesc	给前端看
+     */
+    public BusinessException(String message, String errorCode, String errorDesc, Object respJson) {
+        super(message);
+        this.errorCode = errorCode;
+        this.errorDesc = errorDesc;
+        this.respJson = respJson;
+    }
+
+    public BusinessException(Throwable cause, String errorCode, String errorDesc) {
+        super(cause);
+        this.errorCode = errorCode;
+        this.errorDesc = errorDesc;
+    }
+
+    public BusinessException(String message, Throwable cause, String errorCode, String errorDesc) {
+        super(message, cause);
+        this.errorCode = errorCode;
+        this.errorDesc = errorDesc;
+    }
+
+    public String getErrorCode() {
+        return errorCode;
+    }
+
+    public void setErrorCode(String errorCode) {
+        this.errorCode = errorCode;
+    }
+
+    public String getErrorDesc() {
+        return errorDesc;
+    }
+
+    public void setErrorDesc(String errorDesc) {
+        this.errorDesc = errorDesc;
+    }
+
+    public Object getRespJson() {
+        return respJson;
+    }
+
+    public void setRespJson(Object respJson) {
+        this.respJson = respJson;
+    }
+
+}

+ 128 - 0
apm-common/src/main/java/com/persagy/common/utils/DMPResponseUtil.java

@@ -0,0 +1,128 @@
+package com.persagy.common.utils;
+
+import java.util.List;
+
+import com.alibaba.csp.sentinel.util.StringUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.persagy.common.constant.DMPConstant;
+import com.persagy.common.enums.ResponseCode;
+import com.persagy.common.exception.BusinessException;
+
+/**
+ * @version
+ * @description 对数据中台的响应体数据进行格式转变
+ * @company persagy
+ * @author zhangqiankun
+ * @since 2020年10月19日:	上午11:03:24
+ */
+public class DMPResponseUtil {
+
+    private static final String ERROR_MSG = "DMP服务响应异常";
+
+    /**
+     * 获取成功的响应数据
+     * @param dmpResult
+     * @return
+     */
+    public static ResponseResult convertResponseResult(String dmpResult) {
+        if (StringUtil.isBlank(dmpResult) || dmpResult.indexOf(DMPConstant.DMP_RESULT_KEY) < 0) {
+            return ResponseResultUtil.errorResult(ResponseCode.C0110.getCode(), ERROR_MSG);
+        }
+        JSONObject result = JSONObject.parseObject(dmpResult);
+        if (DMPConstant.DMP_RESULT_VAL.equals(result.getString(DMPConstant.DMP_RESULT_KEY))) {
+            return ResponseResultUtil.successResult(result.get(DMPConstant.DMP_DATA_KEY), result.getLong(DMPConstant.DMP_COUNT_KEY));
+        } else if (StringUtil.isNotBlank(result.getString(DMPConstant.DMP_FAIL_MSG))) {
+            return ResponseResultUtil.errorResult(ResponseCode.C0110.getCode(), result.getString(DMPConstant.DMP_FAIL_MSG));
+        }
+
+        return ResponseResultUtil.errorResult(ResponseCode.C0110.getCode(), ResponseCode.C0110.getDesc());
+    }
+
+    /**
+     * 判断是否响应成功
+     * @param dmpResult
+     * @return
+     */
+    public static boolean isSuccess(String dmpResult) {
+        if (StringUtil.isBlank(dmpResult) || dmpResult.indexOf(DMPConstant.DMP_RESULT_KEY) < 0) {
+            return false;
+        }
+        JSONObject result = JSONObject.parseObject(dmpResult);
+        if (DMPConstant.DMP_RESULT_VAL.equals(result.getString(DMPConstant.DMP_RESULT_KEY))) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * 判断中台正常响应的情况下,数据中的count值是否存在且大于0,非正常响应,抛出异常
+     * @param dmpResult
+     * @return 存在且大于0,返回true;否则返回false
+     */
+    public static boolean checkResultCount(String dmpResult) {
+        ResponseResult responseResult = convertResponseResult(dmpResult);
+        if(ResponseCode.A00000.getCode().equals(responseResult.getRespCode())){
+            Long count = responseResult.getCount();
+            if(null != count && count > 0){
+                return true;
+            }
+
+            return false;
+        }
+        throw new BusinessException("数据中台处理失败:" + responseResult.getRespMsg());
+    }
+
+    /**
+     * 正常响应转为对应的JSONObject,否则返回null
+     * @param dmpResult
+     * @return
+     */
+    public static JSONObject getJSONObject(String dmpResult) {
+        if (StringUtil.isBlank(dmpResult) || dmpResult.indexOf(DMPConstant.DMP_RESULT_KEY) < 0) {
+            return null;
+        }
+
+        JSONObject result = JSONObject.parseObject(dmpResult);
+        if (DMPConstant.DMP_RESULT_VAL.equals(result.getString(DMPConstant.DMP_RESULT_KEY))) {
+            // 响应成功,转变响应结构
+            return result;
+        }
+        return null;
+    }
+
+    /**
+     * @param dmpResult
+     * @return 正常count 否则 null
+     */
+    public static Long getDMPResultCount(String dmpResult) {
+        JSONObject jsonObject = getJSONObject(dmpResult);
+        return jsonObject.getLong(DMPConstant.DMP_COUNT_KEY);
+    }
+
+    /***
+     * @Description: 转换结果
+     * @param content : 数组形式的
+     * @param clazz : 类的类型
+     * @return : java.util.List<T>
+     * @author: lijie
+     * @Date:2020/10/19 14:59
+     * Update By lijie 2020/10/19 14:59
+     */
+    public static <T> List<T> transferObjectToList(Object content, Class<T> clazz){
+        return JSONObject.parseArray(JSONObject.toJSONString(content), clazz);
+    }
+
+    /***
+     * @Description: 转换结果
+     * @param content : 对象形式的
+     * @param clazz : 类的类型
+     * @return : java.util.List<T>
+     * @author: lijie
+     * @Date:2020/10/19 14:59
+     * Update By lijie 2020/10/19 14:59
+     */
+    public static <T> T transferObjectToObject(Object content, Class<T> clazz){
+        return JSONObject.parseObject(JSONObject.toJSONString(content), clazz);
+    }
+
+}

+ 50 - 0
apm-common/src/main/java/com/persagy/common/utils/ResponseResult.java

@@ -0,0 +1,50 @@
+package com.persagy.common.utils;
+
+import java.io.Serializable;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+/**
+ * @description
+ * @author zhangqiankun
+ * @since 2020年8月26日:	下午5:17:08
+ */
+@Getter
+@Setter
+@ToString
+public class ResponseResult implements Serializable {
+    private static final long serialVersionUID = -5424463986046237843L;
+
+    private String respCode;			// 响应码
+
+    private String respMsg;				// 响应描述
+
+    private Object content; 			// 响应数据,实际可以是请求体,也可以是响应体,随意
+
+    private Long count;				// 响应数据总记录数
+
+    public ResponseResult() {
+
+    }
+
+    public ResponseResult(String respCode, String respMsg) {
+        this.respCode = respCode;
+        this.respMsg = respMsg;
+    }
+
+    public ResponseResult(String respCode, String respMsg,  Object content) {
+        this.respCode = respCode;
+        this.respMsg = respMsg;
+        this.content = content;
+    }
+
+    public ResponseResult(String respCode, String respMsg, Object content, Long count) {
+        this.respCode = respCode;
+        this.respMsg = respMsg;
+        this.content = content;
+        this.count = count;
+    }
+
+}

+ 227 - 0
apm-common/src/main/java/com/persagy/common/utils/ResponseResultUtil.java

@@ -0,0 +1,227 @@
+package com.persagy.common.utils;
+
+import com.alibaba.csp.sentinel.util.StringUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.persagy.common.enums.ResponseCode;
+
+/**
+ * @version
+ * @description
+ * @company persagy
+ * @author zhangqiankun
+ * @since 2020年9月1日:	下午2:21:25
+ */
+public class ResponseResultUtil {
+
+    public static final String RESP_CODE_KEY = "respCode";
+    public static final String RESP_MSG_KEY = "respMsg";
+    public static final String RESP_CONTENT_KEY = "content";
+    public static final String RESP_COUNT_KEY = "count";
+
+    public static final String SUCCESS_CODE = ResponseCode.A00000.getCode();
+    public static final String FAILURE_CODE = ResponseCode.A10000.getCode();
+
+    /**
+     * 判断是否响应成功, respCode=00000
+     */
+    public static boolean isSuccess(String resultJson) {
+        if (StringUtil.isBlank(resultJson)) {
+            return false;
+        }
+        try {
+            return isSuccess(JSONObject.parseObject(resultJson));
+        } catch (Exception e) {
+        }
+        return false;
+    }
+
+    /**
+     * 判断是否响应成功, respCode=00000
+     */
+    public static boolean isSuccess(JSONObject jsonObject) {
+        if (jsonObject == null) {
+            return false;
+        }
+        if (SUCCESS_CODE.equals(jsonObject.getString(RESP_CODE_KEY))) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * 判断是否响应成功, respCode=00000
+     */
+    public static boolean isSuccess(ResponseResult result) {
+        if (result == null) {
+            return false;
+        }
+        if (SUCCESS_CODE.equals(result.getRespCode())) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * 判断响应是否失败
+     */
+    public static boolean isError(String resultJson) {
+        return !isSuccess(resultJson);
+    }
+    /**
+     * 判断响应是否失败
+     */
+    public static boolean isError(JSONObject jsonObject) {
+        return !isSuccess(jsonObject);
+    }
+    /**
+     * 判断响应是否失败
+     */
+    public static boolean isError(ResponseResult result) {
+        return !isSuccess(result);
+    }
+
+    /**
+     * 获取响应体对象
+     *
+     * @param resultJson
+     * @return
+     */
+    public static ResponseResult convertResponse(String resultJson) {
+        if (StringUtil.isBlank(resultJson)) {
+            return null;
+        }
+        try {
+            return JSONObject.parseObject(resultJson, ResponseResult.class);
+        } catch (Exception e) {
+        }
+        return null;
+    }
+
+    /**
+     * 获取响应体中content内容所表示的class对象
+     *
+     * @param resultJson
+     * @return
+     */
+    public static Class<?> convertResponse(String resultJson, Class<?> clazz) {
+        JSONObject jsonObject = toJSONObject(resultJson);
+        return (Class<?>)jsonObject.toJavaObject(clazz);
+    }
+
+    /**
+     * 获取响应体中content内容所表示的集合对象
+     *
+     * @param resultJson
+     * @return
+     */
+    public static Class<?>[] convertResponse(String resultJson, Class<?>[] clazz) {
+        JSONArray jsonArray = toJSONArray(resultJson);
+        return (Class<?>[]) jsonArray.toArray(clazz);
+    }
+
+
+    /**
+     * 成功响应才会返回content
+     *
+     * @param resultJson
+     * @return 此方法不会返回null
+     */
+    public static JSONObject toJSONObject(String resultJson) {
+        if (StringUtil.isBlank(resultJson)) {
+            return new JSONObject();
+        }
+        JSONObject jsonObject = JSONObject.parseObject(resultJson);
+        if (isSuccess(jsonObject)) {
+            return jsonObject.getJSONObject(RESP_CONTENT_KEY);
+        }
+        return new JSONObject();
+    }
+
+    /**
+     * 成功响应才会返回content
+     *
+     * @param resultJson
+     * @return 此方法不会返回null
+     */
+    public static JSONArray toJSONArray(String resultJson) {
+        if (StringUtil.isBlank(resultJson)) {
+            return new JSONArray();
+        }
+        JSONObject jsonObject = JSONObject.parseObject(resultJson);
+        if (isSuccess(jsonObject)) {
+            return jsonObject.getJSONArray(RESP_CONTENT_KEY);
+        }
+        return new JSONArray();
+    }
+
+
+    public static ResponseResult successResult() {
+        ResponseResult result = new ResponseResult();
+        result.setRespCode(ResponseCode.A00000.getCode());
+        result.setRespMsg(ResponseCode.A00000.getDesc());
+        return result;
+    }
+
+    public static ResponseResult successResult(String respMsg) {
+        ResponseResult result = new ResponseResult();
+        result.setRespCode(ResponseCode.A00000.getCode());
+        result.setRespMsg(respMsg);
+        return result;
+    }
+
+    public static ResponseResult successResult(Object content) {
+        ResponseResult result = new ResponseResult();
+        result.setRespCode(ResponseCode.A00000.getCode());
+        result.setRespMsg(ResponseCode.A00000.getDesc());
+        result.setContent(content);
+        return result;
+    }
+
+    public static ResponseResult successResult(String respMsg, Object content) {
+        ResponseResult result = new ResponseResult();
+        result.setRespCode(ResponseCode.A00000.getCode());
+        result.setRespMsg(respMsg);
+        result.setContent(content);
+        return result;
+    }
+
+    public static ResponseResult successResult(Object content, Long count) {
+        ResponseResult result = new ResponseResult();
+        result.setRespCode(ResponseCode.A00000.getCode());
+        result.setRespMsg(ResponseCode.A00000.getDesc());
+        result.setContent(content);
+        result.setCount(count);
+        return result;
+    }
+
+    public static ResponseResult errorResult() {
+        ResponseResult result = new ResponseResult();
+        result.setRespCode(ResponseCode.A10000.getCode());
+        result.setRespMsg(ResponseCode.A10000.getDesc());
+        return result;
+    }
+
+    public static ResponseResult errorResult(String respMsg) {
+        ResponseResult result = new ResponseResult();
+        result.setRespCode(ResponseCode.A10000.getCode());
+        result.setRespMsg(respMsg);
+        return result;
+    }
+
+    public static ResponseResult errorResult(String respCode, String respMsg) {
+        ResponseResult result = new ResponseResult();
+        result.setRespCode(respCode);
+        result.setRespMsg(respMsg);
+        return result;
+    }
+
+    public static ResponseResult errorResult(String respCode, String respMsg, Object content) {
+        ResponseResult result = new ResponseResult();
+        result.setRespCode(respCode);
+        result.setRespMsg(respMsg);
+        result.setContent(content);
+        return result;
+    }
+
+}

+ 9 - 0
apm-common/src/main/java/com/persagy/security/exception/AESDecryptException.java

@@ -0,0 +1,9 @@
+package com.persagy.security.exception;
+
+public class AESDecryptException extends CipherException {
+	private static final long serialVersionUID = 818715664895970378L;
+
+	public AESDecryptException(String message) {
+		super(message);
+	}
+}

+ 9 - 0
apm-common/src/main/java/com/persagy/security/exception/CipherException.java

@@ -0,0 +1,9 @@
+package com.persagy.security.exception;
+
+public class CipherException extends RuntimeException {
+	private static final long serialVersionUID = 6894064914307229407L;
+
+	public CipherException(String message) {
+		super(message);
+	}
+}

+ 2 - 12
apm-mybatis/pom.xml

@@ -4,7 +4,7 @@
     <parent>
         <groupId>com.persagy</groupId>
         <artifactId>apm-parent</artifactId>
-        <version>v1.2.0-SNAPSHOT</version>
+        <version>v1.3.0-SNAPSHOT</version>
         <relativePath>../apm-parent</relativePath>
     </parent>
     <artifactId>apm-mybatis</artifactId>
@@ -13,17 +13,7 @@
         <dependency>
             <groupId>com.persagy</groupId>
             <artifactId>apm-common</artifactId>
-        </dependency>
-        <!-- mybatisPlus相关的依赖 start -->
-        <!-- mybatisPlus -->
-        <dependency>
-            <groupId>com.baomidou</groupId>
-            <artifactId>mybatis-plus-boot-starter</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.baomidou</groupId>
-            <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
-            <version>3.3.2</version>
+            <version>v1.3.0-SNAPSHOT</version><!--$NO-MVN-MAN-VER$-->
         </dependency>
     </dependencies>
 </project>

+ 4 - 5
apm-mybatis/src/main/java/com/persagy/apm/mybatis/aop/FormatMybatisQueryParamsAspect.java

@@ -1,7 +1,8 @@
 package com.persagy.apm.mybatis.aop;
 
-import com.persagy.apm.mybatis.utils.MyBatisStringUtils;
-import lombok.extern.slf4j.Slf4j;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
 import org.apache.commons.lang3.StringUtils;
 import org.aspectj.lang.JoinPoint;
 import org.aspectj.lang.annotation.Aspect;
@@ -9,8 +10,7 @@ import org.aspectj.lang.annotation.Before;
 import org.aspectj.lang.annotation.Pointcut;
 import org.springframework.stereotype.Component;
 
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
+import com.persagy.apm.mybatis.utils.MyBatisStringUtils;
 
 /**
  * 格式化mybatis请求参数切面
@@ -20,7 +20,6 @@ import java.lang.reflect.Method;
  **/
 @Component
 @Aspect
-@Slf4j
 public class FormatMybatisQueryParamsAspect {
     @Pointcut("@annotation(com.persagy.apm.mybatis.annotations.FormatMybatisQueryParams)")
     private void pointCutMethod() {

+ 0 - 36
apm-mybatis/src/main/java/com/persagy/apm/mybatis/config/MybatisPlusConfig.java

@@ -1,36 +0,0 @@
-package com.persagy.apm.mybatis.config;
-
-import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.transaction.annotation.EnableTransactionManagement;
-
-/**
- * <p>
- * MybatisPlusConfig
- * </p>
- *
- * @author lixing
- * @description 由 Mybatisplus Code Generator 创建
- * @since 2020-09-09 09:13:27
- **/
-@Configuration
-@EnableTransactionManagement
-public class MybatisPlusConfig {
-    /**
-     * @param
-     * @description:配置分页插件 不配置分页插件,MP提供的分页方法会查询全部,分页不生效
-     * 使用实例:
-     * IPage<Member> memberPage = new Page<>(1, 2,false) true查询总记录数量
-     * @exception:
-     * @author: LuoGuangyi
-     * @company: Persagy Technology Co.,Ltd
-     * @return: com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor
-     * @since: 2020/09/30 10:33
-     * @version: V1.0
-     */
-    @Bean
-    public PaginationInterceptor paginationInterceptor() {
-        return new PaginationInterceptor();
-    }
-}

+ 2 - 1
apm-mybatis/src/main/java/com/persagy/apm/mybatis/handler/DbJsonTypeHandler.java

@@ -29,7 +29,8 @@ public class DbJsonTypeHandler extends AbstractJsonTypeHandler<Object> {
         this.clazz = innerType;
     }
 
-    @Override
+    @SuppressWarnings("deprecation")
+	@Override
     protected Object parse(String json) {
         if (JSONUtil.isJsonArray(json)) {
             return JSONUtil.toList(JSONUtil.parseArray(json), this.clazz);

+ 13 - 16
apm-mybatis/src/main/java/com/persagy/apm/mybatis/handler/DynamicDataSourceHandler.java

@@ -1,27 +1,25 @@
 package com.persagy.apm.mybatis.handler;
 
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.sql.DataSource;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.servlet.AsyncHandlerInterceptor;
+
 import com.baomidou.dynamic.datasource.DynamicRoutingDataSource;
 import com.baomidou.dynamic.datasource.creator.DefaultDataSourceCreator;
 import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DataSourceProperty;
 import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties;
 import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
-import com.google.common.collect.Lists;
 import com.persagy.apm.common.context.poems.PoemsContext;
 import com.persagy.apm.common.helper.SpringHelper;
 import com.persagy.apm.mybatis.service.IDbService;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.stereotype.Component;
-import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
-
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.sql.DataSource;
 
 /**
  * 动态数据源拦截器
@@ -29,8 +27,7 @@ import javax.sql.DataSource;
  * @author Charlie Yu
  * @date 2021-03-29
  */
-@Component
-public class DynamicDataSourceHandler extends HandlerInterceptorAdapter {
+public class DynamicDataSourceHandler implements AsyncHandlerInterceptor {
 
     /**
      * 忽略的url - swagger的文档不校验

+ 1 - 1
apm-package/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>apm-parent</artifactId>
         <groupId>com.persagy</groupId>
-        <version>v1.2.0-SNAPSHOT</version>
+        <version>v1.3.0-SNAPSHOT</version>
         <relativePath>../apm-parent</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

+ 413 - 376
apm-parent/pom.xml

@@ -1,382 +1,419 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <groupId>com.persagy</groupId>
-    <artifactId>apm-parent</artifactId>
-    <version>v1.2.0-SNAPSHOT</version>
-    <packaging>pom</packaging>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>com.persagy</groupId>
+	<artifactId>apm-parent</artifactId>
+	<version>v1.3.0-SNAPSHOT</version>
+	<packaging>pom</packaging>
 
-    <repositories>
-        <repository>
-            <id>integrated</id>
-            <name>releases Repository</name>
-            <url>http://47.93.132.139:8081/nexus/content/repositories/integrated/</url>
-        </repository>
-        <repository>
-            <id>Snapshots</id>
-            <name>snapshot</name>
-            <url>http://47.93.132.139:8081/nexus/content/repositories/snapshots/</url>
-        </repository>
-        <repository>
-            <id>Releases</id>
-            <name>persagy</name>
-            <url>http://47.93.132.139:8081/nexus/content/repositories/persagy</url>
-        </repository>
-    </repositories>
+	<repositories>
+		<repository>
+			<id>integrated</id>
+			<name>releases Repository</name>
+			<url>http://47.93.132.139:8081/nexus/content/repositories/integrated/</url>
+		</repository>
+		<repository>
+			<id>Snapshots</id>
+			<name>snapshot</name>
+			<url>http://47.93.132.139:8081/nexus/content/repositories/snapshots/</url>
+		</repository>
+		<repository>
+			<id>Releases</id>
+			<name>persagy</name>
+			<url>http://47.93.132.139:8081/nexus/content/repositories/persagy</url>
+		</repository>
+		<repository>
+			<id>persagy2021-yushu-public</id>
+			<name>public</name>
+			<url>https://persagy2021-maven.pkg.coding.net/repository/yushu/public/</url>
+		</repository>
+	</repositories>
+	<parent>
+		<groupId>org.springframework.boot</groupId>
+		<artifactId>spring-boot-starter-parent</artifactId>
+		<version>2.4.12</version>
+		<relativePath />
+	</parent>
+	<!-- 版本管理 -->
+	<properties>
+		<passcloud.version>1.0.8</passcloud.version>
+		<apm.version>v1.3.0-SNAPSHOT</apm.version>
+		<platform.version>1.0.0</platform.version>
+		<mybatis-plus.version>3.3.1</mybatis-plus.version>
+		<dynamic-datasource.version>3.3.2</dynamic-datasource.version>
+		<tomcat-jdbc.version>9.0.31</tomcat-jdbc.version>
+		<HikariCP.version>3.2.0</HikariCP.version>
+		<mysql.version>8.0.15</mysql.version>
+		<guava.version>27.0.1-jre</guava.version>
+		<spring.version>5.3.12</spring.version>
+		<spring-data.version>2.4.4</spring-data.version>
+		<mapstruct.version>1.2.0.Final</mapstruct.version>
+		<lang.version>2.5</lang.version>
+		<gson.version>2.8.6</gson.version>
+		<druid.version>1.1.22</druid.version>
+		<!-- Plugins -->
+		<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
+		<spring-boot-maven-plugin.version>2.4.3</spring-boot-maven-plugin.version>
+		<maven-source-plugin.version>3.0.1</maven-source-plugin.version>
+		<maven-resources-plugin.version>3.0.2</maven-resources-plugin.version>
+	</properties>
 
-    <parent>
-        <groupId>org.springframework.boot</groupId>
-        <artifactId>spring-boot-starter-parent</artifactId>
-        <version>2.1.14.RELEASE</version>
-        <relativePath/>
-    </parent>
-    <!-- 版本管理 -->
-    <properties>
-        <apm.version>v1.2.0-SNAPSHOT</apm.version>
-        <platform.version>1.0.0</platform.version>
-        <mybatis-plus.version>3.3.1</mybatis-plus.version>
-        <dynamic-datasource.version>3.3.2</dynamic-datasource.version>
-        <tomcat-jdbc.version>9.0.31</tomcat-jdbc.version>
-        <HikariCP.version>3.2.0</HikariCP.version>
-        <mysql.version>8.0.15</mysql.version>
-        <guava.version>27.0.1-jre</guava.version>
-        <spring.version>5.1.15.RELEASE</spring.version>
-        <spring-data.version>2.1.17.RELEASE</spring-data.version>
-        <spring-data-jpa.version>2.0.11.RELEASE</spring-data-jpa.version>
-        <mapstruct.version>1.2.0.Final</mapstruct.version>
-        <lang.version>2.5</lang.version>
-        <gson.version>2.8.6</gson.version>
-        <druid.version>1.1.22</druid.version>
-        <!-- Plugins -->
-        <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
-        <spring-boot-maven-plugin.version>2.4.3</spring-boot-maven-plugin.version>
-        <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
-        <maven-resources-plugin.version>3.0.2</maven-resources-plugin.version>
-    </properties>
+	<dependencyManagement>
+		<dependencies>
+			<dependency>
+				<groupId>com.persagy</groupId>
+				<artifactId>starter-cloud</artifactId>
+				<version>${passcloud.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.persagy</groupId>
+				<artifactId>starter-web</artifactId>
+				<version>${passcloud.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.persagy</groupId>
+				<artifactId>starter-redis</artifactId>
+				<version>${passcloud.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.persagy</groupId>
+				<artifactId>starter-databases</artifactId>
+				<version>${passcloud.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.persagy</groupId>
+				<artifactId>starter-excel</artifactId>
+				<version>${passcloud.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.persagy</groupId>
+				<artifactId>starter-redis</artifactId>
+				<version>${passcloud.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.persagy</groupId>
+				<artifactId>starter-rabbitmq</artifactId>
+				<version>${passcloud.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.persagy</groupId>
+				<artifactId>apm-server</artifactId>
+				<version>${apm.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.persagy</groupId>
+				<artifactId>apm-common</artifactId>
+				<version>${apm.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.persagy</groupId>
+				<artifactId>apm-mybatis</artifactId>
+				<version>${apm.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.persagy</groupId>
+				<artifactId>apm-translate</artifactId>
+				<version>${apm.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.persagy</groupId>
+				<artifactId>integrated-common-core</artifactId>
+				<version>${platform.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.persagy</groupId>
+				<artifactId>integrated-common-security</artifactId>
+				<version>${platform.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.persagy</groupId>
+				<artifactId>integrated-log-spring-boot-starter</artifactId>
+				<version>${platform.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.persagy</groupId>
+				<artifactId>integrated-ribbon-spring-boot-starter</artifactId>
+				<version>${platform.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.persagy</groupId>
+				<artifactId>integrated-swagger2-spring-boot-starter</artifactId>
+				<version>${platform.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.persagy</groupId>
+				<artifactId>integrated-redis-spring-boot-starter</artifactId>
+				<version>${platform.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.persagy</groupId>
+				<artifactId>integrated-config-client</artifactId>
+				<version>${platform.version}</version>
+			</dependency>
+			<!-- mybatis plus -->
+			<dependency>
+				<groupId>com.baomidou</groupId>
+				<artifactId>mybatis-plus-boot-starter</artifactId>
+				<version>${mybatis-plus.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.baomidou</groupId>
+				<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
+				<version>${dynamic-datasource.version}</version>
+			</dependency>
+			<!-- mapstruct 优雅的进行bean与dto的转换 -->
+			<dependency>
+				<groupId>org.mapstruct</groupId>
+				<artifactId>mapstruct-jdk8</artifactId>
+				<version>${mapstruct.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.mapstruct</groupId>
+				<artifactId>mapstruct-processor</artifactId>
+				<version>${mapstruct.version}</version>
+			</dependency>
+			<!-- alibaba druid -->
+			<dependency>
+				<groupId>com.alibaba</groupId>
+				<artifactId>druid-spring-boot-starter</artifactId>
+				<version>${druid.version}</version>
+			</dependency>
+			<!-- 以下是数据库连接池版本管理,建议使用provided方式引入-->
+			<dependency>
+				<groupId>org.apache.tomcat</groupId>
+				<artifactId>tomcat-jdbc</artifactId>
+				<version>${tomcat-jdbc.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.zaxxer</groupId>
+				<artifactId>HikariCP</artifactId>
+				<version>${HikariCP.version}</version>
+			</dependency>
+			<!-- 以下是数据库driver版本管理,建议使用provided方式引入 -->
+			<dependency>
+				<groupId>mysql</groupId>
+				<artifactId>mysql-connector-java</artifactId>
+				<version>${mysql.version}</version>
+			</dependency>
+			<!-- 以下是commons工具版本管理 -->
+			<dependency>
+				<groupId>com.google.guava</groupId>
+				<artifactId>guava</artifactId>
+				<version>${guava.version}</version>
+			</dependency>
+			<!-- 以下是spring版本管理 -->
+			<dependency>
+				<groupId>org.springframework</groupId>
+				<artifactId>spring-context</artifactId>
+				<version>${spring.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.springframework</groupId>
+				<artifactId>spring-web</artifactId>
+				<version>${spring.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.springframework</groupId>
+				<artifactId>spring-tx</artifactId>
+				<version>${spring.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.springframework</groupId>
+				<artifactId>spring-aop</artifactId>
+				<version>${spring.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.springframework</groupId>
+				<artifactId>spring-test</artifactId>
+				<version>${spring.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.springframework</groupId>
+				<artifactId>spring-beans</artifactId>
+				<version>${spring.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.springframework</groupId>
+				<artifactId>spring-webmvc</artifactId>
+				<version>${spring.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.springframework</groupId>
+				<artifactId>spring-context-support</artifactId>
+				<version>${spring.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.springframework</groupId>
+				<artifactId>spring-core</artifactId>
+				<version>${spring.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.springframework</groupId>
+				<artifactId>spring-expression</artifactId>
+				<version>${spring.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.springframework</groupId>
+				<artifactId>spring-jcl</artifactId>
+				<version>${spring.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.springframework</groupId>
+				<artifactId>spring-jdbc</artifactId>
+				<version>${spring.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.springframework</groupId>
+				<artifactId>spring-messaging</artifactId>
+				<version>${spring.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.springframework</groupId>
+				<artifactId>spring-oxm</artifactId>
+				<version>${spring.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.springframework</groupId>
+				<artifactId>spring-webflux</artifactId>
+				<version>${spring.version}</version>
+			</dependency>
+			<!-- 以下是spring data版本管理 -->
+			<dependency>
+				<groupId>org.springframework.data</groupId>
+				<artifactId>spring-data-commons</artifactId>
+				<version>${spring-data.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.springframework.data</groupId>
+				<artifactId>spring-data-redis</artifactId>
+				<version>${spring-data.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.springframework.data</groupId>
+				<artifactId>spring-data-jpa</artifactId>
+				<version>${spring-data.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>commons-lang</groupId>
+				<artifactId>commons-lang</artifactId>
+				<version>${lang.version}</version>
+			</dependency>
+			<!-- gson json,java对象互转 -->
+			<dependency>
+				<groupId>com.google.code.gson</groupId>
+				<artifactId>gson</artifactId>
+				<version>${gson.version}</version>
+			</dependency>
+		</dependencies>
+	</dependencyManagement>
 
-    <dependencyManagement>
-        <dependencies>
-            <dependency>
-                <groupId>com.persagy</groupId>
-                <artifactId>apm-server</artifactId>
-                <version>${apm.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>com.persagy</groupId>
-                <artifactId>apm-common</artifactId>
-                <version>${apm.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>com.persagy</groupId>
-                <artifactId>apm-mybatis</artifactId>
-                <version>${apm.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>com.persagy</groupId>
-                <artifactId>apm-translate</artifactId>
-                <version>${apm.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>com.persagy</groupId>
-                <artifactId>integrated-common-core</artifactId>
-                <version>${platform.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>com.persagy</groupId>
-                <artifactId>integrated-common-security</artifactId>
-                <version>${platform.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>com.persagy</groupId>
-                <artifactId>integrated-log-spring-boot-starter</artifactId>
-                <version>${platform.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>com.persagy</groupId>
-                <artifactId>integrated-ribbon-spring-boot-starter</artifactId>
-                <version>${platform.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>com.persagy</groupId>
-                <artifactId>integrated-swagger2-spring-boot-starter</artifactId>
-                <version>${platform.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>com.persagy</groupId>
-                <artifactId>integrated-redis-spring-boot-starter</artifactId>
-                <version>${platform.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>com.persagy</groupId>
-                <artifactId>integrated-config-client</artifactId>
-                <version>${platform.version}</version>
-            </dependency>
-            <!-- mybatis plus -->
-            <dependency>
-                <groupId>com.baomidou</groupId>
-                <artifactId>mybatis-plus-boot-starter</artifactId>
-                <version>${mybatis-plus.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>com.baomidou</groupId>
-                <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
-                <version>${dynamic-datasource.version}</version>
-            </dependency>
-            <!-- mapstruct 优雅的进行bean与dto的转换 -->
-            <dependency>
-                <groupId>org.mapstruct</groupId>
-                <artifactId>mapstruct-jdk8</artifactId>
-                <version>${mapstruct.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.mapstruct</groupId>
-                <artifactId>mapstruct-processor</artifactId>
-                <version>${mapstruct.version}</version>
-            </dependency>
-            <!-- alibaba druid -->
-            <dependency>
-                <groupId>com.alibaba</groupId>
-                <artifactId>druid-spring-boot-starter</artifactId>
-                <version>${druid.version}</version>
-            </dependency>
-            <!-- 以下是数据库连接池版本管理,建议使用provided方式引入-->
-            <dependency>
-                <groupId>org.apache.tomcat</groupId>
-                <artifactId>tomcat-jdbc</artifactId>
-                <version>${tomcat-jdbc.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>com.zaxxer</groupId>
-                <artifactId>HikariCP</artifactId>
-                <version>${HikariCP.version}</version>
-            </dependency>
-            <!-- 以下是数据库driver版本管理,建议使用provided方式引入 -->
-            <dependency>
-                <groupId>mysql</groupId>
-                <artifactId>mysql-connector-java</artifactId>
-                <version>${mysql.version}</version>
-            </dependency>
-            <!-- 以下是commons工具版本管理 -->
-            <dependency>
-                <groupId>com.google.guava</groupId>
-                <artifactId>guava</artifactId>
-                <version>${guava.version}</version>
-            </dependency>
-            <!-- 以下是spring版本管理 -->
-            <dependency>
-                <groupId>org.springframework</groupId>
-                <artifactId>spring-context</artifactId>
-                <version>${spring.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.springframework</groupId>
-                <artifactId>spring-web</artifactId>
-                <version>${spring.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.springframework</groupId>
-                <artifactId>spring-tx</artifactId>
-                <version>${spring.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.springframework</groupId>
-                <artifactId>spring-aop</artifactId>
-                <version>${spring.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.springframework</groupId>
-                <artifactId>spring-test</artifactId>
-                <version>${spring.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.springframework</groupId>
-                <artifactId>spring-beans</artifactId>
-                <version>${spring.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.springframework</groupId>
-                <artifactId>spring-webmvc</artifactId>
-                <version>${spring.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.springframework</groupId>
-                <artifactId>spring-context-support</artifactId>
-                <version>${spring.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.springframework</groupId>
-                <artifactId>spring-core</artifactId>
-                <version>${spring.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.springframework</groupId>
-                <artifactId>spring-expression</artifactId>
-                <version>${spring.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.springframework</groupId>
-                <artifactId>spring-jcl</artifactId>
-                <version>${spring.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.springframework</groupId>
-                <artifactId>spring-jdbc</artifactId>
-                <version>${spring.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.springframework</groupId>
-                <artifactId>spring-messaging</artifactId>
-                <version>${spring.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.springframework</groupId>
-                <artifactId>spring-oxm</artifactId>
-                <version>${spring.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.springframework</groupId>
-                <artifactId>spring-webflux</artifactId>
-                <version>${spring.version}</version>
-            </dependency>
-            <!-- 以下是spring data版本管理 -->
-            <dependency>
-                <groupId>org.springframework.data</groupId>
-                <artifactId>spring-data-commons</artifactId>
-                <version>${spring-data.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.springframework.data</groupId>
-                <artifactId>spring-data-redis</artifactId>
-                <version>${spring-data.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.springframework.data</groupId>
-                <artifactId>spring-data-jpa</artifactId>
-                <version>${spring-data-jpa.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>commons-lang</groupId>
-                <artifactId>commons-lang</artifactId>
-                <version>${lang.version}</version>
-            </dependency>
-            <!-- gson json,java对象互转 -->
-            <dependency>
-                <groupId>com.google.code.gson</groupId>
-                <artifactId>gson</artifactId>
-                <version>${gson.version}</version>
-            </dependency>
-        </dependencies>
-    </dependencyManagement>
+	<!-- 插件配置 -->
+	<build>
+		<finalName>${project.artifactId}</finalName>
+		<pluginManagement>
+			<plugins>
+				<!-- compiler插件, 设定JDK版本 -->
+				<plugin>
+					<groupId>org.apache.maven.plugins</groupId>
+					<artifactId>maven-compiler-plugin</artifactId>
+					<version>${maven-compiler-plugin.version}</version>
+					<configuration>
+						<source>${java.version}</source>
+						<target>${java.version}</target>
+						<encoding>UTF-8</encoding>
+						<skip>true</skip>
+						<showWarnings>true</showWarnings>
+					</configuration>
+				</plugin>
+				<plugin>
+					<groupId>org.springframework.boot</groupId>
+					<artifactId>spring-boot-maven-plugin</artifactId>
+					<version>${spring-boot-maven-plugin.version}</version>
+				</plugin>
+				<plugin>
+					<groupId>org.apache.maven.plugins</groupId>
+					<artifactId>maven-source-plugin</artifactId>
+					<version>${maven-source-plugin.version}</version>
+					<configuration>
+						<attach>true</attach>
+					</configuration>
+					<executions>
+						<execution>
+							<phase>compile</phase>
+							<goals>
+								<goal>jar</goal>
+							</goals>
+						</execution>
+					</executions>
+				</plugin>
+				<!-- resource插件 -->
+				<plugin>
+					<groupId>org.apache.maven.plugins</groupId>
+					<artifactId>maven-resources-plugin</artifactId>
+					<version>${maven-resources-plugin.version}</version>
+					<executions>
+						<execution>
+							<id>copy-resources</id>
+							<phase>package</phase>
+							<goals>
+								<goal>copy-resources</goal>
+							</goals>
+							<configuration>
+								<resources>
+									<resource>
+										<directory>src/main/resources/</directory>
+										<includes>
+											<include>**/*.yml</include>
+										</includes>
+									</resource>
+									<resource>
+										<directory>${project.build.directory}</directory>
+										<includes>
+											<include>**/version.txt</include>
+										</includes>
+									</resource>
+								</resources>
+								<outputDirectory>${project.build.directory}/config</outputDirectory>
+							</configuration>
+						</execution>
+						<!--拷贝启动脚本-->
+						<execution>
+							<id>copy-version</id>
+							<phase>package</phase>
+							<goals>
+								<goal>copy-resources</goal>
+							</goals>
+							<configuration>
+								<resources>
+									<resource>
+										<directory>src/script</directory>
+									</resource>
+								</resources>
+								<outputDirectory>${project.build.directory}</outputDirectory>
+							</configuration>
+						</execution>
+					</executions>
+				</plugin>
+			</plugins>
+		</pluginManagement>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-source-plugin</artifactId>
+			</plugin>
+		</plugins>
+	</build>
 
-    <!-- 插件配置 -->
-    <build>
-        <finalName>${project.artifactId}</finalName>
-        <pluginManagement>
-            <plugins>
-                <!-- compiler插件, 设定JDK版本 -->
-                <plugin>
-                    <groupId>org.apache.maven.plugins</groupId>
-                    <artifactId>maven-compiler-plugin</artifactId>
-                    <version>${maven-compiler-plugin.version}</version>
-                    <configuration>
-                        <source>${java.version}</source>
-                        <target>${java.version}</target>
-                        <encoding>UTF-8</encoding>
-                        <skip>true</skip>
-                        <showWarnings>true</showWarnings>
-                    </configuration>
-                </plugin>
-                <plugin>
-                    <groupId>org.springframework.boot</groupId>
-                    <artifactId>spring-boot-maven-plugin</artifactId>
-                    <version>${spring-boot-maven-plugin.version}</version>
-                </plugin>
-                <plugin>
-                    <groupId>org.apache.maven.plugins</groupId>
-                    <artifactId>maven-source-plugin</artifactId>
-                    <version>${maven-source-plugin.version}</version>
-                    <configuration>
-                        <attach>true</attach>
-                    </configuration>
-                    <executions>
-                        <execution>
-                            <phase>compile</phase>
-                            <goals>
-                                <goal>jar</goal>
-                            </goals>
-                        </execution>
-                    </executions>
-                </plugin>
-                <!-- resource插件 -->
-                <plugin>
-                    <groupId>org.apache.maven.plugins</groupId>
-                    <artifactId>maven-resources-plugin</artifactId>
-                    <version>${maven-resources-plugin.version}</version>
-                    <executions>
-                        <execution>
-                            <id>copy-resources</id>
-                            <phase>package</phase>
-                            <goals>
-                                <goal>copy-resources</goal>
-                            </goals>
-                            <configuration>
-                                <resources>
-                                    <resource>
-                                        <directory>src/main/resources/</directory>
-                                        <includes>
-                                            <include>**/*.yml</include>
-                                        </includes>
-                                    </resource>
-                                    <resource>
-                                        <directory>${project.build.directory}</directory>
-                                        <includes>
-                                            <include>**/version.txt</include>
-                                        </includes>
-                                    </resource>
-                                </resources>
-                                <outputDirectory>${project.build.directory}/config</outputDirectory>
-                            </configuration>
-                        </execution>
-                        <!--拷贝启动脚本-->
-                        <execution>
-                            <id>copy-version</id>
-                            <phase>package</phase>
-                            <goals>
-                                <goal>copy-resources</goal>
-                            </goals>
-                            <configuration>
-                                <resources>
-                                    <resource>
-                                        <directory>src/script</directory>
-                                    </resource>
-                                </resources>
-                                <outputDirectory>${project.build.directory}</outputDirectory>
-                            </configuration>
-                        </execution>
-                    </executions>
-                </plugin>
-            </plugins>
-        </pluginManagement>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-source-plugin</artifactId>
-            </plugin>
-        </plugins>
-    </build>
-
-    <distributionManagement>
-        <snapshotRepository>
-            <id>Snapshots</id>
-            <name>apm-basics</name>
-            <url>http://47.93.132.139:8081/nexus/content/repositories/snapshots/</url>
-        </snapshotRepository>
-        <repository>
-            <id>Releases</id>
-            <name>apm-basics</name>
-            <url>http://47.93.132.139:8081/nexus/content/repositories/persagy/</url>
-        </repository>
-    </distributionManagement>
+	<distributionManagement>
+		<snapshotRepository>
+			<id>Snapshots</id>
+			<name>apm-basics</name>
+			<url>http://47.93.132.139:8081/nexus/content/repositories/snapshots/</url>
+		</snapshotRepository>
+		<repository>
+			<id>Releases</id>
+			<name>apm-basics</name>
+			<url>http://47.93.132.139:8081/nexus/content/repositories/persagy/</url>
+		</repository>
+	</distributionManagement>
 </project>

+ 7 - 13
apm-server/pom.xml

@@ -5,26 +5,20 @@
     <parent>
         <artifactId>apm-parent</artifactId>
         <groupId>com.persagy</groupId>
-        <version>v1.0.0-SNAPSHOT</version>
+        <version>v1.3.0-SNAPSHOT</version>
         <relativePath>../apm-parent</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>apm-server</artifactId>
-	<version>v1.2.0-SNAPSHOT</version>
     <dependencies>
-        <!-- 集成框架工具类 -->
+		<dependency>
+			<groupId>com.persagy</groupId>
+			<artifactId>starter-web</artifactId>
+		</dependency>
         <dependency>
             <groupId>com.persagy</groupId>
-            <artifactId>integrated-common-core</artifactId>
-        </dependency>
-        <!-- web -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>druid-spring-boot-starter</artifactId>
+            <artifactId>apm-common</artifactId>
+            <version>v1.3.0-SNAPSHOT</version><!--$NO-MVN-MAN-VER$-->
         </dependency>
     </dependencies>
 </project>

+ 5 - 5
apm-server/src/main/java/com/persagy/ServerApplication.java

@@ -1,9 +1,5 @@
 package com.persagy;
 
-import cn.hutool.extra.spring.EnableSpringUtil;
-import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
-import com.persagy.log.annotation.EnableControllerLog;
-import lombok.extern.slf4j.Slf4j;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.Banner;
 import org.springframework.boot.SpringApplication;
@@ -15,6 +11,11 @@ import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
 import org.springframework.scheduling.annotation.EnableScheduling;
 
+import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
+
+import cn.hutool.extra.spring.EnableSpringUtil;
+import lombok.extern.slf4j.Slf4j;
+
 /**
  * springboot服务器
  * 同时启动Eureka和Feign
@@ -23,7 +24,6 @@ import org.springframework.scheduling.annotation.EnableScheduling;
  */
 @EnableCaching(proxyTargetClass = true)
 @EnableFeignClients(basePackages="com.persagy.apm.**.client")
-@EnableControllerLog
 @EnableDiscoveryClient
 @Configuration
 @EnableScheduling

+ 2 - 17
apm-translate/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>apm-parent</artifactId>
         <groupId>com.persagy</groupId>
-        <version>v1.2.0-SNAPSHOT</version>
+        <version>v1.3.0-SNAPSHOT</version>
         <relativePath>../apm-parent</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
@@ -14,23 +14,8 @@
     <dependencies>
         <dependency>
             <groupId>com.persagy</groupId>
-            <artifactId>integrated-common-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.persagy</groupId>
             <artifactId>apm-common</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-tx</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.data</groupId>
-            <artifactId>spring-data-commons</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.google.guava</groupId>
-            <artifactId>guava</artifactId>
+            <version>v1.3.0-SNAPSHOT</version><!--$NO-MVN-MAN-VER$-->
         </dependency>
     </dependencies>
 </project>

+ 1 - 0
apm-translate/src/main/java/com/persagy/apm/translate/dao/ITranslateDao.java

@@ -28,6 +28,7 @@ public interface ITranslateDao{
 	 * @param parameter 参数
 	 * @param handler 结果处理
 	 */
+	@SuppressWarnings("rawtypes")
 	void findBatchTransBySql(@Param("sql") String sql, @Param("parameter") List<String> parameter, ResultHandler handler);
 
 }

+ 4 - 2
apm-translate/src/main/java/com/persagy/apm/translate/extension/BeanTransWrapperBuilder.java

@@ -48,11 +48,13 @@ public class BeanTransWrapperBuilder implements ITransWrapperBuilder{
      * 构造方法
      * @param clazz 对象类
      */
-    public BeanTransWrapperBuilder(Class clazz){
+    @SuppressWarnings("rawtypes")
+	public BeanTransWrapperBuilder(Class clazz){
         this.isMap = Map.class.isAssignableFrom(clazz);
         this.clazz = clazz;
     }
-    @Override
+    @SuppressWarnings({ "unchecked", "rawtypes" })
+	@Override
     public ITransWrapper createWrapper(Object origion) {
         if(isMap) {
             return new MapTransWrapper((Map<String, Object>) origion);

+ 1 - 0
apm-translate/src/main/java/com/persagy/apm/translate/extension/MapPairResultHandler.java

@@ -12,6 +12,7 @@ import java.util.Map;
  * @version 1.0 2015-7-23
  * @since 1.6
  */
+@SuppressWarnings("rawtypes")
 public class MapPairResultHandler implements ResultHandler {
 
     /**

+ 1 - 0
apm-translate/src/main/java/com/persagy/apm/translate/extension/MapResultHandler.java

@@ -12,6 +12,7 @@ import java.util.Map;
  * @version 1.0 2015-7-23
  * @since 1.6
  */
+@SuppressWarnings("rawtypes")
 public class MapResultHandler<T> implements ResultHandler {
 
     /**

+ 1 - 0
apm-translate/src/main/java/com/persagy/apm/translate/helper/EmojiCharsTranslator.java

@@ -20,6 +20,7 @@ public class EmojiCharsTranslator implements ITranslator {
 		return EmojiUtil.toHtml(parameter);
 	}
 
+	@SuppressWarnings({ "unchecked", "rawtypes" })
 	@Override
 	public Map<String, Object> transBatch(List<String> parameter) {
 		if (parameter == null || parameter.size() == 0) {

+ 10 - 8
apm-translate/src/main/java/com/persagy/apm/translate/impl/DBTranslateHandleImpl.java

@@ -1,5 +1,13 @@
 package com.persagy.apm.translate.impl;
 
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
 import com.persagy.apm.common.helper.SpringHelper;
 import com.persagy.apm.translate.dao.ITranslateDao;
 import com.persagy.apm.translate.extension.MapPairResultHandler;
@@ -8,13 +16,6 @@ import com.persagy.apm.translate.model.ITransWrapper;
 import com.persagy.apm.translate.model.TransMeta;
 import com.persagy.apm.translate.model.TransType;
 import com.persagy.apm.translate.service.ITranslateBatchHandle;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.context.annotation.Scope;
-import org.springframework.stereotype.Service;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
 
 
 /**
@@ -109,7 +110,8 @@ public class DBTranslateHandleImpl implements ITranslateBatchHandle {
         return data;
     }
 
-    @Override
+    @SuppressWarnings({ "rawtypes", "unchecked" })
+	@Override
     public Map<String, Object> batchTrans(List<String> parameter) {
         if (parameter == null || parameter.size() == 0) {
             return null;

+ 11 - 9
apm-translate/src/main/java/com/persagy/apm/translate/impl/ServiceTranslateHandleImpl.java

@@ -1,20 +1,22 @@
 package com.persagy.apm.translate.impl;
 
-import cn.hutool.core.collection.CollUtil;
-import com.persagy.common.exception.BusinessException;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
 import com.persagy.apm.common.helper.SpringHelper;
 import com.persagy.apm.translate.model.ITransWrapper;
 import com.persagy.apm.translate.model.TransMeta;
 import com.persagy.apm.translate.model.TransType;
 import com.persagy.apm.translate.service.ITranslateBatchHandle;
 import com.persagy.apm.translate.service.ITranslator;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.context.annotation.Scope;
-import org.springframework.stereotype.Service;
+import com.persagy.common.exception.BusinessException;
 
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
+import cn.hutool.core.collection.CollUtil;
 
 
 /**
@@ -22,7 +24,6 @@ import java.util.Map;
  * @author Charlie Yu
  * @Date 2021-03-03
  */
-@SuppressWarnings("ALL")
 @Service(TransType.SERVICE)
 @Scope("prototype")
 public class ServiceTranslateHandleImpl implements ITranslateBatchHandle {
@@ -52,6 +53,7 @@ public class ServiceTranslateHandleImpl implements ITranslateBatchHandle {
 		this.meta = meta;
 	}
 
+	@SuppressWarnings({ "rawtypes", "unchecked" })
 	@Override
 	public ITransWrapper trans(ITransWrapper data) {
 		if(translator == null){

+ 22 - 13
apm-translate/src/main/java/com/persagy/apm/translate/impl/TranslateServiceImpl.java

@@ -1,6 +1,19 @@
 package com.persagy.apm.translate.impl;
 
-import cn.hutool.core.collection.CollUtil;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.PageImpl;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
 import com.persagy.apm.common.helper.SpringHelper;
 import com.persagy.apm.common.response.CommonResult;
 import com.persagy.apm.common.response.PageList;
@@ -11,15 +24,8 @@ import com.persagy.apm.translate.model.TransMeta;
 import com.persagy.apm.translate.service.ITranslateBatchHandle;
 import com.persagy.apm.translate.service.ITranslateHandle;
 import com.persagy.apm.translate.service.ITranslateService;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.PageImpl;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
 
-import java.lang.reflect.Field;
-import java.util.*;
-import java.util.stream.Collectors;
+import cn.hutool.core.collection.CollUtil;
 
 
 /**
@@ -31,7 +37,7 @@ import java.util.stream.Collectors;
 @Transactional
 public class TranslateServiceImpl implements ITranslateService {
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     @Override
     public Object translate(Object origins, List<TransMeta> metas) {
         if (origins == null || metas == null || metas.size() == 0) {
@@ -86,7 +92,8 @@ public class TranslateServiceImpl implements ITranslateService {
      * @param origins 原结果
      * @return
      */
-    private Object fetchTransObj(Object origins){
+    @SuppressWarnings({ "unchecked", "rawtypes" })
+	private Object fetchTransObj(Object origins){
         Object obj = null;
         //对分页和列表进行处理获取单个对象,并设置是否为列表标志
         if (origins instanceof Page) {
@@ -151,7 +158,8 @@ public class TranslateServiceImpl implements ITranslateService {
      * @param handle   翻译处理
      * @param builder   数据包装对象构建器
      */
-    protected void batchTransMultiRows(List<Object> datas, List<ITransWrapper> wrappers, ITranslateBatchHandle handle, ITransWrapperBuilder builder) {
+    @SuppressWarnings({ "unchecked", "rawtypes" })
+	protected void batchTransMultiRows(List<Object> datas, List<ITransWrapper> wrappers, ITranslateBatchHandle handle, ITransWrapperBuilder builder) {
         List<String> parameters = new ArrayList<>();
         TransMeta meta = handle.getMeta();
         if (wrappers.size() == 0) {
@@ -232,7 +240,8 @@ public class TranslateServiceImpl implements ITranslateService {
      * @param meta    翻译元数据
      * @param wrapper 包装对象
      */
-    protected void setRowTransResult(Object rs, TransMeta meta, ITransWrapper wrapper) {
+    @SuppressWarnings("unchecked")
+	protected void setRowTransResult(Object rs, TransMeta meta, ITransWrapper wrapper) {
         if (rs == null) {
             return;
         }

+ 6 - 6
apm-translate/src/main/java/com/persagy/apm/translate/model/TransMeta.java

@@ -1,20 +1,20 @@
 package com.persagy.apm.translate.model;
 
-import cn.hutool.json.JSONUtil;
-import com.fasterxml.jackson.databind.JsonNode;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.commons.lang3.StringUtils;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+import cn.hutool.json.JSONUtil;
+
 /**
  * 翻译描述信息
  * @author Charlie Yu
  * @Date 2021-03-03
  */
-@Slf4j
 public class TransMeta {
 	
 

+ 1 - 1
pom.xml

@@ -6,7 +6,7 @@
     <parent>
         <groupId>com.persagy</groupId>
         <artifactId>apm-parent</artifactId>
-        <version>v1.2.0-SNAPSHOT</version>
+        <version>v1.3.0-SNAPSHOT</version>
         <relativePath>apm-parent</relativePath>
     </parent>
     <artifactId>apm-basics</artifactId>