|
|
@ -78,29 +78,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()))); |
|
|
|
|
|
|
@ -404,16 +407,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 +426,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 +433,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 +447,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()))); |
|
|
@ -504,12 +511,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 +526,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 +533,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 +547,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()))); |
|
|
|