diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java index da87009..f372820 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java @@ -115,6 +115,9 @@ public class ProjectRenewalFundManage { GovBizProjectBaseinfo baseinfo = baseinfoService.getOne(Wrappers.lambdaQuery(GovBizProjectBaseinfo.class) .eq(GovBizProjectBaseinfo::getBaseProjId, renewal.getProjectCode()) .last(BizConst.LIMIT_1)); + GovOperationProjectBaseinfo operationBaseinfo = operationProjectBaseinfoService.getOne(Wrappers.lambdaQuery(GovOperationProjectBaseinfo.class) + .eq(GovOperationProjectBaseinfo::getBaseProjId, renewal.getProjectCode()) + .last(BizConst.LIMIT_1)); GovBizProjectApply apply = applyService.getOne(Wrappers.lambdaQuery(GovBizProjectApply.class) .eq(GovBizProjectApply::getBaseProjId, renewal.getProjectCode()) .last(BizConst.LIMIT_1)); @@ -186,6 +189,40 @@ public class ProjectRenewalFundManage { }) ); vo.setAnnualAccumulateAmountList(annualAmounts); + }else if(Objects.nonNull(operationBaseinfo)){ + if(Objects.nonNull(approve)){ + vo.setApprovalAmount(approve.getBaseInitialReviewTotalMoney()); + } + vo.setProjectName(operationBaseinfo.getBaseProjName()); + vo.setProjectType(operationBaseinfo.getBaseProjType()); +// vo.setStage(project.getStage()); + vo.setStatus(StringUtils.isNotBlank(operationBaseinfo.getBaseProjSetProg()) ? + Integer.parseInt(operationBaseinfo.getBaseProjSetProg()) : null); + vo.setBuildOrgName(operationBaseinfo.getBaseBuildDeprt()); + vo.setAnnualPaymentAmount(renewal.getAnnualPaymentAmount()); + List annualAmounts = Lists.newArrayList(); + annualAmounts.add(AnnualAmountVO.builder() + .projectId(operationBaseinfo.getId()) + .projectCode(operationBaseinfo.getBaseProjId()) + .projectYear(StringUtils.isNotBlank(apply.getBaseProjSetYear()) ? Integer.parseInt(apply.getBaseProjSetYear()) : null) + .annualAmount(apply.getBaseProjDeclAmount()) + .build()); + List renewalDeclarations = projectRenewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class) + .eq(ProjectRenewalFundDeclaration::getProjectCode, vo.getProjectCode()) + .eq(ProjectRenewalFundDeclaration::getApprovalStatus, ProjectRenewalApprovalStatusEnum.PASS.name()) + .eq(ProjectRenewalFundDeclaration::getDeleted,Boolean.FALSE) + .orderByAsc(ProjectRenewalFundDeclaration::getProjectYear)); + Optional.ofNullable(renewalDeclarations).ifPresent(declarations -> + declarations.forEach(declaration -> { + annualAmounts.add(AnnualAmountVO.builder() + .projectId(operationBaseinfo.getId()) + .projectCode(operationBaseinfo.getBaseProjId()) + .projectYear(declaration.getProjectYear()) + .annualAmount(declaration.getAnnualPaymentAmount()) + .build()); + }) + ); + vo.setAnnualAccumulateAmountList(annualAmounts); } return vo; }