Browse Source

网格小组,话题

dev_shibei_match
zxc 5 years ago
parent
commit
55e0821428
  1. 6
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryInfoResultDTO.java
  2. 10
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryResultDTO.java
  3. 8
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java
  4. 1
      epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml

6
epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryInfoResultDTO.java

@ -16,15 +16,15 @@ public class TopicSummaryInfoResultDTO implements Serializable {
/** /**
* 名称 * 名称
*/ */
private String name; private String name = "";
/** /**
* *
*/ */
private Integer value; private Integer value = 0;
/** /**
* 百分比 * 百分比
*/ */
private String ratio; private String ratio = "0.0%";
} }

10
epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryResultDTO.java

@ -16,27 +16,27 @@ public class TopicSummaryResultDTO implements Serializable {
/** /**
* 话题总数 * 话题总数
*/ */
private Integer topicTotalCount; private Integer topicTotalCount = 0;
/** /**
* 讨论中话题数量 * 讨论中话题数量
*/ */
private Integer talkingTotalCount; private Integer talkingTotalCount = 0;
/** /**
* 已关闭话题数量 * 已关闭话题数量
*/ */
private Integer closedTotalCount; private Integer closedTotalCount = 0;
/** /**
* 已屏蔽话题数量 * 已屏蔽话题数量
*/ */
private Integer shieldedTotalCount; private Integer shieldedTotalCount = 0;
/** /**
* 话题已转议题数量 * 话题已转议题数量
*/ */
private Integer shiftedTotalCount; private Integer shiftedTotalCount = 0;
/** /**
* 数据更新至 时间 * 数据更新至 时间

8
epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java

@ -14,6 +14,7 @@ import org.springframework.beans.BeanUtils;
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 java.time.LocalDate;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -39,6 +40,7 @@ public class TopicServiceImpl implements TopicService {
TopicSummaryResultDTO result = new TopicSummaryResultDTO(); TopicSummaryResultDTO result = new TopicSummaryResultDTO();
String agencyId = this.getLoginUserDetails(tokenDto); String agencyId = this.getLoginUserDetails(tokenDto);
List<TopicStatusResultDTO> topicStatus = topicDao.getTopicStatus(agencyId); List<TopicStatusResultDTO> topicStatus = topicDao.getTopicStatus(agencyId);
result.setDeadline(LocalDate.now().minusDays(NumConstant.ONE).toString());
if (topicStatus.size() != NumConstant.ZERO){ if (topicStatus.size() != NumConstant.ZERO){
topicStatus.forEach(topic -> { topicStatus.forEach(topic -> {
if (topic.getTopicStatus().equals(TopicConstant.DISCUSSING)){ if (topic.getTopicStatus().equals(TopicConstant.DISCUSSING)){
@ -50,12 +52,12 @@ public class TopicServiceImpl implements TopicService {
} }
}); });
result.setTopicTotalCount(topicStatus.stream().collect(Collectors.summingInt(TopicStatusResultDTO::getTopicCount))); result.setTopicTotalCount(topicStatus.stream().collect(Collectors.summingInt(TopicStatusResultDTO::getTopicCount)));
}
TopicShiftedCountResultDTO shiftedCount = topicDao.getShiftedCount(agencyId); TopicShiftedCountResultDTO shiftedCount = topicDao.getShiftedCount(agencyId);
if (shiftedCount != null){ if (shiftedCount != null){
result.setShiftedTotalCount(shiftedCount.getShiftedIssueCount()); result.setShiftedTotalCount(shiftedCount.getShiftedIssueCount());
result.setDeadline(shiftedCount.getDeadline()); result.setDeadline(shiftedCount.getDeadline());
} }
}
return result; return result;
} }
@ -178,14 +180,16 @@ public class TopicServiceImpl implements TopicService {
String agencyId = this.getLoginUserDetails(tokenDto); String agencyId = this.getLoginUserDetails(tokenDto);
List<TopicSummaryInfoResultDTO> topicSummaryInfo = topicDao.topicSummaryInfo(agencyId); List<TopicSummaryInfoResultDTO> topicSummaryInfo = topicDao.topicSummaryInfo(agencyId);
TopicShiftedCountResultDTO shiftedCount = topicDao.getShiftedCount(agencyId); TopicShiftedCountResultDTO shiftedCount = topicDao.getShiftedCount(agencyId);
if (topicSummaryInfo.size() != NumConstant.ZERO && shiftedCount != null) {
Integer collect = topicSummaryInfo.stream().collect(Collectors.summingInt(TopicSummaryInfoResultDTO::getValue)); Integer collect = topicSummaryInfo.stream().collect(Collectors.summingInt(TopicSummaryInfoResultDTO::getValue));
String ratio; String ratio;
ratio = collect == NumConstant.ZERO ? NumConstant.ZERO + TopicConstant.RATIO : ((float)shiftedCount.getShiftedIssueCount() / (float)collect) * NumConstant.ONE_HUNDRED + TopicConstant.RATIO; ratio = collect == NumConstant.ZERO ? NumConstant.ZERO + TopicConstant.RATIO : ((float) shiftedCount.getShiftedIssueCount() / (float) collect) * NumConstant.ONE_HUNDRED + TopicConstant.RATIO;
TopicSummaryInfoResultDTO result = new TopicSummaryInfoResultDTO(); TopicSummaryInfoResultDTO result = new TopicSummaryInfoResultDTO();
result.setName(TopicConstant.SHIFTED); result.setName(TopicConstant.SHIFTED);
result.setRatio(ratio); result.setRatio(ratio);
result.setValue(shiftedCount.getShiftedIssueCount()); result.setValue(shiftedCount.getShiftedIssueCount());
topicSummaryInfo.add(result); topicSummaryInfo.add(result);
}
return topicSummaryInfo; return topicSummaryInfo;
} }

1
epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml

@ -28,6 +28,7 @@
WHERE WHERE
del_flag = '0' del_flag = '0'
AND pid = #{agencyId} AND pid = #{agencyId}
AND agency_dim_type = 'all'
</select> </select>
<!--获取下级机关的小组数--> <!--获取下级机关的小组数-->

Loading…
Cancel
Save