|
|
@@ -15,8 +15,10 @@ import com.ningdatech.pmapi.common.constant.CommonConst; |
|
|
|
import com.ningdatech.pmapi.common.util.ExcelDownUtil; |
|
|
|
import com.ningdatech.pmapi.common.util.ExcelExportStyle; |
|
|
|
import com.ningdatech.pmapi.gov.model.entity.GovBizProjectApply; |
|
|
|
import com.ningdatech.pmapi.gov.model.entity.GovBizProjectApprove; |
|
|
|
import com.ningdatech.pmapi.gov.model.entity.GovBizProjectBaseinfo; |
|
|
|
import com.ningdatech.pmapi.gov.service.IGovBizProjectApplyService; |
|
|
|
import com.ningdatech.pmapi.gov.service.IGovBizProjectApproveService; |
|
|
|
import com.ningdatech.pmapi.gov.service.IGovBizProjectBaseinfoService; |
|
|
|
import com.ningdatech.pmapi.projectdeclared.model.dto.ProjectRenewalDeclareExportDTO; |
|
|
|
import com.ningdatech.pmapi.projectlib.enumeration.ProjectRenewalApprovalStatusEnum; |
|
|
@@ -69,6 +71,8 @@ public class ProjectRenewalFundManage { |
|
|
|
|
|
|
|
private final IGovBizProjectApplyService applyService; |
|
|
|
|
|
|
|
private final IGovBizProjectApproveService approveService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 项目续建资金库列表 分页 |
|
|
|
* @param req |
|
|
@@ -103,21 +107,28 @@ public class ProjectRenewalFundManage { |
|
|
|
ProjectRenewalFundDeclarationVO vo = new ProjectRenewalFundDeclarationVO(); |
|
|
|
BeanUtils.copyProperties(renewal, vo); |
|
|
|
// 查询项目信息 |
|
|
|
Project project = projectService.getById(renewal.getProjectId()); |
|
|
|
if(Objects.isNull(project)){ |
|
|
|
return vo; |
|
|
|
} |
|
|
|
vo.setApprovalAmount(project.getApprovalAmount()); |
|
|
|
vo.setProjectName(project.getProjectName()); |
|
|
|
vo.setProjectType(project.getProjectType()); |
|
|
|
vo.setStage(project.getStage()); |
|
|
|
vo.setStatus(project.getStatus()); |
|
|
|
vo.setBuildOrgName(project.getBuildOrgName()); |
|
|
|
vo.setAnnualPaymentAmount(renewal.getAnnualPaymentAmount()); |
|
|
|
if (ProjectStatusEnum.ACCEPTED.getCode().equals(project.getStatus())) { |
|
|
|
Project project = projectService.getProjectByCode(renewal.getProjectCode()); |
|
|
|
GovBizProjectBaseinfo baseinfo = baseinfoService.getOne(Wrappers.lambdaQuery(GovBizProjectBaseinfo.class) |
|
|
|
.eq(GovBizProjectBaseinfo::getBaseProjId, renewal.getProjectCode()) |
|
|
|
.last(BizConst.LIMIT_1)); |
|
|
|
GovBizProjectApply apply = applyService.getOne(Wrappers.lambdaQuery(GovBizProjectApply.class) |
|
|
|
.eq(GovBizProjectApply::getBaseProjId, renewal.getProjectCode()) |
|
|
|
.last(BizConst.LIMIT_1)); |
|
|
|
GovBizProjectApprove approve = approveService.getOne(Wrappers.lambdaQuery(GovBizProjectApprove.class) |
|
|
|
.eq(GovBizProjectApprove::getBaseProjId, renewal.getProjectCode()) |
|
|
|
.last(BizConst.LIMIT_1)); |
|
|
|
if(Objects.nonNull(project)){ |
|
|
|
vo.setApprovalAmount(project.getApprovalAmount()); |
|
|
|
vo.setProjectName(project.getProjectName()); |
|
|
|
vo.setProjectType(project.getProjectType()); |
|
|
|
vo.setStage(project.getStage()); |
|
|
|
vo.setStatus(project.getStatus()); |
|
|
|
vo.setBuildOrgName(project.getBuildOrgName()); |
|
|
|
vo.setAnnualPaymentAmount(renewal.getAnnualPaymentAmount()); |
|
|
|
List<AnnualAmountVO> annualAmounts = Lists.newArrayList(); |
|
|
|
annualAmounts.add(AnnualAmountVO.builder() |
|
|
|
.projectId(project.getId()) |
|
|
|
.projectCode(project.getProjectCode()) |
|
|
|
.projectYear(project.getProjectYear()) |
|
|
|
.annualAmount(project.getAnnualPlanAmount()) |
|
|
|
.build()); |
|
|
@@ -130,6 +141,41 @@ public class ProjectRenewalFundManage { |
|
|
|
declarations.forEach(declaration -> { |
|
|
|
annualAmounts.add(AnnualAmountVO.builder() |
|
|
|
.projectId(project.getId()) |
|
|
|
.projectCode(project.getProjectCode()) |
|
|
|
.projectYear(declaration.getProjectYear()) |
|
|
|
.annualAmount(declaration.getAnnualPaymentAmount()) |
|
|
|
.build()); |
|
|
|
}) |
|
|
|
); |
|
|
|
vo.setAnnualAccumulateAmountList(annualAmounts); |
|
|
|
}else if(Objects.nonNull(baseinfo)){ |
|
|
|
if(Objects.nonNull(approve)){ |
|
|
|
vo.setApprovalAmount(approve.getBaseInitialReviewTotalMoney()); |
|
|
|
} |
|
|
|
vo.setProjectName(baseinfo.getBaseProjName()); |
|
|
|
vo.setProjectType(baseinfo.getBaseProjType()); |
|
|
|
// vo.setStage(project.getStage()); |
|
|
|
vo.setStatus(StringUtils.isNotBlank(baseinfo.getBaseProjSetProg()) ? |
|
|
|
Integer.parseInt(baseinfo.getBaseProjSetProg()) : null); |
|
|
|
vo.setBuildOrgName(baseinfo.getBaseBuildDeprt()); |
|
|
|
vo.setAnnualPaymentAmount(renewal.getAnnualPaymentAmount()); |
|
|
|
List<AnnualAmountVO> annualAmounts = Lists.newArrayList(); |
|
|
|
annualAmounts.add(AnnualAmountVO.builder() |
|
|
|
.projectId(baseinfo.getId()) |
|
|
|
.projectCode(baseinfo.getBaseProjId()) |
|
|
|
.projectYear(StringUtils.isNotBlank(apply.getBaseProjSetYear()) ? Integer.parseInt(apply.getBaseProjSetYear()) : null) |
|
|
|
.annualAmount(apply.getBaseProjDeclAmount()) |
|
|
|
.build()); |
|
|
|
List<ProjectRenewalFundDeclaration> 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(baseinfo.getId()) |
|
|
|
.projectCode(baseinfo.getBaseProjId()) |
|
|
|
.projectYear(declaration.getProjectYear()) |
|
|
|
.annualAmount(declaration.getAnnualPaymentAmount()) |
|
|
|
.build()); |
|
|
@@ -199,8 +245,14 @@ public class ProjectRenewalFundManage { |
|
|
|
} |
|
|
|
|
|
|
|
declaration.setApprovalStatus(ProjectRenewalApprovalStatusEnum.PENDING.name()); |
|
|
|
declaration.setRegionCode(project.getAreaCode()); |
|
|
|
declaration.setOrgCode(project.getBuildOrgCode()); |
|
|
|
if(Objects.nonNull(project)){ |
|
|
|
declaration.setRegionCode(project.getAreaCode()); |
|
|
|
declaration.setOrgCode(project.getBuildOrgCode()); |
|
|
|
}else if(Objects.nonNull(baseinfo)){ |
|
|
|
declaration.setRegionCode(StringUtils.isNotBlank(baseinfo.getBaseAreaCode()) ? baseinfo.getBaseAreaCode().substring(0,6) : StringUtils.EMPTY); |
|
|
|
declaration.setOrgCode(baseinfo.getBaseBuildDeprtDing()); |
|
|
|
} |
|
|
|
|
|
|
|
if(!projectRenewalFundDeclarationService.saveOrUpdate(declaration)){ |
|
|
|
throw new BusinessException(String.format("申报失败 【%s】",dto.getId())); |
|
|
|
} |
|
|
|