|
|
@@ -29,8 +29,11 @@ import com.ningdatech.pmapi.gov.service.IGovBizProjectBaseinfoService; |
|
|
|
import com.ningdatech.pmapi.gov.service.IGovOperationProjectBaseinfoService; |
|
|
|
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalProject; |
|
|
|
import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalProjectService; |
|
|
|
import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; |
|
|
|
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; |
|
|
|
import com.ningdatech.pmapi.projectlib.model.entity.Project; |
|
|
|
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; |
|
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectInstService; |
|
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectService; |
|
|
|
import com.ningdatech.pmapi.sys.model.dto.RegionDTO; |
|
|
|
import com.ningdatech.pmapi.sys.model.entity.WflowEarlyWarningRecords; |
|
|
@@ -38,6 +41,8 @@ import com.ningdatech.pmapi.sys.service.IEarlyWarningRecordsService; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.flowable.engine.HistoryService; |
|
|
|
import org.flowable.engine.history.HistoricActivityInstance; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.scheduling.annotation.Scheduled; |
|
|
@@ -77,6 +82,9 @@ public class CockpitStatsStatisticsTask { |
|
|
|
private IProjectService projectService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private IProjectInstService projectInstService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private IExpertUserFullInfoService expertUserFullInfoService; |
|
|
|
|
|
|
|
@Autowired |
|
|
@@ -88,6 +96,9 @@ public class CockpitStatsStatisticsTask { |
|
|
|
private IGovBizProjectApplyService applyService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private HistoryService historyService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private IGovBizProjectApproveService approveService; |
|
|
|
|
|
|
|
@Autowired |
|
|
@@ -325,14 +336,14 @@ public class CockpitStatsStatisticsTask { |
|
|
|
cockpitStats.setExpertTechnicalFeasibilityAssessmentNum(0); |
|
|
|
|
|
|
|
//3.顶部数据 |
|
|
|
//3.1 计划项目数(通过单位内部审核的项目) |
|
|
|
//3.1 计划项目数(建设方案待申报和申报了未开始审核的项目) |
|
|
|
Integer planProjectNum = projects.stream().filter(p -> { |
|
|
|
if(Objects.nonNull(p.getStatus()) && |
|
|
|
p.getStatus().compareTo(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()) >= 0){ |
|
|
|
return Boolean.TRUE; |
|
|
|
} |
|
|
|
return Boolean.FALSE; |
|
|
|
}).collect(Collectors.toList()).size(); |
|
|
|
if(Objects.nonNull(p.getStatus()) && |
|
|
|
p.getStatus().compareTo(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()) >= 0){ |
|
|
|
return Boolean.TRUE; |
|
|
|
} |
|
|
|
return Boolean.FALSE; |
|
|
|
}).collect(Collectors.toList()).size(); |
|
|
|
cockpitStats.setTopPlanProjectsNum(planProjectNum); |
|
|
|
//3.2 批复项目数(可以用批复金额来判断) |
|
|
|
Integer approvalNumDeclared = projects.stream().filter(p -> { |
|
|
@@ -400,21 +411,23 @@ public class CockpitStatsStatisticsTask { |
|
|
|
cockpitStats.setProjectsTotal(projects.size() + baseProjCount); |
|
|
|
|
|
|
|
//5.下面项目状态数 |
|
|
|
//5.1 处于计划 (单位内部) |
|
|
|
//5.1 计划 |
|
|
|
Integer inPlanNum = projects.stream().filter(p -> { |
|
|
|
if(Objects.nonNull(p.getStatus()) && |
|
|
|
p.getStatus().equals(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode())){ |
|
|
|
p.getStatus().compareTo(ProjectStatusEnum.PRE_APPLYING.getCode()) > 0 && |
|
|
|
p.getStatus().compareTo(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode()) <= 0){ |
|
|
|
return Boolean.TRUE; |
|
|
|
} |
|
|
|
return Boolean.FALSE; |
|
|
|
}).collect(Collectors.toList()).size(); |
|
|
|
cockpitStats.setProjectsTotalPlan(inPlanNum); |
|
|
|
|
|
|
|
//5.2 处于申报 (预审) |
|
|
|
//5.2 处于申报 |
|
|
|
Integer inApplyNum = projects.stream().filter(p -> { |
|
|
|
if(Objects.nonNull(p.getStatus()) && |
|
|
|
p.getStatus().compareTo(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()) > 0 |
|
|
|
&& p.getStatus().compareTo(ProjectStatusEnum.TO_BE_APPROVED.getCode()) <= 0){ |
|
|
|
(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode().equals(p.getStatus()) || |
|
|
|
(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode().equals(p.getStatus()) && |
|
|
|
searchSechmeReviewFlow(p.getProjectCode())))){ |
|
|
|
return Boolean.TRUE; |
|
|
|
} |
|
|
|
return Boolean.FALSE; |
|
|
@@ -582,6 +595,44 @@ public class CockpitStatsStatisticsTask { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 建设方案申报了 但未开始审核的项目 |
|
|
|
* @param projectCode |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private boolean searchSechmeReviewFlow(String projectCode) { |
|
|
|
Project project = projectService.getProjectByCode(projectCode); |
|
|
|
if(Objects.isNull(project)){ |
|
|
|
return Boolean.FALSE; |
|
|
|
} |
|
|
|
List<Long> allVersionProjectId = projectService.getAllVersionProjectId(project); |
|
|
|
ProjectInst pi = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) |
|
|
|
.in(ProjectInst::getProjectId, allVersionProjectId) |
|
|
|
.eq(ProjectInst::getInstType, InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode()) |
|
|
|
.last(BizConst.LIMIT_1)); |
|
|
|
if(Objects.isNull(pi)){ |
|
|
|
return Boolean.FALSE; |
|
|
|
} |
|
|
|
String instCode = pi.getInstCode(); |
|
|
|
List<HistoricActivityInstance> finished = historyService.createHistoricActivityInstanceQuery() |
|
|
|
.finished() |
|
|
|
.processInstanceId(instCode) |
|
|
|
.orderByHistoricActivityInstanceEndTime() |
|
|
|
.asc() |
|
|
|
.list(); |
|
|
|
List<HistoricActivityInstance> unfinished = historyService.createHistoricActivityInstanceQuery() |
|
|
|
.unfinished() |
|
|
|
.processInstanceId(instCode) |
|
|
|
.orderByHistoricActivityInstanceStartTime() |
|
|
|
.asc() |
|
|
|
.list(); |
|
|
|
//已经完成的没有 未完成的有 则可计算 |
|
|
|
if(CollUtil.isNotEmpty(unfinished) && CollUtil.isEmpty(finished)){ |
|
|
|
return Boolean.TRUE; |
|
|
|
} |
|
|
|
return Boolean.FALSE; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 计算环节滞后项目 |
|
|
|
* @param projects |
|
|
|
* @return |
|
|
|