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