浏览代码

驾驶舱数据整改

master
PoffyZhang 1年前
父节点
当前提交
13689a6216
共有 11 个文件被更改,包括 286 次插入59 次删除
  1. +33
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/enums/CockpitAppcationTypeEnum.java
  2. +44
    -6
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/handle/CockpitStatsHandler.java
  3. +10
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/CockpitStatsManage.java
  4. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/mapper/CockpitApplicationMapper.java
  5. +45
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/entity/CockpitApplication.java
  6. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/entity/CockpitStats.java
  7. +6
    -6
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/po/SecrecyPasswordGradePO.java
  8. +22
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/CockpitStatsVO.java
  9. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/service/ICockpitApplicationService.java
  10. +23
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/service/impl/CockpitApplicationServiceImpl.java
  11. +70
    -45
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CockpitStatsStatisticsTask.java

+ 33
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/enums/CockpitAppcationTypeEnum.java 查看文件

@@ -0,0 +1,33 @@
package com.ningdatech.pmapi.dashboard.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.Objects;

@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum CockpitAppcationTypeEnum {
/**
* 驾驶舱 应用类型
*/
OPTIMAL(1,"最优应用"),
MAJOR(2,"重大应用");

private Integer code;
private String desc;

public static CockpitAppcationTypeEnum match(Integer code) {
if (Objects.isNull(code)) {
return null;
}
for (CockpitAppcationTypeEnum t : CockpitAppcationTypeEnum.values()) {
if (code.equals(t.getCode())) {
return t;
}
}
return null;
}
}

+ 44
- 6
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/handle/CockpitStatsHandler.java 查看文件

@@ -1,11 +1,15 @@
package com.ningdatech.pmapi.dashboard.handle;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.ningdatech.pmapi.common.constant.RegionConst;
import com.ningdatech.pmapi.common.helper.RegionCacheHelper;
import com.ningdatech.pmapi.dashboard.constant.DashboardConstant;
import com.ningdatech.pmapi.dashboard.enums.CockpitAppcationTypeEnum;
import com.ningdatech.pmapi.dashboard.model.entity.CockpitApplication;
import com.ningdatech.pmapi.dashboard.model.entity.CockpitStats;
import com.ningdatech.pmapi.dashboard.model.vo.CockpitStatsVO;
import com.ningdatech.pmapi.dashboard.service.ICockpitStatsService;
@@ -17,10 +21,7 @@ import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;

/**
@@ -40,7 +41,8 @@ public class CockpitStatsHandler {

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

public CockpitStatsVO convertCockpitStats(CockpitStats cockpitStats,String regionCode,Integer year) {
public CockpitStatsVO convertCockpitStats(CockpitStats cockpitStats, String regionCode, Integer year
, List<CockpitApplication> appDatas) {
CockpitStatsVO res = BeanUtil.copyProperties(cockpitStats,CockpitStatsVO.class);

if(Objects.isNull(cockpitStats)){
@@ -64,6 +66,41 @@ public class CockpitStatsHandler {
res.setProduceData(convertProduceData(cockpitStats));
//绩效
res.setPerformanceData(convertPerformanceData(cockpitStats));
//最佳/重大应用
res.setAppDatas(convertCockpitApps(appDatas));
//数据质量分数
res.setQualityDatas(convertQualityDatas(year));
return res;
}

private List<CockpitStatsVO.QualityData> convertQualityDatas(Integer year) {
List<CockpitStats> datas = cockpitStatsService.list(Wrappers.lambdaQuery(CockpitStats.class)
.eq(Objects.nonNull(year), CockpitStats::getYear, year)
.eq(Objects.isNull(year), CockpitStats::getYear, DashboardConstant.CockpitStats.NONE_YEAR)
.ne(CockpitStats::getRegionCode,DashboardConstant.CockpitStats.TOTAL)
.orderByAsc(CockpitStats::getRegionCode));

if(CollUtil.isEmpty(datas)){
return Collections.emptyList();
}

return datas.stream().map(d -> {
CockpitStatsVO.QualityData data = new CockpitStatsVO.QualityData();
data.setRegionCode(d.getRegionCode());
data.setRegionName(d.getRegionName());
data.setQuality(d.getDataQuality());
return data;
}).collect(Collectors.toList());
}

private Map<String, List<CockpitApplication>> convertCockpitApps(List<CockpitApplication> appDatas) {
Map<String, List<CockpitApplication>> res = Maps.newHashMap();
res.put(CockpitAppcationTypeEnum.OPTIMAL.getDesc(), CollUtil.isEmpty(appDatas) ? Collections.emptyList() :
appDatas.stream().filter(a -> Objects.nonNull(a) && Objects.nonNull(a.getType()) &&
CockpitAppcationTypeEnum.OPTIMAL.getCode().equals(a.getType())).collect(Collectors.toList()));
res.put(CockpitAppcationTypeEnum.MAJOR.getDesc(), CollUtil.isEmpty(appDatas) ? Collections.emptyList() :
appDatas.stream().filter(a -> Objects.nonNull(a) && Objects.nonNull(a.getType()) &&
CockpitAppcationTypeEnum.MAJOR.getCode().equals(a.getType())).collect(Collectors.toList()));
return res;
}

@@ -184,7 +221,8 @@ public class CockpitStatsHandler {
List<CockpitStats> cocks = cockpitStatsService.list(Wrappers.lambdaQuery(CockpitStats.class)
.eq(StringUtils.isNotBlank(regionCode), CockpitStats::getRegionCode, regionCode)
.eq(StringUtils.isBlank(regionCode), CockpitStats::getRegionCode, DashboardConstant.CockpitStats.TOTAL)
.in(CockpitStats::getYear, years));
.in(CockpitStats::getYear, years)
.orderByAsc(CockpitStats::getYear));
return cocks.stream().map(c -> {
CockpitStatsVO.SafetyInput safetyInput = new CockpitStatsVO.SafetyInput();
safetyInput.setYear(c.getYear());


+ 10
- 1
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/CockpitStatsManage.java 查看文件

@@ -4,14 +4,17 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.pmapi.common.constant.BizConst;
import com.ningdatech.pmapi.dashboard.constant.DashboardConstant;
import com.ningdatech.pmapi.dashboard.handle.CockpitStatsHandler;
import com.ningdatech.pmapi.dashboard.model.entity.CockpitApplication;
import com.ningdatech.pmapi.dashboard.model.entity.CockpitStats;
import com.ningdatech.pmapi.dashboard.model.vo.CockpitStatsVO;
import com.ningdatech.pmapi.dashboard.service.ICockpitApplicationService;
import com.ningdatech.pmapi.dashboard.service.ICockpitStatsService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Objects;

/**
@@ -29,6 +32,8 @@ public class CockpitStatsManage {

private final CockpitStatsHandler convertCockpitStats;

private final ICockpitApplicationService cockpitApplicationService;

/**
* 驾驶舱 统计数据
* @param regionCode
@@ -47,6 +52,10 @@ public class CockpitStatsManage {
return new CockpitStatsVO();
}

return convertCockpitStats.convertCockpitStats(cockpitStats,regionCode,year);
List<CockpitApplication> aps = cockpitApplicationService
.list(Wrappers.lambdaQuery(CockpitApplication.class)
.orderByAsc(CockpitApplication::getCreateOn));

return convertCockpitStats.convertCockpitStats(cockpitStats,regionCode,year,aps);
}
}

+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/mapper/CockpitApplicationMapper.java 查看文件

@@ -0,0 +1,16 @@
package com.ningdatech.pmapi.dashboard.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ningdatech.pmapi.dashboard.model.entity.CockpitApplication;

/**
* <p>
* Mapper 接口
* </p>
*
* @author zpf
* @since 2023-02-05
*/
public interface CockpitApplicationMapper extends BaseMapper<CockpitApplication> {

}

+ 45
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/entity/CockpitApplication.java 查看文件

@@ -0,0 +1,45 @@
package com.ningdatech.pmapi.dashboard.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@TableName("nd_project_cockpit_applition")
@ApiModel(value = "驾驶舱统计应用对象", description = "")
public class CockpitApplication implements Serializable {
private static final long serialVersionUID = 1L;

@ApiModelProperty("主键")
@TableId(type = IdType.AUTO)
private Long id;

@ApiModelProperty("应用名称")
private String applicationName;

@ApiModelProperty("介绍")
private String introduce;

@ApiModelProperty("年份")
private LocalDateTime createOn;

@ApiModelProperty("建设单位")
private String buildOrgName;

@ApiModelProperty("金额")
private BigDecimal amount;

@ApiModelProperty("标签")
private String tags;

@ApiModelProperty("类型 1最佳应用 2重大应用")
private Integer type;

}

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/entity/CockpitStats.java 查看文件

@@ -257,6 +257,6 @@ public class CockpitStats implements Serializable {
private String performanceTop5Name;

@ApiModelProperty("数据质量")
private BigDecimal dataQuality;
private BigDecimal dataQuality = BigDecimal.ZERO;

}

+ 6
- 6
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/po/SecrecyPasswordGradePO.java 查看文件

@@ -11,22 +11,22 @@ public class SecrecyPasswordGradePO implements Serializable {
private static final long serialVersionUID = 1L;

@ApiModelProperty("项目监控-等保1级数量")
private Integer monitorSecrecyGrade1Num;
private Integer monitorSecrecyGrade1Num = 0;

@ApiModelProperty("项目监控-等保2级数量")
private Integer monitorSecrecyGrade2Num;
private Integer monitorSecrecyGrade2Num = 0;

@ApiModelProperty("项目监控-等保3级数量")
private Integer monitorSecrecyGrade3Num;
private Integer monitorSecrecyGrade3Num = 0;

@ApiModelProperty("项目监控-等保4级数量")
private Integer monitorSecrecyGrade4Num;
private Integer monitorSecrecyGrade4Num = 0;

@ApiModelProperty("项目监控-等保5级数量")
private Integer monitorSecrecyGrade5Num;
private Integer monitorSecrecyGrade5Num = 0;

@ApiModelProperty("项目监控-密评1级数量")
private Integer monitorPasswordGrade1Num;
private Integer monitorPasswordGrade1Num = 0;

@ApiModelProperty("项目监控-密评2级数量")
private Integer monitorPasswordGrade2Num;


+ 22
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/CockpitStatsVO.java 查看文件

@@ -1,5 +1,6 @@
package com.ningdatech.pmapi.dashboard.model.vo;

import com.ningdatech.pmapi.dashboard.model.entity.CockpitApplication;
import com.ningdatech.pmapi.portrait.model.entity.Tag;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -9,6 +10,7 @@ import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Data
@ApiModel(value = "驾驶舱统计数据对象VO", description = "")
@@ -57,6 +59,12 @@ public class CockpitStatsVO implements Serializable {
@ApiModelProperty("绩效数据")
private PerformanceData performanceData;

@ApiModelProperty("最佳应用or重大应用")
private Map<String,List<CockpitApplication>> appDatas;

@ApiModelProperty("数据质量区域信息")
private List<QualityData> qualityDatas;

@Data
public static class Monitor {
@ApiModelProperty("项目监控-超期建设项目数")
@@ -210,6 +218,18 @@ public class CockpitStatsVO implements Serializable {
}

@Data
public static class QualityData {
@ApiModelProperty("区域CODE")
private String regionCode;

@ApiModelProperty("区域名字")
private String regionName;

@ApiModelProperty("质量分数")
private BigDecimal quality = BigDecimal.ZERO;
}

@Data
public static class StatusProjectsData {
@ApiModelProperty("项目总数-计划状态")
private Integer projectsTotalPlan;
@@ -313,6 +333,8 @@ public class CockpitStatsVO implements Serializable {
private Integer produceComponentNum;
@ApiModelProperty("产出-大脑要素")
private Integer produceBrainElementsNum;
@ApiModelProperty("产出-大脑要素")
private Integer produceBrainModelNum;
}

@Data


+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/service/ICockpitApplicationService.java 查看文件

@@ -0,0 +1,16 @@
package com.ningdatech.pmapi.dashboard.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ningdatech.pmapi.dashboard.model.entity.CockpitApplication;

/**
* <p>
* 服务类
* </p>
*
* @author zpf
* @since 2023-05-29
*/
public interface ICockpitApplicationService extends IService<CockpitApplication> {

}

+ 23
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/service/impl/CockpitApplicationServiceImpl.java 查看文件

@@ -0,0 +1,23 @@
package com.ningdatech.pmapi.dashboard.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ningdatech.pmapi.dashboard.mapper.CockpitApplicationMapper;
import com.ningdatech.pmapi.dashboard.model.entity.CockpitApplication;
import com.ningdatech.pmapi.dashboard.service.ICockpitApplicationService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
* <p>
* 服务实现类
* </p>
*
* @author zpf
* @since 2023-02-05
*/
@Service
@RequiredArgsConstructor
public class CockpitApplicationServiceImpl extends ServiceImpl<CockpitApplicationMapper, CockpitApplication>
implements ICockpitApplicationService {

}

+ 70
- 45
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CockpitStatsStatisticsTask.java 查看文件

@@ -99,6 +99,9 @@ public class CockpitStatsStatisticsTask {
private IGovBizProjectProcureService procureService;

@Autowired
private IGovBizProjectCimplementService cimplementService;

@Autowired
private IGovOperationProjectBaseinfoService operationBaseInfoService;

@Autowired
@@ -206,14 +209,25 @@ public class CockpitStatsStatisticsTask {
Project::getProjectYear, years));

//项目归集
List<GovBizProjectApply> applieYears = applyService.list(Wrappers.lambdaQuery(GovBizProjectApply.class)
.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, years));
List<String> yearProjIds = applieYears.stream().map(GovBizProjectApply::getBaseProjId)
.collect(Collectors.toList());

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));
GovBizProjectBaseinfo::getBaseAreaCode, regionCode + RegionContant.MORE_CODE)
.in(CollUtil.isNotEmpty(yearProjIds),GovBizProjectBaseinfo::getBaseProjId,yearProjIds)
.in(CollUtil.isEmpty(yearProjIds),GovBizProjectBaseinfo::getBaseProjId,Lists.newArrayList(BizConst.NINE_AREA_CODE_LAST)));

List<GovBizProjectApprove> approves = Lists.newArrayList();
List<GovBizProjectApply> applies = Lists.newArrayList();
List<GovBizProjectProcure> procures = Lists.newArrayList();
List<GovBizProjectCimplement> cimplements = Lists.newArrayList();
if(CollUtil.isNotEmpty(baseInfos)){
List<String> baseProjIds = baseInfos.stream().map(GovBizProjectBaseinfo::getBaseProjId).collect(Collectors.toList());
approves = approveService.list(Wrappers.lambdaQuery(GovBizProjectApprove.class)
@@ -224,29 +238,9 @@ public class CockpitStatsStatisticsTask {

procures = procureService.list(Wrappers.lambdaQuery(GovBizProjectProcure.class)
.in(GovBizProjectProcure::getBaseProjId, baseProjIds));
}


//运维备案
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) || 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, years));
baseProjCount = count.intValue();
cimplements = cimplementService.list(Wrappers.lambdaQuery(GovBizProjectCimplement.class)
.in(GovBizProjectCimplement::getBaseProjId, baseProjIds));
}

//1.项目监测
@@ -309,13 +303,50 @@ public class CockpitStatsStatisticsTask {

//1.8等保密评
SecrecyPasswordGradePO secrecyPasswordGradePo = cockpitStatsService.getSecrecyPasswordGrade(regionCode, year);

Integer guijiSecerecyGrade1 = 0;
Integer guijiSecerecyGrade2 = 0;
Integer guijiSecerecyGrade3 = 0;
Integer guijiSecerecyGrade4 = 0;
Integer guijiSecerecyGrade5 = 0;
//项目归集 评审信息
for (GovBizProjectApprove approve : approves){
String equalProtectionLevel = approve.getEqualProtectionLevel();
switch (equalProtectionLevel){
case "01":
guijiSecerecyGrade1++;
break;
case "02":
guijiSecerecyGrade2++;
break;
case "03":
guijiSecerecyGrade3++;
break;
case "04":
guijiSecerecyGrade4++;
break;
case "05":
guijiSecerecyGrade5++;
break;
default:
break;
}
}

Integer passwordGradeNumGov = 0;
for (GovBizProjectCimplement cimplement : cimplements){
if(StringUtils.isNotBlank(cimplement.getBaseInforLevelFile())){
passwordGradeNumGov ++;
}
}

if(Objects.nonNull(secrecyPasswordGradePo)){
cockpitStats.setMonitorSecrecyGrade1Num(secrecyPasswordGradePo.getMonitorSecrecyGrade1Num());
cockpitStats.setMonitorSecrecyGrade2Num(secrecyPasswordGradePo.getMonitorSecrecyGrade2Num());
cockpitStats.setMonitorSecrecyGrade3Num(secrecyPasswordGradePo.getMonitorSecrecyGrade3Num());
cockpitStats.setMonitorSecrecyGrade4Num(secrecyPasswordGradePo.getMonitorSecrecyGrade4Num());
cockpitStats.setMonitorSecrecyGrade5Num(secrecyPasswordGradePo.getMonitorSecrecyGrade5Num());
cockpitStats.setMonitorPasswordGrade1Num(secrecyPasswordGradePo.getMonitorPasswordGrade1Num());
cockpitStats.setMonitorSecrecyGrade1Num(secrecyPasswordGradePo.getMonitorSecrecyGrade1Num() + guijiSecerecyGrade1);
cockpitStats.setMonitorSecrecyGrade2Num(secrecyPasswordGradePo.getMonitorSecrecyGrade2Num() + guijiSecerecyGrade2);
cockpitStats.setMonitorSecrecyGrade3Num(secrecyPasswordGradePo.getMonitorSecrecyGrade3Num() + guijiSecerecyGrade3);
cockpitStats.setMonitorSecrecyGrade4Num(secrecyPasswordGradePo.getMonitorSecrecyGrade4Num() + guijiSecerecyGrade4);
cockpitStats.setMonitorSecrecyGrade5Num(secrecyPasswordGradePo.getMonitorSecrecyGrade5Num() + guijiSecerecyGrade5);
cockpitStats.setMonitorPasswordGrade1Num(secrecyPasswordGradePo.getMonitorPasswordGrade1Num() + passwordGradeNumGov);
cockpitStats.setMonitorPasswordGrade2Num(secrecyPasswordGradePo.getMonitorPasswordGrade2Num());
cockpitStats.setMonitorPasswordGrade3Num(secrecyPasswordGradePo.getMonitorPasswordGrade3Num());
cockpitStats.setMonitorPasswordGrade4Num(secrecyPasswordGradePo.getMonitorPasswordGrade4Num());
@@ -420,7 +451,7 @@ public class CockpitStatsStatisticsTask {
cockpitStats.setTopOngoingProjectsNum(contructionNum + contructionNumGov);

//4.地图 只要放总数 取的时候 会有逻辑(也要取项目归集)
cockpitStats.setProjectsTotal(projects.size() + baseProjCount);
cockpitStats.setProjectsTotal(projects.size() + baseInfos.size());

//5.下面项目状态数
//5.1 计划(申报项目:项目预审完成到年度计划未完成 项目归集:评审中)
@@ -556,18 +587,6 @@ public class CockpitStatsStatisticsTask {
cockpitStats.setExcellentCrossLevelSharingNum(0);
cockpitStats.setExcellentMajorAppNum(0);

//7 核减资金
Double reduceFundsTotal = projects.stream().mapToDouble(p -> {
if(Objects.nonNull(p.getApprovalAmount()) && Objects.nonNull(p.getDeclareAmount())){
if(Objects.nonNull(p.getContractAmount())){
return (p.getDeclareAmount().subtract(p.getContractAmount())).doubleValue();
}else{
return (p.getDeclareAmount().subtract(p.getApprovalAmount())).doubleValue();
}
}
return 0.0;
}).sum();
cockpitStats.setReduceFundsTotal(BigDecimal.valueOf(reduceFundsTotal));
//7.2驳回节约资金
List<Project> rejectPreProjects = projects.stream().filter(p -> {
if (Objects.nonNull(p.getStatus()) &&
@@ -620,7 +639,8 @@ public class CockpitStatsStatisticsTask {
BigDecimal approvalAmountApproveTotal = BigDecimal.valueOf(approvalAmountApprove).add(BigDecimal.valueOf(approvalAmountApproveGov));
cockpitStats.setApprovalAmountApprove(approvalAmountApproveTotal);
//申报的差额
cockpitStats.setDifferenceApprove(declaredAmountApproveTotal.subtract(approvalAmountApproveTotal));
BigDecimal subtractApprove = declaredAmountApproveTotal.subtract(approvalAmountApproveTotal);
cockpitStats.setDifferenceApprove(subtractApprove);

//批复的申报金额(申报项目:建设方案申报金额 项目归集:建议总投资)
cockpitStats.setDeclaredAmountApproval(approvalAmountApproveTotal);
@@ -638,7 +658,8 @@ public class CockpitStatsStatisticsTask {
cockpitStats.setApprovalAmountApproval(approvalAmountApprovalTotal);

//批复的差额
cockpitStats.setDifferenceApproval(approvalAmountApproveTotal.subtract(approvalAmountApprovalTotal));
BigDecimal subtractApproval = approvalAmountApproveTotal.subtract(approvalAmountApprovalTotal);
cockpitStats.setDifferenceApproval(subtractApproval);

//合同的申报金额(申报项目:归集信息建议批复总投资 项目归集:建议批复总投资)
cockpitStats.setDeclaredAmountContract(approvalAmountApprovalTotal);
@@ -657,7 +678,11 @@ public class CockpitStatsStatisticsTask {
cockpitStats.setApprovalAmountContract(approvalAmountContractTotal);

//合同的差额
cockpitStats.setDifferenceContract(approvalAmountApprovalTotal.subtract(approvalAmountContractTotal));
BigDecimal subtractContract = approvalAmountApprovalTotal.subtract(approvalAmountContractTotal);
cockpitStats.setDifferenceContract(subtractContract);

//7 核减资金
cockpitStats.setReduceFundsTotal(subtractApprove.add(subtractApproval).add(subtractContract));

//8 产出数据
cockpitStats.setProduceAppNum(0);


正在加载...
取消
保存