Browse Source

Merge remote-tracking branch 'origin/dev_resi_header_customerid' into dev_areaCode

dev
yinzuomei 5 years ago
parent
commit
c12821a47b
  1. 5
      epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java
  2. 21
      epmet-commons/epmet-commons-rocketmq/pom.xml
  3. 21
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java
  4. 5
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java
  5. 148
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/InitCustomerMQMsg.java
  6. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  7. 35
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/VideoScanParamDTO.java
  8. 32
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/VideoTaskDTO.java
  9. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/AsyncScanResult.java
  10. 47
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/VideoAsyncScanResultDTO.java
  11. 56
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/VideoScanDetailDTO.java
  12. 88
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java
  13. 1
      epmet-commons/pom.xml
  14. 2
      epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java
  15. 8
      epmet-module/data-aggregator/data-aggregator-server/pom.xml
  16. 3
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java
  17. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml
  18. 28
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml
  19. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AdvanceBranchRankResultDTO.java
  20. 9
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/FineExampleResultDTO.java
  21. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityRankResultDTO.java
  22. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityResultDTO.java
  23. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/OrgRankDataResultDTO.java
  24. 2
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiRankResultDTO.java
  25. 6
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsGovernMonthlyDao.java
  26. 6
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsOrgMonthlyDao.java
  27. 6
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.java
  28. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
  29. 24
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AnScreenServiceImpl.java
  30. 1
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java
  31. 1
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java
  32. 3
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml
  33. 3
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml
  34. 24
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml
  35. 41
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml
  36. 1
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml
  37. 3
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml
  38. 6
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml
  39. 35
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml
  40. 43
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsGovernMonthlyDao.xml
  41. 37
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsOrgMonthlyDao.xml
  42. 49
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.xml
  43. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  44. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java
  45. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java
  46. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java
  47. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java
  48. 37
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java
  49. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java
  50. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java
  51. 35
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java
  52. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java
  53. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java
  54. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java
  55. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java
  56. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java
  57. 43
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java
  58. 170
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java
  59. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java
  60. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java
  61. 6
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml
  62. 24
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml
  63. 9
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml
  64. 18
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml
  65. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml
  66. 8
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml
  67. 15
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml
  68. 2
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/constant/AreaCodeConstant.java
  69. 2
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java
  70. 6
      epmet-module/epmet-job/epmet-job-server/pom.xml
  71. 12
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/TopicAutoAuditService.java
  72. 24
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/TopicAutoAuditServiceImpl.java
  73. 31
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/TopicAutoAuditTask.java
  74. 10
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SmsTemplateConstant.java
  75. 19
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SysSmsConstant.java
  76. 7
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageSendApproach.java
  77. 13
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java
  78. 88
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/WxmpMessageConstant.java
  79. 111
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpUpdateSendDataDTO.java
  80. 131
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpUpdateSendRecordDTO.java
  81. 43
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/ProjectSendMsgFormDTO.java
  82. 15
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SystemMsgFormDTO.java
  83. 86
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/WxSubscribeUpdateFormDTO.java
  84. 29
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java
  85. 18
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java
  86. 29
      epmet-module/epmet-message/epmet-message-server/pom.xml
  87. 63
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/constant/WxmpMessageConstant.java
  88. 17
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SmsController.java
  89. 27
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SystemMessageController.java
  90. 40
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpMessageController.java
  91. 98
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpUpdateSendDataController.java
  92. 94
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpUpdateSendRecordController.java
  93. 33
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/SystemMessageDao.java
  94. 33
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpUpdateSendDataDao.java
  95. 33
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpUpdateSendRecordDao.java
  96. 57
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/SystemMessageEntity.java
  97. 81
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/WxmpUpdateSendDataEntity.java
  98. 101
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/WxmpUpdateSendRecordEntity.java
  99. 80
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/WxmpUpdateSendDataExcel.java
  100. 92
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/WxmpUpdateSendRecordExcel.java

5
epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java

@ -86,7 +86,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService {
String token = this.generateToken(formDTO, userId);
//4.存放Redis
this.saveTokenDto(formDTO, userId, userWechatDTO, token);
this.saveTokenDto(formDTO, userId, userWechatDTO, token, userWechatDTO.getCustomerId());
//5.接口返参
UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO();
@ -111,9 +111,10 @@ public class ThirdLoginServiceImpl implements ThirdLoginService {
/**
* @Description 将token存入redis
**/
private String saveTokenDto(LoginCommonFormDTO formDTO, String userId, UserWechatDTO userWechatDTO, String token) {
private String saveTokenDto(LoginCommonFormDTO formDTO, String userId, UserWechatDTO userWechatDTO, String token, String customerId) {
int expire = jwtTokenProperties.getExpire();
TokenDto tokenDto = new TokenDto();
tokenDto.setCustomerId(customerId);
tokenDto.setApp(formDTO.getApp());
tokenDto.setClient(formDTO.getClient());
tokenDto.setUserId(userId);

21
epmet-commons/epmet-commons-rocketmq/pom.xml

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>epmet-commons</artifactId>
<groupId>com.epmet</groupId>
<version>2.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>epmet-commons-rocketmq</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-spring-boot-starter</artifactId>
<version>2.1.1</version>
</dependency>
</dependencies>
</project>

21
epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java

@ -0,0 +1,21 @@
package com.epmet.commons.rocketmq.constants;
/**
* 消费者组常量
*/
public interface ConsomerGroupConstants {
/**
* 初始化客户角色消费者组
*/
String INIT_CUSTOMER_ROLES_GROUP = "init_customer_roles_group";
/**
* 初始化客户自定义消费者组
*/
String INIT_CUSTOMER_CUSTOMIZE_GROUP = "init_customer_customize_group";
/**
* 初始化客户组织机构信息分组
*/
String INIT_CUSTOMER_ORG_GROUP = "init_customer_org_group";
}

5
epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java

@ -0,0 +1,5 @@
package com.epmet.commons.rocketmq.constants;
public interface TopicConstants {
String INIT_CUSTOMER = "init_customer_topic";
}

148
epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/InitCustomerMQMsg.java

@ -0,0 +1,148 @@
package com.epmet.commons.rocketmq.messages;
public class InitCustomerMQMsg {
private String customerId;
private InitCustomerAgency agency;
private InitCustomerStaff staff;
public static class InitCustomerStaff {
private String agencyId;
private Integer gender;
private String mobile;
private String name;
private String workType;
public String getAgencyId() {
return agencyId;
}
public void setAgencyId(String agencyId) {
this.agencyId = agencyId;
}
public Integer getGender() {
return gender;
}
public void setGender(Integer gender) {
this.gender = gender;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getWorkType() {
return workType;
}
public void setWorkType(String workType) {
this.workType = workType;
}
}
public static class InitCustomerAgency {
private String agencyId;
private String organizationName;
private String level;
private String areaCode;
private String province;
private String city;
private String district;
public String getAgencyId() {
return agencyId;
}
public void setAgencyId(String agencyId) {
this.agencyId = agencyId;
}
public String getOrganizationName() {
return organizationName;
}
public void setOrganizationName(String organizationName) {
this.organizationName = organizationName;
}
public String getLevel() {
return level;
}
public void setLevel(String level) {
this.level = level;
}
public String getAreaCode() {
return areaCode;
}
public void setAreaCode(String areaCode) {
this.areaCode = areaCode;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getDistrict() {
return district;
}
public void setDistrict(String district) {
this.district = district;
}
}
public String getCustomerId() {
return customerId;
}
public void setCustomerId(String customerId) {
this.customerId = customerId;
}
public InitCustomerAgency getAgency() {
return agency;
}
public void setAgency(InitCustomerAgency agency) {
this.agency = agency;
}
public InitCustomerStaff getStaff() {
return staff;
}
public void setStaff(InitCustomerStaff staff) {
this.staff = staff;
}
}

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -20,6 +20,7 @@ public enum EpmetErrorCode {
ERR10006(10006, "登录超时,请重新登录"),
ERR10007(10007, "当前帐号已在别处登录"),
ERR10019(10019, "验证码不正确"),
SYSTEM_MQ_MSG_SEND_FAIL(10020, "MQ消息发送失败"),
ERR401(401, "未授权"),
INTERNAL_VALIDATE_ERROR(7000, "内部数据校验异常"),
SERVER_ERROR(8000, "服务器开小差了..."),

35
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/VideoScanParamDTO.java

@ -0,0 +1,35 @@
package com.epmet.commons.tools.scan.param;
import lombok.Data;
import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* 异步检测请求参数
*
* @author yinzuomei@elink-cn.com
* @date 2021/1/10 21:05
*/
@Data
public class VideoScanParamDTO implements Serializable {
private static final long serialVersionUID = -7261993744367287072L;
/**
* 是否开启回调
*/
@NotNull(message = "openCallBack必填,true开启;false不开启")
private Boolean openCallBack;
/**
* 异步检测结果回调地址,执行异步审查内容时 必填
* openCallBack=true时,callback必填
*/
private String callback;
@Valid
@NotEmpty(message = "任务列表不能为空")
private List<VideoTaskDTO> tasks;
}

32
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/VideoTaskDTO.java

@ -0,0 +1,32 @@
package com.epmet.commons.tools.scan.param;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 异步检测请求参数
*
* @author yinzuomei@elink-cn.com
* @date 2021/1/10 21:06
*/
@Data
public class VideoTaskDTO implements Serializable {
private static final long serialVersionUID = -5268462578193403270L;
/**
* 不必填
* 要检测的数据id 非必填
* 检测对象对应的数据ID
* 由大小写英文字母数字下划线_短划线-英文句号.组成不超过128个字符可以用于唯一标识您的业务数据
* */
@NotBlank(message = "dataId不能为空")
private String dataId;
/**
* 必填
* 待检测视频的URL该字段不能和frames同时为空也不能和frames同时有值
*/
@NotBlank(message = "音频URL不能为空")
private String url;
}

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/AsyncScanResult.java

@ -8,7 +8,7 @@ import java.util.List;
/**
* 语音异步检测 返参
*
* 视频异步检测 返参通用
* @author yinzuomei@elink-cn.com
* @date 2020/12/18 10:09
*/

47
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/VideoAsyncScanResultDTO.java

@ -0,0 +1,47 @@
package com.epmet.commons.tools.scan.result;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* 视频异步检测结果查询接口返参
* 正在检测中的不返回,调用方继续轮询查询结果
* @author yinzuomei@elink-cn.com
* @date 2020/12/29 15:37
*/
@Data
public class VideoAsyncScanResultDTO implements Serializable {
private static final long serialVersionUID = -7302168989456734818L;
/**
* 执行成功的任务Id集合
* code=200,且所有语音+视频所有场景返回结果都为pass时则为成功
*/
private List<String> passDataIds = new ArrayList<>();
/**
* 执行失败的任务Id集合
*/
private List<String> noPassDataIds = new ArrayList<>();
private List<String> passTaskIds = new ArrayList<>();
private List<String> noPassTaskIds = new ArrayList<>();
/**
* desc:阿里内容审核API返回结果详情
*/
private List<VideoScanDetailDTO> details = new ArrayList<>();
/**
* 本地是否全部通过
*/
private Boolean isAllPass;
public boolean isAllPass() {
if (noPassTaskIds.isEmpty() && !passTaskIds.isEmpty()) {
return true;
}
return isAllPass;
}
}

56
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/VideoScanDetailDTO.java

@ -0,0 +1,56 @@
package com.epmet.commons.tools.scan.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
*
* @author yinzuomei@elink-cn.com
* @date 2021/1/10 21:24
*/
@Data
public class VideoScanDetailDTO implements Serializable {
/**
* 错误码和HTTP状态码一致
* 更多信息请参见公共错误码
*/
private Integer code;
private String codeDesc;
/**
* 错误描述信息
*/
private String msg;
/**
* 检测对象对应的数据ID
*/
private String dataId;
/**
* 检测任务的ID
*/
private String taskId;
/**
* 返回结果调用成功时code=200返回结果中包含一个或多个元素每个元素是个结构体具体结构描述请参见result
* 说明 视频流检测场景中code返回280表示在检测中返回200表示检测完成在检测中状态时检测结果中包含从开始检测到当前时间的检测到结果
*/
private List<ResultDetail> results;
/**
* 视频语音检测结果具体结构描述请参见audioScanResult
*/
private List<ResultDetail> audioScanResults;
@Data
public static class ResultDetail {
private String scene;
private String label;
private String suggestion;
private Float rate;
}
}

88
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java

@ -8,6 +8,7 @@ import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.scan.param.*;
import com.epmet.commons.tools.scan.result.AsyncScanResult;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.scan.result.VideoAsyncScanResultDTO;
import com.epmet.commons.tools.scan.result.VoiceResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@ -136,6 +137,65 @@ public class ScanContentUtils {
}
}
/**
* @param url 视频地址
* @param param
* @author yinzuomei
* @description 异步检测-提交检测任务
**/
public static Result<AsyncScanResult> videoAsyncScan(String url, VideoScanParamDTO param){
log.debug("videoAsyncScan param:{}", JSON.toJSONString(param));
if (StringUtils.isBlank(url) || param == null) {
throw new RenException("参数错误");
}
if (param.getOpenCallBack() && StringUtils.isBlank(param.getCallback())) {
throw new RenException("参数错误,开启回调,callback必填");
}
try {
Result<String> result = HttpClientManager.getInstance().sendPostByJSON(url, JSON.toJSONString(param));
log.debug("videoAsyncScan result:{}", JSON.toJSONString(result));
if (result.success()) {
return JSON.parseObject(result.getData(),new TypeReference<Result<AsyncScanResult>>(){});
}
Result<AsyncScanResult> resultResult = new Result<>();
resultResult.error(result.getCode(),result.getMsg());
resultResult.setInternalMsg(result.getInternalMsg());
return resultResult;
} catch (Exception e) {
log.error("videoAsyncScan exception:", e);
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage());
}
}
/**
* @param url
* @param taskIds
* @author yinzuomei
* @description 查询视频检测结果
**/
public static Result<VideoAsyncScanResultDTO> videoResults(String url, List<String> taskIds) {
if (StringUtils.isBlank(url) || CollectionUtils.isEmpty(taskIds)) {
throw new RenException("参数错误");
}
if (taskIds.size() > NumConstant.ONE_HUNDRED) {
throw new RenException("参数错误,查询检测任务最大不能超过100");
}
try {
Result<String> result = HttpClientManager.getInstance().sendPostByJSON(url, JSON.toJSONString(taskIds));
log.debug("videoResults result:{}", JSON.toJSONString(result));
if (result.success()) {
return JSON.parseObject(result.getData(), new TypeReference<Result<VideoAsyncScanResultDTO>>() {
});
}
Result<VideoAsyncScanResultDTO> resultResult = new Result<>();
resultResult.error(result.getCode(), result.getMsg());
resultResult.setInternalMsg(result.getInternalMsg());
return resultResult;
} catch (Exception e) {
log.error("voiceResults exception:", e);
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage());
}
}
public static void main(String[] args) {
//测试文本检测
@ -143,7 +203,11 @@ public class ScanContentUtils {
//测试语音检测
// testVoiceAsyncScan();
//语音检测结果
testVoiceResults();
// testVoiceResults();
//视频检测任务提交
// testVideoAsyncScan();
//查询视频检测结果
testVideoResults();
}
public static void testTextSyncScan(){
@ -200,4 +264,26 @@ public class ScanContentUtils {
Result<List<VoiceResultDTO>> asyncScanResultResult = ScanContentUtils.voiceResults(url, taskIds);
System.out.println("================" + JSON.toJSONString(asyncScanResultResult));
}
public static void testVideoAsyncScan(){
String url = "http://localhost:8107/epmetscan/api/videoAsyncScan";
VideoTaskDTO p = new VideoTaskDTO();
p.setDataId("1");
p.setUrl("https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20210111/e996a68b9f0144a3843666c430f73086.mp4");
List<VideoTaskDTO> list = new ArrayList<>();
list.add(p);
VideoScanParamDTO param = new VideoScanParamDTO();
param.setTasks(list);
param.setOpenCallBack(false);
Result<AsyncScanResult> asyncScanResultResult = ScanContentUtils.videoAsyncScan(url, param);
System.out.println(JSON.toJSONString(asyncScanResultResult));
}
public static void testVideoResults(){
String url = "http://localhost:8107/epmetscan/api/videoResults";
List<String> taskIds=new ArrayList<>();
taskIds.add("vi6ZatqnJEkqf5m@FZ7Ka0AU-1tKYdk");
Result<VideoAsyncScanResultDTO> result = ScanContentUtils.videoResults(url, taskIds);
System.out.println("================" + JSON.toJSONString(result));
}
}

1
epmet-commons/pom.xml

@ -23,6 +23,7 @@
<module>epmet-commons-tools-wx-mp</module>
<module>epmet-commons-service-call</module>
<module>epmet-commons-extapp-auth</module>
<module>epmet-commons-rocketmq</module>
</modules>
</project>

2
epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java

@ -111,7 +111,7 @@ public class InternalAuthProcessor extends AuthProcessor {
.header(AppClientConstant.CLIENT,baseTokenDto.getClient())
.header(AppClientConstant.USER_ID,baseTokenDto.getUserId());
if (StringUtils.equals(baseTokenDto.getApp(), "gov")) {//工作端
if (StringUtils.equalsAny(baseTokenDto.getApp(), AppClientConstant.APP_GOV, AppClientConstant.APP_RESI)) {//工作端/居民
if(StringUtils.isNotBlank(customerId)){
exchange.getRequest().mutate().header(AppClientConstant.CUSTOMER_ID, customerId);
}

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

@ -318,28 +318,28 @@
<!-- govissue -->
<datasource.druid.govissue.url>
<![CDATA[jdbc:mysql://rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306/epmet_gov_issue?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
<![CDATA[jdbc:mysql://rm-m5e3vzs2637224wj9.mysql.rds.aliyuncs.com:3306/epmet_gov_issue?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.govissue.url>
<datasource.druid.govissue.username>epmet_gov_issue_user</datasource.druid.govissue.username>
<datasource.druid.govissue.password>EpmEt-db-UsEr</datasource.druid.govissue.password>
<!-- gov-project -->
<datasource.druid.govproject.url>
<![CDATA[jdbc:mysql://rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306/epmet_gov_project?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
<![CDATA[jdbc:mysql://rm-m5e3vzs2637224wj9.mysql.rds.aliyuncs.com:3306/epmet_gov_project?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.govproject.url>
<datasource.druid.govproject.username>epmet_gov_project_user</datasource.druid.govproject.username>
<datasource.druid.govproject.password>EpmEt-db-UsEr</datasource.druid.govproject.password>
<!-- resi-group -->
<datasource.druid.resigroup.url>
<![CDATA[jdbc:mysql://rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306/epmet_resi_group?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
<![CDATA[jdbc:mysql://rm-m5e3vzs2637224wj9.mysql.rds.aliyuncs.com:3306/epmet_resi_group?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.resigroup.url>
<datasource.druid.resigroup.username>epmet_resi_group_user</datasource.druid.resigroup.username>
<datasource.druid.resigroup.password>EpmEt-db-UsEr</datasource.druid.resigroup.password>
<!-- epmet-user -->
<datasource.druid.epmetuser.url>
<![CDATA[jdbc:mysql://rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306/epmet_user?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
<![CDATA[jdbc:mysql://rm-m5e3vzs2637224wj9.mysql.rds.aliyuncs.com:3306/epmet_user?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.epmetuser.url>
<datasource.druid.epmetuser.username>epmet_user_user</datasource.druid.epmetuser.username>
<datasource.druid.epmetuser.password>EpmEt-db-UsEr</datasource.druid.epmetuser.password>

3
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java

@ -280,8 +280,7 @@ public class GovIssueServiceImpl implements GovIssueService {
shiftProject.setStatus(project.getStatus());
return shiftProject;
})).collect(Collectors.toList());
List<ShiftProjectIssueListResultDTO> result = resultList.stream().sorted(Comparator.comparing(ShiftProjectIssueListResultDTO::getCount, Comparator.reverseOrder()).thenComparing(ShiftProjectIssueListResultDTO::getShiftedTime, Comparator.reverseOrder())).collect(Collectors.toList());
return result;
return resultList;
}
/**

2
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml

@ -75,7 +75,7 @@
AND i.issue_status = 'shift_project'
AND i.org_id_path like concat('%', #{agencyId}, '%')
ORDER BY
count DESC, i.created_time ASC
count DESC, i.shifted_time DESC
LIMIT #{pageNo}, #{pageSize}
</select>

28
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml

@ -40,19 +40,19 @@
<!-- 查询项目信息 -->
<select id="selectProjectInfoClosed" resultType="com.epmet.dataaggre.dto.govissue.result.IssueListResultDTO">
SELECT
p.ID AS projectId,
p.ORIGIN_ID AS issueId,
p.`STATUS`,
pp.PUBLIC_REPLY AS closedReason,
UNIX_TIMESTAMP( p.UPDATED_TIME ) AS operationTime
p.ID AS projectId,
p.ORIGIN_ID AS issueId,
p.`STATUS`,
pp.PUBLIC_REPLY AS closedReason,
UNIX_TIMESTAMP( p.UPDATED_TIME ) AS operationTime
FROM project p
LEFT JOIN project_process pp ON pp.PROJECT_ID = p.ID AND pp.OPERATION = 'close'
WHERE p.DEL_FLAG = '0'
AND pp.DEL_FLAG = '0'
AND
<foreach collection="issueIds" item="issueId" separator=" OR ">
p.ORIGIN_ID = #{issueId}
</foreach>
AND pp.DEL_FLAG = '0'
AND(
<foreach collection="issueIds" item="issueId" separator=" OR ">
p.ORIGIN_ID = #{issueId}
</foreach>)
</select>
<!-- 查询项目信息【处理中】 -->
@ -79,10 +79,10 @@
AND ps.DEL_FLAG = '0'
AND p.`STATUS` = 'pending'
AND ps.IS_HANDLE = 'unhandled'
AND
AND(
<foreach collection="issueIds" item="issueId" separator=" OR ">
p.ORIGIN_ID = #{issueId}
</foreach>
p.ORIGIN_ID = #{issueId}
</foreach>)
</select>
<select id="selectShiftProjectList" resultType="com.epmet.dataaggre.dto.govproject.ProjectDTO">
@ -108,7 +108,7 @@
p.origin_id = #{issueId}
</foreach>
ORDER BY
p.created_time ASC
p.created_time DESC
</select>
<select id="selectDepartmentNameList" resultType="java.lang.String">

5
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AdvanceBranchRankResultDTO.java

@ -50,4 +50,9 @@ public class AdvanceBranchRankResultDTO implements Serializable {
* */
private Integer projectNum;
/**
* 当前name的上级组织名称 2021-01-11新增
*/
private String parentAgencyName;
}

9
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/FineExampleResultDTO.java

@ -78,4 +78,13 @@ public class FineExampleResultDTO implements Serializable {
* 党员发布议题数占比
*/
private String publishIssueRatio = "0.00%";
/**
* 01.12新增PLAT_ISSUE_TOTAL 平台参与议事总数
*/
private Integer platIssueTotal;
/**
* PLAT_JOIN PARTY_RATIO 平台参与议事的党员占比
*/
private String platJoinPartyRatio = "0.00%";
}

5
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityRankResultDTO.java

@ -39,4 +39,9 @@ public class GovernCapacityRankResultDTO implements Serializable {
* 满意率
* */
private String satisfactionRatio;
/**
* 当前agencyName的上一级组织名称
*/
private String parentAgencyName;
}

5
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityResultDTO.java

@ -39,4 +39,9 @@ public class GovernCapacityResultDTO implements Serializable {
* 满意率
* */
private BigDecimal satisfactionRatio;
/**
* 当前agencyName的上一级组织名称
*/
private String parentAgencyName;
}

5
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/OrgRankDataResultDTO.java

@ -51,4 +51,9 @@ public class OrgRankDataResultDTO implements Serializable {
* */
private Integer projectNum;
/**
* 当前name的上级组织名称 2021-01-11新增
*/
private String parentAgencyName;
}

2
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiRankResultDTO.java

@ -25,4 +25,6 @@ public class PublicPartiRankResultDTO implements Serializable {
private Integer issueNum;
private Integer projectNum;
private String parentAgencyName;
}

6
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsGovernMonthlyDao.java

@ -48,12 +48,12 @@ public interface ScreenAnGrassRootsGovernMonthlyDao {
* 基层治理-指标月度趋势
*
* @param agencyId
* @param yearId
* @param curDate
* @return java.util.List<com.epmet.evaluationindex.screen.dto.result.GrassRootsGovernTrendDTO>
* @author zhaoqifeng
* @date 2020/10/9 16:49
*/
List<GrassRootsGovernTrendDTO> selectGrassRootsGovernTrend(@Param("agencyId") String agencyId, @Param("yearId") String yearId);
List<GrassRootsGovernTrendDTO> selectGrassRootsGovernTrend(@Param("agencyId") String agencyId, @Param("curDate") String curDate);
/**
* 基层治理-治理排行
@ -66,4 +66,4 @@ public interface ScreenAnGrassRootsGovernMonthlyDao {
*/
List<GrassRootsGovernRankResultDTO> selectGrassRootsGovernRank(@Param("agencyId") String agencyId, @Param("monthId") String monthId);
}
}

6
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsOrgMonthlyDao.java

@ -49,12 +49,12 @@ public interface ScreenAnGrassRootsOrgMonthlyDao {
* 基层组织-指标月度趋势
*
* @param agencyId
* @param yearId
* @param curDate
* @return java.util.List<com.epmet.evaluationindex.screen.dto.result.GrassRootsOrgTrendDTO>
* @author zhaoqifeng
* @date 2020/10/9 16:32
*/
List<GrassRootsOrgTrendDTO> selectGrassRootsOrgTrend(@Param("agencyId") String agencyId, @Param("yearId") String yearId);
List<GrassRootsOrgTrendDTO> selectGrassRootsOrgTrend(@Param("agencyId") String agencyId, @Param("curDate") String curDate);
/**
* 基层组织-组织排行榜单
@ -67,4 +67,4 @@ public interface ScreenAnGrassRootsOrgMonthlyDao {
*/
List<GrassRootsOrgRankResultDTO> selectGrassRootsOrgRank(@Param("agencyId") String agencyId, @Param("monthId") String monthId);
}
}

6
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.java

@ -47,12 +47,12 @@ public interface ScreenAnGrassRootsPmTotalMonthlyDao {
* 基层党员-指标月度趋势
*
* @param agencyId
* @param monthId
* @param curDate
* @return java.util.List<com.epmet.evaluationindex.screen.dto.result.PmTotalTrendDTO>
* @author zhaoqifeng
* @date 2020/10/9 15:12
*/
List<PmTotalTrendDTO> selectPmTotalTrend(@Param("agencyId") String agencyId, @Param("monthId") String monthId);
List<PmTotalTrendDTO> selectPmTotalTrend(@Param("agencyId") String agencyId, @Param("curDate") String curDate);
}
}

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java

@ -241,7 +241,7 @@ public class AgencyServiceImpl implements AgencyService {
public List<AreaCodeDictResultDTO> areaCodeDictTree(AreaCodeDictFormDTO formDTO) {
Result<List<AreaCodeDictResultDTO>> listResult = commonServiceOpenFeignClient.areaCodeDictTree(formDTO);
if (!listResult.success()){
throw new RenException(ScreenConstant.GET_AREA_TREE_FAILURE);
throw new RenException(listResult.getInternalMsg());
}
if (!CollectionUtils.isEmpty(listResult.getData())){
return listResult.getData();

24
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AnScreenServiceImpl.java

@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@ -38,6 +39,8 @@ public class AnScreenServiceImpl implements AnScreenService {
private ScreenAnGrassRootsGovernMonthlyDao screenAnGrassRootsGovernMonthlyDao;
@Autowired
private ScreenAnCommunityProjectProfileDao screenAnCommunityProjectProfileDao;
@Autowired
private PartyMemberLeadServiceImpl partyMemberLeadServiceImpl;
/**
* 基层党员-各类总数
@ -65,7 +68,10 @@ public class AnScreenServiceImpl implements AnScreenService {
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
public PmTotalTrendResultDTO pmTotalTrend(AnScreenTrendFormDTO formDTO) {
PmTotalTrendResultDTO resultDTO = new PmTotalTrendResultDTO();
List<PmTotalTrendDTO> list = screenAnGrassRootsPmTotalMonthlyDao.selectPmTotalTrend(formDTO.getAgencyId(), formDTO.getMonthId());
String monthId = StringUtils.isNotBlank(formDTO.getMonthId()) ? formDTO.getMonthId() : DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMM);
String curDate = monthId.substring(0, 4) + "-" + monthId.substring(4, 6) + "-" + "01";
// 查询近一年的指数值【包括本月】
List<PmTotalTrendDTO> list = screenAnGrassRootsPmTotalMonthlyDao.selectPmTotalTrend(formDTO.getAgencyId(), curDate);
List<String> xAxis = list.stream().map(item -> getMonth(item.getMonthId())).collect(Collectors.toList());
List<Integer> groupMemberTotalList = list.stream().map(PmTotalTrendDTO::getGroupMemberTotal).collect(Collectors.toList());
List<Integer> topicTotalList = list.stream().map(PmTotalTrendDTO::getTopicTotal).collect(Collectors.toList());
@ -123,9 +129,12 @@ public class AnScreenServiceImpl implements AnScreenService {
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
public GrassRootsOrgTrendResultDTO grassRootsOrgTrend(AnScreenTrendFormDTO formDTO) {
GrassRootsOrgTrendResultDTO resultDTO = new GrassRootsOrgTrendResultDTO();
String yearId = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYY);
List<GrassRootsOrgTrendDTO> list = screenAnGrassRootsOrgMonthlyDao.selectGrassRootsOrgTrend(formDTO.getAgencyId(), yearId);
List<String> xAxis = list.stream().map(item -> getMonth(item.getMonthId())).collect(Collectors.toList());
String monthId = StringUtils.isNotBlank(formDTO.getMonthId()) ? formDTO.getMonthId() : DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMM);
String curDate = monthId.substring(0, 4) + "-" + monthId.substring(4, 6) + "-" + "01";
// 查询近一年的指数值【包括本月】
List<GrassRootsOrgTrendDTO> list = screenAnGrassRootsOrgMonthlyDao.selectGrassRootsOrgTrend(formDTO.getAgencyId(), curDate);
List<String> xAxis = list.stream().map(item -> getMonth(item.getMonthId())).collect(Collectors.toList());
List<Integer> groupTotalList = list.stream().map(GrassRootsOrgTrendDTO::getGroupTotal).collect(Collectors.toList());
List<Integer> issueTotalList = list.stream().map(GrassRootsOrgTrendDTO::getIssueTotal).collect(Collectors.toList());
List<Integer> projectTotal = list.stream().map(GrassRootsOrgTrendDTO::getProjectTotal).collect(Collectors.toList());
@ -176,8 +185,11 @@ public class AnScreenServiceImpl implements AnScreenService {
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
public GrassRootsGovernTrendResultDTO grassRootsGovernTrend(AnScreenTrendFormDTO formDTO) {
GrassRootsGovernTrendResultDTO resultDTO = new GrassRootsGovernTrendResultDTO();
String yearId = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYY);
List<GrassRootsGovernTrendDTO> list = screenAnGrassRootsGovernMonthlyDao.selectGrassRootsGovernTrend(formDTO.getAgencyId(), yearId);
String monthId = StringUtils.isNotBlank(formDTO.getMonthId()) ? formDTO.getMonthId() : DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMM);
String curDate = monthId.substring(0, 4) + "-" + monthId.substring(4, 6) + "-" + "01";
// 查询近一年的指数值【包括本月】
List<GrassRootsGovernTrendDTO> list = screenAnGrassRootsGovernMonthlyDao.selectGrassRootsGovernTrend(formDTO.getAgencyId(), curDate);
List<String> xAxis = list.stream().map(item -> getMonth(item.getMonthId())).collect(Collectors.toList());
List<Integer> partiProjectTotalList = list.stream().map(GrassRootsGovernTrendDTO::getPartiProjectTotal).collect(Collectors.toList());
List<Integer> closedProjectTotalList = list.stream().map(GrassRootsGovernTrendDTO::getClosedProjectTotal).collect(Collectors.toList());

1
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java

@ -181,6 +181,7 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
rank.setResolvedRatio(convertPercentStr(o.getResolvedRatio(),NumConstant.ONE));
rank.setResponseRatio(convertPercentStr(o.getResponseRatio(),NumConstant.ONE));
rank.setSatisfactionRatio(convertPercentStr(o.getSatisfactionRatio(),NumConstant.ONE));
rank.setParentAgencyName(o.getParentAgencyName());
result.add(rank);
});
return result;

1
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java

@ -67,6 +67,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService {
fineExampleResultDTO.setResolvedProjectRatio(this.getRatio(fineExampleResultDTO.getResolvedProjectRatioA()));
fineExampleResultDTO.setTopicRatio(this.getRatio(fineExampleResultDTO.getTopicRatioA()));
fineExampleResultDTO.setShiftProjectRatio(this.getRatio(fineExampleResultDTO.getShiftProjectRatioA()));
fineExampleResultDTO.setPlatJoinPartyRatio(this.getRatio(Double.valueOf(fineExampleResultDTO.getPlatJoinPartyRatio())));
return fineExampleResultDTO;
}

3
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml

@ -10,7 +10,8 @@
SUM( AGE_LEVEL_3 ) + SUM( AGE_LEVEL_4 ) AS between31And50Count,
SUM( AGE_LEVEL_5 ) AS between51And60Count,
SUM( AGE_LEVEL_6 ) AS above61Count,
SUM( PARTY_MEMBER_COUNT) AS partyTotal
SUM( PARTY_MEMBER_COUNT) AS partyMemberCount,
SUM( AGE_LEVEL_1 ) + SUM( AGE_LEVEL_2 )+SUM( AGE_LEVEL_3 ) + SUM( AGE_LEVEL_4 )+SUM( AGE_LEVEL_5 )+SUM( AGE_LEVEL_6 ) as partyTotal
FROM
screen_cpc_base_data
WHERE

3
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml

@ -160,7 +160,8 @@
bo.ORG_ID AS agencyId,
sca.agency_name AS name,
IFNULL(sca.area_marks,'') AS areaMarks,
sca.level AS level
sca.level AS level,
sca.level as agencyLevel
FROM
screen_customer_agency sca
LEFT JOIN screen_customer_biz_org bo ON bo.ORG_ID = sca.AGENCY_ID

24
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml

@ -6,19 +6,23 @@
<!-- 查询政府治理能力各项指标 -->
<select id="selectGovernCapacityRatio" resultType="com.epmet.evaluationindex.screen.dto.result.GovernCapacityResultDTO">
SELECT
ORG_NAME AS agencyName,
RESPONSE_RATIO,
RESOLVED_RATIO,
GOVERN_RATIO,
SATISFACTION_RATIO
rankData.ORG_NAME AS agencyName,
rankData.RESPONSE_RATIO,
rankData.RESOLVED_RATIO,
rankData.GOVERN_RATIO,
rankData.SATISFACTION_RATIO,
agency.AGENCY_NAME AS parentAgencyName
FROM
screen_govern_rank_data
screen_govern_rank_data rankData
LEFT JOIN
screen_customer_agency agency
ON rankData.PARENT_ID = agency.AGENCY_ID AND agency.DEL_FLAG = '0' AND agency.AGENCY_ID = #{agencyId}
WHERE
DEL_FLAG = '0'
AND PARENT_ID = #{agencyId}
AND MONTH_ID = #{monthId}
rankData.DEL_FLAG = '0'
AND rankData.PARENT_ID = #{agencyId}
AND rankData.MONTH_ID = #{monthId}
ORDER BY
(RESPONSE_RATIO + RESOLVED_RATIO + GOVERN_RATIO + SATISFACTION_RATIO) DESC,RESPONSE_RATIO DESC,RESOLVED_RATIO DESC,GOVERN_RATIO DESC,SATISFACTION_RATIO DESC
(rankData.RESPONSE_RATIO + rankData.RESOLVED_RATIO + rankData.GOVERN_RATIO + rankData.SATISFACTION_RATIO) DESC,rankData.RESPONSE_RATIO DESC,rankData.RESOLVED_RATIO DESC,rankData.GOVERN_RATIO DESC,rankData.SATISFACTION_RATIO DESC
</select>
</mapper>

41
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml

@ -6,28 +6,31 @@
<!-- 查询指定机关的直属网格月度数据 -->
<select id="selectGridDataMonthly" resultType="com.epmet.evaluationindex.screen.dto.result.OrgRankDataResultDTO">
SELECT
ORG_NAME AS NAME,
PARTY_TOTAL AS partyMemberNum,
GROUP_TOTAL AS branchNum,
ISSUE_TOTAL AS issueNum,
PROJECT_TOTAL AS projectNum,
CLOSE_PROJECT_RATIO AS closedProjectRatio,
SATISFACTION_RATIO AS satisfactionRatio
rankData.ORG_NAME AS NAME,
rankData.PARTY_TOTAL AS partyMemberNum,
rankData.GROUP_TOTAL AS branchNum,
rankData.ISSUE_TOTAL AS issueNum,
rankData.PROJECT_TOTAL AS projectNum,
rankData.CLOSE_PROJECT_RATIO AS closedProjectRatio,
rankData.SATISFACTION_RATIO AS satisfactionRatio,
agency.AGENCY_NAME AS parentAgencyName
FROM
screen_org_rank_data
screen_org_rank_data rankData
LEFT JOIN screen_customer_agency agency
ON rankData.PARENT_ID = agency.AGENCY_ID AND agency.DEL_FLAG = 0
WHERE
DEL_FLAG = '0'
AND ORG_TYPE = 'grid'
AND ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%')
AND MONTH_ID = #{monthId}
rankData.DEL_FLAG = '0'
AND rankData.ORG_TYPE = 'grid'
AND rankData.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%')
AND rankData.MONTH_ID = #{monthId}
ORDER BY
(PARTY_TOTAL + GROUP_TOTAL + ISSUE_TOTAL + PROJECT_TOTAL + CLOSE_PROJECT_RATIO + SATISFACTION_RATIO) DESC,
PARTY_TOTAL DESC,
GROUP_TOTAL DESC,
ISSUE_TOTAL DESC,
PROJECT_TOTAL DESC,
CLOSE_PROJECT_RATIO DESC,
SATISFACTION_RATIO DESC
(rankData.PARTY_TOTAL + rankData.GROUP_TOTAL + rankData.ISSUE_TOTAL + rankData.PROJECT_TOTAL + rankData.CLOSE_PROJECT_RATIO + rankData.SATISFACTION_RATIO) DESC,
rankData.PARTY_TOTAL DESC,
rankData.GROUP_TOTAL DESC,
rankData.ISSUE_TOTAL DESC,
rankData.PROJECT_TOTAL DESC,
rankData.CLOSE_PROJECT_RATIO DESC,
rankData.SATISFACTION_RATIO DESC
</select>

1
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml

@ -32,6 +32,7 @@
AND ORG_ID = #{agencyId}
AND TYPE = #{category}
AND MONTH_ID <![CDATA[ >= ]]> #{bottomMonthId}
AND MEET_CATEGORY_NAME IS NOT NULL
ORDER BY
MONTH_ID DESC ,
MEET_CATEGORY_NAME

3
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml

@ -15,5 +15,8 @@
WHERE
md.del_flag = '0'
AND md.parent_id = #{agencyId}
AND md.ORG_TYPE =
CASE WHEN sca.LEVEL = 'community' THEN 'grid' ELSE 'agency' END
</select>
</mapper>

6
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml

@ -15,7 +15,9 @@
resolved_project_total AS resolvedProjectTotal,
resolved_project_ratio AS resolvedProjectRatioA,
publish_issue_total AS publishIssueTotal,
publish_issue_ratio AS publishIssueRatioA
publish_issue_ratio AS publishIssueRatioA,
PLAT_ISSUE_TOTAL AS platIssueTotal,
PLAT_JOIN_PARTY_RATIO AS platJoinPartyRatio
FROM
screen_pioneer_data
WHERE
@ -24,4 +26,4 @@
ORDER BY data_end_time DESC
LIMIT 1
</select>
</mapper>
</mapper>

35
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml

@ -6,24 +6,29 @@
<!-- 查询公众参与各类总数 -->
<select id="selectPublicPartiTotal" resultType="com.epmet.evaluationindex.screen.dto.result.PublicPartiRankResultDTO">
SELECT
ORG_NAME AS NAME,
REG_USER_TOTAL AS regNum,
JOIN_USER_TOTAL AS joinNum,
TOPIC_TOTAL AS topicNum,
ISSUE_TOTAL AS issueNum,
PROJECT_TOTAL AS projectNum
totalData.ORG_NAME AS NAME,
totalData.REG_USER_TOTAL AS regNum,
totalData.JOIN_USER_TOTAL AS joinNum,
totalData.TOPIC_TOTAL AS topicNum,
totalData.ISSUE_TOTAL AS issueNum,
totalData.PROJECT_TOTAL AS projectNum,
agency.AGENCY_NAME AS parentAgencyName
FROM
screen_public_parti_total_data
screen_public_parti_total_data totalData
LEFT JOIN
screen_customer_agency agency
ON totalData.PARENT_ID = agency.AGENCY_ID
AND agency.DEL_FLAG = '0' AND agency.AGENCY_ID = #{agencyId}
WHERE
DEL_FLAG = '0'
AND PARENT_ID = #{agencyId}
totalData.DEL_FLAG = '0'
AND totalData.PARENT_ID = #{agencyId}
ORDER BY
(REG_USER_TOTAL + JOIN_USER_TOTAL + TOPIC_TOTAL + ISSUE_TOTAL + PROJECT_TOTAL) DESC,
REG_USER_TOTAL desc,
JOIN_USER_TOTAL desc,
TOPIC_TOTAL desc,
ISSUE_TOTAL desc,
PROJECT_TOTAL desc
(totalData.REG_USER_TOTAL + totalData.JOIN_USER_TOTAL + totalData.TOPIC_TOTAL + totalData.ISSUE_TOTAL + totalData.PROJECT_TOTAL) DESC,
totalData.REG_USER_TOTAL desc,
totalData.JOIN_USER_TOTAL desc,
totalData.TOPIC_TOTAL desc,
totalData.ISSUE_TOTAL desc,
totalData.PROJECT_TOTAL desc
</select>
</mapper>

43
epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsGovernMonthlyDao.xml

@ -16,16 +16,37 @@
AND MONTH_ID = #{monthId}
</select>
<select id="selectGrassRootsGovernTrend" resultType="com.epmet.evaluationindex.screen.dto.result.GrassRootsGovernTrendDTO">
SELECT MONTH_ID,
PARTI_PROJECT_TOTAL,
CLOSED_PROJECT_TOTAL,
0 + cast( TRUNCATE ( PROJECT_RESPONSE_RATIO, 1 ) AS CHAR ) AS "projectResponseRatio",
0 + cast( TRUNCATE ( PROJECT_SATIS_RATIO, 1 ) AS CHAR ) AS "projectSatisRatio",
0 + cast( TRUNCATE ( CLOSED_PROJECT_RATIO, 1 ) AS CHAR ) AS "closedProjectRatio"
FROM screen_an_grass_roots_govern_monthly
WHERE DEL_FLAG = 0
AND ORG_ID = #{agencyId}
AND YEAR_ID = #{yearId}
SELECT
d.`month` MONTH_ID,
IFNULL(s.PARTI_PROJECT_TOTAL, 0) PARTI_PROJECT_TOTAL,
IFNULL(s.CLOSED_PROJECT_TOTAL, 0) CLOSED_PROJECT_TOTAL,
IFNULL(s.projectResponseRatio, 0) projectResponseRatio,
IFNULL(s.projectSatisRatio, 0) projectSatisRatio,
IFNULL(s.closedProjectRatio, 0) closedProjectRatio
FROM(
SELECT DATE_FORMAT(#{curDate}, '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 1 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 2 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 3 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 4 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 5 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 6 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 7 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 8 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 9 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 10 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 11 MONTH), '%Y%m') AS `month`
) d LEFT JOIN (
SELECT MONTH_ID,
PARTI_PROJECT_TOTAL,
CLOSED_PROJECT_TOTAL,
0 + cast( TRUNCATE ( PROJECT_RESPONSE_RATIO, 1 ) AS CHAR ) AS "projectResponseRatio",
0 + cast( TRUNCATE ( PROJECT_SATIS_RATIO, 1 ) AS CHAR ) AS "projectSatisRatio",
0 + cast( TRUNCATE ( CLOSED_PROJECT_RATIO, 1 ) AS CHAR ) AS "closedProjectRatio"
FROM screen_an_grass_roots_govern_monthly
WHERE DEL_FLAG = 0
AND ORG_ID = #{agencyId}
) s ON d.`month` = s.MONTH_ID
ORDER BY MONTH_ID
</select>
<select id="selectGrassRootsGovernRank" resultType="com.epmet.evaluationindex.screen.dto.result.GrassRootsGovernRankResultDTO">
@ -41,4 +62,4 @@
AND MONTH_ID = #{monthId}
ORDER BY PARTI_PROJECT_TOTAL DESC
</select>
</mapper>
</mapper>

37
epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsOrgMonthlyDao.xml

@ -14,14 +14,33 @@
AND MONTH_ID = #{monthId}
</select>
<select id="selectGrassRootsOrgTrend" resultType="com.epmet.evaluationindex.screen.dto.result.GrassRootsOrgTrendDTO">
SELECT MONTH_ID,
GROUP_TOTAL,
ISSUE_TOTAL,
PROJECT_TOTAL
FROM screen_an_grass_roots_org_monthly
WHERE DEL_FLAG = 0
AND ORG_ID = #{agencyId}
AND YEAR_ID = #{yearId}
SELECT d.`month` MONTH_ID,
IFNULL(s.GROUP_TOTAL, 0) GROUP_TOTAL,
IFNULL(s.ISSUE_TOTAL, 0) ISSUE_TOTAL,
IFNULL(s.PROJECT_TOTAL, 0) PROJECT_TOTAL
FROM(
SELECT DATE_FORMAT(#{curDate}, '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 1 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 2 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 3 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 4 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 5 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 6 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 7 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 8 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 9 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 10 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 11 MONTH), '%Y%m') AS `month`
) d LEFT JOIN (
SELECT
MONTH_ID,
GROUP_TOTAL,
ISSUE_TOTAL,
PROJECT_TOTAL
FROM screen_an_grass_roots_org_monthly
WHERE DEL_FLAG = 0
AND ORG_ID = #{agencyId}
) s ON d.`month` = s.MONTH_ID
ORDER BY MONTH_ID
</select>
<select id="selectGrassRootsOrgRank" resultType="com.epmet.evaluationindex.screen.dto.result.GrassRootsOrgRankResultDTO">
@ -35,4 +54,4 @@
AND MONTH_ID = #{monthId}
ORDER BY GROUP_TOTAL DESC
</select>
</mapper>
</mapper>

49
epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.xml

@ -15,20 +15,37 @@
</select>
<select id="selectPmTotalTrend" resultType="com.epmet.evaluationindex.screen.dto.result.PmTotalTrendDTO">
SELECT
MONTH_ID,
GROUP_MEMBER_TOTAL,
TOPIC_TOTAL,
TOPIC_PARTI_USER_TOTAL,
ISSUE_TOTAL
FROM
screen_an_grass_roots_pm_total_monthly
WHERE
DEL_FLAG = '0'
AND ORG_ID = #{agencyId}
<if test="monthId != null and monthId.trim() != ''">
AND MONTH_ID &lt;= #{monthId}
</if>
ORDER BY MONTH_ID ASC
LIMIT 12
d.`month` MONTH_ID,
IFNULL(s.GROUP_MEMBER_TOTAL, 0) GROUP_MEMBER_TOTAL,
IFNULL(s.TOPIC_TOTAL, 0) TOPIC_TOTAL,
IFNULL(s.TOPIC_PARTI_USER_TOTAL, 0) TOPIC_PARTI_USER_TOTAL,
IFNULL(s.ISSUE_TOTAL, 0) ISSUE_TOTAL
FROM(
SELECT DATE_FORMAT(#{curDate}, '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 1 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 2 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 3 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 4 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 5 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 6 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 7 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 8 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 9 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 10 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 11 MONTH), '%Y%m') AS `month`
) d LEFT JOIN (
SELECT
MONTH_ID,
GROUP_MEMBER_TOTAL,
TOPIC_TOTAL,
TOPIC_PARTI_USER_TOTAL,
ISSUE_TOTAL
FROM
screen_an_grass_roots_pm_total_monthly
WHERE
DEL_FLAG = '0'
AND ORG_ID = #{agencyId}
) s ON d.`month` = s.MONTH_ID
ORDER BY MONTH_ID
</select>
</mapper>
</mapper>

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

@ -20,7 +20,6 @@ import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyEntity;
@ -47,7 +46,6 @@ import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
@ -660,12 +658,21 @@ public class DemoController {
@Autowired
private PublicPartiTotalDataExtractService publicPartiTotalDataExtractService;
@PostMapping("insertScreenPioneerData")
public Result insertScreenPioneerData(@RequestParam("customerId") String customerId, @RequestParam("dateId") String dateId) {
public Result insertScreenPioneerData(@RequestParam("customerId") String customerId, @RequestParam("dateId") String dateId,@RequestParam("type") String type) {
if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) {
pioneerDataExtractService.extractGridPioneerData(customerId, dateId);
pioneerDataExtractService.extractCommunityPioneerData(customerId, dateId);
pioneerDataExtractService.extractExceptCommunityPioneerData(customerId, dateId);
} else {
if ("grid".equals(type)) {
pioneerDataExtractService.extractGridPioneerData(customerId, dateId);
} else if ("community".equals(type)) {
pioneerDataExtractService.extractCommunityPioneerData(customerId, dateId);
} else if ("exceptcommunity".equals(type)) {
pioneerDataExtractService.extractExceptCommunityPioneerData(customerId, dateId);
} else {
pioneerDataExtractService.extractGridPioneerData(customerId, dateId);
pioneerDataExtractService.extractCommunityPioneerData(customerId, dateId);
pioneerDataExtractService.extractExceptCommunityPioneerData(customerId, dateId);
}
}
/*else {
QueryWrapper<DimCustomerEntity> customerEntityQueryWrapper = new QueryWrapper<>();
List<DimCustomerEntity> customerEntityList = dimCustomerDao.selectList(customerEntityQueryWrapper);
for (DimCustomerEntity customerEntity : customerEntityList) {
@ -673,8 +680,8 @@ public class DemoController {
pioneerDataExtractService.extractCommunityPioneerData(customerEntity.getId(), "20200926");
pioneerDataExtractService.extractExceptCommunityPioneerData(customerEntity.getId(), "20200926");
}
}
return new Result();
}*/
return new Result().ok("调用成功");
}
@PostMapping("extractPublicPartiTotalData")

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

@ -1,5 +1,7 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
@ -11,6 +13,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 原始数据清洗
@ -114,7 +118,15 @@ public class FactOriginExtractController {
**/
@PostMapping("groupdatacleaning")
public Result groupDataCleaning(@RequestBody ExtractOriginFormDTO param) {
groupExtractService.extractGroupData(param);
if(StringUtils.isNotBlank(param.getStartDate()) && StringUtils.isNotBlank(param.getEndDate())){
List<String> finalDaysBetween = DateUtils.getDaysBetween(param.getStartDate(), param.getEndDate());
ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class);
for (int i = 0; i < finalDaysBetween.size(); i++) {
String dateDimId = finalDaysBetween.get(i);
paramNew.setDateId(dateDimId);
groupExtractService.extractGroupData(paramNew);
}
}else groupExtractService.extractGroupData(param);
return new Result();
}
}

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

@ -18,13 +18,11 @@
package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.GridGroupUserCountResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO;
import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity;
@ -164,12 +162,11 @@ public interface FactOriginGroupMainDailyDao extends BaseDao<FactOriginGroupMain
/**
* @param customerId
* @param monthId
* @Description 查询党员建组信息
* @author zxc
* @date 2020/9/25 9:46 上午
*/
List<ScreenPartyLinkMassesDataFormDTO> selectPartyCreateGroupInfo(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("gridIds") List<String> gridIds);
List<ScreenPartyLinkMassesDataFormDTO> selectPartyCreateGroupInfo(@Param("customerId") String customerId, @Param("gridIds") List<String> gridIds);
/**
* desc: 获取所有网格的组中成员人数 去重
@ -202,4 +199,4 @@ public interface FactOriginGroupMainDailyDao extends BaseDao<FactOriginGroupMain
*/
List<OrgStatisticsResultDTO> selectOrgGroupCount(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level") String level);
}
}

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

@ -108,11 +108,26 @@ public interface FactOriginIssueLogDailyDao extends BaseDao<FactOriginIssueLogDa
*
* @param customerId
* @param monthId
* @param pids
* @param groupField
* @return java.util.List<com.epmet.dto.extract.IssueVoteUserCountResultDTO>
* @author LiuJanJun
* @date 2020/9/27 1:58 下午
*/
List<IssueVoteUserCountResultDTO> getVoteCount(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("groupField") String groupField);
/**
* @param customerId
* @param gridId
* @param agencyPath
* @param isParty
* @return int
* @author yinzuomei
* @description 大屏先锋模范计算 平台参与议事总人数平台参与议事党员数
* @Date 2021/1/12 15:08
**/
int selectPlatJoinUserTotal(@Param("customerId") String customerId,
@Param("gridId") String gridId,
@Param("communityId") String communityId,
@Param("agencyPath") String agencyPath,
@Param("isParty") String isParty);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java

@ -63,7 +63,7 @@ public interface FactOriginProjectOrgPeriodDailyDao extends BaseDao<FactOriginPr
* @author wangc
* @date 2020.10.19 16:26
*/
void deleteByProjectIds(@Param("list") List<String> list);
void deleteByProjectIds(@Param("list") List<String> list,@Param("customerId") String customerId);
/**
* @Description 批量插入

37
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java

@ -67,7 +67,12 @@ public class ScreenPioneerDataEntity extends BaseEpmetEntity {
*/
private Integer issueTotal;
/**
/**
* 01.12新增PLAT_ISSUE_TOTAL 平台参与议事总数
*/
private Integer platIssueTotal;
/**
* 党员参与议事占比
*/
private BigDecimal issueRatio;
@ -77,6 +82,11 @@ public class ScreenPioneerDataEntity extends BaseEpmetEntity {
*/
private Integer topicTotal;
/**
* 01.12新增PLAT_TOPIC_TOTAL 当前组织维度话题总数,TOPIC_RATIO的分母
*/
private Integer platTopicTotal;
/**
* 党员发布话题占比
*/
@ -87,6 +97,11 @@ public class ScreenPioneerDataEntity extends BaseEpmetEntity {
*/
private Integer publishIssueTotal;
/**
* 01.12新增PLAT_PUBLISH_ISSUE_TOTAL 当前组织维度发布议题总数PUBLISH_ISSUE_RATIO的分母SHIFT_PROJECT_RATIO的分母
*/
private Integer platPublishIssueTotal;
/**
* 党员发布议题占比
*/
@ -107,6 +122,10 @@ public class ScreenPioneerDataEntity extends BaseEpmetEntity {
*/
private Integer resolvedProjectTotal;
/**
* 01.12新增PLAT_CLOSED_PROJECT_TOTAL 当前组织维度所有结案项目数RESOLVED_PROJECT_RATIO的分母
*/
private Integer platClosedProjectTotal;
/**
* 解决项目总数占比
*/
@ -124,4 +143,20 @@ public class ScreenPioneerDataEntity extends BaseEpmetEntity {
private String pid;
private String agencyPids;
private String agencyPath;
/**
* PLAT_JOIN_USER_TOTAL 平台参与议事总人数
*/
private Integer platJoinUserTotal;
/**
* PLAT_JOIN_PARTY_TOTAL 平台参与议事党员数
*/
private Integer platJoinPartyTotal;
/**
* PLAT_JOIN PARTY_RATIO 平台参与议事的党员占比
*/
private BigDecimal platJoinPartyRatio;
}

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

@ -68,12 +68,11 @@ public interface FactOriginGroupMainDailyService extends BaseService<FactOriginG
/**
* @param customerId
* @param monthId
* @Description 查询党员建组信息
* @author zxc
* @date 2020/9/25 9:46 上午
*/
List<ScreenPartyLinkMassesDataFormDTO> selectPartyCreateGroupInfo(String customerId, String monthId, List<String> gridIds);
List<ScreenPartyLinkMassesDataFormDTO> selectPartyCreateGroupInfo(String customerId, List<String> gridIds);
/**
* desc: 获取客户下每个网格小组内的 去重人数
@ -106,4 +105,4 @@ public interface FactOriginGroupMainDailyService extends BaseService<FactOriginG
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getOrgGroupCount(String customerId, String monthId, String level);
}
}

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

@ -65,4 +65,16 @@ public interface FactOriginIssueLogDailyService extends BaseService<FactOriginIs
* @date 2020/9/27 1:58 下午
*/
List<IssueVoteUserCountResultDTO> getVoteCount(String customerId, String monthId, String groupField);
/**
* @return java.lang.Integer
* @param customerId
* @param gridId
* @param agencyPath
* @param isParty
* @author yinzuomei
* @description 计算 平台参与议事总人数平台参与议事党员数
* @Date 2021/1/12 15:02
**/
int calPlatJoinUserTotal(String customerId, String gridId, String communityId,String agencyPath, String isParty);
}

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

@ -21,8 +21,8 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.GridGroupUserCountResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService;
@ -85,19 +85,21 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl<FactOri
@Override
@Transactional(rollbackFor = Exception.class)
public boolean insertExtractedData(boolean isFirst, String customerId, String dateId,List<FactOriginGroupMainDailyDTO> originGroupData, List<ExtractGroupMemberActionRecordResultDTO> memberList,List<String> missing) {
if (isFirst) {
//isFirst
baseDao.deleteBatchMemberByCustomerId(customerId,null,null);
} else {
if(StringUtils.isNotBlank(dateId)){
baseDao.deleteBatchMemberByCustomerId(customerId,dateId,"date");
if(!CollectionUtils.isEmpty(originGroupData)) {
if (isFirst) {
//isFirst
baseDao.deleteBatchMemberByCustomerId(customerId, null, null);
} else {
if (StringUtils.isNotBlank(dateId)) {
baseDao.deleteBatchMemberByCustomerId(customerId, dateId, "date");
}
}
}
//删除要插入的组主表数据
baseDao.deleteBatchByGroupId(customerId,originGroupData.stream().map(FactOriginGroupMainDailyDTO :: getId).distinct().collect(Collectors.toList()));
//删除要插入的组主表数据
baseDao.deleteBatchByGroupId(customerId, originGroupData.stream().map(FactOriginGroupMainDailyDTO::getId).distinct().collect(Collectors.toList()));
baseDao.insertBatchMain(originGroupData);
baseDao.insertBatchMembers(memberList);
baseDao.insertBatchMain(originGroupData);
baseDao.insertBatchMembers(memberList);
}
if(!CollectionUtils.isEmpty(missing)){
baseDao.deleteBatchByGroupId(customerId,missing);
baseDao.deleteMemberByGroupList(customerId,missing);
@ -106,16 +108,15 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl<FactOri
}
/**
* @Description 查询党员建组信息
* @param customerId
* @param monthId
* @Description 查询党员建组信息
* @author zxc
* @date 2020/9/25 9:46 上午
*/
@Override
public List<ScreenPartyLinkMassesDataFormDTO> selectPartyCreateGroupInfo(String customerId, String monthId, List<String> gridIds) {
public List<ScreenPartyLinkMassesDataFormDTO> selectPartyCreateGroupInfo(String customerId, List<String> gridIds) {
if (!CollectionUtils.isEmpty(gridIds)) {
return baseDao.selectPartyCreateGroupInfo(customerId, monthId, gridIds);
return baseDao.selectPartyCreateGroupInfo(customerId, gridIds);
}
return new ArrayList<>();
}
@ -135,4 +136,4 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl<FactOri
return baseDao.selectOrgGroupCount(customerId, monthId, level);
}
}
}

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

@ -100,4 +100,19 @@ public class FactOriginIssueLogDailyServiceImpl extends BaseServiceImpl<FactOrig
public List<IssueVoteUserCountResultDTO> getVoteCount(String customerId, String monthId, String groupField) {
return baseDao.getVoteCount(customerId, monthId, groupField);
}
/**
* @param customerId
* @param gridId
* @param agencyPath
* @param isParty
* @return java.lang.Integer
* @author yinzuomei
* @description 计算 平台参与议事总人数平台参与议事党员数
* @Date 2021/1/12 15:02
**/
@Override
public int calPlatJoinUserTotal(String customerId, String gridId,String communityId, String agencyPath, String isParty) {
return baseDao.selectPlatJoinUserTotal(customerId,gridId,communityId,agencyPath,isParty);
}
}

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

@ -1,5 +1,6 @@
package com.epmet.service.evaluationindex.extract.todata.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.utils.DateUtils;
@ -84,10 +85,10 @@ public class GroupExtractServiceImpl implements GroupExtractService {
List<FactOriginGroupMainDailyDTO> originGroupData = groupDataService.extractGroupData(
count <= NumConstant.ZERO,
param.getCustomerId(), param.getDateId());
log.info("extractGroupData extractGroupData:result:{},param:{}", JSON.toJSONString(originGroupData), JSON.toJSONString(param));
List<ExtractGroupMemberActionRecordResultDTO> memberList = new LinkedList<>();
if (!CollectionUtils.isEmpty(originGroupData)) {
List<GridAttributesResultDTO> gridList = dimGridService.getGridAttributes(param.getCustomerId(),originGroupData.stream().map(FactOriginGroupMainDailyDTO::getGridId).distinct().collect(Collectors.toList()));
List<GridAttributesResultDTO> gridList = dimGridService.getGridAttributes(param.getCustomerId(),null);
if (!CollectionUtils.isEmpty(gridList)) {
Map<String, GridAttributesResultDTO> gridMap =
@ -160,7 +161,7 @@ public class GroupExtractServiceImpl implements GroupExtractService {
factOriginGroupMainDailyService.insertExtractedData(
count <= NumConstant.ZERO ? true : false,
count <= NumConstant.ZERO,
param.getCustomerId(),
param.getDateId(),
originGroupData,

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

@ -22,6 +22,7 @@ import com.epmet.service.evaluationindex.extract.todata.IssueExtractService;
import com.epmet.service.topic.TopicService;
import com.epmet.service.user.UserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -129,7 +130,11 @@ public class IssueExtractServiceImpl implements IssueExtractService {
agencyInfoList.forEach(pid -> {
if (r.getAgencyId().equals(pid.getAgencyId())){
r.setPid(pid.getPid());
r.setPids(pid.getPids().concat(":").concat(r.getAgencyId()));
if (StringUtils.isNotBlank(pid.getPids())) {
r.setPids(pid.getPids().concat(":").concat(r.getAgencyId()));
} else {
r.setPids(r.getAgencyId());
}
}
});
});
@ -231,7 +236,11 @@ public class IssueExtractServiceImpl implements IssueExtractService {
agencyInfoList.forEach(agency -> {
if (r.getAgencyId().equals(agency.getAgencyId())){
r.setPid(agency.getPid());
r.setPids(agency.getPids().concat(":").concat(r.getAgencyId()));
if(StringUtils.isNotBlank(agency.getPids())){
r.setPids(agency.getPids().concat(":").concat(r.getAgencyId()));
}else{
r.setPids(r.getAgencyId());
}
}
});
});

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

@ -439,7 +439,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
if(!CollectionUtils.isEmpty(formattingData)) {
List<String> projectIds = formattingData.stream().map(FactOriginProjectOrgPeriodDailyEntity::getProjectId).distinct().collect(Collectors.toList());
if (!CollectionUtils.isEmpty(projectIds)) {
factOriginProjectOrgPeriodDailyDao.deleteByProjectIds(projectIds);
factOriginProjectOrgPeriodDailyDao.deleteByProjectIds(null,param.getCustomerId());
factOriginProjectOrgPeriodDailyDao.insertBatch(formattingData);
}
}

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

@ -129,7 +129,8 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
form.setAgeLevel4(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel4)));
form.setAgeLevel5(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel5)));
form.setAgeLevel6(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel6)));
form.setPartyMemberCount(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getPartyMemberCount)));
// form.setPartyMemberCount(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getPartyMemberCount)));
form.setPartyMemberCount(calPartyMemberCount(form));
form.setResiTotal(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getResiTotal)));
form.setRegisterUserCount(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getRegisterUserCount)));
result.add(form);
@ -175,6 +176,7 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
form.setAgeLevel4(disposeAgeArea(partyInfos,NumConstant.FORTY_ONE,NumConstant.FIFTY));
form.setAgeLevel5(disposeAgeArea(partyInfos,NumConstant.FIFTY_ONE,NumConstant.SIXTY));
form.setAgeLevel6(disposeAge(partyInfos,NumConstant.SIXTY,true));
form.setPartyMemberCount(calPartyMemberCount(form));
form.setCustomerId(customerId);
form.setDataEndTime(dateId);
form.setParentId(partyInfos.get(NumConstant.ZERO).getAgencyId());
@ -183,7 +185,7 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
if (gridId.equals(user.getOrgId())){
form.setResiTotal(user.getResiTotal());
form.setRegisterUserCount(user.getRegisterUserCount());
form.setPartyMemberCount(user.getPartyMemberCount());
// form.setPartyMemberCount(user.getPartyMemberCount());
}
});
}
@ -210,7 +212,8 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
form.setAgeLevel4(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getAgeLevel4)));
form.setAgeLevel5(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getAgeLevel5)));
form.setAgeLevel6(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getAgeLevel6)));
form.setPartyMemberCount(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getPartyMemberCount)));
// form.setPartyMemberCount(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getPartyMemberCount)));
form.setPartyMemberCount(calPartyMemberCount(form));
form.setResiTotal(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getResiTotal)));
form.setRegisterUserCount(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getRegisterUserCount)));
result.add(form);
@ -361,6 +364,7 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
form.setAgeLevel3(disposeAgeArea(partyInfos,NumConstant.THIRTY_ONE,NumConstant.FORTY));
form.setAgeLevel4(disposeAgeArea(partyInfos,NumConstant.FORTY_ONE,NumConstant.FIFTY));
form.setAgeLevel5(disposeAgeArea(partyInfos,NumConstant.FIFTY_ONE,NumConstant.SIXTY));
form.setPartyMemberCount(calPartyMemberCount(form));
form.setAgeLevel6(disposeAge(partyInfos,NumConstant.SIXTY,true));
form.setCustomerId(customerId);
form.setDataEndTime(dateId);
@ -370,7 +374,7 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
if (gridId.equals(user.getOrgId())){
form.setResiTotal(user.getResiTotal());
form.setRegisterUserCount(user.getRegisterUserCount());
form.setPartyMemberCount(user.getPartyMemberCount());
// form.setPartyMemberCount(user.getPartyMemberCount());
}
});
}
@ -379,4 +383,9 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
}
return new GridPartyDTO(orgIds, result);
}
public Integer calPartyMemberCount(PartyBaseInfoFormDTO form){
Integer result = form.getAgeLevel1() + form.getAgeLevel2() + form.getAgeLevel3() + form.getAgeLevel4() + form.getAgeLevel5() + form.getAgeLevel6();
return result;
}
}

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

@ -1,11 +1,9 @@
package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.ScreenConstant;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.dto.extract.form.ScreenExtractFormDTO;
import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.*;
@ -185,22 +183,22 @@ public class PartyGuideServiceImpl implements PartyGuideService {
// 判断当前级别agency是否为空
if (!CollectionUtils.isEmpty(agencyIdList)){
// 获取agencyIds
List<String> orgIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList());
if (isGrid == true){
List<String> orgIds = agencyIdList.stream().map(CustomerAgencyInfoResultDTO::getAgencyId).collect(Collectors.toList());
if (isGrid) {
agencyIdList.forEach(agency -> {
// 计算社区级别的下级(实际就是网格)
GridPartyGuideDTO gridPartyGuideDTO = communityLevelSubGrid(customerId, monthId, agency);
GridPartyGuideDTO gridPartyGuideDTO = communityLevelSubGrid(customerId, agency);
orgIds.addAll(gridPartyGuideDTO.getOrgIds());
result.addAll(gridPartyGuideDTO.getResult());
});
// 根据agencyId分组,计算各个社区的
Map<String, List<ScreenPartyLinkMassesDataFormDTO>> groupByAgency = result.stream().collect(Collectors.groupingBy(ScreenPartyLinkMassesDataFormDTO::getParentId));
groupByAgency.forEach((agencyId,gridList) -> {
groupByAgency.forEach((agencyId, gridList) -> {
ScreenPartyLinkMassesDataFormDTO form = new ScreenPartyLinkMassesDataFormDTO();
List<OrgNameResultDTO> orgNameAgencyList = agencyService.selectOrgNameAgency(orgIds);
if (!CollectionUtils.isEmpty(orgNameAgencyList)){
orgNameAgencyList.forEach(name -> {
if (agencyId.equals(name.getAgencyId())){
if (agencyId.equals(name.getAgencyId())) {
form.setOrgName(name.getAgencyName());
form.setParentId(name.getParentId());
}
@ -210,8 +208,8 @@ public class PartyGuideServiceImpl implements PartyGuideService {
form.setCustomerId(customerId);
form.setDataEndTime(monthId);
form.setOrgType(ScreenConstant.AGENCY);
form.setCreateGroupTotal(gridList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getCreateGroupTotal)));
form.setGroupUserTotal(gridList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getGroupUserTotal)));
form.setCreateGroupTotal(gridList.stream().mapToInt(ScreenPartyLinkMassesDataFormDTO::getCreateGroupTotal).sum());
form.setGroupUserTotal(gridList.stream().mapToInt(ScreenPartyLinkMassesDataFormDTO::getGroupUserTotal).sum());
result.add(form);
});
delAndInsertLink(result,customerId,monthId,orgIds);
@ -227,15 +225,15 @@ public class PartyGuideServiceImpl implements PartyGuideService {
}
});
// 不为空 存在直属网格
if (!CollectionUtils.isEmpty(disGridIds)){
if (!CollectionUtils.isEmpty(disGridIds)) {
List<ScreenPartyLinkMassesDataFormDTO> gridResult = new ArrayList<>();
// 查询党员创建组,组内成员数
List<ScreenPartyLinkMassesDataFormDTO> partyLinkMassesDataList = groupMainService.selectPartyCreateGroupInfo(customerId, monthId, disGridIds);
List<OrgNameResultDTO> orgNameList = agencyService.selectOrgNameGrid(partyLinkMassesDataList.stream().map(m -> m.getOrgId()).collect(Collectors.toList()));
if (!CollectionUtils.isEmpty(partyLinkMassesDataList)){
List<ScreenPartyLinkMassesDataFormDTO> partyLinkMassesDataList = groupMainService.selectPartyCreateGroupInfo(customerId, disGridIds);
List<OrgNameResultDTO> orgNameList = agencyService.selectOrgNameGrid(partyLinkMassesDataList.stream().map(ScreenPartyLinkMassesDataFormDTO::getOrgId).collect(Collectors.toList()));
if (!CollectionUtils.isEmpty(partyLinkMassesDataList)) {
partyLinkMassesDataList.forEach(party -> {
orgNameList.forEach(org -> {
if (party.getOrgId().equals(org.getGridId())){
if (party.getOrgId().equals(org.getGridId())) {
party.setOrgName(org.getGridName());
}
});
@ -246,10 +244,10 @@ public class PartyGuideServiceImpl implements PartyGuideService {
delAndInsertLink(gridResult,customerId,monthId,disGridIds);
}
// 查询直属网格的信息 + 下级机关的信息 = agency的机关信息
List<ScreenPartyLinkMassesDataFormDTO> screenPartyLinkMassesDataGrid = groupMainService.selectPartyCreateGroupInfo(customerId, monthId, disGridIds);
List<ScreenPartyLinkMassesDataFormDTO> screenPartyLinkMassesDataGrid = groupMainService.selectPartyCreateGroupInfo(customerId, disGridIds);
List<ScreenPartyLinkMassesDataFormDTO> screenPartyLinkMassesDataList = linkMassesDataService.selectPartyLinkMassesInfo(customerId, monthId, agencyId);
screenPartyLinkMassesDataList.addAll(screenPartyLinkMassesDataGrid);
if (!CollectionUtils.isEmpty(screenPartyLinkMassesDataList)){
if (!CollectionUtils.isEmpty(screenPartyLinkMassesDataList)) {
ScreenPartyLinkMassesDataFormDTO form = new ScreenPartyLinkMassesDataFormDTO();
form.setOrgId(agencyId);
form.setOrgType(ScreenConstant.AGENCY);
@ -257,8 +255,8 @@ public class PartyGuideServiceImpl implements PartyGuideService {
form.setCustomerId(customerId);
form.setDataEndTime(monthId);
form.setParentId(screenPartyLinkMassesDataList.get(NumConstant.ZERO).getParentId());
form.setGroupUserTotal(screenPartyLinkMassesDataList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getGroupUserTotal)));
form.setCreateGroupTotal(screenPartyLinkMassesDataList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getCreateGroupTotal)));
form.setGroupUserTotal(screenPartyLinkMassesDataList.stream().mapToInt(ScreenPartyLinkMassesDataFormDTO::getGroupUserTotal).sum());
form.setCreateGroupTotal(screenPartyLinkMassesDataList.stream().mapToInt(ScreenPartyLinkMassesDataFormDTO::getCreateGroupTotal).sum());
result.add(form);
}
});
@ -431,24 +429,23 @@ public class PartyGuideServiceImpl implements PartyGuideService {
}
/**
* @Description 社区级别的处理
* @Description 社区级别的处理
* @Param customerId
* @Param monthId
* @Param agency
* @author zxc
* @date 2020/9/25 10:06 上午
*/
public GridPartyGuideDTO communityLevelSubGrid(String customerId, String monthId, CustomerAgencyInfoResultDTO agency){
public GridPartyGuideDTO communityLevelSubGrid(String customerId, CustomerAgencyInfoResultDTO agency) {
String agencyId = agency.getAgencyId();
// 获取下级所有agencyId【根据agencyMap中的level判断下级orgId是否是gridId】(此处直接作为gridId)
Map<String, Object> agencyMap = agencyService.selectAllSubAgencyId(agencyId, customerId);
List<String> gridIds = (List<String>) agencyMap.get(agencyId);
List<ScreenPartyLinkMassesDataFormDTO> partyLinkMassesDataList = groupMainService.selectPartyCreateGroupInfo(customerId, monthId, gridIds);
List<ScreenPartyLinkMassesDataFormDTO> partyLinkMassesDataList = groupMainService.selectPartyCreateGroupInfo(customerId, gridIds);
List<String> orgIds = partyLinkMassesDataList.stream().map(m -> m.getOrgId()).collect(Collectors.toList());
List<OrgNameResultDTO> orgNameList = agencyService.selectOrgNameGrid(orgIds);
partyLinkMassesDataList.forEach(party -> {
orgNameList.forEach(orgName -> {
if (party.getOrgId().equals(orgName.getGridId())){
if (party.getOrgId().equals(orgName.getGridId())) {
party.setOrgName(orgName.getGridName());
}
});

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

@ -66,56 +66,76 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
//何为参与: 议题的表决行为次数总计
//1、党员参与议事
entity.setIssueTotal(calPartyPartiIssueTotal(customerId,gridId,null,null,NumConstant.ONE_STR));
log.info("extractGridPioneerData 当前网格id=" + gridId + ";党员参与议事issueTotal="+entity.getIssueTotal());
//01.12新增:平台参与议事总数
int issueTotal=calPartyPartiIssueTotal(customerId,gridId,null,null,null);
entity.setPlatIssueTotal(issueTotal);
log.info("extractGridPioneerData 当前网格id=" + gridId + ";参与议事总数issueTotal=" + issueTotal);
//2、党员参与议事占比
if(entity.getIssueTotal()==0){
entity.setIssueRatio(BigDecimal.ZERO);
}else{
//2、党员参与议事占比
int issueTotal=calPartyPartiIssueTotal(customerId,gridId,null,null,null);
BigDecimal issueRatio=new BigDecimal(entity.getIssueTotal()/issueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED));
BigDecimal issueRatio = new BigDecimal((double) entity.getIssueTotal() / issueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED));
log.info("extractGridPioneerData 当前网格id=" + gridId + ";issueRatio=" + issueRatio);
entity.setIssueRatio(issueRatio.setScale(NumConstant.SIX,RoundingMode.HALF_UP));
}
//3、党员发布话题:
entity.setTopicTotal(getTopicTotal(customerId, gridId, null));
log.info("extractGridPioneerData 当前网格id=" + gridId + ";党员发布话题topicTotal"+entity.getTopicTotal());
//当前网格内所有话题总数
int gridTopicTotal = getGridOrCommunityTopicTotal(customerId, gridId, null);
log.info("extractGridPioneerData 当前网格id=" + gridId + ";当前网格内所有话题总数gridTopicTotal="+gridTopicTotal);
//01.12新增:PLAT_TOPIC_TOTAL 当前组织维度,话题总数
entity.setPlatTopicTotal(gridTopicTotal);
//4、党员发布话题占比: 网格内注册党员发布的话题总数占 网格内话题总数的 比率
if (entity.getTopicTotal() == NumConstant.ZERO) {
entity.setTopicRatio(BigDecimal.ZERO);
} else {
//当前网格内所有话题总数
int gridTopicTotal = getGridOrCommunityTopicTotal(customerId, gridId, null);
if(gridTopicTotal == NumConstant.ZERO){
entity.setTopicRatio(BigDecimal.ZERO);
}else{
BigDecimal topicRatio=new BigDecimal(entity.getTopicTotal() / gridTopicTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED));
BigDecimal topicRatio = new BigDecimal((double) entity.getTopicTotal() / gridTopicTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED));
log.info("extractGridPioneerData 当前网格id=" + gridId + ";党员发布话题占比topicRatio="+topicRatio);
entity.setTopicRatio(topicRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
}
//当前网格内所有议题总数
int gridIssueTotal = getGridOrCommunityIssueTotal(customerId, gridId, null);
log.info("extractGridPioneerData 当前网格id=" + gridId + ";当前网格内所有议题总数=" + gridIssueTotal);
//01.12新增:PLAT_PUBLISH_ISSUE_TOTAL 当前组织维度,发布议题总数
entity.setPlatPublishIssueTotal(gridIssueTotal);
if (gridIssueTotal != NumConstant.ZERO) {
//5、党员发布议题
entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, gridId, null));
log.info("extractGridPioneerData 当前网格id=" + gridId + ";党员发布议题publishIssueTotal"+entity.getPublishIssueTotal());
//6、党员发布议题占比 : 占网格内所有议题的比率
if (entity.getPublishIssueTotal() == NumConstant.ZERO) {
entity.setPublishIssueRatio(BigDecimal.ZERO);
}else{
BigDecimal publishIssueRatio=new BigDecimal(entity.getPublishIssueTotal() / gridIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED));
BigDecimal publishIssueRatio=new BigDecimal((double)entity.getPublishIssueTotal() / gridIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED));
entity.setPublishIssueRatio(publishIssueRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
//7、议题转项目数
entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, gridId, null));
log.info("extractGridPioneerData 当前网格id=" + gridId +";议题转项目数shiftProjectTotal="+entity.getShiftProjectTotal());
//8、议题转项目占比 : 占网格内议题总数的比率
if(entity.getShiftProjectTotal() == NumConstant.ZERO){
entity.setShiftProjectRatio(BigDecimal.ZERO);
}else{
BigDecimal shiftProjectRatio=new BigDecimal(entity.getShiftProjectTotal() / gridIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED));
BigDecimal shiftProjectRatio = new BigDecimal((double) entity.getShiftProjectTotal() / gridIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED));
entity.setShiftProjectRatio(shiftProjectRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
}else{
// log.info("当前网格内所有议题总数="+gridIssueTotal);
log.info("extractGridPioneerData 当前网格id="+gridId+";当前网格内所有议题总数 gridIssueTotal =0 ");
entity.setPublishIssueTotal(NumConstant.ZERO);
entity.setPublishIssueRatio(BigDecimal.ZERO);
entity.setShiftProjectTotal(NumConstant.ZERO);
@ -125,18 +145,34 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
// 9、已解决项目
entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, gridId, null, DimObjectStatusConstant.RESOLVED));
log.info("extractGridPioneerData 当前网格id="+gridId+";已解决项目resolvedProjectTotal="+entity.getResolvedProjectTotal());
int closedProjectTotal = getGridOrCommunityClosedProjectTotal(customerId, gridId, null, null);
log.info("extractGridPioneerData 当前网格id="+gridId+";总结项目closedProjectTotal="+closedProjectTotal);
// 01.12新增:PLAT_CLOSED_PROJECT_TOTAL 当前组织维度,所有结案项目数
entity.setPlatClosedProjectTotal(closedProjectTotal);
// 10、占总结项目
if (entity.getResolvedProjectTotal() == NumConstant.ZERO) {
entity.setResolvedProjectRatio(BigDecimal.ZERO);
} else {
// 10、占总结项目
int closedProjectTotal = getGridOrCommunityClosedProjectTotal(customerId, gridId, null, null);
if(closedProjectTotal == NumConstant.ZERO){
entity.setResolvedProjectRatio(BigDecimal.ZERO);
}else {
BigDecimal resolvedProjectRatio=new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED));
BigDecimal resolvedProjectRatio = new BigDecimal((double) entity.getResolvedProjectTotal() / closedProjectTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED));
entity.setResolvedProjectRatio(resolvedProjectRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
}
//01.12: 新增指标:平台参与议事总人数、平台参与议事党员数、平台参与议事的党员占比
entity.setPlatJoinUserTotal(factOriginIssueLogDailyService.calPlatJoinUserTotal(customerId, gridId, null, null,null));
entity.setPlatJoinPartyTotal(factOriginIssueLogDailyService.calPlatJoinUserTotal(customerId, gridId, null, null,NumConstant.ONE_STR));
if (entity.getPlatJoinPartyTotal() == NumConstant.ZERO) {
entity.setPlatJoinPartyRatio(BigDecimal.ZERO);
} else {
BigDecimal platJoinPartyRatio = new BigDecimal((double) entity.getPlatJoinPartyTotal() / entity.getPlatJoinUserTotal()).multiply(new BigDecimal(NumConstant.ONE_HUNDRED));
entity.setPlatJoinPartyRatio(platJoinPartyRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
});
screenPioneerDataService.delAndSavePioneerData(customerId, OrgTypeConstant.GRID, IndexCalConstant.DELETE_SIZE, gridList);
}
@ -172,42 +208,60 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
String communityId = entity.getOrgId();
//1、党员参与议事
entity.setIssueTotal(calPartyPartiIssueTotal(customerId,null,communityId,null,NumConstant.ONE_STR));
log.info("extractCommunityPioneerData 当前communityId="+communityId+";党员参与议事issueTotal="+entity.getIssueTotal());
//01.12新增
int issueTotal=calPartyPartiIssueTotal(customerId,null,communityId,null,null);
log.info("extractCommunityPioneerData 当前communityId="+communityId+";参与议事总数issueTotal="+issueTotal);
entity.setPlatIssueTotal(issueTotal);
if(entity.getIssueTotal()==0){
entity.setIssueRatio(BigDecimal.ZERO);
}else{
//2、党员参与议事占比
int issueTotal=calPartyPartiIssueTotal(customerId,null,communityId,null,null);
entity.setIssueRatio(new BigDecimal(entity.getIssueTotal()/issueTotal).setScale(NumConstant.SIX,RoundingMode.HALF_UP));
entity.setIssueRatio(new BigDecimal((double)entity.getIssueTotal()/issueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX,RoundingMode.HALF_UP));
}
//3、党员发布话题:
entity.setTopicTotal(getTopicTotal(customerId, null, communityId));
log.info("extractCommunityPioneerData 当前communityId="+communityId+";党员发布话题topicTotal="+entity.getTopicTotal());
//01.12新增
//当前社区内所有话题总数
int communityTopicTotal = getGridOrCommunityTopicTotal(customerId, null, communityId);
log.info("extractCommunityPioneerData 当前communityId="+communityId+";当前社区内所有话题总数communityTopicTotal="+communityTopicTotal);
entity.setPlatTopicTotal(communityTopicTotal);
//4、党员发布话题占比: 社区内注册党员发布的话题总数占 社区内话题总数的 比率
if (entity.getTopicTotal() == NumConstant.ZERO) {
entity.setTopicRatio(BigDecimal.ZERO);
} else {
//当前社区内所有话题总数
int communityTopicTotal = getGridOrCommunityTopicTotal(customerId, null, communityId);
entity.setTopicRatio(communityTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / communityTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
entity.setTopicRatio(communityTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal((double)entity.getTopicTotal() / communityTopicTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
//01.12新增
//当前社区内所有议题总数
int communityIssueTotal = getGridOrCommunityIssueTotal(customerId, null, communityId);
log.info("extractCommunityPioneerData 当前communityId="+communityId+";当前社区内所有议题总数communityIssueTotal="+communityIssueTotal);
entity.setPlatPublishIssueTotal(communityIssueTotal);
if (communityIssueTotal != NumConstant.ZERO) {
//5、党员发布议题
entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, null, communityId));
log.info("extractCommunityPioneerData 当前communityId="+communityId+";党员发布议题publishIssueTotal="+entity.getPublishIssueTotal());
//6、党员发布议题占比 : 占社区内所有议题的比率
if (entity.getPublishIssueTotal() == NumConstant.ZERO) {
entity.setPublishIssueRatio(BigDecimal.ZERO);
}
entity.setPublishIssueRatio(communityIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getPublishIssueTotal() / communityIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
entity.setPublishIssueRatio(communityIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal((double)entity.getPublishIssueTotal() / communityIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
//7、议题转项目数
entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, null, communityId));
log.info("extractCommunityPioneerData 当前communityId="+communityId+";议题转项目数shiftProjectTotal="+entity.getShiftProjectTotal());
//8、议题转项目占比 : 占社区内议题总数的比率
entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / communityIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal((double)entity.getShiftProjectTotal() / communityIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}else{
// log.info("当前社区内所有议题总数="+communityIssueTotal);
log.info("extractCommunityPioneerData 当前communityId="+communityId+"communityIssueTotal =0");
entity.setPublishIssueTotal(NumConstant.ZERO);
entity.setPublishIssueRatio(BigDecimal.ZERO);
entity.setShiftProjectTotal(NumConstant.ZERO);
@ -217,12 +271,28 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
// 9、已解决项目
entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, null, communityId, DimObjectStatusConstant.RESOLVED));
log.info("extractCommunityPioneerData 当前communityId="+communityId+";已解决项目resolvedProjectTotal="+entity.getResolvedProjectTotal());
//01.12新增
int closedProjectTotal = getGridOrCommunityClosedProjectTotal(customerId, null, communityId, null);
log.info("extractCommunityPioneerData 当前communityId="+communityId+";总结项目closedProjectTotal="+closedProjectTotal);
entity.setPlatClosedProjectTotal(closedProjectTotal);
if (entity.getResolvedProjectTotal() == NumConstant.ZERO) {
entity.setResolvedProjectRatio(BigDecimal.ZERO);
} else {
// 10、占总结项目
int closedProjectTotal = getGridOrCommunityClosedProjectTotal(customerId, null, communityId, null);
entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal((double)entity.getResolvedProjectTotal() / closedProjectTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
//01.12: 新增指标:平台参与议事总人数、平台参与议事党员数、平台参与议事的党员占比
entity.setPlatJoinUserTotal(factOriginIssueLogDailyService.calPlatJoinUserTotal(customerId, null, communityId,null, null));
entity.setPlatJoinPartyTotal(factOriginIssueLogDailyService.calPlatJoinUserTotal(customerId, null, communityId,null, NumConstant.ONE_STR));
if (entity.getPlatJoinPartyTotal() == NumConstant.ZERO) {
entity.setPlatJoinPartyRatio(BigDecimal.ZERO);
} else {
BigDecimal platJoinPartyRatio = new BigDecimal((double) entity.getPlatJoinPartyTotal() / entity.getPlatJoinUserTotal()).multiply(new BigDecimal(NumConstant.ONE_HUNDRED));
entity.setPlatJoinPartyRatio(platJoinPartyRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
});
screenPioneerDataService.delAndSavePioneerData(customerId, OrgTypeConstant.AGENCY, IndexCalConstant.DELETE_SIZE, communityList);
@ -243,44 +313,63 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
} else {
entity.setAgencyPath(entity.getAgencyPids().concat(StrConstant.COLON).concat(entity.getOrgId()));
}
log.info("extractExceptCommunityPioneerData 当前orgId="+entity.getOrgId()+";agencyPath="+entity.getAgencyPath());
//1、党员参与议事
entity.setIssueTotal(calPartyPartiIssueTotal(customerId,null,null,entity.getAgencyPath(),NumConstant.ONE_STR));
log.info("extractExceptCommunityPioneerData 党员参与议事issueTotal="+entity.getIssueTotal());
//01.12新增
int issueTotal=calPartyPartiIssueTotal(customerId,null,null,entity.getAgencyPath(),null);
log.info("extractExceptCommunityPioneerData 平台参与议事issueTotal="+issueTotal);
entity.setPlatIssueTotal(issueTotal);
if(entity.getIssueTotal()==0){
entity.setIssueRatio(BigDecimal.ZERO);
}else{
//2、党员参与议事占比
int issueTotal=calPartyPartiIssueTotal(customerId,null,null,entity.getAgencyPath(),null);
entity.setIssueRatio(new BigDecimal(entity.getIssueTotal()/issueTotal).setScale(NumConstant.SIX,RoundingMode.HALF_UP));
entity.setIssueRatio(new BigDecimal((double)entity.getIssueTotal()/issueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX,RoundingMode.HALF_UP));
}
//3、党员发布话题:
entity.setTopicTotal(getAgencyTopicTotal(customerId, entity.getAgencyPath(),NumConstant.ONE_STR));
log.info("extractExceptCommunityPioneerData 党员发布话题topicTotal="+entity.getTopicTotal());
//01.12新增
//当前组织内所有话题总数
int agencyTopicTotal = getAgencyTopicTotal(customerId, entity.getAgencyPath(),null);
log.info("extractExceptCommunityPioneerData 当前组织内所有话题总数agencyTopicTotal="+agencyTopicTotal);
entity.setPlatTopicTotal(agencyTopicTotal);
//4、党员发布话题占比: 组织内注册党员发布的话题总数占 组织内话题总数的 比率
if (entity.getTopicTotal() == NumConstant.ZERO) {
entity.setTopicRatio(BigDecimal.ZERO);
} else {
//当前组织内所有话题总数
int agencyTopicTotal = getAgencyTopicTotal(customerId, entity.getAgencyPath(),null);
entity.setTopicRatio(agencyTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / agencyTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
entity.setTopicRatio(agencyTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal((double)entity.getTopicTotal() / agencyTopicTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
//01.12新增
//当前组织内所有议题总数
int agencyIssueTotal = getAgencyIssueTotal(customerId, entity.getAgencyPath());
log.info("extractExceptCommunityPioneerData 当前组织内所有议题总数agencyIssueTotal="+agencyIssueTotal);
entity.setPlatPublishIssueTotal(agencyIssueTotal);
if (agencyIssueTotal != NumConstant.ZERO) {
//5、党员发布议题
entity.setPublishIssueTotal(getAgencyParyPublishIssueTotal(customerId, entity.getAgencyPath()));
log.info("extractExceptCommunityPioneerData 党员发布议题publishIssueTotal="+entity.getPublishIssueTotal());
//6、党员发布议题占比 : 占社区内所有议题的比率
if (entity.getPublishIssueTotal() == NumConstant.ZERO) {
entity.setPublishIssueRatio(BigDecimal.ZERO);
}
entity.setPublishIssueRatio(agencyIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getPublishIssueTotal() / agencyIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
entity.setPublishIssueRatio(agencyIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal((double)entity.getPublishIssueTotal() / agencyIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
//7、议题转项目数
entity.setShiftProjectTotal(getAgencyShiftProjectTotal(customerId, entity.getAgencyPath()));
log.info("extractExceptCommunityPioneerData 议题转项目数shiftProjectTotal="+entity.getShiftProjectTotal());
//8、议题转项目占比 : 占网格内议题总数的比率
entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / agencyIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal((double)entity.getShiftProjectTotal() / agencyIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}else{
// log.info("当前组织内所有议题总数="+agencyIssueTotal);
log.info("extractExceptCommunityPioneerData 当前组织内所有议题总数agencyIssueTotal=0");
entity.setPublishIssueTotal(NumConstant.ZERO);
entity.setPublishIssueRatio(BigDecimal.ZERO);
entity.setShiftProjectTotal(NumConstant.ZERO);
@ -290,13 +379,30 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
// 9、已解决项目
entity.setResolvedProjectTotal(getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), DimObjectStatusConstant.RESOLVED));
log.info("extractExceptCommunityPioneerData 已解决项目resolvedProjectTotal="+entity.getResolvedProjectTotal());
//01.12新增
int closedProjectTotal = getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), null);
log.info("extractExceptCommunityPioneerData 总结项目closedProjectTotal="+closedProjectTotal);
entity.setPlatClosedProjectTotal(closedProjectTotal);
if (entity.getResolvedProjectTotal() == NumConstant.ZERO) {
entity.setResolvedProjectRatio(BigDecimal.ZERO);
} else {
// 10、占总结项目
int closedProjectTotal = getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), null);
entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal((double)entity.getResolvedProjectTotal() / closedProjectTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
//01.12: 新增指标:平台参与议事总人数、平台参与议事党员数、平台参与议事的党员占比
entity.setPlatJoinUserTotal(factOriginIssueLogDailyService.calPlatJoinUserTotal(customerId, null, null, entity.getAgencyPath(), null));
entity.setPlatJoinPartyTotal(factOriginIssueLogDailyService.calPlatJoinUserTotal(customerId, null, null, entity.getAgencyPath(), NumConstant.ONE_STR));
if (entity.getPlatJoinPartyTotal() == NumConstant.ZERO) {
entity.setPlatJoinPartyRatio(BigDecimal.ZERO);
} else {
BigDecimal platJoinPartyRatio = new BigDecimal((double) entity.getPlatJoinPartyTotal() / entity.getPlatJoinUserTotal()).multiply(new BigDecimal(NumConstant.ONE_HUNDRED));
entity.setPlatJoinPartyRatio(platJoinPartyRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
});
screenPioneerDataService.delAndSavePioneerData(customerId, OrgTypeConstant.AGENCY, IndexCalConstant.DELETE_SIZE, agencyList);

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

@ -184,6 +184,8 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
List<ScreenDifficultyImgDataEntity> imgList = new LinkedList<>();
imgMap.values().forEach(list -> {imgList.addAll(list);});
difficulties.removeIf( diff -> StringUtils.isBlank(diff.getLatestOperateDesc()));
screenDifficultyDataService.dataClean(param.getCustomerId(),difficulties,imgList);
log.info("【大屏数据抽取-难点赌点执行完毕】 客户Id{} 难点赌点数据{}",param.getCustomerId(),JSON.toJSONString(difficulties));
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java

@ -186,7 +186,7 @@ public class DimGridServiceImpl extends BaseServiceImpl<DimGridDao, DimGridEntit
**/
@Override
public List<GridAttributesResultDTO> getGridAttributes(String customerId,List<String> gridIds) {
if(CollectionUtils.isEmpty(gridIds)) return Collections.EMPTY_LIST;
return baseDao.selectGridAttributes(customerId,gridIds);
}
}

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

@ -97,7 +97,7 @@
</foreach>
</where>
</delete>
<delete id="deleteSpecifiedDateData">
DELETE FROM
fact_origin_group_main_daily
@ -287,8 +287,8 @@
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
AND GROUP_STATE = 'approved'
AND IS_OWNER_PARTY = 1
AND
(
<foreach collection="gridIds" item="gridId" separator=" OR ">
@ -338,4 +338,4 @@
AND f.GROUP_STATE = 'approved'
GROUP BY f.AGENCY_ID
</select>
</mapper>
</mapper>

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

@ -153,4 +153,28 @@
and m.PIDS LIKE CONCAT(#{pids},'%')
</if>
</select>
<!-- 大屏:先锋模范:计算 平台参与议事总人数、平台参与议事党员数-->
<select id="selectPlatJoinUserTotal" parameterType="map" resultType="int">
SELECT
count( DISTINCT m.OPERATION_USER_ID ) as total
FROM
fact_origin_issue_log_daily m
WHERE
m.DEL_FLAG = '0'
and m.ACTION_CODE like'vote_%'
and m.CUSTOMER_ID=#{customerId}
<if test='null != gridId and "" != gridId'>
and m.GRID_ID=#{gridId}
</if>
<if test='null != communityId and "" != communityId'>
AND M.AGENCY_ID=#{communityId}
</if>
<if test='null != agencyPath and "" != agencyPath'>
AND M.PIDS LIKE CONCAT(#{agencyPath},'%')
</if>
<if test='null != isParty and "" != isParty'>
and M.IS_PARTY=#{isParty}
</if>
</select>
</mapper>

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

@ -39,9 +39,12 @@
fact_origin_project_org_period_daily
WHERE
DEL_FLAG = '0'
<foreach collection="list" open="AND ( " close=" )" separator=" OR " item="item">
PROJECT_ID = #{item}
</foreach>
AND CUSTOMER_ID = #{customerId}
<if test="null != list and list.size() > 0">
<foreach collection="list" open="AND ( " close=" )" separator=" OR " item="item">
PROJECT_ID = #{item}
</foreach>
</if>
</delete>
<select id="selectResponsiveness" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">

18
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml

@ -188,7 +188,14 @@
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME,
DATA_END_TIME
DATA_END_TIME,
PLAT_ISSUE_TOTAL,
PLAT_JOIN_USER_TOTAL,
PLAT_JOIN_PARTY_TOTAL,
PLAT_JOIN_PARTY_RATIO,
PLAT_TOPIC_TOTAL,
PLAT_PUBLISH_ISSUE_TOTAL,
PLAT_CLOSED_PROJECT_TOTAL
) values
<foreach collection="list" item="item" index="index" separator=",">
(
@ -214,7 +221,14 @@
now(),
'APP_USER',
now(),
#{item.dataEndTime}
#{item.dataEndTime},
#{item.platIssueTotal},
#{item.platJoinUserTotal},
#{item.platJoinPartyTotal},
#{item.platJoinPartyRatio},
#{item.platTopicTotal},
#{item.platPublishIssueTotal},
#{item.platClosedProjectTotal}
)
</foreach>
</insert>

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml

@ -186,7 +186,7 @@
oper.UPDATED_TIME AS joinDate,
IF(groupp.CREATED_BY = oper.CUSTOMER_USER_ID,'leader','member') AS leaderFlag,
groupp.CREATED_BY AS groupOwnerId,
'join' AS actionCode
IF(groupp.CREATED_BY = oper.CUSTOMER_USER_ID,'join','create') AS actionCode
FROM
RESI_GROUP groupp

8
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml

@ -56,9 +56,10 @@
ps.ORG_ID_PATH AS pids,
pp.CREATED_TIME
FROM project_staff ps
INNER JOIN project_process pp ON ps.PROCESS_ID = pp.ID
INNER JOIN project p ON pp.PROJECT_ID = p.ID
INNER JOIN project_process pp ON ps.PROCESS_ID = pp.ID AND pp.DEL_FLAG = '0'
INNER JOIN project p ON pp.PROJECT_ID = p.ID AND p.DEL_FLAG = '0'
WHERE p.CUSTOMER_ID = #{customerId}
AND ps.DEL_FLAG = '0'
<if test="date != null and date.trim() != ''">
AND DATE_FORMAT(pp.CREATED_TIME, '%Y%m%d') = #{date}
</if>
@ -296,12 +297,13 @@
pp.CREATED_TIME
FROM
project_process pp
INNER JOIN project p ON pp.PROJECT_ID = p.ID
INNER JOIN project p ON pp.PROJECT_ID = p.ID AND p.DEL_FLAG = '0'
LEFT JOIN project_staff ps ON pp.PROJECT_ID = ps.PROJECT_ID
AND pp.STAFF_ID = ps.STAFF_ID
AND pp.DEPARTMENT_NAME = ps.DEPARTMENT_NAME
WHERE
1=1
AND pp.DEL_FLAG = '0'
AND p.CUSTOMER_ID = #{customerId}
AND pp.OPERATION = 'response'
<if test="date != null and date.trim() != ''">

15
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml

@ -104,11 +104,14 @@
dg.DEL_FLAG = '0'
AND da.DEL_FLAG = '0'
AND da.CUSTOMER_ID = #{customerId}
AND
(
<foreach collection="gridIds" item="gridId" separator=" OR ">
dg.id = #{gridId}
</foreach>
)
<if test="null != gridIds and gridIds.size() > 0">
AND
(
<foreach collection="gridIds" item="gridId" separator=" OR ">
dg.id = #{gridId}
</foreach>
)
</if>
</select>
</mapper>

2
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/constant/AreaCodeConstant.java

@ -24,4 +24,6 @@ public interface AreaCodeConstant {
String ROOT_AGENCY_LEVEL_IS_LEVEL = "RootAreaLevel为空......";
String LEVEL_ERROR = "RootAreaLevel填写错误【%s】";
}

2
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java

@ -313,6 +313,8 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
tree = disposeAfterTwoLevel(formDTO);
}else if (formDTO.getRootAreaLevel().equals(AreaCodeConstant.PROVINCE) || formDTO.getRootAreaLevel().equals(AreaCodeConstant.CITY) || formDTO.getRootAreaLevel().equals(AreaCodeConstant.DISTRICT)){
tree = disposeBeforeThreeLevelFinal(formDTO,tree);
}else {
throw new RenException(String.format(AreaCodeConstant.LEVEL_ERROR,formDTO.getRootAreaLevel()));
}
return tree;
}

6
epmet-module/epmet-job/epmet-job-server/pom.xml

@ -79,6 +79,12 @@
<artifactId>feign-httpclient</artifactId>
<version>10.3.0</version>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>resi-group-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

12
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/TopicAutoAuditService.java

@ -0,0 +1,12 @@
package com.epmet.service;
import com.epmet.commons.tools.utils.Result;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/12/29 17:45
*/
public interface TopicAutoAuditService {
Result autoAudit();
}

24
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/TopicAutoAuditServiceImpl.java

@ -0,0 +1,24 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.utils.Result;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import com.epmet.service.TopicAutoAuditService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/12/29 17:46
*/
@Service
public class TopicAutoAuditServiceImpl implements TopicAutoAuditService {
@Autowired
private ResiGroupOpenFeignClient resiGroupOpenFeignClient;
@Override
public Result autoAudit() {
return resiGroupOpenFeignClient.autoAudit();
}
}

31
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/TopicAutoAuditTask.java

@ -0,0 +1,31 @@
package com.epmet.task;
import com.epmet.commons.tools.utils.Result;
import com.epmet.service.TopicAutoAuditService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/12/29 17:43
*/
@Slf4j
@Component("topicAutoAuditTask")
public class TopicAutoAuditTask implements ITask {
@Autowired
private TopicAutoAuditService topicAutoAuditService;
@Override
public void run(String params) {
log.info("TopicAutoAuditTask定时任务正在执行,参数为:{}", params);
Result result = topicAutoAuditService.autoAudit();
if (result.success()) {
log.info("TopicAutoAuditTask定时任务执行成功");
} else {
log.error("TopicAutoAuditTask定时任务执行失败:" + result.getMsg());
}
}
}

10
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SmsTemplateConstant.java

@ -27,4 +27,14 @@ public interface SmsTemplateConstant {
* 修改密码验证码
*/
String CHANGE_PASSWORD = "SMS_150731393";
/**
* 项目被吹哨提醒
*/
String PROJECT_TRANSFER = "SMS_200187239";
/**
* 项目滞留提醒
*/
String PROJECT_OVERDUE = "SMS_206885207";
}

19
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SysSmsConstant.java

@ -0,0 +1,19 @@
package com.epmet.constant;
/**
* @Author zxc
* @DateTime 2021/1/4 下午1:42
*/
public interface SysSmsConstant {
String IS_NULL_PARAM_LIST = "项目流转或滞留推送短信提醒入参集合为空......";
String SELECT_PARAMETER_INFO_FAILURE = "查询客户配置参数失败......";
String PARAMETER_INFO_IS_ZERO = "未查到客户配置参数......";
String NOT_ENOUGH_BALANCE = "客户:%s ,当前余额为:%s";
String NOT_ON_SWITCH = "客户:%s ,【%s】开关未开启";
}

7
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageSendApproach.java

@ -0,0 +1,7 @@
package com.epmet.constant;
public interface SystemMessageSendApproach {
String MQ = "mq";
}

13
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java

@ -0,0 +1,13 @@
package com.epmet.constant;
/**
* 系统消息类型
*/
public interface SystemMessageType {
/**
* 初始化客户
*/
String INIT_CUSTOMER = "init_customer";
}

88
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/WxmpMessageConstant.java

@ -0,0 +1,88 @@
package com.epmet.constant;
import java.util.HashMap;
import java.util.Map;
/**
* @description: 微信订阅消息常量
* @author: liushaowen
* @date: 2020/10/21 17:45
*/
public interface WxmpMessageConstant {
String SEND_MESSAGE = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=";
String ERR_CODE = "errcode";
String ERR_MSG = "errmsg";
int USER_REFUSED = 43101;
String AUTHORIZER_ACCESS_TOKEN = "authorizerAccessToken";
String RESI = "resi";
String GOV_REDIS = "work";
String GOV_DB = "gov";
String ACCESS_TOKEN = "access_token";
String TOUSER = "touser";
String TEMPLATE_ID = "template_id";
/*站内信模板start*/
String MESSAGE_TEMPLATE_TYPE = "1832";
String MESSAGE_TITLE = "thing5";
String MESSAGE_CONTENT = "thing4";
String MESSAGE_TIME = "date2";
/*站内信模板end*/
/**关注更新提醒模板start**/
String CONCERN_UPDATE_TEMPLATE_TYPE = "8171";
String CONCERN_UPDATE_TITLE = "thing5";
String CONCERN_UPDATE_TITLE_TEXT = "话题状态提醒";
String CONCERN_UPDATE_CONTENT = "thing7";
String CONCERN_UPDATE_CONTENT_TEXT = "你关注的话题已被转为议题,请点击查看。";
String CONCERN_UPDATE_TIME = "time6";
/**关注更新提醒模板end**/
/**内容更新消息通知模板start**/
String CONTENT_UPDATE_TEMPLATE_TYPE = "2092";
String CONTENT_UPDATE_TITLE = "name4";
String CONTENT_UPDATE_TITLE_TEXT = "新评论提醒";
String CONTENT_UPDATE_CONTENT = "thing9";
String CONTENT_UPDATE_CONTENT_TEXT = "你关注的话题收到新评论,请点击查看。";
String CONTENT_UPDATE_TIME = "date3";
/**内容更新消息通知模板end**/
/** 消息来源start**/
//话题
String SOURCE_TYPE_TOPIC = "topic";
//议题
String SOURCE_TYPE_ISSUE = "issue";
/** 消息来源end**/
String PAGE = "page";
String MESSAGE_PAGE_URL = "/subpages/mine/pages/message/skip";
String UPDATE_PAGE_URL = "/pages/index/subscribe?id=";
int TITLE_LIMIT = 20;
int MESSAGE_CONTENT_LIMIT = 20;
String DATA = "data";
String MINIPROGRAM_STATE = "miniprogram_state";
String SUCCESS = "success";
String ERROR = "error";
String STATE_DEV = "developer";
String STATE_TEST = "trial";
}

111
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpUpdateSendDataDTO.java

@ -0,0 +1,111 @@
/**
* 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.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 订阅消息发送数据表(内容更新消息提醒关注更新提醒)
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-01-04
*/
@Data
public class WxmpUpdateSendDataDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 来源类型 (话题:topic 议题:issue 项目project 爱心互助heart 党建声音voice)
*/
private String sourceType;
/**
* 来源对应ID
*/
private String sourceId;
/**
* 客户ID
*/
private String customerId;
/**
* 组织ID agencyId
*/
private String agencyId;
/**
* 网格ID
*/
private String gridId;
/**
* 小组Id
*/
private String groupId;
/**
* 工作人员Id
*/
private String staffId;
/**
* 消息接收者
*/
private String msgUserId;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

131
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpUpdateSendRecordDTO.java

@ -0,0 +1,131 @@
/**
* 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.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 订阅消息发送记录表(内容更新消息提醒关注更新提醒)
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-12-30
*/
@Data
public class WxmpUpdateSendRecordDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 网格Id 居民端跟网格有关的则有值工作端以及一些居民端和网格没关的存*
*/
private String gridId;
/**
* 所属端类型 居民端:resi 工作端:gov
*/
private String clientType;
/**
* 消息模板Id
*/
private String templateId;
/**
* 用户Id
*/
private String userId;
/**
* openId
*/
private String wxOpenId;
/**
* 行为类型: 关注更新提醒内容更新消息通知
*/
private String behaviorType;
/**
* 消息标题
*/
private String title;
/**
* 消息内容
*/
private String content;
/**
* 消息时间
*/
private Date time;
/**
* 发送结果(成功success 失败error)
*/
private String result;
/**
* 发送失败的原因成功可以不记录
*/
private String reason;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

43
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/ProjectSendMsgFormDTO.java

@ -0,0 +1,43 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 项目提醒--根据手机号短信模板编码发送短信 验证码
*
* @author sun
*/
@Data
public class ProjectSendMsgFormDTO implements Serializable {
private static final long serialVersionUID = 8894395590639206399L;
/**
* 手机号
*/
@NotBlank(message = "手机号不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class})
private String mobile;
/**
* 场景
*/
@NotBlank(message = "短信模板编码不能为空", groups = {AddUserInternalGroup.class})
private String aliyunTemplateCode;
/**
* 客户ID
*/
@NotBlank(message = "客户ID不能为空", groups = {AddUserInternalGroup.class})
private String customerId;
/**
* 参数KEY(发短信:send_msg;)
*/
@NotBlank(message = "参数KEY不能为空", groups = {AddUserInternalGroup.class})
private String parameterKey;
public interface AddUserInternalGroup {}
public interface AddUserShowGroup extends CustomerClientShowGroup {}
}

15
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SystemMsgFormDTO.java

@ -0,0 +1,15 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
public class SystemMsgFormDTO {
@NotNull(message = "消息类型不能为空")
private String messageType;
@NotNull(message = "消息内容不能为空")
private Object content;
}

86
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/WxSubscribeUpdateFormDTO.java

@ -0,0 +1,86 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
/**
* @description: 微信订阅消息FormDTO
* @author: liushaowen
* @date: 2020/10/21 14:29
*/
@Data
public class WxSubscribeUpdateFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
@NotBlank(message = "客户id不能为空")
private String customerId;
/**
* 客户端类型 居民端:resi 工作端:work
*/
@NotBlank(message = "客户端类型不能为空")
private String clientType;
/**
* 接收者用户 userId
*/
@NotBlank(message = "接收用户id不能为空")
private String userId;
/**
* 来源类型 (话题:topic 议题:issue 项目project 爱心互助heart 党建声音voice)
*/
@NotBlank(message = "来源类型不能为空")
private String sourceType;
/**
* 来源对应id
*/
@NotBlank(message = "来源id不能为空")
private String sourceId;
/**
* 行为类型 传模板的tid
*/
@NotBlank(message = "行为类型不能为空")
private String behaviorType;
@NotBlank(message = "消息标题不能为空")
private String messageTitle;
/**
* 消息内容
*/
@NotBlank(message = "消息内容不能为空")
private String messageContent;
/**
* 消息时间
*/
@NotNull(message = "消息时间不能为空")
private Date messageTime;
/**
* 网格id
*/
private String gridId;
/**
* 工作人员id
*/
private String staffId;
/**
* 群id
*/
private String groupId;
/**
* 组织id
*/
private String agencyId;
}

29
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java

@ -3,9 +3,12 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.SysSmsDTO;
import com.epmet.dto.form.ProjectSendMsgFormDTO;
import com.epmet.dto.form.SendVerificationCodeFormDTO;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.dto.form.WxSubscribeMessageFormDTO;
import com.epmet.dto.form.WxSubscribeUpdateFormDTO;
import com.epmet.dto.result.SendVerificationCodeResultDTO;
import com.epmet.feign.fallback.EpmetMessageOpenFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
@ -77,4 +80,30 @@ public interface EpmetMessageOpenFeignClient {
**/
@PostMapping(value = "message/wxmpmessage/sendwxsubscribemessage", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result sendWxSubscribeMessage(List<WxSubscribeMessageFormDTO> msgList);
/**
* @param formDTOList
* @author sun
* @description 项目流转或滞留推送短信提醒
**/
@PostMapping(value = "message/sms/projectsendmsg", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result projectSendMsg(List<ProjectSendMsgFormDTO> formDTOList);
/**
* @param msgList
* @return com.epmet.commons.tools.utils.Result
* @Author liushaowen
* @Description 发送微信订阅消息
**/
@PostMapping(value = "message/wxmpmessage/sendwxsubscribeupdate", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result sendWxSubscribeUpdate(List<WxSubscribeUpdateFormDTO> msgList);
/**
* @Description 通过mq发送系统消息
* @return
* @author wxz
* @date 2021.01.06 15:16
*/
@PostMapping("/message/system/send-by-mq")
Result sendSystemMsgByMQ(@RequestBody SystemMsgFormDTO form);
}

18
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java

@ -4,9 +4,12 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.SysSmsDTO;
import com.epmet.dto.form.ProjectSendMsgFormDTO;
import com.epmet.dto.form.SendVerificationCodeFormDTO;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.dto.form.WxSubscribeMessageFormDTO;
import com.epmet.dto.form.WxSubscribeUpdateFormDTO;
import com.epmet.dto.result.SendVerificationCodeResultDTO;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import org.springframework.stereotype.Component;
@ -51,4 +54,19 @@ public class EpmetMessageOpenFeignClientFallback implements EpmetMessageOpenFeig
public Result sendWxSubscribeMessage(List<WxSubscribeMessageFormDTO> msgList) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "sendWxSubscribeMessage", msgList);
}
@Override
public Result projectSendMsg(List<ProjectSendMsgFormDTO> formDTOList) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "projectSendMsg", formDTOList);
}
@Override
public Result sendWxSubscribeUpdate(List<WxSubscribeUpdateFormDTO> msgList) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "sendWxSubscribeUpdate", msgList);
}
@Override
public Result sendSystemMsgByMQ(SystemMsgFormDTO form) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "sendSystemMsgByMQ", form);
}
}

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

@ -112,6 +112,19 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<!-- crm -->
<dependency>
<groupId>com.epmet</groupId>
<artifactId>oper-crm-client</artifactId>
<version>2.0.0</version>
</dependency>
<!--rocketmq-->
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-rocketmq</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>
<build>
@ -178,6 +191,10 @@
</dingTalk.robot.webHook>
<dingTalk.robot.secret>SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19
</dingTalk.robot.secret>
<!--rocketmq-->
<rocketmq.nameserver>192.168.1.130:9876;192.168.1.132:9876</rocketmq.nameserver>
<rocketmq.producer.group>epmet_message</rocketmq.producer.group>
</properties>
</profile>
<profile>
@ -222,6 +239,10 @@
</dingTalk.robot.webHook>
<dingTalk.robot.secret>SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19
</dingTalk.robot.secret>
<!--rocketmq-->
<rocketmq.nameserver>192.168.1.130:9876;192.168.1.132:9876</rocketmq.nameserver>
<rocketmq.producer.group>epmet_message</rocketmq.producer.group>
</properties>
</profile>
<profile>
@ -266,6 +287,10 @@
</dingTalk.robot.webHook>
<dingTalk.robot.secret>SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19
</dingTalk.robot.secret>
<!--rocketmq-->
<rocketmq.nameserver>192.168.10.161:9876</rocketmq.nameserver>
<rocketmq.producer.group>epmet_message</rocketmq.producer.group>
</properties>
</profile>
<profile>
@ -307,6 +332,10 @@
</dingTalk.robot.webHook>
<dingTalk.robot.secret>SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1
</dingTalk.robot.secret>
<!--rocketmq-->
<rocketmq.nameserver>192.168.11.187:9876;192.168.11.184:9876</rocketmq.nameserver>
<rocketmq.producer.group>epmet_message</rocketmq.producer.group>
</properties>
</profile>
</profiles>

63
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/constant/WxmpMessageConstant.java

@ -1,63 +0,0 @@
package com.epmet.constant;
import java.util.HashMap;
import java.util.Map;
/**
* @description: 微信订阅消息常量
* @author: liushaowen
* @date: 2020/10/21 17:45
*/
public interface WxmpMessageConstant {
String SEND_MESSAGE = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=";
String ERR_CODE = "errcode";
String ERR_MSG = "errmsg";
int USER_REFUSED = 43101;
String AUTHORIZER_ACCESS_TOKEN = "authorizerAccessToken";
String RESI = "resi";
String GOV_REDIS = "work";
String GOV_DB = "gov";
String ACCESS_TOKEN = "access_token";
String TOUSER = "touser";
String TEMPLATE_ID = "template_id";
String TEMPLATE_TYPE = "1832";
String PAGE = "page";
String PAGE_URL = "/subpages/mine/pages/message/skip";
String TITLE = "thing5";
int TITLE_LIMIT = 20;
String MESSAGE_CONTENT = "thing4";
int MESSAGE_CONTENT_LIMIT = 20;
String MESSAGE_TIME = "date2";
String DATA = "data";
String MINIPROGRAM_STATE = "miniprogram_state";
String SUCCESS = "success";
String ERROR = "error";
String STATE_DEV = "developer";
String STATE_TEST = "trial";
}

17
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SmsController.java

@ -16,6 +16,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AliyunGroup;
import com.epmet.commons.tools.validator.group.QcloudGroup;
import com.epmet.dto.SysSmsDTO;
import com.epmet.dto.form.ProjectSendMsgFormDTO;
import com.epmet.dto.form.SendVerificationCodeFormDTO;
import com.epmet.dto.result.SendVerificationCodeResultDTO;
import com.epmet.enums.PlatformEnum;
@ -32,6 +33,7 @@ import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
@ -139,4 +141,19 @@ public class SmsController {
SendVerificationCodeResultDTO resultDTO=sysSmsService.sendVerificationCode(formDTO);
return new Result<SendVerificationCodeResultDTO>().ok(resultDTO);
}
/**
* @param formDTOList
* @author sun
* @description 项目流转或滞留推送短信提醒
**/
@PostMapping("projectsendmsg")
public Result projectSendMsg(@RequestBody List<ProjectSendMsgFormDTO> formDTOList) {
for (ProjectSendMsgFormDTO formDTO : formDTOList) {
ValidatorUtils.validateEntity(formDTO, ProjectSendMsgFormDTO.AddUserShowGroup.class, ProjectSendMsgFormDTO.AddUserInternalGroup.class);
}
sysSmsService.projectSendMsg(formDTOList);
return new Result();
}
}

27
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SystemMessageController.java

@ -0,0 +1,27 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.service.SystemMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("system")
public class SystemMessageController {
@Autowired
private SystemMessageService systemMessageService;
@PostMapping("send-by-mq")
public Result sendSystemMsgByMQ(@RequestBody SystemMsgFormDTO form) {
ValidatorUtils.validateEntity(form);
systemMessageService.sendMQMessage(form.getMessageType(), form.getContent());
return new Result();
}
}

40
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpMessageController.java

@ -21,11 +21,9 @@ import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.ActivationSubscribeFormDTO;
import com.epmet.dto.form.GetTemplateListFormDTO;
import com.epmet.dto.form.WxMsgAuthInfoFormDTO;
import com.epmet.dto.form.WxSubscribeMessageFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.GetTemplateListResultDTO;
import com.epmet.dto.result.TemplateListV2ResultDTO;
import com.epmet.dto.result.WxMsgAuthInfoResultDTO;
import com.epmet.service.WxmpMessageService;
import org.slf4j.Logger;
@ -100,9 +98,27 @@ public class WxmpMessageController {
return new Result();
}
@PostMapping("sendwxsubscribeupdate")
public Result sendWxSubscribeUpdate(@RequestBody List<WxSubscribeUpdateFormDTO> msgList){
for (WxSubscribeUpdateFormDTO wxSubscribeUpdateFormDTO : msgList) {
ValidatorUtils.validateEntity(wxSubscribeUpdateFormDTO);
}
executorService.execute(() -> {
try {
long startTs = System.currentTimeMillis();
wxmpMessageService.sendWxSubscribeUpdate(msgList);
long endTs = System.currentTimeMillis();
logger.info("异步发送消息成功,执行时长:{}", endTs - startTs);
} catch (Exception e) {
logger.error("异步发送消息失败,错误信息:{}", ExceptionUtils.getErrorStackTrace(e));
}
});
return new Result();
}
/**
* @return
* @Description 居民端工作端-获取客户小程序模板列表
* @Description 居民端工作端-获取客户小程序模板列表(只有站内信模板)
* @author sun
*/
@PostMapping("templatelist")
@ -110,6 +126,18 @@ public class WxmpMessageController {
ValidatorUtils.validateEntity(formDTO, GetTemplateListFormDTO.AddUserInternalGroup.class);
return new Result<List<GetTemplateListResultDTO>>().ok(wxmpMessageService.templateList(formDTO));
}
/**
* @Description 居民端工作端-获取客户小程序模板列表(除了站内信模板)
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<TemplateListV2ResultDTO>
* @Author liushaowen
* @Date 2020/12/29 13:18
*/
@PostMapping("templatelistv2")
public Result<List<TemplateListV2ResultDTO>> templateListV2(@RequestBody TemplateListV2FormDTO formDTO){
ValidatorUtils.validateEntity(formDTO);
return new Result<List<TemplateListV2ResultDTO>>().ok(wxmpMessageService.templateListV2(formDTO));
}
/**
* @Description 查询用户授权信息
@ -159,4 +187,4 @@ public class WxmpMessageController {
return new Result();
}
}
}

98
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpUpdateSendDataController.java

@ -0,0 +1,98 @@
/**
* 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.controller;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.WxmpUpdateSendDataDTO;
import com.epmet.excel.WxmpUpdateSendDataExcel;
import com.epmet.service.WxmpUpdateSendDataService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 订阅消息发送数据表(内容更新消息提醒关注更新提醒)
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-01-04
*/
@RestController
@RequestMapping("wxmpupdatesenddata")
public class WxmpUpdateSendDataController {
@Autowired
private WxmpUpdateSendDataService wxmpUpdateSendDataService;
@GetMapping("page")
public Result<PageData<WxmpUpdateSendDataDTO>> page(@RequestParam Map<String, Object> params){
PageData<WxmpUpdateSendDataDTO> page = wxmpUpdateSendDataService.page(params);
return new Result<PageData<WxmpUpdateSendDataDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<WxmpUpdateSendDataDTO> get(@PathVariable("id") String id){
if (StringUtils.isBlank(id) || "undefined".equals(id)){
return new Result().error(8000,"id不能为空");
}
WxmpUpdateSendDataDTO data = wxmpUpdateSendDataService.get(id);
return new Result<WxmpUpdateSendDataDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody WxmpUpdateSendDataDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
wxmpUpdateSendDataService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody WxmpUpdateSendDataDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
wxmpUpdateSendDataService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
wxmpUpdateSendDataService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<WxmpUpdateSendDataDTO> list = wxmpUpdateSendDataService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, WxmpUpdateSendDataExcel.class);
}
}

94
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpUpdateSendRecordController.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.controller;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.WxmpUpdateSendRecordDTO;
import com.epmet.excel.WxmpUpdateSendRecordExcel;
import com.epmet.service.WxmpUpdateSendRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 订阅消息发送记录表(内容更新消息提醒关注更新提醒)
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-12-30
*/
@RestController
@RequestMapping("wxmpupdatesendrecord")
public class WxmpUpdateSendRecordController {
@Autowired
private WxmpUpdateSendRecordService wxmpUpdateSendRecordService;
@GetMapping("page")
public Result<PageData<WxmpUpdateSendRecordDTO>> page(@RequestParam Map<String, Object> params){
PageData<WxmpUpdateSendRecordDTO> page = wxmpUpdateSendRecordService.page(params);
return new Result<PageData<WxmpUpdateSendRecordDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<WxmpUpdateSendRecordDTO> get(@PathVariable("id") String id){
WxmpUpdateSendRecordDTO data = wxmpUpdateSendRecordService.get(id);
return new Result<WxmpUpdateSendRecordDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody WxmpUpdateSendRecordDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
wxmpUpdateSendRecordService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody WxmpUpdateSendRecordDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
wxmpUpdateSendRecordService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
wxmpUpdateSendRecordService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<WxmpUpdateSendRecordDTO> list = wxmpUpdateSendRecordService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, WxmpUpdateSendRecordExcel.class);
}
}

33
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/SystemMessageDao.java

@ -0,0 +1,33 @@
/**
* 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.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.SystemMessageEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 系统消息表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-01-06
*/
@Mapper
public interface SystemMessageDao extends BaseDao<SystemMessageEntity> {
}

33
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpUpdateSendDataDao.java

@ -0,0 +1,33 @@
/**
* 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.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.WxmpUpdateSendDataEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 订阅消息发送数据表(内容更新消息提醒关注更新提醒)
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-01-04
*/
@Mapper
public interface WxmpUpdateSendDataDao extends BaseDao<WxmpUpdateSendDataEntity> {
}

33
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpUpdateSendRecordDao.java

@ -0,0 +1,33 @@
/**
* 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.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.WxmpUpdateSendRecordEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 订阅消息发送记录表(内容更新消息提醒关注更新提醒)
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-12-30
*/
@Mapper
public interface WxmpUpdateSendRecordDao extends BaseDao<WxmpUpdateSendRecordEntity> {
}

57
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/SystemMessageEntity.java

@ -0,0 +1,57 @@
/**
* 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.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.omg.CORBA.StringHolder;
import java.util.Date;
/**
* 系统消息表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-01-06
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("system_message")
public class SystemMessageEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 消息类型
*/
private String msgType;
/**
* 发送途径
*/
private String sendApproach;
/**
* 消息内容
*/
private String content;
}

81
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/WxmpUpdateSendDataEntity.java

@ -0,0 +1,81 @@
/**
* 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.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 订阅消息发送数据表(内容更新消息提醒关注更新提醒)
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-01-04
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("wxmp_update_send_data")
public class WxmpUpdateSendDataEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 来源类型 (话题:topic 议题:issue 项目project 爱心互助heart 党建声音voice)
*/
private String sourceType;
/**
* 来源对应ID
*/
private String sourceId;
/**
* 客户ID
*/
private String customerId;
/**
* 组织ID agencyId
*/
private String agencyId;
/**
* 网格ID
*/
private String gridId;
/**
* 小组Id
*/
private String groupId;
/**
* 工作人员Id
*/
private String staffId;
/**
* 消息接收者
*/
private String msgUserId;
}

101
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/WxmpUpdateSendRecordEntity.java

@ -0,0 +1,101 @@
/**
* 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.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 订阅消息发送记录表(内容更新消息提醒关注更新提醒)
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-12-30
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("wxmp_update_send_record")
public class WxmpUpdateSendRecordEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 网格Id 居民端跟网格有关的则有值工作端以及一些居民端和网格没关的存*
*/
private String gridId;
/**
* 所属端类型 居民端:resi 工作端:gov
*/
private String clientType;
/**
* 消息模板Id
*/
private String templateId;
/**
* 用户Id
*/
private String userId;
/**
* openId
*/
private String wxOpenId;
/**
* 行为类型: 关注更新提醒内容更新消息通知
*/
private String behaviorType;
/**
* 消息标题
*/
private String title;
/**
* 消息内容
*/
private String content;
/**
* 消息时间
*/
private Date time;
/**
* 发送结果(成功success 失败error)
*/
private String result;
/**
* 发送失败的原因成功可以不记录
*/
private String reason;
}

80
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/WxmpUpdateSendDataExcel.java

@ -0,0 +1,80 @@
/**
* 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.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 订阅消息发送数据表(内容更新消息提醒关注更新提醒)
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-01-04
*/
@Data
public class WxmpUpdateSendDataExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "来源类型 (话题:topic 议题:issue 项目project 爱心互助heart 党建声音voice)")
private String sourceType;
@Excel(name = "来源对应ID")
private String sourceId;
@Excel(name = "客户ID")
private String customerId;
@Excel(name = "组织ID agencyId")
private String agencyId;
@Excel(name = "网格ID ")
private String gridId;
@Excel(name = "小组Id")
private String groupId;
@Excel(name = "工作人员Id")
private String staffId;
@Excel(name = "消息接收者")
private String msgUserId;
@Excel(name = "删除标识 0未删除、1已删除")
private String delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

92
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/WxmpUpdateSendRecordExcel.java

@ -0,0 +1,92 @@
/**
* 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.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 订阅消息发送记录表(内容更新消息提醒关注更新提醒)
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-12-30
*/
@Data
public class WxmpUpdateSendRecordExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "客户Id ")
private String customerId;
@Excel(name = "网格Id (居民端跟网格有关的则有值,工作端以及一些居民端和网格没关的存*)")
private String gridId;
@Excel(name = "所属端类型 居民端:resi 工作端:gov")
private String clientType;
@Excel(name = "消息模板Id ")
private String templateId;
@Excel(name = "用户Id")
private String userId;
@Excel(name = "openId ")
private String wxOpenId;
@Excel(name = "行为类型: 关注更新提醒、内容更新消息通知")
private String behaviorType;
@Excel(name = "消息标题 ")
private String title;
@Excel(name = "消息内容 ")
private String content;
@Excel(name = "消息时间 ")
private Date time;
@Excel(name = "发送结果(成功:success 失败:error)")
private String result;
@Excel(name = "发送失败的原因,成功可以不记录")
private String reason;
@Excel(name = "删除标识")
private String delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

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

Loading…
Cancel
Save