| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -126,22 +126,7 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //6.存入数据库
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //不按照时间删除,每次插入之前将该客户下的所有历史数据清空
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //过滤 统计维度中没有的数据
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Set<String> gridIdSet = new HashSet<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<ScreenPartyUserRankDataEntity> newInsertList = registeredUsers.stream() | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                .filter(o -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    if (StringUtils.isBlank(o.getGridName())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        gridIdSet.add(o.getGridId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        return false; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } else { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        return true; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                }).collect(Collectors.toList()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        log.warn("userScoreDataHub grids:{} not in DimGrid", JSON.toJSONString(gridIdSet)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        screenPartyUserRankDataService.dataClean(newInsertList, param.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        screenPartyUserRankDataService.dataClean(registeredUsers, param.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    /** | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -160,43 +145,51 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //查询数据
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<ScreenDifficultyDataEntity> difficulties = factOriginProjectMainDailyService.getDifficultyBaseInfo(param.getCustomerId(),projectService.getOvertimeProjectByParameter(param.getCustomerId(),existed)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if(CollectionUtils.isEmpty(difficulties)) return; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //剔除垃圾数据
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //2.查询出客户下网格的相关信息
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<GridInfoDTO> gridList = customerGridService.queryGridInfoList(param.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String,GridInfoDTO> gridMap = gridList.stream().collect(Collectors.toMap(GridInfoDTO :: getGridId,a -> a,(o, n) -> o)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<String> missing = new LinkedList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //剔除垃圾数据(本次需要更新的数据集)
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        for(Iterator<ScreenDifficultyDataEntity> iter = difficulties.iterator(); iter.hasNext();){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            ScreenDifficultyDataEntity pointer = iter.next(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if(null == gridMap.get(pointer.getOrgId())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                missing.add(pointer.getEventId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                iter.remove(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //记录垃圾数(全量)
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<String> missing = new LinkedList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<ScreenDifficultyDataEntity> population = screenDifficultyDataService.getAllDifficultyByCustomerId(param.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if(!CollectionUtils.isEmpty(population)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            for(Iterator<ScreenDifficultyDataEntity> iter = population.iterator(); iter.hasNext();){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                ScreenDifficultyDataEntity pointer = iter.next(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if(null == gridMap.get(pointer.getOrgId())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    missing.add(pointer.getEventId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<String> projectIds = difficulties.stream().map(ScreenDifficultyDataEntity :: getEventId).distinct().collect(Collectors.toList()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //最近一次操作
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, ProjectLatestOperationResultDTO> latestOperationMap = projectProcessService.getLatestOperation(projectIds,param.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        boolean isOperationNull = CollectionUtils.isEmpty(latestOperationMap) ? true : false; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //图片
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<ProjectSourceMapFormDTO> projectSourceMap = factOriginProjectMainDailyService.getNewProject(param.getCustomerId(),projectIds); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String,List<ScreenDifficultyImgDataEntity>> imgMap = | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                topicService.getTopicImgs(projectSourceMap); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        boolean isImgNull = CollectionUtils.isEmpty(imgMap) ? true : false; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String,String> contentMap = topicService.getTopicContent(projectSourceMap); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        boolean isContentNull = CollectionUtils.isEmpty(contentMap) ? true : false; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        difficulties.forEach( diff -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if(!isImgNull) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if(!CollectionUtils.isEmpty(imgMap)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                List<ScreenDifficultyImgDataEntity> figureList = imgMap.get(diff.getEventId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                diff.setEventImgUrl(CollectionUtils.isEmpty(figureList) ? "" : figureList.get(NumConstant.ZERO).getEventImgUrl()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if(!isContentNull) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if(!CollectionUtils.isEmpty(contentMap)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                diff.setEventContent(contentMap.get(diff.getEventId())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if(!isOperationNull){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if(! CollectionUtils.isEmpty(latestOperationMap)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                ProjectLatestOperationResultDTO oper = latestOperationMap.get(diff.getEventId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if(null != oper){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    diff.setLatestOperateDesc(oper.getOperationName()); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |