| 
						
						
							
								
							
						
						
					 | 
					@ -24,6 +24,7 @@ import com.epmet.constant.ProjectConstant; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.dao.evaluationindex.extract.FactGridGovernDailyDao; | 
					 | 
					 | 
					import com.epmet.dao.evaluationindex.extract.FactGridGovernDailyDao; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.dto.org.GridInfoDTO; | 
					 | 
					 | 
					import com.epmet.dto.org.GridInfoDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity; | 
					 | 
					 | 
					import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.epmet.entity.evaluationindex.extract.GovernGridClosedTotalCommonDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; | 
					 | 
					 | 
					import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService; | 
					 | 
					 | 
					import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService; | 
					 | 
					 | 
					import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -42,6 +43,7 @@ import java.util.ArrayList; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import java.util.HashMap; | 
					 | 
					 | 
					import java.util.HashMap; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import java.util.List; | 
					 | 
					 | 
					import java.util.List; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import java.util.Map; | 
					 | 
					 | 
					import java.util.Map; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import java.util.stream.Collectors; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					/** | 
					 | 
					 | 
					/** | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 * 网格的治理指数,按天统计 | 
					 | 
					 | 
					 * 网格的治理指数,按天统计 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -86,6 +88,7 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            log.info("当前客户customerId=("+customerId+")下没有网格,无需计算"); | 
					 | 
					 | 
					            log.info("当前客户customerId=("+customerId+")下没有网格,无需计算"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            return; | 
					 | 
					 | 
					            return; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        List<String> gridIds=gridInfoDTOList.stream().map(GridInfoDTO::getGridId).collect(Collectors.toList()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        List<FactGridGovernDailyEntity> insertEntityList=this.constructFactGridGovernDailyEntityList(customerId,dateId,gridInfoDTOList); | 
					 | 
					 | 
					        List<FactGridGovernDailyEntity> insertEntityList=this.constructFactGridGovernDailyEntityList(customerId,dateId,gridInfoDTOList); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        // log.info(JSON.toJSONString(insertEntityList,true));
 | 
					 | 
					 | 
					        // log.info(JSON.toJSONString(insertEntityList,true));
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -102,7 +105,7 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        Map<String,Integer>  approvalProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_AGENCY,DimObjectStatusConstant.UNRESOLVED); | 
					 | 
					 | 
					        Map<String,Integer>  approvalProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_AGENCY,DimObjectStatusConstant.UNRESOLVED); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        Map<String, Integer> inGroupTopicResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED,NumConstant.ONE_STR); | 
					 | 
					 | 
					        Map<String, Integer> inGroupTopicResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED,NumConstant.ONE_STR); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        Map<String, Integer> inGroupTopicUnResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED,NumConstant.ONE_STR); | 
					 | 
					 | 
					        Map<String, Integer> inGroupTopicUnResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED,NumConstant.ONE_STR); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					
 | 
					 | 
					 | 
					        Map<String, GovernGridClosedTotalCommonDTO> dtoMap=getGovernGridClosedTotalCommonDTOMap(customerId,gridIds); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        for(FactGridGovernDailyEntity insertEntity:insertEntityList){ | 
					 | 
					 | 
					        for(FactGridGovernDailyEntity insertEntity:insertEntityList){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            //1、当前网格内,话题关闭已解决数
 | 
					 | 
					 | 
					            //1、当前网格内,话题关闭已解决数
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -154,18 +157,24 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            // todo
 | 
					 | 
					 | 
					            // todo
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            // 11、来源于议题的项目,未出网格结案并且已解决的项目数
 | 
					 | 
					 | 
					            // 11、来源于议题的项目,未出网格结案并且已解决的项目数
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            insertEntity.setFromIssueResolvedInGridCount(0); | 
					 | 
					 | 
					            insertEntity.setFromIssueResolvedInGridCount(666); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            // 12、来源于议题的项目,未出网格结案并且无需解决的项目数
 | 
					 | 
					 | 
					            // 12、来源于议题的项目,未出网格结案并且无需解决的项目数
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            insertEntity.setFromIssueUnResolvedInGridCount(0); | 
					 | 
					 | 
					            insertEntity.setFromIssueUnResolvedInGridCount(666); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            // 13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0
 | 
					 | 
					 | 
					            // 13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            insertEntity.setFromAgencyResolvedInGridCount(0); | 
					 | 
					 | 
					            insertEntity.setFromAgencyResolvedInGridCount(666); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            // 14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0
 | 
					 | 
					 | 
					            // 14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            insertEntity.setFromAgencyUnResolvedInGridCount(0); | 
					 | 
					 | 
					            insertEntity.setFromAgencyUnResolvedInGridCount(666); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            // 所有网格内结案项目数(未出网格)=来源于议题的项目结案已解决+来源于议题的项目结案无需解决+来源于立项的项目结案已解决+来源于立项的项目结案无需解决
 | 
					 | 
					 | 
					            // 所有网格内结案项目数(未出网格)=来源于议题的项目结案已解决+来源于议题的项目结案无需解决+来源于立项的项目结案已解决+来源于立项的项目结案无需解决
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            // 15、未出当前网格的,结案项目数=11+12+13+14
 | 
					 | 
					 | 
					            // 15、未出当前网格的,结案项目数=11+12+13+14
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            insertEntity.setGridSelfGovernProjectTotal(insertEntity.getFromIssueResolvedInGridCount()+insertEntity.getFromIssueUnResolvedInGridCount()+ | 
					 | 
					 | 
					            insertEntity.setGridSelfGovernProjectTotal(insertEntity.getFromIssueResolvedInGridCount()+insertEntity.getFromIssueUnResolvedInGridCount()+ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        insertEntity.getFromAgencyResolvedInGridCount()+insertEntity.getFromAgencyUnResolvedInGridCount()); | 
					 | 
					 | 
					                        insertEntity.getFromAgencyResolvedInGridCount()+insertEntity.getFromAgencyUnResolvedInGridCount()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            //当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            insertEntity.setCommunityClosedCount(666); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            //当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            insertEntity.setStreetClosedCount(666); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            //当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            insertEntity.setDistrictDeptClosedCount(666); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            //界面展示:1、问题解决总数=1+2+3+4+5+6+7+8
 | 
					 | 
					 | 
					            //界面展示:1、问题解决总数=1+2+3+4+5+6+7+8
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            insertEntity.setProblemResolvedCount(insertEntity.getTopicResolvedCount()+insertEntity.getTopicUnResolvedCount() | 
					 | 
					 | 
					            insertEntity.setProblemResolvedCount(insertEntity.getTopicResolvedCount()+insertEntity.getTopicUnResolvedCount() | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -191,6 +200,34 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                String gridSelfGovernRatioStr = numberFormat.format((float) insertEntity.getGridSelfGovernProjectTotal() / insertEntity.getProblemResolvedCount()); | 
					 | 
					 | 
					                String gridSelfGovernRatioStr = numberFormat.format((float) insertEntity.getGridSelfGovernProjectTotal() / insertEntity.getProblemResolvedCount()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                insertEntity.setGridSelfGovernRatio(new BigDecimal(gridSelfGovernRatioStr)); | 
					 | 
					 | 
					                insertEntity.setGridSelfGovernRatio(new BigDecimal(gridSelfGovernRatioStr)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            //界面展示:4、社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            //网格内出来的项目,最终由社区结案的项目数
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            if (NumConstant.ZERO == insertEntity.getCommunityClosedCount()||NumConstant.ZERO == insertEntity.getProblemResolvedCount()) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                insertEntity.setCommunityClosedRatio(BigDecimal.ZERO); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            }else{ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                String setCommunityClosedRatioStr = numberFormat.format((float) insertEntity.getCommunityClosedCount() / insertEntity.getProblemResolvedCount()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                insertEntity.setCommunityClosedRatio(new BigDecimal(setCommunityClosedRatioStr)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            // 界面展示:5、街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            //网格内出来的项目,最终由街道结案的项目数
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            if (NumConstant.ZERO == insertEntity.getStreetClosedCount() || NumConstant.ZERO == insertEntity.getProblemResolvedCount()) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                insertEntity.setStreetClosedRatio(BigDecimal.ZERO); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            } else { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                String streetClosedRatioStr = numberFormat.format((float) insertEntity.getStreetClosedCount() / insertEntity.getProblemResolvedCount()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                insertEntity.setStreetClosedRatio(new BigDecimal(streetClosedRatioStr)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            //界面展示:6、区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            //网格内出来的项目,最终由区直部门结案的项目数
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            if (NumConstant.ZERO == insertEntity.getDistrictDeptClosedCount() || NumConstant.ZERO == insertEntity.getProblemResolvedCount()) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                insertEntity.setDistrictDeptClosedRatio(BigDecimal.ZERO); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            } else { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                String setDistrictDeptClosedRatioStr = numberFormat.format((float) insertEntity.getDistrictDeptClosedCount() / insertEntity.getProblemResolvedCount()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                insertEntity.setDistrictDeptClosedRatio(new BigDecimal(setDistrictDeptClosedRatioStr)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        // 先删除,后新增
 | 
					 | 
					 | 
					        // 先删除,后新增
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        // 3、批量删除
 | 
					 | 
					 | 
					        // 3、批量删除
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -204,6 +241,14 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        log.info("extractFactGridGovernDaily completed"); | 
					 | 
					 | 
					        log.info("extractFactGridGovernDaily completed"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    private Map<String, GovernGridClosedTotalCommonDTO> getGovernGridClosedTotalCommonDTOMap(String customerId, List<String> gridIds) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        Map<String, GovernGridClosedTotalCommonDTO> resultMap=new HashMap<>(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        for(String gridId:gridIds){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        return resultMap; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    /** | 
					 | 
					 | 
					    /** | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * 构造要插入的数据,每个网格一天一条数据,初始赋值0 | 
					 | 
					 | 
					     * 构造要插入的数据,每个网格一天一条数据,初始赋值0 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * | 
					 | 
					 | 
					     * | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |