Browse Source

Merge branch 'dev' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_import

 Conflicts:
	epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml
master
wangxianzhang 4 years ago
parent
commit
e5a354a4f5
  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. 32
      epmet-auth/src/main/java/com/epmet/StringRandomUtils.java
  5. 24
      epmet-auth/src/main/java/com/epmet/controller/LoginController.java
  6. 10
      epmet-auth/src/main/java/com/epmet/service/CaptchaService.java
  7. 20
      epmet-auth/src/main/java/com/epmet/service/impl/CaptchaServiceImpl.java
  8. 12
      epmet-auth/src/main/resources/bootstrap.yml
  9. 93
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/AsyncConfig.java
  10. 47
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/EpmetThreadPoolProperties.java
  11. 55
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java
  12. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java
  13. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  14. 36
      epmet-module/data-aggregator/data-aggregator-server/pom.xml
  15. 11
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml
  16. 36
      epmet-module/data-report/data-report-server/pom.xml
  17. 11
      epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml
  18. 53
      epmet-module/data-statistical/data-statistical-server/pom.xml
  19. 49
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/config/AsyncConfig.java
  20. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  21. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java
  22. 71
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/external/IndexCalculateController.java
  23. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/mq/ProjectChangedCustomListener.java
  24. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/biz/impl/BizDataStatsServiceImpl.java
  25. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java
  26. 102
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java
  27. 29
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java
  28. 56
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java
  29. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateService.java
  30. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java
  31. 11
      epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml
  32. 36
      epmet-module/epmet-activiti/epmet-activiti-server/pom.xml
  33. 11
      epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml
  34. 36
      epmet-module/epmet-common-service/common-service-server/pom.xml
  35. 3
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java
  36. 11
      epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml
  37. 4
      epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml
  38. 36
      epmet-module/epmet-ext/epmet-ext-server/pom.xml
  39. 11
      epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml
  40. 36
      epmet-module/epmet-heart/epmet-heart-server/pom.xml
  41. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml
  42. 53
      epmet-module/epmet-message/epmet-message-server/pom.xml
  43. 2
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/MessageApplication.java
  44. 49
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/config/AsyncConfig.java
  45. 12
      epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml
  46. 36
      epmet-module/epmet-oss/epmet-oss-server/pom.xml
  47. 11
      epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml
  48. 56
      epmet-module/epmet-point/epmet-point-server/pom.xml
  49. 2
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/EpmetPointApplication.java
  50. 49
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/AsyncConfig.java
  51. 11
      epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml
  52. 36
      epmet-module/epmet-third/epmet-third-server/pom.xml
  53. 13
      epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml
  54. 36
      epmet-module/gov-access/gov-access-server/pom.xml
  55. 57
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java
  56. 3
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovMenuRedis.java
  57. 6
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovCustomerMenuServiceImpl.java
  58. 13
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java
  59. 13
      epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml
  60. 36
      epmet-module/gov-grid/gov-grid-server/pom.xml
  61. 11
      epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml
  62. 4
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ShiftProjectFormDTO.java
  63. 36
      epmet-module/gov-issue/gov-issue-server/pom.xml
  64. 4
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java
  65. 3
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java
  66. 231
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java
  67. 11
      epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml
  68. 36
      epmet-module/gov-mine/gov-mine-server/pom.xml
  69. 11
      epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml
  70. 35
      epmet-module/gov-org/gov-org-server/pom.xml
  71. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java
  72. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java
  73. 11
      epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml
  74. 36
      epmet-module/gov-project/gov-project-server/pom.xml
  75. 4
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java
  76. 20
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
  77. 11
      epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml
  78. 36
      epmet-module/gov-voice/gov-voice-server/pom.xml
  79. 11
      epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml
  80. 36
      epmet-module/open-data-worker/open-data-worker-server/pom.xml
  81. 13
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/bootstrap.yml
  82. 36
      epmet-module/oper-access/oper-access-server/pom.xml
  83. 11
      epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml
  84. 36
      epmet-module/oper-crm/oper-crm-server/pom.xml
  85. 11
      epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml
  86. 36
      epmet-module/oper-customize/oper-customize-server/pom.xml
  87. 11
      epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml
  88. 52
      epmet-module/resi-group/resi-group-server/pom.xml
  89. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/ResiGroupApplication.java
  90. 49
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/config/AsyncConfig.java
  91. 28
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java
  92. 11
      epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml
  93. 35
      epmet-openapi/epmet-openapi-scan/pom.xml
  94. 2
      epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/interceptor/ScanApiAuthInterceptor.java
  95. 11
      epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml
  96. 1
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BasicInfoResultDTO.java
  97. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java
  98. 36
      epmet-user/epmet-user-server/pom.xml
  99. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java
  100. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

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>

32
epmet-auth/src/main/java/com/epmet/StringRandomUtils.java

@ -0,0 +1,32 @@
package com.epmet;
import com.epmet.commons.tools.constant.StrConstant;
/**
* desc:随机生成字母
*
* @author: LiuJanJun
* @date: 2022/3/1 5:16 下午
* @version: 1.0
*/
public class StringRandomUtils {
public static String getRandomStr(int length){
String result = StrConstant.EPMETY_STR;
//小写字母范围: 97~122
for (int i = 0; i < length; i++) {
int randomNumber = 97 + (int) (Math.random()* (122+1-97));
result += (char)randomNumber;
}
return result;
}
public static void main(String[] args) {
StringRandomUtils test = new StringRandomUtils();
//测试
for (int i = 0; i < 1000000; i++) {
System.out.println(getRandomStr(5));
}
}
}

24
epmet-auth/src/main/java/com/epmet/controller/LoginController.java

@ -68,30 +68,6 @@ public class LoginController {
}
}
/**
* @description 基层治理平台登录验证码
*
* @param response
* @return
* @author wxz
* @date 2021.10.25 14:19:40
*/
@GetMapping("ic-login-captcha")
public void icLoginCaptcha(HttpServletResponse response, String uuid) throws IOException {
try {
//生成图片验证码
BufferedImage image = captchaService.createIcLoginCaptcha(uuid);
response.reset();
response.setHeader("Cache-Control", "no-store, no-cache");
response.setContentType("image/jpeg");
ServletOutputStream out = response.getOutputStream();
ImageIO.write(image, "jpg", out);
out.close();
} catch (IOException e) {
log.error("获取登陆验证码异常", e);
}
}
/**
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.lang.String>

10
epmet-auth/src/main/java/com/epmet/service/CaptchaService.java

@ -23,16 +23,6 @@ public interface CaptchaService {
*/
BufferedImage create(String uuid);
/**
* @description 基层治理平台登录验证码
*
* @param
* @return
* @author wxz
* @date 2021.10.25 14:15:30
*/
BufferedImage createIcLoginCaptcha(String uuid);
/**
* 验证码效验
* @param uuid uuid

20
epmet-auth/src/main/java/com/epmet/service/impl/CaptchaServiceImpl.java

@ -8,16 +8,17 @@
package com.epmet.service.impl;
import com.google.code.kaptcha.Producer;
import com.epmet.StringRandomUtils;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.redis.CaptchaRedis;
import com.epmet.service.CaptchaService;
import com.google.code.kaptcha.Producer;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.awt.image.BufferedImage;
import java.util.UUID;
/**
* 验证码
@ -35,8 +36,8 @@ public class CaptchaServiceImpl implements CaptchaService {
@Override
public BufferedImage create(String uuid) {
//生成验证码
String captcha = producer.createText();
//生成验证码 //producer.createText();
String captcha = StringRandomUtils.getRandomStr(NumConstant.FIVE);
//logger.info("uuid:"+uuid+",生成的验证码:"+captcha);
//保存验证码
captchaRedis.set(uuid, captcha);
@ -44,17 +45,6 @@ public class CaptchaServiceImpl implements CaptchaService {
return producer.createImage(captcha);
}
@Override
public BufferedImage createIcLoginCaptcha(String uuid) {
//生成验证码
String captchaText = producer.createText();
//logger.info("uuid:"+uuid+",生成的验证码:"+captcha);
//保存验证码
captchaRedis.setIcLoginCaptcha(uuid, captchaText);
return producer.createImage(captchaText);
}
@Override
public boolean validate(String uuid, String code) {
String captcha = captchaRedis.get(uuid);

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();
}

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java

@ -66,6 +66,7 @@ public class LogMsgSendFilter extends LevelFilter {
}
if (StringUtils.isNotBlank(activeEnv)) {
stringBuilder.append("告警环境:").append(activeEnv);
stringBuilder.append("\n");
}
@ -112,7 +113,6 @@ public class LogMsgSendFilter extends LevelFilter {
if (!flag) {
logger.warn("msgSender.sendMsg fail,param:{}", stringBuilder.toString());
}
stringBuilder.append("告警环境:").append(activeEnv);
} catch (Exception e) {
logger.warn("decide exception", e);
}

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java

@ -733,4 +733,7 @@ public class RedisKeys {
return rootPrefix.concat("temporary:").concat("temporaryResult:").concat(customerId).concat(":").concat(userId);
}
public static String getCustomerMenuList(String customerId, Integer type) {
return rootPrefix.concat("oper:access:nav:customerId:").concat(customerId).concat(":type:")+type;
}
}

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();
}
}

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java

@ -1098,12 +1098,6 @@ public class DemoController {
return new Result();
}
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder()
.setNameFormat("ScreenExtractServiceImpl-pool-%d").build();
ExecutorService threadPool = new ThreadPoolExecutor(3, 6,
10L, TimeUnit.MINUTES,
new LinkedBlockingQueue<>(500), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy());
@Autowired
private ScreenProjectCategoryGridAndOrgDailyService screenProjectCategoryGridAndOrgDailyService;
@ -1118,20 +1112,20 @@ public class DemoController {
if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)){
List<String> daysBetween = DateUtils.getDaysBetween(startDate, endDate);
daysBetween.forEach(d -> {
threadPool.submit(() -> {
executorService.submit(() -> {
screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectGridData(customerId,d);
});
threadPool.submit(() -> {
executorService.submit(() -> {
screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectOrgData(customerId,d);
});
result.add(d);
redisUtils.hSet(RedisKeys.getBackDoorbizExcuteResult("gridandorgdailynew"),customerId,result,3*24*60*60L);
});
}else {
threadPool.submit(() -> {
executorService.submit(() -> {
screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectGridData(customerId,dateId);
});
threadPool.submit(() -> {
executorService.submit(() -> {
screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectOrgData(customerId,dateId);
});
result.add(dateId);

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java

@ -5,7 +5,6 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractService;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -13,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.concurrent.*;
import java.util.concurrent.ExecutorService;
/**
* @Author zxc
@ -23,13 +22,10 @@ import java.util.concurrent.*;
@RestController
@RequestMapping("screenextract")
public class ScreenExtractDailyController {
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder()
.setNameFormat("ScreenExtractDailyController-pool-%d").build();
ExecutorService threadPool = new ThreadPoolExecutor(1, 1,
10L, TimeUnit.MINUTES,
new LinkedBlockingQueue<>(500), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy());
@Autowired
private ScreenExtractService screenExtractService;
@Autowired
private ExecutorService executorService;
/**
* @param extractOriginFormDTO
@ -39,7 +35,7 @@ public class ScreenExtractDailyController {
*/
@PostMapping("extractdailyall")
public Result screenExtractDaily(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) {
threadPool.submit(() -> {
executorService.submit(() -> {
log.info("screenExtractDaily start,param:{}", JSON.toJSONString(extractOriginFormDTO));
try {
screenExtractService.extractDailyAll(extractOriginFormDTO);

71
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/external/IndexCalculateController.java

@ -1,5 +1,6 @@
package com.epmet.controller.external;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.enums.EnvEnum;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.RedisKeys;
@ -16,7 +17,6 @@ import com.epmet.model.CalculateFlagModel;
import com.epmet.service.evaluationindex.indexcal.CpcIndexCalculateService;
import com.epmet.service.evaluationindex.indexcal.IndexCalculateService;
import com.epmet.util.DimIdGenerator;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -27,7 +27,8 @@ import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
/**
* 指标计算controller
@ -39,13 +40,6 @@ import java.util.concurrent.*;
@RestController
@RequestMapping("indexcalculate")
public class IndexCalculateController {
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder()
.setNameFormat("indexcalculate-pool-%d").build();
ExecutorService singleThreadPool = new ThreadPoolExecutor(1, 1,
0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy());
@Autowired
private IndexCalculateService indexCalculateService;
@ -54,6 +48,9 @@ public class IndexCalculateController {
@Autowired
private RedisUtils redisUtils;
@Autowired
private ExecutorService executorService;
// 计算同步锁
private Object statsCalLock = new Object();
@ -68,7 +65,7 @@ public class IndexCalculateController {
CalculateFlagModel flag = (CalculateFlagModel) redisUtils.get(RedisKeys.getCustomerStatsCalFlag(customerId));
flag.setStatus(CalculateStatus.PENDDING);
redisUtils.set(RedisKeys.getCustomerStatsCalFlag(customerId), flag);
log.info("客户【%s】正在执行计算,实例发生重启,修改计算状态为:calculation->pendding", customerId);
log.error("客户【%s】正在执行计算,实例发生重启,修改计算状态为:calculation->pendding", customerId);
});
}
@ -97,7 +94,7 @@ public class IndexCalculateController {
}
/**
* 按照客户计算所有指标(按照月份)
* 这个是外部客户主动调用的方法入口 按照客户计算所有指标(按照月份)
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
@ -112,6 +109,35 @@ public class IndexCalculateController {
return new Result<Boolean>().ok(true);
}
@PostMapping("calSingle")
public Result<Boolean> calculateSingle(@RequestBody CalculateCommonFormDTO formDTO) {
long start = System.currentTimeMillis();
try {
ValidatorUtils.validateEntity(formDTO);
Boolean aBoolean = indexCalculateService.indexCalculate(formDTO);
HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() + "客户Id:" + formDTO.getCustomerId() + ";monthId:" + formDTO.getMonthId() + ",calculateAll全部指标计算完成,是否成功:" + aBoolean + ",总耗时:" + (System.currentTimeMillis() - start) / 1000 + "秒");
if (aBoolean) {
return new Result<Boolean>().ok(true);
}
} catch (Exception e) {
return new Result<Boolean>().error(e.getMessage());
}
return new Result<Boolean>().error("指标计算失败");
}
/**
* desc:异步 连续计算[指定或所有内部客户][多个月份]的指标得分入口 适用于公式调整后或之前计算错误 统一计算
* @param formDTO
* @return
* @remark:不要轻易调用 因为异步 怕有冲突
*/
@PostMapping("warn/moreStats")
public Result indexStatistics(@RequestBody IndexStatisticsFormDTO formDTO){
log.error("moreStats 不要轻易调用 因为异步 怕有冲突,参数:{}", JSON.toJSONString(formDTO));
indexCalculateService.indexStatistics(formDTO);
return new Result();
}
/**
* 指标计算
*
@ -142,7 +168,7 @@ public class IndexCalculateController {
* @return
*/
private void submitCalculate(CalculateCommonFormDTO formDTO) {
Future<?> future = singleThreadPool.submit(() -> {
Future<?> future = executorService.submit(() -> {
try {
long start = System.currentTimeMillis();
Boolean aBoolean = indexCalculateService.indexCalculate(formDTO);
@ -202,21 +228,6 @@ public class IndexCalculateController {
return new Result();
}
@PostMapping("reAll")
public Result<Boolean> calculateAll(@RequestBody CalculateCommonFormDTO formDTO) {
long start = System.currentTimeMillis();
try {
Boolean aBoolean = indexCalculateService.indexCalculate(formDTO);
HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() + "客户Id:" + formDTO.getCustomerId() + ";monthId:" + formDTO.getMonthId() + ",calculateAll全部指标计算完成,是否成功:" + aBoolean + ",总耗时:" + (System.currentTimeMillis() - start) / 1000 + "秒");
if (aBoolean) {
return new Result<Boolean>().ok(true);
}
} catch (Exception e) {
return new Result<Boolean>().error(e.getMessage());
}
return new Result<Boolean>().error("指标计算失败");
}
/**
* desc计算党员指标分数
*
@ -343,12 +354,6 @@ public class IndexCalculateController {
return new Result();
}*/
@PostMapping("indexstatistics")
public Result indexStatistics(@RequestBody IndexStatisticsFormDTO formDTO){
indexCalculateService.indexStatistics(formDTO);
return new Result();
}
/**
* @return com.epmet.commons.tools.utils.Result
* @param formDTO

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/mq/ProjectChangedCustomListener.java

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.epmet.commons.rocketmq.constants.MQUserPropertys;
import com.epmet.commons.rocketmq.messages.DisputeProcessMQMsg;
import com.epmet.commons.rocketmq.messages.ProjectChangedMQMsg;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
@ -111,12 +112,19 @@ public class ProjectChangedCustomListener implements MessageListenerConcurrently
String customerId = msgObj.getCustomerId();
distributedLock = SpringContextUtils.getBean(DistributedLock.class);
lock = distributedLock.getLock(String.format("lock:project_changed:%s:%s", customerId, msgObj.getProjectId())
,30L, 30L, TimeUnit.SECONDS);
,60L, 60L, TimeUnit.SECONDS);
if (StringUtils.isBlank(customerId)){
logger.error("consumer project_changed fail,msg:{}",customerId);
return;
}
//睡一秒 要不然那边执行不完
try {
Thread.sleep(NumConstant.ONE_THOUSAND);
} catch (InterruptedException e) {
log.error("consumeMessage exception",e);
}
ExtractOriginFormDTO extractOriginFormDTO = new ExtractOriginFormDTO();
extractOriginFormDTO.setCustomerId(customerId);

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/biz/impl/BizDataStatsServiceImpl.java

@ -21,7 +21,6 @@ import com.epmet.service.stats.DimCustomerService;
import com.epmet.service.user.StatsStaffPatrolService;
import com.epmet.service.user.UserService;
import com.epmet.util.DimIdGenerator;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@ -34,7 +33,6 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.concurrent.*;
import java.util.stream.Collectors;
/**
@ -47,11 +45,6 @@ import java.util.stream.Collectors;
@Slf4j
@Service
public class BizDataStatsServiceImpl implements BizDataStatsService {
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder()
.setNameFormat("bizDataStats-pool-%d").build();
ExecutorService threadPool = new ThreadPoolExecutor(3, 6,
10L, TimeUnit.MINUTES,
new LinkedBlockingQueue<>(500), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy());
@Autowired
private CustomerStaffService customerStaffService;
@Autowired

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java

@ -311,7 +311,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
//1、查询当前党员建了多少个组
List<String> groupIdList = userCreatedGroups.get(partyMember.getUserId());
if (CollectionUtils.isEmpty(groupIdList)) {
log.info("当前党员userId="+partyMember.getUserId()+"没有创建过小组, 【党员相关-党员自建群活跃群众人数】赋值0");
log.warn("当前党员userId="+partyMember.getUserId()+"没有创建过小组, 【党员相关-党员自建群活跃群众人数】赋值0");
map.put(partyMember.getUserId(), NumConstant.ZERO);
continue;
}

102
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java

@ -4,11 +4,14 @@ import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.CustomerIdConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.enums.EnvEnum;
import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.extract.form.ExtractIndexFormDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.service.evaluationindex.extract.dataToIndex.*;
import com.epmet.service.evaluationindex.indexcal.IndexCalculateService;
import com.epmet.service.stats.DimCustomerService;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -18,7 +21,8 @@ import org.springframework.util.CollectionUtils;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.*;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
/**
* desc指标原始数据抽取服务实现类
@ -26,12 +30,8 @@ import java.util.concurrent.*;
@Slf4j
@Service
public class IndexOriginExtractServiceImpl implements IndexOriginExtractService {
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder()
.setNameFormat("indexOriginExtract-pool-%d").build();
ExecutorService threadPool = new ThreadPoolExecutor(1, 1,
10L, TimeUnit.MINUTES,
new LinkedBlockingQueue<>(500), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy());
@Autowired
private ExecutorService executorService;
@Autowired
private CalCpcIndexService calCpcIndexService;
@Autowired
@ -45,7 +45,10 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService
@Autowired
private IndexCollDistrictService indexCollDistrictService;
@Autowired
private IndexCollDistrictDepartmentService indexCollDistrictDepartmentService;
private IndexCollDistrictDepartmentService indexCollDistrictDepartmentService;
@Autowired
private IndexCalculateService indexCalculateService;
/**
* desc从统计库对象抽取指标数据
*
@ -56,7 +59,7 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService
String monthId = formDTO.getMonthId();
String customerId = formDTO.getCustomerId();
if (StringUtils.isBlank(monthId)) {
monthId = LocalDate.now().minusMonths(NumConstant.ONE).toString().replace("-","").substring(NumConstant.ZERO,NumConstant.SIX);
monthId = LocalDate.now().minusMonths(NumConstant.ONE).toString().replace("-", "").substring(NumConstant.ZERO, NumConstant.SIX);
}
List<String> customerIds = new ArrayList<>();
if (StringUtils.isNotBlank(customerId)) {
@ -67,7 +70,7 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService
List<String> customerIdList = null;
do {
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize);
if (!CollectionUtils.isEmpty(customerIdList)){
if (!CollectionUtils.isEmpty(customerIdList)) {
customerIds.addAll(customerIdList);
}
} while (!CollectionUtil.isEmpty(customerIdList) && customerIdList.size() == pageSize);
@ -91,88 +94,103 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService
private void submitJob(ExtractIndexFormDTO param) {
CountDownLatch countDownLatch = new CountDownLatch(2);
CountDownLatch countDownLatch = new CountDownLatch(NumConstant.SIX);
long start = System.currentTimeMillis();
final String customerId = param.getCustomerId();
final String monthId = param.getMonthId();
threadPool.submit(() -> {
executorService.submit(() -> {
try {
long startCpc = System.currentTimeMillis();
calCpcIndexService.calCpcPartyAbility(customerId, monthId);
log.error("党员相关-党建能力执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-startCpc, param.getCustomerId());
log.info("党员相关-党建能力执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, param.getCustomerId());
} catch (Exception e) {
log.error("抽取【党员相关数据】发生异常,参数:" + JSON.toJSONString(param), e);
}finally {
} finally {
countDownLatch.countDown();
}
});
threadPool.submit(() -> {
executorService.submit(() -> {
try {
long startGridGovern = System.currentTimeMillis();
calGridIndexService.calGridIndexGovernAbility(customerId, monthId);
log.error("网格相关-治理能力执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-startGridGovern, param.getCustomerId());
log.info("网格相关-治理能力执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startGridGovern, param.getCustomerId());
} catch (Exception e) {
log.error("抽取【网格治理能力数据】发生异常,参数:" + JSON.toJSONString(param), e);
}
try {
long startGridParty = System.currentTimeMillis();
calGridIndexService.calGridIndexPartyAbility(customerId, monthId);
log.error("网格相关-党建能力执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-startGridParty, param.getCustomerId());
log.info("网格相关-党建能力执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startGridParty, param.getCustomerId());
} catch (Exception e) {
log.error("抽取【网格党建能力数据】发生异常,参数:" + JSON.toJSONString(param), e);
}
try {
long startGridService = System.currentTimeMillis();
calGridIndexService.calGridIndexServiceAbility(customerId, monthId);
log.error("网格相关-服务能力执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-startGridService, param.getCustomerId());
log.info("网格相关-服务能力执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startGridService, param.getCustomerId());
} catch (Exception e) {
log.error("抽取【网格服务能力数据】发生异常,参数:" + JSON.toJSONString(param), e);
}
try{
//dimAgency
countDownLatch.countDown();
});
executorService.submit(() -> {
try {
long startCommunity = System.currentTimeMillis();
indexCollCommunityService.saveCommunityAbility(customerId, monthId);
log.error("社区相关-三大能力执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-startCommunity, param.getCustomerId());
}catch (Exception e){
log.info("社区相关-三大能力执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCommunity, param.getCustomerId());
} catch (Exception e) {
log.error("抽取【社区治理能力-社区党建能力-服务能力】发生异常,参数:" + JSON.toJSONString(param), e);
}
try{
//dimAgency
countDownLatch.countDown();
});
executorService.submit(() -> {
try {
long startStreet = System.currentTimeMillis();
indexCollStreetService.saveStreetAbility(customerId, monthId);
log.error("街道相关-三大能力执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-startStreet, param.getCustomerId());
}catch (Exception e){
log.info("街道相关-三大能力执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startStreet, param.getCustomerId());
} catch (Exception e) {
log.error("抽取【街道治理能力-街道党建能力-服务能力】发生异常,参数:" + JSON.toJSONString(param), e);
}
try{
//dimAgency
countDownLatch.countDown();
});
executorService.submit(() -> {
try {
long startDept = System.currentTimeMillis();
indexCollDistrictDepartmentService.saveDepartmentAbility(customerId, monthId);
log.error("区直部门相关-治理能力执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-startDept, param.getCustomerId());
}catch (Exception e){
log.info("区直部门相关-治理能力执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startDept, param.getCustomerId());
} catch (Exception e) {
log.error("抽取【区直部门治理能力】发生异常,参数:" + JSON.toJSONString(param), e);
}
try{
//dimAgency
countDownLatch.countDown();
});
executorService.submit(() -> {
try {
long startDistrict = System.currentTimeMillis();
indexCollDistrictService.saveDistrictAbility(customerId, monthId);
log.error("全区相关-三大能力执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-startDistrict, param.getCustomerId());
}catch (Exception e){
log.info("全区相关-三大能力执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startDistrict, param.getCustomerId());
} catch (Exception e) {
log.error("抽取【全区治理能力-全区党建能力-服务能力】发生异常,参数:" + JSON.toJSONString(param), e);
}
countDownLatch.countDown();
});
log.info("indexOriginExtractAll======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - start, param.getCustomerId());
try {
//等前面都执行完 再执行计算指标得分
countDownLatch.await();
executorService.submit(() -> {
long startT = System.currentTimeMillis();
CalculateCommonFormDTO formDTO1 = new CalculateCommonFormDTO();
try {
formDTO1.setMonthId(monthId);
formDTO1.setCustomerId(customerId);
Boolean aBoolean = indexCalculateService.indexCalculate(formDTO1);
HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() + "客户Id:" + customerId + ";monthId:" + monthId + ",calculateAll全部指标计算完成,是否成功:" + aBoolean + ",总耗时:" + (System.currentTimeMillis() - startT) / 1000 + "秒");
} catch (Exception e) {
log.error("extractMonthly 计算分数异常,参数:{}", JSON.toJSONString(formDTO1));
}
});
} catch (InterruptedException e) {
log.error("indexOriginExtractAll countDownLatch exception", e);
}
log.error("indexOriginExtractAll执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-start, param.getCustomerId());
}
}

29
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java

@ -7,13 +7,10 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.service.StatsGroupService;
import com.epmet.service.StatsTopicService;
import com.epmet.service.evaluationindex.extract.todata.*;
import com.epmet.service.stats.DimCustomerPartymemberService;
import com.epmet.service.stats.DimCustomerService;
import com.epmet.util.DimIdGenerator;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -23,7 +20,9 @@ import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.concurrent.*;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
/**
* desc抽取业务数据 统计库 汇聚类
@ -31,12 +30,6 @@ import java.util.concurrent.*;
@Slf4j
@Service
public class FactOriginExtractServiceImpl implements FactOriginExtractService {
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder()
.setNameFormat("factOriginExtract-pool-%d").build();
ExecutorService threadPool = new ThreadPoolExecutor(3, 6,
10L, TimeUnit.MINUTES,
new LinkedBlockingQueue<>(500), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy());
@Autowired
private IssueExtractService issueExtractService;
@Autowired
@ -54,9 +47,7 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService {
@Autowired
private FactGroupActDailyService factGroupActDailyService;
@Autowired
private StatsGroupService statsGroupService;
@Autowired
private StatsTopicService statsTopicService;
private ExecutorService executorService;
@Override
@ -106,7 +97,7 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService {
daysBetween = DateUtils.getDaysBetween(param.getStartDate(), param.getEndDate());
}
List<String> finalDaysBetween = daysBetween;
threadPool.submit(() -> {
executorService.submit(() -> {
try {
CustomerIdAndDateIdFormDTO formDTO = new CustomerIdAndDateIdFormDTO();
formDTO.setCustomerId(param.getCustomerId());
@ -132,7 +123,7 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService {
countDownLatch.countDown();
}
});
threadPool.submit(() -> {
executorService.submit(() -> {
try {
ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class);
if (!isRange) {
@ -156,7 +147,7 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService {
countDownLatch.countDown();
}
});
threadPool.submit(() -> {
executorService.submit(() -> {
try {
log.debug("extractAll start param:{}", JSON.toJSONString(param));
ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class);
@ -183,7 +174,7 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService {
countDownLatch.countDown();
}
});
threadPool.submit(() -> {
executorService.submit(() -> {
try {
ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class);
if (!isRange) {
@ -222,7 +213,7 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService {
}
});
//小组活动
threadPool.submit(() -> {
executorService.submit(() -> {
try {
ExtractOriginFormDTO extractOriginFormDTO = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class);
if (!isRange) {
@ -339,7 +330,7 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService {
@Override
public Future<?> submitProjectRelationData(ExtractOriginFormDTO param, List<String> finalDaysBetween) {
Future<?> submit = threadPool.submit(() -> {
Future<?> submit = executorService.submit(() -> {
ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class);
if (CollectionUtils.isEmpty(finalDaysBetween)) {
try {

56
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java

@ -7,22 +7,17 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.distributedlock.LockConstants;
import com.epmet.commons.tools.enums.EnvEnum;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.dto.extract.form.ExtractFactGridGovernDailyFromDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
import com.epmet.service.evaluationindex.extract.todata.FactAgencyGovernDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactGridMemberStatisticsDailyService;
import com.epmet.service.evaluationindex.extract.toscreen.*;
import com.epmet.service.evaluationindex.indexcal.IndexCalculateService;
import com.epmet.service.evaluationindex.screen.*;
import com.epmet.service.stats.DimCustomerService;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.redisson.api.RLock;
@ -33,7 +28,9 @@ import org.springframework.util.CollectionUtils;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.*;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
/**
* @Author zxc
@ -42,12 +39,6 @@ import java.util.concurrent.*;
@Service
@Slf4j
public class ScreenExtractServiceImpl implements ScreenExtractService {
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder()
.setNameFormat("ScreenExtractServiceImpl-pool-%d").build();
ExecutorService threadPool = new ThreadPoolExecutor(3, 6,
10L, TimeUnit.MINUTES,
new LinkedBlockingQueue<>(500), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy());
@Autowired
private DimCustomerService dimCustomerService;
@Autowired
@ -65,8 +56,6 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
@Autowired
private PublicPartiTotalDataExtractService publicPartiTotalDataExtractService;
@Autowired
private IndexCalculateService indexCalculateService;
@Autowired
private ScreenCentralZoneDataAbsorptionService screenCentralZoneDataAbsorptionService;
@Autowired
private ScreenGrassrootsGovernDataAbsorptionService screenGrassrootsGovernDataAbsorptionService;
@ -81,10 +70,6 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
@Autowired
private ScreenProjectSettleService screenProjectSettleService;
@Autowired
private ScreenProjectCategoryGridDailyService projectCategoryGridDailyService;
@Autowired
private ScreenProjectCategoryOrgDailyService projectCategoryOrgDailyService;
@Autowired
private FactGridGovernDailyService factGridGovernDailyService;
@Autowired
private FactAgencyGovernDailyService factAgencyGovernDailyService;
@ -94,6 +79,9 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
private ScreenProjectCategoryGridAndOrgDailyService screenProjectCategoryGridAndOrgDailyService;
@Autowired
private DistributedLock distributedLock;
@Autowired
private ExecutorService executorService;
/**
* @param extractOriginFormDTO
@ -183,7 +171,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
lock = distributedLock.getLock(LockConstants.SCREEN_DAILY, NumConstant.SIX_HUNDRED_L, NumConstant.TEN_L, TimeUnit.SECONDS);
//等待3个线程执行完毕后再 继续执行下一个客户的 避免死锁
final CountDownLatch latch = new CountDownLatch(NumConstant.FOUR);
threadPool.submit(() -> {
executorService.submit(() -> {
//党员基本情况screen_cpc_base_data
try {
try {
@ -215,7 +203,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
}
});
threadPool.submit(() -> {
executorService.submit(() -> {
//公众参与排行(注册人数、参与人数、话题数、议题数、项目数)screen_public_party_total_data
try {
@ -263,7 +251,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
log.info("extractDaily 2 thread run end ========= dateId:{},customerId:{}", dateId, customerId);
}
});
threadPool.submit(() -> {
executorService.submit(() -> {
try {
try {
@ -283,7 +271,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
log.info("extractDaily 3 thread run end ========= dateId:{},customerId:{}", dateId, customerId);
}
});
threadPool.submit(() -> {
executorService.submit(() -> {
//治理能力排行screen_govern_rank_data
try {
try {
@ -447,16 +435,6 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
} catch (Exception e) {
log.error("党建引领抽取到大屏失败,参数为:" + JSON.toJSONString(formDTO), e);
}
//已经挪到天抽取的抽取里了
/* try {
//基层治理 - 热心市民 screen_party_user_rank_data
ScreenCentralZoneDataFormDTO param = new ScreenCentralZoneDataFormDTO();
param.setCustomerId(customerId);
param.setDateId(monthId);
screenGrassrootsGovernDataAbsorptionService.userScoreDataHub(param);
} catch (Exception e) {
log.error("大屏热心市民/党员得分数据写入失败,参数为:{}" + JSON.toJSONString(formDTO), e);
}*/
try {
// 项目(事件)数量分析按网格_按月统计
screenProjectQuantityGridMonthlyService.extractionProjectGridMonthly(customerId, monthId);
@ -474,20 +452,6 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
log.info("===== extractMonthly method end not contains shi bei:{}======", customerId);
return;
}
//此方法保持在最后即可 计算指标分数 todo 优化 手动创建线程池 控制任务数量
ExecutorService pool = Executors.newSingleThreadExecutor();
pool.submit(() -> {
long start = System.currentTimeMillis();
CalculateCommonFormDTO formDTO1 = new CalculateCommonFormDTO();
try {
formDTO1.setMonthId(monthId);
formDTO1.setCustomerId(customerId);
Boolean aBoolean = indexCalculateService.indexCalculate(formDTO1);
HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() + "客户Id:" + formDTO.getCustomerId() + ";monthId:" + formDTO1.getMonthId() + ",calculateAll全部指标计算完成,是否成功:" + aBoolean + ",总耗时:" + (System.currentTimeMillis() - start) / 1000 + "秒");
} catch (Exception e) {
log.error("extractMonthly 计算分数异常,参数:{}", JSON.toJSONString(formDTO1));
}
});
log.info("===== extractMonthly method end ======");
}
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateService.java

@ -19,6 +19,11 @@ public interface IndexCalculateService {
*/
Boolean indexCalculate(CalculateCommonFormDTO formDTO);
/**
* desc:异步 连续计算[指定或所有内部客户][多个月份]的指标得分入口
* @param formDTO
* @return
*/
Boolean indexStatistics(IndexStatisticsFormDTO formDTO);
/**

33
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java

@ -1,7 +1,9 @@
package com.epmet.service.evaluationindex.indexcal.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.enums.EnvEnum;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.DateUtils;
@ -17,16 +19,16 @@ import com.epmet.redis.IndexCalRedis;
import com.epmet.service.crm.CustomerRelationService;
import com.epmet.service.evaluationindex.indexcal.*;
import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService;
import com.epmet.service.stats.DimCustomerService;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.*;
/**
* @author liujianjun
@ -58,6 +60,8 @@ public class IndexCalculateServiceImpl implements IndexCalculateService {
private ScreenCustomerAgencyDao screenCustomerAgencyDao;
@Autowired
private CustomerRelationService customerRelationService;
@Autowired
private DimCustomerService dimCustomerService;
@Override
public Boolean indexCalculate(CalculateCommonFormDTO formDTO) {
@ -67,14 +71,15 @@ public class IndexCalculateServiceImpl implements IndexCalculateService {
formDTO.setMonthId(DimIdGenerator.getMonthDimId(DateUtils.addDateMonths(new Date(), -1)));
}
//按照客户分组
List<String> customerIds = new ArrayList<>();
Set<String> customerIds = new HashSet<>();
if (StringUtils.isBlank(formDTO.getCustomerId())) {
log.error("什么情况下走的这个方法,应该干掉他,因为...=====param:{}",JSON.toJSONString(formDTO));
Result<List<String>> externalCustomerIdsResult = epmetCommonServiceOpenFeignClient.getExternalCustomerIds();
if (!externalCustomerIdsResult.success()) {
log.error("indexCalculate epmetCommonServiceOpenFeignClient.getExternalCustomerIds return fail");
return false;
}
customerIds = externalCustomerIdsResult.getData();
customerIds.addAll(externalCustomerIdsResult.getData());
} else {
customerIds.add(formDTO.getCustomerId());
}
@ -95,8 +100,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService {
}
return flag;
} catch (Exception e) {
e.printStackTrace();
log.warn("indexCalculate exception:{}",e);
log.warn("indexCalculate late exception",e);
log.error("indexCalculate exception,param:{}", JSON.toJSONString(formDTO));
} finally {
//清除缓存
@ -212,12 +216,15 @@ public class IndexCalculateServiceImpl implements IndexCalculateService {
public Boolean indexStatistics(IndexStatisticsFormDTO formDTO) {
List<String> customerIds = new ArrayList<>();
if (StringUtils.isEmpty(formDTO.getCustomerId())){
Result<List<String>> externalCustomerIds = epmetCommonServiceOpenFeignClient.getExternalCustomerIds();
if (!externalCustomerIds.success()){
log.error("indexCalculate epmetCommonServiceOpenFeignClient.getExternalCustomerIds return fail");
return false;
}
customerIds = externalCustomerIds.getData();
int pageNo = NumConstant.ONE;
int pageSize = NumConstant.ONE_HUNDRED;
List<String> customerIdList = null;
do {
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize);
if (!CollectionUtils.isEmpty(customerIdList)){
customerIds.addAll(customerIdList);
}
} while (!CollectionUtil.isEmpty(customerIdList) && customerIdList.size() == pageSize);
}else {
customerIds.add(formDTO.getCustomerId());
}

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>

3
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java

@ -187,7 +187,6 @@ public class ExternalAppServiceImpl implements ExternalAppService {
@Override
public List<String> getCustomerIds() {
return externalAppDao.getCustomerIds();
}
@ -224,4 +223,4 @@ public class ExternalAppServiceImpl implements ExternalAppService {
return appIdInfoResultDTO;
}
}
}

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@

4
epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml

@ -66,7 +66,7 @@
</select>
<select id="getCustomerIds" resultType="java.lang.String">
SELECT CUSTOMER_ID FROM external_app WHERE DEL_FLAG = 0
SELECT ID FROM external_customer WHERE DEL_FLAG = 0
</select>
<!-- 根据appId查询客户ID和密钥 -->
@ -84,4 +84,4 @@
</select>
</mapper>
</mapper>

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>

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>

57
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java

@ -17,31 +17,72 @@
package com.epmet.redis;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.dto.GovMenuDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* 客户菜单配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-03-16
*/
@Slf4j
@Component
public class GovCustomerMenuRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
/**
* desc:保存客户菜单缓存
* @param customerId
* @param type
* @see com.epmet.enums.MenuTypeEnum
*/
public void setCustomerMenuList(String customerId, Integer type, List<GovMenuDTO> govMenuDTOS) {
if (checkParam(customerId, type)) {
String key = RedisKeys.getCustomerMenuList(customerId, type);
redisUtils.set(key, govMenuDTOS, RedisUtils.DEFAULT_EXPIRE);
}
}
/**
* desc:获取客户菜单缓存
* @param customerId
* @param type
* @see com.epmet.enums.MenuTypeEnum
*/
public List<GovMenuDTO> getCustomerMenuList(String customerId, Integer type) {
if (checkParam(customerId, type)) {
String key = RedisKeys.getCustomerMenuList(customerId, type);
return (List<GovMenuDTO>) redisUtils.get(key);
}
return null;
}
public void set(){
/**
* desc:删除客户菜单缓存
* @param customerId
* @param type
* @see com.epmet.enums.MenuTypeEnum
*/
public void delCustomerMenu(String customerId, Integer type) {
if (checkParam(customerId, type)) {
String key = RedisKeys.getCustomerMenuList(customerId, type);
redisUtils.delete(key);
}
}
public String get(String id){
return null;
private boolean checkParam(String customerId, Integer type) {
if (StringUtils.isBlank(customerId) || type == null){
log.warn("checkParam fail, param is null");
return false;
}
return true;
}
}
}

3
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovMenuRedis.java

@ -70,5 +70,4 @@ public class GovMenuRedis {
String key = RedisKeys.getUserPermissionsKey(userId, app, client);
return (Set<String>)redisUtils.get(key);
}
}
}

6
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovCustomerMenuServiceImpl.java

@ -20,14 +20,15 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.GovCustomerMenuDao;
import com.epmet.dto.GovCustomerMenuDTO;
import com.epmet.dto.form.MenuConfigFormDTO;
import com.epmet.entity.GovCustomerMenuEntity;
import com.epmet.enums.MenuTypeEnum;
import com.epmet.redis.GovCustomerMenuRedis;
import com.epmet.service.GovCustomerMenuService;
import org.apache.commons.lang3.StringUtils;
@ -105,6 +106,7 @@ public class GovCustomerMenuServiceImpl extends BaseServiceImpl<GovCustomerMenuD
}
@Override
@Transactional(rollbackFor = Exception.class)
public void saveCustomerMenu(MenuConfigFormDTO formDTO) {
baseDao.deleteBatchTableIds(formDTO.getTableId());
if (NumConstant.ZERO < formDTO.getCustomerIds().size()) {
@ -117,6 +119,8 @@ public class GovCustomerMenuServiceImpl extends BaseServiceImpl<GovCustomerMenuD
}
insertBatch(entities);
}
//删除缓存
formDTO.getCustomerIds().forEach(customerId-> govCustomerMenuRedis.delCustomerMenu(customerId, MenuTypeEnum.MENU.value()));
}
@Override

13
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java

@ -33,7 +33,7 @@ import com.epmet.dao.GovMenuDao;
import com.epmet.dto.GovMenuDTO;
import com.epmet.entity.GovMenuEntity;
import com.epmet.enums.MenuTypeEnum;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.redis.GovCustomerMenuRedis;
import com.epmet.redis.GovMenuRedis;
import com.epmet.service.*;
import org.apache.commons.lang3.StringUtils;
@ -42,6 +42,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.*;
@ -57,7 +58,7 @@ public class GovMenuServiceImpl extends BaseServiceImpl<GovMenuDao, GovMenuEntit
@Autowired
private GovMenuRedis govMenuRedis;
@Autowired
private EpmetUserFeignClient epmetUserFeignClient;
private GovCustomerMenuRedis govCustomerMenuRedis;
@Autowired
private GovRoleMenuService govRoleMenuService;
@Autowired
@ -208,9 +209,15 @@ public class GovMenuServiceImpl extends BaseServiceImpl<GovMenuDao, GovMenuEntit
* @Date 15:51 2021-03-16
**/
private List<GovMenuDTO> getCustomerMenuList(String customerId, Integer type) {
List<GovMenuDTO> govMenuDTOS = govCustomerMenuRedis.getCustomerMenuList(customerId,type);
if (!CollectionUtils.isEmpty(govMenuDTOS)){
return govMenuDTOS;
}
List<GovMenuEntity> menuList = baseDao.getCustomerMenuList(customerId, type, HttpContextUtils.getLanguage());
List<GovMenuDTO> dtoList = ConvertUtils.sourceToTarget(menuList, GovMenuDTO.class);
return TreeUtils.buildTree(dtoList);
govMenuDTOS = TreeUtils.buildTree(dtoList);
govCustomerMenuRedis.setCustomerMenuList(customerId,type,govMenuDTOS);
return govMenuDTOS;
}
@Override

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@

4
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ShiftProjectFormDTO.java

@ -52,6 +52,10 @@ public class ShiftProjectFormDTO implements Serializable {
* 议题标签
*/
private List<IssueTagsDTO> tagList;
/**
* token中客户Id
*/
private String customerId;
}

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>

4
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java

@ -181,9 +181,9 @@ public class IssueManageController {
@PostMapping("shiftproject-v2")
public Result shiftProjectV2(@LoginUser TokenDto tokenDTO, @RequestBody ShiftProjectFormDTO formDTO) {
formDTO.setStaffId(tokenDTO.getUserId());
formDTO.setCustomerId(tokenDTO.getCustomerId());
ValidatorUtils.validateEntity(formDTO);
issueService.shiftProjectV2(formDTO);
return new Result();
return issueService.shiftProjectV2(formDTO);
}
/**

3
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java

@ -3,6 +3,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IssueDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
@ -219,7 +220,7 @@ public interface IssueService extends BaseService<IssueEntity> {
* @param formDTO
* @return void
*/
void shiftProjectV2(ShiftProjectFormDTO formDTO);
Result shiftProjectV2(ShiftProjectFormDTO formDTO);
/**
* @Description 已关闭列表 政府端

231
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java

@ -9,7 +9,9 @@ import com.epmet.commons.rocketmq.messages.GroupAchievementMQMsg;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.AchievementTypeEnum;
import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
@ -41,7 +43,6 @@ import com.epmet.entity.IssueEntity;
import com.epmet.entity.IssueProcessEntity;
import com.epmet.entity.IssueProjectRelationEntity;
import com.epmet.feign.*;
import com.epmet.commons.tools.enums.AchievementTypeEnum;
import com.epmet.redis.GovIssueRedis;
import com.epmet.redis.IssueVoteDetailRedis;
import com.epmet.resi.group.dto.group.form.AllIssueFormDTO;
@ -62,6 +63,7 @@ import com.epmet.utils.ModuleConstants;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
import org.redisson.api.RLock;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -136,6 +138,8 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
private GovProjectOpenFeignClient govProjectOpenFeignClient;
@Autowired
private IssueVoteDetailService issueVoteDetailService;
@Autowired
private DistributedLock distributedLock;
@Value("${openapi.scan.server.url}")
@ -957,127 +961,138 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
* @date 2020/12/9 10:01
*/
@Override
public void shiftProjectV2(ShiftProjectFormDTO formDTO) {
//1:查询议题数据
IssueEntity entity = baseDao.selectById(formDTO.getIssueId());
if (null == entity) {
throw new RenException(IssueConstant.SELECT_EXCEPTION);
}
if (IssueConstant.ISSUE_SHIFT_PROJECT.equals(entity.getIssueStatus())) {
throw new RenException(IssueConstant.ISSUE_SHIFT_PROJECT_EXCEPTION);
}
if (!IssueConstant.ISSUE_VOTING.equals(entity.getIssueStatus())) {
throw new RenException(IssueConstant.ISSUE_VOTING_EXCEPTION);
}
formDTO.setIssueDTO(ConvertUtils.sourceToTarget(entity, IssueDTO.class));
public Result shiftProjectV2(ShiftProjectFormDTO formDTO) {
RLock lock = null;
try {
//获取锁,判断当前议题是否已处理
lock = distributedLock.tryLock(formDTO.getCustomerId() + formDTO.getIssueId());
//1:查询议题数据
IssueEntity entity = baseDao.selectById(formDTO.getIssueId());
if (null == entity) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),IssueConstant.SELECT_EXCEPTION,IssueConstant.SELECT_EXCEPTION);
}
if (IssueConstant.ISSUE_SHIFT_PROJECT.equals(entity.getIssueStatus())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),IssueConstant.ISSUE_SHIFT_PROJECT_EXCEPTION,IssueConstant.ISSUE_SHIFT_PROJECT_EXCEPTION);
}
if (!IssueConstant.ISSUE_VOTING.equals(entity.getIssueStatus())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),IssueConstant.ISSUE_VOTING_EXCEPTION,IssueConstant.ISSUE_VOTING_EXCEPTION);
}
formDTO.setIssueDTO(ConvertUtils.sourceToTarget(entity, IssueDTO.class));
//获取议题分类
List<IssueCategoryDTO> categoryList = issueCategoryService.getCategoryByIssue(formDTO.getIssueId());
if (CollectionUtils.isEmpty(categoryList)) {
throw new RenException(EpmetErrorCode.CATEGORY_IS_NULL.getCode());
}
//获取议题分类
List<IssueCategoryDTO> categoryList = issueCategoryService.getCategoryByIssue(formDTO.getIssueId());
if (CollectionUtils.isEmpty(categoryList)) {
throw new EpmetException(EpmetErrorCode.CATEGORY_IS_NULL.getCode(),EpmetErrorCode.CATEGORY_IS_NULL.getMsg(),EpmetErrorCode.CATEGORY_IS_NULL.getMsg());
}
//公开回复内容审核
if (StringUtils.isNotBlank(formDTO.getPublicReply())) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
taskDTO.setContent(formDTO.getPublicReply());
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode());
//公开回复内容审核
if (StringUtils.isNotBlank(formDTO.getPublicReply())) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
taskDTO.setContent(formDTO.getPublicReply());
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),EpmetErrorCode.SERVER_ERROR.getMsg(),EpmetErrorCode.SERVER_ERROR.getMsg());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
throw new EpmetException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(),EpmetErrorCode.TEXT_SCAN_FAILED.getMsg(),EpmetErrorCode.TEXT_SCAN_FAILED.getMsg());
}
}
}
}
//因需要保证议题表中的转项目时间与创建项目时间一致 因此先新增项目数据再更新议题数据
//2:调用resi-group查询话题创建人数据(目前议题来源只有来自话题),为了到项目服务初始数据以及发送消息使用
Result<ResiTopicDTO> resultTopicDTO = resiGroupFeignClient.getTopicById(entity.getSourceId());
if (!resultTopicDTO.success() || null == resultTopicDTO.getData()) {
throw new RenException(IssueConstant.SELECT_TOPIC_EXCEPTION);
}
ResiTopicDTO topicDTO = resultTopicDTO.getData();
formDTO.setTopicDTO(topicDTO);
//3:调用gov-project服务,新增项目各业务表初始数据
formDTO.setCategoryList(categoryList);
List<IssueTagsDTO> tagList = issueTagsService.getTagsByIssue(formDTO.getIssueId());
formDTO.setTagList(tagList);
Result<IssueProjectResultDTO> resultDTO = govProjectFeignClient.issueShiftProject(formDTO);
if (!resultDTO.success() || null == resultDTO.getData()) {
logger.error(resultDTO.getInternalMsg());
throw new RenException(IssueConstant.GOV_PRJECT_EXCEPTION);
}
IssueProjectResultDTO issueProjectResultDTO = resultDTO.getData();
//更新项目对标签的引用次数
if (CollectionUtils.isNotEmpty(tagList)) {
tagList.forEach(item -> {
IssueProjectTagDictDTO tag = issueProjectTagDictService.get(item.getTagId());
tag.setProjectUseCount(tag.getProjectUseCount() + NumConstant.ONE);
issueProjectTagDictService.update(tag);
});
}
//因需要保证议题表中的转项目时间与创建项目时间一致 因此先新增项目数据再更新议题数据
//4:更新议题相关业务表数据
//4.1:更新议题表数据
entity.setIssueStatus(IssueConstant.ISSUE_SHIFT_PROJECT);
entity.setShiftedTime(issueProjectResultDTO.getShiftedTime());
baseDao.updateById(entity);
//2:调用resi-group查询话题创建人数据(目前议题来源只有来自话题),为了到项目服务初始数据以及发送消息使用
Result<ResiTopicDTO> resultTopicDTO = resiGroupFeignClient.getTopicById(entity.getSourceId());
if (!resultTopicDTO.success() || null == resultTopicDTO.getData()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),IssueConstant.SELECT_TOPIC_EXCEPTION,IssueConstant.SELECT_TOPIC_EXCEPTION);
}
ResiTopicDTO topicDTO = resultTopicDTO.getData();
formDTO.setTopicDTO(topicDTO);
//3:调用gov-project服务,新增项目各业务表初始数据
formDTO.setCategoryList(categoryList);
List<IssueTagsDTO> tagList = issueTagsService.getTagsByIssue(formDTO.getIssueId());
formDTO.setTagList(tagList);
Result<IssueProjectResultDTO> resultDTO = govProjectFeignClient.issueShiftProject(formDTO);
if (!resultDTO.success() || null == resultDTO.getData()) {
logger.error(resultDTO.getInternalMsg());
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),IssueConstant.GOV_PRJECT_EXCEPTION,IssueConstant.GOV_PRJECT_EXCEPTION);
}
IssueProjectResultDTO issueProjectResultDTO = resultDTO.getData();
//更新项目对标签的引用次数
if (CollectionUtils.isNotEmpty(tagList)) {
tagList.forEach(item -> {
IssueProjectTagDictDTO tag = issueProjectTagDictService.get(item.getTagId());
tag.setProjectUseCount(tag.getProjectUseCount() + NumConstant.ONE);
issueProjectTagDictService.update(tag);
});
}
//4.2:议题处理进展表新增数据
IssueProcessEntity processEntity = new IssueProcessEntity();
processEntity.setIssueId(entity.getId());
processEntity.setIssueStatus(IssueConstant.ISSUE_SHIFT_PROJECT);
processEntity.setOrgType(IssueConstant.ISSUE_GRID);
processEntity.setOrgId(entity.getGridId());
processEntity.setOrgName(issueProjectResultDTO.getOrgName());
issueProcessDao.insert(processEntity);
//4:更新议题相关业务表数据
//4.1:更新议题表数据
entity.setIssueStatus(IssueConstant.ISSUE_SHIFT_PROJECT);
entity.setShiftedTime(issueProjectResultDTO.getShiftedTime());
baseDao.updateById(entity);
//4.2:议题处理进展表新增数据
IssueProcessEntity processEntity = new IssueProcessEntity();
processEntity.setIssueId(entity.getId());
processEntity.setIssueStatus(IssueConstant.ISSUE_SHIFT_PROJECT);
processEntity.setOrgType(IssueConstant.ISSUE_GRID);
processEntity.setOrgId(entity.getGridId());
processEntity.setOrgName(issueProjectResultDTO.getOrgName());
issueProcessDao.insert(processEntity);
//4.3:议题项目关系表新增数据
IssueProjectRelationEntity relationEntity = new IssueProjectRelationEntity();
relationEntity.setIssueId(entity.getId());
relationEntity.setProjectId(issueProjectResultDTO.getProjectId());
issueProjectRelationDao.insert(relationEntity);
//5:调用epmet-message服务,给居民端话题创建人、议题发起人以及政府端工作人员发送消息
if (!shiftProjectMessage(issueProjectResultDTO, formDTO, entity).success()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),IssueConstant.SAVE_MSG_EXCEPTION,IssueConstant.SAVE_MSG_EXCEPTION);
}
//5-1:2020.10.26 添加给居民端话题创建人、议题发起人以及政府端工作人员推送微信订阅消息功能 sun
if (!wxmpShiftProjectMessage(issueProjectResultDTO, formDTO, entity).success()) {
logger.error("议题转项目,推送微信订阅消息失败!");
}
//4.3:议题项目关系表新增数据
IssueProjectRelationEntity relationEntity = new IssueProjectRelationEntity();
relationEntity.setIssueId(entity.getId());
relationEntity.setProjectId(issueProjectResultDTO.getProjectId());
issueProjectRelationDao.insert(relationEntity);
//6:缓存中网格下表决中的议题总数减1
govIssueRedis.subtractWorkGrassrootsIssueRedDotValue(entity.getGridId());
try{
issueVoteStatisticalService.syncVotingCacheToDbByParams(formDTO.getIssueId(),entity.getGridId(),null);
}catch(RenException e){
logger.error(e.getInternalMsg());
}
//5:调用epmet-message服务,给居民端话题创建人、议题发起人以及政府端工作人员发送消息
if (!shiftProjectMessage(issueProjectResultDTO, formDTO, entity).success()) {
throw new RenException(IssueConstant.SAVE_MSG_EXCEPTION);
}
//5-1:2020.10.26 添加给居民端话题创建人、议题发起人以及政府端工作人员推送微信订阅消息功能 sun
if (!wxmpShiftProjectMessage(issueProjectResultDTO, formDTO, entity).success()) {
logger.error("议题转项目,推送微信订阅消息失败!");
}
//6:缓存中网格下表决中的议题总数减1
govIssueRedis.subtractWorkGrassrootsIssueRedDotValue(entity.getGridId());
try{
issueVoteStatisticalService.syncVotingCacheToDbByParams(formDTO.getIssueId(),entity.getGridId(),null);
}catch(RenException e){
logger.error(e.getInternalMsg());
}
//7:发送话题转议题积分事件
TopicEventFormDTO eventParam = new TopicEventFormDTO();
eventParam.setTopicId(entity.getSourceId());
eventParam.setEvent(EventEnum.TOPIC_SHIFTED_TO_PROJECT);
if(!resiGroupOpenFeignClient.sendEvent(eventParam).success()){
logger.warn("com.epmet.service.impl.IssueServiceImpl.shiftProjectV2,话题被转为项目积分事件发送失败,参数:{}", JSON.toJSONString(formDTO));
}
// 8.数据库更新表决统计
SelectIssueVotingDetailFormDTO dto = new SelectIssueVotingDetailFormDTO();
dto.setGridId(entity.getGridId());
dto.setIssueId(formDTO.getIssueId());
issueVoteDetailService.updateVote(dto);
//7:发送话题转议题积分事件
TopicEventFormDTO eventParam = new TopicEventFormDTO();
eventParam.setTopicId(entity.getSourceId());
eventParam.setEvent(EventEnum.TOPIC_SHIFTED_TO_PROJECT);
if(!resiGroupOpenFeignClient.sendEvent(eventParam).success()){
logger.warn("com.epmet.service.impl.IssueServiceImpl.shiftProjectV2,话题被转为项目积分事件发送失败,参数:{}", JSON.toJSONString(formDTO));
//8.记录日志
//SendMqMsgUtil.build().openFeignClient(messageOpenFeignClient).sendProjectChangedMqMsg();
return new Result();
} catch (Exception e) {
return new Result().error(e.getMessage());
} finally {
distributedLock.unLock(lock);
}
// 8.数据库更新表决统计
SelectIssueVotingDetailFormDTO dto = new SelectIssueVotingDetailFormDTO();
dto.setGridId(entity.getGridId());
dto.setIssueId(formDTO.getIssueId());
issueVoteDetailService.updateVote(dto);
//8.记录日志
//SendMqMsgUtil.build().openFeignClient(messageOpenFeignClient).sendProjectChangedMqMsg();
}
/**

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>
<!--生产钉钉 机器人地址-->

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java

@ -176,6 +176,8 @@ public class CustomerStaffGridServiceImpl extends BaseServiceImpl<CustomerStaffG
if (CollectionUtils.isEmpty(data)){
return new ArrayList<>();
}
/*gridStaff.stream().forEach(g -> data.stream().filter(d -> g.getStaffId().equals(d.getStaffId()) && g.getGridId().equals(d.getGridId())).forEach(d -> g.setMobile(d.getMobile())));
return gridStaff.stream().filter(g -> StringUtils.isNotBlank(g.getMobile())).collect(Collectors.toList());*/
return data;
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java

@ -519,7 +519,7 @@ public class StaffServiceImpl implements StaffService {
//2.调用user服务,新增用户信息
StaffSubmitFromDTO submitDTO = ConvertUtils.sourceToTarget(fromDTO, StaffSubmitFromDTO.class);
submitDTO.setAgencyId(fromDTO.getOrgId());
submitDTO.setAgencyId(orgDTO.getAgencyId());
Result<CustomerStaffDTO> result = epmetUserFeignClient.addStaff(submitDTO);
if (!result.success()) {
if (result.getCode() != EpmetErrorCode.SERVER_ERROR.getCode()) {

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>

4
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java

@ -140,8 +140,8 @@ public class ProjectSatisfactionStatisticsServiceImpl extends BaseServiceImpl<Pr
@Override
public ProjectEvaluateScoreResultDTO projectEvaluateScore(ProjectEvaluateScoreFormDTO formDTO) {
ProjectEntity projectEntity = projectDao.selectById(formDTO.getProjectId());
if (projectEntity.getOrigin().equals(ProjectConstant.AGENCY)){
// 直接立项的项目不能评价,所以给0分
if (!projectEntity.getOrigin().equals(ProjectConstant.ISSUE)){
// 直接立项的项目不能评价,报事不能评价,所以给0分
return new ProjectEvaluateScoreResultDTO(NumConstant.EIGHTY);
}
ProjectSatisfactionStatisticsEntity entity = baseDao.selectInfoByProjectId(formDTO.getProjectId());

20
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java

@ -453,10 +453,12 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
Integer workMinutes = calculateDelta_T(ProjectConstant.PRECISE_CALCULATION,
ProjectConstant.CALCULATION_TYPE_DEFAULT, fromDTO.getProjectId(), projectEntity.getCreatedTime(), current);
projectEntity.setStatus(ProjectConstant.CLOSED);
projectEntity.setClosedStatus(fromDTO.getClosedStatus());
projectEntity.setWorkMinutes(workMinutes);
baseDao.updateById(projectEntity);
ProjectEntity newProject = new ProjectEntity();
newProject.setId(fromDTO.getProjectId());
newProject.setStatus(ProjectConstant.CLOSED);
newProject.setClosedStatus(fromDTO.getClosedStatus());
newProject.setWorkMinutes(workMinutes);
baseDao.updateById(newProject);
//更新项目关联表
ProjectStaffEntity projectStaffEntity = new ProjectStaffEntity();
projectStaffEntity.setId(fromDTO.getProjectStaffId());
@ -655,10 +657,12 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
Integer workMinutes = calculateDelta_T(ProjectConstant.PRECISE_CALCULATION,
ProjectConstant.CALCULATION_TYPE_DEFAULT, fromDTO.getProjectId(), projectEntity.getCreatedTime(), current);
projectEntity.setStatus(ProjectConstant.CLOSED);
projectEntity.setClosedStatus(fromDTO.getClosedStatus());
projectEntity.setWorkMinutes(workMinutes);
baseDao.updateById(projectEntity);
ProjectEntity newProject = new ProjectEntity();
newProject.setId(fromDTO.getProjectId());
newProject.setStatus(ProjectConstant.CLOSED);
newProject.setClosedStatus(fromDTO.getClosedStatus());
newProject.setWorkMinutes(workMinutes);
baseDao.updateById(newProject);
//更新项目关联表
ProjectStaffEntity projectStaffEntity = new ProjectStaffEntity();
projectStaffEntity.setId(fromDTO.getProjectStaffId());

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@

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();
}
}

28
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java

@ -17,7 +17,6 @@
package com.epmet.modules.topic.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
@ -25,8 +24,8 @@ import com.epmet.commons.rocketmq.messages.GroupAchievementMQMsg;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.MqConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO;
import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
import com.epmet.commons.tools.enums.AchievementTypeEnum;
import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
@ -37,19 +36,18 @@ import com.epmet.commons.tools.scan.result.AsyncScanTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.scan.result.VoiceResultDTO;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.*;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.SystemMessageType;
import com.epmet.dto.form.CommonGridIdFormDTO;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.result.AllGridsByUserIdResultDTO;
import com.epmet.dto.result.UserInfoResultDTO;
import com.epmet.dto.result.CommonDataFilterResultDTO;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.dto.result.UserInfoResultDTO;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.commons.tools.enums.AchievementTypeEnum;
import com.epmet.modules.feign.EpmetUserFeignClient;
import com.epmet.modules.group.dao.GroupMessageDao;
import com.epmet.modules.feign.GovOrgFeignClient;
import com.epmet.modules.group.dao.GroupMessageDao;
import com.epmet.modules.group.dao.ResiGroupDao;
@ -58,7 +56,6 @@ import com.epmet.modules.group.entity.GroupMessageEntity;
import com.epmet.modules.group.entity.ResiGroupEntity;
import com.epmet.modules.group.entity.ResiGroupStatisticalEntity;
import com.epmet.modules.group.redis.ResiGroupRedis;
import com.epmet.modules.member.dao.ResiGroupMemberDao;
import com.epmet.modules.member.redis.ResiGroupMemberRedis;
import com.epmet.modules.member.service.ResiGroupMemberService;
import com.epmet.modules.topic.dao.ResiTopicAttachmentDao;
@ -84,7 +81,6 @@ import com.epmet.resi.group.dto.topic.result.MyAuditingListResultDTO;
import com.epmet.resi.group.dto.topic.result.TopicAuditResultDTO;
import com.epmet.send.SendMqMsgUtil;
import com.google.common.base.CharMatcher;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@ -97,7 +93,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.*;
import java.util.stream.Collectors;
/**
@ -111,11 +106,6 @@ import java.util.stream.Collectors;
public class TopicDraftServiceImpl extends BaseServiceImpl<TopicDraftDao, TopicDraftEntity> implements TopicDraftService {
private static Logger logger = LoggerFactory.getLogger(TopicDraftServiceImpl.class);
private ThreadFactory namedThreadFactory = new ThreadFactoryBuilder()
.setNameFormat("TopicDraftService-pool-%d").build();
private ExecutorService threadPool = new ThreadPoolExecutor(1, 1,
1L, TimeUnit.MINUTES,
new LinkedBlockingQueue<>(500), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy());
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
@ -125,12 +115,8 @@ public class TopicDraftServiceImpl extends BaseServiceImpl<TopicDraftDao, TopicD
@Autowired
private ResiTopicOperationDao resiTopicOperationDao;
@Autowired
private EpmetUserFeignClient epmetUserFeignClient;
@Autowired
private ResiGroupDao resiGroupDao;
@Autowired
private ResiGroupMemberDao resiGroupMemberDao;
@Autowired
private ResiGroupStatisticalDao resiGroupStatisticalDao;
@Autowired
private ResiTopicDao resiTopicDao;
@ -1035,7 +1021,7 @@ public class TopicDraftServiceImpl extends BaseServiceImpl<TopicDraftDao, TopicD
sendMsgForm.setContent(actPointEventMsgList);
sendMsgForm.setMessageType(SystemMessageType.PUBLISH_ONE_TOPIC);
Result mqResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm);
if(!mqResult.success()){
logger.error("发表话题积分添加失败");
}

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:

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>

2
epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/interceptor/ScanApiAuthInterceptor.java

@ -33,7 +33,7 @@ public class ScanApiAuthInterceptor implements HandlerInterceptor {
String ip = IpUtils.getIpAddr(request);
SetOperations setOperations = redisTemplate.opsForSet();
if (!setOperations.isMember(RedisKeys.getWhiteList(), ip)) {
log.warn("preHandle ip:{} is not in whitelist", ip);
log.error("preHandle ip:{} 不在白名单内", ip);
String result = JSON.toJSONString(new Result<>().error(EpmetErrorCode.ERR401.getCode(), EpmetErrorCode.ERR401.getMsg()));
responseJson(response, result);
return false;

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@

1
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BasicInfoResultDTO.java

@ -1,7 +1,6 @@
package com.epmet.dto.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;

2
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java

@ -16,7 +16,7 @@ public class StaffBasicInfoResultDTO implements Serializable {
* 客户Id
*/
private String customerId;
private String customerName;
/**
* 用户Id
*/

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>

2
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java

@ -138,6 +138,8 @@ public interface StaffRoleDao extends BaseDao<StaffRoleEntity> {
*/
List<GridStaffResultDTO> staffGridRole(@Param("forms") List<GridStaffResultDTO> forms);
List<GridStaffResultDTO> staffGridRoleByIds(@Param("ids") List<String> ids);
/**
* @Description 查询角色
* @Param userIds

10
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

@ -742,6 +742,16 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
resultDTO.setLongitude(staffInfo.getLongitude());
resultDTO.setLatitude(staffInfo.getLatitude());
}
//获取工作人员所属客户名
CustomerDTO dto = new CustomerDTO();
dto.setId(customerId);
Result<CustomerDTO> customerResult = operCrmOpenFeignClient.getCustomerInfo(dto);
if (!customerResult.success()) {
throw new RenException(customerResult.getCode(), customerResult.getMsg());
}
if (null != customerResult.getData()) {
resultDTO.setCustomerName(customerResult.getData().getCustomerName());
}
}
return new Result<StaffBasicInfoResultDTO>().ok(resultDTO);
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save