Browse Source

Merge branch 'dev_third_data' into dev_temp

# Conflicts:
#	epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java
#	epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java
#	epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java
#	epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java
#	epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml
#	epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java
#	epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java
#	epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java
#	epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java
#	epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
dev_shibei_match
sunyuchao 4 years ago
parent
commit
f9845dec57
  1. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java
  2. 28
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GridBasicDataFormDTO.java
  3. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java
  4. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java
  5. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyBasicDataResultDTO.java
  6. 96
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridBasicDataResultDTO.java
  7. 12
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java
  8. 18
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java
  9. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java
  10. 167
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  11. 43
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml
  12. 41
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ProjectCategoryDisPoseResultDTO.java
  13. 9
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java
  14. 5
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java
  15. 17
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java
  16. 10
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java
  17. 13
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java
  18. 39
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java
  19. 14
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml
  20. 43
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MassesDiscontentFormDTO.java
  21. 62
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MassesDiscontentResultDTO.java
  22. 31
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectScoreResultDTO.java
  23. 14
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java
  24. 14
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectSatisfactionStatisticsController.java
  25. 9
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectCategoryDao.java
  26. 10
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java
  27. 10
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionStatisticsDao.java
  28. 10
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectSatisfactionStatisticsService.java
  29. 102
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java
  30. 15
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectCategoryDao.xml
  31. 14
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml
  32. 24
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectSatisfactionStatisticsDao.xml
  33. 42
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicInfoResultDTO.java
  34. 11
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java
  35. 6
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java
  36. 11
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java
  37. 8
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java
  38. 8
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java
  39. 27
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
  40. 25
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml

4
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java

@ -48,6 +48,10 @@ public interface NumConstant {
int MAX = 99999999;
int EIGHTY_EIGHT = 88;
int EIGHTY = 80;
int NINETY = 90;
int ONE_HUNDRED_AND_EIGHTY = 180;
int THREE_HUNDRED_AND_SIXTY_FIVE = 365;
int SEVENTY_FIVE = 75;
double ZERO_DOT_ZERO = 0.0;

28
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GridBasicDataFormDTO.java

@ -0,0 +1,28 @@
package com.epmet.dataaggre.dto.datastats.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 基础数据-网格各种数据汇总-接口入参
* @Auth sun
*/
@Data
public class GridBasicDataFormDTO implements Serializable {
private static final long serialVersionUID = -3381286960911634231L;
/**
* 网格Id
*/
@NotBlank(message = "网格ID不能为空",groups = GridBasicDataFormDTO.Grid.class)
private String gridId;
/**
* 日维度Id
*/
private String dateId;
public interface Grid extends CustomerClientShowGroup{}
}

2
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java

@ -38,6 +38,8 @@ public class SubAgencyFormDTO implements Serializable {
public static class Topic implements Serializable {
//组织Id
private String agencyId;
//话题总量
private Integer topicTotal;
//话题数量
private Integer topicCount;
//话题状态 已关闭:closed、已屏蔽:hidden、 讨论中:discussing

2
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java

@ -38,6 +38,8 @@ public class SubGridFormDTO implements Serializable {
public static class Topic implements Serializable {
//网格Id
private String gridId;
//话题总量
private Integer topicTotal;
//话题数量
private Integer topicCount;
//话题状态 已关闭:closed、已屏蔽:hidden、 讨论中:discussing

2
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyBasicDataResultDTO.java

@ -81,6 +81,8 @@ public class AgencyBasicDataResultDTO implements Serializable {
@Data
public static class Topic implements Serializable {
//话题总量
private Integer topicTotal;
//话题数量
private Integer topicCount;
//话题状态 已关闭:closed、已屏蔽:hidden、 讨论中:discussing

96
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridBasicDataResultDTO.java

@ -0,0 +1,96 @@
package com.epmet.dataaggre.dto.datastats.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Description 基础数据-网格各种数据汇总-接口返参
* @Auth sun
*/
@Data
public class GridBasicDataResultDTO implements Serializable {
private static final long serialVersionUID = 466974582608407121L;
@JsonIgnore
BigDecimal bi = new BigDecimal(0);
/**
* 网格Id
*/
private String gridId;
//用户总数
private Integer userTotal = 0;
//党员总数
private Integer partyMemberTotal = 0;
//党员总数占比
private BigDecimal partyMemberRatio = bi;
//居民总数
private Integer resiTotal = 0;
//居民总数占比
private BigDecimal resiRatio = bi;
//党群小组总数
private Integer groupTotal = 0;
//楼院小组总数
private Integer ordinaryTotal = 0;
//楼院小组总数占比
private BigDecimal ordinaryRatio = bi;
//支部小组总数
private Integer branchTotal = 0;
//支部小组总数占比
private BigDecimal branchRatio = bi;
//话题总数
private Integer topicTotal = 0;
//热议中总数
private Integer discussingTotal = 0;
//热议中总数占比
private BigDecimal discussingRatio = bi;
//已处理总数
private Integer closedTopicTotal = 0;
//已处理总数占比
private BigDecimal closedTopicRatio = bi;
//转议题总数
private Integer shiftIssueTotal = 0;
//转议题总数占比
private BigDecimal shiftIssueRatio = bi;
//议题总数
private Integer issueTotal = 0;
//表决中总数
private Integer votingTotal = 0;
//表决中总数占比
private BigDecimal votingRatio = bi;
//已处理总数
private Integer closedIssueTotal = 0;
//已处理总数占比
private BigDecimal closedIssueRatio = bi;
//已转项目总数
private Integer shiftProjectTotal = 0;
//已转项目总数占比
private BigDecimal shiftProjectRatio = bi;
//项目总数
private Integer projectTotal = 0;
//处理中总数
private Integer pendingTotal = 0;
//处理中总数占比
private BigDecimal pendingRatio = bi;
//已结案总数
private Integer closedProjectTotal = 0;
//已结案总数占比
private BigDecimal closedProjectRatio = bi;
@Data
public static class Topic implements Serializable {
//话题总量
private Integer topicTotal;
//话题数量
private Integer topicCount;
//话题状态 已关闭:closed、已屏蔽:hidden、 讨论中:discussing
private String topicStatus;
//话题已转议题数量
private Integer shiftedIssueTotal;
//数据更新至 时间
private String deadline;
}
}

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

@ -3,6 +3,7 @@ package com.epmet.dataaggre.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO;
import com.epmet.dataaggre.dto.datastats.form.GridBasicDataFormDTO;
import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO;
import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO;
import com.epmet.dataaggre.dto.datastats.result.*;
@ -37,6 +38,17 @@ public class DataStatsController {
return new Result<AgencyBasicDataResultDTO>().ok(dataStatsService.agencyBasicData(formDTO));
}
/**
* @Param formDTO
* @Description 网格下五项基础数据汇总
* @author sun
*/
@PostMapping("gridbasicdata")
public Result<GridBasicDataResultDTO> gridBasicData(@RequestBody GridBasicDataFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, GridBasicDataFormDTO.Grid.class);
return new Result<GridBasicDataResultDTO>().ok(dataStatsService.gridBasicData(formDTO));
}
/**
* @Param formDTO
* @Description 查询当前组织的直属下级组织用户数据

18
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java

@ -58,6 +58,12 @@ public interface DataStatsDao {
*/
AgencyBasicDataResultDTO.Topic getAgencyTopicShiftIssue(@Param("agencyId") String agencyId, @Param("dateId") String dateId);
/**
* @Description 热议中话题-机关日统计数据
* @author sun
*/
AgencyBasicDataResultDTO.Topic getAgencyTopicHotDiscuss(@Param("agencyId") String agencyId, @Param("dateId") String dateId);
/**
* @Description 查询组织下最新议题日统计数据
* @author sun
@ -118,6 +124,12 @@ public interface DataStatsDao {
*/
List<SubAgencyFormDTO.Topic> getSubAgencyTopicShiftIssue(@Param("agencyIds") List<String> agencyIds, @Param("dateId") String dateId);
/**
* @Description 查询直属下级组织热议中话题-机关日统计数据
* @author sun
*/
List<SubAgencyFormDTO.Topic> getSubAgencyTopicHotDiscuss(@Param("agencyIds") List<String> agencyIds, @Param("dateId") String dateId);
/**
* @Description 查询网格层级状态话题-日统计数据
* @author sun
@ -130,6 +142,12 @@ public interface DataStatsDao {
*/
List<SubGridFormDTO.Topic> getSubGridTopicShiftIssue(@Param("gridIds") List<String> gridIds, @Param("dateId") String dateId);
/**
* @Description 查询网格层级热议中话题-日统计数据
* @author sun
*/
List<SubGridFormDTO.Topic> getSubGridTopicHotDiscuss(@Param("gridIds") List<String> gridIds, @Param("dateId") String dateId);
/**
* @Description 查询直属下级组织议题日统计数据默认按议题总数降序
* @author sun

9
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java

@ -1,6 +1,7 @@
package com.epmet.dataaggre.service.datastats;
import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO;
import com.epmet.dataaggre.dto.datastats.form.GridBasicDataFormDTO;
import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO;
import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO;
import com.epmet.dataaggre.dto.datastats.result.*;
@ -20,6 +21,13 @@ public interface DataStatsService {
*/
AgencyBasicDataResultDTO agencyBasicData(AgenctBasicDataFormDTO formDTO);
/**
* @Param formDTO
* @Description 网格下五项基础数据汇总
* @author sun
*/
GridBasicDataResultDTO gridBasicData(GridBasicDataFormDTO formDTO);
/**
* @Param formDTO
* @Description 查询当前组织的直属下级组织用户数据
@ -91,4 +99,5 @@ public interface DataStatsService {
* @author sun
*/
List<SubGridProjectResultDTO> subGridProject(SubGridFormDTO formDTO);
}

167
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java

@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.datastats.DataStatsDao;
import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO;
import com.epmet.dataaggre.dto.datastats.form.GridBasicDataFormDTO;
import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO;
import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO;
import com.epmet.dataaggre.dto.datastats.result.*;
@ -47,7 +48,7 @@ public class DataStatsServiceImpl implements DataStatsService {
AgencyBasicDataResultDTO resultDTO = new AgencyBasicDataResultDTO();
resultDTO.setAgencyId(formDTO.getAgencyId());
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.FOUR);
numberFormat.setMaximumFractionDigits(NumConstant.THREE);
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if (StringUtils.isBlank(formDTO.getDateId())) {
@ -78,29 +79,32 @@ public class DataStatsServiceImpl implements DataStatsService {
//3.查询组织下最新话题日统计数据
//状态话题-机关日统计数据表最新日期三种状态数据
//机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念,热议中=总量-关闭数-屏蔽数-转议题数
//机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念
List<AgencyBasicDataResultDTO.Topic> topic = dataStatsDao.getAgencyTopic(formDTO.getAgencyId(), formDTO.getDateId());
//转议题话题-机关日统计数据表
AgencyBasicDataResultDTO.Topic topicSHiftIssue = dataStatsDao.getAgencyTopicShiftIssue(formDTO.getAgencyId(), formDTO.getDateId());
//热议中话题-机关日统计数据
AgencyBasicDataResultDTO.Topic hotdiscuss = dataStatsDao.getAgencyTopicHotDiscuss(formDTO.getAgencyId(), formDTO.getDateId());
AtomicReference<Integer> closedTotal = new AtomicReference<>(0);
AtomicReference<Integer> hiddenTotal = new AtomicReference<>(0);
if (topic.size() > NumConstant.ZERO) {
resultDTO.setTopicTotal(topic.stream().collect(Collectors.summingInt(AgencyBasicDataResultDTO.Topic::getTopicCount)));
topic.forEach(t -> {
if (t.getTopicStatus().equals("closed")) {
closedTotal.set(t.getTopicCount());
}
if (t.getTopicStatus().equals("hidden")) {
hiddenTotal.set(t.getTopicCount());
}
});
}
//转议题
if (null != topicSHiftIssue) {
resultDTO.setShiftIssueTotal(topicSHiftIssue.getShiftedIssueTotal());
resultDTO.setShiftIssueRatio(resultDTO.getShiftIssueTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftIssueTotal() / (float) resultDTO.getTopicTotal())));
}
resultDTO.setDiscussingTotal(resultDTO.getTopicTotal() - closedTotal.get() - hiddenTotal.get() - resultDTO.getShiftIssueTotal());
resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal())));
//热议中
if (null != hotdiscuss) {
resultDTO.setDiscussingTotal(hotdiscuss.getTopicCount());
resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal())));
}
//已处理
resultDTO.setClosedTopicTotal(closedTotal.get());
resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal())));
@ -129,6 +133,103 @@ public class DataStatsServiceImpl implements DataStatsService {
return resultDTO;
}
/**
* @Param formDTO
* @Description 网格下五项基础数据汇总
* @author sun
*/
@Override
public GridBasicDataResultDTO gridBasicData(GridBasicDataFormDTO formDTO) {
GridBasicDataResultDTO resultDTO = new GridBasicDataResultDTO();
resultDTO.setGridId(formDTO.getGridId());
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.THREE);
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if (StringUtils.isBlank(formDTO.getDateId())) {
Date yesterday = DateUtils.addDateDays(new Date(), -1);
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
formDTO.setDateId(format.format(yesterday));
}
//1.查询网格下注册用户最新日统计数据【只查询注册用户的统计数据,不涉及参与用户的】
List<String> gridIds = new ArrayList<>();
gridIds.add(formDTO.getGridId());
List<SubGridUserResultDTO> userList = dataStatsDao.getSubGridUser(gridIds, formDTO.getDateId());
if (userList.size() > NumConstant.ZERO) {
resultDTO.setUserTotal(userList.get(0).getUserTotal());
resultDTO.setResiTotal(userList.get(0).getResiTotal());
resultDTO.setResiRatio(resultDTO.getResiTotal() == 0 || resultDTO.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getResiTotal() / (float) resultDTO.getUserTotal())));
resultDTO.setPartyMemberTotal(userList.get(0).getPartyMemberTotal());
resultDTO.setPartyMemberRatio(resultDTO.getPartyMemberTotal() == 0 || resultDTO.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getPartyMemberTotal() / (float) resultDTO.getUserTotal())));
}
//2.查询网格下最新群组日统计数据
List<SubGridGroupResultDTO> groupList = dataStatsDao.getSubGridGroup(gridIds, formDTO.getDateId());
if (groupList.size() > NumConstant.ZERO) {
resultDTO.setGroupTotal(groupList.get(0).getGroupTotal());
resultDTO.setOrdinaryTotal(groupList.get(0).getOrdinaryTotal());
resultDTO.setOrdinaryRatio(resultDTO.getOrdinaryTotal() == 0 || resultDTO.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getOrdinaryTotal() / (float) resultDTO.getGroupTotal())));
resultDTO.setBranchTotal(groupList.get(0).getBranchTotal());
resultDTO.setBranchRatio(resultDTO.getBranchTotal() == 0 || resultDTO.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getBranchTotal() / (float) resultDTO.getGroupTotal())));
}
//3.查询网格下最新话题日统计数据
//状态话题-网格日统计数据表最新日期三种状态数据
//网格日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念
List<SubGridFormDTO.Topic> topicList = dataStatsDao.getSubGridTopic(gridIds, formDTO.getDateId());
//转议题话题-网格日统计数据表
List<SubGridFormDTO.Topic> topicShiftIssueList = dataStatsDao.getSubGridTopicShiftIssue(gridIds, formDTO.getDateId());
//热议中话题-网格日统计数据
List<SubGridFormDTO.Topic> hotdiscussList = dataStatsDao.getSubGridTopicHotDiscuss(gridIds, formDTO.getDateId());
AtomicReference<Integer> closedTotal = new AtomicReference<>(0);
if (topicList.size() > NumConstant.ZERO) {
resultDTO.setTopicTotal(topicList.stream().collect(Collectors.summingInt(SubGridFormDTO.Topic::getTopicCount)));
topicList.forEach(t -> {
if (t.getTopicStatus().equals("closed")) {
closedTotal.set(t.getTopicCount());
}
});
}
//转议题
if (topicShiftIssueList.size() > NumConstant.ZERO) {
resultDTO.setShiftIssueTotal(topicShiftIssueList.get(0).getShiftedIssueTotal());
resultDTO.setShiftIssueRatio(resultDTO.getShiftIssueTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftIssueTotal() / (float) resultDTO.getTopicTotal())));
}
//热议中
if (hotdiscussList.size() > NumConstant.ZERO) {
resultDTO.setDiscussingTotal(hotdiscussList.get(0).getTopicCount());
resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal())));
}
//已处理
resultDTO.setClosedTopicTotal(closedTotal.get());
resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal())));
//4.查询网格下最新议题日统计数据
List<SubGridIssueResultDTO> issueList = dataStatsDao.getSubGridIssue(gridIds, formDTO.getDateId());
if (issueList.size() > NumConstant.ZERO) {
resultDTO.setIssueTotal(issueList.get(0).getIssueTotal());
resultDTO.setVotingTotal(issueList.get(0).getVotingTotal());
resultDTO.setVotingRatio(resultDTO.getVotingTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getVotingTotal() / (float) resultDTO.getIssueTotal())));
resultDTO.setClosedIssueTotal(issueList.get(0).getClosedIssueTotal());
resultDTO.setClosedIssueRatio(resultDTO.getClosedIssueTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedIssueTotal() / (float) resultDTO.getIssueTotal())));
resultDTO.setShiftProjectTotal(issueList.get(0).getShiftProjectTotal());
resultDTO.setShiftProjectRatio(resultDTO.getShiftProjectTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftProjectTotal() / (float) resultDTO.getIssueTotal())));
}
//5.查询网格下最新项目日统计数据
List<SubGridProjectResultDTO> projectList = dataStatsDao.getSubGridProject(gridIds, formDTO.getDateId());
if (projectList.size() > NumConstant.ZERO) {
resultDTO.setProjectTotal(projectList.get(0).getProjectTotal());
resultDTO.setPendingTotal(projectList.get(0).getPendingTotal());
resultDTO.setPendingRatio(resultDTO.getPendingTotal() == 0 || resultDTO.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getPendingTotal() / (float) resultDTO.getProjectTotal())));
resultDTO.setClosedProjectTotal(projectList.get(0).getClosedProjectTotal());
resultDTO.setClosedProjectRatio(resultDTO.getClosedProjectTotal() == 0 || resultDTO.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedProjectTotal() / (float) resultDTO.getProjectTotal())));
}
return resultDTO;
}
/**
* @Param formDTO
* @Description 查询当前组织的直属下级组织用户数据
@ -138,7 +239,7 @@ public class DataStatsServiceImpl implements DataStatsService {
public List<SubAgencyUserResultDTO> subAgencyUser(SubAgencyFormDTO formDTO) {
List<SubAgencyUserResultDTO> resultList = new ArrayList<>();
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.FOUR);
numberFormat.setMaximumFractionDigits(NumConstant.THREE);
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if (StringUtils.isBlank(formDTO.getDateId())) {
@ -201,7 +302,7 @@ public class DataStatsServiceImpl implements DataStatsService {
public List<SubGridUserResultDTO> subGridUser(SubGridFormDTO formDTO) {
List<SubGridUserResultDTO> resultList = new ArrayList<>();
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.FOUR);
numberFormat.setMaximumFractionDigits(NumConstant.THREE);
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if (StringUtils.isBlank(formDTO.getDateId())) {
@ -262,7 +363,7 @@ public class DataStatsServiceImpl implements DataStatsService {
public List<SubAgencyGroupResultDTO> subAgencyGroup(SubAgencyFormDTO formDTO) {
List<SubAgencyGroupResultDTO> resultList = new ArrayList<>();
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.FOUR);
numberFormat.setMaximumFractionDigits(NumConstant.THREE);
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if (StringUtils.isBlank(formDTO.getDateId())) {
@ -322,7 +423,7 @@ public class DataStatsServiceImpl implements DataStatsService {
public List<SubGridGroupResultDTO> subGridGroup(SubGridFormDTO formDTO) {
List<SubGridGroupResultDTO> resultList = new ArrayList<>();
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.FOUR);
numberFormat.setMaximumFractionDigits(NumConstant.THREE);
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if (StringUtils.isBlank(formDTO.getDateId())) {
@ -383,7 +484,7 @@ public class DataStatsServiceImpl implements DataStatsService {
public List<SubAgencyTopicResultDTO> subAgencyTopic(SubAgencyFormDTO formDTO) {
List<SubAgencyTopicResultDTO> resultList = new ArrayList<>();
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.FOUR);
numberFormat.setMaximumFractionDigits(NumConstant.THREE);
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if (StringUtils.isBlank(formDTO.getDateId())) {
@ -404,16 +505,18 @@ public class DataStatsServiceImpl implements DataStatsService {
List<String> agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList());
//2.查询直属下级组织状态话题-日统计数据
//机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念,热议中=总量-关闭数-屏蔽数-转议题数
//机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念
List<SubAgencyFormDTO.Topic> topic = dataStatsDao.getSubAgencyTopic(agencyIds, formDTO.getDateId());
//查询直属下级组织转议题话题-日统计数据表
List<SubAgencyFormDTO.Topic> topicShiftIssue = dataStatsDao.getSubAgencyTopicShiftIssue(agencyIds, formDTO.getDateId());
//查询直属下级组织热议中话题-机关日统计数据
List<SubAgencyFormDTO.Topic> hotdiscuss = dataStatsDao.getSubAgencyTopicHotDiscuss(agencyIds, formDTO.getDateId());
agencyIds.forEach(agencyId -> {
SubAgencyTopicResultDTO resultDTO = new SubAgencyTopicResultDTO();
AtomicInteger topicTotal = new AtomicInteger(0);
AtomicInteger closedTotal = new AtomicInteger(0);
AtomicInteger hiddenTotal = new AtomicInteger(0);
AtomicInteger shiftIssueTotal = new AtomicInteger(0);
AtomicInteger hotdiscussTotal = new AtomicInteger(0);
AtomicReference<String> agencyName = new AtomicReference<>("");
topic.forEach(t -> {
if (t.getAgencyId().equals(agencyId)) {
@ -421,9 +524,6 @@ public class DataStatsServiceImpl implements DataStatsService {
if (t.getTopicStatus().equals("closed")) {
closedTotal.set(t.getTopicCount());
}
if (t.getTopicStatus().equals("hidden")) {
hiddenTotal.set(t.getTopicCount());
}
}
});
topicShiftIssue.forEach(t -> {
@ -431,6 +531,11 @@ public class DataStatsServiceImpl implements DataStatsService {
shiftIssueTotal.addAndGet(t.getShiftedIssueTotal());
}
});
hotdiscuss.forEach(t -> {
if (t.getAgencyId().equals(agencyId)) {
hotdiscussTotal.addAndGet(t.getTopicCount());
}
});
subAgencyList.forEach(sub -> {
if (agencyId.equals(sub.getId())) {
agencyName.set(sub.getAgencyName());
@ -440,7 +545,7 @@ public class DataStatsServiceImpl implements DataStatsService {
resultDTO.setAgencyId(agencyId);
resultDTO.setAgencyName(agencyName.get());
resultDTO.setTopicTotal(topicTotal.get());
resultDTO.setDiscussingTotal(topicTotal.get() - closedTotal.get() - hiddenTotal.get() - shiftIssueTotal.get());
resultDTO.setDiscussingTotal(hotdiscussTotal.get());
resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal())));
resultDTO.setClosedTopicTotal(closedTotal.get());
resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal())));
@ -479,7 +584,7 @@ public class DataStatsServiceImpl implements DataStatsService {
public List<SubGridTopicResultDTO> subGridTopic(SubGridFormDTO formDTO) {
List<SubGridTopicResultDTO> resultList = new ArrayList<>();
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.FOUR);
numberFormat.setMaximumFractionDigits(NumConstant.THREE);
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if (StringUtils.isBlank(formDTO.getDateId())) {
@ -504,12 +609,14 @@ public class DataStatsServiceImpl implements DataStatsService {
List<SubGridFormDTO.Topic> topic = dataStatsDao.getSubGridTopic(gridIds, formDTO.getDateId());
//查询网格层级转议题话题-日统计数据表
List<SubGridFormDTO.Topic> topicShiftIssue = dataStatsDao.getSubGridTopicShiftIssue(gridIds, formDTO.getDateId());
//查询网格层级热议中话题-日统计数据
List<SubGridFormDTO.Topic> hotdiscuss = dataStatsDao.getSubGridTopicHotDiscuss(gridIds, formDTO.getDateId());
gridIds.forEach(gridId -> {
SubGridTopicResultDTO resultDTO = new SubGridTopicResultDTO();
AtomicInteger topicTotal = new AtomicInteger(0);
AtomicInteger closedTotal = new AtomicInteger(0);
AtomicInteger hiddenTotal = new AtomicInteger(0);
AtomicInteger shiftIssueTotal = new AtomicInteger(0);
AtomicInteger hotdiscussTotal = new AtomicInteger(0);
AtomicReference<String> gridName = new AtomicReference<>("");
topic.forEach(t -> {
if (t.getGridId().equals(gridId)) {
@ -517,9 +624,6 @@ public class DataStatsServiceImpl implements DataStatsService {
if (t.getTopicStatus().equals("closed")) {
closedTotal.set(t.getTopicCount());
}
if (t.getTopicStatus().equals("hidden")) {
hiddenTotal.set(t.getTopicCount());
}
}
});
topicShiftIssue.forEach(t -> {
@ -527,6 +631,11 @@ public class DataStatsServiceImpl implements DataStatsService {
shiftIssueTotal.addAndGet(t.getShiftedIssueTotal());
}
});
hotdiscuss.forEach(t -> {
if (t.getGridId().equals(gridId)) {
hotdiscussTotal.addAndGet(t.getTopicCount());
}
});
gridList.forEach(sub -> {
if (gridId.equals(sub.getId())) {
gridName.set(sub.getGridName());
@ -536,7 +645,7 @@ public class DataStatsServiceImpl implements DataStatsService {
resultDTO.setGridId(gridId);
resultDTO.setGridName(gridName.get());
resultDTO.setTopicTotal(topicTotal.get());
resultDTO.setDiscussingTotal(topicTotal.get() - closedTotal.get() - hiddenTotal.get() - shiftIssueTotal.get());
resultDTO.setDiscussingTotal(hotdiscussTotal.get());
resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal())));
resultDTO.setClosedTopicTotal(closedTotal.get());
resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal())));
@ -574,7 +683,7 @@ public class DataStatsServiceImpl implements DataStatsService {
public List<SubAgencyIssueResultDTO> subAgencyIssue(SubAgencyFormDTO formDTO) {
List<SubAgencyIssueResultDTO> resultList = new ArrayList<>();
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.FOUR);
numberFormat.setMaximumFractionDigits(NumConstant.THREE);
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if (StringUtils.isBlank(formDTO.getDateId())) {
@ -637,7 +746,7 @@ public class DataStatsServiceImpl implements DataStatsService {
public List<SubGridIssueResultDTO> subGridIssue(SubGridFormDTO formDTO) {
List<SubGridIssueResultDTO> resultList = new ArrayList<>();
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.FOUR);
numberFormat.setMaximumFractionDigits(NumConstant.THREE);
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if (StringUtils.isBlank(formDTO.getDateId())) {
@ -700,7 +809,7 @@ public class DataStatsServiceImpl implements DataStatsService {
public List<SubAgencyProjectResultDTO> subAgencyProject(SubAgencyFormDTO formDTO) {
List<SubAgencyProjectResultDTO> resultList = new ArrayList<>();
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.FOUR);
numberFormat.setMaximumFractionDigits(NumConstant.THREE);
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if (StringUtils.isBlank(formDTO.getDateId())) {
@ -760,7 +869,7 @@ public class DataStatsServiceImpl implements DataStatsService {
public List<SubGridProjectResultDTO> subGridProject(SubGridFormDTO formDTO) {
List<SubGridProjectResultDTO> resultList = new ArrayList<>();
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.FOUR);
numberFormat.setMaximumFractionDigits(NumConstant.THREE);
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if (StringUtils.isBlank(formDTO.getDateId())) {

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

@ -58,6 +58,19 @@
LIMIT 1
</select>
<select id="getAgencyTopicHotDiscuss" resultType="com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO$Topic">
SELECT
IFNULL(topic_total, 0) AS topicTotal,
IFNULL(topic_count, 0) AS topicCount
FROM
fact_topic_hotdiscuss_agency_daily
WHERE
del_flag = '0'
AND agency_id = #{agencyId}
AND date_id = #{dateId}
LIMIT 1
</select>
<select id="getAgencyIssue" resultType="com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO">
SELECT
issue_total AS issueTotal,
@ -210,6 +223,21 @@
</foreach>
</select>
<select id="getSubAgencyTopicHotDiscuss" resultType="com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO$Topic">
SELECT
agency_id AS agencyId,
topic_total AS topicTotal,
topic_count AS topicCount
FROM
fact_topic_hotdiscuss_agency_daily
WHERE
del_flag = '0'
AND date_id = #{dateId}
<foreach item="agencyId" collection="agencyIds" open="AND (" separator="or" close=")" index="">
agency_id = #{agencyId}
</foreach>
</select>
<select id="getSubGridTopic" resultType="com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO$Topic">
SELECT
grid_id AS gridId,
@ -240,6 +268,21 @@
</foreach>
</select>
<select id="getSubGridTopicHotDiscuss" resultType="com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO$Topic">
SELECT
grid_id AS gridId,
topic_total AS topicTotal,
topic_count AS topicCount
FROM
fact_topic_hotdiscuss_grid_daily
WHERE
del_flag = '0'
AND date_id = #{dateId}
<foreach item="gridId" collection="gridIds" open="AND (" separator="or" close=")" index="">
grid_id = #{gridId}
</foreach>
</select>
<select id="getSubAgencyIssue" resultType="com.epmet.dataaggre.dto.datastats.result.SubAgencyIssueResultDTO">
SELECT
agency_id AS agencyId,

41
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ProjectCategoryDisPoseResultDTO.java

@ -0,0 +1,41 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/5/17 10:36 上午
* @DESC
*/
@Data
public class ProjectCategoryDisPoseResultDTO implements Serializable {
private static final long serialVersionUID = -2434579745274187160L;
/**
* 项目ID
*/
private String projectId;
/**
* 查询传参
*/
private String categoryCode;
/**
* mysql查询接收结果
*/
private String categoryName;
/**
* 反参
*/
private String projectCategory;
/**
* 客户ID
*/
private String customerId;
}

9
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java

@ -330,4 +330,13 @@ public interface GovIssueOpenFeignClient {
*/
@PostMapping("/gov/issue/issue/canevaluateprojectcountbatch")
Result<List<CanEvaluateProjectCountBatchResultDTO>> canEvaluateProjectCountBatch(@RequestParam("issueIds")List<String> issueIds);
/**
* @Description 查询项目分类标签
* @Param list
* @author zxc
* @date 2021/5/17 1:51 下午
*/
@PostMapping(value = "/gov/issue/issueprojectcategorydict/getprojectcategory")
Result<List<ProjectCategoryDisPoseResultDTO>> getProjectCategory(@RequestBody List<ProjectCategoryDisPoseResultDTO> list);
}

5
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java

@ -274,4 +274,9 @@ public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient
public Result<List<CanEvaluateProjectCountBatchResultDTO>> canEvaluateProjectCountBatch(List<String> issueIds) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "canEvaluateProjectCountBatch", issueIds);
}
@Override
public Result<List<ProjectCategoryDisPoseResultDTO>> getProjectCategory(List<ProjectCategoryDisPoseResultDTO> list) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "getProjectCategory", list);
}
}

17
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java

@ -32,10 +32,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IssueProjectCategoryDictDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.CategoryTagResultDTO;
import com.epmet.dto.result.CustomerCategoryListResultDTO;
import com.epmet.dto.result.CustomerCategoryResultDTO;
import com.epmet.dto.result.ProjectIssueCategoryResultDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.IssueProjectCategoryDictEntity;
import com.epmet.excel.IssueProjectCategoryDictExcel;
import com.epmet.project.dto.CustomerCategoryDTO;
@ -268,5 +265,17 @@ public class IssueProjectCategoryDictController {
return new Result<CategoryTagResultDTO>().ok(issueProjectCategoryDictService.getCategoryTagList(formDTO));
}
/**
* @Description 查询项目分类标签
* @Param list
* @author zxc
* @date 2021/5/17 1:51 下午
*/
@PostMapping("getprojectcategory")
public Result<List<ProjectCategoryDisPoseResultDTO>> getProjectCategory(@RequestBody List<ProjectCategoryDisPoseResultDTO> list){
return new Result<List<ProjectCategoryDisPoseResultDTO>>().ok(issueProjectCategoryDictService.getProjectCategory(list));
}
}

10
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java

@ -24,6 +24,7 @@ import com.epmet.dto.form.IsDisableCategoryFormDTO;
import com.epmet.dto.form.IssueProjectCategoryDictListFormDTO;
import com.epmet.dto.result.CustomerCategoryListResultDTO;
import com.epmet.dto.result.CustomerCategoryResultDTO;
import com.epmet.dto.result.ProjectCategoryDisPoseResultDTO;
import com.epmet.entity.IssueProjectCategoryDictEntity;
import com.epmet.project.dto.result.ProjectCategoryDictResultDTO;
import org.apache.ibatis.annotations.Mapper;
@ -173,4 +174,13 @@ public interface IssueProjectCategoryDictDao extends BaseDao<IssueProjectCategor
* @Author sun
**/
List<IssueProjectCategoryDictDTO> getCategoryList(@Param("customerId") String customerId, @Param("categoryIdList") List<String> categoryIdList);
/**
* @Description 查询项目分类标签
* @Param list
* @author zxc
* @date 2021/5/17 1:51 下午
*/
List<ProjectCategoryDisPoseResultDTO> getProjectCategory(@Param("list") List<ProjectCategoryDisPoseResultDTO> list,@Param("customerId") String customerId);
}

13
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java

@ -22,10 +22,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IssueProjectCategoryDictDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.CategoryTagResultDTO;
import com.epmet.dto.result.CustomerCategoryListResultDTO;
import com.epmet.dto.result.CustomerCategoryResultDTO;
import com.epmet.dto.result.ProjectIssueCategoryResultDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.IssueProjectCategoryDictEntity;
import com.epmet.project.dto.result.ProjectCategoryDictResultDTO;
import org.springframework.web.bind.annotation.RequestBody;
@ -216,4 +213,12 @@ public interface IssueProjectCategoryDictService extends BaseService<IssueProjec
* @Author sun
**/
CategoryTagResultDTO getCategoryTagList(CategoryTagListFormDTO formDTO);
/**
* @Description 查询项目分类标签
* @Param list
* @author zxc
* @date 2021/5/17 1:51 下午
*/
List<ProjectCategoryDisPoseResultDTO> getProjectCategory(List<ProjectCategoryDisPoseResultDTO> list);
}

39
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java

@ -472,4 +472,43 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl<IssuePr
return resultDTO;
}
/**
* @Description 查询项目分类标签
* @Param list
* @author zxc
* @date 2021/5/17 1:51 下午
*/
@Override
public List<ProjectCategoryDisPoseResultDTO> getProjectCategory(List<ProjectCategoryDisPoseResultDTO> list) {
String customerId = list.get(NumConstant.ZERO).getCustomerId();
List<ProjectCategoryDisPoseResultDTO> projectCategory = baseDao.getProjectCategory(list, customerId);
if (CollectionUtils.isEmpty(projectCategory)){
return new ArrayList<>();
}
List<ProjectCategoryDisPoseResultDTO> result = new ArrayList<>();
Map<String, List<ProjectCategoryDisPoseResultDTO>> groupByProject = projectCategory.stream().collect(Collectors.groupingBy(ProjectCategoryDisPoseResultDTO::getProjectId));
groupByProject.forEach((projectId,categoryList) -> {
ProjectCategoryDisPoseResultDTO p = new ProjectCategoryDisPoseResultDTO();
p.setProjectId(projectId);
p.setProjectCategory(disposeCategory(categoryList));
result.add(p);
});
return result;
}
/**
* @Description 项目分类处理
* @Param list
* @author zxc
* @date 2021/5/17 2:16 下午
*/
public String disposeCategory(List<ProjectCategoryDisPoseResultDTO> list){
String result = "";
if (!CollectionUtils.isEmpty(list)){
list.forEach(l -> {
result.concat(l.getCategoryName()).concat(",");
});
}
return result.substring(NumConstant.ZERO,result.length()-NumConstant.ONE);
}
}

14
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml

@ -230,6 +230,20 @@
sort ASC
</select>
<!-- 查询项目分类标签 -->
<select id="getProjectCategory" resultType="com.epmet.dto.result.ProjectCategoryDisPoseResultDTO">
<foreach collection="list" item="l" separator=" UNION ALL ">
SELECT
#{l.projectId} AS projectId,
CATEGORY_NAME
FROM issue_project_category_dict
WHERE DEL_FLAG = '0'
AND IS_DISABLE = 'enable'
AND CUSTOMER_ID = #{customerId}
AND CATEGORY_CODE = #{l.categoryCode}
</foreach>
</select>
<update id="updateIssueProjectCategoryDict">
UPDATE issue_project_category_dict
SET

43
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MassesDiscontentFormDTO.java

@ -0,0 +1,43 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/5/13 5:16 下午
* @DESC
*/
@Data
public class MassesDiscontentFormDTO implements Serializable {
private static final long serialVersionUID = -9104774532905137856L;
public interface MassesDiscontentForm{}
/**
* 时间区间,三个月threeMonth半年sixMonth一年twelveMonth
* 一个月按照30天三个月90天半年180天一年365天
*/
private String timeSection;
/**
* asc:分数由低到高
* desc:分数由高到低
*/
private String sortType;
/**
* 组织ID
*/
private String agencyId;
@NotNull(message = "pageNo不能为空",groups = MassesDiscontentForm.class)
private Integer pageNo;
@NotNull(message = "pageSize不能为空",groups = MassesDiscontentForm.class)
private Integer pageSize;
}

62
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MassesDiscontentResultDTO.java

@ -0,0 +1,62 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @Author zxc
* @DateTime 2021/5/14 9:04 上午
* @DESC
*/
@Data
public class MassesDiscontentResultDTO implements Serializable {
private static final long serialVersionUID = 8954504790464516198L;
/**
* 项目ID
*/
private String projectId;
/**
* 议题ID
*/
private String issueId;
/**
* 话题所在网格
*/
private String gridName;
/**
* 话题图片
*/
private List<String> photos;
/**
* 话题内容
*/
private String topicContent;
/**
* 项目分类标签
*/
private String projectCategory;
/**
* 项目评价分数
*/
@JsonIgnore
private Integer score;
public MassesDiscontentResultDTO() {
this.gridName = "";
this.photos = new ArrayList<>();
this.topicContent = "";
this.projectCategory = "";
}
}

31
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectScoreResultDTO.java

@ -0,0 +1,31 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/5/18 1:29 下午
* @DESC
*/
@Data
public class ProjectScoreResultDTO implements Serializable {
private static final long serialVersionUID = 8559486245200043097L;
/**
* 项目ID
*/
private String projectId;
/**
* 项目评价分数
*/
private Integer score;
/**
* 议题ID
*/
private String issueId;
}

14
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java

@ -178,4 +178,18 @@ public interface ProjectConstant {
String EVALUATE_GOOD = "good";
String EVALUATE_BAD = "bad";
String EVALUATE_PERFECT = "perfect";
/**
* 三个月六个月12个月
*/
String THREE_MONTH = "threeMonth";
String SIX_MONTH = "sixMonth";
String TWELVE_MONTH = "twelveMonth";
/**
* 排序
*/
String SORT_ASC = "asc";
String SORT_DESC = "desc";
}

14
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectSatisfactionStatisticsController.java

@ -26,7 +26,9 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.ProjectSatisfactionStatisticsDTO;
import com.epmet.dto.form.MassesDiscontentFormDTO;
import com.epmet.dto.form.ProjectEvaluateScoreFormDTO;
import com.epmet.dto.result.MassesDiscontentResultDTO;
import com.epmet.dto.result.ProjectEvaluateScoreResultDTO;
import com.epmet.excel.ProjectSatisfactionStatisticsExcel;
import com.epmet.service.ProjectSatisfactionStatisticsService;
@ -105,4 +107,16 @@ public class ProjectSatisfactionStatisticsController {
return new Result<ProjectEvaluateScoreResultDTO>().ok(projectSatisfactionStatisticsService.projectEvaluateScore(formDTO));
}
/**
* @Description 群众不满
* @Param formDTO
* @author zxc
* @date 2021/5/14 10:46 上午
*/
@PostMapping("massesdiscontent")
public Result<List<MassesDiscontentResultDTO>> massesDiscontent(@RequestBody MassesDiscontentFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, MassesDiscontentFormDTO.MassesDiscontentForm.class);
return new Result<List<MassesDiscontentResultDTO>>().ok(projectSatisfactionStatisticsService.massesDiscontent(formDTO));
}
}

9
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectCategoryDao.java

@ -20,6 +20,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ProjectCategoryDTO;
import com.epmet.dto.form.DelCategoryFormDTO;
import com.epmet.dto.result.ProjectCategoryDisPoseResultDTO;
import com.epmet.entity.ProjectCategoryEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -52,4 +53,12 @@ public interface ProjectCategoryDao extends BaseDao<ProjectCategoryEntity> {
* @Author sun
**/
List<ProjectCategoryDTO> selectProjectCategoryList(DelCategoryFormDTO formDTO);
/**
* @Description 根据项目ID查询项目分类
* @Param projectIds
* @author zxc
* @date 2021/5/17 10:47 上午
*/
List<ProjectCategoryDisPoseResultDTO> selectCategoryByIds(@Param("projectIds")List<String> projectIds);
}

10
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java

@ -154,4 +154,14 @@ public interface ProjectDao extends BaseDao<ProjectEntity> {
* @date 2021/5/12 10:29 上午
*/
List<ComplementedProjectEvaluateResultDTO> selectAllClosedProject();
/**
* @Description 查询时间段内的项目ID
* @Param agencyId
* @Param startDate
* @Param endDate
* @author zxc
* @date 2021/5/14 1:59 下午
*/
List<MassesDiscontentResultDTO> selectProjectIdByTime(@Param("agencyId")String agencyId,@Param("endDate")Integer endDate,@Param("startDate")Integer startDate);
}

10
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionStatisticsDao.java

@ -18,6 +18,8 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.MassesDiscontentResultDTO;
import com.epmet.dto.result.ProjectScoreResultDTO;
import com.epmet.entity.ProjectSatisfactionStatisticsEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -66,4 +68,12 @@ public interface ProjectSatisfactionStatisticsDao extends BaseDao<ProjectSatisfa
*/
ProjectSatisfactionStatisticsEntity selectInfoByProjectId(@Param("projectId")String projectId);
/**
* @Description 查询评价分数小于xx分的项目
* @Param projectIds
* @author zxc
* @date 2021/5/17 9:59 上午
*/
List<MassesDiscontentResultDTO> selectProjectByScore(@Param("projectIds")List<String> projectIds, @Param("setScore")Integer setScore, @Param("sortType")String sortType);
}

10
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectSatisfactionStatisticsService.java

@ -20,7 +20,9 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.ProjectSatisfactionStatisticsDTO;
import com.epmet.dto.form.MassesDiscontentFormDTO;
import com.epmet.dto.form.ProjectEvaluateScoreFormDTO;
import com.epmet.dto.result.MassesDiscontentResultDTO;
import com.epmet.dto.result.ProjectEvaluateScoreResultDTO;
import com.epmet.entity.ProjectSatisfactionStatisticsEntity;
@ -102,4 +104,12 @@ public interface ProjectSatisfactionStatisticsService extends BaseService<Projec
* @date 2021/5/13 11:18 上午
*/
ProjectEvaluateScoreResultDTO projectEvaluateScore(ProjectEvaluateScoreFormDTO formDTO);
/**
* @Description 群众不满
* @Param formDTO
* @author zxc
* @date 2021/5/14 10:46 上午
*/
List<MassesDiscontentResultDTO> massesDiscontent(MassesDiscontentFormDTO formDTO);
}

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

@ -21,24 +21,42 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.ProjectConstant;
import com.epmet.dao.ProjectCategoryDao;
import com.epmet.dao.ProjectDao;
import com.epmet.dao.ProjectSatisfactionStatisticsDao;
import com.epmet.dto.ProjectSatisfactionStatisticsDTO;
import com.epmet.dto.form.MassesDiscontentFormDTO;
import com.epmet.dto.form.ProjectEvaluateScoreFormDTO;
import com.epmet.dto.result.MassesDiscontentResultDTO;
import com.epmet.dto.result.ProjectCategoryDisPoseResultDTO;
import com.epmet.dto.result.ProjectEvaluateScoreResultDTO;
import com.epmet.dto.result.ProjectScoreResultDTO;
import com.epmet.entity.ProjectSatisfactionStatisticsEntity;
import com.epmet.feign.GovIssueOpenFeignClient;
import com.epmet.redis.ProjectSatisfactionStatisticsRedis;
import com.epmet.resi.group.dto.topic.result.TopicInfoResultDTO;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import com.epmet.service.ProjectSatisfactionStatisticsService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 项目满意度调查统计表
@ -51,6 +69,14 @@ public class ProjectSatisfactionStatisticsServiceImpl extends BaseServiceImpl<Pr
@Autowired
private ProjectSatisfactionStatisticsRedis projectSatisfactionStatisticsRedis;
@Autowired
private ProjectDao projectDao;
@Autowired
private ProjectCategoryDao projectCategoryDao;
@Autowired
private GovIssueOpenFeignClient issueOpenFeignClient;
@Autowired
private ResiGroupOpenFeignClient resiGroupOpenFeignClient;
@Override
public PageData<ProjectSatisfactionStatisticsDTO> page(Map<String, Object> params) {
@ -125,4 +151,80 @@ public class ProjectSatisfactionStatisticsServiceImpl extends BaseServiceImpl<Pr
return new ProjectEvaluateScoreResultDTO((noEvalScore + realEvalScore) / shouldEvaluateCount);
}
/**
* @Description 群众不满
* @Param formDTO
* @author zxc
* @date 2021/5/14 10:46 上午
*/
@Override
public List<MassesDiscontentResultDTO> massesDiscontent(MassesDiscontentFormDTO formDTO) {
List<MassesDiscontentResultDTO> projectIds = projectDao.selectProjectIdByTime(formDTO.getAgencyId(), getDateId("yesterday"), getDateId(formDTO.getTimeSection()));
if (CollectionUtils.isEmpty(projectIds)){
return new ArrayList<>();
}
PageInfo<MassesDiscontentResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectProjectByScore(projectIds.stream().map(m -> m.getProjectId()).collect(Collectors.toList()), NumConstant.SEVENTY_FIVE, formDTO.getSortType()));
List<MassesDiscontentResultDTO> projects = pageInfo.getList();
if (CollectionUtils.isEmpty(projects)){
return new ArrayList<>();
}
List<ProjectCategoryDisPoseResultDTO> projectCategoryDisPoseResultDTOS = projectCategoryDao.selectCategoryByIds(projects.stream().map(m -> m.getProjectId()).collect(Collectors.toList()));
List<ProjectCategoryDisPoseResultDTO> projectCategoryData = new ArrayList<>();
if (!CollectionUtils.isEmpty(projectCategoryDisPoseResultDTOS)){
Result<List<ProjectCategoryDisPoseResultDTO>> projectCategory = issueOpenFeignClient.getProjectCategory(projectCategoryDisPoseResultDTOS);
if (!projectCategory.success()){
throw new RenException("查询项目分类标签失败".concat(projectCategory.getMsg()));
}
projectCategoryData = projectCategory.getData();
}
Result<List<TopicInfoResultDTO>> topicInfos = resiGroupOpenFeignClient.getTopicInfos(projects.stream().map(m -> m.getIssueId()).collect(Collectors.toList()));
if (!topicInfos.success()){
throw new RenException("查询话题信息失败".concat(topicInfos.getMsg()));
}
List<ProjectCategoryDisPoseResultDTO> finalProjectCategoryData = projectCategoryData;
projects.forEach(p -> {
if (!CollectionUtils.isEmpty(finalProjectCategoryData)){
finalProjectCategoryData.forEach(cate -> {
if (p.getProjectId().equals(cate.getProjectId())){
p.setProjectCategory(cate.getProjectCategory());
}
});
}
if (!CollectionUtils.isEmpty(topicInfos.getData())){
topicInfos.getData().forEach(t -> {
if (p.getIssueId().equals(t.getIssueId())){
p.setGridName(t.getGridName());
p.setTopicContent(t.getTopicContent());
p.setPhotos(t.getPhotos());
}
});
}
});
return projects;
}
/**
* @Description 处理时间
* @Param dateType
* @author zxc
* @date 2021/5/18 2:28 下午
*/
public Integer getDateId(String dateType){
String beforeNDay = DateUtils.getBeforeNDay(NumConstant.ONE);
Integer result = Integer.valueOf(beforeNDay);
switch (dateType) {
case ProjectConstant.THREE_MONTH:
result = Integer.valueOf(DateUtils.getBeforeNDay(NumConstant.NINETY));
break;
case ProjectConstant.SIX_MONTH:
result = Integer.valueOf(DateUtils.getBeforeNDay(NumConstant.ONE_HUNDRED_AND_EIGHTY));
break;
case ProjectConstant.TWELVE_MONTH:
result = Integer.valueOf(DateUtils.getBeforeNDay(NumConstant.THREE_HUNDRED_AND_SIXTY_FIVE));
break;
default:
}
return result;
}
}

15
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectCategoryDao.xml

@ -35,4 +35,19 @@
project_id = #{projectId}
</delete>
<!-- 根据项目ID查询项目分类 -->
<select id="selectCategoryByIds" resultType="com.epmet.dto.result.ProjectCategoryDisPoseResultDTO">
SELECT
PROJECT_ID,
CATEGORY_CODE,
CUSTOMER_ID
FROM project_category
WHERE DEL_FLAG = '0'
AND (
<foreach collection="projectIds" item="projectId" separator=" OR ">
PROJECT_ID = #{projectId}
</foreach>
)
</select>
</mapper>

14
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml

@ -281,4 +281,18 @@
AND ORIGIN = 'issue'
AND `STATUS` = 'closed'
</select>
<!-- 查询时间段内的项目ID -->
<select id="selectProjectIdByTime" resultType="com.epmet.dto.result.MassesDiscontentResultDTO">
SELECT
ID AS projectId,
ORIGIN_ID AS issueId
FROM project
WHERE
DEL_FLAG = '0'
AND DATE_FORMAT(CREATED_TIME,'%Y%m%d') >= #{startDate}
AND DATE_FORMAT(CREATED_TIME,'%Y%m%d') <![CDATA[ <= ]]> #{endDate}
AND ORG_ID_PATH LIKE CONCAT('%',#{agencyId},'%')
</select>
</mapper>

24
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectSatisfactionStatisticsDao.xml

@ -41,5 +41,29 @@
select * from project_satisfaction_statistics where DEL_FLAG = '0' AND PROJECT_ID = #{projectId}
</select>
<!-- 查询评价分数小于xx分的项目 -->
<select id="selectProjectByScore" resultType="com.epmet.dto.result.MassesDiscontentResultDTO">
select a.* from
(SELECT
s.PROJECT_ID,
p.ORIGIN_ID AS issueId,
IFNULL((((s.SHOULD_EVALUATE_COUNT - s.GOOD_COUNT - s.BAD_COUNT - s.PERFECT_COUNT) * 80 + s.BAD_COUNT * 60 + s.GOOD_COUNT * 80 + s.PERFECT_COUNT * 100 )/ s.SHOULD_EVALUATE_COUNT),0) AS score
FROM project_satisfaction_statistics s
LEFT JOIN project p on p.id = s.PROJECT_ID AND p.DEL_FLAG = '0'
WHERE s.DEL_FLAG = '0'
AND (
<foreach collection="projectIds" item="projectId" separator=" OR ">
s.PROJECT_ID = #{projectId}
</foreach>
)) a
where score <![CDATA[ < ]]> #{setScore}
<if test="sortType == 'desc' ">
ORDER BY score DESC
</if>
<if test="sortType == 'asc' ">
ORDER BY score ASC
</if>
</select>
</mapper>

42
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicInfoResultDTO.java

@ -0,0 +1,42 @@
package com.epmet.resi.group.dto.topic.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2021/5/17 2:44 下午
* @DESC
*/
@Data
public class TopicInfoResultDTO implements Serializable {
private static final long serialVersionUID = 4068679301595597877L;
/**
* 议题ID
*/
private String issueId;
/**
* 话题所在网格
*/
private String gridName;
/**
* 网格ID
*/
private String gridId;
/**
* 话题图片
*/
private List<String> photos;
/**
* 话题内容
*/
private String topicContent;
}

11
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java

@ -10,6 +10,7 @@ import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO;
import com.epmet.resi.group.dto.topic.ResiTopicDTO;
import com.epmet.resi.group.dto.topic.form.*;
import com.epmet.resi.group.dto.topic.result.*;
import com.epmet.resi.group.dto.topic.result.TopicInfoResultDTO;
import com.epmet.resi.group.feign.fallback.ResiGroupOpenFeignClientFallback;
import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO;
import org.springframework.cloud.openfeign.FeignClient;
@ -269,4 +270,14 @@ public interface ResiGroupOpenFeignClient {
*/
@PostMapping("/resi/group/topic/allmessages")
Result<List<AllMessagesResultDTO>> allMessages(@RequestBody AllMessagesFormDTO formDTO);
/**
* @Description 查询话题信息
* @Param issueIds
* @author zxc
* @date 2021/5/17 4:19 下午
*/
@PostMapping("resi/group/topic/gettopicinfos")
Result<List<TopicInfoResultDTO>> getTopicInfos(@RequestBody List<String> issueIds);
}

6
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java

@ -21,6 +21,7 @@ import com.epmet.resi.group.dto.topic.result.MyPartIssueResultDTO;
import com.epmet.resi.group.dto.topic.result.ParticipatedTopicUnitResultDTO;
import com.epmet.resi.group.dto.group.form.CreateGroupCodeFormDTO;
import com.epmet.resi.group.dto.topic.result.TopicBelongGroupResultDTO;
import com.epmet.resi.group.dto.topic.result.TopicInfoResultDTO;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO;
import org.springframework.stereotype.Component;
@ -220,4 +221,9 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien
public Result<List<TopicCreatedUserBatchResultDTO>> topicCreatedUserBatch(List<String> topicIds) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "topicCreatedUserBatch", topicIds);
}
@Override
public Result<List<TopicInfoResultDTO>> getTopicInfos(List<String> issueIds) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getTopicInfos", issueIds);
}
}

11
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java

@ -508,4 +508,15 @@ public class ResiTopicController {
return new Result<List<TopicCreatedUserBatchResultDTO>>().ok(topicService.topicCreatedUserBatch(topicIds));
}
/**
* @Description 查询话题信息
* @Param issueIds
* @author zxc
* @date 2021/5/17 4:19 下午
*/
@PostMapping("gettopicinfos")
public Result<List<TopicInfoResultDTO>> getTopicInfos(@RequestBody List<String> issueIds){
return new Result<List<TopicInfoResultDTO>>().ok(topicService.getTopicInfos(issueIds));
}
}

8
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java

@ -224,4 +224,12 @@ public interface ResiTopicDao extends BaseDao<ResiTopicEntity> {
* @author sun
*/
int upTopicList(@Param("delIdList") List<String> delIdList, @Param("userId") String userId);
/**
* @Description 查询话题信息
* @Param issueIds
* @author zxc
* @date 2021/5/17 4:54 下午
*/
List<TopicInfoResultDTO> getTopicInfos(@Param("issueIds") List<String> issueIds);
}

8
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java

@ -407,4 +407,12 @@ public interface ResiTopicService extends BaseService<ResiTopicEntity> {
* @date 2021/5/12 9:16 上午
*/
List<TopicCreatedUserBatchResultDTO> topicCreatedUserBatch(List<String> topicIds);
/**
* @Description 查询话题信息
* @Param issueIds
* @author zxc
* @date 2021/5/17 4:19 下午
*/
List<TopicInfoResultDTO> getTopicInfos(List<String> issueIds);
}

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

@ -103,6 +103,7 @@ import com.epmet.resi.group.dto.topic.form.*;
import com.epmet.resi.group.dto.topic.result.CheckTopicPublisherResultDTO;
import com.epmet.resi.group.dto.topic.result.GovTopicIssueInfoResultDTO;
import com.epmet.resi.group.dto.topic.result.*;
import com.epmet.resi.group.dto.topic.result.TopicInfoResultDTO;
import com.epmet.send.SendMqMsgUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@ -2793,6 +2794,32 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
return result;
}
/**
* @Description 查询话题信息
* @Param issueIds
* @author zxc
* @date 2021/5/17 4:19 下午
*/
@Override
public List<TopicInfoResultDTO> getTopicInfos(List<String> issueIds) {
if (CollectionUtils.isEmpty(issueIds)){
return new ArrayList<>();
}
List<TopicInfoResultDTO> topicInfos = baseDao.getTopicInfos(issueIds);
Result<List<AllGridsByUserIdResultDTO>> gridNames = govOrgOpenFeignClient.getGridListByGridIds(topicInfos.stream().map(m -> m.getGridId()).collect(Collectors.toList()));
if (!gridNames.success()){
throw new RenException("查询网格Name失败");
}
topicInfos.forEach(t -> {
gridNames.getData().forEach(g -> {
if (t.getGridId().equals(g.getGridId())){
t.setGridName(g.getGridName());
}
});
});
return topicInfos;
}
}

25
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml

@ -606,5 +606,30 @@
</foreach>
</update>
<resultMap id="getTopicInfosMap" type="com.epmet.resi.group.dto.topic.result.TopicInfoResultDTO">
<result property="issueId" column="issueId"/>
<result property="gridId" column="gridId"/>
<result property="topicContent" column="topicContent"/>
<collection property="photos" ofType="java.lang.String">
<result column="imgUrl"/>
</collection>
</resultMap>
<select id="getTopicInfos" resultMap="getTopicInfosMap">
SELECT
t.TOPIC_CONTENT AS topicContent,
g.GRID_ID AS gridId,
ta.ATTACHMENT_URL AS imgUrl,
t.ISSUE_ID AS issueId
FROM resi_topic t
LEFT JOIN resi_group g ON g.ID = t.GROUP_ID AND g.DEL_FLAG = '0'
LEFT JOIN resi_topic_attachment ta ON t.ID = ta.TOPIC_ID AND ta.DEL_FLAG = '0' AND ta.ATTACHMENT_TYPE = 'image' AND (ta.SORT = 0 OR ta.SORT = 1 OR ta.SORT = 2)
WHERE t.DEL_FLAG = '0'
AND (
<foreach collection="issueIds" item="issueId" separator=" OR ">
t.ISSUE_ID = #{issueId}
</foreach>
)
</select>
</mapper>

Loading…
Cancel
Save