Explorar el Código

预警 增加当时的状态

tags/24080901
PoffyZhang hace 1 año
padre
commit
3d22c54565
Se han modificado 3 ficheros con 43 adiciones y 13 borrados
  1. +33
    -11
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CockpitStatsStatisticsTask.java
  2. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/EarlyWarningManage.java
  3. +7
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/WflowEarlyWarningRecords.java

+ 33
- 11
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CockpitStatsStatisticsTask.java Ver fichero

@@ -20,8 +20,10 @@ import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo;
import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService;
import com.ningdatech.pmapi.gov.model.entity.GovBizProjectApply;
import com.ningdatech.pmapi.gov.model.entity.GovBizProjectBaseinfo;
import com.ningdatech.pmapi.gov.model.entity.GovOperationProjectBaseinfo;
import com.ningdatech.pmapi.gov.service.IGovBizProjectApplyService;
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.ProjectStatusEnum;
@@ -77,8 +79,12 @@ public class CockpitStatsStatisticsTask {
private IGovBizProjectBaseinfoService baseinfoService;

@Autowired
private IGovOperationProjectBaseinfoService operationBaseInfoService;

@Autowired
private IGovBizProjectApplyService applyService;

private List<Integer> years = Lists.newArrayList(2021,2022,2023,2024,2025);

/**
* 定义统计 驾驶舱数据 每天3点开始执行一次
@@ -101,22 +107,21 @@ public class CockpitStatsStatisticsTask {
StopWatch stopWatch = new StopWatch();
stopWatch.start();

List<Integer> years = Lists.newArrayList(2021,2022,2023,2024,2025);

List<CockpitStats> res = Lists.newArrayList();
//1.根据2个维度来统计 区域和分年
//1.总的
res.add(statisticsData(DashboardConstant.CockpitStats.TOTAL,
DashboardConstant.CockpitStats.TOTAL,0));
DashboardConstant.CockpitStats.TOTAL,DashboardConstant.CockpitStats.NONE_YEAR));
for(Integer year : years){
res.add(statisticsData(DashboardConstant.CockpitStats.TOTAL,
DashboardConstant.CockpitStats.TOTAL,year));
}

List<RegionDTO> regions = regionCacheHelper.listChildren(RegionConst.RC_LS, RegionConst.RL_CITY);
regions = regions.stream().filter(r -> r.getRegionLevel() != 2).collect(Collectors.toList());
regions = regions.stream().filter(r -> r.getRegionLevel() != RegionConst.RL_CITY).collect(Collectors.toList());
for(RegionDTO regionDto : regions){
res.add(statisticsData(regionDto.getRegionCode(),regionDto.getRegionName(),0));
res.add(statisticsData(regionDto.getRegionCode(),regionDto.getRegionName(),
DashboardConstant.CockpitStats.NONE_YEAR));
for(Integer year : years){
res.add(statisticsData(regionDto.getRegionCode(),regionDto.getRegionName(),year));
}
@@ -170,6 +175,7 @@ public class CockpitStatsStatisticsTask {
cockpitStats.setRegionName(regionName);
cockpitStats.setYear(year);

//申报项目
List<Project> projects = projectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Project::getNewest, Boolean.TRUE)
.eq(StringUtils.isNotBlank(regionCode) && !DashboardConstant.CockpitStats.TOTAL.equals(regionCode),
@@ -177,27 +183,42 @@ public class CockpitStatsStatisticsTask {
.eq(Objects.nonNull(year) && !year.equals(DashboardConstant.CockpitStats.NONE_YEAR),
Project::getProjectYear, year)
.in(Objects.isNull(year) && year.equals(DashboardConstant.CockpitStats.NONE_YEAR),
Project::getProjectYear, Lists.newArrayList(2021,2022,2023,2024)));
Project::getProjectYear, years));

//项目归集
List<GovBizProjectBaseinfo> baseInfos = baseinfoService.list(Wrappers.lambdaQuery(GovBizProjectBaseinfo.class)
.eq(GovBizProjectBaseinfo::getDeleted, Boolean.FALSE)
.eq(StringUtils.isNotBlank(regionCode) && !DashboardConstant.CockpitStats.TOTAL.equals(regionCode),
GovBizProjectBaseinfo::getBaseAreaCode, regionCode + RegionContant.MORE_CODE));
List<String> baseProjIds = baseInfos.stream().map(b -> b.getBaseProjId()).collect(Collectors.toList());

//运维备案
List<GovOperationProjectBaseinfo> operationBaseInfos = operationBaseInfoService.list(Wrappers.lambdaQuery(GovOperationProjectBaseinfo.class)
.eq(GovOperationProjectBaseinfo::getDeleted, Boolean.FALSE)
.eq(StringUtils.isNotBlank(regionCode) && !DashboardConstant.CockpitStats.TOTAL.equals(regionCode),
GovOperationProjectBaseinfo::getBaseAreaCode, regionCode + RegionContant.MORE_CODE));

List<String> baseProjIds = baseInfos.stream().map(GovBizProjectBaseinfo::getBaseProjId)
.collect(Collectors.toList());
List<String> operationBaseProjIds = operationBaseInfos.stream().map(GovOperationProjectBaseinfo::getBaseProjId)
.collect(Collectors.toList());
Integer baseProjCount = 0;
if(CollUtil.isNotEmpty(baseProjIds)){
if(CollUtil.isNotEmpty(baseProjIds) || CollUtil.isNotEmpty(operationBaseProjIds)){
baseProjIds.addAll(operationBaseProjIds);
Long count = applyService.count(Wrappers.lambdaQuery(GovBizProjectApply.class)
.in(GovBizProjectApply::getBaseProjId, baseProjIds)
.eq(Objects.nonNull(year) && !year.equals(DashboardConstant.CockpitStats.NONE_YEAR),
GovBizProjectApply::getBaseProjSetYear, year)
.in(Objects.isNull(year) && year.equals(DashboardConstant.CockpitStats.NONE_YEAR),
GovBizProjectApply::getBaseProjSetYear, Lists.newArrayList(2021, 2022, 2023, 2024)));
GovBizProjectApply::getBaseProjSetYear, years));
baseProjCount = count.intValue();
}

//1.项目监测
//1.1 超期在建项目
Integer overdueConstructionProjectsNum = projects.stream().filter(p -> {
if(Objects.nonNull(p.getPlanAcceptanceTime()) && p.getPlanAcceptanceTime().compareTo(LocalDateTime.now()) < 0){
if(Objects.nonNull(p.getPlanAcceptanceTime()) &&
p.getPlanAcceptanceTime().compareTo(LocalDateTime.now()) < 0 &&
Objects.nonNull(p.getStatus()) && p.getStatus().compareTo(ProjectStatusEnum.ACCEPTED.getCode()) < 0){
return Boolean.TRUE;
}
return Boolean.FALSE;
@@ -207,7 +228,8 @@ public class CockpitStatsStatisticsTask {
cockpitStats.setMonitorLaggingProjectsNum(0);
//1.3预审驳回项目
Integer preFailed = projects.stream().filter(p -> {
if(Objects.nonNull(p.getStatus()) && p.getStatus().equals(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode())){
if(Objects.nonNull(p.getStatus()) &&
p.getStatus().equals(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode())){
return Boolean.TRUE;
}
return Boolean.FALSE;


+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/EarlyWarningManage.java Ver fichero

@@ -95,6 +95,9 @@ public class EarlyWarningManage {
records.setProjectName(project.getProjectName());
records.setWarningUsername(Objects.nonNull(user) ? user.getUsername() : StringUtils.EMPTY);
records.setWarningEmployeecode(employeeCode);
records.setProjectId(project.getId());
records.setProjectCode(project.getProjectCode());
records.setProjectStatus(project.getStatus());
earlyWarningRecordsService.save(records);

//2.消息提醒


+ 7
- 2
pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/WflowEarlyWarningRecords.java Ver fichero

@@ -40,11 +40,16 @@ public class WflowEarlyWarningRecords implements Serializable {
private String areaCode;

/**
* 项目名称
* 项目
*/
@ApiModelProperty(value = "项目编码")
private String projectCode;
@ApiModelProperty(value = "项目id")
private Long projectId;
@ApiModelProperty(value = "项目名称")
private String projectName;

@ApiModelProperty(value = "项目当时的状态")
private Integer projectStatus;

/**
* 流程类型


Cargando…
Cancelar
Guardar