diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index f5c7549..127ba0f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -173,8 +173,10 @@ public class ProjectLibManage { if(finalRenewalMap.containsKey(item.getId())){ List prfs = finalRenewalMap.get(item.getId()); item.setAnnualAccumulateAmount(computeAmount(w.getAnnualPlanAmount(),prfs)); + item.setAnnualAccumulateAmountList(convertAccmulate(w,prfs)); }else{ item.setAnnualAccumulateAmount(w.getAnnualPlanAmount()); + item.setAnnualAccumulateAmountList(convertAccmulate(w,Collections.emptyList())); } return item; }); @@ -257,8 +259,10 @@ public class ProjectLibManage { if(finalRenewalMap.containsKey(item.getId())){ List prfs = finalRenewalMap.get(item.getId()); item.setAnnualAccumulateAmount(computeAmount(w.getAnnualPlanAmount(),prfs)); + item.setAnnualAccumulateAmountList(convertAccmulate(w,prfs)); }else{ item.setAnnualAccumulateAmount(w.getAnnualPlanAmount()); + item.setAnnualAccumulateAmountList(convertAccmulate(w,Collections.emptyList())); } return item; }); @@ -273,6 +277,23 @@ public class ProjectLibManage { return res; } + private List convertAccmulate(Project project,List prfs) { + List annualAmounts = Lists.newArrayList(); + annualAmounts.add(AnnualAmountVO.builder() + .projectId(project.getId()) + .projectYear(project.getProjectYear()) + .annualAmount(project.getAnnualPlanAmount()) + .build()); + for(ProjectRenewalFundDeclaration prf : prfs){ + annualAmounts.add(AnnualAmountVO.builder() + .projectId(prf.getProjectId()) + .projectYear(prf.getProjectYear()) + .annualAmount(prf.getAnnualPaymentAmount()) + .build()); + } + return annualAmounts; + } + private void setTag(ProjectLibListItemVO item, Map> finalTagMap, Map finalTagNameMap) { if(finalTagMap.containsKey(item.getProjectCode())){ List tags = Lists.newArrayList(); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java index 73eea9f..b0997d2 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java @@ -6,6 +6,7 @@ import com.ningdatech.pmapi.common.enumeration.CommonEnum; import com.ningdatech.pmapi.portrait.model.vo.TagVO; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; +import com.ningdatech.pmapi.projectlib.model.entity.ProjectRenewalFundDeclaration; import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; import com.ningdatech.pmapi.user.util.LoginUserUtil; import io.swagger.annotations.ApiModel; @@ -158,6 +159,7 @@ public class ProjectLibListItemVO { @ApiModelProperty("年度投资金额总额") private BigDecimal annualAccumulateAmount; + private List annualAccumulateAmountList; public Boolean getNeedUploadSuperLineFile() { UserInfoDetails userInfoDetail = LoginUserUtil.loginUserDetail(); //要满足条件 1.当前登录人是市本级单位 2.有上级条线单位 3.项目状态是待预审