| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -5,6 +5,8 @@ import com.epmet.commons.tools.constant.StrConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.ConvertUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.DateUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.Result; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.constant.OrgTypeConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.constant.ProjectConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.ProjectDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -32,10 +34,10 @@ import com.epmet.service.project.ProjectService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.service.topic.TopicService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.util.DimIdGenerator; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import lombok.extern.slf4j.Slf4j; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.apache.commons.collections4.CollectionUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.apache.commons.lang3.StringUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.beans.factory.annotation.Autowired; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.stereotype.Service; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.apache.commons.collections4.CollectionUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.text.SimpleDateFormat; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.ArrayList; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -86,9 +88,9 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (!CollectionUtils.isEmpty(closedList)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            List<FactOriginProjectMainDailyEntity> closeProjects = | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        entity.setId(process.getProjectId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
											entity.setProjectStatus("closed"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
											FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
											entity.setId(process.getProjectId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
											entity.setProjectStatus(ProjectConstant.CLOSED); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
											entity.setCreatedTime(DateUtils.stringToDate(pending.getDateId(), DateUtils.DATE_PATTERN_YYYYMMDD)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
											entity.setUpdatedTime(process.getUpdatedTime()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
											entity.setIsResolved(process.getIsResolved()); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -214,11 +216,11 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									entity.setIsActive(NumConstant.ONE); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									entity.setPids(process.getPids()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									if (StringUtils.isNotBlank(process.getDepartmentId())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										entity.setOrgType("department"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										entity.setOrgType(OrgTypeConstant.DEPARTMENT); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										entity.setOrgId(process.getDepartmentId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										entity.setPid(process.getAgencyId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									}else if (StringUtils.isNotBlank(process.getGridId())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										entity.setOrgType("grid"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										entity.setOrgType(OrgTypeConstant.GRID); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										entity.setOrgId(process.getGridId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										entity.setPid(process.getAgencyId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									}else{ | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -264,11 +266,11 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									entity.setIsActive(NumConstant.ONE); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									entity.setPids(process.getPids()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									if (StringUtils.isNotBlank(process.getDepartmentId())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										entity.setOrgType("department"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										entity.setOrgType(OrgTypeConstant.DEPARTMENT); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										entity.setOrgId(process.getDepartmentId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										entity.setPid(process.getAgencyId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									} else if (StringUtils.isNotBlank(process.getGridId())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										entity.setOrgType("grid"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										entity.setOrgType(OrgTypeConstant.GRID); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										entity.setOrgId(process.getGridId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										entity.setPid(process.getAgencyId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									} else { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -319,7 +321,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								entity.setActionCode(process.getOperation()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								entity.setIsActive(NumConstant.ONE); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								entity.setOrgId(process.getGridId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								entity.setOrgType("grid"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								entity.setOrgType(OrgTypeConstant.GRID); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								entity.setPids(process.getPids()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								entity.setPid(process.getPid()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								return entity; | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -344,11 +346,11 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								entity.setIsActive(NumConstant.ZERO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								entity.setPids(process.getPids()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								if (StringUtils.isNotBlank(process.getDepartmentId())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									entity.setOrgType("department"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									entity.setOrgType(OrgTypeConstant.DEPARTMENT); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									entity.setOrgId(process.getDepartmentId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									entity.setPid(process.getAgencyId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								}else if (StringUtils.isNotBlank(process.getGridId())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									entity.setOrgType("grid"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									entity.setOrgType(OrgTypeConstant.GRID); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									entity.setOrgId(process.getGridId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									entity.setPid(process.getAgencyId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								}else{ | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -405,21 +407,21 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									dest.setOrgType("dept"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									dest.setPid(original.getOrgId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									dest.setPids(original.getOrgIdPath()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								}else if(StringUtils.isNotBlank(original.getGridId())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									dest.setOrgType("grid"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								}else if(StringUtils.isNotBlank(original.getGridId())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									dest.setOrgType(OrgTypeConstant.GRID); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									dest.setPid(original.getOrgId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									dest.setPids(original.getOrgIdPath()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								}else{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									dest.setOrgType("agency"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								}else { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									dest.setOrgType(OrgTypeConstant.AGENCY); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									dest.setPids(""); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									String[] array = original.getOrgIdPath().split(StrConstant.COLON); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									if(array.length <= NumConstant.ZERO){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									if (array.length <= NumConstant.ZERO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										dest.setPid(NumConstant.ZERO_STR); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									if(array[NumConstant.ZERO].equals(original.getOrgId()) && array.length == NumConstant.ONE){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									if (array[NumConstant.ZERO].equals(original.getOrgId()) && array.length == NumConstant.ONE) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										dest.setPid(NumConstant.ZERO_STR); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									if(array.length > NumConstant.ONE && original.getOrgId().equals(array[array.length - NumConstant.ONE])){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									if (array.length > NumConstant.ONE && original.getOrgId().equals(array[array.length - NumConstant.ONE])) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										dest.setPid(array[array.length - NumConstant.TWO]); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										dest.setPids(original.getOrgIdPath().replace(original.getOrgId(),"")); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									} | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -457,7 +459,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						 */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						private Integer getDetentionDays(String id, Date startDate, Date endDate) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							int result; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							List<WorkDayFormDTO> list = new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							WorkDayFormDTO workDayFormDTO = new WorkDayFormDTO(); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |