| 
						
						
							
								
							
						
						
					 | 
					@ -9,6 +9,8 @@ import com.epmet.dataaggre.dao.datastats.DataStatsDao; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO; | 
					 | 
					 | 
					import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.dataaggre.dto.datastats.form.*; | 
					 | 
					 | 
					import com.epmet.dataaggre.dto.datastats.form.*; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.dataaggre.dto.datastats.result.*; | 
					 | 
					 | 
					import com.epmet.dataaggre.dto.datastats.result.*; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; | 
					 | 
					 | 
					import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO; | 
					 | 
					 | 
					import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; | 
					 | 
					 | 
					import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -52,6 +54,7 @@ public class DataStatsServiceImpl implements DataStatsService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    @Override | 
					 | 
					 | 
					    @Override | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    public AgencyBasicDataResultDTO agencyBasicData(AgenctBasicDataFormDTO formDTO) { | 
					 | 
					 | 
					    public AgencyBasicDataResultDTO agencyBasicData(AgenctBasicDataFormDTO formDTO) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        AgencyBasicDataResultDTO resultDTO = new AgencyBasicDataResultDTO(); | 
					 | 
					 | 
					        AgencyBasicDataResultDTO resultDTO = new AgencyBasicDataResultDTO(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        List<String> agencyList = new ArrayList<>(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        resultDTO.setAgencyId(formDTO.getAgencyId()); | 
					 | 
					 | 
					        resultDTO.setAgencyId(formDTO.getAgencyId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        NumberFormat numberFormat = NumberFormat.getInstance(); | 
					 | 
					 | 
					        NumberFormat numberFormat = NumberFormat.getInstance(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        numberFormat.setMaximumFractionDigits(NumConstant.THREE); | 
					 | 
					 | 
					        numberFormat.setMaximumFractionDigits(NumConstant.THREE); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -63,78 +66,102 @@ public class DataStatsServiceImpl implements DataStatsService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            formDTO.setDateId(format.format(yesterday)); | 
					 | 
					 | 
					            formDTO.setDateId(format.format(yesterday)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        //1.查询组织下注册用户最新日统计数据【只查询注册用户的统计数据,不涉及参与用户的】
 | 
					 | 
					 | 
					        //0.判断level是否有值,有值判断areaCode是否有值,没值直接用agencyId查数据,有值查询不是当前agencyId对应客户的areaCode的下级组织列表
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        AgencyBasicDataResultDTO user = dataStatsDao.getAgnecyRegUser(formDTO.getAgencyId(), formDTO.getDateId()); | 
					 | 
					 | 
					        if(StringUtils.isNotBlank(formDTO.getLevel())&&!"community".equals(formDTO.getLevel())&&StringUtils.isNotBlank(formDTO.getAreaCode())){ | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        if (null != user) { | 
					 | 
					 | 
					            agencyList = indexService.getAgencyByAreaCodeAgencyId(formDTO.getAgencyId(), formDTO.getAreaCode()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					            resultDTO.setUserTotal(user.getUserTotal()); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            resultDTO.setResiTotal(user.getResiTotal()); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            resultDTO.setResiRatio(user.getResiTotal() == 0 || user.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) user.getResiTotal() / (float) user.getUserTotal()))); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            resultDTO.setPartyMemberTotal(user.getPartyMemberTotal()); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            resultDTO.setPartyMemberRatio(user.getPartyMemberTotal() == 0 || user.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) user.getPartyMemberTotal() / (float) user.getUserTotal()))); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        agencyList.add(formDTO.getAgencyId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        //1.查询组织下注册用户最新日统计数据【只查询注册用户的统计数据,不涉及参与用户的】
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        List<AgencyBasicDataResultDTO> userList = dataStatsDao.getAgnecyRegUser(agencyList, formDTO.getDateId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        int userTotal = 0; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        int resiTotal = 0; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        int partyMemberTotal = 0; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        for (AgencyBasicDataResultDTO u : userList){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            userTotal+=u.getUserTotal(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            resiTotal+=u.getResiTotal(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            partyMemberTotal+=u.getPartyMemberTotal(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        resultDTO.setUserTotal(userTotal); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        resultDTO.setResiTotal(resiTotal); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        resultDTO.setResiRatio(resultDTO.getResiTotal() == 0 || resultDTO.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getResiTotal() / (float) resultDTO.getUserTotal()))); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        resultDTO.setPartyMemberTotal(partyMemberTotal); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        resultDTO.setPartyMemberRatio(resultDTO.getPartyMemberTotal() == 0 || resultDTO.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getPartyMemberTotal() / (float) resultDTO.getUserTotal()))); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //2.查询组织下最新群组日统计数据
 | 
					 | 
					 | 
					        //2.查询组织下最新群组日统计数据
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        AgencyBasicDataResultDTO group = dataStatsDao.getAgnecyGroup(formDTO.getAgencyId(), formDTO.getDateId()); | 
					 | 
					 | 
					        List<AgencyBasicDataResultDTO> groupList = dataStatsDao.getAgnecyGroup(agencyList, formDTO.getDateId()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        if (null != group) { | 
					 | 
					 | 
					        int groupTotal = 0; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            resultDTO.setGroupTotal(group.getGroupTotal()); | 
					 | 
					 | 
					        int ordinaryTotal = 0; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            resultDTO.setOrdinaryTotal(group.getOrdinaryTotal()); | 
					 | 
					 | 
					        int branchTotal = 0; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            resultDTO.setOrdinaryRatio(group.getOrdinaryTotal() == 0 || group.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) group.getOrdinaryTotal() / (float) group.getGroupTotal()))); | 
					 | 
					 | 
					        for (AgencyBasicDataResultDTO g : groupList){ | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            resultDTO.setBranchTotal(group.getBranchTotal()); | 
					 | 
					 | 
					            groupTotal+=g.getGroupTotal(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            resultDTO.setBranchRatio(group.getBranchTotal() == 0 || group.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) group.getBranchTotal() / (float) group.getGroupTotal()))); | 
					 | 
					 | 
					            ordinaryTotal+=g.getOrdinaryTotal(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        } | 
					 | 
					 | 
					            branchTotal+=g.getBranchTotal(); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        resultDTO.setGroupTotal(groupTotal); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        resultDTO.setOrdinaryTotal(ordinaryTotal); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        resultDTO.setOrdinaryRatio(resultDTO.getOrdinaryTotal() == 0 || resultDTO.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getOrdinaryTotal() / (float) resultDTO.getGroupTotal()))); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        resultDTO.setBranchTotal(branchTotal); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        resultDTO.setBranchRatio(resultDTO.getBranchTotal() == 0 || resultDTO.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getBranchTotal() / (float) resultDTO.getGroupTotal()))); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //3.查询组织下最新话题日统计数据
 | 
					 | 
					 | 
					        //3.查询组织下最新话题日统计数据
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //状态话题-机关日统计数据表最新日期三种状态数据
 | 
					 | 
					 | 
					        //状态话题-机关日统计数据表最新日期三种状态数据
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念
 | 
					 | 
					 | 
					        //机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<AgencyBasicDataResultDTO.Topic> topic = dataStatsDao.getAgencyTopic(formDTO.getAgencyId(), formDTO.getDateId()); | 
					 | 
					 | 
					        List<AgencyBasicDataResultDTO.Topic> topic = dataStatsDao.getAgencyTopic(agencyList, formDTO.getDateId()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        //转议题话题-机关日统计数据表
 | 
					 | 
					 | 
					        //转议题话题-机关日统计数据表
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        AgencyBasicDataResultDTO.Topic topicSHiftIssue = dataStatsDao.getAgencyTopicShiftIssue(formDTO.getAgencyId(), formDTO.getDateId()); | 
					 | 
					 | 
					        List<AgencyBasicDataResultDTO.Topic> topicSHiftIssue = dataStatsDao.getAgencyTopicShiftIssue(agencyList, formDTO.getDateId()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        //热议中话题-机关日统计数据
 | 
					 | 
					 | 
					        //热议中话题-机关日统计数据
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        AgencyBasicDataResultDTO.Topic hotdiscuss = dataStatsDao.getAgencyTopicHotDiscuss(formDTO.getAgencyId(), formDTO.getDateId()); | 
					 | 
					 | 
					        List<AgencyBasicDataResultDTO.Topic> hotdiscuss = dataStatsDao.getAgencyTopicHotDiscuss(agencyList, formDTO.getDateId()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        AtomicReference<Integer> closedTotal = new AtomicReference<>(0); | 
					 | 
					 | 
					        //话题总数
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        if (topic.size() > NumConstant.ZERO) { | 
					 | 
					 | 
					        resultDTO.setTopicTotal(topic.stream().collect(Collectors.summingInt(AgencyBasicDataResultDTO.Topic::getTopicCount))); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            resultDTO.setTopicTotal(topic.stream().collect(Collectors.summingInt(AgencyBasicDataResultDTO.Topic::getTopicCount))); | 
					 | 
					 | 
					        int closedTotal = topic.stream().filter(t -> t.getTopicStatus().equals("closed")).mapToInt(AgencyBasicDataResultDTO.Topic::getTopicCount).sum(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					            topic.forEach(t -> { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                if (t.getTopicStatus().equals("closed")) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    closedTotal.set(t.getTopicCount()); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            }); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        //转议题
 | 
					 | 
					 | 
					        //转议题
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        if (null != topicSHiftIssue) { | 
					 | 
					 | 
					        int shiftIssueTotal = topicSHiftIssue.stream().mapToInt(AgencyBasicDataResultDTO.Topic::getShiftedIssueTotal).sum(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            resultDTO.setShiftIssueTotal(topicSHiftIssue.getShiftedIssueTotal()); | 
					 | 
					 | 
					        resultDTO.setShiftIssueTotal(shiftIssueTotal); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            resultDTO.setShiftIssueRatio(resultDTO.getShiftIssueTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftIssueTotal() / (float) resultDTO.getTopicTotal()))); | 
					 | 
					 | 
					        resultDTO.setShiftIssueRatio(resultDTO.getShiftIssueTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftIssueTotal() / (float) resultDTO.getTopicTotal()))); | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        //热议中
 | 
					 | 
					 | 
					        //热议中
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        if (null != hotdiscuss) { | 
					 | 
					 | 
					        int discussingTotal = hotdiscuss.stream().mapToInt(AgencyBasicDataResultDTO.Topic::getTopicCount).sum(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            resultDTO.setDiscussingTotal(hotdiscuss.getTopicCount()); | 
					 | 
					 | 
					        resultDTO.setDiscussingTotal(discussingTotal); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); | 
					 | 
					 | 
					        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.setClosedTopicTotal(closedTotal); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); | 
					 | 
					 | 
					        resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //4.查询组织下最新议题日统计数据
 | 
					 | 
					 | 
					        //4.查询组织下最新议题日统计数据
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        AgencyBasicDataResultDTO issue = dataStatsDao.getAgencyIssue(formDTO.getAgencyId(), formDTO.getDateId()); | 
					 | 
					 | 
					        List<AgencyBasicDataResultDTO> issueList = dataStatsDao.getAgencyIssue(agencyList, formDTO.getDateId()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        if (null != issue) { | 
					 | 
					 | 
					        int issueTotal = 0; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            resultDTO.setIssueTotal(issue.getIssueTotal()); | 
					 | 
					 | 
					        int votingTotal = 0; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            resultDTO.setVotingTotal(issue.getVotingTotal()); | 
					 | 
					 | 
					        int closedIssueTotal = 0; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            resultDTO.setVotingRatio(resultDTO.getVotingTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getVotingTotal() / (float) resultDTO.getIssueTotal()))); | 
					 | 
					 | 
					        int shiftProjectTotal = 0; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            resultDTO.setClosedIssueTotal(issue.getClosedIssueTotal()); | 
					 | 
					 | 
					        for (AgencyBasicDataResultDTO i : issueList){ | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            resultDTO.setClosedIssueRatio(resultDTO.getClosedIssueTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedIssueTotal() / (float) resultDTO.getIssueTotal()))); | 
					 | 
					 | 
					            issueTotal+=i.getIssueTotal(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            resultDTO.setShiftProjectTotal(issue.getShiftProjectTotal()); | 
					 | 
					 | 
					            votingTotal+=i.getVotingTotal(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            resultDTO.setShiftProjectRatio(resultDTO.getShiftProjectTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftProjectTotal() / (float) resultDTO.getIssueTotal()))); | 
					 | 
					 | 
					            closedIssueTotal+=i.getClosedIssueTotal(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        } | 
					 | 
					 | 
					            shiftProjectTotal+=i.getShiftProjectTotal(); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        resultDTO.setIssueTotal(issueTotal); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        resultDTO.setVotingTotal(votingTotal); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        resultDTO.setVotingRatio(resultDTO.getVotingTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getVotingTotal() / (float) resultDTO.getIssueTotal()))); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        resultDTO.setClosedIssueTotal(closedIssueTotal); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        resultDTO.setClosedIssueRatio(resultDTO.getClosedIssueTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedIssueTotal() / (float) resultDTO.getIssueTotal()))); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        resultDTO.setShiftProjectTotal(shiftProjectTotal); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        resultDTO.setShiftProjectRatio(resultDTO.getShiftProjectTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftProjectTotal() / (float) resultDTO.getIssueTotal()))); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //5.查询组织下最新项目日统计数据
 | 
					 | 
					 | 
					        //5.查询组织下最新项目日统计数据
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        AgencyBasicDataResultDTO project = dataStatsDao.getAgencyProject(formDTO.getAgencyId(), formDTO.getDateId()); | 
					 | 
					 | 
					        List<AgencyBasicDataResultDTO> projectList = dataStatsDao.getAgencyProject(agencyList, formDTO.getDateId()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        if (null != project) { | 
					 | 
					 | 
					        int projectTotal = 0; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            resultDTO.setProjectTotal(project.getProjectTotal()); | 
					 | 
					 | 
					        int pendingTotal = 0; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            resultDTO.setPendingTotal(project.getPendingTotal()); | 
					 | 
					 | 
					        int closedProjectTotal = 0; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            resultDTO.setPendingRatio(resultDTO.getPendingTotal() == 0 || resultDTO.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getPendingTotal() / (float) resultDTO.getProjectTotal()))); | 
					 | 
					 | 
					        for (AgencyBasicDataResultDTO p : projectList){ | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            resultDTO.setClosedProjectTotal(project.getClosedProjectTotal()); | 
					 | 
					 | 
					            projectTotal+=p.getProjectTotal(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            resultDTO.setClosedProjectRatio(resultDTO.getClosedProjectTotal() == 0 || resultDTO.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedProjectTotal() / (float) resultDTO.getProjectTotal()))); | 
					 | 
					 | 
					            pendingTotal+=p.getPendingTotal(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        } | 
					 | 
					 | 
					            closedProjectTotal+=p.getClosedProjectTotal(); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        resultDTO.setProjectTotal(projectTotal); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        resultDTO.setPendingTotal(pendingTotal); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        resultDTO.setPendingRatio(resultDTO.getPendingTotal() == 0 || resultDTO.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getPendingTotal() / (float) resultDTO.getProjectTotal()))); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        resultDTO.setClosedProjectTotal(closedProjectTotal); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        resultDTO.setClosedProjectRatio(resultDTO.getClosedProjectTotal() == 0 || resultDTO.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedProjectTotal() / (float) resultDTO.getProjectTotal()))); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        return resultDTO; | 
					 | 
					 | 
					        return resultDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -258,23 +285,23 @@ public class DataStatsServiceImpl implements DataStatsService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            formDTO.setType("user"); | 
					 | 
					 | 
					            formDTO.setType("user"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        //1.查询当前组织的直属下级组织信息【机关维度】
 | 
					 | 
					 | 
					        //1.查询直属下级组织列表,有areaCode的按areaCode查,没有的按agencyId查
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); | 
					 | 
					 | 
					        List<ScreenCustomerAgencyDTO> subAgencyList = indexService.getSubAgencyList(formDTO.getAgencyId(), formDTO.getAreaCode()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        if (subAgencyList.size() < NumConstant.ONE) { | 
					 | 
					 | 
					        if (subAgencyList.size() < NumConstant.ONE) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            return resultList; | 
					 | 
					 | 
					            return resultList; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<String> agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); | 
					 | 
					 | 
					        List<String> agencyIds = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //2.查询直属下级组织注册用户日统计数据,默认按用户总数降序
 | 
					 | 
					 | 
					        //2.查询直属下级组织注册用户日统计数据,默认按用户总数降序
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        List<SubAgencyUserResultDTO> list = dataStatsDao.getSubAgencyUser(agencyIds, formDTO.getDateId()); | 
					 | 
					 | 
					        List<SubAgencyUserResultDTO> list = dataStatsDao.getSubAgencyUser(agencyIds, formDTO.getDateId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //3.封装数据
 | 
					 | 
					 | 
					        //3.封装数据
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        for (DimAgencyEntity sub : subAgencyList) { | 
					 | 
					 | 
					        for (ScreenCustomerAgencyDTO sub : subAgencyList) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            SubAgencyUserResultDTO dto = new SubAgencyUserResultDTO(); | 
					 | 
					 | 
					            SubAgencyUserResultDTO dto = new SubAgencyUserResultDTO(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            dto.setAgencyId(sub.getId()); | 
					 | 
					 | 
					            dto.setAgencyId(sub.getAgencyId()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            dto.setAgencyName(sub.getAgencyName()); | 
					 | 
					 | 
					            dto.setAgencyName(sub.getAgencyName()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            for (SubAgencyUserResultDTO u : list) { | 
					 | 
					 | 
					            for (SubAgencyUserResultDTO u : list) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                if (sub.getId().equals(u.getAgencyId())) { | 
					 | 
					 | 
					                if (sub.getAgencyId().equals(u.getAgencyId())) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                    dto.setUserTotal(u.getUserTotal()); | 
					 | 
					 | 
					                    dto.setUserTotal(u.getUserTotal()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    dto.setPartyMemberTotal(u.getPartyMemberTotal()); | 
					 | 
					 | 
					                    dto.setPartyMemberTotal(u.getPartyMemberTotal()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    dto.setResiTotal(u.getResiTotal()); | 
					 | 
					 | 
					                    dto.setResiTotal(u.getResiTotal()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -327,23 +354,23 @@ public class DataStatsServiceImpl implements DataStatsService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            formDTO.setType("user"); | 
					 | 
					 | 
					            formDTO.setType("user"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        //1.查询组织直属网格列表【网格维度】
 | 
					 | 
					 | 
					        //1.查询指标库组织直属网格列表【这个客户组织网格数据包括小程序的和项目上报的】
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); | 
					 | 
					 | 
					        List<ScreenCustomerGridDTO> gridList = indexService.getSubGridList(formDTO.getAgencyId()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        if (gridList.size() < NumConstant.ONE) { | 
					 | 
					 | 
					        if (gridList.size() < NumConstant.ONE) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            return resultList; | 
					 | 
					 | 
					            return resultList; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<String> gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); | 
					 | 
					 | 
					        List<String> gridIds = gridList.stream().map(ScreenCustomerGridDTO::getGridId).collect(Collectors.toList()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //2.查询网格层级注册用户日统计数据,默认按用户总数降序
 | 
					 | 
					 | 
					        //2.查询网格层级注册用户日统计数据,默认按用户总数降序
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        List<SubGridUserResultDTO> list = dataStatsDao.getSubGridUser(gridIds, formDTO.getDateId()); | 
					 | 
					 | 
					        List<SubGridUserResultDTO> list = dataStatsDao.getSubGridUser(gridIds, formDTO.getDateId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //3.封装数据
 | 
					 | 
					 | 
					        //3.封装数据
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        for (DimGridEntity gr : gridList) { | 
					 | 
					 | 
					        for (ScreenCustomerGridDTO gr : gridList) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            SubGridUserResultDTO dto = new SubGridUserResultDTO(); | 
					 | 
					 | 
					            SubGridUserResultDTO dto = new SubGridUserResultDTO(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            dto.setGridId(gr.getId()); | 
					 | 
					 | 
					            dto.setGridId(gr.getGridId()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            dto.setGridName(gr.getGridName()); | 
					 | 
					 | 
					            dto.setGridName(gr.getGridName()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            for (SubGridUserResultDTO re : list) { | 
					 | 
					 | 
					            for (SubGridUserResultDTO re : list) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                if (gr.getId().equals(re.getGridId())) { | 
					 | 
					 | 
					                if (gr.getGridId().equals(re.getGridId())) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                    dto.setUserTotal(re.getUserTotal()); | 
					 | 
					 | 
					                    dto.setUserTotal(re.getUserTotal()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    dto.setPartyMemberTotal(re.getPartyMemberTotal()); | 
					 | 
					 | 
					                    dto.setPartyMemberTotal(re.getPartyMemberTotal()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    dto.setResiTotal(re.getResiTotal()); | 
					 | 
					 | 
					                    dto.setResiTotal(re.getResiTotal()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -394,23 +421,23 @@ public class DataStatsServiceImpl implements DataStatsService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            formDTO.setType("group"); | 
					 | 
					 | 
					            formDTO.setType("group"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        //1.查询当前组织的直属下级组织信息【机关维度】
 | 
					 | 
					 | 
					        //1.查询直属下级组织列表,有areaCode的按areaCode查,没有的按agencyId查
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); | 
					 | 
					 | 
					        List<ScreenCustomerAgencyDTO> subAgencyList = indexService.getSubAgencyList(formDTO.getAgencyId(), formDTO.getAreaCode()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        if (subAgencyList.size() < NumConstant.ONE) { | 
					 | 
					 | 
					        if (subAgencyList.size() < NumConstant.ONE) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            return resultList; | 
					 | 
					 | 
					            return resultList; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<String> agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); | 
					 | 
					 | 
					        List<String> agencyIds = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //2.查询直属下级组织小组日统计数据,默认按群组总数降序
 | 
					 | 
					 | 
					        //2.查询直属下级组织小组日统计数据,默认按群组总数降序
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        List<SubAgencyGroupResultDTO> list = dataStatsDao.getSubAgencyGroup(agencyIds, formDTO.getDateId()); | 
					 | 
					 | 
					        List<SubAgencyGroupResultDTO> list = dataStatsDao.getSubAgencyGroup(agencyIds, formDTO.getDateId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //3.封装数据
 | 
					 | 
					 | 
					        //3.封装数据
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        for (DimAgencyEntity sub : subAgencyList) { | 
					 | 
					 | 
					        for (ScreenCustomerAgencyDTO sub : subAgencyList) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            SubAgencyGroupResultDTO dto = new SubAgencyGroupResultDTO(); | 
					 | 
					 | 
					            SubAgencyGroupResultDTO dto = new SubAgencyGroupResultDTO(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            dto.setAgencyId(sub.getId()); | 
					 | 
					 | 
					            dto.setAgencyId(sub.getAgencyId()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            dto.setAgencyName(sub.getAgencyName()); | 
					 | 
					 | 
					            dto.setAgencyName(sub.getAgencyName()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            for (SubAgencyGroupResultDTO u : list) { | 
					 | 
					 | 
					            for (SubAgencyGroupResultDTO u : list) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                if (sub.getId().equals(u.getAgencyId())) { | 
					 | 
					 | 
					                if (sub.getAgencyId().equals(u.getAgencyId())) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                    dto.setGroupTotal(u.getGroupTotal()); | 
					 | 
					 | 
					                    dto.setGroupTotal(u.getGroupTotal()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    dto.setOrdinaryTotal(u.getOrdinaryTotal()); | 
					 | 
					 | 
					                    dto.setOrdinaryTotal(u.getOrdinaryTotal()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    dto.setBranchTotal(u.getBranchTotal()); | 
					 | 
					 | 
					                    dto.setBranchTotal(u.getBranchTotal()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -460,23 +487,23 @@ public class DataStatsServiceImpl implements DataStatsService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            formDTO.setType("group"); | 
					 | 
					 | 
					            formDTO.setType("group"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        //1.查询组织直属网格列表【网格维度】
 | 
					 | 
					 | 
					        //1.查询指标库组织直属网格列表【这个客户组织网格数据包括小程序的和项目上报的】
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); | 
					 | 
					 | 
					        List<ScreenCustomerGridDTO> gridList = indexService.getSubGridList(formDTO.getAgencyId()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        if (gridList.size() < NumConstant.ONE) { | 
					 | 
					 | 
					        if (gridList.size() < NumConstant.ONE) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            return resultList; | 
					 | 
					 | 
					            return resultList; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<String> gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); | 
					 | 
					 | 
					        List<String> gridIds = gridList.stream().map(ScreenCustomerGridDTO::getGridId).collect(Collectors.toList()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //2.查询网格层级小组日统计数据,默认按群组总数降序
 | 
					 | 
					 | 
					        //2.查询网格层级小组日统计数据,默认按群组总数降序
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        List<SubGridGroupResultDTO> list = dataStatsDao.getSubGridGroup(gridIds, formDTO.getDateId()); | 
					 | 
					 | 
					        List<SubGridGroupResultDTO> list = dataStatsDao.getSubGridGroup(gridIds, formDTO.getDateId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //3.封装数据并返回
 | 
					 | 
					 | 
					        //3.封装数据并返回
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        for (DimGridEntity gr : gridList) { | 
					 | 
					 | 
					        for (ScreenCustomerGridDTO gr : gridList) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            SubGridGroupResultDTO dto = new SubGridGroupResultDTO(); | 
					 | 
					 | 
					            SubGridGroupResultDTO dto = new SubGridGroupResultDTO(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            dto.setGridId(gr.getId()); | 
					 | 
					 | 
					            dto.setGridId(gr.getGridId()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            dto.setGridName(gr.getGridName()); | 
					 | 
					 | 
					            dto.setGridName(gr.getGridName()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            for (SubGridGroupResultDTO re : list) { | 
					 | 
					 | 
					            for (SubGridGroupResultDTO re : list) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                if (gr.getId().equals(re.getGridId())) { | 
					 | 
					 | 
					                if (gr.getGridId().equals(re.getGridId())) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                    dto.setGroupTotal(re.getGroupTotal()); | 
					 | 
					 | 
					                    dto.setGroupTotal(re.getGroupTotal()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    dto.setOrdinaryTotal(re.getOrdinaryTotal()); | 
					 | 
					 | 
					                    dto.setOrdinaryTotal(re.getOrdinaryTotal()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    dto.setBranchTotal(re.getBranchTotal()); | 
					 | 
					 | 
					                    dto.setBranchTotal(re.getBranchTotal()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -527,12 +554,12 @@ public class DataStatsServiceImpl implements DataStatsService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            formDTO.setType("topic"); | 
					 | 
					 | 
					            formDTO.setType("topic"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        //1.查询当前组织的直属下级组织信息【机关维度】
 | 
					 | 
					 | 
					        //1.查询直属下级组织列表,有areaCode的按areaCode查,没有的按agencyId查
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); | 
					 | 
					 | 
					        List<ScreenCustomerAgencyDTO> subAgencyList = indexService.getSubAgencyList(formDTO.getAgencyId(), formDTO.getAreaCode()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        if (subAgencyList.size() < NumConstant.ONE) { | 
					 | 
					 | 
					        if (subAgencyList.size() < NumConstant.ONE) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            return resultList; | 
					 | 
					 | 
					            return resultList; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<String> agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); | 
					 | 
					 | 
					        List<String> agencyIds = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //2.查询直属下级组织状态话题-日统计数据
 | 
					 | 
					 | 
					        //2.查询直属下级组织状态话题-日统计数据
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念
 | 
					 | 
					 | 
					        //机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -548,7 +575,7 @@ public class DataStatsServiceImpl implements DataStatsService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            AtomicInteger shiftIssueTotal = new AtomicInteger(0); | 
					 | 
					 | 
					            AtomicInteger shiftIssueTotal = new AtomicInteger(0); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            AtomicInteger hotdiscussTotal = new AtomicInteger(0); | 
					 | 
					 | 
					            AtomicInteger hotdiscussTotal = new AtomicInteger(0); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            topic.forEach(t -> { | 
					 | 
					 | 
					            topic.forEach(t -> { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                if (t.getAgencyId().equals(sub.getId())) { | 
					 | 
					 | 
					                if (t.getAgencyId().equals(sub.getAgencyId())) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                    topicTotal.addAndGet(t.getTopicCount()); | 
					 | 
					 | 
					                    topicTotal.addAndGet(t.getTopicCount()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    if (t.getTopicStatus().equals("closed")) { | 
					 | 
					 | 
					                    if (t.getTopicStatus().equals("closed")) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        closedTotal.set(t.getTopicCount()); | 
					 | 
					 | 
					                        closedTotal.set(t.getTopicCount()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -556,17 +583,17 @@ public class DataStatsServiceImpl implements DataStatsService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            }); | 
					 | 
					 | 
					            }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            topicShiftIssue.forEach(t -> { | 
					 | 
					 | 
					            topicShiftIssue.forEach(t -> { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                if (t.getAgencyId().equals(sub.getId())) { | 
					 | 
					 | 
					                if (t.getAgencyId().equals(sub.getAgencyId())) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                    shiftIssueTotal.addAndGet(t.getShiftedIssueTotal()); | 
					 | 
					 | 
					                    shiftIssueTotal.addAndGet(t.getShiftedIssueTotal()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            }); | 
					 | 
					 | 
					            }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            hotdiscuss.forEach(t -> { | 
					 | 
					 | 
					            hotdiscuss.forEach(t -> { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                if (t.getAgencyId().equals(sub.getId())) { | 
					 | 
					 | 
					                if (t.getAgencyId().equals(sub.getAgencyId())) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                    hotdiscussTotal.addAndGet(t.getTopicCount()); | 
					 | 
					 | 
					                    hotdiscussTotal.addAndGet(t.getTopicCount()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            }); | 
					 | 
					 | 
					            }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            resultDTO.setAgencyId(sub.getId()); | 
					 | 
					 | 
					            resultDTO.setAgencyId(sub.getAgencyId()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            resultDTO.setAgencyName(sub.getAgencyName()); | 
					 | 
					 | 
					            resultDTO.setAgencyName(sub.getAgencyName()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            resultDTO.setTopicTotal(topicTotal.get()); | 
					 | 
					 | 
					            resultDTO.setTopicTotal(topicTotal.get()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            resultDTO.setDiscussingTotal(hotdiscussTotal.get()); | 
					 | 
					 | 
					            resultDTO.setDiscussingTotal(hotdiscussTotal.get()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -621,12 +648,12 @@ public class DataStatsServiceImpl implements DataStatsService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            formDTO.setType("topic"); | 
					 | 
					 | 
					            formDTO.setType("topic"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        //1.查询组织直属网格列表【网格维度】
 | 
					 | 
					 | 
					        //1.查询指标库组织直属网格列表【这个客户组织网格数据包括小程序的和项目上报的】
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); | 
					 | 
					 | 
					        List<ScreenCustomerGridDTO> gridList = indexService.getSubGridList(formDTO.getAgencyId()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        if (gridList.size() < NumConstant.ONE) { | 
					 | 
					 | 
					        if (gridList.size() < NumConstant.ONE) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            return resultList; | 
					 | 
					 | 
					            return resultList; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<String> gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); | 
					 | 
					 | 
					        List<String> gridIds = gridList.stream().map(ScreenCustomerGridDTO::getGridId).collect(Collectors.toList()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //2.查询网格层级话题数据
 | 
					 | 
					 | 
					        //2.查询网格层级话题数据
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //查询网格层级状态话题-日统计数据  机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念,热议中=总量-关闭数-屏蔽数-转议题数
 | 
					 | 
					 | 
					        //查询网格层级状态话题-日统计数据  机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念,热议中=总量-关闭数-屏蔽数-转议题数
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -642,7 +669,7 @@ public class DataStatsServiceImpl implements DataStatsService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            AtomicInteger shiftIssueTotal = new AtomicInteger(0); | 
					 | 
					 | 
					            AtomicInteger shiftIssueTotal = new AtomicInteger(0); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            AtomicInteger hotdiscussTotal = new AtomicInteger(0); | 
					 | 
					 | 
					            AtomicInteger hotdiscussTotal = new AtomicInteger(0); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            topic.forEach(t -> { | 
					 | 
					 | 
					            topic.forEach(t -> { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                if (t.getGridId().equals(gr.getId())) { | 
					 | 
					 | 
					                if (t.getGridId().equals(gr.getGridId())) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                    topicTotal.addAndGet(t.getTopicCount()); | 
					 | 
					 | 
					                    topicTotal.addAndGet(t.getTopicCount()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    if (t.getTopicStatus().equals("closed")) { | 
					 | 
					 | 
					                    if (t.getTopicStatus().equals("closed")) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        closedTotal.set(t.getTopicCount()); | 
					 | 
					 | 
					                        closedTotal.set(t.getTopicCount()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -650,17 +677,17 @@ public class DataStatsServiceImpl implements DataStatsService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            }); | 
					 | 
					 | 
					            }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            topicShiftIssue.forEach(t -> { | 
					 | 
					 | 
					            topicShiftIssue.forEach(t -> { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                if (t.getGridId().equals(gr.getId())) { | 
					 | 
					 | 
					                if (t.getGridId().equals(gr.getGridId())) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                    shiftIssueTotal.addAndGet(t.getShiftedIssueTotal()); | 
					 | 
					 | 
					                    shiftIssueTotal.addAndGet(t.getShiftedIssueTotal()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            }); | 
					 | 
					 | 
					            }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            hotdiscuss.forEach(t -> { | 
					 | 
					 | 
					            hotdiscuss.forEach(t -> { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                if (t.getGridId().equals(gr.getId())) { | 
					 | 
					 | 
					                if (t.getGridId().equals(gr.getGridId())) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                    hotdiscussTotal.addAndGet(t.getTopicCount()); | 
					 | 
					 | 
					                    hotdiscussTotal.addAndGet(t.getTopicCount()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            }); | 
					 | 
					 | 
					            }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            resultDTO.setGridId(gr.getId()); | 
					 | 
					 | 
					            resultDTO.setGridId(gr.getGridId()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            resultDTO.setGridName(gr.getGridName()); | 
					 | 
					 | 
					            resultDTO.setGridName(gr.getGridName()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            resultDTO.setTopicTotal(topicTotal.get()); | 
					 | 
					 | 
					            resultDTO.setTopicTotal(topicTotal.get()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            resultDTO.setDiscussingTotal(hotdiscussTotal.get()); | 
					 | 
					 | 
					            resultDTO.setDiscussingTotal(hotdiscussTotal.get()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -714,23 +741,23 @@ public class DataStatsServiceImpl implements DataStatsService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            formDTO.setType("issue"); | 
					 | 
					 | 
					            formDTO.setType("issue"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        //1.查询当前组织的直属下级组织信息【机关维度】
 | 
					 | 
					 | 
					        //1.查询直属下级组织列表,有areaCode的按areaCode查,没有的按agencyId查
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); | 
					 | 
					 | 
					        List<ScreenCustomerAgencyDTO> subAgencyList = indexService.getSubAgencyList(formDTO.getAgencyId(), formDTO.getAreaCode()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        if (subAgencyList.size() < NumConstant.ONE) { | 
					 | 
					 | 
					        if (subAgencyList.size() < NumConstant.ONE) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            return resultList; | 
					 | 
					 | 
					            return resultList; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<String> agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); | 
					 | 
					 | 
					        List<String> agencyIds = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //2.查询直属下级组织议题日统计数据,默认按议题总数降序
 | 
					 | 
					 | 
					        //2.查询直属下级组织议题日统计数据,默认按议题总数降序
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        List<SubAgencyIssueResultDTO> list = dataStatsDao.getSubAgencyIssue(agencyIds, formDTO.getDateId()); | 
					 | 
					 | 
					        List<SubAgencyIssueResultDTO> list = dataStatsDao.getSubAgencyIssue(agencyIds, formDTO.getDateId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //3.封装数据
 | 
					 | 
					 | 
					        //3.封装数据
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        for (DimAgencyEntity sub : subAgencyList) { | 
					 | 
					 | 
					        for (ScreenCustomerAgencyDTO sub : subAgencyList) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            SubAgencyIssueResultDTO dto = new SubAgencyIssueResultDTO(); | 
					 | 
					 | 
					            SubAgencyIssueResultDTO dto = new SubAgencyIssueResultDTO(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            dto.setAgencyId(sub.getId()); | 
					 | 
					 | 
					            dto.setAgencyId(sub.getAgencyId()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            dto.setAgencyName(sub.getAgencyName()); | 
					 | 
					 | 
					            dto.setAgencyName(sub.getAgencyName()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            for (SubAgencyIssueResultDTO u : list) { | 
					 | 
					 | 
					            for (SubAgencyIssueResultDTO u : list) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                if (sub.getId().equals(u.getAgencyId())) { | 
					 | 
					 | 
					                if (sub.getAgencyId().equals(u.getAgencyId())) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                    dto.setIssueTotal(u.getIssueTotal()); | 
					 | 
					 | 
					                    dto.setIssueTotal(u.getIssueTotal()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    dto.setVotingTotal(u.getVotingTotal()); | 
					 | 
					 | 
					                    dto.setVotingTotal(u.getVotingTotal()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    dto.setClosedIssueTotal(u.getClosedIssueTotal()); | 
					 | 
					 | 
					                    dto.setClosedIssueTotal(u.getClosedIssueTotal()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -784,23 +811,23 @@ public class DataStatsServiceImpl implements DataStatsService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            formDTO.setType("issue"); | 
					 | 
					 | 
					            formDTO.setType("issue"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        //1.查询组织直属网格列表【网格维度】
 | 
					 | 
					 | 
					        //1.查询指标库组织直属网格列表【这个客户组织网格数据包括小程序的和项目上报的】
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); | 
					 | 
					 | 
					        List<ScreenCustomerGridDTO> gridList = indexService.getSubGridList(formDTO.getAgencyId()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        if (gridList.size() < NumConstant.ONE) { | 
					 | 
					 | 
					        if (gridList.size() < NumConstant.ONE) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            return resultList; | 
					 | 
					 | 
					            return resultList; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<String> gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); | 
					 | 
					 | 
					        List<String> gridIds = gridList.stream().map(ScreenCustomerGridDTO::getGridId).collect(Collectors.toList()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //2.查询网格层级议题日统计数据,默认按议题总数降序
 | 
					 | 
					 | 
					        //2.查询网格层级议题日统计数据,默认按议题总数降序
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        List<SubGridIssueResultDTO> list = dataStatsDao.getSubGridIssue(gridIds, formDTO.getDateId()); | 
					 | 
					 | 
					        List<SubGridIssueResultDTO> list = dataStatsDao.getSubGridIssue(gridIds, formDTO.getDateId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //3.封装数据
 | 
					 | 
					 | 
					        //3.封装数据
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        for (DimGridEntity gr : gridList) { | 
					 | 
					 | 
					        for (ScreenCustomerGridDTO gr : gridList) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            SubGridIssueResultDTO dto = new SubGridIssueResultDTO(); | 
					 | 
					 | 
					            SubGridIssueResultDTO dto = new SubGridIssueResultDTO(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            dto.setGridId(gr.getId()); | 
					 | 
					 | 
					            dto.setGridId(gr.getGridId()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            dto.setGridName(gr.getGridName()); | 
					 | 
					 | 
					            dto.setGridName(gr.getGridName()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            for (SubGridIssueResultDTO re : list) { | 
					 | 
					 | 
					            for (SubGridIssueResultDTO re : list) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                if (gr.getId().equals(re.getGridId())) { | 
					 | 
					 | 
					                if (gr.getGridId().equals(re.getGridId())) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                    dto.setIssueTotal(re.getIssueTotal()); | 
					 | 
					 | 
					                    dto.setIssueTotal(re.getIssueTotal()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    dto.setVotingTotal(re.getVotingTotal()); | 
					 | 
					 | 
					                    dto.setVotingTotal(re.getVotingTotal()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    dto.setClosedIssueTotal(re.getClosedIssueTotal()); | 
					 | 
					 | 
					                    dto.setClosedIssueTotal(re.getClosedIssueTotal()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -854,23 +881,23 @@ public class DataStatsServiceImpl implements DataStatsService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            formDTO.setType("project"); | 
					 | 
					 | 
					            formDTO.setType("project"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        //1.查询当前组织的直属下级组织信息【机关维度】
 | 
					 | 
					 | 
					        //1.查询直属下级组织列表,有areaCode的按areaCode查,没有的按agencyId查
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); | 
					 | 
					 | 
					        List<ScreenCustomerAgencyDTO> subAgencyList = indexService.getSubAgencyList(formDTO.getAgencyId(), formDTO.getAreaCode()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        if (subAgencyList.size() < NumConstant.ONE) { | 
					 | 
					 | 
					        if (subAgencyList.size() < NumConstant.ONE) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            return resultList; | 
					 | 
					 | 
					            return resultList; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<String> agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); | 
					 | 
					 | 
					        List<String> agencyIds = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //2.查询直属下级组织项目日统计数据,默认按项目总数降序
 | 
					 | 
					 | 
					        //2.查询直属下级组织项目日统计数据,默认按项目总数降序
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        List<SubAgencyProjectResultDTO> list = dataStatsDao.getSubAgencyProject(agencyIds, formDTO.getDateId()); | 
					 | 
					 | 
					        List<SubAgencyProjectResultDTO> list = dataStatsDao.getSubAgencyProject(agencyIds, formDTO.getDateId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //3.封装数据
 | 
					 | 
					 | 
					        //3.封装数据
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        for (DimAgencyEntity sub : subAgencyList) { | 
					 | 
					 | 
					        for (ScreenCustomerAgencyDTO sub : subAgencyList) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            SubAgencyProjectResultDTO dto = new SubAgencyProjectResultDTO(); | 
					 | 
					 | 
					            SubAgencyProjectResultDTO dto = new SubAgencyProjectResultDTO(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            dto.setAgencyId(sub.getId()); | 
					 | 
					 | 
					            dto.setAgencyId(sub.getAgencyId()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            dto.setAgencyName(sub.getAgencyName()); | 
					 | 
					 | 
					            dto.setAgencyName(sub.getAgencyName()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            for (SubAgencyProjectResultDTO u : list) { | 
					 | 
					 | 
					            for (SubAgencyProjectResultDTO u : list) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                if (sub.getId().equals(u.getAgencyId())) { | 
					 | 
					 | 
					                if (sub.getAgencyId().equals(u.getAgencyId())) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                    dto.setProjectTotal(u.getProjectTotal()); | 
					 | 
					 | 
					                    dto.setProjectTotal(u.getProjectTotal()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    dto.setPendingTotal(u.getPendingTotal()); | 
					 | 
					 | 
					                    dto.setPendingTotal(u.getPendingTotal()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    dto.setClosedProjectTotal(u.getClosedProjectTotal()); | 
					 | 
					 | 
					                    dto.setClosedProjectTotal(u.getClosedProjectTotal()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -920,23 +947,23 @@ public class DataStatsServiceImpl implements DataStatsService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            formDTO.setType("project"); | 
					 | 
					 | 
					            formDTO.setType("project"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        //1.查询组织直属网格列表【网格维度】
 | 
					 | 
					 | 
					        //1.查询指标库组织直属网格列表【这个客户组织网格数据包括小程序的和项目上报的】
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); | 
					 | 
					 | 
					        List<ScreenCustomerGridDTO> gridList = indexService.getSubGridList(formDTO.getAgencyId()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        if (gridList.size() < NumConstant.ONE) { | 
					 | 
					 | 
					        if (gridList.size() < NumConstant.ONE) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            return resultList; | 
					 | 
					 | 
					            return resultList; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<String> gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); | 
					 | 
					 | 
					        List<String> gridIds = gridList.stream().map(ScreenCustomerGridDTO::getGridId).collect(Collectors.toList()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //2.查询网格层级项目日统计数据,默认按项目总数降序
 | 
					 | 
					 | 
					        //2.查询网格层级项目日统计数据,默认按项目总数降序
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        List<SubGridProjectResultDTO> list = dataStatsDao.getSubGridProject(gridIds, formDTO.getDateId()); | 
					 | 
					 | 
					        List<SubGridProjectResultDTO> list = dataStatsDao.getSubGridProject(gridIds, formDTO.getDateId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //3.封装数据
 | 
					 | 
					 | 
					        //3.封装数据
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        for (DimGridEntity gr : gridList) { | 
					 | 
					 | 
					        for (ScreenCustomerGridDTO gr : gridList) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            SubGridProjectResultDTO dto = new SubGridProjectResultDTO(); | 
					 | 
					 | 
					            SubGridProjectResultDTO dto = new SubGridProjectResultDTO(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            dto.setGridId(gr.getId()); | 
					 | 
					 | 
					            dto.setGridId(gr.getGridId()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            dto.setGridName(gr.getGridName()); | 
					 | 
					 | 
					            dto.setGridName(gr.getGridName()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            for (SubGridProjectResultDTO re : list) { | 
					 | 
					 | 
					            for (SubGridProjectResultDTO re : list) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                if (gr.getId().equals(re.getGridId())) { | 
					 | 
					 | 
					                if (gr.getGridId().equals(re.getGridId())) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                    dto.setProjectTotal(re.getProjectTotal()); | 
					 | 
					 | 
					                    dto.setProjectTotal(re.getProjectTotal()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    dto.setPendingTotal(re.getPendingTotal()); | 
					 | 
					 | 
					                    dto.setPendingTotal(re.getPendingTotal()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    dto.setClosedProjectTotal(re.getClosedProjectTotal()); | 
					 | 
					 | 
					                    dto.setClosedProjectTotal(re.getClosedProjectTotal()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |