| 
						
						
							
								
							
						
						
					 | 
					@ -41,7 +41,7 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						@Autowired | 
					 | 
					 | 
						@Autowired | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
						private ScreenProjectDataService targetDbService; | 
					 | 
					 | 
						private ScreenProjectDataService screenProjectDataService; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
						@Autowired | 
					 | 
					 | 
						@Autowired | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						private FactOriginProjectMainDailyService originMainService; | 
					 | 
					 | 
						private FactOriginProjectMainDailyService originMainService; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						@Autowired | 
					 | 
					 | 
						@Autowired | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -55,9 +55,9 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						@Autowired | 
					 | 
					 | 
						@Autowired | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						private IssueService issueService; | 
					 | 
					 | 
						private IssueService issueService; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						@Autowired | 
					 | 
					 | 
						@Autowired | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
						private ScreenProjectProcessService targetProcessService; | 
					 | 
					 | 
						private ScreenProjectProcessService screenProjectProcessService; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
						@Autowired | 
					 | 
					 | 
						@Autowired | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
						private ScreenProjectImgDataService targetImgService; | 
					 | 
					 | 
						private ScreenProjectImgDataService screenProjectImgDataService; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
						@Autowired | 
					 | 
					 | 
						@Autowired | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						private ScreenProjectProcessAttachmentService targetAttachmentService; | 
					 | 
					 | 
						private ScreenProjectProcessAttachmentService targetAttachmentService; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -71,7 +71,7 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						@Override | 
					 | 
					 | 
						@Override | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						public void extractScreenData(ScreenCentralZoneDataFormDTO param) { | 
					 | 
					 | 
						public void extractScreenData(ScreenCentralZoneDataFormDTO param) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							//screen_project_data表是否存在此客户数据
 | 
					 | 
					 | 
							//screen_project_data表是否存在此客户数据
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
							int rows = targetDbService.checkIfExisted(param.getCustomerId()); | 
					 | 
					 | 
							int rows = screenProjectDataService.checkIfExisted(param.getCustomerId()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							List<ScreenProjectDataDTO> metaData = | 
					 | 
					 | 
							List<ScreenProjectDataDTO> metaData = | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
									originMainService.initNewScreenProjectData(param.getCustomerId(), rows , param.getDateId()); | 
					 | 
					 | 
									originMainService.initNewScreenProjectData(param.getCustomerId(), rows , param.getDateId()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -119,7 +119,7 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							orientCase.setCustomerId(param.getCustomerId()); | 
					 | 
					 | 
							orientCase.setCustomerId(param.getCustomerId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							//待更新的数据 需要检测更新的字段为:①projectStatusCode    ②closeCaseTime    ③allCategoryName    ④projectLevel
 | 
					 | 
					 | 
							//待更新的数据 需要检测更新的字段为:①projectStatusCode    ②closeCaseTime    ③allCategoryName    ④projectLevel
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							List<ScreenProjectDataDTO> orientData = | 
					 | 
					 | 
							List<ScreenProjectDataDTO> orientData = | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
									targetDbService.getPending(orientCase,param.getDateId()); | 
					 | 
					 | 
									screenProjectDataService.getPending(orientCase,param.getDateId()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							// 给metaData和orientData赋上分类信息
 | 
					 | 
					 | 
							// 给metaData和orientData赋上分类信息
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							List<String> projectIds = | 
					 | 
					 | 
							List<String> projectIds = | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -127,6 +127,8 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							if(!CollectionUtils.isEmpty(orientData)) { | 
					 | 
					 | 
							if(!CollectionUtils.isEmpty(orientData)) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								projectIds.addAll(orientData.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList())); | 
					 | 
					 | 
								projectIds.addAll(orientData.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList())); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							} | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
							projectIds.clear(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
							projectIds.add("18759f2fb5c5fb8513c4a21b0be81834"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							Map<String, Set<String>> categoryMap = projectService.getProjectCategory(projectIds); | 
					 | 
					 | 
							Map<String, Set<String>> categoryMap = projectService.getProjectCategory(projectIds); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							if(!CollectionUtils.isEmpty(categoryMap)){ | 
					 | 
					 | 
							if(!CollectionUtils.isEmpty(categoryMap)){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								Map<String, String> integratedProjectCategoryMap = issueService.getIntegratedProjectCategory(categoryMap, param.getCustomerId()); | 
					 | 
					 | 
								Map<String, String> integratedProjectCategoryMap = issueService.getIntegratedProjectCategory(categoryMap, param.getCustomerId()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -139,7 +141,9 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
									}); | 
					 | 
					 | 
									}); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								} | 
					 | 
					 | 
								} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							} | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					
 | 
					 | 
					 | 
							if(projectIds.contains("4f670b349899b33c20e888e77842d938")){ | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
								return; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							//重新计算orientData的级别 有现成的方法 fact_origin_project_org_period_daily
 | 
					 | 
					 | 
							//重新计算orientData的级别 有现成的方法 fact_origin_project_org_period_daily
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					//		originMainService.computerIfExceed(orientData, exceedLimit,about2ExceedLimit);
 | 
					 | 
					 | 
					//		originMainService.computerIfExceed(orientData, exceedLimit,about2ExceedLimit);
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							//todo 与上面重复处理 暂时注释掉
 | 
					 | 
					 | 
							//todo 与上面重复处理 暂时注释掉
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -148,20 +152,20 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							//更新结案时间和结案状态
 | 
					 | 
					 | 
							//更新结案时间和结案状态
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							processService.updateProjectStatus(orientData,param.getDateId(),param.getCustomerId()); | 
					 | 
					 | 
							processService.updateProjectStatus(orientData,param.getDateId(),param.getCustomerId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
							targetDbService.insertOrUpdateBatch(param.getCustomerId(),param.getDateId(),metaData,orientData); | 
					 | 
					 | 
							screenProjectDataService.insertOrUpdateBatch(param.getCustomerId(),param.getDateId(),metaData,orientData); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							if(!CollectionUtils.isEmpty(metaData)){ | 
					 | 
					 | 
							if(!CollectionUtils.isEmpty(metaData)){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								List<ScreenProjectImgDataDTO> imgs = topicService.buildNewScreenProjectImgData(metaData); | 
					 | 
					 | 
								List<ScreenProjectImgDataDTO> imgs = topicService.buildNewScreenProjectImgData(metaData); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								if(!CollectionUtils.isEmpty(imgs)){ | 
					 | 
					 | 
								if(!CollectionUtils.isEmpty(imgs)){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
									targetImgService.insertBatch(imgs); | 
					 | 
					 | 
									screenProjectImgDataService.insertBatch(imgs); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
								} | 
					 | 
					 | 
								} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							} | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							//
 | 
					 | 
					 | 
							//
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
							List<ScreenProjectProcessDTO> processes = processService.buildNewScreenProjectProcessData(param.getCustomerId(), param.getDateId(),!targetProcessService.checkIfHistoricalDataExists(param.getCustomerId())); | 
					 | 
					 | 
							List<ScreenProjectProcessDTO> processes = processService.buildNewScreenProjectProcessData(param.getCustomerId(), param.getDateId(),!screenProjectProcessService.checkIfHistoricalDataExists(param.getCustomerId())); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
							if(!CollectionUtils.isEmpty(processes)){ | 
					 | 
					 | 
							if(!CollectionUtils.isEmpty(processes)){ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
								targetProcessService.insertBatch(processes,param.getCustomerId(),param.getDateId()); | 
					 | 
					 | 
								screenProjectProcessService.insertBatch(processes,param.getCustomerId(),param.getDateId()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
								List<ScreenProjectProcessAttachmentDTO> attachments = processService.buildProcessAttachmentData(processes.stream().map(ScreenProjectProcessDTO::getProcessId).distinct().collect(Collectors.toList())); | 
					 | 
					 | 
								List<ScreenProjectProcessAttachmentDTO> attachments = processService.buildProcessAttachmentData(processes.stream().map(ScreenProjectProcessDTO::getProcessId).distinct().collect(Collectors.toList())); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								if(!CollectionUtils.isEmpty(attachments)){ | 
					 | 
					 | 
								if(!CollectionUtils.isEmpty(attachments)){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -186,7 +190,7 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							if(StringUtils.isNotBlank(projectId)){ | 
					 | 
					 | 
							if(StringUtils.isNotBlank(projectId)){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								BigDecimal calProjectSatisfactionScore = projectService.calProjectSatisfactionScore(customerId, projectId); | 
					 | 
					 | 
								BigDecimal calProjectSatisfactionScore = projectService.calProjectSatisfactionScore(customerId, projectId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								log.warn("单独计算projectId=" + projectId + "满意度得分:" + calProjectSatisfactionScore); | 
					 | 
					 | 
								log.warn("单独计算projectId=" + projectId + "满意度得分:" + calProjectSatisfactionScore); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
								targetDbService.updateProjectSatisfactionScore(projectId,calProjectSatisfactionScore); | 
					 | 
					 | 
								screenProjectDataService.updateProjectSatisfactionScore(projectId,calProjectSatisfactionScore); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
								return; | 
					 | 
					 | 
								return; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							} | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							List<String> projectIds=new ArrayList<>(); | 
					 | 
					 | 
							List<String> projectIds=new ArrayList<>(); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -207,7 +211,7 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							projectIds.forEach(id -> { | 
					 | 
					 | 
							projectIds.forEach(id -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								BigDecimal calProjectSatisfactionScore = projectService.calProjectSatisfactionScore(customerId, id); | 
					 | 
					 | 
								BigDecimal calProjectSatisfactionScore = projectService.calProjectSatisfactionScore(customerId, id); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								log.warn("projectId=" + id + "满意度得分:" + calProjectSatisfactionScore); | 
					 | 
					 | 
								log.warn("projectId=" + id + "满意度得分:" + calProjectSatisfactionScore); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
								targetDbService.updateProjectSatisfactionScore(id, calProjectSatisfactionScore); | 
					 | 
					 | 
								screenProjectDataService.updateProjectSatisfactionScore(id, calProjectSatisfactionScore); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
							}); | 
					 | 
					 | 
							}); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						} | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |