Browse Source

Merge remote-tracking branch 'remotes/origin/dev' into 市北测试

# Conflicts:
#	epmet-module/epmet-heart/epmet-heart-server/pom.xml
#	epmet-user/epmet-user-server/pom.xml
release
jianjun 4 years ago
parent
commit
a284319b77
  1. 36
      epmet-admin/epmet-admin-server/pom.xml
  2. 13
      epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml
  3. 7
      epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.11__del_social_org.sql
  4. 8
      epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml
  5. 36
      epmet-auth/pom.xml
  6. 12
      epmet-auth/src/main/resources/bootstrap.yml
  7. 93
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/AsyncConfig.java
  8. 47
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/EpmetThreadPoolProperties.java
  9. 15
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/DingDingRobotConstant.java
  10. 23
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/SpecialCustomerOrgConstant.java
  11. 7
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ThreadLocalConstant.java
  12. 27
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DingTextBriefNessFormDTO.java
  13. 39
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/EpmetBaseRequestInterceptor.java
  14. 11
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/FeignHystrixConcurrencyStrategy.java
  15. 28
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java
  16. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/GlobalFilter.java
  17. 17
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/resolver/LoginUserHandlerMethodArgumentResolver.java
  18. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelPoiUtils.java
  19. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java
  20. 31
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YuShanSysApiService.java
  21. 19
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/group/QueryGroup.java
  22. 1
      epmet-gateway/src/main/resources/bootstrap.yml
  23. 24
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java
  24. 19
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallback.java
  25. 17
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallbackFactory.java
  26. 42
      epmet-module/data-aggregator/data-aggregator-server/pom.xml
  27. 12
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java
  28. 19
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/GridLivelyExcel.java
  29. 6
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java
  30. 97
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  31. 11
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml
  32. 29
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml
  33. 36
      epmet-module/data-report/data-report-server/pom.xml
  34. 3
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java
  35. 11
      epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml
  36. 1
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java
  37. 13
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/UserGroupIdDTO.java
  38. 35
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/DataCheckDTO.java
  39. 3
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java
  40. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java
  41. 77
      epmet-module/data-statistical/data-statistical-server/pom.xml
  42. 49
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/config/AsyncConfig.java
  43. 24
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  44. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java
  45. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java
  46. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java
  47. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.java
  48. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java
  49. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java
  50. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/CalCpcIndexService.java
  51. 290
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java
  52. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java
  53. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java
  54. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicLogDailyService.java
  55. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/IssueExtractService.java
  56. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java
  57. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicLogDailyServiceImpl.java
  58. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java
  59. 42
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ProjectDataService.java
  60. 94
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ProjectDataServiceImpl.java
  61. 35
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java
  62. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java
  63. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java
  64. 16
      epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml
  65. 5
      epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.29__addindex_forcpcability.sql
  66. 18
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml
  67. 22
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml
  68. 10
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml
  69. 23
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml
  70. 52
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml
  71. 13
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml
  72. 36
      epmet-module/epmet-activiti/epmet-activiti-server/pom.xml
  73. 11
      epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml
  74. 11
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java
  75. 55
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ImportTaskCommonFormDTO.java
  76. 43
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/ImportTaskCommonResultDTO.java
  77. 18
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java
  78. 10
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java
  79. 36
      epmet-module/epmet-common-service/common-service-server/pom.xml
  80. 82
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ImportTaskController.java
  81. 0
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ImportTaskDao.java
  82. 11
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/ImportTaskEntity.java
  83. 54
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ImportTaskService.java
  84. 123
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ImportTaskServiceImpl.java
  85. 11
      epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml
  86. 19
      epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.12__createImportTask.sql
  87. 1
      epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.13__ImportTaskCommentModify.sql
  88. 1
      epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ImportTaskDao.xml
  89. 36
      epmet-module/epmet-ext/epmet-ext-server/pom.xml
  90. 11
      epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml
  91. 85
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcActivityServiceRelationDTO.java
  92. 89
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcActivityUnitRelationDTO.java
  93. 30
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java
  94. 79
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActServiceRelationDTO.java
  95. 84
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActUnitRelationDTO.java
  96. 3
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java
  97. 12
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java
  98. 11
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java
  99. 4
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java
  100. 12
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.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>114.215.125.123: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>172.16.0.53:9876;172.16.0.51: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@

7
epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.11__del_social_org.sql

@ -0,0 +1,7 @@
UPDATE sys_dict_data
SET DEL_FLAG = '1',
UPDATED_BY = 'yinzuomei',
UPDATED_TIME = NOW(),
remark = '2022.02.21删除社会组织功能,改用联建单位两新组织'
WHERE
dict_value = 'social_org';

8
epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml

@ -14,8 +14,8 @@
FROM
sys_dict_data a
INNER JOIN sys_dict_type b ON a.dict_type_id = b.id
WHERE
b.dict_type = #{dictType}
WHERE a.del_flag='0'
and b.dict_type = #{dictType}
ORDER BY
a.sort ASC
</select>
@ -27,8 +27,8 @@
FROM
sys_dict_data a
INNER JOIN sys_dict_type b ON a.dict_type_id = b.id
WHERE
b.dict_type = #{dictType}
WHERE a.del_flag='0'
and b.dict_type = #{dictType}
ORDER BY
a.sort asc
</select>

36
epmet-auth/pom.xml

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

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

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

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

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

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

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

15
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/DingDingRobotConstant.java

@ -0,0 +1,15 @@
package com.epmet.commons.tools.constant;
public interface DingDingRobotConstant {
/**
* 尹作梅测试用
*/
String YZM_TEST_URL="https://oapi.dingtalk.com/robot/send?access_token=249c5f49006cf14b37f9c3bc502ede34c16926a5ac5a0deeb9c9b4be735c0daf";
String YZM_TEST_SECRET="SECa03f447d67c62d924b5ae52dd9a7ddd9147d32c1d43f8cb43449f505444bdc6b";
/**
* EPMET V3 产品研发群
*/
String V3_ROBOT_URL="https://oapi.dingtalk.com/robot/send?access_token=75e9ab857536f3018baa09009646876edbd263d07521a1a22eedfc3852623614";
String V3_ROBOT_SECRET="SECdc8d3fb6780faa919f38fd43783f76d111255036c3b5bdcbc086dff023ee84d5";
}

23
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/SpecialCustomerOrgConstant.java

@ -18,14 +18,19 @@ public interface SpecialCustomerOrgConstant {
*/
String test="6e511da6816e53af4cda952365a26eb9";
// /**
// * 榆山生产客户id
// */
// String YUSHAN_PROD_CUSTOMER_ID = "46c55cb862d6d5e6d05d2ab61a1cc07e";
//
// /**
// * 榆山测试客户id
// */
// String YUSHAN_TEST_CUSTOMER_ID = "a4bbf298d8e427844038cee466f022ef";
/**
* 榆山生产客户id
*/
String YUSHAN_PROD_CUSTOMER_ID = "46c55cb862d6d5e6d05d2ab61a1cc07e";
/**
* 榆山测试客户id
*/
String YUSHAN_TEST_CUSTOMER_ID = "a4bbf298d8e427844038cee466f022ef";
/**
* 生产平阴客户id
*/
String PING_YIN_CUSTOMER_ID="6f203e30de1a65aab7e69c058826cd80";
}

7
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ThreadLocalConstant.java

@ -1,5 +1,7 @@
package com.epmet.commons.tools.constant;
import java.util.Map;
/**
* ThreadLocal常亮
*/
@ -19,4 +21,9 @@ public class ThreadLocalConstant {
* 用于本次的获取请求参数
*/
public static final ThreadLocal<String> requestParam = new ThreadLocal();
/**
* 可被子线程继承的追加的request headers
*/
public static final InheritableThreadLocal<Map<String, String>> inheritableAdditionalHeaders = new InheritableThreadLocal<>();
}

27
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DingTextBriefNessFormDTO.java

@ -0,0 +1,27 @@
package com.epmet.commons.tools.dto.form;
import com.dingtalk.api.request.OapiRobotSendRequest;
import lombok.Data;
/**
* 钉钉机器人发送文本通知@手机号简参
*/
@Data
public class DingTextBriefNessFormDTO {
/* {
"msgtype":"text",
"text":{
"content":"我就是我, @15764229697 是不同的烟火"
},
"at":{
"atMobiles": [
"15764229697"
],
"isAtAll":false
}
}*/
private String msgtype;
private OapiRobotSendRequest.Text text;
private OapiRobotSendRequest.At at;
}

39
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/EpmetBaseRequestInterceptor.java

@ -1,24 +1,55 @@
package com.epmet.commons.tools.feign;
import com.epmet.commons.tools.constant.ThreadLocalConstant;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
public class EpmetBaseRequestInterceptor implements RequestInterceptor {
private static final Logger log = LoggerFactory.getLogger(EpmetBaseRequestInterceptor.class);
@Override
public void apply(RequestTemplate template) {
// 自定义追加的request header,可被子线程继承拷贝
Map<String, String> inheritableAdditionalHeaders = FeignHystrixConcurrencyStrategy.hystrixAdditionHeaders.get();
Map<String, String> requestHeaders = getHeadersFromRequest();
log.info("EpmetBaseRequestInterceptor#apply#inheritableAdditionalHeaders:"+inheritableAdditionalHeaders);
if (requestHeaders != null && requestHeaders.size() > 0) {
for (Map.Entry<String, String> kv : requestHeaders.entrySet()) {
template.header(kv.getKey(), kv.getValue());
}
}
if (inheritableAdditionalHeaders != null && inheritableAdditionalHeaders.size() > 0) {
for (Map.Entry<String, String> kv : inheritableAdditionalHeaders.entrySet()) {
template.header(kv.getKey(), kv.getValue());
}
}
}
/**
* 从header里面获取headers
*/
public HashMap<String, String> getHeadersFromRequest() {
HashMap<String, String> headers = new HashMap<>();
RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
if (requestAttributes == null) {
return;
return null;
}
HttpServletRequest request = ((ServletRequestAttributes) requestAttributes).getRequest();
Enumeration<String> headerNames = request.getHeaderNames();
if (headerNames != null) {
@ -27,9 +58,11 @@ public class EpmetBaseRequestInterceptor implements RequestInterceptor {
Enumeration<String> values = request.getHeaders(name);
while (values.hasMoreElements()) {
String value = values.nextElement();
template.header(name, value);
headers.put(name, value);
}
}
}
return headers;
}
}

11
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/FeignHystrixConcurrencyStrategy.java

@ -1,5 +1,6 @@
package com.epmet.commons.tools.feign;
import com.epmet.commons.tools.constant.ThreadLocalConstant;
import com.netflix.hystrix.HystrixThreadPoolKey;
import com.netflix.hystrix.HystrixThreadPoolProperties;
import com.netflix.hystrix.strategy.HystrixPlugins;
@ -17,6 +18,7 @@ import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.Callable;
import java.util.concurrent.ThreadPoolExecutor;
@ -35,6 +37,7 @@ import java.util.concurrent.TimeUnit;
@Component
public class FeignHystrixConcurrencyStrategy extends HystrixConcurrencyStrategy {
public static final ThreadLocal<Map<String, String>> hystrixAdditionHeaders = new ThreadLocal<>();
private static final Logger log = LoggerFactory.getLogger(FeignHystrixConcurrencyStrategy.class);
private HystrixConcurrencyStrategy delegate;
@ -74,8 +77,9 @@ public class FeignHystrixConcurrencyStrategy extends HystrixConcurrencyStrategy
@Override
public <T> Callable<T> wrapCallable(Callable<T> callable) {
Map<String, String> inheritableAdditionalHeaders = ThreadLocalConstant.inheritableAdditionalHeaders.get();
RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
return new WrappedCallable<>(callable, requestAttributes);
return new WrappedCallable<>(callable, requestAttributes, inheritableAdditionalHeaders);
}
@Override
@ -105,15 +109,18 @@ public class FeignHystrixConcurrencyStrategy extends HystrixConcurrencyStrategy
static class WrappedCallable<T> implements Callable<T> {
private final Callable<T> target;
private final RequestAttributes requestAttributes;
private final Map<String, String> inheritableAdditionalHeaders;
public WrappedCallable(Callable<T> target, RequestAttributes requestAttributes) {
public WrappedCallable(Callable<T> target, RequestAttributes requestAttributes, Map<String, String> inheritableAdditionalHeaders) {
this.target = target;
this.requestAttributes = requestAttributes;
this.inheritableAdditionalHeaders = inheritableAdditionalHeaders;
}
@Override
public T call() throws Exception {
try {
hystrixAdditionHeaders.set(inheritableAdditionalHeaders);
RequestContextHolder.setRequestAttributes(requestAttributes);
return target.call();
} finally {

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

@ -1,5 +1,6 @@
package com.epmet.commons.tools.feign;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
@ -13,6 +14,8 @@ import org.slf4j.LoggerFactory;
*/
public interface ResultDataResolver {
Logger logger = LoggerFactory.getLogger(ResultDataResolver.class);
/**
* @Description 获取Result种的data如果失败(返回result为null或者result.success为false)那么返回null
* @return data数据
@ -20,7 +23,6 @@ public interface ResultDataResolver {
* @date 2021.06.07 22:45
*/
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;
@ -49,22 +51,24 @@ public interface ResultDataResolver {
// 考虑到:上游服务抛出的异常代码和错误消息并不一定适用于当前服务,并且上有服务的错误消息弹出之后可能给用户造成困扰,
// 因此,当前服务抛出异常的时候,不再继承上游服务返回的错误码和错误消息
/*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);
}
// if (!result.success()) {
// String j = JSON.toJSONString(result);
// logger.info("远程调用出错,返回结果:{}", j);
//
// // 如果不通过参数指定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();
}

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/GlobalFilter.java

@ -25,6 +25,7 @@ public class GlobalFilter implements Filter {
ThreadLocalConstant.sqlFilter.remove();
ThreadLocalConstant.requirePermissionTl.remove();
ThreadLocalConstant.requestParam.remove();
ThreadLocalConstant.inheritableAdditionalHeaders.remove();
}
}
}

17
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/resolver/LoginUserHandlerMethodArgumentResolver.java

@ -34,6 +34,9 @@ import org.springframework.web.servlet.HandlerMapping;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
/**
@ -80,6 +83,20 @@ public class LoginUserHandlerMethodArgumentResolver implements HandlerMethodArgu
logger.info("【LoginUserHandlerMethodArgumentResolver】请求uri:{}", requestURI);
// todo delete
Iterator<String> headerNames = request.getHeaderNames();
if (headerNames != null) {
HashMap<String, String> hm = new HashMap<>();
while (headerNames.hasNext()) {
String name = headerNames.next();
String[] headerValues = request.getHeaderValues(name);
hm.put(name, String.join(",", headerValues));
}
logger.info("LoginUserHandlerMethodArgumentResolver#resolveArgument:"+hm);
}
//app-client-userId
String redisKey = request.getHeader(Constant.APP_USER_KEY);
if (StringUtils.isEmpty(redisKey)) {

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelPoiUtils.java

@ -255,7 +255,7 @@ public class ExcelPoiUtils {
* @param <T>
* @return
*/
private static <T> ExcelImportResult<T> importExcelMore(InputStream inputStream,Integer titleRows, Integer headerRows, Class<T> pojoClass) throws IOException {
public static <T> ExcelImportResult<T> importExcelMore(InputStream inputStream,Integer titleRows, Integer headerRows, Class<T> pojoClass) throws IOException {
if (inputStream == null) {
return null;
}

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java

@ -305,6 +305,7 @@ public class HttpClientManager {
*/
public Result<String> sendAlarmMsg(String content) {
Long timestamp = System.currentTimeMillis();
//生产环境报警群:重要消息通知
String url = "https://oapi.dingtalk.com/robot/send?access_token=c40055ed85e45fdaafea00f3218928794262ff15163e09ad5c89764433b69806";
String secret = "SEC220eafdcb39ab5dd6cffa9f11b0e5de7178ddac9812d40fdceb6b1dda2963186";

31
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YuShanSysApiService.java

@ -5,14 +5,12 @@ import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.SpecialCustomerOrgConstant;
import com.epmet.commons.tools.dto.form.UpdateUserPointsFormDTO;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.EnvEnum;
import com.epmet.commons.tools.enums.ExternalApiEnum;
import com.epmet.commons.tools.enums.ExternalServerEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@ -34,12 +32,28 @@ public class YuShanSysApiService {
*
* @return
*/
@Async
// @Async
public void updateUserPoints(String customerId, List<UpdateUserPointsFormDTO> paramList) {
/*try {
Thread.sleep(1000l);
} catch (InterruptedException e) {
log.error("调用榆山街道发放积分睡眠发生异常,{}",e);
e.printStackTrace();
}*/
if (StringUtils.isBlank(customerId) || CollectionUtils.isEmpty(paramList)) {
throw new RenException("参数错误");
log.warn("updateUserPoints 参数错误");
return;
}
if (!SpecialCustomerOrgConstant.PING_YIN_CUSTOMER_ID.equals(customerId)) {
return;
}
String serverUrl = null;
EnvEnum currentEnv = EnvEnum.getCurrentEnv();
if (EnvEnum.PROD.getCode().equals(currentEnv.getCode())) {
serverUrl = ExternalServerEnum.getUrl(SpecialCustomerOrgConstant.YUSHAN_PROD_CUSTOMER_ID);
} else if (EnvEnum.TEST.getCode().equals(currentEnv.getCode()) || EnvEnum.LOCAL.getCode().equals(currentEnv.getCode())) {
serverUrl = ExternalServerEnum.getUrl(SpecialCustomerOrgConstant.YUSHAN_TEST_CUSTOMER_ID);
}
String serverUrl = ExternalServerEnum.getUrl(customerId);
if (StringUtils.isBlank(serverUrl)) {
log.warn(String.format("当前客户:%s,未配置服务器地址", customerId));
return;
@ -56,14 +70,13 @@ public class YuShanSysApiService {
// formDTO.setMobile("13205302682");
Result<String> res = HttpClientManager.getInstance().sendPostByJSON(apiPath, JSON.toJSONString(formDTO));
Result result = JSON.parseObject(res.getData(), Result.class);
log.info(String.format("updateUserPoints 入参:%s;返参:%s", JSON.toJSONString(formDTO),JSON.toJSONString(result)));
log.info(String.format("updateUserPoints 入参:%s;返参:%s", JSON.toJSONString(formDTO), JSON.toJSONString(result)));
if (!result.success()) {
log.warn("updateUserPoints failed:{}", JSON.toJSONString(result));
}
}
} catch (Exception e) {
log.warn("updateUserPoints exception 入参:{}", JSON.toJSONString(formDTO));
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage());
log.error("updateUserPoints exception 入参:{},异常:{}", JSON.toJSONString(formDTO), e);
}
}
}

19
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/group/QueryGroup.java

@ -0,0 +1,19 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有侵权必究
*/
package com.epmet.commons.tools.validator.group;
/**
* 查询 Group
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
public interface QueryGroup {
}

1
epmet-gateway/src/main/resources/bootstrap.yml

@ -234,6 +234,7 @@ spring:
- Path=${server.servlet.context-path}/commonservice/**
filters:
- StripPrefix=1
- CpAuth=true
#党建园地
- id: resi-home-server
uri: @gateway.routes.resi-home-server.uri@

24
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java

@ -0,0 +1,24 @@
package com.epmet.dataaggre.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO;
import com.epmet.dataaggre.feign.impl.DataAggregatorOpenFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@FeignClient(name = ServiceConstant.DATA_AGGREGATOR_SERVER, fallbackFactory = DataAggregatorOpenFeignClientFallbackFactory.class)
// @FeignClient(name = ServiceConstant.DATA_AGGREGATOR_SERVER, fallbackFactory= DataAggregatorOpenFeignClientFallbackFactory.class,url = "localhost:8114")
public interface DataAggregatorOpenFeignClient {
/**
* 定时任务导出网格活跃统计表
* @param form
* @return
*/
@PostMapping(value = "data/aggregator/org/export-send-msg")
Result exportGridLiveRes(@RequestBody GridLivelyFormDTO form);
}

19
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallback.java

@ -0,0 +1,19 @@
package com.epmet.dataaggre.feign.impl;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO;
import com.epmet.dataaggre.feign.DataAggregatorOpenFeignClient;
public class DataAggregatorOpenFeignClientFallback implements DataAggregatorOpenFeignClient {
/**
* 定时任务导出网格活跃统计表
* @param form
* @return
*/
@Override
public Result exportGridLiveRes(GridLivelyFormDTO form) {
return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "pcworkRecordListExportSendMsg",form);
}
}

17
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallbackFactory.java

@ -0,0 +1,17 @@
package com.epmet.dataaggre.feign.impl;
import com.epmet.dataaggre.feign.DataAggregatorOpenFeignClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@Slf4j
@Component
public class DataAggregatorOpenFeignClientFallbackFactory implements FallbackFactory<DataAggregatorOpenFeignClient> {
private DataAggregatorOpenFeignClientFallback fallback = new DataAggregatorOpenFeignClientFallback();
@Override
public DataAggregatorOpenFeignClient create(Throwable throwable) {
return null;
}
}

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

@ -110,6 +110,12 @@
</exclusion>-->
</exclusions>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-oss-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
@ -259,6 +265,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 +390,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 +515,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 +641,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>

12
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java

@ -27,7 +27,6 @@ import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import com.epmet.dataaggre.enums.GridMemberDataAnalysisEnums;
import com.epmet.dataaggre.service.AggreGridService;
import com.epmet.dataaggre.service.govorg.GovOrgService;
import com.epmet.dto.form.patrol.PcworkRecordListFormDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
@ -402,4 +401,15 @@ public class GovOrgController {
govOrgService.grdiLivelyExport(response, formDTO);
}
/**
* 定时任务调用本方法查询网格活跃度统计结果生成excel,上传oss.发送钉钉excel.
* @param formDTO
* @return
*/
@PostMapping("export-send-msg")
public Result pcworkRecordListExportSendMsg(@RequestBody GridLivelyFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, GridLivelyFormDTO.Grid.class);
govOrgService.pcworkRecordListExportSendMsg(formDTO);
return new Result();
}
}

19
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/GridLivelyExcel.java

@ -29,40 +29,57 @@ import lombok.Data;
*/
@Data
public class GridLivelyExcel {
@ExcelProperty("组织ID")
@ExcelIgnore
private String agencyId;
//组织名称
@Excel(name = "组织名称",width = 15)
@ExcelProperty("组织名称")
@ColumnWidth(15)
private String agencyName;
//组织下所有网格总数
@Excel(name = "网格总数",width = 15)
@ExcelProperty("网格总数")
@ColumnWidth(15)
private Integer gridSumNum;
//活跃网格数
@Excel(name = "活跃网格数",width = 15)
@ExcelProperty("活跃网格数")
@ColumnWidth(15)
private Integer gridLivelyNum;
//活跃网格数占比
@Excel(name = "活跃网格数占比",width = 15)
@ExcelProperty("活跃网格数占比")
@ColumnWidth(15)
private String gridLivelyRatio;
//正常运行网格数
@Excel(name = "正常运行网格数",width = 15)
@ExcelProperty("正常运行网格数")
@ColumnWidth(15)
private Integer gridOrdinaryNum;
//正常运行网格数占比
@Excel(name = "正常运行网格数占比",width = 15)
@ExcelProperty("正常运行网格数占比")
@ColumnWidth(15)
private String gridOrdinaryRatio;
//僵尸网格数
@Excel(name = "僵尸网格数",width = 15)
@ExcelProperty("僵尸网格数")
@ColumnWidth(15)
private Integer gridLazyNum;
//僵尸网格数占比
@Excel(name = "僵尸网格数占比",width = 15)
@ExcelProperty("僵尸网格数占比")
@ColumnWidth(15)
private String gridLazyRatio;

6
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java

@ -182,4 +182,10 @@ public interface GovOrgService {
* @Description 查询组织的直属下级组织下网格活跃度统计--文件导出
**/
void grdiLivelyExport(HttpServletResponse response, GridLivelyFormDTO formDTO);
/**
* @Author sun
* @Description 查询组织的直属下级组织下网格活跃度统计--文件导出
**/
void pcworkRecordListExportSendMsg(GridLivelyFormDTO formDTO);
}

97
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java

@ -1,18 +1,27 @@
package com.epmet.dataaggre.service.govorg.impl;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.fastjson.JSON;
import com.dingtalk.api.request.OapiRobotSendRequest;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.DingDingRobotConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.form.DingTextBriefNessFormDTO;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.govorg.*;
import com.epmet.dataaggre.dto.epmetuser.result.ListStaffResultDTO;
@ -28,13 +37,23 @@ import com.epmet.dataaggre.service.datastats.DataStatsService;
import com.epmet.dataaggre.service.epmetuser.EpmetUserService;
import com.epmet.dataaggre.service.govorg.GovOrgService;
import com.epmet.dataaggre.service.opercrm.CustomerRelation;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.feign.OssFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.*;
@ -67,6 +86,8 @@ public class GovOrgServiceImpl implements GovOrgService {
private EpmetUserService epmetUserService;
@Autowired
private DataStatsService dataStatsService;
@Autowired
private OssFeignClient ossFeignClient;
/**
* @param staffId
@ -690,4 +711,80 @@ public class GovOrgServiceImpl implements GovOrgService {
return name.toString();
}
/**
* @Author sun
* @Description 查询组织的直属下级组织下网格活跃度统计--文件导出
**/
@Override
public void pcworkRecordListExportSendMsg(GridLivelyFormDTO formDTO) {
List<GridLivelyExcel> data = ConvertUtils.sourceToTarget(grdiLively(formDTO), GridLivelyExcel.class);
if(CollectionUtils.isEmpty(data)){
log.warn(String.format("网格员活跃度统计数据查询为空,入参【%s】", JSON.toJSONString(formDTO)));
return;
}
ExportParams exportParams = new ExportParams();
String sheetName = excelSheetName(formDTO);
exportParams.setSheetName(sheetName);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams,
GridLivelyExcel.class, data);
// 文件名
String resultDescFileName = sheetName.concat(".xls");
FileItemFactory factory = new DiskFileItemFactory(16, null);
FileItem fileItem = factory.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), true, resultDescFileName);
OutputStream os = null;
Result<UploadImgResultDTO> uploadResult = null;
try {
os = fileItem.getOutputStream();
workbook.write(os);
uploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem));
} catch (Exception e) {
String errormsg = ExceptionUtils.getErrorStackTrace(e);
log.warn("【网格活跃度统计】上传错误描述文件异常:{}", errormsg);
} finally {
try {
os.close();
} catch (IOException e) {
String errormsg = ExceptionUtils.getErrorStackTrace(e);
log.warn("【网格活跃度统计】上传错误描述文件关闭输出流:{}", errormsg);
}
try {
fileItem.delete();
} catch (Exception e) {
String errormsg = ExceptionUtils.getErrorStackTrace(e);
log.warn("【网格活跃度统计】上传错误描述文件删除临时文件:{}", errormsg);
}
}
log.warn(String.format("网格员活跃度统计数据查询为空,返参【%s】", JSON.toJSONString(uploadResult)));
if (uploadResult == null || !uploadResult.success()) {
log.warn("【网格活跃度统计】调用OSS上传结果描述文件失败");
} else {
//EPMETV3群机器人
String secret = DingDingRobotConstant.V3_ROBOT_SECRET;
String url = DingDingRobotConstant.V3_ROBOT_URL;
// String secret = DingDingRobotConstant.YZM_TEST_SECRET;
// String url = DingDingRobotConstant.YZM_TEST_URL;
DingTextBriefNessFormDTO dingTalkTextMsg=new DingTextBriefNessFormDTO();
dingTalkTextMsg.setMsgtype("text");
//小雷哥手机号:18660295251,
OapiRobotSendRequest.At at = new OapiRobotSendRequest.At();
at.setAtMobiles(Arrays.asList("18660295251"));
at.setIsAtAll(false);
dingTalkTextMsg.setAt(at);
//文本方式发送
OapiRobotSendRequest.Text text = new OapiRobotSendRequest.Text();
text.setContent("网格活跃度统计: \n" +
"起止时间: " + formDTO.getStartTime().concat(StrConstant.UNDER_LINE).concat(formDTO.getEndTime()) + "\n" +
"文件下载地址: " + uploadResult.getData().getUrl() + "\n"+
"请查收@18660295251");
dingTalkTextMsg.setText(text);
HttpClientManager.getInstance().sendDingMsg(JSON.toJSONString(dingTalkTextMsg), url, secret);
}
}
}

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@

29
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml

@ -331,17 +331,19 @@
<select id="getSubAgencyProject" resultType="com.epmet.dataaggre.dto.datastats.result.SubAgencyProjectResultDTO">
SELECT
agency_id AS agencyId,
IFNULL(project_total, 0) AS "projectTotal",
IFNULL(pending_total, 0) AS "pendingTotal",
IFNULL(closed_total, 0) AS "closedProjectTotal"
<!-- 平阴三个街道的统计数据同一组织同一天会存在两条数据,一条是上报的一条是小程序统计的,所以查询的时候需要按组织分组sum -->
SUM(IFNULL(project_total, 0)) AS "projectTotal",
SUM(IFNULL(pending_total, 0)) AS "pendingTotal",
SUM(IFNULL(closed_total, 0)) AS "closedProjectTotal"
FROM
fact_agency_project_daily
WHERE
del_flag = '0'
AND date_id = #{dateId}
<foreach item="agencyId" collection="agencyIds" open="AND (" separator="or" close=")" index="">
agency_id = #{agencyId}
<foreach collection="agencyIds" item="agencyId" open="AND agency_id IN (" separator="," close=")">
#{agencyId}
</foreach>
GROUP BY agency_id
ORDER BY
project_total DESC
</select>
@ -349,17 +351,19 @@
<select id="getSubGridProject" resultType="com.epmet.dataaggre.dto.datastats.result.SubGridProjectResultDTO">
SELECT
grid_id AS gridId,
IFNULL(project_total, 0) AS "projectTotal",
IFNULL(pending_total, 0) AS "pendingTotal",
IFNULL(closed_total, 0) AS "closedProjectTotal"
<!-- 平阴三个街道的统计数据同一网格同一天会存在两条数据,一条是上报的一条是小程序统计的,所以查询的时候需要按网格分组sum -->
SUM(IFNULL(project_total, 0)) AS "projectTotal",
SUM(IFNULL(pending_total, 0)) AS "pendingTotal",
SUM(IFNULL(closed_total, 0)) AS "closedProjectTotal"
FROM
fact_grid_project_daily
WHERE
del_flag = '0'
AND date_id = #{dateId}
<foreach item="gridId" collection="gridIds" open="AND (" separator="or" close=")" index="">
grid_id = #{gridId}
<foreach collection="gridIds" item="gridId" open="AND grid_id IN (" separator="," close=")">
#{gridId}
</foreach>
GROUP BY grid_id
ORDER BY
project_total DESC
</select>
@ -1004,7 +1008,8 @@
FROM
(
SELECT DISTINCT
date_id dateId, project_total projectCount, closed_total closedProjectCount
<!-- 平阴的三个街道的数据在表里同一天会存在两条,一条是上报的一条是小程序统计的,所以查询时需要sum -->
date_id dateId, SUM(project_total) projectCount, SUM(closed_total) closedProjectCount
<choose>
<when test='dataType == "agency"'>
, agency_id orgId
@ -1028,6 +1033,7 @@
<if test='endTime != "" and endTime != null '>
AND date_id <![CDATA[<=]]> #{endTime}
</if>
GROUP BY date_id, agency_id
ORDER BY date_id ASC
</if>
<if test='sourceType != "" and sourceType == "end" and endTime != "" and endTime != null '>
@ -1035,6 +1041,7 @@
AND date_id <![CDATA[>=]]> #{startTime}
</if>
AND date_id <![CDATA[<=]]> #{endTime}
GROUP BY date_id, agency_id
ORDER BY date_id DESC
</if>
<choose>

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>

3
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java

@ -204,6 +204,7 @@ public class ScreenProjectController {
//tokenDto.setUserId("36bc0fb38565ecdebf8ab9b476b44548");
//tokenDto.setCustomerId("45687aa479955f9d06204d415238f7cc");
ValidatorUtils.validateEntity(formDTO, ProjectCategoryFormDTO.CategoryProjectExportForm.class);
String openTime = formDTO.getStartTime();
List<ProjectCategoryResultDTO> data = screenProjectService.selectProjectCategory(formDTO, tokenDto);
String templatePath = "excel/project_category_temp.xlsx";
@ -216,7 +217,7 @@ public class ScreenProjectController {
Map<String,Object> mapData = new HashMap<>();
mapData.put("list",resultDTOList);
mapData.put("orgName", formDTO.getOrgName());
mapData.put("exportDate",getExportDateStr(formDTO.getStartTime(),formDTO.getEndTime()));
mapData.put("exportDate", getExportDateStr(openTime, formDTO.getEndTime()));
Workbook workbook = ExcelExportUtil.exportExcel(new TemplateExportParams(templatePath), mapData);
response.setHeader("content-Type", "application/vnd.ms-excel");
response.addHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode("项目分类统计.xls", "UTF-8"));

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@

1
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java

@ -12,6 +12,7 @@ public interface DataSourceConstant {
String RESI_GROUP = "resiGroup";
String EPMET_USER = "epmetuser";
String EVALUATION_INDEX = "evaluationIndex";
String EVALUATION_INDEX_READ = "evaluationIndexRead";
String PARTY_MEMBER = "partyMember";
String EPMET_HEART="epmetHeart";
String EPMET_POINT = "epmetPoint";

13
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/UserGroupIdDTO.java

@ -0,0 +1,13 @@
package com.epmet.dto.extract;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class UserGroupIdDTO implements Serializable {
private String userId;
private List<String> groupIdList;
}

35
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/DataCheckDTO.java

@ -0,0 +1,35 @@
package com.epmet.dto.screen.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/3/7 15:56
*/
@Data
public class DataCheckDTO implements Serializable {
private static final long serialVersionUID = -5836567756526658928L;
/**
* 客户ID
*/
private String customerId;
/**
* 客户名
*/
private String customerName;
/**
* 日期
*/
private String dateId;
/**
* 上报项目数
*/
private String reportCount;
/**
* 项目数
*/
private String count;
}

3
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java

@ -365,4 +365,7 @@ public interface DataStatisticalOpenFeignClient {
@PostMapping("/data/stats/ic/user/category-analysis-daily")
Result statUserCategoryDaily(@RequestBody IcUserCategoryAnalysisDailyFormDTO formDTO);
@PostMapping("/data/stats/screenextract/data_check")
Result dataCheck(@RequestBody ExtractOriginFormDTO formDTO);
}

5
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java

@ -346,4 +346,9 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
public Result statUserCategoryDaily(IcUserCategoryAnalysisDailyFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "statUserCategoryDaily", formDTO);
}
@Override
public Result dataCheck(ExtractOriginFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "dataCheck", formDTO);
}
}

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

@ -242,6 +242,12 @@
<datasource.druid.evaluationIndex.username>epmet_evaluation_index_user</datasource.druid.evaluationIndex.username>
<datasource.druid.evaluationIndex.password>EpmEt-db-UsEr</datasource.druid.evaluationIndex.password>
<datasource.druid.evaluationIndex1.url>
<![CDATA[jdbc:mysql://192.168.1.140:3306/epmet_evaluation_index?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.evaluationIndex1.url>
<datasource.druid.evaluationIndex1.username>root</datasource.druid.evaluationIndex1.username>
<datasource.druid.evaluationIndex1.password>root</datasource.druid.evaluationIndex1.password>
<datasource.druid.partyMember.url>
<![CDATA[jdbc:mysql://192.168.1.140:3306/epmet_resi_partymember?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.partyMember.url>
@ -286,11 +292,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>
@ -371,6 +380,12 @@
<datasource.druid.evaluationIndex.username>epmet_evaluation_index_user</datasource.druid.evaluationIndex.username>
<datasource.druid.evaluationIndex.password>EpmEt-db-UsEr</datasource.druid.evaluationIndex.password>
<datasource.druid.evaluationIndex1.url>
<![CDATA[jdbc:mysql://192.168.1.140:3306/epmet_evaluation_index?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.evaluationIndex1.url>
<datasource.druid.evaluationIndex1.username>root</datasource.druid.evaluationIndex1.username>
<datasource.druid.evaluationIndex1.password>root</datasource.druid.evaluationIndex1.password>
<datasource.druid.partyMember.url>
<![CDATA[jdbc:mysql://192.168.1.140:3306/epmet_resi_partymember?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.partyMember.url>
@ -415,11 +430,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>
@ -500,6 +518,12 @@
<datasource.druid.evaluationIndex.username>root</datasource.druid.evaluationIndex.username>
<datasource.druid.evaluationIndex.password>Abc@123456</datasource.druid.evaluationIndex.password>
<datasource.druid.evaluationIndex1.url>
<![CDATA[jdbc:mysql://rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306/epmet_evaluation_index?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.evaluationIndex1.url>
<datasource.druid.evaluationIndex1.username>epmet</datasource.druid.evaluationIndex1.username>
<datasource.druid.evaluationIndex1.password>elink@833066</datasource.druid.evaluationIndex1.password>
<datasource.druid.partyMember.url>
<![CDATA[jdbc:mysql://rm-bp1l2b53j508j1176xo.mysql.rds.aliyuncs.com:3306/epmet_resi_partymember?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.partyMember.url>
@ -543,11 +567,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>
@ -624,6 +652,12 @@
<datasource.druid.evaluationIndex.username>epdc</datasource.druid.evaluationIndex.username>
<datasource.druid.evaluationIndex.password>Elink@833066</datasource.druid.evaluationIndex.password>
<datasource.druid.evaluationIndex1.url>
<![CDATA[jdbc:mysql://rm-m5e3vzs2637224wj9.mysql.rds.aliyuncs.com:3306/epmet_evaluation_index?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.evaluationIndex1.url>
<datasource.druid.evaluationIndex1.username>epmet_cloud_viewer</datasource.druid.evaluationIndex1.username>
<datasource.druid.evaluationIndex1.password>EpmEtclOUdvIEwEr@w</datasource.druid.evaluationIndex1.password>
<datasource.druid.partyMember.url>
<![CDATA[jdbc:mysql://rm-m5e8z9h4z06z60n8h.mysql.rds.aliyuncs.com:3306/epmet_resi_partymember?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.partyMember.url>
@ -667,11 +701,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();
}
}

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

@ -54,7 +54,6 @@ import com.epmet.service.stats.DimAgencyService;
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.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@ -65,7 +64,9 @@ import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
@RequestMapping("demo")
@RestController
@ -620,20 +621,23 @@ public class DemoController {
private CalCpcIndexService calCpcIndexService;
@PostMapping("calCpcPartyAbility")
public Result calCpcPartyAbility(@RequestParam("customerId") String customerId, @RequestParam("monthId")String monthId) {
public Result calCpcPartyAbility(@RequestParam("customerId") String customerId, @RequestParam("monthId") String monthId) {
long startCpc = System.currentTimeMillis();
if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(monthId)) {
calCpcIndexService.calCpcPartyAbility(customerId,monthId);
}else{
calCpcIndexService.calCpcPartyAbilityV2(customerId, monthId);
// calCpcIndexService.calCpcPartyAbility(customerId, monthId);
} else {
QueryWrapper<DimCustomerEntity> customerEntityQueryWrapper = new QueryWrapper<>();
List<DimCustomerEntity> customerEntityList=dimCustomerDao.selectList(customerEntityQueryWrapper);
List<DimCustomerEntity> customerEntityList = dimCustomerDao.selectList(customerEntityQueryWrapper);
QueryWrapper<DimMonthEntity> wrapper = new QueryWrapper<>();
List<DimMonthEntity> dimMonthEntityList= dimMonthDao.selectList(wrapper);
for(DimCustomerEntity customerEntity:customerEntityList){
for(DimMonthEntity monthEntity:dimMonthEntityList) {
calCpcIndexService.calCpcPartyAbility(customerEntity.getId(),monthEntity.getId());
List<DimMonthEntity> dimMonthEntityList = dimMonthDao.selectList(wrapper);
for (DimCustomerEntity customerEntity : customerEntityList) {
for (DimMonthEntity monthEntity : dimMonthEntityList) {
calCpcIndexService.calCpcPartyAbilityV2(customerEntity.getId(), monthEntity.getId());
}
}
}
log.error("手动调用党员相关-党建能力执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId);
return new Result();
}

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

@ -5,6 +5,7 @@ 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.epmet.service.evaluationindex.screen.ProjectDataService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -12,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.concurrent.ExecutorService;
/**
@ -26,6 +28,8 @@ public class ScreenExtractDailyController {
private ScreenExtractService screenExtractService;
@Autowired
private ExecutorService executorService;
@Resource
private ProjectDataService projectDataService;
/**
* @param extractOriginFormDTO
@ -59,4 +63,19 @@ public class ScreenExtractDailyController {
return new Result();
}
/**
* 平阴三个街道上报统计数据正确性校验
*
* @Param formDTO
* @Return {@link Result}
* @Author zhaoqifeng
* @Date 2022/3/7 15:43
*/
@PostMapping("data_check")
public Result dataCheck(@RequestBody ExtractOriginFormDTO formDTO) {
projectDataService.dataCheck(formDTO);
return new Result();
}
}

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java

@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.UserGroupIdDTO;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.GridGroupUserCountResultDTO;
@ -225,4 +226,6 @@ public interface FactOriginGroupMainDailyDao extends BaseDao<FactOriginGroupMain
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectPartyMemberGroupStaticByGrid(@Param("customerId") String customerId, @Param("dateId") String dateId);
List<UserGroupIdDTO> selectGroupAndLeader(String customerId);
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java

@ -170,4 +170,12 @@ public interface FactOriginIssueLogDailyDao extends BaseDao<FactOriginIssueLogDa
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getClosedIssueIncr(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* 查询出本月内做过议题表决的用户id
* @param customerId
* @param monthId
* @return
*/
List<String> queryVoteUserIds(@Param("customerId")String customerId, @Param("monthId")String monthId);
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.java

@ -103,4 +103,12 @@ public interface FactOriginTopicLogDailyDao extends BaseDao<FactOriginTopicLogDa
* @date 2020/9/21 9:37 上午
*/
List<PartyActiveResultDTO> selectPartyActiveTopic(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("isParty") Integer isParty);
/**
* 查询出本月内评论过话题的用户id
* @param customerId
* @param monthId
* @return
*/
List<String> queryCommentTopicUserIds(@Param("customerId") String customerId, @Param("monthId")String monthId);
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java

@ -18,7 +18,9 @@
package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.screen.result.DataCheckDTO;
import com.epmet.dto.screen.result.GridAndOrgCategoryCountResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity;
import org.apache.ibatis.annotations.Mapper;
@ -111,4 +113,13 @@ public interface ScreenProjectDataDao extends BaseDao<ScreenProjectDataEntity> {
@Param("customerId") String customerId, @Param("subCount")Integer subCount,
@Param("allAgencies") List<GridAndOrgCategoryCountResultDTO> allAgencies);
/**
* 获取数据比对结果
*
* @Param formDTO
* @Return {@link List< DataCheckDTO>}
* @Author zhaoqifeng
* @Date 2022/3/7 16:00
*/
List<DataCheckDTO> getCheckResult(ExtractOriginFormDTO formDTO);
}

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java

@ -25,6 +25,7 @@ import com.epmet.dto.org.CustomerStaffGridDTO;
import com.epmet.dto.org.GridInfoDTO;
import com.epmet.dto.org.form.GridBaseInfoFormDTO;
import com.epmet.dto.org.result.CustomerGridDTO;
import com.epmet.dto.stats.DimGridDTO;
import com.epmet.dto.user.form.StaffBaseInfoFormDTO;
import com.epmet.dto.user.result.GridUserInfoDTO;
import com.epmet.entity.org.CustomerGridEntity;
@ -118,4 +119,10 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
* @Description 查询工作人员所属网格信息
**/
List<GridUserInfoDTO> getStaffGrid(StaffBaseInfoFormDTO formDTO);
/**
* @Author sun
* @Description 查询客户下有效网格列表
**/
List<DimGridDTO> gridListByCustomerId(@Param("customerId") String customerId);
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/CalCpcIndexService.java

@ -1,7 +1,5 @@
package com.epmet.service.evaluationindex.extract.dataToIndex;
import java.util.Map;
/**
* 党员相关
*
@ -18,4 +16,7 @@ public interface CalCpcIndexService {
* @Date 2020/9/17 14:08
**/
void calCpcPartyAbility(String customerId, String monthId);
void calCpcPartyAbilityV2(String customerId, String monthId);
}

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

@ -1,7 +1,10 @@
package com.epmet.service.evaluationindex.extract.dataToIndex.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.extract.UserGroupIdDTO;
import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity;
import com.epmet.service.evaluationindex.extract.dataToIndex.CalCpcIndexService;
@ -9,8 +12,10 @@ import com.epmet.service.evaluationindex.extract.todata.*;
import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyService;
import com.epmet.service.group.GroupDataService;
import com.epmet.service.stats.DimCustomerPartymemberService;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -20,6 +25,8 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
/**
* 党员相关
@ -134,6 +141,237 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
factIndexPartyAblityCpcMonthlyService.delAndSavePartyAblityCpcMonthly(customerId,monthId,indexPartyAblityCpcList);
}
@Override
public void calCpcPartyAbilityV2(String customerId, String monthId) {
//1、构造初始值 当前客户下所有的党员
List<FactIndexPartyAblityCpcMonthlyEntity> indexPartyAblityCpcList = dimCustomerPartymemberService.selectPartyMemberList(customerId);
if (CollectionUtils.isEmpty(indexPartyAblityCpcList)) {
log.info("dim_customer_partymember do not any records customerId=" + customerId);
return;
}
//可以先查询出每个党员的 自建群
Map<String, List<String>> userCreatedGroups = queryUserCreatedGroups(customerId, indexPartyAblityCpcList);
CompletableFuture<Map<String, Integer>> createTopicCountFuture = CompletableFuture.supplyAsync(() -> {
return calCreateTopicCount(customerId, monthId);
});
CompletableFuture<Map<String, Integer>> joinTopicCountFuture = CompletableFuture.supplyAsync(() -> {
return calJoinTopicCount(customerId, monthId);
});
CompletableFuture<Map<String, Integer>> shiftIssueCountFuture = CompletableFuture.supplyAsync(() -> {
return calShiftIssueCount(customerId, monthId);
});
CompletableFuture<Map<String, Integer>> shiftProjectCountFuture = CompletableFuture.supplyAsync(() -> {
return calShiftProjectCount(customerId, monthId);
});
CompletableFuture<Map<String, Integer>> joinThreeMeetsCountFuture = CompletableFuture.supplyAsync(() -> {
return calJoinThreeMeetsCount(customerId, monthId);
});
CompletableFuture<Map<String, Integer>> groupUserCountFuture = CompletableFuture.supplyAsync(() -> {
return calgroupUserCount(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups);
});
CompletableFuture<Map<String, Integer>> groupActiveUserCountFuture = CompletableFuture.supplyAsync(() -> {
return calGroupActiveUserCount(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups);
});
CompletableFuture<Map<String, Integer>> groupTopicCountFuture = CompletableFuture.supplyAsync(() -> {
return calGroupTopicCount(customerId, monthId);
});
CompletableFuture<Map<String, BigDecimal>> topicToIssueRatioFuture = CompletableFuture.supplyAsync(() -> {
return caltopicToIssueRatio(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups);
});
Map<String, Integer> createTopicCountMap = new HashMap<>();
Map<String, Integer> joinTopicCountMap = new HashMap<>();
Map<String, Integer> shiftIssueCountMap = new HashMap<>();
Map<String, Integer> shiftProjectCountMap = new HashMap<>();
Map<String, Integer> joinThreeMeetsCountMap = new HashMap<>();
Map<String, Integer> groupUserCountMap = new HashMap<>();
Map<String, Integer> groupActiveUserCountMap = new HashMap<>();
Map<String, Integer> groupTopicCountMap = new HashMap<>();
Map<String, BigDecimal> topicToIssueRatioMap = new HashMap<>();
try {
//1、党员提出话题数
createTopicCountMap = createTopicCountFuture.get();
} catch (Exception e) {
log.error("党员相关-党建能力原始指标值【党员提出话题数】计算异常:{}", ExceptionUtils.getErrorStackTrace(e));
}
try{
//2、党员参与话题数(支持、反对、评论、浏览)---目前只统计 党员评论话题次数之和
joinTopicCountMap = joinTopicCountFuture.get();
} catch (Exception e) {
log.error("党员相关-党建能力原始指标值【党员参与话题数】计算异常:{}", ExceptionUtils.getErrorStackTrace(e));
}
try{
//3、党员提出的话题转议题数
shiftIssueCountMap = shiftIssueCountFuture.get();
} catch (Exception e) {
log.error("党员相关-党建能力原始指标值【党员提出的话题转议题数】计算异常:{}", ExceptionUtils.getErrorStackTrace(e));
}
try{
//4、党员提出的议题转项目数
shiftProjectCountMap = shiftProjectCountFuture.get();
} catch (Exception e) {
log.error("党员相关-党建能力原始指标值【党员提出的议题转项目数】计算异常:{}", ExceptionUtils.getErrorStackTrace(e));
}
try{
//5、参加“三会一课”次数 默认0 :当前用户在本月内活动签到次数 限制活动分类编码100001 三会一课
joinThreeMeetsCountMap = joinThreeMeetsCountFuture.get();
} catch (Exception e) {
log.error("党员相关-党建能力原始指标值【参加“三会一课”次数】计算异常:{}", ExceptionUtils.getErrorStackTrace(e));
}
try{
//6、党员自建群群众人数 :和评价周期无关
groupUserCountMap = groupUserCountFuture.get();
} catch (Exception e) {
log.error("党员相关-党建能力原始指标值【党员自建群群众人数】计算异常:{}", ExceptionUtils.getErrorStackTrace(e));
}
try{
//7、党员自建群活跃群众人数
groupActiveUserCountMap = groupActiveUserCountFuture.get();
} catch (Exception e) {
log.error("党员相关-党建能力原始指标值【党员自建群活跃群众人数】计算异常:{}", ExceptionUtils.getErrorStackTrace(e));
}
try{
//8、党员自建群活跃度——话题数:从话题表中统计党员自建群i的话题总数;对所有自建群话题数累加。
groupTopicCountMap = groupTopicCountFuture.get();
} catch (Exception e) {
log.error("党员相关-党建能力原始指标值【党员自建群活跃度】计算异常:{}", ExceptionUtils.getErrorStackTrace(e));
}
try{
//9、自建群活跃度——议题转项目率
topicToIssueRatioMap = topicToIssueRatioFuture.get();
} catch (Exception e) {
log.error("党员相关-党建能力原始指标值【自建群活跃度】计算异常:{}", ExceptionUtils.getErrorStackTrace(e));
}
List<FactIndexPartyAblityCpcMonthlyEntity> list = new ArrayList<>();
List<List<FactIndexPartyAblityCpcMonthlyEntity>> partionList = Lists.partition(indexPartyAblityCpcList, 500);
List<CompletableFuture<List<FactIndexPartyAblityCpcMonthlyEntity>>> entityFutures = new ArrayList<>();
//2、计算实际值,更新
for (List<FactIndexPartyAblityCpcMonthlyEntity> partList : partionList) {
String quarterId = DateUtils.getQuarterId(monthId);
String yearId = DateUtils.getYearId(monthId);
Map<String, Integer> finalCreateTopicCountMap = createTopicCountMap;
Map<String, Integer> finalJoinTopicCountMap = joinTopicCountMap;
Map<String, Integer> finalShiftIssueCountMap = shiftIssueCountMap;
Map<String, Integer> finalShiftProjectCountMap = shiftProjectCountMap;
Map<String, Integer> finalJoinThreeMeetsCountMap = joinThreeMeetsCountMap;
Map<String, Integer> finalGroupUserCountMap = groupUserCountMap;
Map<String, Integer> finalGroupActiveUserCountMap = groupActiveUserCountMap;
Map<String, Integer> finalGroupTopicCountMap = groupTopicCountMap;
Map<String, BigDecimal> finalTopicToIssueRatioMap = topicToIssueRatioMap;
//目前平阴2100多个党员,200个一组,开一个线程
CompletableFuture<List<FactIndexPartyAblityCpcMonthlyEntity>> future = CompletableFuture.supplyAsync(() -> {
return constructEntity(monthId,
quarterId,
yearId,
partList,
finalCreateTopicCountMap,
finalJoinTopicCountMap,
finalShiftIssueCountMap,
finalShiftProjectCountMap,
finalJoinThreeMeetsCountMap,
finalGroupUserCountMap,
finalGroupActiveUserCountMap,
finalGroupTopicCountMap,
finalTopicToIssueRatioMap);
});
entityFutures.add(future);
}
for (CompletableFuture<List<FactIndexPartyAblityCpcMonthlyEntity>> entityFuture : entityFutures) {
try {
List<FactIndexPartyAblityCpcMonthlyEntity> partList = entityFuture.get();
list.addAll(partList);
} catch (InterruptedException e) {
log.error("党员相关-党建能力原始指标构造异常:{}", ExceptionUtils.getErrorStackTrace(e));
} catch (Exception e) {
log.error("党员相关-党建能力原始指标构造异常:{}", ExceptionUtils.getErrorStackTrace(e));
}
}
//3、删除之前统计过的、批插入批量插入
factIndexPartyAblityCpcMonthlyService.delAndSavePartyAblityCpcMonthly(customerId, monthId, list);
}
private List<FactIndexPartyAblityCpcMonthlyEntity> constructEntity(String monthId,
String quarterId,
String yearId,
List<FactIndexPartyAblityCpcMonthlyEntity> partList,
Map<String, Integer> createTopicCountMap,
Map<String, Integer> joinTopicCountMap,
Map<String, Integer> shiftIssueCountMap,
Map<String, Integer> shiftProjectCountMap,
Map<String, Integer> joinThreeMeetsCountMap,
Map<String, Integer> groupUserCountMap,
Map<String, Integer> groupActiveUserCountMap,
Map<String, Integer> groupTopicCountMap,
Map<String, BigDecimal> topicToIssueRatioMap) {
List<FactIndexPartyAblityCpcMonthlyEntity> resultList = new ArrayList<>();
for (FactIndexPartyAblityCpcMonthlyEntity temp : partList) {
FactIndexPartyAblityCpcMonthlyEntity indexPartyAblityCpcEntity = ConvertUtils.sourceToTarget(temp, FactIndexPartyAblityCpcMonthlyEntity.class);
indexPartyAblityCpcEntity.setMonthId(monthId);
indexPartyAblityCpcEntity.setQuarterId(quarterId);
indexPartyAblityCpcEntity.setYearId(yearId);
//1、党员提出话题数
if (MapUtils.isNotEmpty(createTopicCountMap) && createTopicCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) {
indexPartyAblityCpcEntity.setCreateTopicCount(createTopicCountMap.get(indexPartyAblityCpcEntity.getUserId()));
}
//2、党员参与话题数(支持、反对、评论、浏览)---目前只统计 党员评论话题次数之和
if (MapUtils.isNotEmpty(joinTopicCountMap) && joinTopicCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) {
indexPartyAblityCpcEntity.setJoinTopicCount(joinTopicCountMap.get(indexPartyAblityCpcEntity.getUserId()));
}
//3、党员提出的话题转议题数
if (MapUtils.isNotEmpty(shiftIssueCountMap) && shiftIssueCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) {
indexPartyAblityCpcEntity.setShiftIssueCount(shiftIssueCountMap.get(indexPartyAblityCpcEntity.getUserId()));
}
//4、党员提出的议题转项目数
if (MapUtils.isNotEmpty(shiftProjectCountMap) && shiftProjectCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) {
indexPartyAblityCpcEntity.setShiftProjectCount(shiftProjectCountMap.get(indexPartyAblityCpcEntity.getUserId()));
}
//5、参加“三会一课”次数 目前没有此业务,默认0 : 当前用户在本月内活动签到次数 限制活动分类编码100001 三会一课
if (MapUtils.isNotEmpty(joinThreeMeetsCountMap) && joinThreeMeetsCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) {
indexPartyAblityCpcEntity.setJoinThreeMeetsCount(joinThreeMeetsCountMap.get(indexPartyAblityCpcEntity.getUserId()));
}
//6、党员自建群群众人数
if (MapUtils.isNotEmpty(groupUserCountMap) && groupUserCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) {
indexPartyAblityCpcEntity.setGroupUserCount(groupUserCountMap.get(indexPartyAblityCpcEntity.getUserId()));
}
//7、党员自建群活跃群众人数
if (MapUtils.isNotEmpty(groupActiveUserCountMap) && groupActiveUserCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) {
indexPartyAblityCpcEntity.setGroupActiveUserCount(groupActiveUserCountMap.get(indexPartyAblityCpcEntity.getUserId()));
}
//8、党员自建群活跃度——话题数
if (MapUtils.isNotEmpty(groupTopicCountMap) && groupTopicCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) {
indexPartyAblityCpcEntity.setGroupTopicCount(groupTopicCountMap.get(indexPartyAblityCpcEntity.getUserId()));
}
//9、自建群活跃度——议题转项目率
if (MapUtils.isNotEmpty(topicToIssueRatioMap) && topicToIssueRatioMap.containsKey(indexPartyAblityCpcEntity.getUserId())) {
indexPartyAblityCpcEntity.setTopicToIssueRatio(topicToIssueRatioMap.get(indexPartyAblityCpcEntity.getUserId()));
}
resultList.add(indexPartyAblityCpcEntity);
}
return resultList;
}
/**
* @param customerId
* @param partyMemberList
@ -144,7 +382,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
**/
private Map<String, List<String>> queryUserCreatedGroups(String customerId, List<FactIndexPartyAblityCpcMonthlyEntity> partyMemberList) {
Map<String, List<String>> map = new HashMap<>();
for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) {
/*for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) {
//查询当前党员建了多少个组
List<String> groupIdList=factOriginGroupMainDailyService.selectGroupIds(customerId,partyMember.getUserId());
if (CollectionUtils.isEmpty(groupIdList)) {
@ -153,6 +391,17 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
} else {
map.put(partyMember.getUserId(), groupIdList);
}
}*/
//查询出所有的小组,按照组长
List<UserGroupIdDTO> list = factOriginGroupMainDailyService.selectGroupAndLeader(customerId);
Map<String, List<String>> userGroupIdMap = list.stream().collect(Collectors.toMap(UserGroupIdDTO::getUserId, UserGroupIdDTO::getGroupIdList));
for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) {
if (MapUtils.isEmpty(userGroupIdMap) || !userGroupIdMap.containsKey(partyMember.getUserId())) {
map.put(partyMember.getUserId(), new ArrayList<>());
continue;
} else {
map.put(partyMember.getUserId(), userGroupIdMap.get(partyMember.getUserId()));
}
}
return map;
}
@ -166,11 +415,13 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
* @Date 2020/9/18 10:59
**/
private Map<String, Integer> calCreateTopicCount(String customerId, String monthId) {
long startCpc = System.currentTimeMillis();
List<CpcIndexCommonDTO> list = factOriginTopicMainDailyService.selectPartyCreateTopicCount(customerId, monthId);
Map<String, Integer> resultMap = new HashMap<>();
for (CpcIndexCommonDTO cpcIndexCommonDTO: list) {
resultMap.put(cpcIndexCommonDTO.getUserId(), cpcIndexCommonDTO.getIndexValue());
}
log.warn("1、党员相关-党建能力【党员提出话题数】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId);
return resultMap;
}
@ -183,11 +434,13 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
* @Date 2020/9/18 13:33
**/
private Map<String, Integer> calJoinTopicCount(String customerId, String monthId) {
long startCpc = System.currentTimeMillis();
List<CpcIndexCommonDTO> list = factOriginTopicLogDailyService.selectJoinTopicCount(customerId, monthId);
Map<String, Integer> resultMap = new HashMap<>();
for (CpcIndexCommonDTO cpcIndexCommonDTO : list) {
resultMap.put(cpcIndexCommonDTO.getUserId(), cpcIndexCommonDTO.getIndexValue());
}
log.warn("2、党员相关-党建能力【党员参与话题数】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId);
return resultMap;
}
@ -201,11 +454,13 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
* @Date 2020/9/18 13:53
**/
private Map<String, Integer> calShiftIssueCount(String customerId, String monthId) {
long startCpc = System.currentTimeMillis();
List<CpcIndexCommonDTO> list = issueExtractService.selectShiftIssueCount(customerId, monthId);
Map<String, Integer> resultMap = new HashMap<>();
for (CpcIndexCommonDTO cpcIndexCommonDTO : list) {
resultMap.put(cpcIndexCommonDTO.getUserId(), cpcIndexCommonDTO.getIndexValue());
}
log.warn("3、党员相关-党建能力【党员提出的话题转议题数】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId);
return resultMap;
}
@ -218,12 +473,14 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
* @Date 2020/9/18 14:10
**/
private Map<String, Integer> calShiftProjectCount(String customerId, String monthId) {
long startCpc = System.currentTimeMillis();
//查询fact_origin_project_main_daily 表 中议题的议题的状态为 shift_
List<CpcIndexCommonDTO> list = factOriginProjectMainDailyService.selectShiftProjectCount(customerId, monthId);
Map<String, Integer> resultMap = new HashMap<>();
for (CpcIndexCommonDTO cpcIndexCommonDTO : list) {
resultMap.put(cpcIndexCommonDTO.getUserId(), cpcIndexCommonDTO.getIndexValue());
}
log.warn("4、党员相关-党建能力【党员提出的议题转项目数】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId);
return resultMap;
}
@ -236,12 +493,14 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
* @Date 2021/5/12 13:38
**/
private Map<String, Integer> calJoinThreeMeetsCount(String customerId, String monthId) {
long startCpc = System.currentTimeMillis();
//查询小组活动签到表,计算用户在本月内签到的活动次数
List<CpcIndexCommonDTO> list=groupDataService.selectJoinThreeMeetsCount(customerId,monthId);
Map<String, Integer> resultMap = new HashMap<>();
for (CpcIndexCommonDTO cpcIndexCommonDTO : list) {
resultMap.put(cpcIndexCommonDTO.getUserId(), cpcIndexCommonDTO.getIndexValue());
}
log.warn("5、党员相关-党建能力【参加“三会一课”次数】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId);
return resultMap;
}
@ -256,6 +515,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
private Map<String, Integer> calgroupUserCount(String customerId, String monthId,
List<FactIndexPartyAblityCpcMonthlyEntity> partyMemberList,
Map<String, List<String>> userCreatedGroups) {
long startCpc = System.currentTimeMillis();
/*含义评价周期内党员自建群中群众成员数
数据来源用户社群关系表
计算方法对党员i的所有j个自建群从用户社群关系表中统计属于每个自建群的群众用户总人数并对j个群众用户总数进行不重复累加
@ -265,7 +525,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
//查询当前党员建了多少个组
List<String> groupIdList = userCreatedGroups.get(partyMember.getUserId());
if (CollectionUtils.isEmpty(groupIdList)) {
log.info("当前党员userId="+partyMember.getUserId()+"没有创建过小组, 【党员相关-党员自建群群众人数】赋值0");
// log.info("当前党员userId="+partyMember.getUserId()+"没有创建过小组, 【党员相关-党员自建群群众人数】赋值0");
map.put(partyMember.getUserId(), NumConstant.ZERO);
continue;
}
@ -279,6 +539,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
map.put(partyMember.getUserId(), memberIdList.size());
}
}
log.warn("6、党员相关-党建能力【党员自建群群众人数】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId);
return map;
}
@ -294,6 +555,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
private Map<String, Integer> calGroupActiveUserCount(String customerId, String monthId,
List<FactIndexPartyAblityCpcMonthlyEntity> partyMemberList,
Map<String, List<String>> userCreatedGroups) {
long startCpc = System.currentTimeMillis();
/*含义评价周期内党员自建群中活跃群众成员数所谓活跃群成员即评价周期内参与话题事件评论点赞点踩总次数大于给定阈值的群众用户
数据来源话题用户阅读表话题评论用户表态表话题评论表事件点赞点踩表事件评论点赞点踩表事件评论表用户信息表
计算方法
@ -311,7 +573,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
//1、查询当前党员建了多少个组
List<String> groupIdList = userCreatedGroups.get(partyMember.getUserId());
if (CollectionUtils.isEmpty(groupIdList)) {
log.warn("当前党员userId="+partyMember.getUserId()+"没有创建过小组, 【党员相关-党员自建群活跃群众人数】赋值0");
// log.warn("当前党员userId="+partyMember.getUserId()+"没有创建过小组, 【党员相关-党员自建群活跃群众人数】赋值0");
map.put(partyMember.getUserId(), NumConstant.ZERO);
continue;
}
@ -321,23 +583,35 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
map.put(partyMember.getUserId(), NumConstant.ZERO);
continue;
}
//可以先把本月内评论的用户+本月内表决过的用户 集合查询出来。避免循环查询
List<String> commentTopicUserIds=factOriginTopicLogDailyService.queryCommentTopicUserIds(customerId,monthId);
List<String> voteUserIds=issueExtractService.queryVoteUserIds(customerId,monthId);
//3、判断每个成员是否 “活跃”
for (String memberId : memberIdList) {
//注释2022.03.02
//1、判断成员在本月内是否评论过
Integer topicCommentCount = factOriginTopicLogDailyService.selectUserCommentCount(memberId, customerId, monthId);
/*Integer topicCommentCount = factOriginTopicLogDailyService.selectUserCommentCount(memberId, customerId, monthId);
if (topicCommentCount > 0) {
groupActiveUserCount++;
continue;
}
}*/
//2、判断成员在本月内是否表决过(支持or反对)议题
Integer voteCount = issueExtractService.selectCountUserVote(memberId, customerId, monthId);
/*Integer voteCount = issueExtractService.selectCountUserVote(memberId, customerId, monthId);
if (voteCount > 0) {
groupActiveUserCount++;
}*/
if (CollectionUtils.isNotEmpty(commentTopicUserIds) && commentTopicUserIds.contains(memberId)) {
groupActiveUserCount++;
continue;
}
if (CollectionUtils.isNotEmpty(voteUserIds) && voteUserIds.contains(memberId)) {
groupActiveUserCount++;
}
}
//赋值每个党员的 -- 党员自建群活跃群众人数
map.put(partyMember.getUserId(), groupActiveUserCount);
}
log.warn("7、党员相关-党建能力【党员自建群活跃群众人数】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId);
return map;
}
@ -351,6 +625,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
* @Date 2020/9/18 14:31
**/
private Map<String, Integer> calGroupTopicCount(String customerId, String monthId) {
long startCpc = System.currentTimeMillis();
/*含义评价周期内党员自建群中话题发布数
数据来源话题表
计算方法从话题表中统计党员自建群i的话题总数对所有自建群话题数累加
@ -360,6 +635,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
for (CpcIndexCommonDTO dto : list) {
resultMap.put(dto.getUserId(), dto.getIndexValue());
}
log.warn("8、党员相关-党建能力【党员自建群活跃度——话题数】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId);
return resultMap;
}
@ -374,6 +650,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
String monthId,
List<FactIndexPartyAblityCpcMonthlyEntity> partyMemberList,
Map<String, List<String>> userCreatedGroups) {
long startCpc = System.currentTimeMillis();
Map<String, BigDecimal> map = new HashMap<>();
for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) {
//如果党员自建群为空,直接赋值0
@ -408,6 +685,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
BigDecimal topicToIssueRatio = new BigDecimal(topicToIssueRatioStr).multiply(new BigDecimal(NumConstant.ONE_HUNDRED));
map.put(partyMember.getUserId(), topicToIssueRatio);
}
log.warn("9、党员相关-党建能力【自建群活跃度——议题转项目率】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId);
return map;
}

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

@ -101,7 +101,8 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService
executorService.submit(() -> {
try {
long startCpc = System.currentTimeMillis();
calCpcIndexService.calCpcPartyAbility(customerId, monthId);
// calCpcIndexService.calCpcPartyAbility(customerId, monthId);
calCpcIndexService.calCpcPartyAbilityV2(customerId, monthId);
log.info("党员相关-党建能力执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, param.getCustomerId());
} catch (Exception e) {
log.error("抽取【党员相关数据】发生异常,参数:" + JSON.toJSONString(param), e);

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java

@ -19,6 +19,7 @@ package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.UserGroupIdDTO;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.GridGroupUserCountResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
@ -125,4 +126,10 @@ public interface FactOriginGroupMainDailyService extends BaseService<FactOriginG
*/
Map<String, OrgStatisticsResultDTO> getPartyMemberGroupStatic(String customerId, String dateId, String type);
/**
* 查询出小组id ,组长userId
* @param customerId
* @return
*/
List<UserGroupIdDTO> selectGroupAndLeader(String customerId);
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicLogDailyService.java

@ -79,4 +79,12 @@ public interface FactOriginTopicLogDailyService extends BaseService<FactOriginTo
* @date 2020/9/21 9:37 上午
*/
List<PartyActiveResultDTO> selectPartyActiveTopic(String customerId, String monthId,Integer isParty);
/**
* 查询出本月内评论过话题的用户id
* @param customerId
* @param monthId
* @return
*/
List<String> queryCommentTopicUserIds(String customerId, String monthId);
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/IssueExtractService.java

@ -107,4 +107,12 @@ public interface IssueExtractService {
* @date 2020/9/21 9:37 上午
*/
List<PartyActiveResultDTO> selectPartyActiveIssueVote(String customerId, String monthId, Integer isParty);
/**
* 查询出本月内做过议题表决的用户id
* @param customerId
* @param monthId
* @return
*/
List<String> queryVoteUserIds(String customerId, String monthId);
}

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

@ -22,8 +22,8 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao;
import com.epmet.dao.evaluationindex.extract.FactOriginGroupMemberDailyDao;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.UserGroupIdDTO;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.GridGroupUserCountResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
@ -198,4 +198,15 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl<FactOri
}
}
/**
* 查询出小组id ,组长userId
*
* @param customerId
* @return
*/
@Override
public List<UserGroupIdDTO> selectGroupAndLeader(String customerId) {
return baseDao.selectGroupAndLeader(customerId);
}
}

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

@ -108,4 +108,16 @@ public class FactOriginTopicLogDailyServiceImpl extends BaseServiceImpl<FactOrig
public List<PartyActiveResultDTO> selectPartyActiveTopic(String customerId, String monthId, Integer isParty) {
return baseDao.selectPartyActiveTopic(customerId, monthId, isParty);
}
/**
* 查询出本月内评论过话题的用户id
*
* @param customerId
* @param monthId
* @return
*/
@Override
public List<String> queryCommentTopicUserIds(String customerId, String monthId) {
return baseDao.queryCommentTopicUserIds(customerId,monthId);
}
}

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

@ -374,4 +374,17 @@ public class IssueExtractServiceImpl implements IssueExtractService {
public List<PartyActiveResultDTO> selectPartyActiveIssueVote(String customerId, String monthId, Integer isParty) {
return issueLogDailyDao.selectPartyActiveIssueVote(customerId, monthId, isParty);
}
/**
* 查询出本月内做过议题表决的用户id
*
* @param customerId
* @param monthId
* @return
*/
@Override
public List<String> queryVoteUserIds(String customerId, String monthId) {
return issueLogDailyDao.queryVoteUserIds(customerId,monthId);
}
}

42
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ProjectDataService.java

@ -0,0 +1,42 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity;
/**
* 中央区-项目数据
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-02-23
*/
public interface ProjectDataService extends BaseService<ScreenProjectDataEntity> {
/**
* 平阴三个街道上报统计数据正确性校验
*
* @Param formDTO
* @Return
* @Author zhaoqifeng
* @Date 2022/3/7 15:44
*/
void dataCheck(ExtractOriginFormDTO formDTO);
}

94
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ProjectDataServiceImpl.java

@ -0,0 +1,94 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.evaluationindex.screen.impl;
import com.alibaba.fastjson.JSON;
import com.dingtalk.api.request.OapiRobotSendRequest;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.DingDingRobotConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.screen.ScreenProjectDataDao;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.screen.result.DataCheckDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity;
import com.epmet.service.evaluationindex.screen.ProjectDataService;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* 中央区-项目数据
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Slf4j
@Service
@DataSource(value = DataSourceConstant.EVALUATION_INDEX_READ)
public class ProjectDataServiceImpl extends BaseServiceImpl<ScreenProjectDataDao, ScreenProjectDataEntity> implements ProjectDataService {
/**
* 平阴三个街道上报统计数据正确性校验
*
* @param formDTO
* @Param formDTO
* @Return
* @Author zhaoqifeng
* @Date 2022/3/7 15:44
*/
@Override
public void dataCheck(ExtractOriginFormDTO formDTO) {
if (StringUtils.isNotBlank(formDTO.getStartDate()) && StringUtils.isNotBlank(formDTO.getEndDate())) {
formDTO.setDateId(null);
} else {
if (StringUtils.isBlank(formDTO.getDateId())){
formDTO.setDateId(DimIdGenerator.getDateDimId(DateUtils.addDateDays(new Date(), -1)));
}
}
List<DataCheckDTO> list = baseDao.getCheckResult(formDTO);
if (CollectionUtils.isNotEmpty(list)) {
//发送钉钉消息
//EPMETV3群机器人
String secret = DingDingRobotConstant.V3_ROBOT_SECRET;
String url = DingDingRobotConstant.V3_ROBOT_URL;
for (DataCheckDTO dto : list) {
OapiRobotSendRequest request = new OapiRobotSendRequest();
request.setMsgtype("markdown");
OapiRobotSendRequest.Markdown markdown = new OapiRobotSendRequest.Markdown();
markdown.setTitle("平阴三个街道项目日统计数据上报比对结果");
markdown.setText("客户ID:" + dto.getCustomerId() +"\n\n"+
"> 客户名称:" + dto.getCustomerName() +"\n\n"+
"> 日期:" + dto.getDateId() + "\n\n"+
"> 上报项目数:" + dto.getReportCount() + "\n\n"+
"> 表中项目数:" + dto.getCount());
request.setMarkdown(markdown);
log.info("robot需要发送的内容为:"+markdown.getText());
HttpClientManager.getInstance().sendDingMsg(JSON.toJSONString(request),url,secret);
}
}
}
}

35
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java

@ -1,17 +1,23 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.PingYinConstant;
import com.epmet.constant.ProjectConstant;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.StatsFormDTO;
import com.epmet.dto.project.form.MonthProjectListFormDTO;
import com.epmet.dto.stats.DimAgencyDTO;
import com.epmet.dto.stats.DimGridDTO;
import com.epmet.entity.issue.IssueEntity;
import com.epmet.entity.org.CustomerAgencyEntity;
import com.epmet.entity.project.ProjectEntity;
import com.epmet.entity.project.ProjectProcessEntity;
import com.epmet.entity.stats.*;
import com.epmet.service.Issue.IssueService;
import com.epmet.service.StatsProjectService;
import com.epmet.service.org.CustomerAgencyService;
import com.epmet.service.org.CustomerGridService;
import com.epmet.service.project.ProjectProcessService;
import com.epmet.service.project.ProjectService;
@ -63,6 +69,8 @@ public class StatsProjectServiceImpl implements StatsProjectService {
private FactGridProjectMonthlyService factGridProjectMonthlyService;
@Autowired
private CustomerGridService customerGridService;
@Autowired
private CustomerAgencyService customerAgencyService;
/**
* @Author sun
@ -108,10 +116,18 @@ public class StatsProjectServiceImpl implements StatsProjectService {
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date);
//2:根据客户Id查询机关维度表数据
DimAgencyDTO dimAgencyDTO = new DimAgencyDTO();
dimAgencyDTO.setCustomerId(customerId);
List<DimAgencyDTO> dimAgencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO);
//2022.3.3 平阴数据统计时只统计了五个街道的 其他三个街道是上报的,现在这三个街道在小程序也产生了项目(例行工作)数据,
//但是dim维度表不能有这三个街道的组织,因此改查业务库组织列表数据 start sun
List<DimAgencyDTO> dimAgencyList = new ArrayList<>();
if (customerId.equals(PingYinConstant.PROD_PING_YIN_CUSTOMER_ID)) {
List<CustomerAgencyEntity> agencyList = customerAgencyService.queryAgencyListByCustomerId(customerId);
dimAgencyList = ConvertUtils.sourceToTarget(agencyList, DimAgencyDTO.class);
} else {
DimAgencyDTO dimAgencyDTO = new DimAgencyDTO();
dimAgencyDTO.setCustomerId(customerId);
dimAgencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO);
}
//2022.3.3 end sun
/*
//2022.1.12 客户数据量大 调整计算逻辑,一千条已查询,封装数据,将这部分业务数据查询拿到子方法分页查询处理 sun
//3:根据客户Id查询项目业务表已结案数据(查询传入日期及之前的数据)
@ -650,7 +666,16 @@ public class StatsProjectServiceImpl implements StatsProjectService {
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date);
//2:根据客户Id查询网格维度表数据
List<DimGridEntity> dimGridList = dimGridService.getGridListByCustomerId(customerId);
//2022.3.3 平阴数据统计时只统计了五个街道的 其他三个街道是上报的,现在这三个街道在小程序也产生了项目(例行工作)数据,
//但是dim维度表不能有这三个街道的组织,因此改查业务库网格列表数据 start sun
List<DimGridEntity> dimGridList = new ArrayList<>();
if (customerId.equals(PingYinConstant.PROD_PING_YIN_CUSTOMER_ID)) {
List<DimGridDTO> gridList = customerGridService.gridListByCustomerId(customerId);
dimGridList = ConvertUtils.sourceToTarget(gridList, DimGridEntity.class);
} else {
dimGridList = dimGridService.getGridListByCustomerId(customerId);
}
//2022.3.3 end sun
//3:根据客户Id查询项目业务表已结案数据(查询传入日期及之前的数据)
ProjectEntity projectEntity = new ProjectEntity();

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java

@ -8,9 +8,11 @@ import com.epmet.dto.org.CustomerStaffGridDTO;
import com.epmet.dto.org.GridInfoDTO;
import com.epmet.dto.org.form.GridBaseInfoFormDTO;
import com.epmet.dto.org.result.CustomerGridDTO;
import com.epmet.dto.stats.DimGridDTO;
import com.epmet.dto.user.form.StaffBaseInfoFormDTO;
import com.epmet.dto.user.result.GridUserInfoDTO;
import com.epmet.entity.org.CustomerGridEntity;
import com.epmet.entity.stats.DimGridEntity;
import java.util.Date;
import java.util.List;
@ -99,4 +101,10 @@ public interface CustomerGridService extends BaseService<CustomerGridEntity> {
* @Description 查询工作人员所属网格信息
**/
List<GridUserInfoDTO> getStaffGrid(StaffBaseInfoFormDTO formDTO);
/**
* @Author sun
* @Description 查询客户下有效网格列表
**/
List<DimGridDTO> gridListByCustomerId(String customerId);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java

@ -12,6 +12,7 @@ import com.epmet.dto.org.CustomerStaffGridDTO;
import com.epmet.dto.org.GridInfoDTO;
import com.epmet.dto.org.form.GridBaseInfoFormDTO;
import com.epmet.dto.org.result.CustomerGridDTO;
import com.epmet.dto.stats.DimGridDTO;
import com.epmet.dto.user.form.StaffBaseInfoFormDTO;
import com.epmet.dto.user.result.GridUserInfoDTO;
import com.epmet.entity.org.CustomerGridEntity;
@ -147,4 +148,13 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
return customerGridDao.getStaffGrid(formDTO);
}
/**
* @Author sun
* @Description 查询客户下有效网格列表
**/
@Override
public List<DimGridDTO> gridListByCustomerId(String customerId) {
return customerGridDao.gridListByCustomerId(customerId);
}
}

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

@ -193,14 +193,22 @@ dynamic:
url: @datasource.druid.operCustomize.url@
username: @datasource.druid.operCustomize.username@
password: @datasource.druid.operCustomize.password@
evaluationIndexRead:
driver-class-name: com.mysql.cj.jdbc.Driver
url: @datasource.druid.evaluationIndex1.url@
username: @datasource.druid.evaluationIndex1.username@
password: @datasource.druid.evaluationIndex1.password@
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:

5
epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.29__addindex_forcpcability.sql

@ -0,0 +1,5 @@
-- stat库执行
alter table fact_origin_topic_main_daily add index `IDX_TOPIC_MAIN_GROUP_ID` (`GROUP_ID`);
alter table fact_origin_project_main_daily add index `IDX_P_MAIN_TOPIC_ID` (`TOPIC_ID`);
alter table fact_origin_issue_main_daily add index `IDX_ISSUE_MAIN_TOPIC_ID` (`TOPIC_ID`);
alter table fact_origin_group_member_daily add index `IDX_GM_GROUP_ID` (`GROUP_ID`);

18
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml

@ -382,4 +382,22 @@
GRID_ID
</select>
<resultMap id="UserGroupIdDTOMap" type="com.epmet.dto.extract.UserGroupIdDTO">
<id property="userId" column="GROUP_OWNER_ID"/>
<collection property="groupIdList" ofType="java.lang.String">
<constructor>
<arg column="ID"/>
</constructor>
</collection>
</resultMap>
<select id="selectGroupAndLeader" parameterType="java.lang.String" resultMap="UserGroupIdDTOMap">
SELECT
t1.GROUP_OWNER_ID,
t1.ID
FROM
fact_origin_group_main_daily t1
WHERE t1.DEL_FLAG='0'
and t1.CUSTOMER_ID = #{customerId}
</select>
</mapper>

22
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml

@ -237,4 +237,26 @@
GRID_ID,
OPERATION_USER_ID
</select>
<select id="queryVoteUserIds" parameterType="map" resultType="java.lang.String">
SELECT
*
FROM
(
SELECT
T1.OPERATION_USER_ID AS userId,
COUNT( 1 ) AS TOTAL
FROM
fact_origin_issue_log_daily T1
WHERE
T1.DEL_FLAG = '0'
AND T1.CUSTOMER_ID = #{customerId}
AND T1.MONTH_ID = #{monthId}
AND ( T1.ACTION_CODE = 'vote_support' OR T1.ACTION_CODE = 'vote_opposition' )
GROUP BY
T1.OPERATION_USER_ID
) temp
WHERE
total >0
</select>
</mapper>

10
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml

@ -40,12 +40,12 @@
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND (DATE_FORMAT(INFORMED_DATE,"%Y%m%d") &gt;= #{dateId} OR DATE_FORMAT(HANDLED_DATE,"%Y%m%d") &gt;= #{dateId} OR DATE_FORMAT(PERIOD_TILL_REPLY_FIRSTLY,"%Y%m%d") &gt;= #{dateId})
<if test="null != list and list.size() > 0">
<foreach collection="list" open="AND ( " close=" )" separator=" OR " item="item">
PROJECT_ID = #{item}
</foreach>
</if>
AND (DATE_FORMAT(INFORMED_DATE,"%Y%m%d") &gt;= #{dateId} OR DATE_FORMAT(HANDLED_DATE,"%Y%m%d") &gt;= #{dateId} OR DATE_FORMAT(PERIOD_TILL_REPLY_FIRSTLY,"%Y%m%d") &gt;= #{dateId})
</delete>
<select id="selectResponsiveness" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
@ -122,7 +122,7 @@
)
</foreach>
</insert>
<select id="selectDeptHandle" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
@ -141,8 +141,8 @@
GROUP BY
fp.ORG_ID
</select>
<select id="selectProjectNodeStartStopTime" resultType="com.epmet.dto.form.CostDayFormDTO">
SELECT
period.PROJECT_ID AS id,
@ -161,4 +161,4 @@
period.PROJECT_ID = #{projectId}
</foreach>
</select>
</mapper>
</mapper>

23
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml

@ -143,4 +143,27 @@
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
</select>
<!-- 查询出本月内,评论过话题的用户id -->
<select id="queryCommentTopicUserIds" parameterType="map" resultType="java.lang.String">
SELECT
userId
FROM
(
SELECT
t1.OPERATE_USER_ID AS userId,
COUNT( 1 ) AS total
FROM
fact_origin_topic_log_daily T1
WHERE
T1.DEL_FLAG = '0'
AND T1.CUSTOMER_ID = #{customerId}
AND T1.MONTH_ID = #{monthId}
AND t1.ACTION_CODE = 'comment'
GROUP BY
t1.OPERATE_USER_ID
) temp
WHERE
total >0
</select>
</mapper>

52
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml

@ -393,4 +393,56 @@
GROUP BY categoryCode
</foreach>
</select>
<select id="getCheckResult" resultType="com.epmet.dto.screen.result.DataCheckDTO">
SELECT
CUSTOMER_ID AS customerId,
CASE
CUSTOMER_ID
WHEN '46c55cb862d6d5e6d05d2ab61a1cc07e' THEN
'榆山'
WHEN '44876154d10d7cb7affd92000f84f833' THEN
'锦水'
WHEN '6f203e30de1a65aab7e69c058826cd80' THEN
'平阴' ELSE '孔村'
END AS customerName,
PROJECT_TOTAL AS reportCount,
DATE_ID,
(
SELECT
count(*) AS dataCount
FROM
screen_project_data
WHERE
1 = 1
AND customer_id = a.CUSTOMER_ID
AND DEL_FLAG = '0'
AND DATE_FORMAT( PROJECT_CREATE_TIME, '%Y%m%d' ) &lt;= DATE_ID
GROUP BY
CUSTOMER_ID
ORDER BY
CUSTOMER_ID
) AS count
FROM
epmet_data_statistical.fact_agency_project_daily a
WHERE
1 = 1
AND del_flag = '0'
AND customer_id IN ( '2fe0065f70ca0e23ce4c26fca5f1d933', '44876154d10d7cb7affd92000f84f833', '46c55cb862d6d5e6d05d2ab61a1cc07e' )
AND AGENCY_ID IN ( '1234085031077498881', '1215437824174608386', '1258587398679126017' )
<if test='null != dateId and "" != dateId'>
AND DATE_ID = #{dateId}
</if>
<if test='null != startDate and "" != startDate and null != endDate and "" != endDate'>
AND DATE_ID BETWEEN #{startDate} AND #{endDate}
</if>
GROUP BY
CUSTOMER_ID,
DATE_ID
HAVING
1 = 1
AND reportCount != count
ORDER BY
CUSTOMER_ID,
DATE_ID DESC
</select>
</mapper>

13
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml

@ -185,4 +185,17 @@
</if>
</select>
<select id="gridListByCustomerId" resultType="com.epmet.dto.stats.DimGridDTO">
SELECT
id id,
customer_id customerId,
pid agencyId,
grid_name gridName
FROM
customer_grid
WHERE
del_flag = 0
AND customer_id = #{customerId}
</select>
</mapper>

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@

11
epmet-user/epmet-user-client/src/main/java/com/epmet/constant/ImportTaskConstants.java → epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java

@ -1,13 +1,20 @@
package com.epmet.constant;
package com.epmet.constants;
/**
* 导入任务的业务类型常量
*/
public interface ImportTaskConstants {
/**
* 居民
* 业务类型居民
*/
String BIZ_TYPE_RESI = "resi";
String BIZ_TYPE_NEIGHBOR_HOOD = "neighborHood";
String BIZ_TYPE_BUILDING = "building";
String BIZ_TYPE_HOUSE = "house";
String BIZ_TYPE_PARTY_MEMBER = "party_member";
String BIZ_TYPE_COMMUNITY_SELF_ORG = "community_self_org";
String BIZ_TYPE_PARTY_UNIT = "party_unit";
String BIZ_TYPE_PARTY_ACTIVITY = "party_activity";
/**
* 处理状态处理中

55
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ImportTaskCommonFormDTO.java

@ -0,0 +1,55 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.validator.group.QueryGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class ImportTaskCommonFormDTO extends PageFormDTO {
public interface Create {}
public interface Finish {}
/**
* 原始文件名
*/
@NotBlank(message = "原始文件名必填", groups = { Create.class })
private String originFileName;
/**
* 操作者ID
*/
@NotBlank(message = "操作者ID必填", groups = { Create.class, Finish.class, QueryGroup.class})
private String operatorId;
/**
* 业务类型
*/
@NotBlank(message = "业务类型必填", groups = { Create.class })
private String bizType;
/**
* 任务ID
*/
@NotBlank(message = "任务ID必填", groups = { Finish.class })
private String taskId;
/**
* 处理状态
*/
@NotBlank(message = "处理状态必填", groups = { Finish.class })
private String processStatus;
/**
* 结果文件 url
*/
private String resultDescFilePath;
/**
* 结果描述文本
*/
private String resultDesc;
}

43
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/ImportTaskCommonResultDTO.java

@ -0,0 +1,43 @@
package com.epmet.dto.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
@Data
@NoArgsConstructor
public class ImportTaskCommonResultDTO implements Serializable {
public ImportTaskCommonResultDTO(String taskId) {
this.taskId = taskId;
}
private String taskId;
/**
* 原始文件名
*/
private String originFileName;
/**
* 业务类型resi:居民楼栋:building房屋:house依次补充
*/
private String bizType;
/**
* 处理状态processing:处理中finished:完成导入失败finished_fail
*/
private String processStatus;
/**
* 开始导入的时间
*/
private Date startTime;
/**
* 失败文件地址
*/
private String resultDescFile;
}

18
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java

@ -4,12 +4,12 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.fallback.EpmetCommonServiceOpenFeignClientFallback;
import com.epmet.feign.fallback.EpmetCommonServiceOpenFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.List;
import java.util.Map;
@ -124,4 +124,20 @@ public interface EpmetCommonServiceOpenFeignClient {
**/
@PostMapping(value = "commonservice/areacode/addareacode", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<String> addAreaCode(AddAreaCodeFormDTO formDTO);
/**
* 创建导入任务
* @param input
* @return
*/
@RequestMapping("/commonservice/import-task/create")
Result<ImportTaskCommonResultDTO> createImportTask(@RequestBody ImportTaskCommonFormDTO input);
/**
* 结束导入任务
* @param input
* @return
*/
@RequestMapping("/commonservice/import-task/finish")
Result finishImportTask(@RequestBody ImportTaskCommonFormDTO input);
}

10
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java

@ -111,4 +111,14 @@ public class EpmetCommonServiceOpenFeignClientFallback implements EpmetCommonSer
public Result<String> addAreaCode(AddAreaCodeFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "addAreaCode", formDTO);
}
@Override
public Result createImportTask(ImportTaskCommonFormDTO input) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "createImportTask", input);
}
@Override
public Result finishImportTask(ImportTaskCommonFormDTO input) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "finishImportTask", input);
}
}

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>

82
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ImportTaskController.java

@ -0,0 +1,82 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
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.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.QueryGroup;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.service.ImportTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("import-task")
public class ImportTaskController {
@Autowired
private ImportTaskService importTaskService;
/**
* desc:分页获取个人导入记录
* @param tokenDto
* @return
*/
@RequestMapping("page")
public Result<PageData<ImportTaskCommonResultDTO>> list(@LoginUser TokenDto tokenDto, @RequestBody ImportTaskCommonFormDTO param) {
//tokenDto.setUserId("d8dfc6c1fa2538976059f3900036d419");
param.setOperatorId(tokenDto.getUserId());
ValidatorUtils.validateEntity(param, QueryGroup.class);
return new Result().ok(importTaskService.page(param));
}
/**
* 创建导入任务
* @param input
* @return
*/
@RequestMapping("create")
public Result<ImportTaskCommonResultDTO> createTask(@RequestBody ImportTaskCommonFormDTO input) {
ValidatorUtils.validateEntity(input, ImportTaskCommonFormDTO.Create.class);
String operatorId = input.getOperatorId();
String bizType = input.getBizType();
String originFileName = input.getOriginFileName();
String taskId = importTaskService.createProcessTask(operatorId, bizType, originFileName);
ImportTaskCommonResultDTO ro = new ImportTaskCommonResultDTO(taskId);
return new Result().ok(ro);
}
/**
* 结束任务
* @param input
* @return
*/
@RequestMapping("finish")
public Result finishTask(@RequestBody ImportTaskCommonFormDTO input) {
ValidatorUtils.validateEntity(input, ImportTaskCommonFormDTO.Finish.class);
Boolean finished = importTaskService.finish(input.getTaskId(), input.getProcessStatus(), input.getOperatorId(), input.getResultDescFilePath(), input.getResultDesc());
if (!finished) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
"失败,请确认任务是否存在,以及是否已完成",
"失败,请确认任务是否存在,以及是否已完成");
}
return new Result();
}
/**
* 检查是否有正在执行的任务
* @param bizType 业务类型非必填不传则任意一种导入正在执行都会返回true
* @return
*/
@GetMapping("processing-check")
public Result processingTaskCheck(@RequestParam(value = "biz_type", required = false) String bizType) {
Boolean r = importTaskService.processingTaskCheck(bizType);
return new Result().ok(r);
}
}

0
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/ImportTaskDao.java → epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ImportTaskDao.java

11
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/ImportTaskEntity.java → epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/ImportTaskEntity.java

@ -1,7 +1,6 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -21,6 +20,16 @@ public class ImportTaskEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 原始文件名
*/
private String originFileName;
/**
* 业务类型resi:居民楼栋:building房屋:house依次补充
*/

54
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ImportTaskService.java

@ -0,0 +1,54 @@
package com.epmet.service;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
/**
*
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-02-15
*/
public interface ImportTaskService {
// /**
// * 检查指定类型该用户是否存在处理中的导入任务
// * @param operatorId 操作者ID
// * @param bizType 业务类型。resi:居民
// * @return
// */
// boolean existsProcessingTask(String operatorId, String bizType);
/**
* 创建处理任务
* @param operatorId
* @param bizType
* @param originFileName 原始文件名
*/
String createProcessTask(String operatorId, String bizType, String originFileName);
/**
* 结束导入
* @param taskId 任务id
* @param processStatus 处理状态
* @param resultDescFile 结果描述文件
* @param resultDesc 结果描述文本
*/
Boolean finish(String taskId, String processStatus, String operatorId, String resultDescFile, String resultDesc);
/**
* desc分页获取个人导入记录
* @param param
* @return
*/
PageData<ImportTaskCommonResultDTO> page(ImportTaskCommonFormDTO param);
/**
* 检查是否有正在执行的任务
* @param bizType
* @return
*/
Boolean processingTaskCheck(String bizType);
}

123
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ImportTaskServiceImpl.java

@ -0,0 +1,123 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.ImportTaskDao;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.entity.ImportTaskEntity;
import com.epmet.service.ImportTaskService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
*
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-02-15
*/
@Service
public class ImportTaskServiceImpl implements ImportTaskService {
@Autowired
private ImportTaskDao importRecordDao;
@Autowired
private LoginUserUtil loginUserUtil;
// /**
// * 该用户,该业务类型,是否有正在处理的导入任务
// * @param operatorId 操作者ID
// * @param bizType 业务类型。resi:居民
// * @return
// */
// @Override
// public boolean existsProcessingTask(String operatorId, String bizType) {
// LambdaQueryWrapper<ImportTaskEntity> query = new LambdaQueryWrapper<>();
// query.eq(ImportTaskEntity::getOperatorId, operatorId);
// query.eq(ImportTaskEntity::getBizType, bizType);
// query.eq(ImportTaskEntity::getProcessStatus, ImportTaskConstants.PROCESS_STATUS_PROCESSING);
//
// return importRecordDao.selectCount(query) > 0;
// }
/**
* 检查是否有正在执行的任务
* @param operatorId
* @param bizType
* @return
*/
public boolean existsProcessingTask(String operatorId, String bizType) {
LambdaQueryWrapper<ImportTaskEntity> query = new LambdaQueryWrapper<>();
query.eq(ImportTaskEntity::getOperatorId, operatorId);
query.eq(ImportTaskEntity::getBizType, bizType);
query.eq(ImportTaskEntity::getProcessStatus, ImportTaskConstants.PROCESS_STATUS_PROCESSING);
return importRecordDao.selectCount(query) > 0;
}
@Override
public String createProcessTask(String operatorId, String bizType, String originFileName) {
if (existsProcessingTask(operatorId, bizType)) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
"存在进行中的导入",
"存在进行中的导入");
}
ImportTaskEntity importRecord = new ImportTaskEntity();
importRecord.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_PROCESSING);
importRecord.setOperatorId(operatorId);
importRecord.setBizType(bizType);
importRecord.setCustomerId(loginUserUtil.getLoginUserCustomerId());
importRecord.setStartTime(new Date());
importRecord.setOriginFileName(originFileName);
importRecordDao.insert(importRecord);
return importRecord.getId();
}
@Override
public Boolean finish(String taskId, String processStatus, String operatorId, String resultDescFile, String resultDesc) {
return importRecordDao.finish(taskId, processStatus, operatorId, resultDesc, resultDescFile) > 0;
}
@Override
public PageData<ImportTaskCommonResultDTO> page(ImportTaskCommonFormDTO param) {
LambdaQueryWrapper<ImportTaskEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ImportTaskEntity::getOperatorId,param.getOperatorId())
.orderByDesc(ImportTaskEntity::getStartTime);
Page<ImportTaskEntity> page = PageHelper.startPage(param.getPageNo(), param.getPageSize(), param.isPage()).doSelectPage(() -> {
importRecordDao.selectList(queryWrapper);
});
List<ImportTaskCommonResultDTO> list = new ArrayList<>();
page.getResult().forEach(item->{
ImportTaskCommonResultDTO record = ConvertUtils.sourceToTarget(item, ImportTaskCommonResultDTO.class);
record.setTaskId(item.getId());
list.add(record);
});
return new PageData<>(list,page.getTotal());
}
@Override
public Boolean processingTaskCheck(String bizType) {
LambdaQueryWrapper<ImportTaskEntity> query = new LambdaQueryWrapper<>();
if (StringUtils.isNotBlank(bizType)) {
query.eq(ImportTaskEntity::getBizType, bizType);
}
query.eq(ImportTaskEntity::getProcessStatus, ImportTaskConstants.PROCESS_STATUS_PROCESSING);
return importRecordDao.selectCount(query) > 0;
}
}

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@

19
epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.12__createImportTask.sql

@ -0,0 +1,19 @@
CREATE TABLE `import_task` (
`ID` varchar(64) NOT NULL COMMENT 'ID',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`ORIGIN_FILE_NAME` varchar(128) NOT NULL COMMENT '原始文件名',
`BIZ_TYPE` varchar(32) NOT NULL COMMENT '业务类型。【resi:居民;neighborHood:小区;building:楼栋;house:房屋;party_member:党员;society_org:社会组织;community_self_org:社区自组织】依次补充',
`PROCESS_STATUS` varchar(32) NOT NULL COMMENT '处理状态。processing:处理中;finished_success:成功;finished_unsuccess:未完全成功',
`OPERATOR_ID` varchar(64) NOT NULL COMMENT '谁导入的',
`START_TIME` datetime NOT NULL COMMENT '开始导入的时间',
`RESULT_DESC_FILE` varchar(255) DEFAULT NULL COMMENT '导入失败结果描述文件',
`RESULT_DESC` varchar(255) DEFAULT NULL COMMENT '导入结果描述,可以输入任何描述信息',
`DEL_FLAG` tinyint(1) NOT NULL COMMENT '删除标识:0.未删除 1.已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(64) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4

1
epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.13__ImportTaskCommentModify.sql

@ -0,0 +1 @@
alter table import_task modify column PROCESS_STATUS varchar(32) comment '处理状态。processing:处理中;finished_success:成功;finished_fail:未完全成功'

1
epmet-user/epmet-user-server/src/main/resources/mapper/ImportTaskDao.xml → epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ImportTaskDao.xml

@ -5,6 +5,7 @@
<resultMap type="com.epmet.entity.ImportTaskEntity" id="importRecordMap">
<result property="id" column="ID"/>
<result property="originFileName" column="ORIGIN_FILE_NAME"/>
<result property="bizType" column="BIZ_TYPE"/>
<result property="processStatus" column="PROCESS_STATUS"/>
<result property="operatorId" column="OPERATOR_ID"/>

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@

85
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcActivityServiceRelationDTO.java

@ -0,0 +1,85 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 联建活动与服务事项关联表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-02-21
*/
@Data
public class IcActivityServiceRelationDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
* 组织的所有上级
*/
private String pids;
/**
* 活动ID
*/
private String activityId;
/**
* act_info表ID
*/
private String actId;
/**
* 服务事项
*/
private String serviceMatter;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

89
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcActivityUnitRelationDTO.java

@ -0,0 +1,89 @@
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 联建活动与单位关联表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-02-21
*/
@Data
public class IcActivityUnitRelationDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
* 组织的所有上级
*/
private String pids;
/**
* 活动ID
*/
private String activityId;
/**
* act_info表ID
*/
private String actId;
/**
* 单位ID
*/
private String unitId;
/**
* 服务事项
*/
private String serviceMatter;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

30
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java

@ -19,12 +19,15 @@ package com.epmet.dto;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
@ -46,35 +49,44 @@ public class IcPartyActivityDTO implements Serializable {
/**
* 客户id
*/
@JsonIgnore
private String customerId;
/**
* 组织ID
*/
@JsonIgnore
private String agencyId;
/**
* 组织的所有上级
*/
@JsonIgnore
private String pids;
/**
* act_info表ID
*/
@JsonIgnore
private String actId;
private String unitId;
private String unitName;
/**
* 单位ID
*/
@NotBlank(message = "单位不能为空",groups = AddGroup.class)
private String unitId;
private String unitName;
@NotEmpty(message = "单位不能为空",groups = AddGroup.class)
private List<String> unitIdList;
private List<String> unitNameList;
private String serviceMatter;
private String serviceMatterName;
/**
* 服务事项
*/
@NotBlank(message = "服务事项不能为空",groups = AddGroup.class)
private String serviceMatter;
private String serviceMatterName;
@NotEmpty(message = "服务事项不能为空",groups = AddGroup.class)
private List<String> serviceMatterList;
private List<String> serviceMatterNameList;
/**
* 活动标题
*/
@ -131,31 +143,37 @@ public class IcPartyActivityDTO implements Serializable {
/**
* 删除标识 0未删除1已删除
*/
@JsonIgnore
private String delFlag;
/**
* 乐观锁
*/
@JsonIgnore
private Integer revision;
/**
* 创建人
*/
@JsonIgnore
private String createdBy;
/**
* 创建时间
*/
@JsonIgnore
private Date createdTime;
/**
* 更新人
*/
@JsonIgnore
private String updatedBy;
/**
* 更新时间
*/
@JsonIgnore
private Date updatedTime;
}

79
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActServiceRelationDTO.java

@ -0,0 +1,79 @@
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 联建活动与服务事项关联表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-02-21
*/
@Data
public class LatestActServiceRelationDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
* 组织的所有上级
*/
private String pids;
/**
* latest_act_info表ID
*/
private String actId;
/**
* 服务事项
*/
private String serviceMatter;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

84
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActUnitRelationDTO.java

@ -0,0 +1,84 @@
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 联建活动与单位关联表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-02-21
*/
@Data
public class LatestActUnitRelationDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
* 组织的所有上级
*/
private String pids;
/**
* latest_act_info表ID
*/
private String actId;
/**
* 单位ID
*/
private String unitId;
/**
* 服务事项
*/
private String serviceMatter;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

3
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java

@ -170,7 +170,7 @@ public class DraftActInfoFormDTO implements Serializable {
* 联建单位
*/
private String unitId;
private List<String> unitIdList;
/**
* 活动目标
*/
@ -180,5 +180,6 @@ public class DraftActInfoFormDTO implements Serializable {
* 服务事项
*/
private String serviceMatter;
private List<String> serviceMatterList;
}

12
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java

@ -5,10 +5,7 @@ import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
@ -200,9 +197,9 @@ public class PublishActInfoFormDTO implements Serializable {
/**
* 联建单位
*/
@NotBlank(message = "联建单位不能为空", groups = {AddPartyActivityGroup.class})
private String unitId;
@NotEmpty(message = "联建单位不能为空", groups = {AddPartyActivityGroup.class})
private List<String> unitIdList;
/**
* 活动目标
*/
@ -212,6 +209,7 @@ public class PublishActInfoFormDTO implements Serializable {
/**
* 服务事项
*/
@NotBlank(message = "服务事项不能为空", groups = {AddPartyActivityGroup.class})
private String serviceMatter;
@NotEmpty(message = "服务事项不能为空", groups = {AddPartyActivityGroup.class})
private List<String> serviceMatterList;
}

11
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java

@ -5,10 +5,7 @@ import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
@ -206,8 +203,9 @@ public class RePublishFormDTO implements Serializable {
/**
* 联建单位
*/
@NotBlank(message = "联建单位不能为空", groups = {AddPartyActivityGroup.class})
private String unitId;
@NotEmpty(message = "联建单位不能为空", groups = {PublishActInfoFormDTO.AddPartyActivityGroup.class})
private List<String> unitIdList;
/**
* 活动目标
@ -218,6 +216,7 @@ public class RePublishFormDTO implements Serializable {
/**
* 服务事项
*/
@NotBlank(message = "服务事项不能为空", groups = {AddPartyActivityGroup.class})
private String serviceMatter;
@NotEmpty(message = "服务事项不能为空", groups = {PublishActInfoFormDTO.AddPartyActivityGroup.class})
private List<String> serviceMatterList;
}

4
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java

@ -186,6 +186,8 @@ public class ResiActDetailResultDTO implements Serializable {
*/
private String unitId;
private String unitName;
private List<String> unitIdList;
private List<String> unitNameList;
/**
* 活动目标
*/
@ -196,4 +198,6 @@ public class ResiActDetailResultDTO implements Serializable {
*/
private String serviceMatter;
private String serviceMatterName;
private List<String> serviceMatterList;
private List<String> serviceMatterNameList;
}

12
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java

@ -1,6 +1,7 @@
package com.epmet.dto.result.work;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
@ -74,7 +75,12 @@ public class ActPreviewResultDTO implements Serializable {
* 主办方名称
*/
private String sponsorName;
@JsonIgnore
private String sponsorType;
@JsonIgnore
private String sponsorId;
@JsonIgnore
private String pid;
/**
* 联系人
*/
@ -100,6 +106,8 @@ public class ActPreviewResultDTO implements Serializable {
*/
private String unitId;
private String unitName;
private List<String> unitIdList;
private List<String> unitNameList;
/**
* 活动目标
*/
@ -110,4 +118,6 @@ public class ActPreviewResultDTO implements Serializable {
*/
private String serviceMatter;
private String serviceMatterName;
private List<String> serviceMatterList;
private List<String> serviceMatterNameList;
}

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

Loading…
Cancel
Save