Browse Source

Merge branches 'dev' and 'wxz_dim_sync' of http://git.elinkit.com.cn:7070/r/epmet-cloud into wxz_dim_sync

master
wangxianzhang 4 years ago
parent
commit
05b8d96bec
  1. 7
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java
  2. 15
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/CustomerIdConstant.java
  3. 8
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  4. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java
  5. 6
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml
  6. 13
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java
  7. 3
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenGovernRankDataDao.java
  8. 6
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassRootsGovernService.java
  9. 56
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java
  10. 79
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml
  11. 6
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml
  12. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  13. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java
  14. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java
  15. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java
  16. 35
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java
  17. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java
  18. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java
  19. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java
  20. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java
  21. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml
  22. 8
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
  23. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
  24. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
  25. 14
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java
  26. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java
  27. 7
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java
  28. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java
  29. 21
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
  30. 7
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java
  31. 6
      epmet-module/epmet-job/epmet-job-server/pom.xml
  32. 3
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/GovIssueFeignClient.java
  33. 5
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/impl/GovIssueFeignClientFallBack.java
  34. 3
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/IssueVotingDailyStatisticalTaskService.java
  35. 5
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/IssueVotingDailyStatisticalTaskServiceImpl.java
  36. 9
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DailyStatisticalVoteTask.java
  37. 5
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/PolyLineDTO.java
  38. 26
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/DailyStatisticalVoteJob.java
  39. 5
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ResiBuzzLeftPieChartFormDTO.java
  40. 70
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/DailyStatisticalVoteJobResultDTO.java
  41. 7
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ResiBuzzLeftPieChartResultDTO.java
  42. 2
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java
  43. 9
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueVoteStatisticalController.java
  44. 6
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueVoteStatisticalDailyController.java
  45. 22
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java
  46. 21
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueVoteDetailDao.java
  47. 9
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueVoteStatisticalDailyDao.java
  48. 7
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueVoteDetailRedis.java
  49. 9
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueVoteStatisticalDailyService.java
  50. 51
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java
  51. 3
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteDetailServiceImpl.java
  52. 81
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalDailyServiceImpl.java
  53. 61
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java
  54. 118
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml
  55. 39
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteDetailDao.xml
  56. 9
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteStatisticalDailyDao.xml
  57. 6
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteStatisticalDao.xml
  58. 1
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
  59. 59
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  60. 20
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  61. 34
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  62. 30
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/EventController.java
  63. 2
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java
  64. 6
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventController.java
  65. 24
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventReplyController.java
  66. 2
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridDailyworkController.java
  67. 4
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseGridDailyworkEntity.java
  68. 4
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java
  69. 2
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseGridDailyworkService.java
  70. 14
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridDailyworkServiceImpl.java
  71. 18
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/UserPatrolRecordServiceImpl.java
  72. 4
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseGridDailyworkDao.xml
  73. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerDistributionResultDTO.java
  74. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  75. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  76. 90
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridUserWorkEntity.java
  77. 189
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java
  78. 17
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

7
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java

@ -11,6 +11,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.dao.DuplicateKeyException; import org.springframework.dao.DuplicateKeyException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.time.Duration; import java.time.Duration;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -281,7 +283,10 @@ public abstract class BaseRequestLogAspect {
} else { } else {
StringBuilder builder = new StringBuilder("["); StringBuilder builder = new StringBuilder("[");
for (Object object : args) { for (Object object : args) {
if (object != null) { if (object != null
&& !(object instanceof ServletRequest)
&& !(object instanceof ServletResponse)
) {
try { try {
// 尝试作为json解析 // 尝试作为json解析
String objectString = JSON.toJSONString(object); String objectString = JSON.toJSONString(object);

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

@ -0,0 +1,15 @@
package com.epmet.commons.tools.constant;
/**
* desc:
*
* @author: LiuJanJun
* @date: 2021/12/27 10:22 上午
* @version: 1.0
*/
public interface CustomerIdConstant {
/**
* 市北生产-客户ID
*/
String SHI_BEI_CUSTOMER_ID = "b09527201c4409e19d1dbc5e3c3429a1";
}

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

@ -628,4 +628,12 @@ public class RedisKeys {
return rootPrefix.concat("resi:").concat("export").concat(":template:changed").concat(customerId); return rootPrefix.concat("resi:").concat("export").concat(":template:changed").concat(customerId);
} }
/**
* desc:临时方案
* @param agencyId
* @return
*/
public static String getOrgTreeCacheKey(String agencyId) {
return rootPrefix.concat("org:temp:orgtree").concat(agencyId);
}
} }

4
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java

@ -487,9 +487,9 @@ public class GovProjectServiceImpl implements GovProjectService {
if (!org.springframework.util.CollectionUtils.isEmpty(userList)) { if (!org.springframework.util.CollectionUtils.isEmpty(userList)) {
//2-1.根据身份证号查询负能平台用户信息 //2-1.根据身份证号查询负能平台用户信息
IcResiUserDTO icResiUserDTO = epmetUserService.getIcResiUser(userList.get(0).getIdNum(), formDTO.getCustomerId()); IcResiUserDTO icResiUserDTO = epmetUserService.getIcResiUser(userList.get(0).getIdNum(), formDTO.getCustomerId());
resultDTO.setIcUserId(icResiUserDTO.getId());
resultDTO.setIcUserName(icResiUserDTO.getName());
if (null != icResiUserDTO) { if (null != icResiUserDTO) {
resultDTO.setIcUserId(icResiUserDTO.getId());
resultDTO.setIcUserName(icResiUserDTO.getName());
//2-2.查询人员的家庭成员数据 //2-2.查询人员的家庭成员数据
List<ProjectAnalysisResultDTO.Home> homeList = epmetUserService.getHomeUserList(icResiUserDTO.getHomeId(), icResiUserDTO.getId()); List<ProjectAnalysisResultDTO.Home> homeList = epmetUserService.getHomeUserList(icResiUserDTO.getHomeId(), icResiUserDTO.getId());
resultDTO.setHomeUserList(homeList); resultDTO.setHomeUserList(homeList);

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

@ -4,7 +4,7 @@
<mapper namespace="com.epmet.dataaggre.dao.govproject.ProjectDao"> <mapper namespace="com.epmet.dataaggre.dao.govproject.ProjectDao">
<select id="getAllProject" resultType="com.epmet.dataaggre.dto.govproject.result.ProjectInfoDTO"> <select id="getAllProject" resultType="com.epmet.dataaggre.dto.govproject.result.ProjectInfoDTO">
SELECT SELECT DISTINCT
p.ID AS projectId, p.ID AS projectId,
p.TITLE AS projectTitle, p.TITLE AS projectTitle,
p.`STATUS` AS projectStatus, p.`STATUS` AS projectStatus,
@ -19,12 +19,12 @@
IFNULL( pp.PUBLIC_REPLY, '' ) AS publicReply IFNULL( pp.PUBLIC_REPLY, '' ) AS publicReply
FROM FROM
project p project p
INNER JOIN ( SELECT PROJECT_ID, GRID_ID FROM project_related_personnel WHERE DEL_FLAG = '0' AND SOURCE_TYPE = 'issue' ) prp ON p.ID = prp.PROJECT_ID LEFT JOIN ( SELECT PROJECT_ID, GRID_ID FROM project_related_personnel WHERE DEL_FLAG = '0' AND SOURCE_TYPE = 'issue' ) prp ON p.ID = prp.PROJECT_ID
INNER JOIN ( SELECT PROJECT_ID, MAX( CREATED_TIME ) AS updateTime FROM project_process ppro GROUP BY PROJECT_ID ) ppro ON p.ID = ppro.PROJECT_ID INNER JOIN ( SELECT PROJECT_ID, MAX( CREATED_TIME ) AS updateTime FROM project_process ppro GROUP BY PROJECT_ID ) ppro ON p.ID = ppro.PROJECT_ID
INNER JOIN ( SELECT PROJECT_ID, COUNT( DISTINCT DEPARTMENT_NAME ) AS departmentCount FROM project_staff GROUP BY PROJECT_ID ) ps ON ps.PROJECT_ID = p.ID INNER JOIN ( SELECT PROJECT_ID, COUNT( DISTINCT DEPARTMENT_NAME ) AS departmentCount FROM project_staff GROUP BY PROJECT_ID ) ps ON ps.PROJECT_ID = p.ID
LEFT JOIN ( SELECT PROJECT_ID, COUNT( ID ) AS processCount FROM project_process WHERE DEL_FLAG = '0' AND OPERATION != 'created' GROUP BY PROJECT_ID ) ppc ON ppc.PROJECT_ID = p.ID LEFT JOIN ( SELECT PROJECT_ID, COUNT( ID ) AS processCount FROM project_process WHERE DEL_FLAG = '0' AND OPERATION != 'created' GROUP BY PROJECT_ID ) ppc ON ppc.PROJECT_ID = p.ID
LEFT JOIN project_process pp ON p.ID = pp.PROJECT_ID LEFT JOIN project_process pp ON p.ID = pp.PROJECT_ID
AND pp.OPERATION = 'close' AND pp.OPERATION = 'close' AND pp.DEL_FLAG = '0'
WHERE WHERE
p.DEL_FLAG = '0' p.DEL_FLAG = '0'
AND p.ORG_ID_PATH LIKE concat('%', #{agencyId}, '%') AND p.ORG_ID_PATH LIKE concat('%', #{agencyId}, '%')

13
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java

@ -97,4 +97,17 @@ public class GrassRootsGovernController {
return new Result<List<GovernCapacityRankResultDTO>>().ok(grassRootsGovernService.governCapacityRank(param)); return new Result<List<GovernCapacityRankResultDTO>>().ok(grassRootsGovernService.governCapacityRank(param));
} }
/**
* @Description 治理能力榜单查询 screen_govern_rank_data
* @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321627
* @param param
* @return
* @author wangc
* @date 2020.08.20 17:46
**/
@PostMapping("governcapacityrank-origin")
public Result<List<GovernCapacityRankResultDTO>> governCapacityRankOrigin(@RequestBody AgencyAndNumFormDTO param){
ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class);
return new Result<List<GovernCapacityRankResultDTO>>().ok(grassRootsGovernService.governCapacityRankOrigin(param));
}
} }

3
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenGovernRankDataDao.java

@ -50,4 +50,7 @@ public interface ScreenGovernRankDataDao{
* @date 2021/2/26 上午9:22 * @date 2021/2/26 上午9:22
*/ */
List<GovernCapacityResultDTO> selectGovernCapacityRatioNew(@Param("monthId") String monthId,@Param("orgIds") List<String> orgIds); List<GovernCapacityResultDTO> selectGovernCapacityRatioNew(@Param("monthId") String monthId,@Param("orgIds") List<String> orgIds);
List<GovernCapacityResultDTO> selectGovernCapacityRatioBak(@Param("monthId") String monthId,@Param("agencyId") String agencyId);
List<GovernCapacityResultDTO> selectGovernCapacityRatioNewBak(@Param("monthId") String monthId,@Param("orgIds") List<String> orgIds);
} }

6
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassRootsGovernService.java

@ -65,6 +65,12 @@ public interface GrassRootsGovernService {
**/ **/
List<GovernCapacityRankResultDTO> governCapacityRank(AgencyAndNumFormDTO param); List<GovernCapacityRankResultDTO> governCapacityRank(AgencyAndNumFormDTO param);
/**
* 治理能力榜单查询 screen_govern_rank_data
* @param param
* @return
*/
List<GovernCapacityRankResultDTO> governCapacityRankOrigin(AgencyAndNumFormDTO param);
/** /**
* @Description 6公众参与-柱状折线图 * @Description 6公众参与-柱状折线图
* @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=322434 * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=322434

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

@ -293,6 +293,62 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
return result; return result;
} }
/**
* 治理能力榜单查询 screen_govern_rank_data
* @param param
* @return
*/
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public List<GovernCapacityRankResultDTO> governCapacityRankOrigin(AgencyAndNumFormDTO param) {
List<GovernCapacityResultDTO> orderList = new ArrayList<>();
if (null == param.getTopNum() || NumConstant.ZERO == param.getTopNum()) {
param.setTopNum(NumConstant.TEN);
}
String monthId = dateUtils.getCurrentMonthId();
if (StringUtils.isNotEmpty(param.getAreaCode())){
List<String> nextAgencyIds = screenCustomerAgencyService.getNextAgencyIds(param.getAreaCode(), param.getAgencyId());
if (CollectionUtils.isEmpty(nextAgencyIds)){
return new ArrayList<>();
}
PageHelper.startPage(NumConstant.ONE,param.getTopNum());
orderList = screenGovernRankDataDao.selectGovernCapacityRatioNewBak(monthId,nextAgencyIds);
int time = NumConstant.TWELVE;
while(CollectionUtils.isEmpty(orderList) && time > NumConstant.ONE){
time--;
monthId = dateUtils.getPreviousMonthIdByDest(null, monthId);
PageHelper.startPage(NumConstant.ONE,param.getTopNum());
orderList = screenGovernRankDataDao.selectGovernCapacityRatioNewBak(monthId,nextAgencyIds);
}
}else {
PageHelper.startPage(NumConstant.ONE,param.getTopNum());
orderList = screenGovernRankDataDao.selectGovernCapacityRatioBak(monthId, param.getAgencyId());
int time = NumConstant.TWELVE;
while (CollectionUtils.isEmpty(orderList) && time > NumConstant.ONE) {
time++;
monthId = dateUtils.getPreviousMonthIdByDest(null, monthId);
PageHelper.startPage(NumConstant.ONE, param.getTopNum());
orderList = screenGovernRankDataDao.selectGovernCapacityRatioBak(monthId, param.getAgencyId());
}
}
if(null == orderList || orderList.isEmpty()) {
return new ArrayList<>();
}
List<GovernCapacityRankResultDTO> result = new LinkedList<>();
orderList.forEach(o -> {
GovernCapacityRankResultDTO rank = new GovernCapacityRankResultDTO();
rank.setAgencyName(o.getAgencyName());
rank.setGovernRatio(convertPercentStr(o.getGovernRatio(),NumConstant.ONE));
rank.setResolvedRatio(convertPercentStr(o.getResolvedRatio(),NumConstant.ONE));
rank.setResponseRatio(convertPercentStr(o.getResponseRatio(),NumConstant.ONE));
rank.setSatisfactionRatio(convertPercentStr(o.getSatisfactionRatio(),NumConstant.ONE));
rank.setParentAgencyName(o.getParentAgencyName());
rank.setMonthId(o.getMonthId());
result.add(rank);
});
return result;
}
/** /**
* @Description 6公众参与-柱状折线图 * @Description 6公众参与-柱状折线图
* @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=322434 * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=322434

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

@ -82,4 +82,83 @@
RESPONSE_RATIO DESC RESPONSE_RATIO DESC
</select> </select>
<!-- 查询政府治理能力各项指标 -->
<select id="selectGovernCapacityRatioBak" resultType="com.epmet.evaluationindex.screen.dto.result.GovernCapacityResultDTO">
SELECT
rankData.org_id as orgId,
rankData.ORG_NAME AS agencyName,
rankData.RESPONSE_RATIO,
rankData.RESOLVED_RATIO,
rankData.GOVERN_RATIO,
rankData.SATISFACTION_RATIO,
agency.AGENCY_NAME AS parentAgencyName,
rankData.MONTH_ID as monthId
FROM
screen_govern_rank_data rankData
LEFT JOIN
screen_customer_agency agency
ON rankData.PARENT_ID = agency.AGENCY_ID AND agency.DEL_FLAG = '0' AND agency.AGENCY_ID = #{agencyId}
WHERE
rankData.DEL_FLAG = '0'
AND rankData.PARENT_ID = #{agencyId}
AND rankData.MONTH_ID = #{monthId}
ORDER BY
rankData.RESPONSE_RATIO DESC
</select>
<!-- 基层治理-治理能力榜单 多客户版,调用此sql -->
<select id="selectGovernCapacityRatioNewBak" resultType="com.epmet.evaluationindex.screen.dto.result.GovernCapacityResultDTO">
(SELECT
agency.agency_id as orgId,
agency.AGENCY_NAME AS agencyName,
IFNULL(rankData.RESPONSE_RATIO,0) AS RESPONSE_RATIO,
IFNULL(rankData.RESOLVED_RATIO,0) AS RESOLVED_RATIO,
IFNULL(rankData.GOVERN_RATIO,0) AS GOVERN_RATIO,
IFNULL(rankData.SATISFACTION_RATIO,0) AS SATISFACTION_RATIO,
pa.AGENCY_NAME AS parentAgencyName,
rankData.MONTH_ID as monthId
FROM screen_customer_agency agency
left join screen_customer_agency pa
on(agency.PARENT_AREA_CODE=pa.AREA_CODE
and pa.DEL_FLAG='0')
left join screen_govern_rank_data rankData
ON (agency.AGENCY_ID =rankData.org_id
AND rankData.DEL_FLAG = '0'
and rankData.org_type='agency')
WHERE
agency.DEL_FLAG = '0'
AND agency.agency_id in
<foreach collection="orgIds" item="orgId" open="(" close=")" separator=",">
#{orgId}
</foreach>
AND rankData.MONTH_ID =#{monthId}
)
union
(
SELECT
grid.grid_id as orgId,
grid.GRID_NAME AS agencyName,
IFNULL(rankData.RESPONSE_RATIO,0) AS RESPONSE_RATIO,
IFNULL(rankData.RESOLVED_RATIO,0) AS RESOLVED_RATIO,
IFNULL(rankData.GOVERN_RATIO,0) AS GOVERN_RATIO,
IFNULL(rankData.SATISFACTION_RATIO,0) AS SATISFACTION_RATIO,
ca.agency_name AS parentAgencyName,
rankData.MONTH_ID as monthId
FROM screen_customer_grid grid
left join screen_customer_agency ca
on (ca.agency_id = grid.parent_agency_id)
left join screen_govern_rank_data_daily rankData
ON (grid.grid_id=rankData.org_id
AND grid.DEL_FLAG = 0
and rankData.org_type='grid')
WHERE grid.DEL_FLAG = '0'
AND grid.GRID_ID in
<foreach collection="orgIds" item="orgId" open="(" close=")" separator=",">
#{orgId}
</foreach>
AND rankData.MONTH_ID =#{monthId}
)
ORDER BY
RESPONSE_RATIO DESC
</select>
</mapper> </mapper>

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

@ -260,10 +260,10 @@
WHERE WHERE
dm.del_flag = '0' dm.del_flag = '0'
AND rd.del_flag = '0' AND rd.del_flag = '0'
<if test="customerId != null and customerId != ''">
AND org.CUSTOMER_ID = #{customerId}
</if>
<choose> <choose>
<when test="customerId != null and customerId != ''">
AND org.CUSTOMER_ID = #{customerId}
</when>
<when test="areaCode != null and areaCode != ''"> <when test="areaCode != null and areaCode != ''">
AND org.AREA_CODE LIKE concat(#{areaCode}, '%') AND org.AREA_CODE LIKE concat(#{areaCode}, '%')
</when> </when>

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

@ -903,6 +903,7 @@ public class DemoController {
ScreenCentralZoneDataFormDTO formDTO = new ScreenCentralZoneDataFormDTO(); ScreenCentralZoneDataFormDTO formDTO = new ScreenCentralZoneDataFormDTO();
formDTO.setCustomerId(customerId); formDTO.setCustomerId(customerId);
formDTO.setDateId(dateId); formDTO.setDateId(dateId);
formDTO.setProjectId(param.getProjectId());
screenProjectSettleService.extractScreenData(formDTO); screenProjectSettleService.extractScreenData(formDTO);
}); });
} }
@ -1111,6 +1112,7 @@ public class DemoController {
}else { }else {
screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectGridData(customerId,dateId); screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectGridData(customerId,dateId);
screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectOrgData(customerId,dateId); screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectOrgData(customerId,dateId);
result.add(dateId);
redisUtils.hSet(RedisKeys.getBackDoorbizExcuteResult("gridandorgdailynew"),customerId,result,3*24*60*60L); redisUtils.hSet(RedisKeys.getBackDoorbizExcuteResult("gridandorgdailynew"),customerId,result,3*24*60*60L);
} }
long end = System.currentTimeMillis(); long end = System.currentTimeMillis();

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

@ -7,6 +7,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.service.evaluationindex.extract.todata.*; import com.epmet.service.evaluationindex.extract.todata.*;
import com.epmet.service.stats.DimCustomerService; import com.epmet.service.stats.DimCustomerService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -23,6 +24,7 @@ import java.util.List;
* @author yinzuomei@elink-cn.com * @author yinzuomei@elink-cn.com
* @date 2020/9/15 11:06 * @date 2020/9/15 11:06
*/ */
@Slf4j
@RestController @RestController
@RequestMapping("factorigin") @RequestMapping("factorigin")
public class FactOriginExtractController { public class FactOriginExtractController {
@ -95,6 +97,7 @@ public class FactOriginExtractController {
@PostMapping("project") @PostMapping("project")
public Result projectData(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) { public Result projectData(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) {
long start = System.currentTimeMillis();
if (StringUtils.isNotBlank(extractOriginFormDTO.getCustomerId())) { if (StringUtils.isNotBlank(extractOriginFormDTO.getCustomerId())) {
List<String> daysBetween; List<String> daysBetween;
if (StringUtils.isBlank(extractOriginFormDTO.getDateId())) { if (StringUtils.isBlank(extractOriginFormDTO.getDateId())) {
@ -115,6 +118,7 @@ public class FactOriginExtractController {
projectExtractService.saveOriginProjectDaily(dto); projectExtractService.saveOriginProjectDaily(dto);
}); });
} }
log.info("projectData end,cost:{}",System.currentTimeMillis() - start);
return new Result(); return new Result();
} }

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java

@ -200,7 +200,8 @@ public interface ProjectDao extends BaseDao<ProjectEntity> {
* 获取已转项目事件事件 * 获取已转项目事件事件
* *
* @param customerId * @param customerId
* @param projectId
* @return * @return
*/ */
List<ResiEventDTO> getEventList(@Param("customerId") String customerId); List<ResiEventDTO> getEventList(@Param("customerId") String customerId, @Param("projectId") String projectId);
} }

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

@ -1,6 +1,7 @@
package com.epmet.service.evaluationindex.extract.dataToIndex.impl; package com.epmet.service.evaluationindex.extract.dataToIndex.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.CustomerIdConstant;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.extract.form.ExtractIndexFormDTO; import com.epmet.dto.extract.form.ExtractIndexFormDTO;
@ -67,6 +68,8 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService
log.error("indexOriginExtractAll 获取客户Id为空"); log.error("indexOriginExtractAll 获取客户Id为空");
return; return;
} }
//去除 市北客户id的抽取
customerIds.remove(CustomerIdConstant.SHI_BEI_CUSTOMER_ID);
} }
String finalMonthId = monthId; String finalMonthId = monthId;

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

@ -38,6 +38,7 @@ import com.epmet.util.DimIdGenerator;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -127,17 +128,26 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
//获取项目信息 //获取项目信息
List<ProjectDTO> projectList = projectService.getProjectInfo(customerId, dateString, projectId); List<ProjectDTO> projectList = projectService.getProjectInfo(customerId, dateString, projectId);
factOriginProjectMainDailyService.deleteByDate(customerId, dateString,projectId); factOriginProjectMainDailyService.deleteByDate(customerId, dateString,projectId);
List<IssueDTO> issueList = new ArrayList<>();
List<ResiTopicDTO> topicList = new ArrayList<>();
if (!CollectionUtils.isEmpty(projectList)) { if (!CollectionUtils.isEmpty(projectList)) {
Map<String, ResiEventDTO> projectEventMap = projectService.getEventList(customerId); Map<String, ResiEventDTO> projectEventMap = projectService.getEventList(customerId, projectId);
//提取议题ID //提取议题ID
List<String> issueIds = List<String> issueIds =
projectList.stream().filter(item -> ProjectConstant.ISSUE.equals(item.getOrigin())).map(ProjectDTO::getOriginId).collect(Collectors.toList()); projectList.stream().filter(item -> ProjectConstant.ISSUE.equals(item.getOrigin())).map(ProjectDTO::getOriginId).collect(Collectors.toList());
//获取议题信息 if (CollectionUtils.isNotEmpty(issueIds)) {
List<IssueDTO> issueList = issueService.getIssueInfoByIds(issueIds); //分批次获取
//提取话题ID //获取议题信息
List<String> topicIds = issueList.stream().map(IssueDTO::getSourceId).collect(Collectors.toList()); List<List<String>> partition = ListUtils.partition(issueIds, NumConstant.FIFTY);
//获取话题信息 partition.forEach(part -> issueList.addAll(issueService.getIssueInfoByIds(part)));
List<ResiTopicDTO> topicList = topicService.getTopicByIds(topicIds); //提取话题ID
List<String> topicIds = issueList.stream().map(IssueDTO::getSourceId).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(topicIds)) {
//获取话题信息
List<List<String>> topicPart = ListUtils.partition(topicIds, NumConstant.FIFTY);
topicPart.forEach(part -> topicList.addAll(topicService.getTopicByIds(part)));
}
}
//获取网格认证党员 //获取网格认证党员
List<PartyMemberDTO> partyMemberList = partyMemberService.getPartyMemberByCustomer(customerId); List<PartyMemberDTO> partyMemberList = partyMemberService.getPartyMemberByCustomer(customerId);
//生成DTO //生成DTO
@ -231,7 +241,9 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
} }
//满意度 //满意度
long start = System.currentTimeMillis();
List<FactOriginProjectMainDailyEntity> satisfaction = projectService.getProjectSatisfaction(customerId, projectId); List<FactOriginProjectMainDailyEntity> satisfaction = projectService.getProjectSatisfaction(customerId, projectId);
log.info("saveOriginProjectDaily 满意度 cost:{}",System.currentTimeMillis()-start);
if (CollectionUtils.isNotEmpty(satisfaction)) { if (CollectionUtils.isNotEmpty(satisfaction)) {
factOriginProjectMainDailyService.updateBatchById(satisfaction); factOriginProjectMainDailyService.updateBatchById(satisfaction);
} }
@ -239,7 +251,9 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
final List<FactOriginProjectMainDailyEntity> mainList = list; final List<FactOriginProjectMainDailyEntity> mainList = list;
List<FactOriginProjectLogDailyEntity> logList = new ArrayList<>(); List<FactOriginProjectLogDailyEntity> logList = new ArrayList<>();
//节点发起人 部门流转退回结案 //节点发起人 部门流转退回结案
start = System.currentTimeMillis();
List<ProcessInfoDTO> processList = projectProcessService.getProcessListByCustomer(customerId, dateString, projectId); List<ProcessInfoDTO> processList = projectProcessService.getProcessListByCustomer(customerId, dateString, projectId);
log.info("saveOriginProjectDaily 节点发起人 部门流转退回结案 cost:{}",System.currentTimeMillis()-start);
if (!CollectionUtils.isEmpty(processList)) { if (!CollectionUtils.isEmpty(processList)) {
logList = processList.stream().map(process -> { logList = processList.stream().map(process -> {
//获取日期相关维度 //获取日期相关维度
@ -291,7 +305,9 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
//节点发起人 响应 //节点发起人 响应
start = System.currentTimeMillis();
List<ProcessInfoDTO> responseList = projectProcessService.getResponseProcessList(customerId, dateString, projectId); List<ProcessInfoDTO> responseList = projectProcessService.getResponseProcessList(customerId, dateString, projectId);
log.info("saveOriginProjectDaily 节点发起人 响应 cost:{}",System.currentTimeMillis()-start);
if (!CollectionUtils.isEmpty(responseList)) { if (!CollectionUtils.isEmpty(responseList)) {
logList.addAll(responseList.stream().map(process -> { logList.addAll(responseList.stream().map(process -> {
//获取日期相关维度 //获取日期相关维度
@ -337,8 +353,9 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
} }
//项目评论人 //项目评论人
start = System.currentTimeMillis();
List<ProcessInfoDTO> satisfactionRecordList = projectProcessService.getSatisfactionRecord(customerId, dateString, projectId); List<ProcessInfoDTO> satisfactionRecordList = projectProcessService.getSatisfactionRecord(customerId, dateString, projectId);
log.info("saveOriginProjectDaily 项目评论人 cost:{}",System.currentTimeMillis()-start);
satisfactionRecordList.forEach(log -> mainList.stream().filter(project -> log.getProjectId().equals(project.getId())).forEach(main -> { satisfactionRecordList.forEach(log -> mainList.stream().filter(project -> log.getProjectId().equals(project.getId())).forEach(main -> {
//进行满意度评价的居民的所属机关的父机机关信息 //进行满意度评价的居民的所属机关的父机机关信息
log.setPid(main.getPid()); log.setPid(main.getPid());
@ -367,7 +384,9 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
//节点接收人 //节点接收人
start = System.currentTimeMillis();
List<ProcessInfoDTO> processStaffList = projectProcessService.getProcessStaffByCustomer(customerId, dateString, projectId); List<ProcessInfoDTO> processStaffList = projectProcessService.getProcessStaffByCustomer(customerId, dateString, projectId);
log.info("saveOriginProjectDaily 节点接收人 cost:{}",System.currentTimeMillis()-start);
logList.addAll(processStaffList.stream().map(process -> { logList.addAll(processStaffList.stream().map(process -> {
//获取日期相关维度 //获取日期相关维度
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(process.getCreatedTime()); DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(process.getCreatedTime());

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

@ -1,6 +1,7 @@
package com.epmet.service.evaluationindex.extract.toscreen.impl; package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.CustomerIdConstant;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.distributedlock.DistributedLock; import com.epmet.commons.tools.distributedlock.DistributedLock;
@ -461,6 +462,11 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
} catch (Exception e) { } catch (Exception e) {
log.error("项目(事件)数量分析按组织_按月统计失败,参数为{}" + JSON.toJSONString(formDTO), e); log.error("项目(事件)数量分析按组织_按月统计失败,参数为{}" + JSON.toJSONString(formDTO), e);
} }
//去除 市北客户id的抽取
if (CustomerIdConstant.SHI_BEI_CUSTOMER_ID.equals(customerId)){
log.info("===== extractMonthly method end not contains shi bei:{}======", customerId);
return;
}
//此方法保持在最后即可 计算指标分数 todo 优化 手动创建线程池 控制任务数量 //此方法保持在最后即可 计算指标分数 todo 优化 手动创建线程池 控制任务数量
ExecutorService pool = Executors.newSingleThreadExecutor(); ExecutorService pool = Executors.newSingleThreadExecutor();
pool.submit(() -> { pool.submit(() -> {

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

@ -15,7 +15,6 @@ import com.epmet.dto.indexcal.IndexStatisticsFormDTO;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.redis.IndexCalRedis; import com.epmet.redis.IndexCalRedis;
import com.epmet.service.crm.CustomerRelationService; import com.epmet.service.crm.CustomerRelationService;
import com.epmet.service.evaluationindex.extract.dataToIndex.IndexOriginExtractService;
import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.evaluationindex.indexcal.*;
import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService;
import com.epmet.util.DimIdGenerator; import com.epmet.util.DimIdGenerator;
@ -59,8 +58,6 @@ public class IndexCalculateServiceImpl implements IndexCalculateService {
private ScreenCustomerAgencyDao screenCustomerAgencyDao; private ScreenCustomerAgencyDao screenCustomerAgencyDao;
@Autowired @Autowired
private CustomerRelationService customerRelationService; private CustomerRelationService customerRelationService;
@Autowired
private IndexOriginExtractService indexOriginExtractService;
@Override @Override
public Boolean indexCalculate(CalculateCommonFormDTO formDTO) { public Boolean indexCalculate(CalculateCommonFormDTO formDTO) {

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java

@ -202,5 +202,5 @@ public interface ProjectService extends BaseService<ProjectEntity> {
* @param projectId * @param projectId
* @return * @return
*/ */
Map<String, ResiEventDTO> getEventList(String customerId); Map<String, ResiEventDTO> getEventList(String customerId, String projectId);
} }

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java

@ -243,8 +243,8 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
} }
@Override @Override
public Map<String, ResiEventDTO> getEventList(String customerId) { public Map<String, ResiEventDTO> getEventList(String customerId, String projectId) {
List<ResiEventDTO> list = baseDao.getEventList(customerId); List<ResiEventDTO> list = baseDao.getEventList(customerId, projectId);
if (org.apache.commons.collections4.CollectionUtils.isEmpty(list)) { if (org.apache.commons.collections4.CollectionUtils.isEmpty(list)) {
return Collections.emptyMap(); return Collections.emptyMap();
} }

3
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml

@ -259,6 +259,9 @@
from resi_event_report_org rero from resi_event_report_org rero
inner join resi_event re on rero.RESI_EVENT_ID = re.id and re.SHIFT_PROJECT = 1 and re.DEL_FLAG = '0' inner join resi_event re on rero.RESI_EVENT_ID = re.id and re.SHIFT_PROJECT = 1 and re.DEL_FLAG = '0'
where rero.del_flag = '0' where rero.del_flag = '0'
<if test="projectId != null and projectId != ''">
AND re.PROJECT_ID = #{projectId}
</if>
and rero.CUSTOMER_ID = #{customerId} and rero.CUSTOMER_ID = #{customerId}
</select> </select>

8
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java

@ -66,4 +66,12 @@ public interface EpmetHeartOpenFeignClient {
*/ */
@PostMapping("/heart/resi/volunteer/page") @PostMapping("/heart/resi/volunteer/page")
Result<List<PageVolunteerInfoResultDTO>> queryVolunteerPage(@RequestBody VolunteerCommonFormDTO input); Result<List<PageVolunteerInfoResultDTO>> queryVolunteerPage(@RequestBody VolunteerCommonFormDTO input);
/**
* 查询志愿者数量
* @param input
* @return
*/
@PostMapping("/heart/resi/volunteer/count")
Result<Integer> getVolunteerCount(@RequestBody VolunteerCommonFormDTO input);
} }

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java

@ -60,4 +60,9 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli
public Result<List<PageVolunteerInfoResultDTO>> queryVolunteerPage(VolunteerCommonFormDTO input) { public Result<List<PageVolunteerInfoResultDTO>> queryVolunteerPage(VolunteerCommonFormDTO input) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "queryVolunteerPage", input); return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "queryVolunteerPage", input);
} }
@Override
public Result<Integer> getVolunteerCount(VolunteerCommonFormDTO input) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "getVolunteerCount", input);
}
} }

4
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java

@ -265,15 +265,13 @@ public class IcUserDemandRecController {
* @throws Exception * @throws Exception
*/ */
@PostMapping("analysis-export") @PostMapping("analysis-export")
public Result analysisExport(HttpServletResponse response,@LoginUser TokenDto tokenDto, @RequestBody PageListAnalysisFormDTO formDTO)throws Exception { public void analysisExport(HttpServletResponse response,@LoginUser TokenDto tokenDto, @RequestBody PageListAnalysisFormDTO formDTO)throws Exception {
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setPageFlag(false); formDTO.setPageFlag(false);
PageData<DemandRecResultDTO> res=icUserDemandRecService.pageListAnalysis(formDTO); PageData<DemandRecResultDTO> res=icUserDemandRecService.pageListAnalysis(formDTO);
if (!CollectionUtils.isEmpty(res.getList())) { if (!CollectionUtils.isEmpty(res.getList())) {
ExcelUtils.exportExcelToTarget(response, null, res.getList(), DemandRecExcelResultDTO.class); ExcelUtils.exportExcelToTarget(response, null, res.getList(), DemandRecExcelResultDTO.class);
return new Result();
} }
return new Result();
} }
/** /**

14
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java

@ -144,4 +144,18 @@ public class ResiVolunteerController {
List<PageVolunteerInfoResultDTO> l = volunteerInfoService.queryVolunteerPage(customerId, pageNo, pageSize); List<PageVolunteerInfoResultDTO> l = volunteerInfoService.queryVolunteerPage(customerId, pageNo, pageSize);
return new Result<List<PageVolunteerInfoResultDTO>>().ok(l); return new Result<List<PageVolunteerInfoResultDTO>>().ok(l);
} }
/**
* 查询志愿者数量
* @param input
* @return
*/
@PostMapping("count")
public Result<Integer> getVolunteerCount(@RequestBody VolunteerCommonFormDTO input) {
ValidatorUtils.validateEntity(input, VolunteerCommonFormDTO.VolunteerPage.class);
String customerId = input.getCustomerId();
Integer volunteerCount = volunteerInfoService.getVolunteerCount(customerId);
return new Result<Integer>().ok(volunteerCount);
}
} }

9
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java

@ -114,6 +114,15 @@ public interface IcPartyUnitService extends BaseService<IcPartyUnitEntity> {
*/ */
List<OptionDTO> option(IcPartyUnitDTO dto); List<OptionDTO> option(IcPartyUnitDTO dto);
/**
* @Description 获取组织以及下级单位列表
* @Param dto
* @Return {@link List< OptionDTO>}
* @Author zhaoqifeng
* @Date 2021/11/22 14:35
*/
List<OptionDTO> options(IcPartyUnitDTO dto);
/** /**
* 导入数据 * 导入数据
* @Param tokenDto * @Param tokenDto

7
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java

@ -97,4 +97,11 @@ public interface VolunteerInfoService extends BaseService<VolunteerInfoEntity> {
List<OptionDTO> queryListVolunteer(String customerId,String userRealName); List<OptionDTO> queryListVolunteer(String customerId,String userRealName);
List<PageVolunteerInfoResultDTO> queryVolunteerPage(String customerId, Integer pageNo, Integer pageSize); List<PageVolunteerInfoResultDTO> queryVolunteerPage(String customerId, Integer pageNo, Integer pageSize);
/**
* 查询志愿者数量
* @param customerId
* @return
*/
Integer getVolunteerCount(String customerId);
} }

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java

@ -366,7 +366,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
unitDTO.setAgencyId(formDTO.getAgencyId()); unitDTO.setAgencyId(formDTO.getAgencyId());
if (CollectionUtils.isNotEmpty(dtoList)) { if (CollectionUtils.isNotEmpty(dtoList)) {
//获取联建单位 //获取联建单位
Map<String, String> option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); Map<String, String> option = icPartyUnitService.options(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
//获取服务事项字典 //获取服务事项字典
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(tokenDto.getCustomerId()); codeFormDTO.setCustomerId(tokenDto.getCustomerId());

21
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java

@ -193,7 +193,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
} }
insert(entity); insert(entity);
} else { } else {
if (CollectionUtils.isNotEmpty(list) && list.get(0).getId().equals(entity.getId())) { if (CollectionUtils.isNotEmpty(list) && !list.get(0).getId().equals(entity.getId())) {
throw new EpmetException(EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getCode(), EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getMsg(), EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getMsg()); throw new EpmetException(EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getCode(), EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getMsg(), EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getMsg());
} }
updateById(entity); updateById(entity);
@ -261,6 +261,25 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
@Override
public List<OptionDTO> options(IcPartyUnitDTO dto) {
LambdaQueryWrapper<IcPartyUnitEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.and(wp -> wp.eq(IcPartyUnitEntity::getAgencyId, dto.getAgencyId()).or().
like(IcPartyUnitEntity::getPids, dto.getAgencyId()));
wrapper.orderByDesc(IcPartyUnitEntity::getUpdatedTime);
wrapper.eq(StringUtils.isNotBlank(dto.getServiceMatter()), IcPartyUnitEntity::getServiceMatter, dto.getServiceMatter());
List<IcPartyUnitEntity> list = baseDao.selectList(wrapper);
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList();
}
return list.stream().map(item -> {
OptionDTO option = new OptionDTO();
option.setValue(item.getId());
option.setLabel(item.getUnitName());
return option;
}).collect(Collectors.toList());
}
/** /**
* 导入数据 * 导入数据
* *

7
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java

@ -278,4 +278,11 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
return list; return list;
} }
@Override
public Integer getVolunteerCount(String customerId) {
LambdaQueryWrapper<VolunteerInfoEntity> query = new LambdaQueryWrapper<>();
query.eq(VolunteerInfoEntity::getCustomerId, customerId);
return baseDao.selectCount(query);
}
} }

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

@ -90,6 +90,12 @@
<version>2.0.0</version> <version>2.0.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>gov-issue-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>

3
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/GovIssueFeignClient.java

@ -2,6 +2,7 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.DailyStatisticalVoteJob;
import com.epmet.feign.impl.GovIssueFeignClientFallBack; import com.epmet.feign.impl.GovIssueFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -22,7 +23,7 @@ public interface GovIssueFeignClient {
* @date 2020.05.20 15:39 * @date 2020.05.20 15:39
**/ **/
@PostMapping(value = "gov/issue/issuevotestatisticaldaily/dailystatisticalvotejob") @PostMapping(value = "gov/issue/issuevotestatisticaldaily/dailystatisticalvotejob")
Result dailyStatisticalVoteJob(); Result dailyStatisticalVoteJob(DailyStatisticalVoteJob form);
/** /**
* @Description 将所有表决中的投票数从缓存同步到数据库要进行数据对比若数据一致无需更新 * @Description 将所有表决中的投票数从缓存同步到数据库要进行数据对比若数据一致无需更新

5
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/impl/GovIssueFeignClientFallBack.java

@ -3,6 +3,7 @@ package com.epmet.feign.impl;
import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.DailyStatisticalVoteJob;
import com.epmet.feign.GovIssueFeignClient; import com.epmet.feign.GovIssueFeignClient;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -15,8 +16,8 @@ import org.springframework.stereotype.Component;
@Component @Component
public class GovIssueFeignClientFallBack implements GovIssueFeignClient { public class GovIssueFeignClientFallBack implements GovIssueFeignClient {
@Override @Override
public Result dailyStatisticalVoteJob() { public Result dailyStatisticalVoteJob(DailyStatisticalVoteJob form) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "dailyStatisticalVoteJob"); return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "dailyStatisticalVoteJob",form);
} }
@Override @Override

3
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/IssueVotingDailyStatisticalTaskService.java

@ -2,6 +2,7 @@ package com.epmet.service;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.DailyStatisticalVoteJob;
/** /**
* @Description 生成议题表决日统计数定时任务 * @Description 生成议题表决日统计数定时任务
@ -10,6 +11,6 @@ import com.epmet.commons.tools.utils.Result;
*/ */
public interface IssueVotingDailyStatisticalTaskService { public interface IssueVotingDailyStatisticalTaskService {
Result issueVotingDailyStatistical(); Result issueVotingDailyStatistical(DailyStatisticalVoteJob form);
} }

5
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/IssueVotingDailyStatisticalTaskServiceImpl.java

@ -1,6 +1,7 @@
package com.epmet.service.impl; package com.epmet.service.impl;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.DailyStatisticalVoteJob;
import com.epmet.feign.GovIssueFeignClient; import com.epmet.feign.GovIssueFeignClient;
import com.epmet.service.IssueVotingDailyStatisticalTaskService; import com.epmet.service.IssueVotingDailyStatisticalTaskService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -18,7 +19,7 @@ public class IssueVotingDailyStatisticalTaskServiceImpl implements IssueVotingDa
private GovIssueFeignClient govIssueFeignClient; private GovIssueFeignClient govIssueFeignClient;
@Override @Override
public Result issueVotingDailyStatistical() { public Result issueVotingDailyStatistical(DailyStatisticalVoteJob form) {
return govIssueFeignClient.dailyStatisticalVoteJob(); return govIssueFeignClient.dailyStatisticalVoteJob(form);
} }
} }

9
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DailyStatisticalVoteTask.java

@ -1,7 +1,10 @@
package com.epmet.task; package com.epmet.task;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.DailyStatisticalVoteJob;
import com.epmet.service.IssueVotingDailyStatisticalTaskService; import com.epmet.service.IssueVotingDailyStatisticalTaskService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -24,7 +27,11 @@ public class DailyStatisticalVoteTask implements ITask{
@Override @Override
public void run(String params) { public void run(String params) {
logger.debug("dailyStatisticalVoteTask定时任务正在执行,参数为:{}", params); logger.debug("dailyStatisticalVoteTask定时任务正在执行,参数为:{}", params);
Result result=issueVotingDailyStatisticalTaskService.issueVotingDailyStatistical(); DailyStatisticalVoteJob form = new DailyStatisticalVoteJob();
if (StringUtils.isNotBlank(params)) {
form = JSON.parseObject(params, DailyStatisticalVoteJob.class);
}
Result result=issueVotingDailyStatisticalTaskService.issueVotingDailyStatistical(form);
if(result.success()){ if(result.success()){
logger.debug("dailyStatisticalVoteTask定时任务正在执行定时任务执行成功"); logger.debug("dailyStatisticalVoteTask定时任务正在执行定时任务执行成功");
}else{ }else{

5
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/PolyLineDTO.java

@ -1,5 +1,6 @@
package com.epmet.dto; package com.epmet.dto;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
@ -29,4 +30,8 @@ public class PolyLineDTO implements Serializable {
*/ */
private Integer oppositionIncrement; private Integer oppositionIncrement;
public PolyLineDTO() {
this.supportIncrement = NumConstant.ZERO;
this.oppositionIncrement = NumConstant.ZERO;
}
} }

26
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/DailyStatisticalVoteJob.java

@ -0,0 +1,26 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/12/29 10:56 上午
* @DESC
*/
@Data
public class DailyStatisticalVoteJob implements Serializable {
private static final long serialVersionUID = -3685299478100771134L;
private String customerId;
private String dateId;
private String startDate;
private String endDate;
}

5
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ResiBuzzLeftPieChartFormDTO.java

@ -23,4 +23,9 @@ public class ResiBuzzLeftPieChartFormDTO implements Serializable {
* 组织类型agency组织grid网格 * 组织类型agency组织grid网格
*/ */
private String orgType; private String orgType;
/**
* 表决中voting 已转项目shift_project 已关闭closed全部all
*/
private String status = "all";
} }

70
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/DailyStatisticalVoteJobResultDTO.java

@ -0,0 +1,70 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Author zxc
* @DateTime 2021/12/29 1:52 下午
* @DESC
*/
@Data
public class DailyStatisticalVoteJobResultDTO implements Serializable {
private static final long serialVersionUID = 5266996778036448163L;
private String issueId;
/**
* 统计日期
*/
private Date statisticalDate;
/**
* 到该日的总赞成数
*/
private Integer supportCount;
/**
* 到该日的总反对数
*/
private Integer oppositionCount;
/**
* 到该日的总票数
*/
private Integer totalCount;
/**
* 该日增量
*/
private Integer todayIncrement;
/**
* 该日赞成增量
*/
private Integer supportIncrement;
/**
* 该日反对增量
*/
private Integer oppositionIncrement;
/**
* 应表决数
*/
private Integer votableCount;
public DailyStatisticalVoteJobResultDTO() {
this.supportCount = NumConstant.ZERO;
this.oppositionCount = NumConstant.ZERO;
this.totalCount = NumConstant.ZERO;
this.todayIncrement = NumConstant.ZERO;
this.supportIncrement = NumConstant.ZERO;
this.oppositionIncrement = NumConstant.ZERO;
this.votableCount = NumConstant.ZERO;
}
}

7
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ResiBuzzLeftPieChartResultDTO.java

@ -37,10 +37,17 @@ public class ResiBuzzLeftPieChartResultDTO implements Serializable {
*/ */
private String color; private String color;
@JsonIgnore
private String issueId;
@JsonIgnore
private Boolean status;
public ResiBuzzLeftPieChartResultDTO() { public ResiBuzzLeftPieChartResultDTO() {
this.count = NumConstant.ZERO; this.count = NumConstant.ZERO;
this.categoryCode = ""; this.categoryCode = "";
this.categoryName = ""; this.categoryName = "";
this.color = ""; this.color = "";
this.status = false;
} }
} }

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

@ -83,7 +83,7 @@ public class IssueManageController {
* @author zxc * @author zxc
*/ */
@PostMapping("votingtrend") @PostMapping("votingtrend")
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_ISSUE_DETAIL) // @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_ISSUE_DETAIL)
public Result<VotingTrendResultDTO> votingTrend(@RequestBody IssueIdFormDTO issueId){ public Result<VotingTrendResultDTO> votingTrend(@RequestBody IssueIdFormDTO issueId){
return new Result<VotingTrendResultDTO>().ok(issueVoteStatisticalService.votingTrend(issueId)); return new Result<VotingTrendResultDTO>().ok(issueVoteStatisticalService.votingTrend(issueId));
} }

9
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueVoteStatisticalController.java

@ -35,6 +35,7 @@ import com.epmet.dto.result.VoteResultDTO;
import com.epmet.dto.result.VotingTrendResultDTO; import com.epmet.dto.result.VotingTrendResultDTO;
import com.epmet.excel.IssueVoteStatisticalExcel; import com.epmet.excel.IssueVoteStatisticalExcel;
import com.epmet.service.IssueVoteStatisticalService; import com.epmet.service.IssueVoteStatisticalService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -49,10 +50,11 @@ import java.util.Map;
* @author generator generator@elink-cn.com * @author generator generator@elink-cn.com
* @since v1.0.0 2020-05-11 * @since v1.0.0 2020-05-11
*/ */
@Slf4j
@RestController @RestController
@RequestMapping("issuevotestatistical") @RequestMapping("issuevotestatistical")
public class IssueVoteStatisticalController { public class IssueVoteStatisticalController {
@Autowired @Autowired
private IssueVoteStatisticalService issueVoteStatisticalService; private IssueVoteStatisticalService issueVoteStatisticalService;
@ -129,7 +131,8 @@ public class IssueVoteStatisticalController {
**/ **/
@PostMapping("syncvotingcacheanddb") @PostMapping("syncvotingcacheanddb")
public Result syncVotingCacheAndDb(){ public Result syncVotingCacheAndDb(){
issueVoteStatisticalService.syncVotingCacheToDb(); //issueVoteStatisticalService.syncVotingCacheToDb();
log.error("syncvotingcacheanddb 又执行了");
return new Result(); return new Result();
} }
@ -159,4 +162,4 @@ public class IssueVoteStatisticalController {
return new Result<List<MyPartIssuesResultDTO>>().ok(issueVoteStatisticalService.myPartIssues(myPartIssuesFormDTO)); return new Result<List<MyPartIssuesResultDTO>>().ok(issueVoteStatisticalService.myPartIssues(myPartIssuesFormDTO));
} }
} }

6
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueVoteStatisticalDailyController.java

@ -26,6 +26,7 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IssueVoteStatisticalDailyDTO; import com.epmet.dto.IssueVoteStatisticalDailyDTO;
import com.epmet.dto.form.DailyStatisticalVoteJob;
import com.epmet.excel.IssueVoteStatisticalDailyExcel; import com.epmet.excel.IssueVoteStatisticalDailyExcel;
import com.epmet.service.IssueVoteStatisticalDailyService; import com.epmet.service.IssueVoteStatisticalDailyService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -99,8 +100,9 @@ public class IssueVoteStatisticalDailyController {
* @date 2020.05.20 15:39 * @date 2020.05.20 15:39
**/ **/
@PostMapping(value = "dailystatisticalvotejob") @PostMapping(value = "dailystatisticalvotejob")
public Result dailyStatisticalVoteJob(){ public Result dailyStatisticalVoteJob(@RequestBody DailyStatisticalVoteJob form){
issueVoteStatisticalDailyService.countVotingDailyStatistic(); // issueVoteStatisticalDailyService.countVotingDailyStatistic();
issueVoteStatisticalDailyService.countVotingDailyStatisticNew(form);
return new Result(); return new Result();
} }
} }

22
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java

@ -254,6 +254,26 @@ public interface IssueDao extends BaseDao<IssueEntity> {
*/ */
List<ResiBuzzLeftPieChartResultDTO> resiBuzzLeftPieChart(@Param("orgId")String orgId,@Param("orgType")String orgType,@Param("length")Integer length,@Param("customerId")String customerId); List<ResiBuzzLeftPieChartResultDTO> resiBuzzLeftPieChart(@Param("orgId")String orgId,@Param("orgType")String orgType,@Param("length")Integer length,@Param("customerId")String customerId);
/**
* @Description
* @param length
* @author zxc
* @date 2021/12/30 9:18 上午
*/
List<ResiBuzzLeftPieChartResultDTO> resiBuzzLeftPieChartByIssueIds(@Param("length")Integer length,@Param("issueIds")List<String> issueIds);
List<ResiBuzzLeftPieChartResultDTO> resiBuzzIssueCategoryByIssueIds(@Param("length")Integer length,@Param("issueIds")List<String> issueIds);
List<ResiBuzzLeftPieChartResultDTO> resiBuzzIssueCategoryNameByIssueIds(List<ResiBuzzLeftPieChartResultDTO> categories,@Param("customerId")String customerId);
/**
* @Description 查询前50名的议题ID
* @param orgId
* @param orgType
* @author zxc
* @date 2021/12/30 9:16 上午
*/
List<String> resiBuzzLeftPieChartIssueIds(@Param("orgId")String orgId,@Param("orgType")String orgType,@Param("status")String status);
/** /**
* @Description 查询组织下每个网格的项目数 * @Description 查询组织下每个网格的项目数
* @param orgId * @param orgId
@ -270,4 +290,6 @@ public interface IssueDao extends BaseDao<IssueEntity> {
*/ */
List<ResiBuzzIssueCategoryDTO> selectCategoryNameByIssueIds(@Param("issueIds")List<String> issueIds); List<ResiBuzzIssueCategoryDTO> selectCategoryNameByIssueIds(@Param("issueIds")List<String> issueIds);
List<ResiBuzzIssueCategoryDTO> selectCategoryNameByIssueList(List<ResiBuzzLeftPieChartResultDTO> issueIds,@Param("customerId")String customerId);
} }

21
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueVoteDetailDao.java

@ -19,8 +19,10 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IssueVoteDetailDTO; import com.epmet.dto.IssueVoteDetailDTO;
import com.epmet.dto.PolyLineDTO;
import com.epmet.dto.form.VoteFormDTO; import com.epmet.dto.form.VoteFormDTO;
import com.epmet.dto.form.VoteRedisFormDTO; import com.epmet.dto.form.VoteRedisFormDTO;
import com.epmet.dto.result.DailyStatisticalVoteJobResultDTO;
import com.epmet.dto.result.IssueAttitudeCountResultDTO; import com.epmet.dto.result.IssueAttitudeCountResultDTO;
import com.epmet.dto.result.IssueVoteResultDTO; import com.epmet.dto.result.IssueVoteResultDTO;
import com.epmet.dto.result.MyPartIssuesResultDTO; import com.epmet.dto.result.MyPartIssuesResultDTO;
@ -130,4 +132,23 @@ public interface IssueVoteDetailDao extends BaseDao<IssueVoteDetailEntity> {
* @date 2021/5/12 1:48 下午 * @date 2021/5/12 1:48 下午
*/ */
List<IssueVoteResultDTO> selectIssueVoteCountBatch(@Param("issueIds")List<String> issueIds); List<IssueVoteResultDTO> selectIssueVoteCountBatch(@Param("issueIds")List<String> issueIds);
/**
* @Description 查询客户下的议题表决日增
* @param customerId
* @param dateId 当dateId为空时查询的是累计值
* @author zxc
* @date 2021/12/29 2:02 下午
*/
List<DailyStatisticalVoteJobResultDTO> statisticVote(@Param("customerId")String customerId,@Param("dateId")String dateId);
/**
* @Description 根据议题ID查询折线图一天的数据
* @param issueId
* @param dateId
* @author zxc
* @date 2021/12/29 4:19 下午
*/
PolyLineDTO polyLineData(@Param("issueId")String issueId,@Param("dateId")String dateId);;
} }

9
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueVoteStatisticalDailyDao.java

@ -78,4 +78,13 @@ public interface IssueVoteStatisticalDailyDao extends BaseDao<IssueVoteStatistic
* @date 2020.05.20 14:54 * @date 2020.05.20 14:54
**/ **/
void updateBatch(@Param("list") List<IssueVoteStatisticalDailyEntity> list); void updateBatch(@Param("list") List<IssueVoteStatisticalDailyEntity> list);
/**
* @Description 删除历史数据
* @param customerId
* @param dateId
* @author zxc
* @date 2021/12/29 2:51 下午
*/
Integer delHistoryData(@Param("customerId")String customerId,@Param("dateId")String dateId);
} }

7
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueVoteDetailRedis.java

@ -256,12 +256,17 @@ public class IssueVoteDetailRedis {
IssueDTO issue = issueService.get(issueId); IssueDTO issue = issueService.get(issueId);
if(null != issue){ if(null != issue){
// 如果是表决中的议题,数据现算 // 如果是表决中的议题,数据现算
VoteRedisFormDTO voteCache = new VoteRedisFormDTO(); VoteRedisFormDTO voteCache;
if (issue.getIssueStatus().equals(IssueConstant.ISSUE_VOTING)){ if (issue.getIssueStatus().equals(IssueConstant.ISSUE_VOTING)){
SelectIssueVotingDetailFormDTO formDTO = new SelectIssueVotingDetailFormDTO(); SelectIssueVotingDetailFormDTO formDTO = new SelectIssueVotingDetailFormDTO();
formDTO.setIssueId(issueId); formDTO.setIssueId(issueId);
formDTO.setGridId(issue.getGridId()); formDTO.setGridId(issue.getGridId());
voteCache = issueVoteDetailService.selectIssueVotingDetail(formDTO); voteCache = issueVoteDetailService.selectIssueVotingDetail(formDTO);
IssueVoteStatisticalDTO dto = ConvertUtils.sourceToTarget(voteCache, IssueVoteStatisticalDTO.class);
dto.setVotableCount(voteCache.getShouldVoteCount());
dto.setSupportCount(voteCache.getSupportAmount());
dto.setOppositionCount(voteCache.getOppositionAmount());
issueVoteStatisticalDao.updateBtIssueId(dto);
}else { }else {
// 状态是关闭,转议题的,直接从结果表查询 // 状态是关闭,转议题的,直接从结果表查询
voteCache = issueVoteStatisticalDao.selectVoteDetail(issueId); voteCache = issueVoteStatisticalDao.selectVoteDetail(issueId);

9
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueVoteStatisticalDailyService.java

@ -20,6 +20,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IssueVoteStatisticalDailyDTO; import com.epmet.dto.IssueVoteStatisticalDailyDTO;
import com.epmet.dto.form.DailyStatisticalVoteJob;
import com.epmet.entity.IssueVoteStatisticalDailyEntity; import com.epmet.entity.IssueVoteStatisticalDailyEntity;
import java.util.List; import java.util.List;
@ -101,4 +102,12 @@ public interface IssueVoteStatisticalDailyService extends BaseService<IssueVoteS
* @date 2020.05.19 09:23 * @date 2020.05.19 09:23
**/ **/
void countVotingDailyStatistic(); void countVotingDailyStatistic();
/**
* @Description 统计前一天所有有表决动作的议题
* @param
* @author zxc
* @date 2021/12/29 10:31 上午
*/
void countVotingDailyStatisticNew(DailyStatisticalVoteJob form);
} }

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

@ -1605,7 +1605,22 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
} }
List<ResiBuzzDTO> list = allList.stream().skip(formDTO.getPageSize() * (formDTO.getPageNo() - NumConstant.ONE)) List<ResiBuzzDTO> list = allList.stream().skip(formDTO.getPageSize() * (formDTO.getPageNo() - NumConstant.ONE))
.limit(formDTO.getPageSize()).collect(Collectors.toList()); .limit(formDTO.getPageSize()).collect(Collectors.toList());
List<ResiBuzzIssueCategoryDTO> names = baseDao.selectCategoryNameByIssueIds(allList.stream().map(m -> m.getIssueId()).collect(Collectors.toList())); List<ResiBuzzLeftPieChartResultDTO> categories = baseDao.resiBuzzIssueCategoryByIssueIds(length, list.stream().map(m -> m.getIssueId()).collect(Collectors.toList()));
List<ResiBuzzLeftPieChartResultDTO> pieChat = getPieChat(list.stream().map(m -> m.getIssueId()).collect(Collectors.toList()));
Iterator<ResiBuzzLeftPieChartResultDTO> listIterator = pieChat.iterator();
while (listIterator.hasNext()){
ResiBuzzLeftPieChartResultDTO next = listIterator.next();
for (int i = 0; i < categories.size(); i++) {
if (next.getIssueId().equals(categories.get(i).getIssueId()) && !next.getStatus()){
next.setStatus(true);
listIterator.remove();
continue;
}
}
}
categories.addAll(pieChat);
// List<ResiBuzzIssueCategoryDTO> names = baseDao.selectCategoryNameByIssueIds(allList.stream().map(m -> m.getIssueId()).collect(Collectors.toList()));
List<ResiBuzzIssueCategoryDTO> names = baseDao.selectCategoryNameByIssueList(categories,tokenDto.getCustomerId());
if (CollectionUtils.isNotEmpty(names)){ if (CollectionUtils.isNotEmpty(names)){
list.forEach(l -> names.stream().filter(n -> l.getIssueId().equals(n.getIssueId())).forEach(n -> l.setCategoryName(n.getCn()))); list.forEach(l -> names.stream().filter(n -> l.getIssueId().equals(n.getIssueId())).forEach(n -> l.setCategoryName(n.getCn())));
} }
@ -1651,13 +1666,43 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
} }
// 分类编码长度 // 分类编码长度
Integer length = baseDao.selectOneLevelCategoryLength(tokenDto.getCustomerId()); Integer length = baseDao.selectOneLevelCategoryLength(tokenDto.getCustomerId());
List<ResiBuzzLeftPieChartResultDTO> result = baseDao.resiBuzzLeftPieChart(formDTO.getOrgId(), formDTO.getOrgType(), length, tokenDto.getCustomerId()); // List<ResiBuzzLeftPieChartResultDTO> result = baseDao.resiBuzzLeftPieChart(formDTO.getOrgId(), formDTO.getOrgType(), length, tokenDto.getCustomerId());
if(CollectionUtils.isEmpty(result)){ List<String> issueIds = baseDao.resiBuzzLeftPieChartIssueIds(formDTO.getOrgId(), formDTO.getOrgType(),formDTO.getStatus());
if(CollectionUtils.isEmpty(issueIds)){
return new ArrayList<>();
}
List<ResiBuzzLeftPieChartResultDTO> categories = baseDao.resiBuzzIssueCategoryByIssueIds(length, issueIds);
List<ResiBuzzLeftPieChartResultDTO> pieChat = getPieChat(issueIds);
Iterator<ResiBuzzLeftPieChartResultDTO> list = pieChat.iterator();
while (list.hasNext()){
ResiBuzzLeftPieChartResultDTO next = list.next();
for (int i = 0; i < categories.size(); i++) {
if (next.getIssueId().equals(categories.get(i).getIssueId()) && !next.getStatus()){
next.setStatus(true);
list.remove();
continue;
}
}
}
categories.addAll(pieChat);
// List<ResiBuzzLeftPieChartResultDTO> result = baseDao.resiBuzzLeftPieChartByIssueIds(length, issueIds);
List<ResiBuzzLeftPieChartResultDTO> result = baseDao.resiBuzzIssueCategoryNameByIssueIds(categories, tokenDto.getCustomerId());
if (CollectionUtils.isEmpty(result)){
return new ArrayList<>(); return new ArrayList<>();
} }
return result; return result;
} }
public List<ResiBuzzLeftPieChartResultDTO> getPieChat(List<String> issueIds){
List<ResiBuzzLeftPieChartResultDTO> resultDTOS = new ArrayList<>();
issueIds.forEach(i -> {
ResiBuzzLeftPieChartResultDTO dto = new ResiBuzzLeftPieChartResultDTO();
dto.setIssueId(i);
resultDTOS.add(dto);
});
return resultDTOS;
}
/** /**
* @Description 查询组织下每个网格的项目数 * @Description 查询组织下每个网格的项目数
* @param formDTO * @param formDTO

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

@ -253,8 +253,11 @@ public class IssueVoteDetailServiceImpl extends BaseServiceImpl<IssueVoteDetailD
@Override @Override
public void updateVote(SelectIssueVotingDetailFormDTO formDTO) { public void updateVote(SelectIssueVotingDetailFormDTO formDTO) {
VoteRedisFormDTO voteRedisFormDTO = this.selectIssueVotingDetail(formDTO); VoteRedisFormDTO voteRedisFormDTO = this.selectIssueVotingDetail(formDTO);
issueVoteDetailRedis.set(voteRedisFormDTO);
IssueVoteStatisticalDTO dto = ConvertUtils.sourceToTarget(voteRedisFormDTO, IssueVoteStatisticalDTO.class); IssueVoteStatisticalDTO dto = ConvertUtils.sourceToTarget(voteRedisFormDTO, IssueVoteStatisticalDTO.class);
dto.setVotableCount(voteRedisFormDTO.getShouldVoteCount()); dto.setVotableCount(voteRedisFormDTO.getShouldVoteCount());
dto.setSupportCount(voteRedisFormDTO.getSupportAmount());
dto.setOppositionCount(voteRedisFormDTO.getOppositionAmount());
issueVoteStatisticalDao.updateBtIssueId(dto); issueVoteStatisticalDao.updateBtIssueId(dto);
} }

81
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalDailyServiceImpl.java

@ -21,18 +21,27 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IssueVoteDetailDao; import com.epmet.dao.IssueVoteDetailDao;
import com.epmet.dao.IssueVoteStatisticalDailyDao; import com.epmet.dao.IssueVoteStatisticalDailyDao;
import com.epmet.dto.CustomerDTO;
import com.epmet.dto.IssueVoteStatisticalDailyDTO; import com.epmet.dto.IssueVoteStatisticalDailyDTO;
import com.epmet.dto.form.DailyStatisticalVoteJob;
import com.epmet.dto.result.DailyStatisticalVoteJobResultDTO;
import com.epmet.dto.result.IssuesToBeCountedResultDTO; import com.epmet.dto.result.IssuesToBeCountedResultDTO;
import com.epmet.entity.IssueVoteStatisticalDailyEntity; import com.epmet.entity.IssueVoteStatisticalDailyEntity;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.epmet.redis.IssueVoteStatisticalDailyRedis; import com.epmet.redis.IssueVoteStatisticalDailyRedis;
import com.epmet.service.IssueVoteStatisticalDailyService; import com.epmet.service.IssueVoteStatisticalDailyService;
import com.epmet.utils.ModuleConstants; import com.epmet.utils.ModuleConstants;
import oracle.sql.NUMBER; import oracle.sql.NUMBER;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -40,6 +49,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDate;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -58,6 +68,9 @@ public class IssueVoteStatisticalDailyServiceImpl extends BaseServiceImpl<IssueV
@Autowired @Autowired
private IssueVoteDetailDao issueVoteDetailDao; private IssueVoteDetailDao issueVoteDetailDao;
@Autowired
private OperCrmOpenFeignClient operCrmOpenFeignClient;
protected static final Logger logger = LoggerFactory.getLogger(IssueVoteStatisticalDailyServiceImpl.class); protected static final Logger logger = LoggerFactory.getLogger(IssueVoteStatisticalDailyServiceImpl.class);
@Override @Override
@ -303,4 +316,72 @@ public class IssueVoteStatisticalDailyServiceImpl extends BaseServiceImpl<IssueV
} }
/**
* @Description 统计前一天所有有表决动作的议题
* @param
* @author zxc
* @date 2021/12/29 10:31 上午
*/
@Override
public void countVotingDailyStatisticNew(DailyStatisticalVoteJob form) {
// 先处理下纬度
List<String> customerIds = new ArrayList<>();
if (StringUtils.isBlank(form.getCustomerId())){
Result<List<CustomerDTO>> allCustomerList = operCrmOpenFeignClient.getAllCustomerList();
if (!allCustomerList.success() || CollectionUtils.isEmpty(allCustomerList.getData())){
throw new EpmetException("查询所有客户失败...");
}
customerIds = allCustomerList.getData().stream().map(m -> m.getId()).collect(Collectors.toList());
}else {
customerIds.add(form.getCustomerId());
}
if (StringUtils.isNotBlank(form.getStartDate()) && StringUtils.isNotBlank(form.getEndDate())){
List<String> daysBetween = DateUtils.getDaysBetween(form.getStartDate(), form.getEndDate());
customerIds.forEach(customerId -> {
daysBetween.forEach(dateId -> {
statisticVote(customerId,dateId);
});
});
}else {
if (StringUtils.isBlank(form.getDateId())){
form.setDateId(LocalDate.now().minusDays(NumConstant.ONE).toString().replace("-", ""));
}
customerIds.forEach(customerId -> {
statisticVote(customerId, form.getDateId());
});
}
}
/**
* @Description 统计 issue_vote_statistical_daily
* 只统计表决日增存在的不存在的不写入查询程序补全
* @param customerId
* @param dateId 格式YYYY-MM-DD
* @author zxc
* @date 2021/12/29 1:46 下午
*/
@Transactional(rollbackFor = Exception.class)
public void statisticVote(String customerId,String dateId){
// 日增
List<DailyStatisticalVoteJobResultDTO> dayAdd = issueVoteDetailDao.statisticVote(customerId, dateId);
if (CollectionUtils.isNotEmpty(dayAdd)){
//累计
List<DailyStatisticalVoteJobResultDTO> allDayAdd = issueVoteDetailDao.statisticVote(customerId, null);
dayAdd.forEach(d -> allDayAdd.stream().filter(a -> a.getIssueId().equals(d.getIssueId())).forEach(a -> {
d.setOppositionCount(a.getOppositionCount());
d.setSupportCount(a.getSupportCount());
d.setTotalCount(a.getTotalCount());
}));
List<IssueVoteStatisticalDailyEntity> needInsert = ConvertUtils.sourceToTarget(dayAdd, IssueVoteStatisticalDailyEntity.class);
Integer delNum;
do {
delNum = baseDao.delHistoryData(customerId, dateId);
} while (delNum != null && delNum > NumConstant.ZERO);
List<List<IssueVoteStatisticalDailyEntity>> partition = ListUtils.partition(needInsert, NumConstant.ONE_HUNDRED);
partition.forEach(p -> {
baseDao.insertBatch(p);
});
}
}
} }

61
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java

@ -27,6 +27,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.IssueConstant; import com.epmet.constant.IssueConstant;
import com.epmet.dao.IssueDao; import com.epmet.dao.IssueDao;
@ -66,6 +67,9 @@ import java.time.ZoneOffset;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.epmet.commons.tools.utils.DateUtils.DATE_PATTERN;
import static com.epmet.commons.tools.utils.DateUtils.DATE_PATTERN_YYYYMMDD;
/** /**
* 议题表决统计表 * 议题表决统计表
* *
@ -205,12 +209,36 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt
votingTrendResultDTO.setRealityVoteCount(voteRedisFormDTO.getSupportAmount() + voteRedisFormDTO.getOppositionAmount()); votingTrendResultDTO.setRealityVoteCount(voteRedisFormDTO.getSupportAmount() + voteRedisFormDTO.getOppositionAmount());
//DB获取表决 日统计详情 //DB获取表决 日统计详情
List<PolyLineDTO> polyLineDTOS = issueVoteStatisticalDao.polyLineData(issueId); List<PolyLineDTO> polyLineDTOS = issueVoteStatisticalDao.polyLineData(issueId);
PolyLineDTO polyLineDTO = new PolyLineDTO(); // PolyLineDTO polyLineDTO = new PolyLineDTO();
polyLineDTO.setVoteDate(LocalDateTime.now().toEpochSecond(ZoneOffset.of(IssueConstant.BEIJING_TIME_ZONE))); // polyLineDTO.setVoteDate(LocalDateTime.now().toEpochSecond(ZoneOffset.of(IssueConstant.BEIJING_TIME_ZONE)));
//议题 已转项目 或 已结案 的时间 //议题 已转项目 或 已结案 的时间
String date = issueDao.operateTime(issueId.getIssueId()); // String date = issueDao.operateTime(issueId.getIssueId());
IssueEntity issueEntity = issueDao.selectById(issueId.getIssueId());
String startDate = DateUtils.format(issueEntity.getDecidedTime(),DATE_PATTERN);
String endDate = null == issueEntity.getVotingDeadline() ?
DateUtils.format(new Date(),DATE_PATTERN) :
DateUtils.format(issueEntity.getVotingDeadline(),DATE_PATTERN);
List<PolyLineDTO> polyLine = getPolyLine(startDate, endDate);
String today = LocalDate.now().toString();
if (today.equals(endDate)){
PolyLineDTO polyLineDTO = issueVoteDetailDao.polyLineData(issueId.getIssueId(), endDate);
polyLine.get(polyLine.size() - NumConstant.ONE).setSupportIncrement(polyLineDTO.getSupportIncrement());
polyLine.get(polyLine.size() - NumConstant.ONE).setOppositionIncrement(polyLineDTO.getOppositionIncrement());
}
if (CollectionUtils.isEmpty(polyLineDTOS)){
votingTrendResultDTO.setPolyLine(polyLine);
return votingTrendResultDTO;
}
polyLineDTOS.forEach(pd -> {
polyLine.forEach(p -> {
if (pd.getVoteDate().equals(p.getVoteDate())){
p.setOppositionIncrement(pd.getOppositionIncrement());
p.setSupportIncrement(pd.getSupportIncrement());
}
});
});
//今天刚转项目或刚刚关闭,当天数据DB没有,直接从缓存拿 //今天刚转项目或刚刚关闭,当天数据DB没有,直接从缓存拿
if (polyLineDTOS.size() == NumConstant.ZERO && date.equals(LocalDate.now().toString())) { /*if (polyLineDTOS.size() == NumConstant.ZERO && date.equals(LocalDate.now().toString())) {
polyLineDTO.setSupportIncrement(voteRedisFormDTO.getSupportAmount()); polyLineDTO.setSupportIncrement(voteRedisFormDTO.getSupportAmount());
polyLineDTO.setOppositionIncrement(voteRedisFormDTO.getOppositionAmount()); polyLineDTO.setOppositionIncrement(voteRedisFormDTO.getOppositionAmount());
polyLineDTOS.add(polyLineDTO); polyLineDTOS.add(polyLineDTO);
@ -222,18 +250,37 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt
polyLineDTOS.add(polyLineDTO); polyLineDTOS.add(polyLineDTO);
} }
//从古至今一直在表决中 //从古至今一直在表决中
IssueEntity issueEntity = issueDao.selectById(issueId.getIssueId());
if (issueEntity.getIssueStatus().equals(IssueConstant.ISSUE_VOTING)){ if (issueEntity.getIssueStatus().equals(IssueConstant.ISSUE_VOTING)){
polyLineDTO.setSupportIncrement(voteRedisFormDTO.getSupportAmount()); polyLineDTO.setSupportIncrement(voteRedisFormDTO.getSupportAmount());
polyLineDTO.setOppositionIncrement(voteRedisFormDTO.getOppositionAmount()); polyLineDTO.setOppositionIncrement(voteRedisFormDTO.getOppositionAmount());
polyLineDTOS.add(polyLineDTO); polyLineDTOS.add(polyLineDTO);
} }
} }*/
//今天之前 “已转项目”或“已关闭” //今天之前 “已转项目”或“已关闭”
votingTrendResultDTO.setPolyLine(polyLineDTOS);
votingTrendResultDTO.setPolyLine(polyLine);
return votingTrendResultDTO; return votingTrendResultDTO;
} }
public List<PolyLineDTO> getPolyLine(String startTime, String endTime){
List<PolyLineDTO> result = new ArrayList<>();
Date start = DateUtils.parse(startTime, DATE_PATTERN);
Date end = DateUtils.parse(endTime, DATE_PATTERN);
Calendar tempStart = Calendar.getInstance();
tempStart.setTime(start);
Calendar tempEnd = Calendar.getInstance();
tempEnd.setTime(end);
// 日期加1(包含结束)
tempEnd.add(Calendar.DATE, +1);
while (tempStart.before(tempEnd)) {
PolyLineDTO dto = new PolyLineDTO();
dto.setVoteDate(tempStart.getTimeInMillis()/1000);
result.add(dto);
tempStart.add(Calendar.DAY_OF_YEAR, 1);
}
return result;
}
/** /**
* @param formDTO * @param formDTO
* @Description 满意度评价列表已关闭 * @Description 满意度评价列表已关闭

118
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml

@ -621,31 +621,31 @@
<!-- 查询居民热议左侧饼图 --> <!-- 查询居民热议左侧饼图 -->
<select id="resiBuzzLeftPieChart" resultType="com.epmet.dto.result.ResiBuzzLeftPieChartResultDTO"> <select id="resiBuzzLeftPieChart" resultType="com.epmet.dto.result.ResiBuzzLeftPieChartResultDTO">
SELECT COUNT(issueId) AS count,categoryCode,categoryName,color FROM
(SELECT SELECT COUNT(t2.issueId) AS count,cd.CATEGORY_CODE,IFNULL(cd.CATEGORY_NAME,'其他') AS categoryName, IFNULL(cd.COLOR,'#0091ed') AS color FROM
i.ID AS issueId, (SELECT t1.issueId AS issueId,IFNULL(LEFT(ic.CATEGORY_CODE,#{length}),'') AS categoryCode FROM
IFNULL(LEFT(ic.CATEGORY_CODE,#{length}),'') AS categoryCode, (SELECT
IFNULL(cd.CATEGORY_NAME,'其他') AS categoryName, i.ID AS issueId
IFNULL(cd.color,'#0091ed') AS color FROM issue i
FROM issue i INNER JOIN issue_vote_statistical s ON (s.ISSUE_ID = i.ID AND s.DEL_FLAG = '0')
INNER JOIN issue_vote_statistical s ON (s.ISSUE_ID = i.ID AND s.DEL_FLAG = '0') WHERE i.DEL_FLAG = '0'
LEFT JOIN issue_category ic ON (ic.ISSUE_ID = i.ID AND ic.DEL_FLAG = '0' AND ic.CUSTOMER_ID = i.CUSTOMER_ID) <if test='orgType == "grid" '>
LEFT JOIN issue_project_category_dict cd ON (cd.CATEGORY_CODE = LEFT(ic.CATEGORY_CODE,#{length}) AND cd.DEL_FLAG = '0' AND cd.CUSTOMER_ID = ic.CUSTOMER_ID) AND i.GRID_ID = #{orgId}
WHERE i.DEL_FLAG = '0' </if>
<if test='orgType == "grid" '> <if test='orgType == "agency" '>
AND i.GRID_ID = #{orgId} AND i.ORG_ID_PATH LIKE CONCAT('%',#{orgId},'%')
</if> </if>
<if test='orgType == "agency" '> ORDER BY (s.SUPPORT_COUNT + s.OPPOSITION_COUNT) DESC,i.created_time DESC LIMIT 50)t1
AND i.ORG_ID_PATH LIKE CONCAT('%',#{orgId},'%') LEFT JOIN issue_category ic ON (t1.issueId = ic.ISSUE_ID AND ic.DEL_FLAG = '0')
</if> GROUP BY t1.issueId,categoryCode)t2
ORDER BY (s.SUPPORT_COUNT + s.OPPOSITION_COUNT) DESC,i.created_time DESC LIMIT 50)temp LEFT JOIN issue_project_category_dict cd ON (cd.CATEGORY_CODE = t2.categoryCode AND cd.CUSTOMER_ID = #{customerId} AND cd.DEL_FLAG = '0' )
GROUP BY categoryName GROUP BY cd.CATEGORY_NAME
</select> </select>
<!-- 查询组织下每个网格的项目数 --> <!-- 查询组织下每个网格的项目数 -->
<select id="getProjectCountByGrid" resultType="com.epmet.dto.result.ProjectDistributionAnalysisRightDTO"> <select id="getProjectCountByGrid" resultType="com.epmet.dto.result.ProjectDistributionAnalysisRightDTO">
SELECT SELECT
GRID_ID, GRID_ID AS orgId,
COUNT(ID) AS count COUNT(ID) AS count
FROM issue FROM issue
WHERE DEL_FLAG = '0' WHERE DEL_FLAG = '0'
@ -676,4 +676,82 @@
</foreach> </foreach>
) )
</select> </select>
<!-- 查询前50名的议题ID -->
<select id="resiBuzzLeftPieChartIssueIds" resultType="java.lang.String">
SELECT
i.ID AS issueId
FROM issue i
INNER JOIN issue_vote_statistical s ON (s.ISSUE_ID = i.ID AND s.DEL_FLAG = '0')
WHERE i.DEL_FLAG = '0'
<if test='status != "all" '>
AND i.ISSUE_STATUS = #{status}
</if>
<if test='orgType == "grid" '>
AND i.GRID_ID = #{orgId}
</if>
<if test='orgType == "agency" '>
AND i.ORG_ID_PATH LIKE CONCAT('%',#{orgId},'%')
</if>
ORDER BY (s.SUPPORT_COUNT + s.OPPOSITION_COUNT) DESC,i.created_time DESC LIMIT 50
</select>
<select id="resiBuzzLeftPieChartByIssueIds" resultType="com.epmet.dto.result.ResiBuzzLeftPieChartResultDTO">
SELECT
COUNT(ic.ISSUE_ID) AS count,
IFNULL(LEFT(ic.CATEGORY_CODE,#{length}),'') AS categoryCode,
IFNULL(cd.CATEGORY_NAME,'其他') AS categoryName,
IFNULL(cd.color,'#0091ed') AS color
FROM issue_category ic
LEFT JOIN issue_project_category_dict cd ON (cd.CATEGORY_CODE = LEFT(ic.CATEGORY_CODE,#{length}) AND cd.DEL_FLAG = '0' AND cd.CUSTOMER_ID = ic.CUSTOMER_ID)
AND ic.ISSUE_ID IN (
<foreach collection="issueIds" item="issueId" separator=",">
#{issueId}
</foreach>
) GROUP BY categoryCode
</select>
<select id="resiBuzzIssueCategoryByIssueIds"
resultType="com.epmet.dto.result.ResiBuzzLeftPieChartResultDTO">
SELECT
ISSUE_ID ,
IFNULL(LEFT(CATEGORY_CODE,#{length}),'') AS categoryCode
FROM issue_category
WHERE DEL_FLAG = '0'
AND ISSUE_ID IN(
<foreach collection="issueIds" item="issueId" separator=",">
#{issueId}
</foreach>
)
GROUP BY issue_id,categoryCode
</select>
<select id="resiBuzzIssueCategoryNameByIssueIds"
resultType="com.epmet.dto.result.ResiBuzzLeftPieChartResultDTO">
select count(t2.issueId) as count , t2.categoryCode,t2.categoryName,t2.color from
(<foreach collection="categories" item="c" separator="UNION ALL">
select
t1.issueId as issueId,
cd.CATEGORY_CODE as categoryCode,
IFNULL(cd.CATEGORY_NAME,'其他') AS categoryName,
IFNULL(cd.COLOR,'#0091ed') AS color
from (select #{c.issueId} as issueId,#{c.categoryCode} as categoryCode) t1
LEFT JOIN issue_project_category_dict cd ON (cd.CATEGORY_CODE = t1.categoryCode AND cd.CUSTOMER_ID = #{customerId} AND cd.DEL_FLAG = '0' )
</foreach>)t2
group by t2.categoryName
</select>
<resultMap id="selectCategoryNameByIssueListMap" type="com.epmet.dto.result.ResiBuzzIssueCategoryDTO">
<result property="issueId" column="issueId"/>
<collection property="cn" ofType="java.lang.String">
<result column="categoryName"/>
</collection>
</resultMap>
<select id="selectCategoryNameByIssueList" resultMap="selectCategoryNameByIssueListMap">
<foreach collection="issueIds" item="c" separator="UNION ALL">
SELECT
t1.issueId AS issueId,
IFNULL(cd.CATEGORY_NAME,'其他') as categoryName
FROM ( select #{c.issueId} as issueId,#{c.categoryCode} as categoryCode) t1
LEFT JOIN issue_project_category_dict cd ON (cd.CATEGORY_CODE = t1.categoryCode AND cd.DEL_FLAG = '0' AND cd.CUSTOMER_ID = #{customerId})
</foreach>
</select>
</mapper> </mapper>

39
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteDetailDao.xml

@ -181,4 +181,43 @@
</foreach> </foreach>
) )
</select> </select>
<!-- 查询客户下的议题表决日增 -->
<select id="statisticVote" resultType="com.epmet.dto.result.DailyStatisticalVoteJobResultDTO">
SELECT
vs.votable_count,
<if test="dateId == null">
(t.oppositionCount + t.supportCount) AS totalCount,
</if>
<if test="dateId != null">
(t.oppositionIncrement + t.supportIncrement) AS todayIncrement,
</if>
t.* FROM
(SELECT
vd.ISSUE_ID,
COUNT(CASE WHEN vd.ATTITUDE = 'opposition' THEN 1 END) AS oppositionCount,
COUNT(CASE WHEN vd.ATTITUDE = 'opposition' THEN 1 END) AS oppositionIncrement,
COUNT(CASE WHEN vd.ATTITUDE = 'support' THEN 1 END) AS supportCount,
COUNT(CASE WHEN vd.ATTITUDE = 'support' THEN 1 END) AS supportIncrement,
str_to_date(#{dateId},'%Y-%m-%d') AS statisticalDate
FROM issue_vote_detail vd
WHERE vd.DEL_FLAG = '0'
AND vd.CUSTOMER_ID = #{customerId}
<if test="dateId != null">
AND DATE_FORMAT(vd.CREATED_TIME,'%Y-%m-%d') = #{dateId}
</if>
GROUP BY vd.ISSUE_ID)t
INNER JOIN issue_vote_statistical vs ON (vs.ISSUE_ID = t.ISSUE_ID AND vs.DEL_FLAG = '0')
</select>
<!-- 根据议题ID查询折线图一天的数据 -->
<select id="polyLineData" resultType="com.epmet.dto.PolyLineDTO">
SELECT
COUNT(CASE WHEN vd.ATTITUDE = 'opposition' THEN 1 END) AS oppositionIncrement,
COUNT(CASE WHEN vd.ATTITUDE = 'support' THEN 1 END) AS supportIncrement
FROM issue_vote_detail vd
WHERE vd.DEL_FLAG = '0'
AND DATE_FORMAT(vd.CREATED_TIME,'%Y-%m-%d') = #{dateId}
AND ISSUE_ID = #{issueId}
</select>
</mapper> </mapper>

9
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteStatisticalDailyDao.xml

@ -280,4 +280,13 @@
id = #{item.id} id = #{item.id}
</foreach> </foreach>
</update> </update>
<!-- 删除历史数据 -->
<delete id="delHistoryData">
DELETE FROM issue_vote_statistical_daily
WHERE CUSTOMER_ID = #{customerId}
AND STATISTICAL_DATE = #{dateId}
LIMIT 1000
</delete>
</mapper> </mapper>

6
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteStatisticalDao.xml

@ -119,9 +119,9 @@
<select id="selectVoteDetail" resultType="com.epmet.dto.form.VoteRedisFormDTO"> <select id="selectVoteDetail" resultType="com.epmet.dto.form.VoteRedisFormDTO">
SELECT SELECT
ISSUE_ID, ISSUE_ID,
SUPPORT_COUNT, SUPPORT_COUNT AS supportAmount,
OPPOSITION_COUNT, OPPOSITION_COUNT AS oppositionAmount,
VOTABLE_COUNT VOTABLE_COUNT AS shouldVoteCount
FROM issue_vote_statistical FROM issue_vote_statistical
WHERE DEL_FLAG = '0' WHERE DEL_FLAG = '0'
AND ISSUE_ID = #{issueId} AND ISSUE_ID = #{issueId}

1
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java

@ -366,6 +366,7 @@ public class CustomerAgencyController {
*/ */
@PostMapping("agencygridtree") @PostMapping("agencygridtree")
public Result<AgencyTreeResultDTO> getOrgTreeData(@LoginUser TokenDto tokenDTO) { public Result<AgencyTreeResultDTO> getOrgTreeData(@LoginUser TokenDto tokenDTO) {
//tokenDTO.setUserId("dffe71e021a61b900f9025f4f07f6955");
return new Result<AgencyTreeResultDTO>().ok(customerAgencyService.getOrgTreeData(tokenDTO.getUserId())); return new Result<AgencyTreeResultDTO>().ok(customerAgencyService.getOrgTreeData(tokenDTO.getUserId()));
} }

59
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java

@ -58,6 +58,7 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
* @Description 组织首页-下级机关列表 * @Description 组织首页-下级机关列表
**/ **/
List<SubListResultDTO> selectSubAgencyById(@Param("pId") String pId, @Param("agencyNum") Integer agencyNum); List<SubListResultDTO> selectSubAgencyById(@Param("pId") String pId, @Param("agencyNum") Integer agencyNum);
List<SubListResultDTO> selectSubAgencyByAgencyId(@Param("pId") String pId); List<SubListResultDTO> selectSubAgencyByAgencyId(@Param("pId") String pId);
/** /**
@ -79,8 +80,8 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
CustomerAgencyEntity getAgencyByStaffId(@Param("staffId") String staffId); CustomerAgencyEntity getAgencyByStaffId(@Param("staffId") String staffId);
/** /**
* @Description 根据agencyId查询地区编码
* @param agencyId 所属机关id * @param agencyId 所属机关id
* @Description 根据agencyId查询地区编码
* @author zxc * @author zxc
* @date 2020/4/28 15:50 * @date 2020/4/28 15:50
*/ */
@ -104,6 +105,7 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
/** /**
* 查询客户根级组织 * 查询客户根级组织
*
* @param customerId * @param customerId
* @return * @return
*/ */
@ -111,10 +113,11 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
/** /**
* 获取所属机关单位名称上级-所属 * 获取所属机关单位名称上级-所属
* @author zhaoqifeng *
* @date 2020/5/22 17:53
* @param agencyId * @param agencyId
* @return java.lang.String * @return java.lang.String
* @author zhaoqifeng
* @date 2020/5/22 17:53
*/ */
String selectAgencyName(@Param("agencyId") String agencyId); String selectAgencyName(@Param("agencyId") String agencyId);
@ -127,46 +130,48 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
List<ArticleGridResultDTO> selectAllSubAgency(@Param("subAgencyPids") String subAgencyPids); List<ArticleGridResultDTO> selectAllSubAgency(@Param("subAgencyPids") String subAgencyPids);
/** /**
* @Description 查询一个工作人员最近登录的网格以及机关信息
* @param gridId * @param gridId
* @return * @return
* @Description 查询一个工作人员最近登录的网格以及机关信息
* @author wangc * @author wangc
* @date 2020.08.17 09:50 * @date 2020.08.17 09:50
**/ **/
ExtStaffInfoResultDTO selectAgencyAndGridInfoExt(@Param("gridId") String gridId); ExtStaffInfoResultDTO selectAgencyAndGridInfoExt(@Param("gridId") String gridId);
/** /**
* @Description 当没有工作人员最近访问的gridId时查询该用户所属的组织机关信息
* @param staffId * @param staffId
* @return * @return
* @Description 当没有工作人员最近访问的gridId时查询该用户所属的组织机关信息
* @author wangc * @author wangc
* @date 2020.08.17 09:50 * @date 2020.08.17 09:50
**/ **/
ExtStaffInfoResultDTO selectAgencyInfoWhenGridIdIsNull(@Param("staffId")String staffId); ExtStaffInfoResultDTO selectAgencyInfoWhenGridIdIsNull(@Param("staffId") String staffId);
/** /**
* @Description 根据agencyId查找指定机构的信息直属网格部门
* @param agencyId * @param agencyId
* @return * @return
* @Description 根据agencyId查找指定机构的信息直属网格部门
* @author wangc * @author wangc
* @date 2020.08.18 13:41 * @date 2020.08.18 13:41
**/ **/
ExtStaffPermissionResultDTO selectAgencyById(@Param("agencyId")String agencyId); ExtStaffPermissionResultDTO selectAgencyById(@Param("agencyId") String agencyId);
/** /**
* @Description 根绝agencyId查找其下属机构的信息
* @param pid * @param pid
* @return * @return
* @Description 根绝agencyId查找其下属机构的信息
* @author wangc * @author wangc
* @date 2020.08.18 13:42 * @date 2020.08.18 13:42
**/ **/
List<ExtStaffPermissionResultDTO> selectSubAgencyByPid(@Param("pid") String pid); List<ExtStaffPermissionResultDTO> selectSubAgencyByPid(@Param("pid") String pid);
/** /**
* @Description 根据agencyId查找指定机构直属的部门将grid与dept分开是因为grid与dept的数量可能不等造成重复数据无法去重
* @param agencyId * @param agencyId
* @return * @return
* @Description 根据agencyId查找指定机构直属的部门将grid与dept分开是因为grid与dept的数量可能不等造成重复数据无法去重
* @author wangc * @author wangc
* @date 2020.08.18 13:42 * @date 2020.08.18 13:42
**/ **/
List<ExtDeptResultDTO> selectDeptList(@Param("agencyId") String agencyId); List<ExtDeptResultDTO> selectDeptList(@Param("agencyId") String agencyId);
/** /**
@ -186,30 +191,33 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
AgencyResultDTO selectAgencyByStaffId(@Param("staffId") String staffId); AgencyResultDTO selectAgencyByStaffId(@Param("staffId") String staffId);
/** /**
* @Description 返回elementTree结构的agency树
* @param customerId * @param customerId
* @param pid * @param pid
* @return java.util.List<com.epmet.dto.result.AgencyElementTreeResultDTO.Agency> * @return java.util.List<com.epmet.dto.result.AgencyElementTreeResultDTO.Agency>
* @Description 返回elementTree结构的agency树
* @Author liushaowen * @Author liushaowen
* @Date 2020/11/6 14:57 * @Date 2020/11/6 14:57
*/ */
List<AgencyElementTreeResultDTO.Agency> getAgencyElementTree(@Param("customerId") String customerId,@Param("pid") String pid); List<AgencyElementTreeResultDTO.Agency> getAgencyElementTree(@Param("customerId") String customerId, @Param("pid") String pid);
/** /**
* @Description 外挂-获取当前组织及部门网格数据递归查询所有下级数据 * @Description 外挂-获取当前组织及部门网格数据递归查询所有下级数据
* @author sun * @author sun
**/ **/
OrganizeTreeResultDTO selectorganizeTree(@Param("agencyId") String agencyId); OrganizeTreeResultDTO selectorganizeTree(@Param("agencyId") String agencyId);
/** /**
* @Description 外挂-获取当前组织及部门网格数据递归查询所有下级数据 * @Description 外挂-获取当前组织及部门网格数据递归查询所有下级数据
* @author sun * @author sun
**/ **/
List<OrganizeTreeGridResultDTO> selectAgencyGridList(@Param("agencyId") String agencyId); List<OrganizeTreeGridResultDTO> selectAgencyGridList(@Param("agencyId") String agencyId);
/** /**
* @Description 外挂-获取当前组织及部门网格数据递归查询所有下级数据 * @Description 外挂-获取当前组织及部门网格数据递归查询所有下级数据
* @author sun * @author sun
**/ **/
List<OrganizeTreeDeptResultDTO> selectAgencyDeptList(@Param("agencyId") String agencyId); List<OrganizeTreeDeptResultDTO> selectAgencyDeptList(@Param("agencyId") String agencyId);
/** /**
* @Description 外挂-获取当前组织及部门网格数据递归查询所有下级数据 * @Description 外挂-获取当前组织及部门网格数据递归查询所有下级数据
* @author sun * @author sun
@ -236,6 +244,7 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
/** /**
* 根据新增人员类型判断查询机关信息 * 根据新增人员类型判断查询机关信息
*
* @author sun * @author sun
*/ */
OrgResultDTO selectAgencyDetail(@Param("orgId") String orgId, @Param("orgType") String orgType); OrgResultDTO selectAgencyDetail(@Param("orgId") String orgId, @Param("orgType") String orgType);
@ -247,40 +256,46 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
List<StaffOrgsResultDTO> getStaffOrgListByStaffId(@Param("staffId") String staffId); List<StaffOrgsResultDTO> getStaffOrgListByStaffId(@Param("staffId") String staffId);
/** /**
* @Description 地图配置删除
* @param orgId * @param orgId
* @param level * @param level
* @Description 地图配置删除
* @author zxc * @author zxc
* @date 2021/10/25 9:39 上午 * @date 2021/10/25 9:39 上午
*/ */
void delMapArea(@Param("orgId") String orgId, @Param("level") String level); void delMapArea(@Param("orgId") String orgId, @Param("level") String level);
/** /**
* @Description 地图配置新增
* @param orgId * @param orgId
* @param level * @param level
* @param coordinates * @param coordinates
* @Description 地图配置新增
* @author zxc * @author zxc
* @date 2021/10/25 9:59 上午 * @date 2021/10/25 9:59 上午
*/ */
void addMapArea(@Param("orgId") String orgId, @Param("level") String level,@Param("coordinates")String coordinates); void addMapArea(@Param("orgId") String orgId, @Param("level") String level, @Param("coordinates") String coordinates);
/** /**
* @Description 地图查询下级组织
* @param pid * @param pid
* @param type * @param type
* @Description 地图查询下级组织
* @author zxc * @author zxc
* @date 2021/10/25 2:30 下午 * @date 2021/10/25 2:30 下午
*/ */
List<MapSonOrgResultDTO> selectSonOrg(@Param("pid")String pid,@Param("type")String type); List<MapSonOrgResultDTO> selectSonOrg(@Param("pid") String pid, @Param("type") String type);
/** /**
* @Description 查询下级agencyId
* @param orgId * @param orgId
* @Description 查询下级agencyId
* @author zxc * @author zxc
* @date 2021/12/9 4:42 下午 * @date 2021/12/9 4:42 下午
*/ */
List<String> getSonAgencyId(@Param("orgId") String orgId); List<String> getSonAgencyId(@Param("orgId") String orgId);
/**
* desc:获取组织和网格的数据 树形sql
* @param agencyId
* @return
*/
ExtStaffPermissionResultDTO selectAgencyAndGridById(@Param("agencyId") String agencyId);
} }

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

@ -16,6 +16,7 @@
*/ */
package com.epmet.service.impl; package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
@ -24,6 +25,8 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.CustomerAgencyConstant; import com.epmet.constant.CustomerAgencyConstant;
@ -81,6 +84,8 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
private EpmetUserFeignClient epmetUserFeignClient; private EpmetUserFeignClient epmetUserFeignClient;
@Autowired @Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private RedisUtils redisUtils;
@Override @Override
public PageData<CustomerAgencyDTO> page(Map<String, Object> params) { public PageData<CustomerAgencyDTO> page(Map<String, Object> params) {
@ -1122,8 +1127,17 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
result.setOrgLevel(rootAgency.getAgencyId().concat("-").concat(rootAgency.getLevel())); result.setOrgLevel(rootAgency.getAgencyId().concat("-").concat(rootAgency.getLevel()));
result.setLongitude(rootAgency.getLongitude()); result.setLongitude(rootAgency.getLongitude());
result.setLatitude(rootAgency.getLatitude()); result.setLatitude(rootAgency.getLatitude());
ExtStaffPermissionResultDTO res = baseDao.selectAgencyById(rootAgency.getAgencyId());
convert2AgencyTreeResult(result,res.getSubAgencyList(),res.getGridList()); String orgTreeCacheKey = RedisKeys.getOrgTreeCacheKey(rootAgency.getAgencyId());
Object o = redisUtils.get(orgTreeCacheKey);
if (o == null){
ExtStaffPermissionResultDTO res = baseDao.selectAgencyAndGridById(rootAgency.getAgencyId());
convert2AgencyTreeResult(result,res.getSubAgencyList(),res.getGridList());
redisUtils.set(orgTreeCacheKey,result, RedisUtils.MINUTE_THIRTY_EXPIRE);
}else {
result = (AgencyTreeResultDTO) o;
}
return result; return result;
} }
/** /**
@ -1193,4 +1207,4 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
public List<StaffOrgsResultDTO> getStaffOrgListByStaffId(String staffId) { public List<StaffOrgsResultDTO> getStaffOrgListByStaffId(String staffId) {
return baseDao.getStaffOrgListByStaffId(staffId); return baseDao.getStaffOrgListByStaffId(staffId);
} }
} }

34
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -308,6 +308,26 @@
</collection> </collection>
</resultMap> </resultMap>
<resultMap id="agencyAndGridMap" type="com.epmet.dto.result.ExtStaffPermissionResultDTO">
<id column="agencyId" property="agencyId" />
<result column="agencyName" property="agencyName"/>
<result column="level" property="level" />
<result column="longitude" property="longitude" />
<result column="latitude" property="latitude" />
<result column="customerId" property="customerId"/>
<collection property="gridList" column="agencyId" ofType="com.epmet.dto.result.ExtGridResultDTO" select="selectGridList">
<id column="gridId" property="gridId" />
<result column="gridName" property="gridName" />
<result column="customerId" property="customerId"/>
<result column="longitude" property="longitude" />
<result column="latitude" property="latitude" />
</collection>
<collection property="subAgencyList" column="agencyId"
ofType="com.epmet.dto.result.ExtStaffPermissionResultDTO" select="selectSubAgencyByPid">
</collection>
</resultMap>
<select id="selectAgencyById" resultMap="treeMap"> <select id="selectAgencyById" resultMap="treeMap">
SELECT SELECT
@ -677,5 +697,19 @@
DEL_FLAG = '0' DEL_FLAG = '0'
AND PID = #{orgId} AND PID = #{orgId}
</select> </select>
<select id="selectAgencyAndGridById" resultMap="agencyAndGridMap">
SELECT
agency.ID AS agencyId,
agency.ORGANIZATION_NAME AS agencyName,
agency.LEVEL AS level,
agency.CUSTOMER_ID as customerId,
agency.longitude,
agency.latitude
FROM
CUSTOMER_AGENCY agency
WHERE
agency.DEL_FLAG = '0'
AND agency.ID = #{agencyId}
</select>
</mapper> </mapper>

30
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/EventController.java

@ -1,30 +0,0 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.EventListFormDTO;
import com.epmet.dto.form.UpdateViewTimeFormDTO;
import com.epmet.dto.result.EventListResultDTO;
import com.epmet.service.ResiEventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 居民报事表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-03
*/
@RestController
@RequestMapping("event")
public class EventController {
@Autowired
private ResiEventService resiEventService;
}

2
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java

@ -99,7 +99,7 @@ public class ProjectTraceController {
* @date 2020/5/11 16:25 * @date 2020/5/11 16:25
*/ */
@PostMapping("projectdetail") @PostMapping("projectdetail")
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PROJECT_TRACE_DETAIL) //@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PROJECT_TRACE_DETAIL)
public Result<ProjectDetailResultDTO> getProjectDetail(@LoginUser TokenDto tokenDto, @RequestBody ProjectDetailFromDTO fromDTO) { public Result<ProjectDetailResultDTO> getProjectDetail(@LoginUser TokenDto tokenDto, @RequestBody ProjectDetailFromDTO fromDTO) {
ProjectDetailResultDTO result = projectTraceService.getProjectDetail(tokenDto, fromDTO); ProjectDetailResultDTO result = projectTraceService.getProjectDetail(tokenDto, fromDTO);
return new Result<ProjectDetailResultDTO>().ok(result); return new Result<ProjectDetailResultDTO>().ok(result);

6
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventController.java

@ -18,6 +18,7 @@
package com.epmet.controller; package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
@ -77,6 +78,7 @@ public class ResiEventController {
* @author yinzuomei * @author yinzuomei
* @date 2021/8/3 10:46 * @date 2021/8/3 10:46
*/ */
@NoRepeatSubmit
@PostMapping("report") @PostMapping("report")
public Result<ResiEventIdDTO> report(@LoginUser TokenDto tokenDto, @RequestBody ResiEventFormDTO formDTO) { public Result<ResiEventIdDTO> report(@LoginUser TokenDto tokenDto, @RequestBody ResiEventFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
@ -93,6 +95,7 @@ public class ResiEventController {
* @author yinzuomei * @author yinzuomei
* @date 2021/8/3 10:54 * @date 2021/8/3 10:54
*/ */
@NoRepeatSubmit
@PostMapping("recall") @PostMapping("recall")
public Result recall(@LoginUser TokenDto tokenDto, @RequestBody ReCallEventFormDTO formDTO) { public Result recall(@LoginUser TokenDto tokenDto, @RequestBody ReCallEventFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
@ -205,6 +208,7 @@ public class ResiEventController {
* @author yinzuomei * @author yinzuomei
* @date 2021/8/5 10:47 * @date 2021/8/5 10:47
*/ */
@NoRepeatSubmit
@PostMapping("close") @PostMapping("close")
public Result closeResiEvent(@LoginUser TokenDto tokenDto, @RequestBody CloseResiEventFormDTO formDTO) { public Result closeResiEvent(@LoginUser TokenDto tokenDto, @RequestBody CloseResiEventFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId()); formDTO.setUserId(tokenDto.getUserId());
@ -254,4 +258,4 @@ public class ResiEventController {
ValidatorUtils.validateEntity(formDTO,ResiEventResearchAnalysisFormDTO.AddUserInternalGroup.class); ValidatorUtils.validateEntity(formDTO,ResiEventResearchAnalysisFormDTO.AddUserInternalGroup.class);
return new Result<ResiEventResearchAnalysisResDTO>().ok(resiEventService.queryResiEventResearchAnalysis(formDTO)); return new Result<ResiEventResearchAnalysisResDTO>().ok(resiEventService.queryResiEventResearchAnalysis(formDTO));
} }
} }

24
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventReplyController.java

@ -18,6 +18,7 @@
package com.epmet.controller; package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
@ -43,7 +44,7 @@ import java.util.List;
@RestController @RestController
@RequestMapping("resieventreply") @RequestMapping("resieventreply")
public class ResiEventReplyController { public class ResiEventReplyController {
@Autowired @Autowired
private ResiEventReplyService resiEventReplyService; private ResiEventReplyService resiEventReplyService;
@ -62,13 +63,14 @@ public class ResiEventReplyController {
/** /**
* 报事-工作人员回复 * 报事-工作人员回复
* *
* @param tokenDto * @param tokenDto
* @param replyFormDTO * @param replyFormDTO
* @return com.epmet.commons.tools.utils.Result * @return com.epmet.commons.tools.utils.Result
* @author yinzuomei * @author yinzuomei
* @date 2021/8/4 14:19 * @date 2021/8/4 14:19
*/ */
@NoRepeatSubmit
@PostMapping("govReply") @PostMapping("govReply")
public Result govReply(@LoginUser TokenDto tokenDto,@RequestBody ReplyFormDTO replyFormDTO){ public Result govReply(@LoginUser TokenDto tokenDto,@RequestBody ReplyFormDTO replyFormDTO){
replyFormDTO.setUserId(tokenDto.getUserId()); replyFormDTO.setUserId(tokenDto.getUserId());
@ -79,13 +81,14 @@ public class ResiEventReplyController {
/** /**
* 报事当事人回复 * 报事当事人回复
* *
* @param tokenDto * @param tokenDto
* @param formDTO * @param formDTO
* @return com.epmet.commons.tools.utils.Result * @return com.epmet.commons.tools.utils.Result
* @author yinzuomei * @author yinzuomei
* @date 2021/8/4 14:37 * @date 2021/8/4 14:37
*/ */
@NoRepeatSubmit
@PostMapping("selfReply") @PostMapping("selfReply")
public Result selfReply(@LoginUser TokenDto tokenDto,@RequestBody ReplyFormDTO formDTO){ public Result selfReply(@LoginUser TokenDto tokenDto,@RequestBody ReplyFormDTO formDTO){
formDTO.setUserId(tokenDto.getUserId()); formDTO.setUserId(tokenDto.getUserId());
@ -103,6 +106,7 @@ public class ResiEventReplyController {
* @author yinzuomei * @author yinzuomei
* @date 2021/8/4 15:06 * @date 2021/8/4 15:06
*/ */
@NoRepeatSubmit
@PostMapping("atReply") @PostMapping("atReply")
public Result atReply(@LoginUser TokenDto tokenDto,@RequestBody ReplyFormDTO formDTO){ public Result atReply(@LoginUser TokenDto tokenDto,@RequestBody ReplyFormDTO formDTO){
formDTO.setUserId(tokenDto.getUserId()); formDTO.setUserId(tokenDto.getUserId());
@ -110,4 +114,4 @@ public class ResiEventReplyController {
resiEventReplyService.atReply(formDTO); resiEventReplyService.atReply(formDTO);
return new Result(); return new Result();
} }
} }

2
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridDailyworkController.java

@ -50,7 +50,7 @@ public class BaseGridDailyworkController {
@PostMapping("sync") @PostMapping("sync")
public Result getStaffBaseInfo(@RequestBody(required = false) UpsertPatrolRecordForm formDTO) { public Result getStaffBaseInfo(@RequestBody(required = false) UpsertPatrolRecordForm formDTO) {
ValidatorUtils.validateEntity(formDTO, DefaultGroup.class); ValidatorUtils.validateEntity(formDTO, DefaultGroup.class);
baseGridDailyworkService.insertPatrolRecord(formDTO); baseGridDailyworkService.insertBaseGridWorkRecord(formDTO);
return new Result(); return new Result();
} }

4
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseGridDailyworkEntity.java

@ -103,12 +103,12 @@ public class BaseGridDailyworkEntity implements Serializable {
/** /**
* 重点人员是否在当地-当事件类型为特殊人群服务与管理时必填 * 重点人员是否在当地-当事件类型为特殊人群服务与管理时必填
*/ */
private String isKeyPeopleLocate; private String isKeypeopleLocate;
/** /**
* 重点人员现状 * 重点人员现状
*/ */
private String keyPeopleStatus; private String keypeopleStatus;
/** /**
* 发生地 * 发生地

4
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java

@ -3,6 +3,7 @@ package com.epmet.opendata.mq.listener;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.epmet.commons.rocketmq.constants.MQUserPropertys; import com.epmet.commons.rocketmq.constants.MQUserPropertys;
import com.epmet.commons.rocketmq.messages.StaffPatrolMQMsg; import com.epmet.commons.rocketmq.messages.StaffPatrolMQMsg;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.distributedlock.DistributedLock; import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.ExceptionUtils;
@ -53,6 +54,7 @@ public class OpenDataPatrolChangeEventListener implements MessageListenerConcurr
} }
try { try {
Thread.sleep(NumConstant.ONE_THOUSAND);
msgs.forEach(this::consumeMessage); msgs.forEach(this::consumeMessage);
} catch (Exception e) { } catch (Exception e) {
logger.error(ExceptionUtils.getErrorStackTrace(e)); logger.error(ExceptionUtils.getErrorStackTrace(e));
@ -96,7 +98,7 @@ public class OpenDataPatrolChangeEventListener implements MessageListenerConcurr
aBoolean = SpringContextUtils.getBean(UserPatrolRecordService.class).updatePatrolRecord(patrolRecordForm); aBoolean = SpringContextUtils.getBean(UserPatrolRecordService.class).updatePatrolRecord(patrolRecordForm);
break; break;
case SystemMessageType.PATROL_ROUTINE_WORK_ADD: case SystemMessageType.PATROL_ROUTINE_WORK_ADD:
aBoolean = SpringContextUtils.getBean(BaseGridDailyworkService.class).insertPatrolRecord(patrolRecordForm); aBoolean = SpringContextUtils.getBean(BaseGridDailyworkService.class).insertBaseGridWorkRecord(patrolRecordForm);
break; break;
default: default:
log.error("错误的消息类型:{}", tags); log.error("错误的消息类型:{}", tags);

2
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseGridDailyworkService.java

@ -34,7 +34,7 @@ public interface BaseGridDailyworkService extends BaseService<BaseGridDailyworkE
* @param patrolRecordForm * @param patrolRecordForm
* @return * @return
*/ */
Boolean insertPatrolRecord(UpsertPatrolRecordForm patrolRecordForm); Boolean insertBaseGridWorkRecord(UpsertPatrolRecordForm patrolRecordForm);
/** /**
* desc重新加载数据 * desc重新加载数据

14
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridDailyworkServiceImpl.java

@ -21,6 +21,8 @@ import com.alibaba.fastjson.JSON;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.AddGroup;
@ -64,14 +66,14 @@ public class BaseGridDailyworkServiceImpl extends BaseServiceImpl<BaseGridDailyw
private ExUserService exUserService; private ExUserService exUserService;
@Override @Override
public Boolean insertPatrolRecord(UpsertPatrolRecordForm patrolRecordForm) { public Boolean insertBaseGridWorkRecord(UpsertPatrolRecordForm patrolRecordForm) {
log.info("upsertPatrolRecord param:{}", JSON.toJSONString(patrolRecordForm)); log.info("insertBaseGridWorkRecord param:{}", JSON.toJSONString(patrolRecordForm));
ValidatorUtils.validateEntity(patrolRecordForm, AddGroup.class); ValidatorUtils.validateEntity(patrolRecordForm, AddGroup.class);
PatrolQueryFormDTO midPatrolFormDTO = buildParam(patrolRecordForm); PatrolQueryFormDTO midPatrolFormDTO = buildParam(patrolRecordForm);
Result<List<PatrolRoutineWorkResult>> record = epmetUserOpenFeignClient.getPatrolRoutineWorkList(midPatrolFormDTO); Result<List<PatrolRoutineWorkResult>> record = epmetUserOpenFeignClient.getPatrolRoutineWorkList(midPatrolFormDTO);
if (record == null || !record.success()) { if (record == null || !record.success()) {
log.error("获取例行工作记录失败,param:{}", JSON.toJSONString(midPatrolFormDTO)); log.error("获取例行工作记录失败,param:{}", JSON.toJSONString(midPatrolFormDTO));
return false; throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode());
} }
Map<String, ExDeptDTO> deptMap = exDeptService.getDeptDTOMap(patrolRecordForm.getCustomerId()); Map<String, ExDeptDTO> deptMap = exDeptService.getDeptDTOMap(patrolRecordForm.getCustomerId());
Map<String, ExUserDTO> userMap = exUserService.getUserDTOMap(patrolRecordForm.getCustomerId()); Map<String, ExUserDTO> userMap = exUserService.getUserDTOMap(patrolRecordForm.getCustomerId());
@ -82,7 +84,7 @@ public class BaseGridDailyworkServiceImpl extends BaseServiceImpl<BaseGridDailyw
log.error("获取例行工作记录返回为空,param:{}", JSON.toJSONString(midPatrolFormDTO)); log.error("获取例行工作记录返回为空,param:{}", JSON.toJSONString(midPatrolFormDTO));
int effectRow = baseDao.deleteById(patrolRecordForm.getId()); int effectRow = baseDao.deleteById(patrolRecordForm.getId());
log.warn("del effectRow:{}", effectRow); log.warn("del effectRow:{}", effectRow);
return true; throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode());
} }
insertRecordBatch(data, deptMap, userMap); insertRecordBatch(data, deptMap, userMap);
return true; return true;
@ -152,10 +154,10 @@ public class BaseGridDailyworkServiceImpl extends BaseServiceImpl<BaseGridDailyw
Integer isKeyPeopleLocate = record.getIsKeyPeopleLocate(); Integer isKeyPeopleLocate = record.getIsKeyPeopleLocate();
if (isKeyPeopleLocate != null){ if (isKeyPeopleLocate != null){
entity.setIsKeyPeopleLocate(isKeyPeopleLocate == NumConstant.ONE ?"Y":"N"); entity.setIsKeypeopleLocate(isKeyPeopleLocate == NumConstant.ONE ?"Y":"N");
} }
entity.setKeyPeopleStatus(record.getKeyPeopleStatus()); entity.setKeypeopleStatus(record.getKeyPeopleStatus());
entity.setHappenPlace(record.getAddress()); entity.setHappenPlace(record.getAddress());
entity.setLng(record.getLongitude()); entity.setLng(record.getLongitude());
entity.setLat(record.getLatitude()); entity.setLat(record.getLatitude());

18
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/UserPatrolRecordServiceImpl.java

@ -21,6 +21,8 @@ import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.user.param.MidPatrolFormDTO; import com.epmet.dto.user.param.MidPatrolFormDTO;
@ -64,17 +66,17 @@ public class UserPatrolRecordServiceImpl extends BaseServiceImpl<UserPatrolRecor
MidPatrolFormDTO midPatrolFormDTO = buildParam(patrolRecordForm); MidPatrolFormDTO midPatrolFormDTO = buildParam(patrolRecordForm);
Result<List<MidPatrolRecordResult>> record = dataStatisticalOpenFeignClient.getPatrolRecordList(midPatrolFormDTO); Result<List<MidPatrolRecordResult>> record = dataStatisticalOpenFeignClient.getPatrolRecordList(midPatrolFormDTO);
if (record == null || !record.success()) { if (record == null || !record.success()) {
log.error("获取巡查记录失败,param:{}", JSON.toJSONString(midPatrolFormDTO)); log.error("insertPatrolRecord 获取巡查记录失败,param:{}", JSON.toJSONString(midPatrolFormDTO));
return false; throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode());
} }
List<MidPatrolRecordResult> data = record.getData(); List<MidPatrolRecordResult> data = record.getData();
if (CollectionUtils.isEmpty(data)) { if (CollectionUtils.isEmpty(data)) {
//数据已被删除了 //数据已被删除了
//暂时设置error 用于排错 //暂时设置error 用于排错
log.error("获取巡查记录返回为空,param:{}", JSON.toJSONString(midPatrolFormDTO)); log.error("insertPatrolRecord获取巡查记录返回为空,param:{}", JSON.toJSONString(midPatrolFormDTO));
int effectRow = baseDao.deleteById(patrolRecordForm.getId()); int effectRow = baseDao.deleteById(patrolRecordForm.getId());
log.warn("del effectRow:{}", effectRow); log.warn("del effectRow:{}", effectRow);
return true; throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode());
} }
List<UserPatrolRecordEntity> insertList = new ArrayList<>(); List<UserPatrolRecordEntity> insertList = new ArrayList<>();
data.forEach(o-> insertList.add(buildEntity(o))); data.forEach(o-> insertList.add(buildEntity(o)));
@ -94,17 +96,17 @@ public class UserPatrolRecordServiceImpl extends BaseServiceImpl<UserPatrolRecor
MidPatrolFormDTO midPatrolFormDTO = buildParam(patrolRecordForm); MidPatrolFormDTO midPatrolFormDTO = buildParam(patrolRecordForm);
Result<List<MidPatrolRecordResult>> record = dataStatisticalOpenFeignClient.getPatrolRecordList(midPatrolFormDTO); Result<List<MidPatrolRecordResult>> record = dataStatisticalOpenFeignClient.getPatrolRecordList(midPatrolFormDTO);
if (record == null || !record.success()) { if (record == null || !record.success()) {
log.error("获取巡查记录失败,param:{}", JSON.toJSONString(midPatrolFormDTO)); log.error("updatePatrolRecord 获取巡查记录失败,param:{}", JSON.toJSONString(midPatrolFormDTO));
return false; throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode());
} }
List<MidPatrolRecordResult> data = record.getData(); List<MidPatrolRecordResult> data = record.getData();
if (CollectionUtils.isEmpty(data)) { if (CollectionUtils.isEmpty(data)) {
//数据已被删除了 //数据已被删除了
//暂时设置error 用于排错 //暂时设置error 用于排错
log.error("获取巡查记录返回为空,param:{}", JSON.toJSONString(midPatrolFormDTO)); log.error("updatePatrolRecord 获取巡查记录返回为空,param:{}", JSON.toJSONString(midPatrolFormDTO));
int effectRow = baseDao.deleteById(patrolRecordForm.getId()); int effectRow = baseDao.deleteById(patrolRecordForm.getId());
log.warn("del effectRow:{}", effectRow); log.warn("del effectRow:{}", effectRow);
return true; throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode());
} }
data.forEach(o->{ data.forEach(o->{
UserPatrolRecordEntity recordEntity = buildEntity(o); UserPatrolRecordEntity recordEntity = buildEntity(o);

4
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseGridDailyworkDao.xml

@ -17,8 +17,8 @@
<result property="keyAreaType" column="KEY_AREA_TYPE"/> <result property="keyAreaType" column="KEY_AREA_TYPE"/>
<result property="regionScale" column="REGION_SCALE"/> <result property="regionScale" column="REGION_SCALE"/>
<result property="isKeyareaState" column="IS_KEYAREA_STATE"/> <result property="isKeyareaState" column="IS_KEYAREA_STATE"/>
<result property="isKeyPeopleLocate" column="IS_KEY_PEOPLE_LOCATE"/> <result property="isKeypeopleLocate" column="IS_KEY_PEOPLE_LOCATE"/>
<result property="keyPeopleStatus" column="KEY_PEOPLE_STATUS"/> <result property="keypeopleStatus" column="KEY_PEOPLE_STATUS"/>
<result property="happenPlace" column="HAPPEN_PLACE"/> <result property="happenPlace" column="HAPPEN_PLACE"/>
<result property="lng" column="LNG"/> <result property="lng" column="LNG"/>
<result property="lat" column="LAT"/> <result property="lat" column="LAT"/>

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

@ -28,6 +28,8 @@ public class VolunteerDistributionResultDTO {
@Data @Data
public static class Distribution { public static class Distribution {
private Set<String> volunteerCategories; private Set<String> volunteerCategories;
private String volunteerCategoriesStr;
private String buildingId;
private String epmetUserId; private String epmetUserId;
private String icResiUserId; private String icResiUserId;
private String longitude; private String longitude;

2
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -688,6 +688,6 @@ public interface EpmetUserOpenFeignClient {
* @param patrolQueryFormDTO * @param patrolQueryFormDTO
* @return * @return
*/ */
@PostMapping(value = "//epmetuser/patrolroutinework/selectList") @PostMapping(value = "/epmetuser/patrolroutinework/selectList")
Result<List<PatrolRoutineWorkResult>> getPatrolRoutineWorkList(@RequestBody PatrolQueryFormDTO patrolQueryFormDTO); Result<List<PatrolRoutineWorkResult>> getPatrolRoutineWorkList(@RequestBody PatrolQueryFormDTO patrolQueryFormDTO);
} }

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

@ -226,4 +226,6 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
*/ */
List<PartyMemberEducationResultDTO> getPartyMemberEducationList(@Param("orgType") String orgType, @Param("orgId") String orgId, List<PartyMemberEducationResultDTO> getPartyMemberEducationList(@Param("orgType") String orgType, @Param("orgId") String orgId,
@Param("code") String code); @Param("code") String code);
List<VolunteerDistributionResultDTO.Distribution> listIcResiInfosByUserIds(@Param("userIds") List<String> userIds);
} }

90
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridUserWorkEntity.java

@ -1,90 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 网格员例行工作
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-19
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("patrol_routine_work")
public class GridUserWorkEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
* gridId的PID
*/
private String pids;
/**
* 用户Id user.id 谁创建的
*/
private String userId;
/**
* 事项名称
*/
private String title;
/**
* 发生日期 格式为YYYY-MM-DD
*/
private Date happenTime;
/**
* 有无变动异常10
*/
private Integer isNormal;
/**
* 备注说明
*/
private String workContent;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
}

189
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java

@ -2,25 +2,30 @@ package com.epmet.service.impl;
import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.dao.IcResiUserDao; import com.epmet.dao.IcResiUserDao;
import com.epmet.dao.UserBaseInfoDao; import com.epmet.dao.UserBaseInfoDao;
import com.epmet.dto.IcBuildingDTO; import com.epmet.dto.IcBuildingDTO;
import com.epmet.dto.IcFormItemOptionsDTO; import com.epmet.dto.IcFormItemOptionsDTO;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.form.IcFormOptionsQueryFormDTO; import com.epmet.dto.form.IcFormOptionsQueryFormDTO;
import com.epmet.dto.form.resi.VolunteerCommonFormDTO; import com.epmet.dto.form.resi.VolunteerCommonFormDTO;
import com.epmet.dto.result.ResiUserBaseInfoResultDTO;
import com.epmet.dto.result.VolunteerDistributionResultDTO; import com.epmet.dto.result.VolunteerDistributionResultDTO;
import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO; import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO;
import com.epmet.feign.EpmetHeartOpenFeignClient; import com.epmet.feign.EpmetHeartOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.feign.OperCustomizeOpenFeignClient;
import com.epmet.service.VolunteerService; import com.epmet.service.VolunteerService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.google.common.collect.Lists;
import java.util.*; import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -29,6 +34,7 @@ import java.util.stream.Collectors;
* @Date 2021/12/10 5:48 下午 * @Date 2021/12/10 5:48 下午
* @Version 1.0 * @Version 1.0
*/ */
@Slf4j
@Service @Service
public class VolunteerServiceImpl implements VolunteerService, ResultDataResolver { public class VolunteerServiceImpl implements VolunteerService, ResultDataResolver {
@ -90,91 +96,154 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve
* @return * @return
*/ */
public VolunteerDistributionResultDTO getVolunteerDistribution(String customerId) { public VolunteerDistributionResultDTO getVolunteerDistribution(String customerId) {
//epmetHeartOpenFeignClient.queryVolunteerPage() VolunteerDistributionResultDTO r = new VolunteerDistributionResultDTO();
// 1.分页查询出所有志愿者列表
int pageNo = 1;
int pageSize = 100;
// 志愿者epmet user id // 1.==========分页查询出所有志愿者列表==========
Set<String> volunteerEpmetUserIds = new HashSet<>();
// 分页查询志愿者的epmet user id String vcErrorMsg = "【志愿者分布】查询志愿者总数出错";
while (true) { VolunteerCommonFormDTO volunteerCountForm = new VolunteerCommonFormDTO();
volunteerCountForm.setCustomerId(customerId);
VolunteerCommonFormDTO volunteerForm = new VolunteerCommonFormDTO(); Integer volunteerCount = getResultDataOrThrowsException(epmetHeartOpenFeignClient.getVolunteerCount(volunteerCountForm),
volunteerForm.setCustomerId(customerId); ServiceConstant.EPMET_HEART_SERVER,
volunteerForm.setPageNo(pageNo); EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
volunteerForm.setPageSize(pageSize); vcErrorMsg,
vcErrorMsg);
String errorMsg = "【志愿者分布】分页查询志愿者列表失败";
List<PageVolunteerInfoResultDTO> volunteerPage = getResultDataOrThrowsException(epmetHeartOpenFeignClient.queryVolunteerPage(volunteerForm), if (volunteerCount == null || volunteerCount == 0) {
ServiceConstant.EPMET_HEART_SERVER, // 没得志愿者,直接返回
EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), return r;
errorMsg,
errorMsg);
// 将本页userId添加到总集中去
volunteerEpmetUserIds.addAll(volunteerPage.stream().map(v -> v.getUserId()).collect(Collectors.toSet()));
if (volunteerPage.size() < pageSize) {
// 说明是最后一页了
break;
}
pageNo++;
} }
// 计算页数
int pageSize = 200;
int pageCount = volunteerCount / pageSize;
int lastPageItems = volunteerCount % pageSize;
pageCount = lastPageItems > 0 ? ++pageCount : pageCount;
VolunteerDistributionResultDTO r = new VolunteerDistributionResultDTO(); // 志愿者epmet user id 集合
List<String> volunteerEpmetUserIds = new ArrayList<>();
// 分页查询志愿者的epmet user id
List<CompletableFuture<Set<String>>> volsPageFutures = new ArrayList<>();
for (int pageNo = 1 ; pageNo <= pageCount ; pageNo ++) {
int pageNoTemp = pageNo;
CompletableFuture<Set<String>> future = CompletableFuture.supplyAsync(() -> {
return listVolunteersByPage(customerId, pageNoTemp, pageSize)
.stream()
.map(v -> v.getUserId())
.collect(Collectors.toSet());
});
// 2.填充ic居民信息 volsPageFutures.add(future);
for (String volunteerEpmetUserId : volunteerEpmetUserIds) { }
VolunteerDistributionResultDTO.Distribution distribution = new VolunteerDistributionResultDTO.Distribution(); // 阻塞,等待子线程返回结果,然后添加到志愿者userId集合中去
for (CompletableFuture<Set<String>> future : volsPageFutures) {
try {
volunteerEpmetUserIds.addAll(future.get());
} catch (InterruptedException e) {
log.error("【志愿者分布】异步获取志愿者userId列表被中断:{}", ExceptionUtils.getErrorStackTrace(e));
} catch (ExecutionException e) {
log.error("【志愿者分布】异步获取志愿者userId列表失败:{}", ExceptionUtils.getErrorStackTrace(e));
}
}
log.info("【志愿者分布】查询到志愿者userId公{}个", volunteerEpmetUserIds.size());
// 2.==========异步填充ic居民信息==========
List<CompletableFuture<List<VolunteerDistributionResultDTO.Distribution>>> volResiInfoFutures = new ArrayList<>();
// 将所有的userId按100固定分割成多个部分,循环用每个部分去查询,然后填充
List<List<String>> volunteerEpmetUserIdParts = Lists.partition(volunteerEpmetUserIds, 100);
for (List<String> volunteerEpmetUserIdPart : volunteerEpmetUserIdParts) {
log.info("【志愿者分布】查询ic居民信息,切割后,本组的userId个数:{}", volunteerEpmetUserIdPart.size());
CompletableFuture<List<VolunteerDistributionResultDTO.Distribution>> future = CompletableFuture.supplyAsync(() -> {
return listIcResiInfosByUserIds(volunteerEpmetUserIdPart);
});
ResiUserBaseInfoResultDTO userBaseInfo = userBaseInfoDao.selecUserBaseInfoByUserId(volunteerEpmetUserId); volResiInfoFutures.add(future);
}
//使用身份证号查询ic resi信息 // 阻塞的,获取各个子线程计算结果
IcResiUserDTO icResiUserInfo = icResiUserDao.selectIdByIdCard(customerId, userBaseInfo.getIdNum(), null); for (CompletableFuture<List<VolunteerDistributionResultDTO.Distribution>> volResiInfoFuture : volResiInfoFutures) {
if (icResiUserInfo == null) { try {
continue; List<VolunteerDistributionResultDTO.Distribution> distributions = volResiInfoFuture.get();
r.getDistributions().addAll(distributions);
} catch (InterruptedException e) {
log.error("【志愿者分布】异步获取志愿者的居民信息被中断:{}", ExceptionUtils.getErrorStackTrace(e));
} catch (ExecutionException e) {
log.error("【志愿者分布】异步获取志愿者的居民信息失败:{}", ExceptionUtils.getErrorStackTrace(e));
} }
}
// 查询志愿者类别 return r;
List<String> volunteerCategories = icResiUserDao.selectVolunteerByUserId(icResiUserInfo.getId()); }
//if (CollectionUtils.isEmpty(volunteerCategories)) {
// // 此人没有志愿者信息 /**
// continue; * userId列表批量获取他们对应的志愿者信息
//} * @param volunteerEpmetUserIdPart
* @return
*/
private List<VolunteerDistributionResultDTO.Distribution> listIcResiInfosByUserIds(List<String> volunteerEpmetUserIdPart) {
List<VolunteerDistributionResultDTO.Distribution> icResiInfos = icResiUserDao.listIcResiInfosByUserIds(volunteerEpmetUserIdPart);
// 填充志愿者类型
for (VolunteerDistributionResultDTO.Distribution icResiInfo : icResiInfos) {
// 将志愿者类型列表字符串,切割放到set中 // 将志愿者类型列表字符串,切割放到set中
Set<String> volunteerTypes = new HashSet(); Set<String> volunteerTypes = new HashSet();
for (String vTypesString : volunteerCategories) { String volunteerCategoriesStr = icResiInfo.getVolunteerCategoriesStr();
String[] vTypes = vTypesString.split(",");
if (StringUtils.isNotEmpty(volunteerCategoriesStr)) {
String[] vTypes = volunteerCategoriesStr.split(",");
if (vTypes != null && vTypes.length > 0) { if (vTypes != null && vTypes.length > 0) {
volunteerTypes.addAll(Arrays.asList(vTypes)); volunteerTypes.addAll(Arrays.asList(vTypes));
} }
icResiInfo.setVolunteerCategories(volunteerTypes);
} else {
icResiInfo.setVolunteerCategories(new HashSet<>());
} }
// 填充建筑坐标
String msg = "【志愿者分布】查询楼栋信息失败"; String msg = "【志愿者分布】查询楼栋信息失败";
IcBuildingDTO building = getResultDataOrThrowsException(govOrgOpenFeignClient.getBuildingById(icResiUserInfo.getBuildId()), IcBuildingDTO building = getResultDataOrThrowsException(govOrgOpenFeignClient.getBuildingById(icResiInfo.getBuildingId()),
ServiceConstant.GOV_ORG_SERVER, ServiceConstant.GOV_ORG_SERVER,
EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg);
distribution.setVolunteerCategories(volunteerTypes); icResiInfo.setEpmetUserId(icResiInfo.getEpmetUserId());
distribution.setEpmetUserId(userBaseInfo.getUserId()); icResiInfo.setIcResiUserId(icResiInfo.getIcResiUserId());
distribution.setIcResiUserId(icResiUserInfo.getId());
Optional.of(building).ifPresent(b -> { Optional.of(building).ifPresent(b -> {
distribution.setLongitude(b.getLongitude()); icResiInfo.setLongitude(b.getLongitude());
distribution.setLatitude(b.getLatitude()); icResiInfo.setLatitude(b.getLatitude());
}); });
r.getDistributions().add(distribution);
} }
return r; return icResiInfos;
} }
/**
* 分页查询志愿者列表
* @param customerId
* @param pageNo
* @param pageSize
* @return
*/
private List<PageVolunteerInfoResultDTO> listVolunteersByPage(String customerId, Integer pageNo, Integer pageSize) {
VolunteerCommonFormDTO volunteerForm = new VolunteerCommonFormDTO();
volunteerForm.setCustomerId(customerId);
volunteerForm.setPageNo(pageNo);
volunteerForm.setPageSize(pageSize);
String errorMsg = "【志愿者分布】分页查询志愿者列表失败";
return getResultDataOrThrowsException(epmetHeartOpenFeignClient.queryVolunteerPage(volunteerForm),
ServiceConstant.EPMET_HEART_SERVER,
EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
errorMsg,
errorMsg);
}
} }

17
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -489,4 +489,21 @@
</choose> </choose>
GROUP BY CULTURE GROUP BY CULTURE
</select> </select>
<select id="listIcResiInfosByUserIds"
resultType="com.epmet.dto.result.VolunteerDistributionResultDTO$Distribution">
select userbaseinfo.USER_ID as epmetUserId,
icuser.ID as icResiUserId,
icuser.BUILD_ID as buildingId,
icvol.VOLUNTEER_CATEGORY as volunteerCategoriesStr
from user_base_info userbaseinfo
inner join ic_resi_user icuser on (userbaseinfo.ID_NUM = icuser.ID_CARD and icuser.DEL_FLAG = '0')
inner join ic_volunteer icvol on (icuser.ID = icvol.IC_RESI_USER and icvol.DEL_FLAG = '0')
where userbaseinfo.DEL_FLAG = '0'
and userbaseinfo.ID_NUM is not null
and userbaseinfo.USER_ID in
<foreach collection="userIds" open="(" separator="," close=")" item="userId">
#{userId}
</foreach>
</select>
</mapper> </mapper>

Loading…
Cancel
Save