Browse Source

Merge remote-tracking branch 'origin/develop' into develop

dev
jianjun 4 years ago
parent
commit
5c11d4f5c7
  1. 36
      epmet-admin/epmet-admin-server/pom.xml
  2. 13
      epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml
  3. 36
      epmet-auth/pom.xml
  4. 12
      epmet-auth/src/main/resources/bootstrap.yml
  5. 93
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/AsyncConfig.java
  6. 47
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/EpmetThreadPoolProperties.java
  7. 55
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java
  8. 36
      epmet-module/data-aggregator/data-aggregator-server/pom.xml
  9. 11
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml
  10. 36
      epmet-module/data-report/data-report-server/pom.xml
  11. 11
      epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml
  12. 53
      epmet-module/data-statistical/data-statistical-server/pom.xml
  13. 49
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/config/AsyncConfig.java
  14. 11
      epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml
  15. 36
      epmet-module/epmet-activiti/epmet-activiti-server/pom.xml
  16. 11
      epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml
  17. 36
      epmet-module/epmet-common-service/common-service-server/pom.xml
  18. 11
      epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml
  19. 36
      epmet-module/epmet-ext/epmet-ext-server/pom.xml
  20. 11
      epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml
  21. 36
      epmet-module/epmet-heart/epmet-heart-server/pom.xml
  22. 206
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java
  23. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml
  24. 53
      epmet-module/epmet-message/epmet-message-server/pom.xml
  25. 2
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/MessageApplication.java
  26. 49
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/config/AsyncConfig.java
  27. 12
      epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml
  28. 36
      epmet-module/epmet-oss/epmet-oss-server/pom.xml
  29. 11
      epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml
  30. 56
      epmet-module/epmet-point/epmet-point-server/pom.xml
  31. 2
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/EpmetPointApplication.java
  32. 49
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/AsyncConfig.java
  33. 11
      epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml
  34. 36
      epmet-module/epmet-third/epmet-third-server/pom.xml
  35. 13
      epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml
  36. 36
      epmet-module/gov-access/gov-access-server/pom.xml
  37. 13
      epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml
  38. 36
      epmet-module/gov-grid/gov-grid-server/pom.xml
  39. 11
      epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml
  40. 36
      epmet-module/gov-issue/gov-issue-server/pom.xml
  41. 11
      epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml
  42. 36
      epmet-module/gov-mine/gov-mine-server/pom.xml
  43. 11
      epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml
  44. 35
      epmet-module/gov-org/gov-org-server/pom.xml
  45. 20
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java
  46. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  47. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java
  48. 11
      epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml
  49. 36
      epmet-module/gov-project/gov-project-server/pom.xml
  50. 11
      epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml
  51. 36
      epmet-module/gov-voice/gov-voice-server/pom.xml
  52. 11
      epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml
  53. 36
      epmet-module/open-data-worker/open-data-worker-server/pom.xml
  54. 13
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/bootstrap.yml
  55. 36
      epmet-module/oper-access/oper-access-server/pom.xml
  56. 11
      epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml
  57. 36
      epmet-module/oper-crm/oper-crm-server/pom.xml
  58. 11
      epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml
  59. 36
      epmet-module/oper-customize/oper-customize-server/pom.xml
  60. 11
      epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml
  61. 2
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/ResiGroupMemberDTO.java
  62. 52
      epmet-module/resi-group/resi-group-server/pom.xml
  63. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/ResiGroupApplication.java
  64. 49
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/config/AsyncConfig.java
  65. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ExitGroupController.java
  66. 3
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ExitGroupServiceImpl.java
  67. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/entity/ResiGroupMemberEntity.java
  68. 11
      epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml
  69. 196
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java
  70. 35
      epmet-openapi/epmet-openapi-scan/pom.xml
  71. 11
      epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml
  72. 36
      epmet-user/epmet-user-server/pom.xml
  73. 11
      epmet-user/epmet-user-server/src/main/resources/bootstrap.yml

36
epmet-admin/epmet-admin-server/pom.xml

@ -141,6 +141,15 @@
<rocketmq.enable>true</rocketmq.enable>
<rocketmq.nameserver>192.168.1.140:9876;192.168.1.141:9876</rocketmq.nameserver>
<rocketmq.producer.group>epmet_message</rocketmq.producer.group>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-admin</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
<profile>
@ -181,6 +190,15 @@
<rocketmq.enable>false</rocketmq.enable>
<rocketmq.nameserver>192.168.1.140:9876;192.168.1.141:9876</rocketmq.nameserver>
<rocketmq.producer.group>epmet_message</rocketmq.producer.group>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-admin</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
<profile>
@ -217,6 +235,15 @@
<rocketmq.enable>true</rocketmq.enable>
<rocketmq.nameserver>192.168.10.161:9876</rocketmq.nameserver>
<rocketmq.producer.group>epmet_message</rocketmq.producer.group>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-admin</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
<profile>
@ -254,6 +281,15 @@
<rocketmq.enable>true</rocketmq.enable>
<rocketmq.nameserver>192.168.11.187:9876;192.168.11.184:9876</rocketmq.nameserver>
<rocketmq.producer.group>epmet_message</rocketmq.producer.group>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-admin</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
</profiles>

13
epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml

@ -139,4 +139,15 @@ shutdown:
rocketmq:
enable: @rocketmq.enable@
name-server: @rocketmq.nameserver@
name-server: @rocketmq.nameserver@
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

36
epmet-auth/pom.xml

@ -216,6 +216,15 @@
<thirdplat.jcet.g.appsecret>UUCnxLyXiB4eBF4p</thirdplat.jcet.g.appsecret>
<epmet.third.urlprefix>https://epmet-cloud.elinkservice.cn</epmet.third.urlprefix>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-auth</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
<profile>
@ -273,6 +282,15 @@
<thirdplat.jcet.g.appsecret>UUCnxLyXiB4eBF4p</thirdplat.jcet.g.appsecret>
<epmet.third.urlprefix>https://epmet-cloud.elinkservice.cn</epmet.third.urlprefix>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-auth</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
<profile>
@ -325,6 +343,15 @@
<thirdplat.jcet.g.appsecret>UUCnxLyXiB4eBF4p</thirdplat.jcet.g.appsecret>
<epmet.third.urlprefix>https://epmet-cloud.elinkservice.cn</epmet.third.urlprefix>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-auth</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
@ -382,6 +409,15 @@
<thirdplat.jcet.g.appsecret>UUCnxLyXiB4eBF4p</thirdplat.jcet.g.appsecret>
<epmet.third.urlprefix>https://epmet-cloud.elinkservice.cn</epmet.third.urlprefix>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-auth</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
</profiles>

12
epmet-auth/src/main/resources/bootstrap.yml

@ -159,3 +159,15 @@ epmet:
# third服务的相关配置
third:
urlPrefix: @epmet.third.urlprefix@
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

93
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/AsyncConfig.java

@ -0,0 +1,93 @@
package com.epmet.commons.tools.config;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;
/**
* 线程池配置类
* thread:
* # 线程池配置
* threadPool:
* enableCustomize: true [true会使用自定义线程池false则使用springboot自动配置的线程池推荐使用自定义线程池]
* 可以只配置此参数其他参会会使用默认值但还是建议把参数配置全
* corePoolSize: 2
* maxPoolSize: 4
* queueCapacity: 2
* keepAliveSeconds: 60
* threadNamePrefix: [线程池名字]
* rejectedExecutionHandler: [拒绝策略]
*
* 顺序核心线程->放入队列->未达到maxPoolSize则继续增加线程直到达到maxPoolSize->拒绝策略
* 开启自定义线程池thread.threadPool.enableCustomize=true不配置或者配置为false自定义线程池都不会开启
* rejectedExecutionHandler拒绝策略abortPolicy/discardPolicy/discardOldestPolicy/callerRunsPolicy(默认)
*/
@EnableConfigurationProperties(EpmetThreadPoolProperties.class)
@Configuration
@ConditionalOnProperty(prefix = "thread.threadPool", name = "enableCustomize", havingValue = "true", matchIfMissing = false)
public class AsyncConfig {
/**
* 默认值
*/
private int corePoolSize = 5;
private int maxPoolSize = 8;
private int queueCapacity = 20;
private String threadNamePrefix = "epmet-default-";
private int keepAliveSeconds = 60;
private String rejectedExecutionHandler = "callerRunsPolicy";
public AsyncConfig(EpmetThreadPoolProperties properties) {
if (properties.getCorePoolSize() != null) corePoolSize = properties.getCorePoolSize();
if (properties.getMaxPoolSize() != null) maxPoolSize = properties.getMaxPoolSize();
if (properties.getQueueCapacity() != null) queueCapacity = properties.getQueueCapacity();
if (properties.getThreadNamePrefix() != null) threadNamePrefix = properties.getThreadNamePrefix();
if (properties.getKeepAliveSeconds() != null) keepAliveSeconds = properties.getKeepAliveSeconds();
if (properties.getRejectedExecutionHandler() != null) rejectedExecutionHandler = properties.getRejectedExecutionHandler();
}
@Bean
public Executor executor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(corePoolSize);
executor.setMaxPoolSize(maxPoolSize);
executor.setQueueCapacity(queueCapacity);
executor.setThreadNamePrefix(threadNamePrefix);
executor.setRejectedExecutionHandler(getRejectedExecutionHandler(rejectedExecutionHandler)); //对拒绝task的处理策略
executor.setKeepAliveSeconds(keepAliveSeconds);
executor.initialize();
return executor;
}
@Bean
public ExecutorService executorService() {
ThreadPoolTaskExecutor executor = (ThreadPoolTaskExecutor) executor();
return executor.getThreadPoolExecutor();
}
/**
* 获取拒绝策略handler
* @param policy
* @return
*/
private RejectedExecutionHandler getRejectedExecutionHandler(String policy) {
switch (policy) {
case "abortPolicy":
return new ThreadPoolExecutor.AbortPolicy();
case "discardPolicy":
return new ThreadPoolExecutor.DiscardPolicy();
case "discardOldestPolicy":
return new ThreadPoolExecutor.DiscardOldestPolicy();
default:
// 默认情况下,使用主线程执行
return new ThreadPoolExecutor.CallerRunsPolicy();
}
}
}

47
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/EpmetThreadPoolProperties.java

@ -0,0 +1,47 @@
package com.epmet.commons.tools.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* 线程池配置参数
* thread-pool会自动对应到threadPool
*/
@ConfigurationProperties(prefix = "thread.thread-pool")
@Data
public class EpmetThreadPoolProperties {
/**
* 是否允许自定义线程池
*/
private Boolean enableCustomize;
/**
* 核心线程数
*/
private Integer corePoolSize;
/**
* 最大线程数
*/
private Integer maxPoolSize;
/**
* 队列容量
*/
private Integer queueCapacity;
/**
* 线程名前缀
*/
private String threadNamePrefix;
/**
* 线程存活时长
*/
private Integer keepAliveSeconds;
/**
* 拒绝策略
*/
private String rejectedExecutionHandler;
}

55
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java

@ -1,9 +1,12 @@
package com.epmet.commons.tools.feign;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.Result;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Feign请求结果解析器
@ -12,30 +15,30 @@ public interface ResultDataResolver {
/**
* @Description 获取Result种的data如果失败(返回result为null或者result.success为false)那么返回null
* @return
* @return data数据
* @author wxz
* @date 2021.06.07 22:45
*/
//default <R> R tryGetResultData(Result<R> result, String targetServiceName) {
// Logger logger = LoggerFactory.getLogger(ResultDataResolver.class);
// if (result == null) {
// logger.error("调用{}服务发生错误,返回Result为null", targetServiceName);
// return null;
// }
// if (!result.success()) {
// logger.error("调用{}服务发生错误,错误信息:{}", targetServiceName, result.getInternalMsg());
// return null;
// }
// return result.getData();
//}
default <R> R getResultDataOrReturnNull(Result<R> result, String targetServiceName) {
Logger logger = LoggerFactory.getLogger(ResultDataResolver.class);
if (result == null) {
logger.error("调用{}服务发生错误,返回Result为null", targetServiceName);
return null;
}
if (!result.success()) {
logger.error("调用{}服务发生错误,内部信息:{},错误信息:{}", targetServiceName, result.getInternalMsg(), result.getMsg());
return null;
}
return result.getData();
}
/**
* @Description
* @return
* @Description 解析Result中的结果如果请求上游服务返回的结果不成功则抛出异常
* @return data数据
* @param targetServiceName 目标service名称
* @param errorCode 错误码可以为空为空则使用上游服务抛出的错误码
* @param errorInternalMsg 内部错误信息可以为空为空则使用上游服务抛出的异常信息
* @param showMsg 展示给前端程序的错误信息可以为空为空则根据errorCode给定错误msg信息
* @param errorCode 错误码可以为空为空则使用8000
* @param errorInternalMsg 内部错误信息可以为空为空则internalMsg=""
* @param showMsg 展示给前端程序的错误信息可以为空为空则showMsg=""
* @author wxz
* @date 2021.06.07 22:45
*/
@ -43,11 +46,25 @@ public interface ResultDataResolver {
if (result == null) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), "调用{}服务发生错误,返回Result为null", targetServiceName);
}
if (!result.success()) {
// 考虑到:上游服务抛出的异常代码和错误消息并不一定适用于当前服务,并且上有服务的错误消息弹出之后可能给用户造成困扰,
// 因此,当前服务抛出异常的时候,不再继承上游服务返回的错误码和错误消息
/*if (!result.success()) {
Integer finalErrorCode = errorCode == null ? result.getCode() : errorCode;
String finalErrorInternalMsg = StringUtils.isBlank(errorInternalMsg) ? result.getInternalMsg() : errorInternalMsg;
throw new RenException(finalErrorCode, finalErrorInternalMsg, showMsg, RenException.MessageMode.CODE_INTERNAL_EXTERNAL);
}*/
if (!result.success()) {
// 如果不通过参数指定code,则默认使用8000服务器开小差
Integer finalErrorCode = errorCode == null ? EpmetErrorCode.SERVER_ERROR.getCode() : errorCode;
String finalErrorInternalMsg = StringUtils.isBlank(errorInternalMsg) ? "" : errorInternalMsg;
String finalShowMsg = StringUtils.isBlank(showMsg) ? "" : showMsg;
throw new EpmetException(finalErrorCode, finalErrorInternalMsg, finalShowMsg);
}
return result.getData();
}

36
epmet-module/data-aggregator/data-aggregator-server/pom.xml

@ -259,6 +259,15 @@
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd</dingTalk.robot.secret>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>data-aggregator</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
<profile>
@ -375,6 +384,15 @@
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd</dingTalk.robot.secret>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>data-aggregator</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
<profile>
@ -491,6 +509,15 @@
<!--测试钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd</dingTalk.robot.secret>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>data-aggregator</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
<profile>
@ -608,6 +635,15 @@
<!--生产钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c</dingTalk.robot.webHook>
<dingTalk.robot.secret>SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1</dingTalk.robot.secret>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>data-aggregator</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
</profiles>

11
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml

@ -191,3 +191,14 @@ dingTalk:
logging:
level:
com.epmet.dataaggre: debug
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

36
epmet-module/data-report/data-report-server/pom.xml

@ -192,6 +192,15 @@
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd</dingTalk.robot.secret>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>data-report</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
<profile>
@ -246,6 +255,15 @@
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd</dingTalk.robot.secret>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>data-report</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
<profile>
@ -300,6 +318,15 @@
<!--测试钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd</dingTalk.robot.secret>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>data-report</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
<profile>
@ -354,6 +381,15 @@
<!--生产钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c</dingTalk.robot.webHook>
<dingTalk.robot.secret>SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1</dingTalk.robot.secret>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>data-report</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
</profiles>

11
epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml

@ -158,3 +158,14 @@ shutdown:
graceful:
enable: true #是否开启优雅停机
waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

53
epmet-module/data-statistical/data-statistical-server/pom.xml

@ -286,11 +286,14 @@
<!--flyway migration 数据库迁移工具-->
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--线程池配置-->
<thread.pool.core-pool-size>5</thread.pool.core-pool-size>
<thread.pool.max-pool-size>8</thread.pool.max-pool-size>
<thread.pool.queue-capacity>10</thread.pool.queue-capacity>
<thread.pool.keep-alive>30</thread.pool.keep-alive>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>data-statistical</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook>
@ -415,11 +418,14 @@
<!--flyway migration 数据库迁移工具-->
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--线程池配置-->
<thread.pool.core-pool-size>5</thread.pool.core-pool-size>
<thread.pool.max-pool-size>8</thread.pool.max-pool-size>
<thread.pool.queue-capacity>10</thread.pool.queue-capacity>
<thread.pool.keep-alive>30</thread.pool.keep-alive>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>data-statistical</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook>
@ -543,11 +549,15 @@
<!--flyway migration 数据库迁移工具-->
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--线程池配置-->
<thread.pool.core-pool-size>5</thread.pool.core-pool-size>
<thread.pool.max-pool-size>8</thread.pool.max-pool-size>
<thread.pool.queue-capacity>10</thread.pool.queue-capacity>
<thread.pool.keep-alive>30</thread.pool.keep-alive>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>data-statistical</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--测试钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd</dingTalk.robot.secret>
@ -667,11 +677,14 @@
<!--flyway migration 数据库迁移工具-->
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--线程池配置-->
<thread.pool.core-pool-size>5</thread.pool.core-pool-size>
<thread.pool.max-pool-size>8</thread.pool.max-pool-size>
<thread.pool.queue-capacity>10</thread.pool.queue-capacity>
<thread.pool.keep-alive>30</thread.pool.keep-alive>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>data-statistical</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--生产钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c</dingTalk.robot.webHook>

49
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/config/AsyncConfig.java

@ -1,49 +0,0 @@
package com.epmet.config;
import com.epmet.properties.ThreadProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
/**
* 线程池配置类
*/
@Configuration
@EnableConfigurationProperties(ThreadProperties.class)
@EnableAsync
public class AsyncConfig {
@Autowired
private ThreadProperties threadProperties;
@Bean
public Executor executor() {
ThreadProperties.ThreadPoolProperties threadPoolProps = threadProperties.getThreadPool();
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(threadPoolProps.getCorePoolSize());
executor.setMaxPoolSize(threadPoolProps.getMaxPoolSize());
executor.setQueueCapacity(threadPoolProps.getQueueCapacity());
executor.setThreadNamePrefix("data-stats-");
// rejection-policy:当pool已经达到max size的时候,如何处理新任务
// CALLER_RUNS:不在新线程中执行任务,而是由调用者所在的线程来执行
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); //对拒绝task的处理策略
executor.setKeepAliveSeconds(threadPoolProps.getKeepAlive());
executor.initialize();
return executor;
}
@Bean
public ExecutorService executorService() {
ThreadPoolTaskExecutor executor = (ThreadPoolTaskExecutor) executor();
return executor.getThreadPoolExecutor();
}
}

11
epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml

@ -197,10 +197,13 @@ dynamic:
thread:
# 线程池配置
threadPool:
corePoolSize: @thread.pool.core-pool-size@
maxPoolSize: @thread.pool.max-pool-size@
queueCapacity: @thread.pool.queue-capacity@
keepAlive: @thread.pool.keep-alive@
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@
dingTalk:
robot:

36
epmet-module/epmet-activiti/epmet-activiti-server/pom.xml

@ -185,6 +185,15 @@
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-activiti</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
<profile>
@ -219,6 +228,15 @@
<nacos.service-list-changed-listening.enable>false</nacos.service-list-changed-listening.enable>
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-activiti</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
<profile>
@ -250,6 +268,15 @@
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-activiti</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
<profile>
@ -281,6 +308,15 @@
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-activiti</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
</profiles>

11
epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml

@ -109,3 +109,14 @@ hystrix:
ribbon:
ReadTimeout: 300000
ConnectTimeout: 300000
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

36
epmet-module/epmet-common-service/common-service-server/pom.xml

@ -139,6 +139,15 @@
</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd
</dingTalk.robot.secret>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>common-service</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
<profile>
@ -187,6 +196,15 @@
</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd
</dingTalk.robot.secret>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>common-service</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
<profile>
@ -233,6 +251,15 @@
</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd
</dingTalk.robot.secret>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>common-service</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
<profile>
@ -276,6 +303,15 @@
</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd
</dingTalk.robot.secret>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>common-service</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
</profiles>

11
epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml

@ -140,3 +140,14 @@ shutdown:
graceful:
enable: true #是否开启优雅停机
waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

36
epmet-module/epmet-ext/epmet-ext-server/pom.xml

@ -226,6 +226,15 @@
</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd
</dingTalk.robot.secret>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-ext</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
<profile>
@ -267,6 +276,15 @@
</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd
</dingTalk.robot.secret>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-ext</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
<profile>
@ -308,6 +326,15 @@
</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd
</dingTalk.robot.secret>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-ext</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
@ -350,6 +377,15 @@
</dingTalk.robot.webHook>
<dingTalk.robot.secret>SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1
</dingTalk.robot.secret>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-ext</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
</profiles>

11
epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml

@ -117,3 +117,14 @@ shutdown:
openApi:
accessToken:
expire: 7200
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

36
epmet-module/epmet-heart/epmet-heart-server/pom.xml

@ -174,6 +174,15 @@
<!--rocketmq-->
<rocketmq.enable>true</rocketmq.enable>
<rocketmq.nameserver>192.168.1.140:9876;192.168.1.141:9876</rocketmq.nameserver>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-heart</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
<profile>
@ -221,6 +230,15 @@
<!--rocketmq-->
<rocketmq.enable>false</rocketmq.enable>
<rocketmq.nameserver>192.168.1.140:9876;192.168.1.141:9876</rocketmq.nameserver>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-heart</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
<profile>
@ -268,6 +286,15 @@
<!--rocketmq-->
<rocketmq.enable>true</rocketmq.enable>
<rocketmq.nameserver>192.168.10.161:9876</rocketmq.nameserver>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-heart</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
<profile>
@ -315,6 +342,15 @@
<!--rocketmq-->
<rocketmq.enable>true</rocketmq.enable>
<rocketmq.nameserver>192.168.11.187:9876;192.168.11.184:9876</rocketmq.nameserver>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-heart</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
</profiles>

206
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java

@ -477,111 +477,117 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
//@Transactional(rollbackFor = Exception.class)
@Async
public void importCommunitySelfOrganization(TokenDto tokenDto, HttpServletResponse response, MultipartFile file, String taskId) throws IOException {
List<CommunitySelfOrgImportExcel> fileList = new ArrayList<>();
CommunitySelfOrgImportExcel excel = null;
//1.读取Excel数据
ExcelImportResult<ImportCommunitySelfOrganization> testExcelImportResult = ExcelPoiUtils.importExcelMore(file, 0, 2, ImportCommunitySelfOrganization.class);
//2.存在错误行数据时存入错误数据集合中
for (ImportCommunitySelfOrganization entity : testExcelImportResult.getFailList()) {
//打印失败的行 和失败的信息
log.warn("第{}行,{}", entity.getRowNum(), entity.getErrorMsg());
excel = new CommunitySelfOrgImportExcel();
excel.setAgencyName(entity.getOrganizationName());
excel.setSocietyName(entity.getOrganizationName());
excel.setErrorInfo(entity.getErrorMsg());
fileList.add(excel);
}
//正确行数据集合
List<ImportCommunitySelfOrganization> list = testExcelImportResult.getList();
if (CollectionUtils.isNotEmpty(list)){
//3.分别判断导入数据是否是当前组织下数据、社会自组织名称是否已存在、手机号是否规范
//3-1.查询当前组织下已从存在的社会自组织名称
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
//查询当前组织下的社会自组织数据
List<IcCommunitySelfOrganizationDTO> communitySeltOrgList = baseDao.selectOrgByCustomerId(tokenDto.getCustomerId());
//组织信息
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfoCache.getAgencyId());
//3-2.检验数据,把不允许导入的数据剔除
Iterator<ImportCommunitySelfOrganization> iterator = list.iterator();
while (iterator.hasNext()) {
AtomicBoolean bl = new AtomicBoolean(false);
StringBuffer errMsg = new StringBuffer("");
ImportCommunitySelfOrganization obj = iterator.next();
//社会自组织名称重复
communitySeltOrgList.forEach(org -> {
if (obj.getOrganizationName().equals(org.getOrganizationName())) {
log.warn(String.format("当前客户下的社会自组织名称已存在,社会自组织名称->%s,行号->%s", obj.getOrganizationName(), obj.getRowNum()));
errMsg.append("客户下社会自组织名称已存在;");
try {
List<CommunitySelfOrgImportExcel> fileList = new ArrayList<>();
CommunitySelfOrgImportExcel excel = null;
//1.读取Excel数据
ExcelImportResult<ImportCommunitySelfOrganization> testExcelImportResult = ExcelPoiUtils.importExcelMore(file, 0, 2, ImportCommunitySelfOrganization.class);
//2.存在错误行数据时存入错误数据集合中
for (ImportCommunitySelfOrganization entity : testExcelImportResult.getFailList()) {
//打印失败的行 和失败的信息
log.warn("第{}行,{}", entity.getRowNum(), entity.getErrorMsg());
excel = new CommunitySelfOrgImportExcel();
excel.setAgencyName(entity.getOrganizationName());
excel.setSocietyName(entity.getOrganizationName());
excel.setErrorInfo(entity.getErrorMsg());
fileList.add(excel);
}
//正确行数据集合
List<ImportCommunitySelfOrganization> list = testExcelImportResult.getList();
if (CollectionUtils.isNotEmpty(list)){
//3.分别判断导入数据是否是当前组织下数据、社会自组织名称是否已存在、手机号是否规范
//3-1.查询当前组织下已从存在的社会自组织名称
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
//查询当前组织下的社会自组织数据
List<IcCommunitySelfOrganizationDTO> communitySeltOrgList = baseDao.selectOrgByCustomerId(tokenDto.getCustomerId());
//组织信息
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfoCache.getAgencyId());
//3-2.检验数据,把不允许导入的数据剔除
Iterator<ImportCommunitySelfOrganization> iterator = list.iterator();
while (iterator.hasNext()) {
AtomicBoolean bl = new AtomicBoolean(false);
StringBuffer errMsg = new StringBuffer("");
ImportCommunitySelfOrganization obj = iterator.next();
//社会自组织名称重复
communitySeltOrgList.forEach(org -> {
if (obj.getOrganizationName().equals(org.getOrganizationName())) {
log.warn(String.format("当前客户下的社会自组织名称已存在,社会自组织名称->%s,行号->%s", obj.getOrganizationName(), obj.getRowNum()));
errMsg.append("客户下社会自组织名称已存在;");
bl.set(true);
}
});
//手机号不合规
boolean m = PhoneValidatorUtils.isMobile(obj.getPrincipalPhone());
boolean t = PhoneValidatorUtils.isTel(obj.getPrincipalPhone());
if (!m && !t){
errMsg.append("手机号码不合法;");
bl.set(true);
}
});
//手机号不合规
boolean m = PhoneValidatorUtils.isMobile(obj.getPrincipalPhone());
boolean t = PhoneValidatorUtils.isTel(obj.getPrincipalPhone());
if (!m && !t){
errMsg.append("手机号码不合法;");
bl.set(true);
}
if(bl.get()){
excel = new CommunitySelfOrgImportExcel();
excel.setAgencyName(obj.getOrganizationName());
excel.setSocietyName(obj.getOrganizationName());
excel.setErrorInfo(errMsg.toString());
fileList.add(excel);
iterator.remove();
if(bl.get()){
excel = new CommunitySelfOrgImportExcel();
excel.setAgencyName(obj.getOrganizationName());
excel.setSocietyName(obj.getOrganizationName());
excel.setErrorInfo(errMsg.toString());
fileList.add(excel);
iterator.remove();
}
}
}
list.forEach(l -> {
IcCommunitySelfOrganizationEntity e = ConvertUtils.sourceToTarget(l, IcCommunitySelfOrganizationEntity.class);
e.setCustomerId(tokenDto.getCustomerId());
e.setOrgId(agencyInfo.getId());
e.setOrgType(IcCommunitySelfOrganizationConstant.ORG_TYPE_AGENCY);
e.setPid(agencyInfo.getPid());
e.setPids(agencyInfo.getPids());
e.setOrganizationCreatedTime(l.getOrganizationCreatedTime());
baseDao.insert(e);
if (CollectionUtils.isNotEmpty(l.getPersons())){
l.getPersons().forEach(p -> {
boolean m = PhoneValidatorUtils.isMobile(p.getPersonPhone());
boolean t = PhoneValidatorUtils.isTel(p.getPersonPhone());
if (!m && !t){
throw new EpmetException(EpmetErrorCode.CHECK_PHONE_ERROR.getCode());
}
});
List<IcCommunitySelfOrganizationPersonnelEntity> persons = ConvertUtils.sourceToTarget(l.getPersons(), IcCommunitySelfOrganizationPersonnelEntity.class);
Map<String, List<IcCommunitySelfOrganizationPersonnelEntity>> groupByPhone = persons.stream().collect(Collectors.groupingBy(IcCommunitySelfOrganizationPersonnelEntity::getPersonPhone));
List<String> phones = new ArrayList<>();
groupByPhone.forEach((k,v) -> {
if (v.size() > NumConstant.ONE){
phones.add(k);
list.forEach(l -> {
IcCommunitySelfOrganizationEntity e = ConvertUtils.sourceToTarget(l, IcCommunitySelfOrganizationEntity.class);
e.setCustomerId(tokenDto.getCustomerId());
e.setOrgId(agencyInfo.getId());
e.setOrgType(IcCommunitySelfOrganizationConstant.ORG_TYPE_AGENCY);
e.setPid(agencyInfo.getPid());
e.setPids(agencyInfo.getPids());
e.setOrganizationCreatedTime(l.getOrganizationCreatedTime());
baseDao.insert(e);
if (CollectionUtils.isNotEmpty(l.getPersons())){
l.getPersons().forEach(p -> {
boolean m = PhoneValidatorUtils.isMobile(p.getPersonPhone());
boolean t = PhoneValidatorUtils.isTel(p.getPersonPhone());
if (!m && !t){
throw new EpmetException(EpmetErrorCode.CHECK_PHONE_ERROR.getCode());
}
});
List<IcCommunitySelfOrganizationPersonnelEntity> persons = ConvertUtils.sourceToTarget(l.getPersons(), IcCommunitySelfOrganizationPersonnelEntity.class);
Map<String, List<IcCommunitySelfOrganizationPersonnelEntity>> groupByPhone = persons.stream().collect(Collectors.groupingBy(IcCommunitySelfOrganizationPersonnelEntity::getPersonPhone));
List<String> phones = new ArrayList<>();
groupByPhone.forEach((k,v) -> {
if (v.size() > NumConstant.ONE){
phones.add(k);
}
});
if (CollectionUtils.isNotEmpty(phones)){
StringBuffer sb = new StringBuffer();
phones.forEach(p -> {
sb.append(p).append(",");
});
String copywriter = sb.toString().substring(NumConstant.ZERO, sb.length() - NumConstant.ONE);
EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.setMsg(String.format(EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.getMsg(),copywriter));
throw new RenException(EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.getCode());
}
});
if (CollectionUtils.isNotEmpty(phones)){
StringBuffer sb = new StringBuffer();
phones.forEach(p -> {
sb.append(p).append(",");
persons.forEach(p -> {
p.setCustomerId(tokenDto.getCustomerId());
p.setOrgId(e.getId());
});
String copywriter = sb.toString().substring(NumConstant.ZERO, sb.length() - NumConstant.ONE);
EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.setMsg(String.format(EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.getMsg(),copywriter));
throw new RenException(EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.getCode());
personnelService.insertBatch(persons);
}
persons.forEach(p -> {
p.setCustomerId(tokenDto.getCustomerId());
p.setOrgId(e.getId());
});
personnelService.insertBatch(persons);
}
});
});
}
//4.错误数据生成文件,修改导入任务状态
String url = erroeImport(fileList);
upImportTask(url, taskId, tokenDto.getUserId(), true);
} catch (Exception e) {
log.error("【社会自组织信息导入】程序错误");
upImportTask(null, taskId, tokenDto.getUserId(), false);
}
//4.错误数据生成文件,修改导入任务状态
erroeImport(fileList, taskId, tokenDto.getUserId());
}
/**
* @Author sun
* @Description 社会自组织导入导入错误数据生成导入失败文件存到阿里云修改导入任务为已结束
* @Description 社会自组织导入错误数据生成导入失败文件存到阿里云修改导入任务为已结束
**/
private void erroeImport(List<CommunitySelfOrgImportExcel> fileList, String importTaskId, String staffId) throws IOException {
private String erroeImport(List<CommunitySelfOrgImportExcel> fileList) throws IOException {
String url = "";
//1.有错误数据则生成错误数据存放文件传到阿里云服务
if (!org.springframework.util.CollectionUtils.isEmpty(fileList)) {
@ -620,16 +626,24 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
}
url = uploadResult.getData().getUrl();
}
return url;
}
/**
* @Author sun
* @Description 社会自组织导入修改导入任务状态
**/
private void upImportTask(String url, String importTaskId, String staffId, Boolean status) {
//2.更新导入任务数据
ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO();
importTaskForm.setOperatorId(staffId);
importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_PARTY_MEMBER);
importTaskForm.setTaskId(importTaskId);
importTaskForm.setResultDescFilePath(url);
importTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS);
if (StringUtils.isNotBlank(url)) {
if (status && StringUtils.isBlank(url)) {
importTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS);
} else {
importTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL);
importTaskForm.setResultDesc("社会自组织导入存在错误数据");
importTaskForm.setResultDesc("社会自组织导入存在错误");
}
Result result = commonServiceOpenFeignClient.finishImportTask(importTaskForm);
if (!result.success()) {

11
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml

@ -150,3 +150,14 @@ shutdown:
graceful:
enable: true #是否开启优雅停机
waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

53
epmet-module/epmet-message/epmet-message-server/pom.xml

@ -188,10 +188,13 @@
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--线程池配置-->
<thread.pool.core-pool-size>5</thread.pool.core-pool-size>
<thread.pool.max-pool-size>8</thread.pool.max-pool-size>
<thread.pool.queue-capacity>10</thread.pool.queue-capacity>
<thread.pool.keep-alive>30</thread.pool.keep-alive>
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-message</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -238,11 +241,15 @@
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--线程池配置-->
<thread.pool.core-pool-size>5</thread.pool.core-pool-size>
<thread.pool.max-pool-size>8</thread.pool.max-pool-size>
<thread.pool.queue-capacity>10</thread.pool.queue-capacity>
<thread.pool.keep-alive>30</thread.pool.keep-alive>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-message</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4
@ -288,11 +295,15 @@
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--线程池配置-->
<thread.pool.core-pool-size>5</thread.pool.core-pool-size>
<thread.pool.max-pool-size>8</thread.pool.max-pool-size>
<thread.pool.queue-capacity>10</thread.pool.queue-capacity>
<thread.pool.keep-alive>30</thread.pool.keep-alive>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-message</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--测试钉钉 机器人地址-->
<dingTalk.robot.webHook>
https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4
@ -336,11 +347,15 @@
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--线程池配置-->
<thread.pool.core-pool-size>5</thread.pool.core-pool-size>
<thread.pool.max-pool-size>8</thread.pool.max-pool-size>
<thread.pool.queue-capacity>10</thread.pool.queue-capacity>
<thread.pool.keep-alive>30</thread.pool.keep-alive>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-message</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--生产钉钉 机器人地址-->
<dingTalk.robot.webHook>
https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c

2
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/MessageApplication.java

@ -13,6 +13,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableAsync;
/**
* 消息模块
@ -24,6 +25,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@EnableDiscoveryClient
@EnableFeignClients
@ServletComponentScan
@EnableAsync
public class MessageApplication {
public static void main(String[] args) {

49
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/config/AsyncConfig.java

@ -1,49 +0,0 @@
package com.epmet.config;
import com.epmet.properties.ThreadProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
/**
* 线程池配置类
*/
@Configuration
@EnableConfigurationProperties(ThreadProperties.class)
@EnableAsync
public class AsyncConfig {
@Autowired
private ThreadProperties threadProperties;
@Bean
public Executor executor() {
ThreadProperties.ThreadPoolProperties threadPoolProps = threadProperties.getThreadPool();
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(threadPoolProps.getCorePoolSize());
executor.setMaxPoolSize(threadPoolProps.getMaxPoolSize());
executor.setQueueCapacity(threadPoolProps.getQueueCapacity());
executor.setThreadNamePrefix("epmet-message-");
// rejection-policy:当pool已经达到max size的时候,如何处理新任务
// CALLER_RUNS:不在新线程中执行任务,而是由调用者所在的线程来执行
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); //对拒绝task的处理策略
executor.setKeepAliveSeconds(threadPoolProps.getKeepAlive());
executor.initialize();
return executor;
}
@Bean
public ExecutorService executorService() {
ThreadPoolTaskExecutor executor = (ThreadPoolTaskExecutor) executor();
return executor.getThreadPoolExecutor();
}
}

12
epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml

@ -126,10 +126,13 @@ pagehelper:
thread:
# 线程池配置
threadPool:
corePoolSize: @thread.pool.core-pool-size@
maxPoolSize: @thread.pool.max-pool-size@
queueCapacity: @thread.pool.queue-capacity@
keepAlive: @thread.pool.keep-alive@
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@
dingTalk:
robot:
@ -146,3 +149,4 @@ rocketmq:
name-server: @rocketmq.nameserver@
producer:
group: @rocketmq.producer.group@

36
epmet-module/epmet-oss/epmet-oss-server/pom.xml

@ -146,6 +146,15 @@
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-oss</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4
@ -185,6 +194,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>false</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-oss</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -225,6 +243,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-oss</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--测试钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -262,6 +289,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-oss</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--生产钉钉 机器人地址-->
<dingTalk.robot.webHook>

11
epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml

@ -143,3 +143,14 @@ shutdown:
graceful:
enable: true #是否开启优雅停机
waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

56
epmet-module/epmet-point/epmet-point-server/pom.xml

@ -159,11 +159,15 @@
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--线程池配置-->
<thread.pool.core-pool-size>5</thread.pool.core-pool-size>
<thread.pool.max-pool-size>8</thread.pool.max-pool-size>
<thread.pool.queue-capacity>10</thread.pool.queue-capacity>
<thread.pool.keep-alive>30</thread.pool.keep-alive>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-point</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd</dingTalk.robot.secret>
@ -206,11 +210,15 @@
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--线程池配置-->
<thread.pool.core-pool-size>5</thread.pool.core-pool-size>
<thread.pool.max-pool-size>8</thread.pool.max-pool-size>
<thread.pool.queue-capacity>10</thread.pool.queue-capacity>
<thread.pool.keep-alive>30</thread.pool.keep-alive>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-point</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd</dingTalk.robot.secret>
@ -253,11 +261,15 @@
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--线程池配置-->
<thread.pool.core-pool-size>5</thread.pool.core-pool-size>
<thread.pool.max-pool-size>8</thread.pool.max-pool-size>
<thread.pool.queue-capacity>10</thread.pool.queue-capacity>
<thread.pool.keep-alive>30</thread.pool.keep-alive>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-point</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd</dingTalk.robot.secret>
@ -300,11 +312,15 @@
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--线程池配置-->
<thread.pool.core-pool-size>5</thread.pool.core-pool-size>
<thread.pool.max-pool-size>8</thread.pool.max-pool-size>
<thread.pool.queue-capacity>10</thread.pool.queue-capacity>
<thread.pool.keep-alive>30</thread.pool.keep-alive>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-point</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--生产钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c</dingTalk.robot.webHook>
<dingTalk.robot.secret>SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1</dingTalk.robot.secret>

2
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/EpmetPointApplication.java

@ -5,6 +5,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableAsync;
/**
* 模块
@ -16,6 +17,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@EnableDiscoveryClient
@EnableFeignClients
@ServletComponentScan
@EnableAsync
public class EpmetPointApplication {
public static void main(String[] args) {
SpringApplication.run(EpmetPointApplication.class, args);

49
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/AsyncConfig.java

@ -1,49 +0,0 @@
package com.epmet.config;
import com.epmet.properties.ThreadProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
/**
* 线程池配置类
*/
@Configuration
@EnableConfigurationProperties(ThreadProperties.class)
@EnableAsync
public class AsyncConfig {
@Autowired
private ThreadProperties threadProperties;
@Bean
public Executor executor() {
ThreadProperties.ThreadPoolProperties threadPoolProps = threadProperties.getThreadPool();
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(threadPoolProps.getCorePoolSize());
executor.setMaxPoolSize(threadPoolProps.getMaxPoolSize());
executor.setQueueCapacity(threadPoolProps.getQueueCapacity());
executor.setThreadNamePrefix("epmet-point-");
// rejection-policy:当pool已经达到max size的时候,如何处理新任务
// CALLER_RUNS:不在新线程中执行任务,而是由调用者所在的线程来执行
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); //对拒绝task的处理策略
executor.setKeepAliveSeconds(threadPoolProps.getKeepAlive());
executor.initialize();
return executor;
}
@Bean
public ExecutorService executorService() {
ThreadPoolTaskExecutor executor = (ThreadPoolTaskExecutor) executor();
return executor.getThreadPoolExecutor();
}
}

11
epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml

@ -126,10 +126,13 @@ pagehelper:
thread:
# 线程池配置
threadPool:
corePoolSize: @thread.pool.core-pool-size@
maxPoolSize: @thread.pool.max-pool-size@
queueCapacity: @thread.pool.queue-capacity@
keepAlive: @thread.pool.keep-alive@
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@
dingTalk:
robot:

36
epmet-module/epmet-third/epmet-third-server/pom.xml

@ -212,6 +212,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-third</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--钉钉 机器人地址-->
@ -263,6 +272,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>false</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-third</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -313,6 +331,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-third</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--测试钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -364,6 +391,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-third</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--生产钉钉 机器人地址-->

13
epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml

@ -160,4 +160,15 @@ rocketmq:
enable: @rocketmq.block-chain.enable@
name-server: @rocketmq.block-chain.name-server@
access-key: @rocketmq.block-chain.access-key@
secret-key: @rocketmq.block-chain.secret-key@
secret-key: @rocketmq.block-chain.secret-key@
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

36
epmet-module/gov-access/gov-access-server/pom.xml

@ -127,6 +127,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-access</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--flyway migration 数据库迁移工具-->
<spring.flyway.enabled>false</spring.flyway.enabled>
@ -166,6 +175,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>false</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-access</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--flyway migration 数据库迁移工具-->
<spring.flyway.enabled>false</spring.flyway.enabled>
@ -205,6 +223,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-access</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--flyway migration 数据库迁移工具-->
<spring.flyway.enabled>true</spring.flyway.enabled>
@ -241,6 +268,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-access</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--flyway migration 数据库迁移工具-->
<spring.flyway.enabled>true</spring.flyway.enabled>

13
epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml

@ -130,4 +130,15 @@ logging:
dingTalk:
robot:
webHook: @dingTalk.robot.webHook@
secret: @dingTalk.robot.secret@
secret: @dingTalk.robot.secret@
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

36
epmet-module/gov-grid/gov-grid-server/pom.xml

@ -119,6 +119,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-grid</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -153,6 +162,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>false</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-grid</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -187,6 +205,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-grid</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--测试钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -221,6 +248,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-grid</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--生产钉钉 机器人地址-->

11
epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml

@ -89,3 +89,14 @@ shutdown:
graceful:
enable: true #是否开启优雅停机
waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

36
epmet-module/gov-issue/gov-issue-server/pom.xml

@ -169,6 +169,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-issue</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
<openapi.scan.server.url>https://epmet-dev.elinkservice.cn/api/epmetscan/api</openapi.scan.server.url>
@ -212,6 +221,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>false</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-issue</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
<openapi.scan.server.url>https://epmet-dev.elinkservice.cn/api/epmetscan/api</openapi.scan.server.url>
@ -255,6 +273,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-issue</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>
<openapi.scan.server.url>https://epmet-dev.elinkservice.cn/api/epmetscan/api</openapi.scan.server.url>
@ -294,6 +321,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-issue</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>
<openapi.scan.server.url>https://epmet-open.elinkservice.cn/api/epmetscan/api</openapi.scan.server.url>

11
epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml

@ -142,3 +142,14 @@ shutdown:
rocketmq:
enable: @rocketmq.enable@
name-server: @rocketmq.nameserver@
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

36
epmet-module/gov-mine/gov-mine-server/pom.xml

@ -139,6 +139,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-mine</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4
@ -172,6 +181,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>false</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-mine</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4
@ -205,6 +223,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-mine</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--测试钉钉 机器人地址-->
<dingTalk.robot.webHook>
https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4
@ -235,6 +262,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-mine</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--生产钉钉 机器人地址-->
<dingTalk.robot.webHook>
https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c

11
epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml

@ -108,3 +108,14 @@ shutdown:
graceful:
enable: true #是否开启优雅停机
waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

35
epmet-module/gov-org/gov-org-server/pom.xml

@ -203,6 +203,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-org</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -248,6 +257,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>false</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-org</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -293,6 +311,14 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-org</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--测试钉钉 机器人地址-->
@ -336,6 +362,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-org</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--生产钉钉 机器人地址-->

20
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java

@ -420,24 +420,18 @@ public class BuildingServiceImpl implements BuildingService {
.registerReadListener(new ImportBuildingInfoListener(formDTO,icHouseRedis,icBuildingDao,neighborHoodService,epmetCommonServiceOpenFeignClient,importTask.getData().getTaskId()))
.build();
excelReader.read(readSheet);
} catch (Exception e){
ImportTaskCommonFormDTO input = new ImportTaskCommonFormDTO();
input.setOperatorId(formDTO.getUserId());
input.setTaskId(importTask.getData().getTaskId());
input.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL);
epmetCommonServiceOpenFeignClient.finishImportTask(input);
} finally {
if (excelReader != null) {
excelReader.finish();
}
}
ImportResultDTO dto = icHouseRedis.getImportResultDTO(formDTO.getCustomerId(), formDTO.getUserId());
if (null == dto){
return new Result<>();
}
List<Integer> nums = dto.getNums();
Integer num = dto.getNum();
String s = "共%s条数据,导入成功%s条。";
if (nums.size() > NumConstant.ZERO){
Collections.sort(nums);
s = s + "第"+nums.stream().map(String::valueOf).collect(Collectors.joining("、"))+"条导入失败";
return new Result<>().error(9999,String.format(s,num,num - nums.size()));
}
return new Result<>().error(9999,String.format(s,num,num));
return new Result<>();
}
private List<IcBuildingExcel> searchAllBuilding(ListIcNeighborHoodFormDTO formDTO) {

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

@ -18,6 +18,7 @@ import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcBuildingDao;
import com.epmet.dao.IcBuildingUnitDao;
import com.epmet.dao.IcHouseDao;
@ -28,6 +29,7 @@ import com.epmet.dto.IcBuildingUnitDTO;
import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.form.IcHouseFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
@ -367,6 +369,12 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
.registerReadListener(new ImportHouseInfoListener(formDTO,icBuildingDao,icHouseRedis,neighborHoodService,icHouseService,epmetCommonServiceOpenFeignClient,importTask.getData().getTaskId()))
.build();
excelReader.read(readSheet);
} catch (Exception e){
ImportTaskCommonFormDTO input = new ImportTaskCommonFormDTO();
input.setOperatorId(formDTO.getUserId());
input.setTaskId(importTask.getData().getTaskId());
input.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL);
epmetCommonServiceOpenFeignClient.finishImportTask(input);
} finally {
if (excelReader != null) {
excelReader.finish();

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java

@ -414,6 +414,12 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
.registerReadListener(new ImportNeighborHoodInfoListener(formDTO,icHouseRedis,icBuildingDao,this,propertyManagementDao,epmetCommonServiceOpenFeignClient,importTask.getData().getTaskId()))
.build();
excelReader.read(readSheet);
} catch (Exception e){
ImportTaskCommonFormDTO input = new ImportTaskCommonFormDTO();
input.setOperatorId(formDTO.getUserId());
input.setTaskId(importTask.getData().getTaskId());
input.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL);
epmetCommonServiceOpenFeignClient.finishImportTask(input);
} finally {
if (excelReader != null) {
excelReader.finish();

11
epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml

@ -154,3 +154,14 @@ rocketmq:
name-server: @rocketmq.nameserver@
# consume-thread-min: 2
# consume-thread-max: 2
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

36
epmet-module/gov-project/gov-project-server/pom.xml

@ -187,6 +187,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-project</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
<openapi.scan.server.url>https://epmet-dev.elinkservice.cn/api/epmetscan/api</openapi.scan.server.url>
@ -229,6 +238,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>false</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-project</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
<openapi.scan.server.url>https://epmet-dev.elinkservice.cn/api/epmetscan/api</openapi.scan.server.url>
<!--钉钉 机器人地址-->
@ -270,6 +288,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-project</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>
<openapi.scan.server.url>https://epmet-dev.elinkservice.cn/api/epmetscan/api</openapi.scan.server.url>
<!--测试钉钉 机器人地址-->
@ -308,6 +335,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-project</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>
<openapi.scan.server.url>https://epmet-open.elinkservice.cn/api/epmetscan/api</openapi.scan.server.url>

11
epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml

@ -141,3 +141,14 @@ shutdown:
graceful:
enable: true #是否开启优雅停机
waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

36
epmet-module/gov-voice/gov-voice-server/pom.xml

@ -132,6 +132,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-voice</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
<openapi.scan.server.url>https://epmet-dev.elinkservice.cn/api/epmetscan/api</openapi.scan.server.url>
<!--钉钉 机器人地址-->
@ -173,6 +182,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>false</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-voice</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
<openapi.scan.server.url>https://epmet-dev.elinkservice.cn/api/epmetscan/api</openapi.scan.server.url>
<!--钉钉 机器人地址-->
@ -214,6 +232,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-voice</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>
<openapi.scan.server.url>https://epmet-dev.elinkservice.cn/api/epmetscan/api</openapi.scan.server.url>
<!--测试钉钉 机器人地址-->
@ -252,6 +279,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>gov-voice</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>
<openapi.scan.server.url>https://epmet-open.elinkservice.cn/api/epmetscan/api</openapi.scan.server.url>

11
epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml

@ -129,3 +129,14 @@ shutdown:
graceful:
enable: true #是否开启优雅停机
waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

36
epmet-module/open-data-worker/open-data-worker-server/pom.xml

@ -140,6 +140,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>open-data-worker</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--flyway migration 数据库迁移工具-->
<spring.flyway.enabled>false</spring.flyway.enabled>
@ -183,6 +192,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>false</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>open-data-worker</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--flyway migration 数据库迁移工具-->
<spring.flyway.enabled>false</spring.flyway.enabled>
@ -226,6 +244,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>open-data-worker</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--flyway migration 数据库迁移工具-->
<spring.flyway.enabled>true</spring.flyway.enabled>
@ -266,6 +293,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>open-data-worker</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--flyway migration 数据库迁移工具-->
<spring.flyway.enabled>true</spring.flyway.enabled>

13
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/bootstrap.yml

@ -135,4 +135,15 @@ dingTalk:
rocketmq:
# 是否开启mq
enable: @rocketmq.enable@
name-server: @rocketmq.nameserver@
name-server: @rocketmq.nameserver@
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

36
epmet-module/oper-access/oper-access-server/pom.xml

@ -120,6 +120,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>oper-access</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -160,6 +169,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>false</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>oper-access</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -200,6 +218,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>oper-access</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--测试钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -237,6 +264,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>oper-access</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--生产钉钉 机器人地址-->

11
epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml

@ -132,3 +132,14 @@ shutdown:
graceful:
enable: true #是否开启优雅停机
waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

36
epmet-module/oper-crm/oper-crm-server/pom.xml

@ -165,6 +165,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>oper-crm</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -205,6 +214,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>false</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>oper-crm</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -245,6 +263,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>oper-crm</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--测试钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -285,6 +312,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>oper-crm</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--生产钉钉 机器人地址-->

11
epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml

@ -138,3 +138,14 @@ shutdown:
graceful:
enable: true #是否开启优雅停机
waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

36
epmet-module/oper-customize/oper-customize-server/pom.xml

@ -137,6 +137,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>oper-customize</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -182,6 +191,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>false</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>oper-customize</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -227,6 +245,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>oper-customize</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--测试钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -269,6 +296,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>oper-customize</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--生产钉钉 机器人地址-->

11
epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml

@ -136,3 +136,14 @@ shutdown:
graceful:
enable: true #是否开启优雅停机
waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

2
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/ResiGroupMemberDTO.java

@ -65,7 +65,7 @@ public class ResiGroupMemberDTO implements Serializable {
private String groupInvitationId;
/**
* 状态 审核通过 - approved 已禁言 - silent 被移出群 - removed
* 状态 审核通过 - approved 已禁言 - silent 被移出群 - removedexit退群
*/
private String status;

52
epmet-module/resi-group/resi-group-server/pom.xml

@ -193,11 +193,14 @@
<elink.mq.token>52d9d9b0e7d0eb5b8b81c205b579e07c</elink.mq.token>
<openapi.scan.server.url>https://epmet-dev.elinkservice.cn/api/epmetscan/api</openapi.scan.server.url>
<!--线程池配置-->
<thread.pool.core-pool-size>5</thread.pool.core-pool-size>
<thread.pool.max-pool-size>8</thread.pool.max-pool-size>
<thread.pool.queue-capacity>10</thread.pool.queue-capacity>
<thread.pool.keep-alive>30</thread.pool.keep-alive>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>resi-group</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -252,11 +255,14 @@
<elink.mq.token>52d9d9b0e7d0eb5b8b81c205b579e07c</elink.mq.token>
<openapi.scan.server.url>https://epmet-dev.elinkservice.cn/api/epmetscan/api</openapi.scan.server.url>
<!--线程池配置-->
<thread.pool.core-pool-size>5</thread.pool.core-pool-size>
<thread.pool.max-pool-size>8</thread.pool.max-pool-size>
<thread.pool.queue-capacity>10</thread.pool.queue-capacity>
<thread.pool.keep-alive>30</thread.pool.keep-alive>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>resi-group</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -309,11 +315,14 @@
<elink.mq.token>96d788191a10ff57a125157183413004</elink.mq.token>
<openapi.scan.server.url>https://epmet-dev.elinkservice.cn/api/epmetscan/api</openapi.scan.server.url>
<!--线程池配置-->
<thread.pool.core-pool-size>5</thread.pool.core-pool-size>
<thread.pool.max-pool-size>8</thread.pool.max-pool-size>
<thread.pool.queue-capacity>10</thread.pool.queue-capacity>
<thread.pool.keep-alive>30</thread.pool.keep-alive>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>resi-group</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--测试钉钉 机器人地址-->
<dingTalk.robot.webHook>
@ -365,11 +374,14 @@
<elink.mq.token>7ce17f65826539ff3e8616dccd4b70fc</elink.mq.token>
<openapi.scan.server.url>https://epmet-open.elinkservice.cn/api/epmetscan/api</openapi.scan.server.url>
<!--线程池配置-->
<thread.pool.core-pool-size>5</thread.pool.core-pool-size>
<thread.pool.max-pool-size>8</thread.pool.max-pool-size>
<thread.pool.queue-capacity>10</thread.pool.queue-capacity>
<thread.pool.keep-alive>30</thread.pool.keep-alive>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>resi-group</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--生产钉钉 机器人地址-->
<dingTalk.robot.webHook>

2
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/ResiGroupApplication.java

@ -13,6 +13,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableAsync;
/**
* 模块
@ -24,6 +25,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@EnableDiscoveryClient
@EnableFeignClients
@ServletComponentScan
@EnableAsync
public class ResiGroupApplication {
public static void main(String[] args) {

49
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/config/AsyncConfig.java

@ -1,49 +0,0 @@
package com.epmet.config;
import com.epmet.properties.ThreadProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
/**
* 线程池配置类
*/
@Configuration
@EnableConfigurationProperties(ThreadProperties.class)
@EnableAsync
public class AsyncConfig {
@Autowired
private ThreadProperties threadProperties;
@Bean
public Executor executor() {
ThreadProperties.ThreadPoolProperties threadPoolProps = threadProperties.getThreadPool();
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(threadPoolProps.getCorePoolSize());
executor.setMaxPoolSize(threadPoolProps.getMaxPoolSize());
executor.setQueueCapacity(threadPoolProps.getQueueCapacity());
executor.setThreadNamePrefix("epmet-resi-group-");
// rejection-policy:当pool已经达到max size的时候,如何处理新任务
// CALLER_RUNS:不在新线程中执行任务,而是由调用者所在的线程来执行
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); //对拒绝task的处理策略
executor.setKeepAliveSeconds(threadPoolProps.getKeepAlive());
executor.initialize();
return executor;
}
@Bean
public ExecutorService executorService() {
ThreadPoolTaskExecutor executor = (ThreadPoolTaskExecutor) executor();
return executor.getThreadPoolExecutor();
}
}

2
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ExitGroupController.java

@ -1,6 +1,7 @@
package com.epmet.modules.group.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
@ -54,6 +55,7 @@ public class ExitGroupController {
* @description 组员自主退群
* @Date 2021/4/30 15:09
**/
@NoRepeatSubmit
@PostMapping("memexitgroup")
public Result memExitGroup(@LoginUser TokenDto tokenDto, @RequestBody MemExitGroupFormDTO formDTO){
formDTO.setUserId(tokenDto.getUserId());

3
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ExitGroupServiceImpl.java

@ -2,6 +2,7 @@ package com.epmet.modules.group.service.impl;
import com.epmet.commons.tools.constant.*;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.UserRoleFormDTO;
@ -223,7 +224,7 @@ public class ExitGroupServiceImpl implements ExitGroupService {
//1、当前组员是否还在群里?
ResiGroupMemberDTO resiGroupMemberDTO=resiGroupMemberDao.selectGroupMemberInfo(formDTO.getGroupId(),formDTO.getUserId());
if(null == resiGroupMemberDTO){
throw new RenException("已退出当前小组,请勿重复操作");
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "已退出当前小组,请勿重复操作","已退出当前小组,请勿重复操作");
}
//2、组长不允许退群,提示:请先转移组长身份后再退组
if(ModuleConstant.GROUP_LEADER.equals(resiGroupMemberDTO.getGroupLeaderFlag())){

2
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/entity/ResiGroupMemberEntity.java

@ -63,7 +63,7 @@ public class ResiGroupMemberEntity extends BaseEpmetEntity {
private String groupInvitationId;
/**
* 状态 审核通过 - approved 已禁言 - silent 被移出群 - removed
* 状态 审核通过 - approved 已禁言 - silent 被移出群 - removedexit退群
*/
private String status;

11
epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml

@ -144,10 +144,13 @@ openapi:
thread:
# 线程池配置
threadPool:
corePoolSize: @thread.pool.core-pool-size@
maxPoolSize: @thread.pool.max-pool-size@
queueCapacity: @thread.pool.queue-capacity@
keepAlive: @thread.pool.keep-alive@
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@
dingTalk:

196
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java

@ -260,100 +260,101 @@ public class IcPartymemberStyleServiceImpl extends BaseServiceImpl<IcPartymember
//@Transactional(rollbackFor = Exception.class)
@Async
public void importData(TokenDto tokenDto, HttpServletResponse response, MultipartFile file, String taskId) throws IOException {
List<PartyMemberImportExcel> fileList = new ArrayList<>();
PartyMemberImportExcel excel = null;
ExcelImportResult<IcPartymemberStyleImportExcel> importResult = ExcelPoiUtils.importExcelMore(file, 0, 1, IcPartymemberStyleImportExcel.class);
try {
List<PartyMemberImportExcel> fileList = new ArrayList<>();
PartyMemberImportExcel excel = null;
ExcelImportResult<IcPartymemberStyleImportExcel> importResult = ExcelPoiUtils.importExcelMore(file, 0, 1, IcPartymemberStyleImportExcel.class);
List<IcPartymemberStyleImportExcel> failList = importResult.getFailList();
//存放错误数据行号
List<Integer> numList = new ArrayList<>();
if (!org.springframework.util.CollectionUtils.isEmpty(failList)) {
for (IcPartymemberStyleImportExcel entity : failList) {
//打印失败的行 和失败的信息
log.warn("第{}行,{}", entity.getRowNum(), entity.getErrorMsg());
numList.add(entity.getRowNum());
excel = new PartyMemberImportExcel();
excel.setGridName(entity.getGridName());
excel.setName(entity.getName());
excel.setMainDeed(entity.getMainDeed());
excel.setCategoryName(entity.getCategoryName());
excel.setErrorInfo(entity.getErrorMsg());
fileList.add(excel);
List<IcPartymemberStyleImportExcel> failList = importResult.getFailList();
//存放错误数据行号
List<Integer> numList = new ArrayList<>();
if (!org.springframework.util.CollectionUtils.isEmpty(failList)) {
for (IcPartymemberStyleImportExcel entity : failList) {
//打印失败的行 和失败的信息
log.warn("第{}行,{}", entity.getRowNum(), entity.getErrorMsg());
numList.add(entity.getRowNum());
excel = new PartyMemberImportExcel();
excel.setGridName(entity.getGridName());
excel.setName(entity.getName());
excel.setMainDeed(entity.getMainDeed());
excel.setCategoryName(entity.getCategoryName());
excel.setErrorInfo(entity.getErrorMsg());
fileList.add(excel);
}
}
}
List<IcPartymemberStyleImportExcel> result = importResult.getList();
List<IcPartymemberStyleImportExcel> result = importResult.getList();
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
//获取组织下网格信息
GridOptionFormDTO formDTO = new GridOptionFormDTO();
formDTO.setAgencyId(staffInfoCache.getAgencyId());
Result<List<CustomerGridDTO>> gridOptionResult = govOrgOpenFeignClient.getGridIListByAgency(staffInfoCache.getAgencyId());
if (!gridOptionResult.success()) {
throw new EpmetException(gridOptionResult.getCode(), gridOptionResult.getMsg());
}
Map<String, String> gridMap = gridOptionResult.getData().stream().collect(Collectors.toMap(CustomerGridDTO::getGridName, CustomerGridDTO::getId));
//获取党员风采所有分类:key:分类名称;
Map<String,IcPartymemberStyleCategoryDictEntity> categoryDictMap=icPartymemberStyleCategoryDictService.getCategoryDictMap(tokenDto.getCustomerId());
//1.数据校验 只允许导入当前组织下的网格的数据
//网格名称不一样的数据舍弃或者分类名称不存在也舍弃
Iterator<IcPartymemberStyleImportExcel> iterator = result.iterator();
while (iterator.hasNext()) {
IcPartymemberStyleImportExcel obj = iterator.next();
if (null == gridMap.get(obj.getGridName().trim())) {
numList.add(obj.getRowNum());
log.warn(String.format("不是当前组织下可导入的数据,网格名称->%s,行号->%s", obj.getGridName(), obj.getRowNum()));
excel = new PartyMemberImportExcel();
excel.setGridName(obj.getGridName());
excel.setName(obj.getName());
excel.setMainDeed(obj.getMainDeed());
excel.setCategoryName(obj.getCategoryName());
excel.setErrorInfo("不是当前组织下网格");
fileList.add(excel);
iterator.remove();
continue;
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
//获取组织下网格信息
GridOptionFormDTO formDTO = new GridOptionFormDTO();
formDTO.setAgencyId(staffInfoCache.getAgencyId());
Result<List<CustomerGridDTO>> gridOptionResult = govOrgOpenFeignClient.getGridIListByAgency(staffInfoCache.getAgencyId());
if (!gridOptionResult.success()) {
throw new EpmetException(gridOptionResult.getCode(), gridOptionResult.getMsg());
}
if (null == categoryDictMap.get(obj.getCategoryName().trim())) {
numList.add(obj.getRowNum());
log.warn(String.format("分类名称【%s】不存在,不可导入,行号->%s", obj.getCategoryName(), obj.getRowNum()));
excel = new PartyMemberImportExcel();
excel.setGridName(obj.getGridName());
excel.setName(obj.getName());
excel.setMainDeed(obj.getMainDeed());
excel.setCategoryName(obj.getCategoryName());
excel.setErrorInfo("分类名称不存在");
fileList.add(excel);
iterator.remove();
Map<String, String> gridMap = gridOptionResult.getData().stream().collect(Collectors.toMap(CustomerGridDTO::getGridName, CustomerGridDTO::getId));
//获取党员风采所有分类:key:分类名称;
Map<String,IcPartymemberStyleCategoryDictEntity> categoryDictMap=icPartymemberStyleCategoryDictService.getCategoryDictMap(tokenDto.getCustomerId());
//1.数据校验 只允许导入当前组织下的网格的数据
//网格名称不一样的数据舍弃或者分类名称不存在也舍弃
Iterator<IcPartymemberStyleImportExcel> iterator = result.iterator();
while (iterator.hasNext()) {
IcPartymemberStyleImportExcel obj = iterator.next();
if (null == gridMap.get(obj.getGridName().trim())) {
numList.add(obj.getRowNum());
log.warn(String.format("不是当前组织下可导入的数据,网格名称->%s,行号->%s", obj.getGridName(), obj.getRowNum()));
excel = new PartyMemberImportExcel();
excel.setGridName(obj.getGridName());
excel.setName(obj.getName());
excel.setMainDeed(obj.getMainDeed());
excel.setCategoryName(obj.getCategoryName());
excel.setErrorInfo("不是当前组织下网格");
fileList.add(excel);
iterator.remove();
continue;
}
if (null == categoryDictMap.get(obj.getCategoryName().trim())) {
numList.add(obj.getRowNum());
log.warn(String.format("分类名称【%s】不存在,不可导入,行号->%s", obj.getCategoryName(), obj.getRowNum()));
excel = new PartyMemberImportExcel();
excel.setGridName(obj.getGridName());
excel.setName(obj.getName());
excel.setMainDeed(obj.getMainDeed());
excel.setCategoryName(obj.getCategoryName());
excel.setErrorInfo("分类名称不存在");
fileList.add(excel);
iterator.remove();
}
}
}
if (CollectionUtils.isEmpty(result)) {
if (CollectionUtils.isEmpty(result)) {
/*Collections.sort(numList);
String subList = numList.stream().map(String::valueOf).collect(Collectors.joining("、"));
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "第" + subList + "行未成功!");*/
erroeImport(fileList, taskId, tokenDto.getUserId());
return;
}
List<IcPartymemberStyleImageEntity> imageList = new ArrayList<>();
List<IcPartymemberStyleEntity> list = result.stream().map(item -> {
IcPartymemberStyleEntity entity = new IcPartymemberStyleEntity();
entity.setId(UUID.randomUUID().toString().replace("-", ""));
entity.setCustomerId(tokenDto.getCustomerId());
entity.setAgencyId(staffInfoCache.getAgencyId());
entity.setGridId(gridMap.get(item.getGridName()));
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(entity.getGridId());
if (null != gridInfo) {
entity.setGridPids(gridInfo.getPids());
erroeImport(fileList);
return;
}
entity.setName(item.getName());
entity.setMainDeed(item.getMainDeed());
IcPartymemberStyleCategoryDictEntity dictEntity=categoryDictMap.get(item.getCategoryName());
entity.setCategoryId(null == dictEntity ? StrConstant.EPMETY_STR : dictEntity.getId());
entity.setCategoryCode(null == dictEntity ? StrConstant.EPMETY_STR : dictEntity.getCategoryCode());
AtomicInteger i = new AtomicInteger();
return entity;
}).collect(Collectors.toList());
List<IcPartymemberStyleImageEntity> imageList = new ArrayList<>();
List<IcPartymemberStyleEntity> list = result.stream().map(item -> {
IcPartymemberStyleEntity entity = new IcPartymemberStyleEntity();
entity.setId(UUID.randomUUID().toString().replace("-", ""));
entity.setCustomerId(tokenDto.getCustomerId());
entity.setAgencyId(staffInfoCache.getAgencyId());
entity.setGridId(gridMap.get(item.getGridName()));
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(entity.getGridId());
if (null != gridInfo) {
entity.setGridPids(gridInfo.getPids());
}
entity.setName(item.getName());
entity.setMainDeed(item.getMainDeed());
IcPartymemberStyleCategoryDictEntity dictEntity=categoryDictMap.get(item.getCategoryName());
entity.setCategoryId(null == dictEntity ? StrConstant.EPMETY_STR : dictEntity.getId());
entity.setCategoryCode(null == dictEntity ? StrConstant.EPMETY_STR : dictEntity.getCategoryCode());
AtomicInteger i = new AtomicInteger();
return entity;
}).collect(Collectors.toList());
insertBatch(list);
icPartymemberStyleImageService.insertBatch(imageList);
insertBatch(list);
icPartymemberStyleImageService.insertBatch(imageList);
/*String str = String.format("共%s条,成功导入%s条。", numList.size() + result.size(), numList.size() + result.size() - numList.size());
if (numList.size() > NumConstant.ZERO) {
@ -363,14 +364,19 @@ public class IcPartymemberStyleServiceImpl extends BaseServiceImpl<IcPartymember
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), str + "第" + subList + "行未成功!");
}
return new Result().ok(str);*/
erroeImport(fileList, taskId, tokenDto.getUserId());
String url = erroeImport(fileList);
upImportTask(url, taskId, tokenDto.getUserId(), true);
} catch (Exception e) {
log.error("【党员风采信息导入】程序错误");
upImportTask(null, taskId, tokenDto.getUserId(), false);
}
}
/**
* @Author sun
* @Description 党员风采导入错误数据生成导入失败文件修改导入任务为已结束
* @Description 党员风采导入错误数据生成导入失败文件
**/
private void erroeImport(List<PartyMemberImportExcel> fileList, String importTaskId, String staffId) throws IOException {
private String erroeImport(List<PartyMemberImportExcel> fileList) throws IOException {
String url = "";
//1.有错误数据则生成错误数据存放文件传到阿里云服务
if (!org.springframework.util.CollectionUtils.isEmpty(fileList)) {
@ -409,16 +415,24 @@ public class IcPartymemberStyleServiceImpl extends BaseServiceImpl<IcPartymember
}
url = uploadResult.getData().getUrl();
}
//2.更新导入任务数据
return url;
}
/**
* @Author sun
* @Description 党员风采导入修改导入任务状态
**/
private void upImportTask(String url, String importTaskId, String staffId, Boolean status) {
//更新导入任务数据
ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO();
importTaskForm.setOperatorId(staffId);
importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_PARTY_MEMBER);
importTaskForm.setTaskId(importTaskId);
importTaskForm.setResultDescFilePath(url);
importTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS);
if (StringUtils.isNotBlank(url)) {
if (status && StringUtils.isBlank(url)) {
importTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS);
} else {
importTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL);
importTaskForm.setResultDesc("党员风采导入存在错误数据");
importTaskForm.setResultDesc("党员风采导入存在错误");
}
Result result = commonServiceOpenFeignClient.finishImportTask(importTaskForm);
if (!result.success()) {

35
epmet-openapi/epmet-openapi-scan/pom.xml

@ -107,6 +107,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-openapi-scan</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4
@ -142,6 +151,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>false</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-openapi-scan</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>
https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4
@ -172,6 +190,15 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-openapi-scan</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--测试钉钉 机器人地址-->
<dingTalk.robot.webHook>
https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4
@ -207,6 +234,14 @@
<!--是否开启服务列表变更监听-->
<nacos.service-list-changed-listening.enable>true</nacos.service-list-changed-listening.enable>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>20</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-openapi-scan</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
<!--生产钉钉 机器人地址-->
<dingTalk.robot.webHook>

11
epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml

@ -91,3 +91,14 @@ shutdown:
enable: true #是否开启优雅停机
waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@

36
epmet-user/epmet-user-server/pom.xml

@ -236,6 +236,15 @@
<!--rocketmq-->
<rocketmq.enable>true</rocketmq.enable>
<rocketmq.nameserver>192.168.1.140:9876;192.168.1.141:9876</rocketmq.nameserver>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-user</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
<profile>
@ -281,6 +290,15 @@
<!--rocketmq-->
<rocketmq.enable>false</rocketmq.enable>
<rocketmq.nameserver>192.168.1.140:9876;192.168.1.141:9876</rocketmq.nameserver>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-user</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
<profile>
@ -325,6 +343,15 @@
<!--rocketmq-->
<rocketmq.enable>true</rocketmq.enable>
<rocketmq.nameserver>192.168.10.161:9876</rocketmq.nameserver>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-user</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
<profile>
@ -368,6 +395,15 @@
<!--rocketmq-->
<rocketmq.enable>true</rocketmq.enable>
<rocketmq.nameserver>192.168.11.187:9876;192.168.11.184:9876</rocketmq.nameserver>
<!--线程池-->
<thread.threadPool.enable-customize>true</thread.threadPool.enable-customize>
<thread.threadPool.core-pool-size>5</thread.threadPool.core-pool-size>
<thread.threadPool.max-pool-size>8</thread.threadPool.max-pool-size>
<thread.threadPool.queue-capacity>10</thread.threadPool.queue-capacity>
<thread.threadPool.keep-alive-seconds>60</thread.threadPool.keep-alive-seconds>
<thread.threadPool.thread-name-prefix>epmet-user</thread.threadPool.thread-name-prefix>
<thread.threadPool.rejected-execution-handler>callerRunsPolicy</thread.threadPool.rejected-execution-handler>
</properties>
</profile>
</profiles>

11
epmet-user/epmet-user-server/src/main/resources/bootstrap.yml

@ -165,3 +165,14 @@ shutdown:
graceful:
enable: true #是否开启优雅停机
waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警
thread:
# 线程池配置
threadPool:
enableCustomize: @thread.threadPool.enable-customize@
corePoolSize: @thread.threadPool.core-pool-size@
maxPoolSize: @thread.threadPool.max-pool-size@
queueCapacity: @thread.threadPool.queue-capacity@
keepAliveSeconds: @thread.threadPool.keep-alive-seconds@
threadNamePrefix: @thread.threadPool.thread-name-prefix@
rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@
Loading…
Cancel
Save