Browse Source

网格小组,话题

master
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. 30
      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;
/**
* 数据更新至 时间

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

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

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

Loading…
Cancel
Save