diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/workbench/manage/WorkbenchManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/workbench/manage/WorkbenchManage.java index c695c54..de2232c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/workbench/manage/WorkbenchManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/workbench/manage/WorkbenchManage.java @@ -112,6 +112,8 @@ public class WorkbenchManage { if (userInfoHelper.isSuperOrRegionAdmin(user.getUserId())) { res.setRegionDeclared(WorkbenchConverter.convert(defaultDeclaredProjectManage .declaredProjectRegionStatistics(year, user),defaultDeclaredProjectManage.declaredProjectRegionStatistics(year - 1, user))); + }else{ + res.setRegionDeclared(new WorkbenchVO.DeclaredStatistics()); } stopWatch.stop(); log.info("项目统计数据 耗时,{} s",stopWatch.getTotalTimeSeconds()); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/workbench/model/vo/WorkbenchVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/workbench/model/vo/WorkbenchVO.java index 9ba5666..7ddf896 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/workbench/model/vo/WorkbenchVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/workbench/model/vo/WorkbenchVO.java @@ -95,22 +95,22 @@ public class WorkbenchVO implements Serializable { @Data public static class DeclaredStatistics { @ApiModelProperty("总项目数") - private Integer totalNum; + private Integer totalNum = 0; @ApiModelProperty("建设项目数") - private Integer buildNum; + private Integer buildNum = 0; @ApiModelProperty("运维项目数") - private Integer operationNum; + private Integer operationNum = 0; @ApiModelProperty("待立项数") - private Integer notApprovedNum; + private Integer notApprovedNum = 0; @ApiModelProperty("已立项数") - private Integer approvedNum; + private Integer approvedNum = 0; @ApiModelProperty("建设中数") - private Integer constructionNum; + private Integer constructionNum = 0; @ApiModelProperty("待验收数") - private Integer tobeInspectedNum; + private Integer tobeInspectedNum = 0; @ApiModelProperty("已归档数") - private Integer archivedNum; + private Integer archivedNum = 0; @ApiModelProperty("申报总金额") private BigDecimal declaredAmount = BigDecimal.ZERO; @@ -123,9 +123,9 @@ public class WorkbenchVO implements Serializable { @ApiModelProperty("立项总金额-去年") private BigDecimal approvalAmountLastYear = BigDecimal.ZERO; @ApiModelProperty("申报总金额-较去年 增长") - private BigDecimal declaredAmountGrowthRate; + private BigDecimal declaredAmountGrowthRate = BigDecimal.ZERO; @ApiModelProperty("立项总金额-较去年 增长") - private BigDecimal approvalAmountGrowthRate; + private BigDecimal approvalAmountGrowthRate = BigDecimal.ZERO; public BigDecimal getDeclaredAmountGrowthRate(){ if(Objects.isNull(declaredAmount)){