From f3b0ab2ab98eb38558c4d33bad0376604a48c46f Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 14 Nov 2023 14:53:10 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A9=BE=E9=A9=B6=E8=88=B1=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/controller/DashboardController.java | 8 + .../pmapi/dashboard/manage/CockpitStatsManage.java | 29 +++ .../dashboard/model/dto/CockpitApplicationDTO.java | 37 +++ .../dashboard/model/dto/CockpitStatsSaveDTO.java | 257 +++++++++++++++++++++ 4 files changed, 331 insertions(+) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/dto/CockpitApplicationDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/dto/CockpitStatsSaveDTO.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/controller/DashboardController.java b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/controller/DashboardController.java index c49534b..93c872d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/controller/DashboardController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/controller/DashboardController.java @@ -4,6 +4,7 @@ import com.ningdatech.log.annotation.WebLog; import com.ningdatech.pmapi.dashboard.manage.CockpitStatsManage; import com.ningdatech.pmapi.dashboard.manage.DashboardExpertManage; import com.ningdatech.pmapi.dashboard.manage.DashboardProjectManage; +import com.ningdatech.pmapi.dashboard.model.dto.CockpitStatsSaveDTO; import com.ningdatech.pmapi.dashboard.model.po.QueryYearPO; import com.ningdatech.pmapi.dashboard.model.vo.*; import com.ningdatech.pmapi.scheduler.task.CockpitStatsStatisticsTask; @@ -81,4 +82,11 @@ public class DashboardController { cockpitStatsStatisticsTask.doTask(); return "运行成功"; } + + @PostMapping("cockpit-stats-save") + @ApiOperation("驾驶舱-统计数据接口 假数据保存") + public String statsSave(@RequestBody CockpitStatsSaveDTO save) { + cockpitStatsManage.save(save); + return "保存成功"; + } } 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 091595f..0f90335 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 @@ -1,9 +1,13 @@ package com.ningdatech.pmapi.dashboard.manage; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; 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.dto.CockpitApplicationDTO; +import com.ningdatech.pmapi.dashboard.model.dto.CockpitStatsSaveDTO; import com.ningdatech.pmapi.dashboard.model.entity.CockpitApplication; import com.ningdatech.pmapi.dashboard.model.entity.CockpitStats; import com.ningdatech.pmapi.dashboard.model.vo.CockpitStatsVO; @@ -16,6 +20,7 @@ import org.springframework.stereotype.Component; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** * @Classname CockpitStatsManage @@ -58,4 +63,28 @@ public class CockpitStatsManage { return convertCockpitStats.convertCockpitStats(cockpitStats,regionCode,year,aps); } + + public void save(CockpitStatsSaveDTO save) { + List cockpitStatsList = cockpitStatsService.list(Wrappers.lambdaUpdate(CockpitStats.class) + .eq(Objects.nonNull(save.getRegionCode()), CockpitStats::getRegionCode, save.getRegionCode()) + .eq(Objects.isNull(save.getYear()), CockpitStats::getYear, save.getYear())); + if(CollUtil.isNotEmpty(cockpitStatsList)){ + for(CockpitStats cockpitStats : cockpitStatsList){ + cockpitStats = BeanUtil.copyProperties(save,CockpitStats.class); + cockpitStatsService.updateById(cockpitStats); + } + } + + if(Objects.nonNull(save.getCockpitApplications())){ + cockpitApplicationService.remove(Wrappers.lambdaQuery(CockpitApplication.class)); + + List cockpitApplications = save.getCockpitApplications(); + if(CollUtil.isNotEmpty(cockpitApplications)){ + List applications = cockpitApplications.stream() + .map(a -> BeanUtil.copyProperties(a,CockpitApplication.class)) + .collect(Collectors.toList()); + cockpitApplicationService.saveBatch(applications); + } + } + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/dto/CockpitApplicationDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/dto/CockpitApplicationDTO.java new file mode 100644 index 0000000..0afc7cc --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/dto/CockpitApplicationDTO.java @@ -0,0 +1,37 @@ +package com.ningdatech.pmapi.dashboard.model.dto; + +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 +@ApiModel(value = "驾驶舱统计应用对象", description = "") +public class CockpitApplicationDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @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/dto/CockpitStatsSaveDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/dto/CockpitStatsSaveDTO.java new file mode 100644 index 0000000..9f40b0e --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/dto/CockpitStatsSaveDTO.java @@ -0,0 +1,257 @@ +package com.ningdatech.pmapi.dashboard.model.dto; + +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; +import java.util.List; + +@Data +@ApiModel(value = "CockpitStatsSaveDTO", description = "") +public class CockpitStatsSaveDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("区域code") + private String regionCode; + + @ApiModelProperty("区域名") + private String regionName; + + @ApiModelProperty("年份") + private Integer year; + + @ApiModelProperty("年份") + private LocalDateTime createOn; + + @ApiModelProperty("项目监控-超期建设项目数") + private Integer monitorOverdueConstructionProjectsNum; + + @ApiModelProperty("项目监控-超期建设项目-增长比例") + private String monitorOverdueConstructionProjectsRise; + + @ApiModelProperty("项目监控-环节滞后项目数") + private Integer monitorLaggingProjectsNum; + + @ApiModelProperty("项目监控-环节滞后项目-增长比例") + private String monitorLaggingProjectsRise = "0"; + + @ApiModelProperty("项目监控-预审驳回项目数") + private Integer monitorRejectedPreReviewProjectsNum; + + @ApiModelProperty("项目监控-预审驳回项目-增长比例") + private String monitorRejectedPreReviewProjectsRise; + + @ApiModelProperty("项目监控-评审驳回项目数") + private Integer monitorRejectedApproveProjectsNum; + + @ApiModelProperty("项目监控-评审驳回项目-增长比例") + private String monitorRejectedApproveProjectsRise; + @ApiModelProperty("项目监控-验收条件未达标") + private Integer monitorAcceptConditionsNotStandardsNum; + + @ApiModelProperty("项目监控-验收条件未达标-增长比例") + private String monitorAcceptConditionsNotStandardsRise; + + @ApiModelProperty("项目监控-安全投入金额(用于算安全投入占比)") + private BigDecimal monitorSafetyInputAmount; + + @ApiModelProperty("项目监控-总申报金额(用于算安全投入占比)") + private BigDecimal monitorDeclaredAmount; + + @ApiModelProperty("项目监控-等保1级数量") + private Integer monitorSecrecyGrade1Num; + + @ApiModelProperty("项目监控-等保2级数量") + private Integer monitorSecrecyGrade2Num; + + @ApiModelProperty("项目监控-等保3级数量") + private Integer monitorSecrecyGrade3Num; + + @ApiModelProperty("项目监控-等保4级数量") + private Integer monitorSecrecyGrade4Num; + + @ApiModelProperty("项目监控-等保5级数量") + private Integer monitorSecrecyGrade5Num; + + @ApiModelProperty("项目监控-密评1级数量") + private Integer monitorPasswordGrade1Num; + + @ApiModelProperty("项目监控-密评2级数量") + private Integer monitorPasswordGrade2Num; + + @ApiModelProperty("项目监控-密评3级数量") + private Integer monitorPasswordGrade3Num; + + @ApiModelProperty("项目监控-密评4级数量") + private Integer monitorPasswordGrade4Num; + + @ApiModelProperty("项目监控-密评5级数量") + private Integer monitorPasswordGrade5Num; + + @ApiModelProperty("专家-总人数") + private Integer expertTotalNum; + + @ApiModelProperty("专家-方案合理性") + private Integer expertPlanRationalityNum; + + @ApiModelProperty("专家-计数可行性评估") + private Integer expertTechnicalFeasibilityAssessmentNum; + + @ApiModelProperty("专家-信创") + private Integer expertXinchuangNum; + + @ApiModelProperty("专家-软硬件核价") + private Integer expertSoftHardPricingNum; + + @ApiModelProperty("专家-党政信息") + private Integer expertPartyGovInfoNum; + + @ApiModelProperty("专家-网络安全") + private Integer expertNetworkSecurityNum; + + @ApiModelProperty("专家-信息化专家") + private Integer expertPromotionInfoTechnologyNum; + + @ApiModelProperty("专家-财务专家") + private Integer expertFinancialNum = 0; + + @ApiModelProperty("顶部-计划项目数") + private Integer topPlanProjectsNum = 0; + + @ApiModelProperty("顶部-批复项目数") + private Integer topApprovalProjectsNum = 0; + + @ApiModelProperty("顶部-批复金额") + private BigDecimal topApprovalProjectsAmount; + + @ApiModelProperty("顶部-平均建设周期") + private Integer topAverageConstructionPeriod; + + @ApiModelProperty("顶部-在建项目数") + private Integer topOngoingProjectsNum; + + @ApiModelProperty("项目总数") + private Integer projectsTotal; + + @ApiModelProperty("项目总数-计划状态") + private Integer projectsTotalPlan; + + @ApiModelProperty("项目总数-申报状态") + private Integer projectsTotalApply; + + @ApiModelProperty("项目总数-审批状态") + private Integer projectsTotalApprove; + + @ApiModelProperty("项目总数-建设状态") + private Integer projectsTotalConstruction; + + @ApiModelProperty("项目总数-验收状态") + private Integer projectsTotalAccept; + + @ApiModelProperty("项目总数-运维状态") + private Integer projectsTotalOperation; + + @ApiModelProperty("项目总数-绩效状态") + private Integer projectsTotalPerformance; + + @ApiModelProperty("项目总数-注销状态") + private Integer projectsTotalLogOff; + + @ApiModelProperty("优秀项目-最佳应用") + private Integer excellentBestAppNum; + + @ApiModelProperty("优秀项目-重大应用") + private Integer excellentMajorAppNum; + + @ApiModelProperty("优秀项目-跨域共享数") + private Integer excellentCrossDomainSharingNum; + + @ApiModelProperty("优秀项目-跨域共享数") + private Integer excellentCrossLevelSharingNum; + + @ApiModelProperty("核减资金") + private BigDecimal reduceFundsTotal; + + @ApiModelProperty("驳回节约资金") + private BigDecimal rejectSavingsFunds; + + @ApiModelProperty("申报金额-申报状态") + private BigDecimal declaredAmountApprove; + @ApiModelProperty("批复金额-申报状态") + private BigDecimal approvalAmountApprove; + @ApiModelProperty("差额-申报状态") + private BigDecimal differenceApprove; + + @ApiModelProperty("申报金额-批复状态") + private BigDecimal declaredAmountApproval; + @ApiModelProperty("批复金额-批复状态") + private BigDecimal approvalAmountApproval; + @ApiModelProperty("差额-批复状态") + private BigDecimal differenceApproval; + + @ApiModelProperty("申报金额-合同状态") + private BigDecimal declaredAmountContract; + @ApiModelProperty("批复金额-合同状态") + private BigDecimal approvalAmountContract; + @ApiModelProperty("差额-合同状态") + private BigDecimal differenceContract; + + @ApiModelProperty("产出-应用数量") + private Integer produceAppNum; + @ApiModelProperty("产出-数据产品") + private Integer produceDataNum; + @ApiModelProperty("产出-组件数") + private Integer produceComponentNum; + @ApiModelProperty("产出-大脑要素") + private Integer produceBrainElementsNum; + @ApiModelProperty("产出-大脑要素 模型数") + private Integer produceBrainModelNum; + + @ApiModelProperty("绩效-项目总数量") + private Integer performanceTotal; + + @ApiModelProperty("绩效-未评价数量") + private Integer performanceTobeReviewTotal; + + @ApiModelProperty("绩效-已评价数量") + private Integer performanceReviewedTotal; + + @ApiModelProperty("绩效-top1分数") + private BigDecimal performanceTop1Score; + + @ApiModelProperty("绩效-top1名称") + private String performanceTop1Name; + + @ApiModelProperty("绩效-top2分数") + private BigDecimal performanceTop2Score; + + @ApiModelProperty("绩效-top2名称") + private String performanceTop2Name; + + @ApiModelProperty("绩效-top3分数") + private BigDecimal performanceTop3Score; + + @ApiModelProperty("绩效-top3名称") + private String performanceTop3Name; + + @ApiModelProperty("绩效-top4分数") + private BigDecimal performanceTop4Score; + + @ApiModelProperty("绩效-top4名称") + private String performanceTop4Name; + + @ApiModelProperty("绩效-top5分数") + private BigDecimal performanceTop5Score; + + @ApiModelProperty("绩效-top5名称") + private String performanceTop5Name; + + @ApiModelProperty("数据质量") + private BigDecimal dataQuality; + + @ApiModelProperty("数据质量") + private List cockpitApplications; +} \ No newline at end of file