Browse Source

Merge remote-tracking branch 'origin/dev_screen_data_2.0' into dev_temp

# Conflicts:
#	epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java
#	epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java
master
zxc 5 years ago
parent
commit
3e40a81a80
  1. 21
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/TimeListResultDTO.java
  2. 20
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java
  3. 1
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java
  4. 21
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java
  5. 13
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/StatsConstant.java
  6. 91
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/DimObjectActionDTO.java
  7. 86
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/DimObjectStatusDTO.java
  8. 136
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginIssueLogDailyDTO.java
  9. 152
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginIssueMainDailyDTO.java
  10. 25
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFormDTO.java
  11. 33
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueInfoFormDTO.java
  12. 112
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueLogDailyFormDTO.java
  13. 123
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java
  14. 25
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/AgencyInfoResultDTO.java
  15. 50
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueInfoResultDTO.java
  16. 45
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueProcessInfoResultDTO.java
  17. 45
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/SatisfactionInfoResultDTO.java
  18. 21
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/TopicInfoResultDTO.java
  19. 19
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/UserPartyResultDTO.java
  20. 35
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java
  21. 131
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerPartymemberDTO.java
  22. 24
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/CustomerIdAndDateIdFormDTO.java
  23. 104
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/DimCustomerPartyMemberFormDTO.java
  24. 30
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/GridBelongAgencyResultDTO.java
  25. 82
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicOriginInfoDTO.java
  26. 12
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java
  27. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java
  28. 24
      epmet-module/data-statistical/data-statistical-server/pom.xml
  29. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java
  30. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectStatusConstant.java
  31. 73
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  32. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java
  33. 76
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java
  34. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/DimObjectActionDao.java
  35. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/DimObjectStatusDao.java
  36. 54
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java
  37. 53
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java
  38. 55
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.java
  39. 57
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java
  40. 38
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java
  41. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java
  42. 29
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/partymember/PartyMemberDao.java
  43. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java
  44. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerDao.java
  45. 53
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java
  46. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java
  47. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java
  48. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java
  49. 61
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/DimObjectActionEntity.java
  50. 56
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/DimObjectStatusEntity.java
  51. 106
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginIssueLogDailyEntity.java
  52. 121
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginIssueMainDailyEntity.java
  53. 116
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicLogDailyEntity.java
  54. 106
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicMainDailyEntity.java
  55. 101
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerPartymemberEntity.java
  56. 39
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java
  57. 51
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java
  58. 35
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicLogDailyService.java
  59. 46
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicMainDailyService.java
  60. 26
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java
  61. 36
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicLogDailyServiceImpl.java
  62. 226
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java
  63. 243
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java
  64. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java
  65. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java
  66. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/PartyMemberService.java
  67. 38
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/impl/PartyMemberServiceImpl.java
  68. 104
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java
  69. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerService.java
  70. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimGridService.java
  71. 174
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java
  72. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java
  73. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java
  74. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java
  75. 50
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java
  76. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java
  77. 34
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java
  78. 5
      epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml
  79. 7
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/DimObjectActionDao.xml
  80. 8
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/DimObjectStatusDao.xml
  81. 65
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml
  82. 69
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml
  83. 68
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml
  84. 65
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml
  85. 81
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml
  86. 14
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml
  87. 22
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.xml
  88. 17
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml
  89. 5
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml
  90. 62
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml
  91. 20
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml
  92. 67
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml
  93. 16
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml
  94. 2
      epmet-module/epmet-common-service/common-service-server/pom.xml
  95. 13
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/DimPartyMemberService.java
  96. 27
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/DimPartyMemberServiceImpl.java
  97. 30
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DimPartyMemberTask.java

21
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/TimeListResultDTO.java

@ -0,0 +1,21 @@
package com.epmet.commons.tools.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/15 5:41 下午
*/
@Data
public class TimeListResultDTO implements Serializable {
private static final long serialVersionUID = 1482639109300981626L;
private String dateId;
private String weekId;
private String monthId;
private String quarterId;
private String yearId;
}

20
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java

@ -10,6 +10,7 @@ package com.epmet.commons.tools.utils;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.form.TimeListResultDTO;
import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
import org.joda.time.LocalDate;
@ -593,4 +594,23 @@ public class DateUtils {
}
return StrConstant.EPMETY_STR;
}
public static TimeListResultDTO getTimeList(String dateId){
TimeListResultDTO result = new TimeListResultDTO();
result.setDateId(dateId);
String monthId = dateId.substring(NumConstant.ZERO, NumConstant.SIX);
result.setMonthId(monthId);
result.setQuarterId(getQuarterId(monthId));
result.setYearId(getYearId(monthId));
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
try {
Date date = formatter.parse(dateId);
int weekOfYear = getWeekOfYear(date);
String weekId = dateId.substring(NumConstant.ZERO,NumConstant.FOUR).concat("W").concat(String.valueOf(weekOfYear));
result.setWeekId(weekId);
} catch (ParseException e) {
e.printStackTrace();
}
return result;
}
}

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

@ -12,5 +12,6 @@ public interface DataSourceConstant {
String RESI_GROUP = "resiGroup";
String EPMET_USER = "epmetuser";
String EVALUATION_INDEX = "evaluationIndex";
String PARTY_MEMBER = "partyMember";
}

21
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java

@ -0,0 +1,21 @@
package com.epmet.constant;
/**
* @Author zxc
* @DateTime 2020/9/16 3:56 下午
*/
public interface ExtractConstant {
String PARTY = "党员";
String STRANGER = "陌生人";
String ISSUE_INFO = "查询议题信息为空";
String CREATED_TOPIC_USER_IDENTITY = "查询创建话题用户身份信息为空";
String PARENT_AGENCY_ID_LIST = "查询组织上级ID集合为空......";
String ISSUE_PROCESS = "查询查询议题process集合为空";
}

13
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/StatsConstant.java

@ -0,0 +1,13 @@
package com.epmet.constant;
/**
* @Author zxc
* @DateTime 2020/9/17 2:56 下午
*/
public interface StatsConstant {
String PARTY_INFO_LIST = "客户【%s】查询党员信息集合为空......";
String CUSTOMER_INFO_NULL = "查询所有客户ID为空";
}

91
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/DimObjectActionDTO.java

@ -0,0 +1,91 @@
/**
* 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.extract;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 对象行为动作维度表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-15
*/
@Data
public class DimObjectActionDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 行为code
*/
private String actionCode;
/**
* 行为描述
*/
private String actionDesc;
/**
* 行为类型 topic,issue,project,article,group
*/
private String actionType;
/**
* 父级ID(本表id)
*/
private String pid;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

86
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/DimObjectStatusDTO.java

@ -0,0 +1,86 @@
/**
* 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.extract;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 对象行为状态维度表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-15
*/
@Data
public class DimObjectStatusDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 行为code
*/
private String statusCode;
/**
* 行为描述
*/
private String statusDesc;
/**
* 行为类型 topic,issue,project,article,group
*/
private String statusType;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

136
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginIssueLogDailyDTO.java

@ -0,0 +1,136 @@
/**
* 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.extract;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 议题记录附表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-14
*/
@Data
public class FactOriginIssueLogDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
* 组织上级ID
*/
private String pid;
/**
* 机关ID
*/
private String agencyId;
/**
* 日期ID
*/
private String dateId;
/**
* 周ID
*/
private String weekId;
/**
* 月份ID
*/
private String monthId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年度ID
*/
private String yearId;
/**
* 议题ID
*/
private String issueId;
/**
* 操作用户ID
*/
private String operationUserId;
/**
* 动作CODE
*/
private String actionCode;
/**
* 党员 热心居民 居民
*/
private Integer isParty;
/**
* 删除状态0:正常1:删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

152
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginIssueMainDailyDTO.java

@ -0,0 +1,152 @@
/**
* 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.extract;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 议题主表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-14
*/
@Data
public class FactOriginIssueMainDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 议题ID
*/
private String id;
/**
* 日ID指议题创建的yyyymmdd
*/
private String dateId;
/**
* 周ID
*/
private String weekId;
/**
* 月份ID
*/
private String monthId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年度ID
*/
private String yearId;
/**
* 客户ID
*/
private String customerId;
/**
* 用户身份标识
*/
private Integer isParty;
/**
* 转议题用户ID
*/
private String userId;
/**
* 创建话题用户的ID
*/
private String createTopicUserId;
/**
* 转为议题的话题ID
*/
private String topicId;
/**
* 议题网格ID
*/
private String gridId;
/**
* 上级ID
*/
private String pid;
/**
* 议题组织ID网格所属组织ID
*/
private String agencyId;
/**
* 议题状态
*/
private String issueStatus;
/**
* 创建话题用户身份标识
*/
private Integer topicUserIsParty;
/**
* 删除状态0:正常1:删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
public FactOriginIssueMainDailyDTO() {
this.delFlag = 0;
this.revision = 0;
this.createdBy = "APP_USER";
this.updatedBy = "APP_USER";
}
}

25
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFormDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.extract.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/16 6:01 下午
*/
@Data
public class ExtractFormDTO implements Serializable {
private static final long serialVersionUID = -6180252151765854242L;
public interface ExtractForm extends CustomerClientShowGroup{}
@NotBlank(message = "客户ID不能为空",groups = ExtractForm.class)
private String customerId;
@NotBlank(message = "dateId不能为空",groups = ExtractForm.class)
private String dateId;
}

33
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueInfoFormDTO.java

@ -0,0 +1,33 @@
package com.epmet.dto.extract.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.AllArgsConstructor;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/15 2:23 下午
*/
@Data
@AllArgsConstructor
public class IssueInfoFormDTO implements Serializable {
private static final long serialVersionUID = 8805754438522195653L;
public interface IssueInfo extends CustomerClientShowGroup{}
/**
* 客户ID
*/
@NotBlank(message = "customerId",groups = IssueInfo.class)
private String customerId;
/**
* 日期ID(实际为议题创建的 "yyyymmdd" )
*/
@NotBlank(message = "dateId",groups = IssueInfo.class)
private String dateId;
}

112
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueLogDailyFormDTO.java

@ -0,0 +1,112 @@
package com.epmet.dto.extract.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/14 5:42 下午
*/
@Data
public class IssueLogDailyFormDTO implements Serializable {
private static final long serialVersionUID = 7036617958351476594L;
/**
* 议题ID
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
* 组织上级ID
*/
private String pid;
/**
* 机关ID
*/
private String agencyId;
/**
* 议题ID
*/
private String issueId;
/**
* 日期ID
*/
private String dateId;
/**
* 周ID
*/
private String weekId;
/**
* 月份ID
*/
private String monthId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年度ID
*/
private String yearId;
/**
* 操作用户ID
*/
private String operationUserId;
/**
* 动作CODE
*/
private String actionCode;
/**
* 党员 热心居民 居民
*/
private Integer isParty;
/**
* 是否已删除(0-未删除1-已删除)
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建者
*/
private String createdBy;
/**
* 修改者
*/
private String updatedBy;
public IssueLogDailyFormDTO() {
this.delFlag = delFlag = 0;
this.revision = revision = 0;
this.createdBy = createdBy = "APP_USER";
this.updatedBy = updatedBy = "APP_USER";
}
}

123
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java

@ -0,0 +1,123 @@
package com.epmet.dto.extract.form;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Author zxc
* @DateTime 2020/9/14 5:47 下午
*/
@Data
public class IssueMainDailyFormDTO implements Serializable {
private static final long serialVersionUID = -5288003778076157611L;
/**
* 议题ID
*/
private String id;
/**
* 日ID指议题创建的yyyymmdd
*/
private String dateId;
/**
* 周ID
*/
private String weekId;
/**
* 月份ID
*/
private String monthId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年度ID
*/
private String yearId;
/**
* 客户ID
*/
private String customerId;
/**
* 用户身份标识
*/
private Integer isParty;
/**
* 转议题用户ID
*/
private String userId;
/**
* 创建话题用户的ID
*/
private String createTopicUserId;
/**
* 转为议题的话题ID
*/
private String topicId;
/**
* 议题网格ID
*/
private String gridId;
/**
* 上级ID
*/
private String pid;
/**
* 议题组织ID网格所属组织ID
*/
private String agencyId;
/**
* 议题状态
*/
private String issueStatus;
/**
* 创建话题用户身份标识
*/
private Integer topicUserIsParty;
/**
* 删除状态0:正常1:删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 更新人
*/
private String updatedBy;
public IssueMainDailyFormDTO() {
this.delFlag = 0;
this.revision = 0;
this.createdBy = "APP_USER";
this.updatedBy = "APP_USER";
}
}

25
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/AgencyInfoResultDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/15 6:13 下午
*/
@Data
public class AgencyInfoResultDTO implements Serializable {
private static final long serialVersionUID = 2823049943836552367L;
/**
* 机关ID
*/
private String agencyId;
/**
* 机关的父ID
*/
private String pid;
}

50
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueInfoResultDTO.java

@ -0,0 +1,50 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/15 2:04 下午
*/
@Data
public class IssueInfoResultDTO implements Serializable {
private static final long serialVersionUID = 3097591617162404015L;
/**
* 议题ID
*/
private String issueId;
/**
* 议题状态
*/
private String issueStatus;
/**
* 话题ID
*/
private String topicId;
/**
* 客户ID
*/
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
* 机关ID
*/
private String agencyId;
/**
* 用户ID
*/
private String userId;
}

45
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueProcessInfoResultDTO.java

@ -0,0 +1,45 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/16 1:27 下午
*/
@Data
public class IssueProcessInfoResultDTO implements Serializable {
private static final long serialVersionUID = 104679947108492259L;
/**
* 客户ID
*/
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
* 机关ID
*/
private String agencyId;
/**
* 议题ID
*/
private String issueId;
/**
* 动作CODE
*/
private String actionCode;
/**
* 用户ID
*/
private String userId;
}

45
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/SatisfactionInfoResultDTO.java

@ -0,0 +1,45 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/16 5:14 下午
*/
@Data
public class SatisfactionInfoResultDTO implements Serializable {
private static final long serialVersionUID = 1194031573388458848L;
/**
* 客户ID
*/
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
* 机关ID
*/
private String agencyId;
/**
* 议题ID
*/
private String issueId;
/**
* 动作CODE
*/
private String actionCode;
/**
* 用户ID
*/
private String userId;
}

21
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/TopicInfoResultDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/15 4:52 下午
*/
@Data
public class TopicInfoResultDTO implements Serializable {
private static final long serialVersionUID = -5902552728088278104L;
private String topicId;
private String userId;
private Integer isParty;
}

19
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/UserPartyResultDTO.java

@ -0,0 +1,19 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/15 4:20 下午
*/
@Data
public class UserPartyResultDTO implements Serializable {
private static final long serialVersionUID = 6688297568032159824L;
private String userId;
private String roleName;
}

35
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java

@ -0,0 +1,35 @@
package com.epmet.dto.org;
import lombok.Data;
import java.io.Serializable;
/**
* 网格基本信息
*
* @author yinzuomei@elink-cn.com
* @date 2020/9/16 14:00
*/
@Data
public class GridInfoDTO implements Serializable {
private static final long serialVersionUID = -5328705277000477630L;
/**
* 话题所属的网格ID
*/
private String gridId;
/**
* 所属机关ID 发布单位所属机关ID
*/
private String agencyId;
/**
* agencyId的上一级组织id
*/
private String pid;
/**
* 客户id
*/
private String customerId;
}

131
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerPartymemberDTO.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.stats;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 党员维度表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-17
*/
@Data
public class DimCustomerPartymemberDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 党员认证时的网格id
*/
private String gridId;
/**
* 所属机关ID
*/
private String agencyId;
/**
* agencyId的上一级组织id
*/
private String parentId;
/**
* 党员认证成功的日期yyyyMMdd
*/
private String dateId;
/**
* 周ID eg2020W01 = 2020年第一周
*/
private String weekId;
/**
* 月份ID eg202006 = 2020年6月2020-07 = 2020年7月
*/
private String monthId;
/**
* 季度ID eg2020Q1 = 2020年第一季度2020Q2 = 2020年第二季度2020Q3 = 2020年第三季度2020Q4 = 2020年第四季度
*/
private String quarterId;
/**
* 年度ID eg2020 = 2020年2021 = 2021年
*/
private String yearId;
/**
* 用户id
*/
private String userId;
/**
* 身份证
*/
private String idCard;
/**
* 生日
*/
private Date birthday;
/**
* 删除标识0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

24
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/CustomerIdAndDateIdFormDTO.java

@ -0,0 +1,24 @@
package com.epmet.dto.stats.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/17 11:02 上午
*/
@Data
public class CustomerIdAndDateIdFormDTO implements Serializable {
private static final long serialVersionUID = -3381286960911634231L;
public interface CustomerIdAndDateId extends CustomerClientShowGroup{}
private String customerId;
@NotBlank(message = "日期Id不能为空",groups = CustomerIdAndDateId.class)
private String dateId;
}

104
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/DimCustomerPartyMemberFormDTO.java

@ -0,0 +1,104 @@
package com.epmet.dto.stats.form;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Author zxc
* @DateTime 2020/9/17 11:15 上午
*/
@Data
public class DimCustomerPartyMemberFormDTO implements Serializable {
private static final long serialVersionUID = -9178779369245037701L;
/**
* 客户ID
*/
private String customerId;
/**
* 党员认证时的网格id
*/
private String gridId;
/**
* 所属机关ID
*/
private String agencyId;
/**
* agencyId的上一级组织id
*/
private String parentId;
/**
* 党员认证成功的日期yyyyMMdd
*/
private String dateId;
/**
* 周ID eg2020W01 = 2020年第一周
*/
private String weekId;
/**
* 月份ID eg202006 = 2020年6月2020-07 = 2020年7月
*/
private String monthId;
/**
* 季度ID eg2020Q1 = 2020年第一季度2020Q2 = 2020年第二季度2020Q3 = 2020年第三季度2020Q4 = 2020年第四季度
*/
private String quarterId;
/**
* 年度ID eg2020 = 2020年2021 = 2021年
*/
private String yearId;
/**
* 用户id
*/
private String userId;
/**
* 身份证
*/
private String idCard;
/**
* 生日
*/
private Date birthday;
/**
* 删除标识0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 更新人
*/
private String updatedBy;
public DimCustomerPartyMemberFormDTO() {
this.delFlag = NumConstant.ZERO_STR;
this.revision = NumConstant.ZERO;
this.createdBy = "APP_USER";
this.updatedBy = "APP_USER";
}
}

30
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/GridBelongAgencyResultDTO.java

@ -0,0 +1,30 @@
package com.epmet.dto.stats.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/17 2:32 下午
*/
@Data
public class GridBelongAgencyResultDTO implements Serializable {
private static final long serialVersionUID = 6781297915444918432L;
/**
* 网格ID
*/
private String gridId;
/**
* 网格所属机关ID
*/
private String agencyId;
/**
* 机关的上级ID
*/
private String parentId;
}

82
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicOriginInfoDTO.java

@ -0,0 +1,82 @@
package com.epmet.dto.topic;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 原始话题相关信息
*
* @author yinzuomei@elink-cn.com
* @date 2020/9/15 18:01
*/
@Data
public class TopicOriginInfoDTO implements Serializable {
private static final long serialVersionUID = -182136873047614269L;
/**
* 话题id
*/
private String topicId;
/**
* 操作类型发布 - discussing 屏蔽 - hidden 取消屏蔽 - hidden_cancelled 关闭话题 - closed
* 补充 转议题shift_issue 评论话题comment
*/
private String actionCode;
/**
* 本条记录的操作人 resi_topic_operation.CREATED_BY
*/
private String operateUserId;
/**
* 用户操作时间 resi_topic_operation.CREATED_TIME 对应的yyyyMMdd
*/
private String dateId;
/**
* 用户操作时间 resi_topic_operation.CREATED_TIME 对应的yyyyMM
*/
private String monthId;
/**
* 用户操作时间 resi_topic_operation.CREATED_TIME 对应的yyyy
*/
private String yearId;
/**
* 用户操作时间 resi_topic_operation.CREATED_TIME
*/
private Date originalBusinessTime;
/**
* 话题状态讨论中 - discussing 已屏蔽 - hidden 已关闭 - closed
*/
private String groupId;
/**
* 话题的状态
*/
private String topicStatus;
/**
* 话题关闭时的状态已解决 resolved未解决 unresolved
*/
// private String closedStatus;
/**
* 网格id ( 其实就是小组所属的网格id)
*/
private String gridId;
/**
* 客户id
*/
private String customerId;
}

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

@ -5,6 +5,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.StatsFormDTO;
import com.epmet.dto.group.form.GroupStatsFormDTO;
import com.epmet.dto.issue.form.IssueJobFromDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.feign.impl.DataStatisticalOpenFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
@ -174,10 +175,11 @@ public interface DataStatisticalOpenFeignClient {
Result execTopicStatistical(@RequestParam(value = "date",required = false) String date);
/**
* 处理暂停的计算
* @return
* @Description 统计党员
* @param customerIdAndDateIdFormDTO
* @author zxc
* @date 2020/9/17 3:10 下午
*/
@PostMapping("/data/stats/indexcalculate/process-pendding-cals")
Result processPenddingCalculate();
@PostMapping("/data/stats/dim/statsparty")
Result getPartyInfo(@RequestBody CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO);
}

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

@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.StatsFormDTO;
import com.epmet.dto.group.form.GroupStatsFormDTO;
import com.epmet.dto.issue.form.IssueJobFromDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.feign.DataStatisticalOpenFeignClient;
import org.springframework.stereotype.Component;
@ -172,7 +173,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
}
@Override
public Result processPenddingCalculate() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "processPenddingCalculate");
public Result getPartyInfo(CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "getPartyInfo",customerIdAndDateIdFormDTO);
}
}

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

@ -192,6 +192,12 @@
<datasource.druid.evaluationIndex.username>epmet_evaluation_index_user</datasource.druid.evaluationIndex.username>
<datasource.druid.evaluationIndex.password>EpmEt-db-UsEr</datasource.druid.evaluationIndex.password>
<datasource.druid.partyMember.url>
<![CDATA[jdbc:mysql://192.168.1.130:3306/epmet_resi_partymember?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.partyMember.url>
<datasource.druid.partyMember.username>epmet_resi_partymember_user</datasource.druid.partyMember.username>
<datasource.druid.partyMember.password>EpmEt-db-UsEr</datasource.druid.partyMember.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>192.168.1.130</spring.redis.host>
@ -290,6 +296,12 @@
<datasource.druid.evaluationIndex.username>epmet_evaluation_index_user</datasource.druid.evaluationIndex.username>
<datasource.druid.evaluationIndex.password>EpmEt-db-UsEr</datasource.druid.evaluationIndex.password>
<datasource.druid.partyMember.url>
<![CDATA[jdbc:mysql://192.168.1.130:3306/epmet_resi_partymember?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.partyMember.url>
<datasource.druid.partyMember.username>epmet_resi_partymember_user</datasource.druid.partyMember.username>
<datasource.druid.partyMember.password>EpmEt-db-UsEr</datasource.druid.partyMember.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>192.168.1.130</spring.redis.host>
@ -388,6 +400,12 @@
<datasource.druid.evaluationIndex.username>epmet</datasource.druid.evaluationIndex.username>
<datasource.druid.evaluationIndex.password>elink@833066</datasource.druid.evaluationIndex.password>
<datasource.druid.partyMember.url>
<![CDATA[jdbc:mysql://rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306/epmet_resi_partymember?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.partyMember.url>
<datasource.druid.partyMember.username>epmet</datasource.druid.partyMember.username>
<datasource.druid.partyMember.password>elink@833066</datasource.druid.partyMember.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com</spring.redis.host>
@ -482,6 +500,12 @@
<datasource.druid.evaluationIndex.username>epmet_evaluation_index_user</datasource.druid.evaluationIndex.username>
<datasource.druid.evaluationIndex.password>EpmEt-db-UsEr</datasource.druid.evaluationIndex.password>
<datasource.druid.partyMember.url>
<![CDATA[jdbc:mysql://rm-m5e3vzs2637224wj9.mysql.rds.aliyuncs.com:3306/epmet_resi_partymember?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.partyMember.url>
<datasource.druid.partyMember.username>epmet_resi_partymember_user</datasource.druid.partyMember.username>
<datasource.druid.partyMember.password>EpmEt-db-UsEr</datasource.druid.partyMember.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com</spring.redis.host>

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java

@ -0,0 +1,14 @@
package com.epmet.constant;
/**
* 对象行为动作维度表
*
* @author yinzuomei@elink-cn.com
* @date 2020/9/16 10:13
*/
public interface DimObjectActionConstant {
/**
* 发布话题
*/
String TOPIC_PUBLISH="discussing";
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectStatusConstant.java

@ -0,0 +1,10 @@
package com.epmet.constant;
/**
* 对象行为状态维度表
*
* @author yinzuomei@elink-cn.com
* @date 2020/9/16 10:14
*/
public interface DimObjectStatusConstant {
}

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

@ -1,5 +1,6 @@
package com.epmet.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.DateUtils;
@ -11,22 +12,27 @@ import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDa
import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyDao;
import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao;
import com.epmet.dao.stats.DimCustomerDao;
import com.epmet.dao.stats.DimDateDao;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyEntity;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity;
import com.epmet.entity.stats.DimAgencyEntity;
import com.epmet.entity.stats.DimCustomerEntity;
import com.epmet.entity.stats.DimDateEntity;
import com.epmet.service.StatsDemoService;
import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService;
import com.epmet.service.evaluationindex.indexcal.*;
import com.epmet.service.stats.DimAgencyService;
import com.epmet.service.stats.DimCustomerPartymemberService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@ -57,6 +63,24 @@ public class DemoController {
private DeptScoreService deptScoreService;
@Autowired
private IndexCalculateDistrictService indexCalculateDistrictService;
@Autowired
private GridScoreDao gridScoreDao;
@Autowired
private FactIndexPartyAblityGridMonthlyDao factIndexPartyAblityGridMonthlyDao;
@Autowired
private FactIndexGovrnAblityGridMonthlyDao factIndexGovrnAblityGridMonthlyDao;
@Autowired
private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao;
@Autowired
private ScreenCustomerGridDao screenCustomerGridDao;
@Autowired
private CpcIndexCalculateService cpcIndexCalculateService;
@Autowired
private DimDateDao dimDateDao;
@Autowired
private DimCustomerDao dimCustomerDao;
@Autowired
private FactOriginTopicMainDailyService factOriginTopicMainDailyService;
@GetMapping("testAlarm")
public void testAlarm() {
@ -147,19 +171,6 @@ public class DemoController {
return new Result();
}
@Autowired
private GridScoreDao gridScoreDao;
@Autowired
private FactIndexPartyAblityGridMonthlyDao factIndexPartyAblityGridMonthlyDao;
@Autowired
private FactIndexGovrnAblityGridMonthlyDao factIndexGovrnAblityGridMonthlyDao;
@Autowired
private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao;
@Autowired
private ScreenCustomerGridDao screenCustomerGridDao;
@Autowired
private CpcIndexCalculateService cpcIndexCalculateService;
// private static Integer testcal=100;
@PostMapping("testcal")
public Result testCal(){
@ -487,4 +498,32 @@ public class DemoController {
c.setMonthId(monthId);
deptScoreService.calculateDeptCorreLation(c);
}
@PostMapping("inserttopicorigin")
public Result topicDataCleaning(@RequestParam("customerId") String customerId, @RequestParam("dateId")String dateId) {
if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) {
factOriginTopicMainDailyService.topicCleaning(customerId,dateId);
}else{
QueryWrapper<DimCustomerEntity> customerEntityQueryWrapper = new QueryWrapper<>();
List<DimCustomerEntity> customerEntityList=dimCustomerDao.selectList(customerEntityQueryWrapper);
QueryWrapper<DimDateEntity> wrapper = new QueryWrapper<>();
List<DimDateEntity> dimDateEntityList= dimDateDao.selectList(wrapper);
for(DimCustomerEntity customerEntity:customerEntityList){
for(DimDateEntity dateEntity:dimDateEntityList){
factOriginTopicMainDailyService.topicCleaning(customerEntity.getId(),dateEntity.getId());
}
}
}
return new Result();
}
@Autowired
private DimCustomerPartymemberService partymemberService;
@PostMapping("statsparty")
public Result getPartyInfo(@RequestBody CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO){
partymemberService.statsPartyMember(customerIdAndDateIdFormDTO);
return new Result();
}
}

17
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java

@ -1,8 +1,10 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.AgencySubDeptTreeDto;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.service.StatsDimService;
import com.epmet.service.stats.*;
import org.slf4j.Logger;
@ -39,6 +41,9 @@ public class DimController {
@Autowired
private DimAgencyService dimAgencyService;
@Autowired
private DimCustomerPartymemberService partyMemberService;
/**
* 初始化所有维度
*
@ -250,4 +255,16 @@ public class DimController {
return dimAgencyService.getTopAgencyWithDept();
}
/**
* @Description
* @param customerIdAndDateIdFormDTO
* @author zxc
* @date 2020/9/17 3:01 下午
*/
@PostMapping("statsparty")
public Result getPartyInfo(@RequestBody CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO) {
ValidatorUtils.validateEntity(customerIdAndDateIdFormDTO, CustomerIdAndDateIdFormDTO.CustomerIdAndDateId.class);
return new Result().ok(partyMemberService.statsPartyMember(customerIdAndDateIdFormDTO));
}
}

76
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java

@ -0,0 +1,76 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.service.evaluationindex.extract.IssueExtractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 原始数据清洗
*
* @author yinzuomei@elink-cn.com
* @date 2020/9/15 11:06
*/
@RestController
@RequestMapping("factorigin")
public class FactOriginController {
@Autowired
private IssueExtractService issueExtractService;
@Autowired
private FactOriginTopicMainDailyService factOriginTopicMainDailyService;
/**
* @Description 议题抽取(main)
* @param extractFormDTO
* @author zxc
* @date 2020/9/15 2:02 下午
*/
@PostMapping("issueextractmain")
public Result issueExtractMain(@RequestBody ExtractFormDTO extractFormDTO){
ValidatorUtils.validateEntity(extractFormDTO, ExtractFormDTO.ExtractForm.class);
issueExtractService.issueExtractMain(extractFormDTO);
return new Result();
}
/**
* @Description 议题抽取(log)
* @param extractFormDTO
* @author zxc
* @date 2020/9/16 9:41 上午
*/
@PostMapping("issueextractlog")
public Result issueExtractLog(@RequestBody ExtractFormDTO extractFormDTO){
ValidatorUtils.validateEntity(extractFormDTO, ExtractFormDTO.ExtractForm.class);
issueExtractService.issueExtractLog(extractFormDTO);
return new Result();
}
/**
* @param customerId yyyyMMdd
* @param dateId yyyyMMdd
* @return com.epmet.commons.tools.utils.Result
* @author yinzuomei
* @description 话题 (fact_origin_topic_main_daily 话题主表_日统计 fact_origin_topic_log_daily 话题明细_日统计)
* @Date 2020/9/15 13:39
**/
@PostMapping("topic")
public Result topicDataCleaning(String customerId,String dateId) {
if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) {
factOriginTopicMainDailyService.topicCleaning(customerId,dateId);
}
return new Result();
}
}

33
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/DimObjectActionDao.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.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.evaluationindex.extract.DimObjectActionEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 对象行为动作维度表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-15
*/
@Mapper
public interface DimObjectActionDao extends BaseDao<DimObjectActionEntity> {
}

33
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/DimObjectStatusDao.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.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.evaluationindex.extract.DimObjectStatusEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 对象行为状态维度表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-15
*/
@Mapper
public interface DimObjectStatusDao extends BaseDao<DimObjectStatusEntity> {
}

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

@ -0,0 +1,54 @@
/**
* 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.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.form.IssueLogDailyFormDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 议题记录附表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-14
*/
@Mapper
public interface FactOriginIssueLogDailyDao extends BaseDao<FactOriginIssueLogDailyEntity> {
/**
* @Description 议题记录附表插入
* @param issueLogList
* @author zxc
* @date 2020/9/14 5:53 下午
*/
void insertIssueLogList(@Param("issueLogList")List<IssueLogDailyFormDTO> issueLogList);
/**
* @Description 删除旧的记录
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 9:33 上午
*/
void deleteOldLogRecord(@Param("customerId")String customerId,@Param("dateId")String dateId);
}

53
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java

@ -0,0 +1,53 @@
/**
* 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.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.form.IssueMainDailyFormDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 议题主表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-14
*/
@Mapper
public interface FactOriginIssueMainDailyDao extends BaseDao<FactOriginIssueMainDailyEntity> {
/**
* @Description 议题主表插入
* @param issueMainList
* @author zxc
* @date 2020/9/14 5:53 下午
*/
void insertIssueMainList(@Param("issueMainList") List<IssueMainDailyFormDTO> issueMainList);
/**
* @Description 删除旧的记录
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 9:33 上午
*/
void deleteOldMainRecord(@Param("customerId")String customerId, @Param("dateId")String dateId);
}

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

@ -0,0 +1,55 @@
/**
* 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.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 话题明细_日统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-15
*/
@Mapper
public interface FactOriginTopicLogDailyDao extends BaseDao<FactOriginTopicLogDailyEntity> {
/**
* @return int
* @param customerId
* @param dateId
* @param deleteSize
* @author yinzuomei
* @description 批量删除
* @Date 2020/9/16 12:54
**/
int deleteByDateIdAndCustomerId(@Param("customerId") String customerId,
@Param("dateId") String dateId,
@Param("deleteSize") Integer deleteSize);
/**
* @return int
* @param list
* @author yinzuomei
* @description 批量插入
* @Date 2020/9/16 12:54
**/
int insertBatchEntity(@Param("list") List<FactOriginTopicLogDailyEntity> list);
}

57
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.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.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 话题主表_日统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-15
*/
@Mapper
public interface FactOriginTopicMainDailyDao extends BaseDao<FactOriginTopicMainDailyEntity> {
/**
* @param customerId
* @param dateId
* @param deleteSize
* @return int
* @author yinzuomei
* @description 批量删除
* @Date 2020/9/16 11:16
**/
int deleteByDateIdAndCustomerId(@Param("customerId") String customerId,
@Param("dateId") String dateId,
@Param("deleteSize") Integer deleteSize);
/**
* @return int
* @param list
* @author yinzuomei
* @description 批量插入
* @Date 2020/9/16 12:48
**/
int insertBatchEntity(@Param("list") List<FactOriginTopicMainDailyEntity> list);
}

38
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java

@ -1,9 +1,12 @@
package com.epmet.dao.issue;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.SatisfactionInfoResultDTO;
import com.epmet.dto.extract.result.IssueProcessInfoResultDTO;
import com.epmet.dto.issue.IssueAgencyDTO;
import com.epmet.dto.issue.IssueGridDTO;
import com.epmet.dto.issue.IssueProjectDTO;
import com.epmet.dto.extract.result.IssueInfoResultDTO;
import com.epmet.entity.issue.IssueEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -112,4 +115,39 @@ public interface StatsIssueDao extends BaseDao<IssueEntity> {
*/
List<IssueProjectDTO> selectIssueProjectList(@Param("customerId") String customerId);
/**
* @Description 查询议题信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/15 2:28 下午
*/
List<IssueInfoResultDTO> selectIssueInfo(@Param("customerId")String customerId, @Param("dateId")String dateId);
/**
* @Description 查询议题process信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 1:48 下午
*/
List<IssueProcessInfoResultDTO> selectIssueProcessInfo(@Param("customerId")String customerId, @Param("dateId")String dateId);
/**
* @Description 查询议题满意度评价信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 1:48 下午
*/
List<SatisfactionInfoResultDTO> selectIssueSatisfactionInfo(@Param("customerId")String customerId, @Param("dateId")String dateId);
/**
* @Description 查询议题支持反对信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 1:48 下午
*/
List<SatisfactionInfoResultDTO> selectIssueVoteInfo(@Param("customerId")String customerId, @Param("dateId")String dateId);
}

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

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.group.AgencyDTO;
import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO;
import com.epmet.dto.group.result.GridIdListByCustomerResultDTO;
import com.epmet.dto.org.GridInfoDTO;
import com.epmet.entity.org.CustomerGridEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -67,4 +68,13 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
* @return
*/
List<CustomerGridEntity> listUpdatedGridsByUpdateTime(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
/**
* @return java.util.List<com.epmet.dto.org.GridInfoDTO>
* @param customerId
* @author yinzuomei
* @description 查询客户下的网格的agencyId, 还有pid
* @Date 2020/9/16 14:03
**/
List<GridInfoDTO> selectListGridInfo(String customerId);
}

29
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/partymember/PartyMemberDao.java

@ -0,0 +1,29 @@
package com.epmet.dao.partymember;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.IssueInfoResultDTO;
import com.epmet.dto.extract.result.IssueProcessInfoResultDTO;
import com.epmet.dto.extract.result.SatisfactionInfoResultDTO;
import com.epmet.dto.issue.IssueAgencyDTO;
import com.epmet.dto.issue.IssueGridDTO;
import com.epmet.dto.issue.IssueProjectDTO;
import com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO;
import com.epmet.entity.issue.IssueEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface PartyMemberDao{
/**
* @Description 查询党员信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/17 1:58 下午
*/
List<DimCustomerPartyMemberFormDTO> selectPartyMemberInfo(@Param("customerId") String customerId,@Param("dateId") String dateId);
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java

@ -21,6 +21,7 @@ package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.AgencySubDeptTreeDto;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.extract.result.AgencyInfoResultDTO;
import com.epmet.dto.stats.DimAgencyDTO;
import com.epmet.entity.stats.DimAgencyEntity;
import org.apache.ibatis.annotations.Mapper;
@ -126,4 +127,12 @@ public interface DimAgencyDao extends BaseDao<DimAgencyEntity> {
DimAgencyEntity getLatestCreatedAgencyDimEntity();
DimAgencyEntity getLatestUpdatedAgencyDimEntity();
/**
* @Description 查询pid信息
* @param agencyIds
* @author zxc
* @date 2020/9/15 6:15 下午
*/
List<AgencyInfoResultDTO> selectAgencyInfo(@Param("agencyIds")List<String> agencyIds);
}

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerDao.java

@ -49,4 +49,11 @@ public interface DimCustomerDao extends BaseDao<DimCustomerEntity> {
DimCustomerEntity getLatestCreatedDimEntity();
DimCustomerEntity getLatestUpdatedDimEntity();
/**
* @Description 查询所有客户ID
* @author zxc
* @date 2020/9/17 3:30 下午
*/
List<String> getAllCustomerId();
}

53
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java

@ -0,0 +1,53 @@
/**
* 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.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO;
import com.epmet.entity.stats.DimCustomerPartymemberEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 党员维度表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-17
*/
@Mapper
public interface DimCustomerPartymemberDao extends BaseDao<DimCustomerPartymemberEntity> {
/**
* @Description 批量插入党员信息
* @param partyMemberInfos
* @author zxc
* @date 2020/9/17 11:18 上午
*/
void insertPartyMemberInfo(@Param("partyMemberInfos")List<DimCustomerPartyMemberFormDTO> partyMemberInfos);
/**
* @Description 删除旧党员记录
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/17 2:43 下午
*/
void deleteOldPartyRecord(@Param("customerId")String customerId,@Param("dateId")String dateId);
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.group.AgencyDTO;
import com.epmet.dto.group.result.AgencyGridInfoResultDTO;
import com.epmet.dto.group.result.SubAgencyIdResultDTO;
import com.epmet.dto.stats.result.GridBelongAgencyResultDTO;
import com.epmet.entity.stats.DimGridEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -60,4 +61,12 @@ public interface DimGridDao extends BaseDao<DimGridEntity> {
List<SubAgencyIdResultDTO> selectSubAgencyId(@Param("formDTO")List<AgencyDTO> formDTO);
DimGridEntity getLastUpdatedGridDim();
/**
* @Description 查询网格属于哪个机关
* @param gridIds
* @author zxc
* @date 2020/9/17 2:34 下午
*/
List<GridBelongAgencyResultDTO> selectGridBelongAgencyInfo(@Param("gridIds") List<String> gridIds);
}

21
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java

@ -7,6 +7,8 @@ package com.epmet.dao.topic;
* @since v1.0.0 2020-05-11
*/
import com.epmet.dto.extract.result.TopicInfoResultDTO;
import com.epmet.dto.topic.TopicOriginInfoDTO;
import com.epmet.dto.topic.result.ResiGroupTopicResultDTO;
import com.epmet.dto.topic.result.ResiTopicOperationResultDTO;
import org.apache.ibatis.annotations.Mapper;
@ -56,4 +58,23 @@ public interface TopicDao {
* @date 2020.06.22 11:07
**/
List<ResiTopicOperationResultDTO> selectTopicOperationRecordBetweenTimeRange(@Param("startDate")Date startDate, @Param("endDate")Date endDate);
/**
* @Description 查询话题创建者信息
* @param topicIds
* @author zxc
* @date 2020/9/15 4:55 下午
*/
List<TopicInfoResultDTO> selectTopicInfo(@Param("topicIds")List<String> topicIds);
/**
* @return java.util.List<com.epmet.dto.topic.TopicOriginInfoDTO>
* @param customerId
* @param dateId yyyyMMdd
* @author yinzuomei
* @description 根据日期查询resi_topic_operation返回当前日期这一天内所有话题相关的操作记录
* @Date 2020/9/15 18:14
**/
List<TopicOriginInfoDTO> selectListTopicOriginInfo(@Param("customerId")String customerId, @Param("dateId")String dateId);
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java

@ -1,5 +1,6 @@
package com.epmet.dao.user;
import com.epmet.dto.extract.result.UserPartyResultDTO;
import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -97,4 +98,12 @@ public interface UserDao {
* @date 2020.06.18 18:50
**/
Integer selectWarmIncrWithinTimeRange(@Param("incrUserIds")List<String> incrUserIds,@Param("gridIds") Set<String> gridIds,@Param("startDate")Date startDate,@Param("endDate")Date endDate);
/**
* @Description 查询用户是不是党员
* @param userIds
* @author zxc
* @date 2020/9/15 4:23 下午
*/
List<UserPartyResultDTO> selectUserIsParty(@Param("userIds") List<String> userIds);;
}

61
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/DimObjectActionEntity.java

@ -0,0 +1,61 @@
/**
* 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.evaluationindex.extract;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 对象行为动作维度表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-15
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("dim_object_action")
public class DimObjectActionEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 行为code
*/
private String actionCode;
/**
* 行为描述
*/
private String actionDesc;
/**
* 行为类型 topic,issue,project,article,group
*/
private String actionType;
/**
* 父级ID(本表id)
*/
private String pid;
}

56
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/DimObjectStatusEntity.java

@ -0,0 +1,56 @@
/**
* 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.evaluationindex.extract;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 对象行为状态维度表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-15
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("dim_object_status")
public class DimObjectStatusEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 行为code
*/
private String statusCode;
/**
* 行为描述
*/
private String statusDesc;
/**
* 行为类型 topic,issue,project,article,group
*/
private String statusType;
}

106
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginIssueLogDailyEntity.java

@ -0,0 +1,106 @@
/**
* 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.evaluationindex.extract;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 议题记录附表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-14
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_origin_issue_log_daily")
public class FactOriginIssueLogDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
* 组织上级ID
*/
private String pid;
/**
* 机关ID
*/
private String agencyId;
/**
* 日期ID
*/
private String dateId;
/**
* 周ID
*/
private String weekId;
/**
* 月份ID
*/
private String monthId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年度ID
*/
private String yearId;
/**
* 议题ID
*/
private String issueId;
/**
* 操作用户ID
*/
private String operationUserId;
/**
* 动作CODE
*/
private String actionCode;
/**
* 党员 热心居民 居民
*/
private String userIdentity;
}

121
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginIssueMainDailyEntity.java

@ -0,0 +1,121 @@
/**
* 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.evaluationindex.extract;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 议题主表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-14
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_origin_issue_main_daily")
public class FactOriginIssueMainDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 日ID指议题创建的yyyymmdd
*/
private String dateId;
/**
* 周ID
*/
private String weekId;
/**
* 月份ID
*/
private String monthId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年度ID
*/
private String yearId;
/**
* 客户ID
*/
private String customerId;
/**
* 用户身份标识
*/
private String userIdentity;
/**
* 转议题用户ID
*/
private String userId;
/**
* 创建话题用户的ID
*/
private String createTopicUserId;
/**
* 议题ID
*/
private String issueId;
/**
* 转为议题的话题ID
*/
private String topicId;
/**
* 议题网格ID
*/
private String gridId;
/**
* 上级ID
*/
private String pid;
/**
* 议题组织ID网格所属组织ID
*/
private String agencyId;
/**
* 议题状态
*/
private String issueStatus;
/**
* 创建话题用户身份标识
*/
private String topicUserIdentity;
}

116
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicLogDailyEntity.java

@ -0,0 +1,116 @@
/**
* 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.evaluationindex.extract;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 话题明细_日统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-15
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_origin_topic_log_daily")
public class FactOriginTopicLogDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 话题所属的网格ID
*/
private String gridId;
/**
* 网格所属上级组织ID
*/
private String agencyId;
/**
* agencyId的上一级组织id
*/
private String pid;
/**
* 业务的发生时间 格式日期ID
*/
private String dateId;
/**
* 周ID eg2020W01 = 2020年第一周
*/
private String weekId;
/**
* 月份ID eg202006 = 2020年6月2020-07 = 2020年7月
*/
private String monthId;
/**
* 季度ID eg2020Q1 = 2020年第一季度2020Q2 = 2020年第二季度2020Q3 = 2020年第三季度2020Q4 = 2020年第四季度
*/
private String quarterId;
/**
* 年度ID eg2020 = 2020年2021 = 2021年
*/
private String yearId;
/**
* 话题id
*/
private String topicId;
/**
* 话题所属小组id
*/
private String groupId;
/**
* 行为code 来自dim_object_action表
*/
private String actionCode;
/**
* 本条数据操作用户Id
*/
private String operateUserId;
/**
* 本条数据操作用户是否是党员 1是0不是
*/
private Boolean operateUserIsParty;
/**
* 原始业务发生时间
*/
private Date originalBusinessTime;
}

106
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicMainDailyEntity.java

@ -0,0 +1,106 @@
/**
* 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.evaluationindex.extract;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 话题主表_日统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-15
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_origin_topic_main_daily")
public class FactOriginTopicMainDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 话题所属的网格ID
*/
private String gridId;
/**
* 所属机关ID 发布单位所属机关ID
*/
private String agencyId;
/**
* agencyId的上一级组织id
*/
private String pid;
/**
* 话题的发布日期yyyyMMdd
*/
private String dateId;
/**
* 周ID eg2020W01 = 2020年第一周
*/
private String weekId;
/**
* 月份ID eg202006 = 2020年6月2020-07 = 2020年7月
*/
private String monthId;
/**
* 季度ID eg2020Q1 = 2020年第一季度2020Q2 = 2020年第二季度2020Q3 = 2020年第三季度2020Q4 = 2020年第四季度
*/
private String quarterId;
/**
* 年度ID eg2020 = 2020年2021 = 2021年
*/
private String yearId;
/**
* 话题所属小组id
*/
private String groupId;
/**
* 话题状态 来自dim_object_status表
*/
private String topicStatus;
/**
* 话题发布人id
*/
private String createTopicUserId;
/**
* 话题发布人是否是党员1是党员0不是 默认0
*/
private Boolean createTopicUserIsParty;
}

101
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerPartymemberEntity.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.stats;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 党员维度表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-17
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("dim_customer_partymember")
public class DimCustomerPartymemberEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 党员认证时的网格id
*/
private String gridId;
/**
* 所属机关ID
*/
private String agencyId;
/**
* agencyId的上一级组织id
*/
private String pid;
/**
* 党员认证成功的日期yyyyMMdd
*/
private String dateId;
/**
* 周ID eg2020W01 = 2020年第一周
*/
private String weekId;
/**
* 月份ID eg202006 = 2020年6月2020-07 = 2020年7月
*/
private String monthId;
/**
* 季度ID eg2020Q1 = 2020年第一季度2020Q2 = 2020年第二季度2020Q3 = 2020年第三季度2020Q4 = 2020年第四季度
*/
private String quarterId;
/**
* 年度ID eg2020 = 2020年2021 = 2021年
*/
private String yearId;
/**
* 用户id
*/
private String userId;
/**
* 身份证
*/
private String idCard;
/**
* 生日
*/
private Date birthday;
}

39
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java

@ -1,8 +1,11 @@
package com.epmet.service.Issue;
import com.epmet.dto.extract.result.SatisfactionInfoResultDTO;
import com.epmet.dto.extract.result.IssueProcessInfoResultDTO;
import com.epmet.dto.issue.IssueAgencyDTO;
import com.epmet.dto.issue.IssueGridDTO;
import com.epmet.dto.issue.IssueProjectDTO;
import com.epmet.dto.extract.result.IssueInfoResultDTO;
import com.epmet.entity.issue.IssueEntity;
import java.util.List;
@ -109,4 +112,40 @@ public interface IssueService {
* @return java.util.List<com.epmet.dto.issue.IssueProjectDTO>
*/
List<IssueProjectDTO> getIssueProjectList(String customerId);
/**
* @Description 查询议题信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/15 2:28 下午
*/
List<IssueInfoResultDTO> selectIssueInfo(String customerId,String dateId);
/**
* @Description 查询议题process信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 1:48 下午
*/
List<IssueProcessInfoResultDTO> selectIssueProcessInfo(String customerId,String dateId);
/**
* @Description 查询议题满意度评价信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 1:48 下午
*/
List<SatisfactionInfoResultDTO> selectIssueSatisfactionInfo(String customerId,String dateId);
/**
* @Description 查询议题支持反对信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 1:48 下午
*/
List<SatisfactionInfoResultDTO> selectIssueVoteInfo(String customerId,String dateId);
}

51
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java

@ -3,9 +3,12 @@ package com.epmet.service.Issue.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.issue.StatsIssueDao;
import com.epmet.dto.extract.result.SatisfactionInfoResultDTO;
import com.epmet.dto.extract.result.IssueProcessInfoResultDTO;
import com.epmet.dto.issue.IssueAgencyDTO;
import com.epmet.dto.issue.IssueGridDTO;
import com.epmet.dto.issue.IssueProjectDTO;
import com.epmet.dto.extract.result.IssueInfoResultDTO;
import com.epmet.entity.issue.IssueEntity;
import com.epmet.service.Issue.IssueService;
import org.springframework.beans.factory.annotation.Autowired;
@ -80,4 +83,52 @@ public class IssueServiceImpl implements IssueService {
public List<IssueProjectDTO> getIssueProjectList(String customerId) {
return statsIssueDao.selectIssueProjectList(customerId);
}
/**
* @Description 查询议题信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/15 2:28 下午
*/
@Override
public List<IssueInfoResultDTO> selectIssueInfo(String customerId,String dateId) {
return statsIssueDao.selectIssueInfo(customerId, dateId);
}
/**
* @Description 查询议题process信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 1:48 下午
*/
@Override
public List<IssueProcessInfoResultDTO> selectIssueProcessInfo(String customerId, String dateId) {
return statsIssueDao.selectIssueProcessInfo(customerId, dateId);
}
/**
* @Description 查询议题满意度评价信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 1:48 下午
*/
@Override
public List<SatisfactionInfoResultDTO> selectIssueSatisfactionInfo(String customerId, String dateId) {
return statsIssueDao.selectIssueSatisfactionInfo(customerId, dateId);
}
/**
* @Description 查询议题支持反对信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 1:48 下午
*/
@Override
public List<SatisfactionInfoResultDTO> selectIssueVoteInfo(String customerId, String dateId) {
return statsIssueDao.selectIssueVoteInfo(customerId, dateId);
}
}

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

@ -0,0 +1,35 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.evaluationindex.extract;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity;
import java.util.List;
import java.util.Map;
/**
* 话题明细_日统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-15
*/
public interface FactOriginTopicLogDailyService extends BaseService<FactOriginTopicLogDailyEntity> {
}

46
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicMainDailyService.java

@ -0,0 +1,46 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.evaluationindex.extract;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.topic.TopicOriginInfoDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity;
import java.util.List;
/**
* 话题主表_日统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-15
*/
public interface FactOriginTopicMainDailyService extends BaseService<FactOriginTopicMainDailyEntity> {
/**
* @return void
* @param customerId 客户id
* @param dateId yyyyMMdd
* @author yinzuomei 数据采集话题本身
* @description fact_origin_topic_log_daily 话题明细_日统计 fact_origin_topic_main_daily 话题主表_日统计
* @Date 2020/9/15 13:40
**/
Boolean topicCleaning(String customerId, String dateId);
}

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

@ -0,0 +1,26 @@
package com.epmet.service.evaluationindex.extract;
import com.epmet.dto.extract.form.ExtractFormDTO;
/**
* @Author zxc
* @DateTime 2020/9/14 5:07 下午
*/
public interface IssueExtractService {
/**
* @Description 议题抽取(main)
* @param extractFormDTO
* @author zxc
* @date 2020/9/15 2:02 下午
*/
Boolean issueExtractMain(ExtractFormDTO extractFormDTO);
/**
* @Description 议题抽取(log)
* @param extractFormDTO
* @author zxc
* @date 2020/9/16 9:41 上午
*/
Boolean issueExtractLog(ExtractFormDTO extractFormDTO);
}

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

@ -0,0 +1,36 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.evaluationindex.extract.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.evaluationindex.extract.FactOriginTopicLogDailyDao;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity;
import com.epmet.service.evaluationindex.extract.FactOriginTopicLogDailyService;
import org.springframework.stereotype.Service;
/**
* 话题明细_日统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-15
*/
@Service
public class FactOriginTopicLogDailyServiceImpl extends BaseServiceImpl<FactOriginTopicLogDailyDao, FactOriginTopicLogDailyEntity> implements FactOriginTopicLogDailyService {
}

226
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java

@ -0,0 +1,226 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.evaluationindex.extract.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DimObjectActionConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginTopicLogDailyDao;
import com.epmet.dao.evaluationindex.extract.FactOriginTopicMainDailyDao;
import com.epmet.dto.org.GridInfoDTO;
import com.epmet.dto.topic.TopicOriginInfoDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity;
import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService;
import com.epmet.service.org.CustomerGridService;
import com.epmet.service.topic.TopicService;
import com.epmet.service.user.UserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.ListUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 话题主表_日统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-15
*/
@Slf4j
@Service
public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOriginTopicMainDailyDao, FactOriginTopicMainDailyEntity> implements FactOriginTopicMainDailyService {
@Autowired
private TopicService topicService;
@Autowired
private CustomerGridService customerGridService;
@Autowired
private FactOriginTopicLogDailyDao factOriginTopicLogDailyDao;
@Autowired
private UserService userService;
/**
* @param customerId 客户id
* @param dateId yyyyMMdd
* @return void
* @author yinzuomei 数据采集话题本身
* @description fact_origin_topic_log_daily 话题明细_日统计 fact_origin_topic_main_daily 话题主表_日统计
* @Date 2020/9/15 13:40
**/
@Override
public Boolean topicCleaning(String customerId, String dateId) {
List<TopicOriginInfoDTO> topicOriginInfoList = topicService.queryTopicOriginInfoList(customerId, dateId);
if (CollectionUtils.isEmpty(topicOriginInfoList)) {
log.info(String.format("customerId%s,dateId%s,doesn't have any topic operation record",customerId,dateId));
return true;
}
Map<String,GridInfoDTO> gridMap=getGridInfoMap(customerId);
Map<String, Object> map=this.constructFactOriginData(topicOriginInfoList,gridMap);
List<FactOriginTopicMainDailyEntity> mainDailyEntityList= (List<FactOriginTopicMainDailyEntity>) map.get("main");
List<FactOriginTopicLogDailyEntity> logDailyEntityList= (List<FactOriginTopicLogDailyEntity>) map.get("log");
//删除之前统计的数据
deleteFactOriginData(customerId,dateId);
//批量保存主表
saveFactOriginTopicMainDailyEntity(mainDailyEntityList);
//批量保存明细表
saveFactOriginTopicLogDailyEntity(logDailyEntityList);
return true;
}
private Map<String, GridInfoDTO> getGridInfoMap(String customerId) {
Map<String ,GridInfoDTO> map=new HashMap<>();
List<GridInfoDTO> list=customerGridService.queryGridInfoList(customerId);
if(!CollectionUtils.isEmpty(list)){
return list.stream().collect(Collectors.toMap(GridInfoDTO::getGridId, gridInfoDTO -> gridInfoDTO));
}
return map;
}
/**
* @return void
* @param mainDailyEntityList
* @author yinzuomei
* @description 批量插入 fact_origin_topic_main_daily
* @Date 2020/9/16 11:21
**/
private void saveFactOriginTopicMainDailyEntity(List<FactOriginTopicMainDailyEntity> mainDailyEntityList) {
//批量插入
List<List<FactOriginTopicMainDailyEntity>> partition = ListUtils.partition(mainDailyEntityList, IndexCalConstant.INSERT_SIZE);
partition.forEach(list -> {
baseDao.insertBatchEntity(list);
});
}
/**
* @return void
* @param logDailyEntityList
* @author yinzuomei
* @description 批量插入fact_origin_topic_log_daily
* @Date 2020/9/16 12:53
**/
private void saveFactOriginTopicLogDailyEntity(List<FactOriginTopicLogDailyEntity> logDailyEntityList) {
//批量插入
List<List<FactOriginTopicLogDailyEntity>> partition = ListUtils.partition(logDailyEntityList, IndexCalConstant.INSERT_SIZE);
partition.forEach(list -> {
factOriginTopicLogDailyDao.insertBatchEntity(list);
});
}
/**
* @return java.util.Map<java.lang.String,java.lang.Object>
* @param topicOriginInfoList
* @author yinzuomei
* @description 构造好要插入的数据
* @Date 2020/9/16 11:21
**/
private Map<String, Object> constructFactOriginData(List<TopicOriginInfoDTO> topicOriginInfoList,Map<String,GridInfoDTO> gridMap) {
Map<String, Object> map=new HashMap<>();
List<FactOriginTopicMainDailyEntity> mainDailyEntityList=new ArrayList<>();
List<FactOriginTopicLogDailyEntity> logDailyEntityList=new ArrayList<>();
List<String> userIds = topicOriginInfoList.stream().map(topic -> topic.getOperateUserId()).distinct().collect(Collectors.toList());
Map<String,Integer> userIsPartyMap = userService.selectUserIsParty(userIds);
for(TopicOriginInfoDTO topicOriginInfoDTO:topicOriginInfoList){
GridInfoDTO gridInfoDTO=gridMap.get(topicOriginInfoDTO.getGridId());
if(null==gridInfoDTO){
log.error("没有找到 gridId="+topicOriginInfoDTO.getGridId()+" 的基本信息");
// continue;
throw new RenException("xxxxxx");
}
// 一年的第几周
String weekId = DateUtils.format(topicOriginInfoDTO.getOriginalBusinessTime(), DateUtils.DATE_PATTERN_YYYY).concat("W").concat(String.valueOf(DateUtils.getWeekOfYear(topicOriginInfoDTO.getOriginalBusinessTime())));
String quarterId=DateUtils.getQuarterId(topicOriginInfoDTO.getMonthId());
if(DimObjectActionConstant.TOPIC_PUBLISH.equals(topicOriginInfoDTO.getActionCode())){
//如果是新发布的话题需要插入主表
FactOriginTopicMainDailyEntity mainDailyEntity=ConvertUtils.sourceToTarget(topicOriginInfoDTO, FactOriginTopicMainDailyEntity.class);
mainDailyEntity.setId(topicOriginInfoDTO.getTopicId());
mainDailyEntity.setWeekId(weekId);
mainDailyEntity.setQuarterId(quarterId);
mainDailyEntity.setCreateTopicUserId(topicOriginInfoDTO.getOperateUserId());
//网格所属的组织id
mainDailyEntity.setAgencyId(gridInfoDTO.getAgencyId());
//网格的上上级组织id=街道id
mainDailyEntity.setPid(gridInfoDTO.getPid());
//TODO
//话题发布人是否是党员:1是党员0不是。 默认0
if (null != userIsPartyMap && null != userIsPartyMap.get(topicOriginInfoDTO.getOperateUserId())) {
mainDailyEntity.setCreateTopicUserIsParty(userIsPartyMap.get(topicOriginInfoDTO.getOperateUserId()) == NumConstant.ONE ? true : false);
} else {
mainDailyEntity.setCreateTopicUserIsParty(false);
}
mainDailyEntityList.add(mainDailyEntity);
}
FactOriginTopicLogDailyEntity logDailyEntity= ConvertUtils.sourceToTarget(topicOriginInfoDTO, FactOriginTopicLogDailyEntity.class);
logDailyEntity.setCustomerId(topicOriginInfoDTO.getCustomerId());
logDailyEntity.setGridId(topicOriginInfoDTO.getGridId());
logDailyEntity.setWeekId(weekId);
logDailyEntity.setQuarterId(quarterId);
logDailyEntity.setAgencyId(gridInfoDTO.getAgencyId());
logDailyEntity.setPid(gridInfoDTO.getPid());
//TODO
if (null != userIsPartyMap && null != userIsPartyMap.get(topicOriginInfoDTO.getOperateUserId())) {
logDailyEntity.setOperateUserIsParty(userIsPartyMap.get(topicOriginInfoDTO.getOperateUserId()) == NumConstant.ONE ? true : false);
} else {
logDailyEntity.setOperateUserIsParty(false);
}
logDailyEntityList.add(logDailyEntity);
}
map.put("main",mainDailyEntityList);
map.put("log",logDailyEntityList);
return map;
}
/**
* @return void
* @param customerId
* @param dateId
* @author yinzuomei
* @description 删除之前统计过的数据
* @Date 2020/9/16 11:21
**/
private void deleteFactOriginData(String customerId, String dateId) {
int mainDeleteNum;
do {
//一次删除50条
mainDeleteNum = baseDao.deleteByDateIdAndCustomerId(customerId,
dateId,
IndexCalConstant.DELETE_SIZE);
} while (mainDeleteNum > NumConstant.ZERO);
int logDeleteNum;
do {
//一次删除50条
logDeleteNum = factOriginTopicLogDailyDao.deleteByDateIdAndCustomerId(customerId,
dateId,
IndexCalConstant.DELETE_SIZE);
} while (logDeleteNum > NumConstant.ZERO);
}
}

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

@ -0,0 +1,243 @@
package com.epmet.service.evaluationindex.extract.impl;
import com.epmet.commons.tools.dto.form.TimeListResultDTO;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.ExtractConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginIssueLogDailyDao;
import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao;
import com.epmet.dao.stats.DimAgencyDao;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.IssueLogDailyFormDTO;
import com.epmet.dto.extract.form.IssueMainDailyFormDTO;
import com.epmet.dto.extract.result.SatisfactionInfoResultDTO;
import com.epmet.dto.extract.result.AgencyInfoResultDTO;
import com.epmet.dto.extract.result.IssueInfoResultDTO;
import com.epmet.dto.extract.result.IssueProcessInfoResultDTO;
import com.epmet.dto.extract.result.TopicInfoResultDTO;
import com.epmet.service.Issue.IssueService;
import com.epmet.service.evaluationindex.extract.IssueExtractService;
import com.epmet.service.topic.TopicService;
import com.epmet.service.user.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.validation.constraints.NotBlank;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Author zxc
* @DateTime 2020/9/14 5:08 下午
*/
@Service
@Slf4j
public class IssueExtractServiceImpl implements IssueExtractService {
@Autowired
private FactOriginIssueMainDailyDao issueMainDailyDao;
@Autowired
private IssueService issueService;
@Autowired
private UserService userService;
@Autowired
private TopicService topicService;
@Autowired
private DimAgencyDao dimAgencyDao;
@Autowired
private FactOriginIssueLogDailyDao issueLogDailyDao;
/**
* @Description 议题抽取
* @param extractFormDTO
* @author zxc
* @date 2020/9/15 2:02 下午
*/
@Override
public Boolean issueExtractMain(ExtractFormDTO extractFormDTO) {
String customerId = extractFormDTO.getCustomerId();
String dateId = extractFormDTO.getDateId();
// 1. 议题信息查询
List<IssueInfoResultDTO> listResult = issueService.selectIssueInfo(customerId, dateId);
List<IssueMainDailyFormDTO> result = new ArrayList<>();
if (CollectionUtils.isEmpty(listResult)){
throw new RenException(ExtractConstant.ISSUE_INFO);
}
listResult.forEach(issue -> {
IssueMainDailyFormDTO issueMainDailyFormDTO = ConvertUtils.sourceToTarget(issue, IssueMainDailyFormDTO.class);
issueMainDailyFormDTO.setId(issue.getIssueId());
result.add(issueMainDailyFormDTO);
});
// 2. 创建议题人ID
List<String> userIds = listResult.stream().map(issue -> issue.getUserId()).distinct().collect(Collectors.toList());
Map<String,Integer> map = userService.selectUserIsParty(userIds);
if (null != map){
result.forEach(r -> {
map.forEach((userId,isParty) -> {
if (r.getUserId().equals(userId)){
r.setIsParty(isParty);
}
});
});
}
// 3. 创建话题用户身份信息查询
List<String> topicIds = listResult.stream().map(issue -> issue.getTopicId()).collect(Collectors.toList());
List<TopicInfoResultDTO> topicInfoList = topicService.selectTopicInfo(topicIds);
if (CollectionUtils.isEmpty(topicInfoList)){
throw new RenException(ExtractConstant.CREATED_TOPIC_USER_IDENTITY);
}
List<String> createTopicUserIds = topicInfoList.stream().map(topic -> topic.getUserId()).distinct().collect(Collectors.toList());
Map<String, Integer> topicUserIsParty = userService.selectUserIsParty(createTopicUserIds);
topicInfoList.forEach(topic -> {
topicUserIsParty.forEach((userId,isParty) -> {
if (topic.getUserId().equals(userId)){
topic.setIsParty(isParty);
}
});
});
// 4. 根据dateId赋值
TimeListResultDTO timeList = DateUtils.getTimeList(dateId);
result.forEach(r -> {
r.setDateId(dateId);
r.setWeekId(timeList.getWeekId());
r.setMonthId(timeList.getMonthId());
r.setQuarterId(timeList.getQuarterId());
r.setYearId(timeList.getYearId());
topicInfoList.forEach(topic -> {
if (r.getTopicId().equals(topic.getTopicId())){
r.setCreateTopicUserId(topic.getUserId());
r.setTopicUserIsParty(topic.getIsParty());
}
});
});
// 5. 查询pid
List<String> agencyIds = result.stream().map(r -> r.getAgencyId()).distinct().collect(Collectors.toList());
List<AgencyInfoResultDTO> agencyInfoList = dimAgencyDao.selectAgencyInfo(agencyIds);
if (CollectionUtils.isEmpty(agencyInfoList)){
throw new RenException(ExtractConstant.PARENT_AGENCY_ID_LIST);
}
result.forEach(r -> {
agencyInfoList.forEach(pid -> {
if (r.getAgencyId().equals(pid.getAgencyId())){
r.setPid(pid.getPid());
}
});
});
delAndInsertMain(customerId,dateId,result);
return true;
}
/**
* @Description 议题主表删除插入
* @param customerId
* @param dateId
* @param result
* @author zxc
* @date 2020/9/16 3:32 下午
*/
@Transactional(rollbackFor = Exception.class)
public void delAndInsertMain(String customerId,String dateId,List<IssueMainDailyFormDTO> result){
issueMainDailyDao.deleteOldMainRecord(customerId, dateId);
issueMainDailyDao.insertIssueMainList(result);
}
/**
* @Description 议题抽取(log)
* @param extractFormDTO
* @author zxc
* @date 2020/9/16 9:41 上午
*/
@Override
public Boolean issueExtractLog(ExtractFormDTO extractFormDTO) {
String customerId = extractFormDTO.getCustomerId();
String dateId = extractFormDTO.getDateId();
List<IssueLogDailyFormDTO> result = new ArrayList<>();
// 1. 查询议题process
List<IssueProcessInfoResultDTO> listResult = issueService.selectIssueProcessInfo(customerId, dateId);
if (CollectionUtils.isEmpty(listResult)){
throw new RenException(ExtractConstant.ISSUE_PROCESS);
}
listResult.forEach(issueProcess -> {
IssueLogDailyFormDTO issueLogDailyFormDTO = ConvertUtils.sourceToTarget(issueProcess, IssueLogDailyFormDTO.class);
issueLogDailyFormDTO.setOperationUserId(issueProcess.getUserId());
result.add(issueLogDailyFormDTO);
});
// 2. 查询议题满意度
List<SatisfactionInfoResultDTO> satisfactionInfoList = issueService.selectIssueSatisfactionInfo(customerId, dateId);
if (!CollectionUtils.isEmpty(satisfactionInfoList)){
satisfactionInfoList.forEach(s -> {
IssueLogDailyFormDTO issueLogDailyFormDTO = ConvertUtils.sourceToTarget(s, IssueLogDailyFormDTO.class);
issueLogDailyFormDTO.setOperationUserId(s.getUserId());
result.add(issueLogDailyFormDTO);
});
}
// 3. 查询议题支持反对
List<SatisfactionInfoResultDTO> voteInfoList = issueService.selectIssueVoteInfo(customerId, dateId);
if (!CollectionUtils.isEmpty(voteInfoList)){
voteInfoList.forEach(v -> {
IssueLogDailyFormDTO issueLogDailyFormDTO = ConvertUtils.sourceToTarget(v, IssueLogDailyFormDTO.class);
issueLogDailyFormDTO.setOperationUserId(v.getUserId());
result.add(issueLogDailyFormDTO);
});
}
// 4. 动作操作人的身份标识是否是党员
List<String> userIds = listResult.stream().map(issue -> issue.getUserId()).distinct().collect(Collectors.toList());
Map<String,Integer> map = userService.selectUserIsParty(userIds);
if (null != map){
result.forEach(r -> {
map.forEach((userId,isParty) -> {
if (r.getOperationUserId().equals(userId)){
r.setIsParty(isParty);
}
});
});
}
// 5. 上级ID
List<String> agencyIds = listResult.stream().map(process -> process.getAgencyId()).distinct().collect(Collectors.toList());
List<AgencyInfoResultDTO> agencyInfoList = dimAgencyDao.selectAgencyInfo(agencyIds);
if (CollectionUtils.isEmpty(agencyInfoList)){
throw new RenException(ExtractConstant.PARENT_AGENCY_ID_LIST);
}
TimeListResultDTO timeList = DateUtils.getTimeList(dateId);
result.forEach(r -> {
r.setDateId(dateId);
r.setWeekId(timeList.getWeekId());
r.setMonthId(timeList.getMonthId());
r.setQuarterId(timeList.getQuarterId());
r.setYearId(timeList.getYearId());
agencyInfoList.forEach(agency -> {
if (r.getAgencyId().equals(agency.getAgencyId())){
r.setPid(agency.getPid());
}
});
});
delAndInsertLog(customerId,dateId,result);
return true;
}
/**
* @Description 议题附表删除插入
* @param customerId
* @param dateId
* @param result
* @author zxc
* @date 2020/9/16 3:32 下午
*/
@Transactional(rollbackFor = Exception.class)
public void delAndInsertLog(String customerId,String dateId,List<IssueLogDailyFormDTO> result){
issueLogDailyDao.deleteOldLogRecord(customerId, dateId);
issueLogDailyDao.insertIssueLogList(result);
}
}

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

@ -3,6 +3,7 @@ package com.epmet.service.org;
import com.epmet.dto.group.AgencyDTO;
import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO;
import com.epmet.dto.group.result.GridIdListByCustomerResultDTO;
import com.epmet.dto.org.GridInfoDTO;
import com.epmet.entity.org.CustomerGridEntity;
import java.util.Date;
@ -40,4 +41,13 @@ public interface CustomerGridService {
* @return
*/
List<CustomerGridEntity> listUpdatedGridsByUpdateTime(Date lastInitTime, Date now);
/**
* @return java.util.List<com.epmet.dto.org.GridInfoDTO>
* @param customerId
* @author yinzuomei
* @description 查询客户下的网格的agencyId, 还有pid
* @Date 2020/9/16 14:02
**/
List<GridInfoDTO> queryGridInfoList(String customerId);
}

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

@ -6,6 +6,7 @@ import com.epmet.dao.org.CustomerGridDao;
import com.epmet.dto.group.AgencyDTO;
import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO;
import com.epmet.dto.group.result.GridIdListByCustomerResultDTO;
import com.epmet.dto.org.GridInfoDTO;
import com.epmet.entity.org.CustomerGridEntity;
import com.epmet.service.org.CustomerGridService;
import org.springframework.beans.factory.annotation.Autowired;
@ -51,4 +52,16 @@ public class CustomerGridServiceImpl implements CustomerGridService {
public List<CustomerGridEntity> listUpdatedGridsByUpdateTime(Date lastInitTime, Date now) {
return customerGridDao.listUpdatedGridsByUpdateTime(lastInitTime, now);
}
/**
* @param customerId
* @return java.util.List<com.epmet.dto.org.GridInfoDTO>
* @author yinzuomei
* @description 查询客户下的网格的agencyId, 还有pid
* @Date 2020/9/16 14:02
**/
@Override
public List<GridInfoDTO> queryGridInfoList(String customerId) {
return customerGridDao.selectListGridInfo(customerId);
}
}

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/PartyMemberService.java

@ -0,0 +1,22 @@
package com.epmet.service.partymember;
import com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/9/17 1:52 下午
*/
public interface PartyMemberService {
/**
* @Description 查询党员信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/17 1:58 下午
*/
List<DimCustomerPartyMemberFormDTO> selectPartyMemberInfo(String customerId, String dateId);
}

38
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/impl/PartyMemberServiceImpl.java

@ -0,0 +1,38 @@
package com.epmet.service.partymember.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.partymember.PartyMemberDao;
import com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO;
import com.epmet.service.partymember.PartyMemberService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/9/17 1:53 下午
*/
@Service
@Slf4j
@DataSource(DataSourceConstant.PARTY_MEMBER)
public class PartyMemberServiceImpl implements PartyMemberService {
@Autowired
private PartyMemberDao partyMemberDao;
/**
* @Description 查询党员信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/17 1:58 下午
*/
@Override
public List<DimCustomerPartyMemberFormDTO> selectPartyMemberInfo(String customerId, String dateId){
return partyMemberDao.selectPartyMemberInfo(customerId, dateId);
}
}

104
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java

@ -0,0 +1,104 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.stats.DimCustomerPartymemberDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.entity.stats.DimCustomerPartymemberEntity;
import java.util.List;
import java.util.Map;
/**
* 党员维度表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-17
*/
public interface DimCustomerPartymemberService extends BaseService<DimCustomerPartymemberEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<DimCustomerPartymemberDTO>
* @author generator
* @date 2020-09-17
*/
PageData<DimCustomerPartymemberDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<DimCustomerPartymemberDTO>
* @author generator
* @date 2020-09-17
*/
List<DimCustomerPartymemberDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return DimCustomerPartymemberDTO
* @author generator
* @date 2020-09-17
*/
DimCustomerPartymemberDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-09-17
*/
void save(DimCustomerPartymemberDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-09-17
*/
void update(DimCustomerPartymemberDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-09-17
*/
void delete(String[] ids);
/**
* @Description 统计党员
* @param customerIdAndDateIdFormDTO
* @author zxc
* @date 2020/9/17 11:05 上午
*/
Boolean statsPartyMember(CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO);
}

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerService.java

@ -116,4 +116,11 @@ public interface DimCustomerService extends BaseService<DimCustomerEntity> {
DimCustomerEntity getLatestCreatedDimEntity();
DimCustomerEntity getLatestUpdatedDimEntity();
/**
* @Description 查询所有客户ID
* @author zxc
* @date 2020/9/17 3:30 下午
*/
List<String> getAllCustomerId();
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimGridService.java

@ -23,6 +23,7 @@ import com.epmet.dto.group.AgencyDTO;
import com.epmet.dto.group.result.AgencyGridInfoResultDTO;
import com.epmet.dto.group.result.SubAgencyIdResultDTO;
import com.epmet.dto.stats.DimGridDTO;
import com.epmet.dto.stats.result.GridBelongAgencyResultDTO;
import com.epmet.entity.stats.DimGridEntity;
import com.epmet.entity.stats.LastExecRecordEntity;
@ -129,4 +130,12 @@ public interface DimGridService extends BaseService<DimGridEntity> {
List<SubAgencyIdResultDTO> selectSubAgencyId(List<AgencyDTO> formDTO);
DimGridEntity getLastUpdatedGridDim();
/**
* @Description 查询网格属于哪个机关
* @param gridIds
* @author zxc
* @date 2020/9/17 2:34 下午
*/
List<GridBelongAgencyResultDTO> selectGridBelongAgencyInfo(List<String> gridIds);
}

174
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java

@ -0,0 +1,174 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.dto.form.TimeListResultDTO;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.StatsConstant;
import com.epmet.dao.stats.DimCustomerPartymemberDao;
import com.epmet.dto.stats.DimCustomerPartymemberDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO;
import com.epmet.dto.stats.result.GridBelongAgencyResultDTO;
import com.epmet.entity.stats.DimCustomerPartymemberEntity;
import com.epmet.service.partymember.PartyMemberService;
import com.epmet.service.stats.DimCustomerPartymemberService;
import com.epmet.service.stats.DimCustomerService;
import com.epmet.service.stats.DimGridService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 党员维度表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-17
*/
@Service
public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl<DimCustomerPartymemberDao, DimCustomerPartymemberEntity> implements DimCustomerPartymemberService {
@Autowired
private DimCustomerPartymemberDao partyMemberDao;
@Autowired
private PartyMemberService partyMemberService;
@Autowired
private DimGridService dimGridService;
@Autowired
private DimCustomerService dimCustomerService;
@Override
public PageData<DimCustomerPartymemberDTO> page(Map<String, Object> params) {
IPage<DimCustomerPartymemberEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, DimCustomerPartymemberDTO.class);
}
@Override
public List<DimCustomerPartymemberDTO> list(Map<String, Object> params) {
List<DimCustomerPartymemberEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, DimCustomerPartymemberDTO.class);
}
private QueryWrapper<DimCustomerPartymemberEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<DimCustomerPartymemberEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public DimCustomerPartymemberDTO get(String id) {
DimCustomerPartymemberEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, DimCustomerPartymemberDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(DimCustomerPartymemberDTO dto) {
DimCustomerPartymemberEntity entity = ConvertUtils.sourceToTarget(dto, DimCustomerPartymemberEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(DimCustomerPartymemberDTO dto) {
DimCustomerPartymemberEntity entity = ConvertUtils.sourceToTarget(dto, DimCustomerPartymemberEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @Description 统计党员
* @param customerIdAndDateIdFormDTO
* @author zxc
* @date 2020/9/17 11:05 上午
*/
@Override
public Boolean statsPartyMember(CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO) {
List<String> allCustomerId = dimCustomerService.getAllCustomerId();
if (CollectionUtils.isEmpty(allCustomerId)){
throw new RenException(StatsConstant.CUSTOMER_INFO_NULL);
}
allCustomerId.forEach(customerId -> {
String dateId = customerIdAndDateIdFormDTO.getDateId();
List<DimCustomerPartyMemberFormDTO> partyMemberList = partyMemberService.selectPartyMemberInfo(customerId, dateId);
if (CollectionUtils.isEmpty(partyMemberList)){
throw new RenException(String.format(StatsConstant.PARTY_INFO_LIST,customerId));
}
List<String> gridIds = partyMemberList.stream().map(party -> party.getGridId()).distinct().collect(Collectors.toList());
List<GridBelongAgencyResultDTO> agencyInfos = dimGridService.selectGridBelongAgencyInfo(gridIds);
TimeListResultDTO timeList = DateUtils.getTimeList(dateId);
partyMemberList.forEach(party -> {
BeanUtils.copyProperties(timeList,party);
agencyInfos.forEach(agency -> {
if (party.getGridId().equals(agency.getGridId())){
party.setAgencyId(agency.getAgencyId());
party.setParentId(agency.getParentId());
}
});
});
delAndInsertParty(partyMemberList,customerId,dateId);
});
return true;
}
/**
* @Description 删除旧纪录插入新纪录
* @param partyMemberList
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/17 2:46 下午
*/
@Transactional(rollbackFor = Exception.class)
public void delAndInsertParty(List<DimCustomerPartyMemberFormDTO> partyMemberList,String customerId,String dateId){
if (!CollectionUtils.isEmpty(partyMemberList)){
partyMemberDao.deleteOldPartyRecord(customerId, dateId);
partyMemberDao.insertPartyMemberInfo(partyMemberList);
}
}
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java

@ -159,4 +159,14 @@ public class DimCustomerServiceImpl extends BaseServiceImpl<DimCustomerDao, DimC
public DimCustomerEntity getLatestUpdatedDimEntity() {
return baseDao.getLatestUpdatedDimEntity();
}
/**
* @Description 查询所有客户ID
* @author zxc
* @date 2020/9/17 3:30 下午
*/
@Override
public List<String> getAllCustomerId() {
return baseDao.getAllCustomerId();
}
}

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

@ -34,6 +34,7 @@ import com.epmet.dto.group.AgencyDTO;
import com.epmet.dto.group.result.AgencyGridInfoResultDTO;
import com.epmet.dto.group.result.SubAgencyIdResultDTO;
import com.epmet.dto.stats.DimGridDTO;
import com.epmet.dto.stats.result.GridBelongAgencyResultDTO;
import com.epmet.entity.stats.DimGridEntity;
import com.epmet.service.stats.DimGridService;
import org.apache.commons.lang3.StringUtils;
@ -165,4 +166,15 @@ public class DimGridServiceImpl extends BaseServiceImpl<DimGridDao, DimGridEntit
public DimGridEntity getLastUpdatedGridDim() {
return baseDao.getLastUpdatedGridDim();
}
/**
* @Description 查询网格属于哪个机关
* @param gridIds
* @author zxc
* @date 2020/9/17 2:34 下午
*/
@Override
public List<GridBelongAgencyResultDTO> selectGridBelongAgencyInfo(List<String> gridIds) {
return baseDao.selectGridBelongAgencyInfo(gridIds);
}
}

19
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java

@ -1,8 +1,10 @@
package com.epmet.service.topic;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.extract.result.TopicInfoResultDTO;
import com.epmet.dto.stats.DimTopicStatusDTO;
import com.epmet.dto.stats.topic.result.TopicStatisticalData;
import com.epmet.dto.topic.TopicOriginInfoDTO;
import com.epmet.util.DimIdGenerator;
import java.util.Date;
@ -25,4 +27,21 @@ public interface TopicService {
**/
TopicStatisticalData compute(List<AgencySubTreeDto> agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension, String customerId, List<DimTopicStatusDTO> statusDimension);
/**
* @return java.util.List<com.epmet.dto.topic.TopicOriginInfoDTO>
* @param customerId
* @param dateId yyyyMMdd
* @author yinzuomei
* @description 根据日期查询resi_topic_operation返回所有对话体的操作记录
* @Date 2020/9/15 18:12
**/
List<TopicOriginInfoDTO> queryTopicOriginInfoList(String customerId, String dateId);
/**
* @Description 查询话题创建者信息
* @param topicIds
* @author zxc
* @date 2020/9/15 4:55 下午
*/
List<TopicInfoResultDTO> selectTopicInfo(List<String> topicIds);
}

50
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java

@ -5,11 +5,13 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.topic.TopicDao;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.extract.result.TopicInfoResultDTO;
import com.epmet.dto.stats.DimTopicStatusDTO;
import com.epmet.dto.stats.topic.*;
import com.epmet.dto.stats.topic.result.GridTopicData;
import com.epmet.dto.stats.topic.result.GroupTopicData;
import com.epmet.dto.stats.topic.result.TopicStatisticalData;
import com.epmet.dto.topic.TopicOriginInfoDTO;
import com.epmet.dto.topic.result.ResiGroupTopicResultDTO;
import com.epmet.dto.topic.result.ResiTopicOperationResultDTO;
import com.epmet.dto.topic.result.ResiTopicResultDTO;
@ -94,6 +96,20 @@ public class TopicServiceImpl implements TopicService {
}
/**
* @Description 查询话题创建者信息
* @param topicIds
* @author zxc
* @date 2020/9/15 4:55 下午
*/
@Override
public List<TopicInfoResultDTO> selectTopicInfo(List<String> topicIds) {
return topicDao.selectTopicInfo(topicIds);
}
/**
* @Description 初始化机关-所有下级网格Map
* @param pid - 固定一个机关Id
@ -219,9 +235,10 @@ public class TopicServiceImpl implements TopicService {
List<ResiGroupTopicResultDTO> groupList = new LinkedList<>();
for(Map.Entry<String,List<ResiGroupTopicResultDTO>> entry : gridGroupMap.entrySet()){
if(null != entry.getValue() && entry.getValue().size() > NumConstant.ZERO)
if(null != entry.getValue() && entry.getValue().size() > NumConstant.ZERO){
groupList.addAll(entry.getValue());
}
}
//key -> groupId
Map<String,GroupTopicData> groupTopicData = traverseGroupTopic(groupList,topicOperationMap);
@ -353,9 +370,10 @@ public class TopicServiceImpl implements TopicService {
List<ResiGroupTopicResultDTO> groupListBetweenTimeRange = new LinkedList<>();
for(Map.Entry<String,List<ResiGroupTopicResultDTO>> entryBetweenTimeRange : GridGroupMapBetweenTimeRange.entrySet()){
if(null != entryBetweenTimeRange.getValue() && entryBetweenTimeRange.getValue().size() > NumConstant.ZERO)
if(null != entryBetweenTimeRange.getValue() && entryBetweenTimeRange.getValue().size() > NumConstant.ZERO){
groupListBetweenTimeRange.addAll(entryBetweenTimeRange.getValue());
}
}
List<ResiTopicOperationResultDTO> operationsBetweenTimeRange =
topicDao.selectTopicOperationRecordBetweenTimeRange(calendar.getTime(),targetDateCheck);
@ -447,9 +465,9 @@ public class TopicServiceImpl implements TopicService {
* @date 2020.06.22 16:03
**/
Map<String,GroupTopicData> traverseGroupTopic(List<ResiGroupTopicResultDTO> groups, Map<String,List<ResiTopicOperationResultDTO>> topicOperationMap){
if(null == groups || groups.size() < NumConstant.ONE)
if(null == groups || groups.size() < NumConstant.ONE){
return null;
}
Map<String , GroupTopicData> groupTopicStatistical = new HashMap<>();
groups.forEach(group -> {
@ -477,7 +495,9 @@ public class TopicServiceImpl implements TopicService {
//}else{
for (ResiTopicResultDTO topic : group.getTopics()) {
if(StringUtils.isBlank(topic.getTopicId())) continue;
if(StringUtils.isBlank(topic.getTopicId())){
continue;
}
if (StringUtils.equals(NumConstant.ONE_STR, topic.getIncrFlag())) {
groupTopicData.setTopicIncr(groupTopicData.getTopicIncr() + NumConstant.ONE);
}
@ -966,9 +986,10 @@ public class TopicServiceImpl implements TopicService {
List<ResiGroupTopicResultDTO> groupList = new LinkedList<>();
for(Map.Entry<String,List<ResiGroupTopicResultDTO>> entry : gridGroupMap.entrySet()){
if(null != entry.getValue() && entry.getValue().size() > NumConstant.ZERO)
if(null != entry.getValue() && entry.getValue().size() > NumConstant.ZERO){
groupList.addAll(entry.getValue());
}
}
//key -> groupId
Map<String,GroupTopicData> groupTopicData = traverseGroupTopic(groupList,topicOperationMap);
@ -1134,9 +1155,10 @@ public class TopicServiceImpl implements TopicService {
List<ResiGroupTopicResultDTO> groupListBetweenTimeRange = new LinkedList<>();
for(Map.Entry<String,List<ResiGroupTopicResultDTO>> entryBetweenTimeRange : GridGroupMapBetweenTimeRange.entrySet()){
if(null != entryBetweenTimeRange.getValue() && entryBetweenTimeRange.getValue().size() > NumConstant.ZERO)
if(null != entryBetweenTimeRange.getValue() && entryBetweenTimeRange.getValue().size() > NumConstant.ZERO){
groupListBetweenTimeRange.addAll(entryBetweenTimeRange.getValue());
}
}
List<ResiTopicOperationResultDTO> operationsBetweenTimeRange =
topicDao.selectTopicOperationRecordBetweenTimeRange(calendar.getTime(),targetDate);
@ -1251,5 +1273,17 @@ public class TopicServiceImpl implements TopicService {
}
/**
* @param customerId
* @param dateId
* @return java.util.List<com.epmet.dto.topic.TopicOriginInfoDTO>
* @author yinzuomei
* @description 根据日期查询resi_topic_operation返回所有对话题操作记录
* @Date 2020/9/15 18:13
**/
@DataSource(DataSourceConstant.RESI_GROUP)
@Override
public List<TopicOriginInfoDTO> queryTopicOriginInfoList(String customerId, String dateId) {
return topicDao.selectListTopicOriginInfo(customerId, dateId);
}
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java

@ -27,4 +27,12 @@ public interface UserService {
* @date 2020.06.18 10:03
**/
UserStatisticalData traverseGridUser(List<AgencySubTreeDto> agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension);
/**
* @Description 查询用户是不是党员
* @param userIds
* @author zxc
* @date 2020/9/15 4:23 下午
*/
Map<String,Integer> selectUserIsParty(List<String> userIds);
}

34
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java

@ -3,8 +3,10 @@ package com.epmet.service.user.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.ExtractConstant;
import com.epmet.dao.user.UserDao;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.extract.result.UserPartyResultDTO;
import com.epmet.dto.stats.user.*;
import com.epmet.dto.stats.user.result.UserStatisticalData;
import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO;
@ -16,11 +18,13 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
/**
@ -118,6 +122,36 @@ public class UserServiceImpl implements UserService {
return dataPacket;
}
/**
* @Description 查询用户是不是党员
* @param userIds
* @author zxc
* @date 2020/9/15 4:23 下午
*/
@Override
public Map<String,Integer> selectUserIsParty(List<String> userIds) {
List<UserPartyResultDTO> userPartyResultDTOS = userDao.selectUserIsParty(userIds);
Map<String,Integer> result = new HashMap<>();
if (!CollectionUtils.isEmpty(userPartyResultDTOS)){
Map<String, List<UserPartyResultDTO>> collect = userPartyResultDTOS.stream().collect(Collectors.groupingBy(UserPartyResultDTO::getUserId));
collect.forEach((userId,c) -> {
AtomicReference<Boolean> isParty = new AtomicReference<>(false);
c.forEach(user -> {
if (user.getRoleName().equals(ExtractConstant.PARTY)){
isParty.set(true);
}
});
result.put(userId,isParty.get() == true ? NumConstant.ONE : NumConstant.ZERO);
});
}
for (String userId : userIds) {
if (!result.containsKey(userId)){
result.put(userId,NumConstant.ZERO);
}
}
return result;
}
/**
* @Description 初始化机关-所有下级网格Map

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

@ -170,6 +170,11 @@ dynamic:
url: @datasource.druid.evaluationIndex.url@
username: @datasource.druid.evaluationIndex.username@
password: @datasource.druid.evaluationIndex.password@
partyMember:
driver-class-name: com.mysql.cj.jdbc.Driver
url: @datasource.druid.partyMember.url@
username: @datasource.druid.partyMember.username@
password: @datasource.druid.partyMember.password@
thread:
# 线程池配置

7
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/DimObjectActionDao.xml

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.evaluationindex.extract.DimObjectActionDao">
</mapper>

8
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/DimObjectStatusDao.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.evaluationindex.extract.DimObjectStatusDao">
</mapper>

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

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.evaluationindex.extract.FactOriginIssueLogDailyDao">
<!-- 议题记录附表插入 -->
<insert id="insertIssueLogList">
INSERT INTO fact_origin_issue_log_daily (
ID,
CUSTOMER_ID,
GRID_ID,
PID,
AGENCY_ID,
DATE_ID,
WEEK_ID,
MONTH_ID,
QUARTER_ID,
YEAR_ID,
ISSUE_ID,
OPERATION_USER_ID,
ACTION_CODE,
IS_PARTY,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME)
VALUES
<foreach collection="issueLogList" item="item" index="index" separator=",">
(
REPLACE ( UUID(), '-', '' ),
#{item.customerId},
#{item.gridId},
#{item.pid},
#{item.agencyId},
#{item.dateId},
#{item.weekId},
#{item.monthId},
#{item.quarterId},
#{item.yearId},
#{item.issueId},
#{item.operationUserId},
#{item.actionCode},
#{item.isParty},
#{item.delFlag},
#{item.revision},
#{item.createdBy},
NOW(),
#{item.updatedBy},
NOW()
)
</foreach>
</insert>
<!-- 删除旧的记录 -->
<delete id="deleteOldLogRecord">
DELETE
FROM
fact_origin_issue_log_daily
WHERE
CUSTOMER_ID = #{customerId}
AND DATE_ID = #{dateId}
</delete>
</mapper>

69
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao">
<!-- 议题主表插入 -->
<insert id="insertIssueMainList">
INSERT INTO fact_origin_issue_main_daily(
ID,
DATE_ID,
WEEK_ID,
MONTH_ID,
QUARTER_ID,
YEAR_ID,
CUSTOMER_ID,
IS_PARTY,
USER_ID,
CREATE_TOPIC_USER_ID,
TOPIC_ID,
GRID_ID,
PID,
AGENCY_ID,
ISSUE_STATUS,
TOPIC_USER_IS_PARTY,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME)
VALUES
<foreach collection="issueMainList" item="item" index="index" separator=",">
(
#{item.id},
#{item.dateId},
#{item.weekId},
#{item.monthId},
#{item.quarterId},
#{item.yearId},
#{item.customerId},
#{item.isParty},
#{item.userId},
#{item.createTopicUserId},
#{item.topicId},
#{item.gridId},
#{item.pid},
#{item.agencyId},
#{item.issueStatus},
#{item.topicUserIsParty},
#{item.delFlag},
#{item.revision},
#{item.createdBy},
NOW(),
#{item.updatedBy},
NOW()
)
</foreach>
</insert>
<!-- 删除旧的记录 -->
<delete id="deleteOldMainRecord">
DELETE
FROM
fact_origin_issue_main_daily
WHERE
CUSTOMER_ID = #{customerId}
AND DATE_ID = #{dateId}
</delete>
</mapper>

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

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.evaluationindex.extract.FactOriginTopicLogDailyDao">
<delete id="deleteByDateIdAndCustomerId" parameterType="map">
DELETE
FROM
fact_origin_topic_log_daily
WHERE
CUSTOMER_ID = #{customerId}
AND DATE_ID = #{dateId}
LIMIT #{deleteSize}
</delete>
<insert id="insertBatchEntity" parameterType="map">
insert into fact_origin_topic_log_daily
(
ID,
CUSTOMER_ID,
GRID_ID,
AGENCY_ID,
PID,
DATE_ID,
WEEK_ID,
MONTH_ID,
QUARTER_ID,
YEAR_ID,
TOPIC_ID,
GROUP_ID,
ACTION_CODE,
OPERATE_USER_ID,
OPERATE_USER_IS_PARTY,
ORIGINAL_BUSINESS_TIME,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
) values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.id},
#{item.customerId},
#{item.gridId},
#{item.agencyId},
#{item.pid},
#{item.dateId},
#{item.weekId},
#{item.monthId},
#{item.quarterId},
#{item.yearId},
#{item.topicId},
#{item.groupId},
#{item.actionCode},
#{item.operateUserId},
#{item.operateUserIsParty},
#{item.originalBusinessTime},
0,
0,
'APP_USER',
now(),
'APP_USER',
now()
)
</foreach>
</insert>
</mapper>

65
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.evaluationindex.extract.FactOriginTopicMainDailyDao">
<delete id="deleteByDateIdAndCustomerId" parameterType="map">
DELETE
FROM
fact_origin_topic_main_daily
WHERE
CUSTOMER_ID = #{customerId}
AND DATE_ID = #{dateId}
LIMIT #{deleteSize}
</delete>
<insert id="insertBatchEntity" parameterType="map">
insert into fact_origin_topic_main_daily
(
ID,
CUSTOMER_ID,
GRID_ID,
AGENCY_ID,
PID,
DATE_ID,
WEEK_ID,
MONTH_ID,
QUARTER_ID,
YEAR_ID,
GROUP_ID,
TOPIC_STATUS,
CREATE_TOPIC_USER_ID,
CREATE_TOPIC_USER_IS_PARTY,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
) values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.id},
#{item.customerId},
#{item.gridId},
#{item.agencyId},
#{item.pid},
#{item.dateId},
#{item.weekId},
#{item.monthId},
#{item.quarterId},
#{item.yearId},
#{item.groupId},
#{item.topicStatus},
#{item.createTopicUserId},
#{item.createTopicUserIsParty},
0,
0,
'APP_USER',
now(),
'APP_USER',
now()
)
</foreach>
</insert>
</mapper>

81
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml

@ -182,4 +182,85 @@
<![CDATA[AND DATE_FORMAT(ipr.created_time, "%Y-%m-%d") <= DATE_FORMAT(#{createdTime}, "%Y-%m-%d")]]>
</select>
<!-- 查询议题信息【根据客户,dateId 】 -->
<select id="selectIssueInfo" resultType="com.epmet.dto.extract.result.IssueInfoResultDTO">
SELECT
ID AS issueId,
ISSUE_STATUS,
SOURCE_ID AS topicId,
CUSTOMER_ID,
GRID_ID,
ORG_ID AS agencyId,
CREATED_BY AS userId
FROM issue
WHERE
DEL_FLAG = '0'
AND customer_id = #{customerId}
AND DATE_FORMAT( CREATED_TIME, '%Y%m%d' ) = #{dateId}
</select>
<!-- 查询议题process信息 -->
<select id="selectIssueProcessInfo" resultType="com.epmet.dto.extract.result.IssueProcessInfoResultDTO">
SELECT
i.GRID_ID AS gridId,
i.ORG_ID AS agencyId,
i.CUSTOMER_ID AS customerId,
ip.ISSUE_ID AS issueId,
ip.CREATED_BY AS userId,
(case when i.RESOLVE_TYPE = 'resolved' then 'closed_resolved'
when i.RESOLVE_TYPE = 'unresolved' then 'closed_unresolved'
else i.ISSUE_STATUS end ) AS actionCode
FROM
issue_process ip
LEFT JOIN issue i ON i.id = ip.issue_id
WHERE
i.DEL_FLAG = '0'
AND ip.DEL_FLAG = '0'
AND i.CUSTOMER_ID = #{customerId}
AND DATE_FORMAT(i.CREATED_TIME,'%Y%m%d') = #{dateId}
</select>
<!-- 查询议题满意度评价信息 -->
<select id="selectIssueSatisfactionInfo" resultType="com.epmet.dto.extract.result.SatisfactionInfoResultDTO">
SELECT
isd.ISSUE_ID AS issueId,
( CASE WHEN isd.SATISFACTION = 'bad' THEN 'evaluste_bad'
WHEN isd.SATISFACTION = 'good' THEN 'evaluste_good'
WHEN isd.SATISFACTION = 'perfect' THEN 'evaluste_perfect'
ELSE '' END ) AS actionCode,
isd.CREATED_BY AS userId,
i.GRID_ID AS gridId,
i.ORG_ID AS agencyId,
i.CUSTOMER_ID AS customerId
FROM
issue_satisfaction_detail isd
LEFT JOIN issue i ON i.id = isd.issue_id
WHERE
isd.del_flag = '0'
AND i.del_flag = '0'
AND i.CUSTOMER_ID = #{customerId}
AND DATE_FORMAT(isd.CREATED_TIME,'%Y%m%d') = #{dateId}
</select>
<!-- 查询议题支持反对信息 -->
<select id="selectIssueVoteInfo" resultType="com.epmet.dto.extract.result.SatisfactionInfoResultDTO">
SELECT
ivd.ISSUE_ID AS issueId,
( CASE WHEN ivd.ATTITUDE = 'support' THEN 'vote_support'
WHEN ivd.ATTITUDE = 'opposition' THEN 'vote_opposition'
ELSE '' END ) AS actionCode,
ivd.CREATED_BY AS userId,
i.GRID_ID AS gridId,
i.ORG_ID AS agencyId,
i.CUSTOMER_ID AS customerId
FROM
issue_vote_detail ivd
LEFT JOIN issue i ON i.id = ivd.issue_id
WHERE
ivd.del_flag = '0'
AND i.del_flag = '0'
AND i.CUSTOMER_ID = #{customerId}
AND DATE_FORMAT(ivd.CREATED_TIME,'%Y%m%d') = #{dateId}
</select>
</mapper>

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

@ -68,4 +68,18 @@
WHERE UPDATED_TIME >= #{startTime}
AND UPDATED_TIME <![CDATA[<]]> #{endTime}
</select>
<select id="selectListGridInfo" parameterType="java.lang.String" resultType="com.epmet.dto.org.GridInfoDTO">
SELECT
cg.ID as GRID_ID,
cg.PID as AGENCY_ID,
ca.PID AS PID,
CG.CUSTOMER_ID
FROM
customer_grid cg
LEFT JOIN customer_agency ca ON ( cg.PID = CA.ID )
WHERE
CG.CUSTOMER_ID =#{customerId}
and cg.del_flag='0'
</select>
</mapper>

22
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.xml

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.partymember.PartyMemberDao">
<!-- 查询党员信息 -->
<select id="selectPartyMemberInfo" resultType="com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO">
SELECT
CUSTOMER_ID,
GRID_ID,
USER_ID,
ID_CARD,
STR_TO_DATE( SUBSTRING( ID_CARD, 7, 8 ),'%Y%m%d') AS birthday
FROM
partymember_info
WHERE
DEL_FLAG = 0
AND ( CONFIRM_RESULT = 'auto_confirm_success' OR CONFIRM_RESULT = 'approved' )
AND CUSTOMER_ID = #{customerId}
AND DATE_FORMAT( UPDATED_TIME, '%Y%m%d' ) = #{dateId}
</select>
</mapper>

17
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml

@ -299,4 +299,21 @@
limit 1
</select>
<!-- 查询pid信息 -->
<select id="selectAgencyInfo" resultType="com.epmet.dto.extract.result.AgencyInfoResultDTO">
SELECT
id AS agencyId,
pid
FROM
dim_agency
WHERE
del_flag = '0'
AND
(
<foreach collection="agencyIds" item="item" separator=" OR ">
id = #{item}
</foreach>
)
</select>
</mapper>

5
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml

@ -40,4 +40,9 @@
order by UPDATED_TIME desc
limit 1;
</select>
<!-- 查询所有客户ID -->
<select id="getAllCustomerId" resultType="java.lang.String">
SELECT ID FROM dim_customer WHERE DEL_FLAG = '0'
</select>
</mapper>

62
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.stats.DimCustomerPartymemberDao">
<!-- 批量插入党员信息 -->
<insert id="insertPartyMemberInfo">
INSERT INTO dim_customer_partymember (
ID,
CUSTOMER_ID,
GRID_ID,
AGENCY_ID,
PARENT_ID,
DATE_ID,
WEEK_ID,
MONTH_ID,
QUARTER_ID,
YEAR_ID,
USER_ID,
ID_CARD,
BIRTHDAY,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
)
VALUES
<foreach collection="partyMemberInfos" item="item" separator=",">
(
REPLACE ( UUID(), '-', '' ),
#{item.customerId},
#{item.gridId},
#{item.agencyId},
#{item.parentId},
#{item.dateId},
#{item.weekId},
#{item.monthId},
#{item.quarterId},
#{item.yearId},
#{item.userId},
#{item.idCard},
#{item.birthday},
#{item.delFlag},
#{item.revision},
#{item.createdBy},
NOW(),
#{item.updatedBy},
NOW()
)
</foreach>
</insert>
<!-- 删除旧党员记录 -->
<delete id="deleteOldPartyRecord">
DELETE FROM dim_customer_partymember
WHERE
CUSTOMER_ID = #{customerId}
AND DATE_ID = #{dateId}
</delete>
</mapper>

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

@ -69,4 +69,24 @@
limit 1;
</select>
<!-- 查询网格属于哪个机关 -->
<select id="selectGridBelongAgencyInfo" resultType="com.epmet.dto.stats.result.GridBelongAgencyResultDTO">
SELECT
dg.id AS gridId,
dg.AGENCY_ID AS agencyId,
da.PID AS parentId
FROM
dim_grid dg
LEFT JOIN dim_agency da ON da.id = dg.agency_id
WHERE
dg.DEL_FLAG = '0'
AND da.DEL_FLAG = '0'
AND
(
<foreach collection="gridIds" item="gridId" separator=" OR ">
dg.id = #{gridId}
</foreach>
)
</select>
</mapper>

67
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml

@ -129,4 +129,71 @@
order by TOPIC_ID
</select>
<!-- 查询话题创建者信息 -->
<select id="selectTopicInfo" resultType="com.epmet.dto.extract.result.TopicInfoResultDTO">
SELECT
id AS topicId,
CREATED_BY AS userId
FROM
resi_topic
WHERE
del_flag = '0'
AND
(
<foreach collection="topicIds" item="item" separator=" OR ">
id = #{item}
</foreach>
)
</select>
<!-- 根据日期查询resi_topic_operation,返回当前日期这一天内所有话题相关的操作记录 -->
<select id="selectListTopicOriginInfo" parameterType="map" resultType="com.epmet.dto.topic.TopicOriginInfoDTO">
SELECT
rto.TOPIC_ID,
(case
when rto.OPERATION_TYPE='closed' and rt.CLOSED_STATUS='resolved' then 'closed_resolved'
when rto.OPERATION_TYPE='closed' and rt.CLOSED_STATUS='unresolved' then 'closed_unresolved'
else rto.OPERATION_TYPE
end
)as ACTION_CODE,
rto.CREATED_BY as OPERATE_USER_ID,
DATE_FORMAT(rto.CREATED_TIME,'%Y%m%d') as DATE_ID,
DATE_FORMAT(rto.CREATED_TIME,'%Y%m') as MONTH_ID,
DATE_FORMAT(rto.CREATED_TIME,'%Y') as YEAR_ID,
rto.CREATED_TIME AS ORIGINAL_BUSINESS_TIME,
rt.GROUP_ID,
rt.STATUS as TOPIC_STATUS,
rg.GRID_ID,
RG.CUSTOMER_ID
FROM
resi_topic_operation rto
LEFT JOIN resi_topic rt ON ( rto.TOPIC_ID = rt.id AND rt.DEL_FLAG = '0' )
LEFT JOIN RESI_GROUP RG ON(RT.GROUP_ID=RG.ID AND RG.DEL_FLAG='0')
WHERE
rto.DEL_FLAG = '0'
AND DATE_FORMAT(rto.CREATED_TIME,'%Y%m%d')=#{dateId}
AND RG.CUSTOMER_ID=#{customerId}
union all
SELECT
rtc.TOPIC_ID,
'comment' as ACTION_CODE,
rtc.CREATED_BY as OPERATE_USER_ID,
DATE_FORMAT(rtc.CREATED_TIME,'%Y%m%d') as DATE_ID,
DATE_FORMAT(rtc.CREATED_TIME,'%Y%m') as MONTH_ID,
DATE_FORMAT(rtc.CREATED_TIME,'%Y') as YEAR_ID,
rtc.CREATED_TIME AS ORIGINAL_BUSINESS_TIME,
rt.GROUP_ID ,
rt.STATUS as TOPIC_STATUS,
rg.GRID_ID,
rg.CUSTOMER_ID
FROM
resi_topic_comment rtc
LEFT JOIN resi_topic rt ON ( rtc.TOPIC_ID = rt.id AND rt.DEL_FLAG = '0' )
LEFT JOIN resi_group rg ON ( rt.GROUP_ID = rg.id AND rg.DEL_FLAG = '0' )
WHERE
rtc.DEL_FLAG = '0'
AND DATE_FORMAT( rtc.CREATED_TIME, '%Y%m%d' )=#{dateId}
AND RG.CUSTOMER_ID =#{customerId}
</select>
</mapper>

16
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml

@ -408,4 +408,20 @@
AND urole.CREATED_TIME <![CDATA[>=]]> #{startDate} AND urole.CREATED_TIME <![CDATA[<]]> DATE_SUB( #{endDate}, INTERVAL - 1 DAY)
AND erole.ROLE_NAME = '热心居民'
</select>
<!-- 查询用户是不是党员 -->
<select id="selectUserIsParty" resultType="com.epmet.dto.extract.result.UserPartyResultDTO">
SELECT ur.user_id AS userId,
er.role_name AS roleName
FROM user_role ur
LEFT JOIN epmet_role er ON er.id = ur.role_id
WHERE ur.del_flag = 0
AND er.del_flag = 0
AND
(
<foreach collection="userIds" item="item" separator=" OR ">
ur.user_id = #{item}
</foreach>
)
</select>
</mapper>

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

@ -178,7 +178,7 @@
</activation>-->
<properties>
<server.port>8103</server.port>
<spring.profiles.active>dev</spring.profiles.active>
<spring.profiles.active>test</spring.profiles.active>
<!-- 数据库配置-->
<spring.datasource.druid.url>

13
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/DimPartyMemberService.java

@ -0,0 +1,13 @@
package com.epmet.service;
import com.epmet.commons.tools.utils.Result;
/**
* @Author zxc
* @DateTime 2020/9/17 3:05 下午
*/
public interface DimPartyMemberService {
Result getPartyInfo(String date);
}

27
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/DimPartyMemberServiceImpl.java

@ -0,0 +1,27 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.feign.DataStatisticalOpenFeignClient;
import com.epmet.service.DimPartyMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Author zxc
* @DateTime 2020/9/17 3:06 下午
*/
@Service
public class DimPartyMemberServiceImpl implements DimPartyMemberService {
@Autowired
private DataStatisticalOpenFeignClient statsFeignClient;
@Override
public Result getPartyInfo(String dateId) {
CustomerIdAndDateIdFormDTO c = new CustomerIdAndDateIdFormDTO();
c.setDateId(dateId);
return statsFeignClient.getPartyInfo(c);
}
}

30
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DimPartyMemberTask.java

@ -0,0 +1,30 @@
package com.epmet.task;
import com.epmet.commons.tools.utils.Result;
import com.epmet.service.DimPartyMemberService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @Author zxc
* @DateTime 2020/9/17 3:04 下午
*/
@Slf4j
@Component("dimPartyMemberTask")
public class DimPartyMemberTask implements ITask{
@Autowired
private DimPartyMemberService dimPartyMemberService;
@Override
public void run(String params) {
log.info("dimPartyMemberTask定时任务正在执行,参数为:{}", params);
Result result = dimPartyMemberService.getPartyInfo(params);
if (result.success()){
log.info("dimPartyMemberTask定时任务执行成功");
}else {
log.error("dimPartyMemberTask定时任务执行失败:" + result.getMsg());
}
}
}
Loading…
Cancel
Save