From 13689a621648c9c4d6128779cbfccf260d4e5fc9 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Mon, 13 Nov 2023 17:29:17 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A9=BE=E9=A9=B6=E8=88=B1=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/enums/CockpitAppcationTypeEnum.java | 33 ++++++ .../dashboard/handle/CockpitStatsHandler.java | 50 +++++++-- .../pmapi/dashboard/manage/CockpitStatsManage.java | 11 +- .../dashboard/mapper/CockpitApplicationMapper.java | 16 +++ .../dashboard/model/entity/CockpitApplication.java | 45 ++++++++ .../pmapi/dashboard/model/entity/CockpitStats.java | 2 +- .../dashboard/model/po/SecrecyPasswordGradePO.java | 12 +-- .../pmapi/dashboard/model/vo/CockpitStatsVO.java | 22 ++++ .../service/ICockpitApplicationService.java | 16 +++ .../impl/CockpitApplicationServiceImpl.java | 23 +++++ .../scheduler/task/CockpitStatsStatisticsTask.java | 115 +++++++++++++-------- 11 files changed, 286 insertions(+), 59 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/dashboard/enums/CockpitAppcationTypeEnum.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/dashboard/mapper/CockpitApplicationMapper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/entity/CockpitApplication.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/dashboard/service/ICockpitApplicationService.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/dashboard/service/impl/CockpitApplicationServiceImpl.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/enums/CockpitAppcationTypeEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/enums/CockpitAppcationTypeEnum.java new file mode 100644 index 0000000..9665314 --- /dev/null +++ b/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; + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/handle/CockpitStatsHandler.java b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/handle/CockpitStatsHandler.java index 6c95fec..6511cff 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/handle/CockpitStatsHandler.java +++ b/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 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 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 convertQualityDatas(Integer year) { + List 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> convertCockpitApps(List appDatas) { + Map> 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 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()); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/CockpitStatsManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/CockpitStatsManage.java index 936ea72..091595f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/CockpitStatsManage.java +++ b/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 aps = cockpitApplicationService + .list(Wrappers.lambdaQuery(CockpitApplication.class) + .orderByAsc(CockpitApplication::getCreateOn)); + + return convertCockpitStats.convertCockpitStats(cockpitStats,regionCode,year,aps); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/mapper/CockpitApplicationMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/mapper/CockpitApplicationMapper.java new file mode 100644 index 0000000..b61f2b2 --- /dev/null +++ b/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; + +/** + *

+ * Mapper 接口 + *

+ * + * @author zpf + * @since 2023-02-05 + */ +public interface CockpitApplicationMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/entity/CockpitApplication.java b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/entity/CockpitApplication.java new file mode 100644 index 0000000..9dc5753 --- /dev/null +++ b/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; + +} \ No newline at end of file diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/entity/CockpitStats.java b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/entity/CockpitStats.java index 0fe20bc..f387ca8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/entity/CockpitStats.java +++ b/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; } \ No newline at end of file diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/po/SecrecyPasswordGradePO.java b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/po/SecrecyPasswordGradePO.java index 63df01d..48a048a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/po/SecrecyPasswordGradePO.java +++ b/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; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/CockpitStatsVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/CockpitStatsVO.java index 58e398a..342900c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/CockpitStatsVO.java +++ b/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> appDatas; + + @ApiModelProperty("数据质量区域信息") + private List 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 diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/service/ICockpitApplicationService.java b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/service/ICockpitApplicationService.java new file mode 100644 index 0000000..3e384f9 --- /dev/null +++ b/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; + +/** + *

+ * 服务类 + *

+ * + * @author zpf + * @since 2023-05-29 + */ +public interface ICockpitApplicationService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/service/impl/CockpitApplicationServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/service/impl/CockpitApplicationServiceImpl.java new file mode 100644 index 0000000..0a145e2 --- /dev/null +++ b/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; + +/** + *

+ * 服务实现类 + *

+ * + * @author zpf + * @since 2023-02-05 + */ +@Service +@RequiredArgsConstructor +public class CockpitApplicationServiceImpl extends ServiceImpl + implements ICockpitApplicationService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CockpitStatsStatisticsTask.java b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CockpitStatsStatisticsTask.java index 2fde720..e1055ba 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CockpitStatsStatisticsTask.java +++ b/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 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 yearProjIds = applieYears.stream().map(GovBizProjectApply::getBaseProjId) + .collect(Collectors.toList()); + List 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 approves = Lists.newArrayList(); List applies = Lists.newArrayList(); List procures = Lists.newArrayList(); + List cimplements = Lists.newArrayList(); if(CollUtil.isNotEmpty(baseInfos)){ List 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 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 baseProjIds = baseInfos.stream().map(GovBizProjectBaseinfo::getBaseProjId) - .collect(Collectors.toList()); - List 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 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);