| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -24,6 +24,7 @@ import com.epmet.service.project.ProjectProcessService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.service.project.ProjectService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.service.topic.TopicService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.util.DimIdGenerator; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.apache.commons.lang3.StringUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.beans.factory.annotation.Autowired; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.stereotype.Service; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -68,6 +69,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//获取已关闭项目列表
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							List<ProjectProcessEntity> closedList = projectProcessService.getClosedProjectList(customerId, dateString); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							List<FactOriginProjectMainDailyDTO> pendingList = factOriginProjectMainDailyService.getPendingList(customerId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							if (null != closedList && !closedList.isEmpty()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								List<FactOriginProjectMainDailyEntity> closeProjects = | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
											FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity(); | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -78,9 +80,10 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
											return entity; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										})).collect(Collectors.toList()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								//更新状态
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							if (null != closeProjects && !closeProjects.isEmpty()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								if (!closeProjects.isEmpty()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									factOriginProjectMainDailyService.updateBatchById(closeProjects); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//获取项目信息
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							List<ProjectDTO> projectList = projectService.getProjectInfo(customerId, dateString); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							if (null != projectList && !projectList.isEmpty()) { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -133,8 +136,10 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									entity.setIsParty(NumConstant.ONE_STR); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								})); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								//插入数据
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								if (!list.isEmpty()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									factOriginProjectMainDailyService.insertBatch(list); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							//节点发起人
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							List<ProcessInfoDTO> processList = projectProcessService.getProcessListByCustomer(customerId, dateString); | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -157,9 +162,9 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									return entity; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								}).collect(Collectors.toList()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								//节点接收人
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								List<ProcessInfoDTO> processStaffList = projectProcessService.getProcessStaffByCustomer(customerId, dateString); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								logList.addAll(processStaffList.stream().map(process -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								//项目评论人
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								List<ProcessInfoDTO> satisfactionRecordList = projectProcessService.getSatisfactionRecord(customerId, dateString); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								logList.addAll(satisfactionRecordList.stream().map(process -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									//获取日期相关维度
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(process.getCreatedTime()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									FactOriginProjectLogDailyEntity entity = new FactOriginProjectLogDailyEntity(); | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -172,14 +177,19 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									entity.setProjectId(process.getProjectId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									entity.setOperationUserId(process.getStaffId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									entity.setActionCode(process.getOperation()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									entity.setIsActive(NumConstant.ZERO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									entity.setIsActive(NumConstant.ONE); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									entity.setOrgType("grid"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									return entity; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								}).collect(Collectors.toList())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								//项目评论人
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								List<ProcessInfoDTO> satisfactionRecordList = projectProcessService.getSatisfactionRecord(customerId, dateString); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								logList.addAll(satisfactionRecordList.stream().map(process -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								List<FactOriginProjectMainDailyDTO> projectMainList = factOriginProjectMainDailyService.getProjectByCustomer(customerId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								logList.forEach(log -> projectMainList.stream().filter(project -> log.getProjectId().equals(project.getId())).forEach(main -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									log.setOrgId(main.getGridId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								})); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								//节点接收人
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								List<ProcessInfoDTO> processStaffList = projectProcessService.getProcessStaffByCustomer(customerId, dateString); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								logList.addAll(processStaffList.stream().map(process -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									//获取日期相关维度
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(process.getCreatedTime()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									FactOriginProjectLogDailyEntity entity = new FactOriginProjectLogDailyEntity(); | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -192,19 +202,23 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									entity.setProjectId(process.getProjectId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									entity.setOperationUserId(process.getStaffId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									entity.setActionCode(process.getOperation()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									entity.setIsActive(NumConstant.ONE); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									entity.setIsActive(NumConstant.ZERO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									if (StringUtils.isNotBlank(process.getDepartmentId())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										entity.setOrgType("department"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										entity.setOrgId(process.getDepartmentId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									if (StringUtils.isNotBlank(process.getGridId())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										entity.setOrgType("grid"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										entity.setOrgId(process.getGridId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									return entity; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								}).collect(Collectors.toList())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								List<FactOriginProjectMainDailyDTO> projectMainList = factOriginProjectMainDailyService.getProjectByCustomer(customerId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								logList.forEach(log -> projectMainList.stream().filter(project -> log.getProjectId().equals(project.getId())).forEach(main -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									log.setOrgId(main.getGridId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								})); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								if (!logList.isEmpty()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									factOriginProjectLogDailyService.insertBatch(logList); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						/** | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |