|
@@ -2,7 +2,9 @@ package com.ningdatech.pmapi.projectlib.manage; |
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
import cn.hutool.core.util.StrUtil; |
|
|
import com.alibaba.excel.EasyExcel; |
|
|
import com.alibaba.excel.EasyExcel; |
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
|
import com.google.common.collect.Lists; |
|
|
import com.ningdatech.basic.exception.BizException; |
|
|
import com.ningdatech.basic.exception.BizException; |
|
|
import com.ningdatech.basic.function.VUtils; |
|
|
import com.ningdatech.basic.function.VUtils; |
|
|
import com.ningdatech.basic.model.PageVo; |
|
|
import com.ningdatech.basic.model.PageVo; |
|
@@ -22,6 +24,7 @@ import com.ningdatech.pmapi.projectlib.model.entity.ProjectRenewalFundDeclaratio |
|
|
import com.ningdatech.pmapi.projectlib.model.po.ProjectRenewalFundDeclarationPO; |
|
|
import com.ningdatech.pmapi.projectlib.model.po.ProjectRenewalFundDeclarationPO; |
|
|
import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalAuditReq; |
|
|
import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalAuditReq; |
|
|
import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalListReq; |
|
|
import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalListReq; |
|
|
|
|
|
import com.ningdatech.pmapi.projectlib.model.vo.AnnualAmountVO; |
|
|
import com.ningdatech.pmapi.projectlib.model.vo.ProjectRenewalFundDeclarationVO; |
|
|
import com.ningdatech.pmapi.projectlib.model.vo.ProjectRenewalFundDeclarationVO; |
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectRenewalFundDeclarationService; |
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectRenewalFundDeclarationService; |
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectService; |
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectService; |
|
@@ -37,6 +40,7 @@ import java.io.IOException; |
|
|
import java.time.LocalDateTime; |
|
|
import java.time.LocalDateTime; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.Objects; |
|
|
import java.util.Objects; |
|
|
|
|
|
import java.util.Optional; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@@ -100,6 +104,29 @@ public class ProjectRenewalFundManage { |
|
|
vo.setStatus(project.getStatus()); |
|
|
vo.setStatus(project.getStatus()); |
|
|
vo.setBuildOrgName(project.getBuildOrgName()); |
|
|
vo.setBuildOrgName(project.getBuildOrgName()); |
|
|
vo.setAnnualPaymentAmount(project.getAnnualPlanAmount()); |
|
|
vo.setAnnualPaymentAmount(project.getAnnualPlanAmount()); |
|
|
|
|
|
if (ProjectStatusEnum.ACCEPTED.getCode().equals(project.getStatus())) { |
|
|
|
|
|
List<AnnualAmountVO> annualAmounts = Lists.newArrayList(); |
|
|
|
|
|
annualAmounts.add(AnnualAmountVO.builder() |
|
|
|
|
|
.projectId(project.getId()) |
|
|
|
|
|
.projectYear(project.getProjectYear()) |
|
|
|
|
|
.annualAmount(project.getAnnualPlanAmount()) |
|
|
|
|
|
.build()); |
|
|
|
|
|
List<ProjectRenewalFundDeclaration> renewalDeclarations = projectRenewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class) |
|
|
|
|
|
.eq(ProjectRenewalFundDeclaration::getProjectId, vo.getId()) |
|
|
|
|
|
.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(project.getId()) |
|
|
|
|
|
.projectYear(declaration.getProjectYear()) |
|
|
|
|
|
.annualAmount(declaration.getAnnualPaymentAmount()) |
|
|
|
|
|
.build()); |
|
|
|
|
|
}) |
|
|
|
|
|
); |
|
|
|
|
|
vo.setAnnualAccumulateAmountList(annualAmounts); |
|
|
|
|
|
} |
|
|
return vo; |
|
|
return vo; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|