|
@@ -192,6 +192,188 @@ public class ProjectLibManage { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
|
|
|
* @param projectId 项目详情 |
|
|
|
|
|
* @return com.ningdatech.pmapi.projectlib.model.entity.vo.ProjectDetailVO |
|
|
|
|
|
* @author ZPF |
|
|
|
|
|
* @since 2023/02/11 11:15 |
|
|
|
|
|
*/ |
|
|
|
|
|
public ProjectDetailVO getProjectDetail(Long projectId) { |
|
|
|
|
|
// 查询最新的项目申报信息 |
|
|
|
|
|
Project projectInfo = projectService.getNewProject(projectId); |
|
|
|
|
|
if (Objects.isNull(projectInfo)) { |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
ProjectDetailVO vo = new ProjectDetailVO(); |
|
|
|
|
|
BeanUtils.copyProperties(projectInfo, vo); |
|
|
|
|
|
vo.buildDynamicForm(projectInfo.getDynamicForm()); |
|
|
|
|
|
// 查询应用 |
|
|
|
|
|
List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) |
|
|
|
|
|
.eq(ProjectApplication::getProjectCode, vo.getProjectCode()) |
|
|
|
|
|
.eq(ProjectApplication::getIsConstruct, projectInfo.getIsConstruct()) |
|
|
|
|
|
.eq(ProjectApplication::getProjectVersion, projectInfo.getVersion())); |
|
|
|
|
|
|
|
|
|
|
|
Optional.ofNullable(applications).ifPresent(apps -> |
|
|
|
|
|
vo.setProjectApplications(CollUtils.convert(apps, |
|
|
|
|
|
ProjectHelper::convertVO) |
|
|
|
|
|
)); |
|
|
|
|
|
|
|
|
|
|
|
List<Long> allVersionProjectId = projectService.getAllVersionProjectId(projectInfo); |
|
|
|
|
|
//查询采购备案 |
|
|
|
|
|
List<Purchase> purchases = purchaseService.listByProjectId(projectId); |
|
|
|
|
|
vo.setPurchases(BeanUtil.copyToList(purchases, PurchaseVO.class)); |
|
|
|
|
|
|
|
|
|
|
|
//查询合同备案 |
|
|
|
|
|
Contract contract = contractService.getOne(Wrappers.lambdaQuery(Contract.class) |
|
|
|
|
|
.in(Contract::getProjectId, allVersionProjectId) |
|
|
|
|
|
.last(BizConst.LIMIT_1)); |
|
|
|
|
|
ContractVO contractVO = BeanUtil.copyProperties(contract, ContractVO.class); |
|
|
|
|
|
vo.setContract(contractVO); |
|
|
|
|
|
List<PaymentPlan> payments = paymentPlanService.list(Wrappers.lambdaQuery(PaymentPlan.class) |
|
|
|
|
|
.in(PaymentPlan::getProjectId, allVersionProjectId) |
|
|
|
|
|
.orderByAsc(PaymentPlan::getPaymentTime)); |
|
|
|
|
|
if (Objects.nonNull(contractVO)) { |
|
|
|
|
|
contractVO.setPayments(convertPayments(payments, |
|
|
|
|
|
contractVO.getTotalAmount())); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询初验信息 |
|
|
|
|
|
List<PreInsAcceptancePerson> acceptancePersons = acceptancePersonService.list(Wrappers.lambdaQuery(PreInsAcceptancePerson.class) |
|
|
|
|
|
.in(PreInsAcceptancePerson::getProjectId, allVersionProjectId) |
|
|
|
|
|
.orderByAsc(PreInsAcceptancePerson::getCreateOn)); |
|
|
|
|
|
vo.setAcceptancePersons(convertPersons(acceptancePersons)); |
|
|
|
|
|
|
|
|
|
|
|
//查询终验信息 |
|
|
|
|
|
//查询年度投资金额 要是已验收的项目 |
|
|
|
|
|
if (ProjectStatusEnum.ACCEPTED.getCode().equals(projectInfo.getStatus())) { |
|
|
|
|
|
List<AnnualAmountVO> annualAmounts = Lists.newArrayList(); |
|
|
|
|
|
annualAmounts.add(AnnualAmountVO.builder() |
|
|
|
|
|
.projectId(projectInfo.getId()) |
|
|
|
|
|
.projectYear(projectInfo.getProjectYear()) |
|
|
|
|
|
.annualAmount(projectInfo.getAnnualPlanAmount()) |
|
|
|
|
|
.build()); |
|
|
|
|
|
List<ProjectRenewalFundDeclaration> renewalDeclarations = renewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class) |
|
|
|
|
|
.eq(ProjectRenewalFundDeclaration::getProjectId, vo.getId()) |
|
|
|
|
|
.orderByAsc(ProjectRenewalFundDeclaration::getProjectYear)); |
|
|
|
|
|
Optional.ofNullable(renewalDeclarations).ifPresent(declarations -> |
|
|
|
|
|
declarations.forEach(declaration -> { |
|
|
|
|
|
annualAmounts.add(AnnualAmountVO.builder() |
|
|
|
|
|
.projectId(projectInfo.getId()) |
|
|
|
|
|
.projectYear(declaration.getProjectYear()) |
|
|
|
|
|
.annualAmount(declaration.getAnnualPaymentAmount()) |
|
|
|
|
|
.build()); |
|
|
|
|
|
}) |
|
|
|
|
|
); |
|
|
|
|
|
vo.setAnnualAccumulateAmountList(annualAmounts); |
|
|
|
|
|
} |
|
|
|
|
|
// 处理文件名 |
|
|
|
|
|
List<Long> fileIdList = new ArrayList<>(); |
|
|
|
|
|
BizUtils.notBlank(vo.getApprovedFile(), w -> fileIdList.add(Long.parseLong(w))); |
|
|
|
|
|
BizUtils.notBlank(vo.getApprovedConstructionPlanFile(), w -> fileIdList.add(Long.parseLong(w))); |
|
|
|
|
|
if (!fileIdList.isEmpty()) { |
|
|
|
|
|
List<File> files = fileService.listByIds(fileIdList); |
|
|
|
|
|
Map<String, String> fileMap = CollUtils.listToMap(files, w -> w.getId().toString(), File::getOriginalFileName); |
|
|
|
|
|
vo.setApprovedFileName(fileMap.get(vo.getApprovedFile())); |
|
|
|
|
|
vo.setApprovedConstructionPlanFileName(fileMap.get(vo.getApprovedConstructionPlanFile())); |
|
|
|
|
|
} |
|
|
|
|
|
return vo; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @param projectId 项目详情 不查询最新版本 |
|
|
|
|
|
* @return com.ningdatech.pmapi.projectlib.model.entity.vo.ProjectDetailVO |
|
|
|
|
|
* @author ZPF |
|
|
|
|
|
* @since 2023/02/11 11:15 |
|
|
|
|
|
*/ |
|
|
|
|
|
public ProjectDetailVO getProjectDetailThisVersion(Long projectId) { |
|
|
|
|
|
// 查询最新的项目申报信息 |
|
|
|
|
|
Project projectInfo = projectService.getById(projectId); |
|
|
|
|
|
if (Objects.isNull(projectInfo)) { |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
ProjectDetailVO vo = new ProjectDetailVO(); |
|
|
|
|
|
BeanUtils.copyProperties(projectInfo, vo); |
|
|
|
|
|
vo.buildDynamicForm(projectInfo.getDynamicForm()); |
|
|
|
|
|
// 查询应用 |
|
|
|
|
|
List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) |
|
|
|
|
|
.eq(ProjectApplication::getProjectCode, vo.getProjectCode()) |
|
|
|
|
|
.eq(ProjectApplication::getIsConstruct, projectInfo.getIsConstruct()) |
|
|
|
|
|
.eq(ProjectApplication::getProjectVersion, projectInfo.getVersion())); |
|
|
|
|
|
|
|
|
|
|
|
Optional.ofNullable(applications).ifPresent(apps -> |
|
|
|
|
|
vo.setProjectApplications(CollUtils.convert(apps, |
|
|
|
|
|
ProjectHelper::convertVO) |
|
|
|
|
|
)); |
|
|
|
|
|
|
|
|
|
|
|
//审批信息 |
|
|
|
|
|
ProcessDetailReq req = new ProcessDetailReq(); |
|
|
|
|
|
req.setInstanceId(projectInfo.getInstCode()); |
|
|
|
|
|
req.setProjectId(projectId); |
|
|
|
|
|
vo.setProcess(todoService.getProcessDetail(req)); |
|
|
|
|
|
|
|
|
|
|
|
List<Long> allVersionProjectId = projectService.getAllVersionProjectId(projectInfo); |
|
|
|
|
|
//查询采购备案 |
|
|
|
|
|
List<Purchase> purchases = purchaseService.listByProjectId(projectId); |
|
|
|
|
|
vo.setPurchases(BeanUtil.copyToList(purchases, PurchaseVO.class)); |
|
|
|
|
|
|
|
|
|
|
|
//查询合同备案 |
|
|
|
|
|
Contract contract = contractService.getOne(Wrappers.lambdaQuery(Contract.class) |
|
|
|
|
|
.in(Contract::getProjectId, allVersionProjectId) |
|
|
|
|
|
.last(BizConst.LIMIT_1)); |
|
|
|
|
|
ContractVO contractVO = BeanUtil.copyProperties(contract, ContractVO.class); |
|
|
|
|
|
vo.setContract(contractVO); |
|
|
|
|
|
List<PaymentPlan> payments = paymentPlanService.list(Wrappers.lambdaQuery(PaymentPlan.class) |
|
|
|
|
|
.in(PaymentPlan::getProjectId, allVersionProjectId) |
|
|
|
|
|
.orderByAsc(PaymentPlan::getPaymentTime)); |
|
|
|
|
|
if (Objects.nonNull(contractVO)) { |
|
|
|
|
|
contractVO.setPayments(convertPayments(payments, |
|
|
|
|
|
contractVO.getTotalAmount())); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询初验信息 |
|
|
|
|
|
List<PreInsAcceptancePerson> acceptancePersons = acceptancePersonService.list(Wrappers.lambdaQuery(PreInsAcceptancePerson.class) |
|
|
|
|
|
.in(PreInsAcceptancePerson::getProjectId, allVersionProjectId) |
|
|
|
|
|
.orderByAsc(PreInsAcceptancePerson::getCreateOn)); |
|
|
|
|
|
vo.setAcceptancePersons(convertPersons(acceptancePersons)); |
|
|
|
|
|
|
|
|
|
|
|
//查询终验信息 |
|
|
|
|
|
//查询年度投资金额 要是已验收的项目 |
|
|
|
|
|
if (ProjectStatusEnum.ACCEPTED.getCode().equals(projectInfo.getStatus())) { |
|
|
|
|
|
List<AnnualAmountVO> annualAmounts = Lists.newArrayList(); |
|
|
|
|
|
annualAmounts.add(AnnualAmountVO.builder() |
|
|
|
|
|
.projectId(projectInfo.getId()) |
|
|
|
|
|
.projectYear(projectInfo.getProjectYear()) |
|
|
|
|
|
.annualAmount(projectInfo.getAnnualPlanAmount()) |
|
|
|
|
|
.build()); |
|
|
|
|
|
List<ProjectRenewalFundDeclaration> renewalDeclarations = renewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class) |
|
|
|
|
|
.eq(ProjectRenewalFundDeclaration::getProjectId, vo.getId()) |
|
|
|
|
|
.orderByAsc(ProjectRenewalFundDeclaration::getProjectYear)); |
|
|
|
|
|
Optional.ofNullable(renewalDeclarations).ifPresent(declarations -> |
|
|
|
|
|
declarations.forEach(declaration -> { |
|
|
|
|
|
annualAmounts.add(AnnualAmountVO.builder() |
|
|
|
|
|
.projectId(projectInfo.getId()) |
|
|
|
|
|
.projectYear(declaration.getProjectYear()) |
|
|
|
|
|
.annualAmount(declaration.getAnnualPaymentAmount()) |
|
|
|
|
|
.build()); |
|
|
|
|
|
}) |
|
|
|
|
|
); |
|
|
|
|
|
vo.setAnnualAccumulateAmountList(annualAmounts); |
|
|
|
|
|
} |
|
|
|
|
|
// 处理文件名 |
|
|
|
|
|
List<Long> fileIdList = new ArrayList<>(); |
|
|
|
|
|
BizUtils.notBlank(vo.getApprovedFile(), w -> fileIdList.add(Long.parseLong(w))); |
|
|
|
|
|
BizUtils.notBlank(vo.getApprovedConstructionPlanFile(), w -> fileIdList.add(Long.parseLong(w))); |
|
|
|
|
|
if (!fileIdList.isEmpty()) { |
|
|
|
|
|
List<File> files = fileService.listByIds(fileIdList); |
|
|
|
|
|
Map<String, String> fileMap = CollUtils.listToMap(files, w -> w.getId().toString(), File::getOriginalFileName); |
|
|
|
|
|
vo.setApprovedFileName(fileMap.get(vo.getApprovedFile())); |
|
|
|
|
|
vo.setApprovedConstructionPlanFileName(fileMap.get(vo.getApprovedConstructionPlanFile())); |
|
|
|
|
|
} |
|
|
|
|
|
return vo; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
* 申报新项目时 保存项目信息和其它相关联的信息 |
|
|
* 申报新项目时 保存项目信息和其它相关联的信息 |
|
|
* |
|
|
* |
|
|
* @param projectDto |
|
|
* @param projectDto |
|
@@ -591,188 +773,6 @@ public class ProjectLibManage { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @param projectId 项目详情 |
|
|
|
|
|
* @return com.ningdatech.pmapi.projectlib.model.entity.vo.ProjectDetailVO |
|
|
|
|
|
* @author ZPF |
|
|
|
|
|
* @since 2023/02/11 11:15 |
|
|
|
|
|
*/ |
|
|
|
|
|
public ProjectDetailVO getProjectDetail(Long projectId) { |
|
|
|
|
|
// 查询最新的项目申报信息 |
|
|
|
|
|
Project projectInfo = projectService.getNewProject(projectId); |
|
|
|
|
|
if (Objects.isNull(projectInfo)) { |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
ProjectDetailVO vo = new ProjectDetailVO(); |
|
|
|
|
|
BeanUtils.copyProperties(projectInfo, vo); |
|
|
|
|
|
vo.buildDynamicForm(projectInfo.getDynamicForm()); |
|
|
|
|
|
// 查询应用 |
|
|
|
|
|
List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) |
|
|
|
|
|
.eq(ProjectApplication::getProjectCode, vo.getProjectCode()) |
|
|
|
|
|
.eq(ProjectApplication::getIsConstruct, projectInfo.getIsConstruct()) |
|
|
|
|
|
.eq(ProjectApplication::getProjectVersion, projectInfo.getVersion())); |
|
|
|
|
|
|
|
|
|
|
|
Optional.ofNullable(applications).ifPresent(apps -> |
|
|
|
|
|
vo.setProjectApplications(CollUtils.convert(apps, |
|
|
|
|
|
ProjectHelper::convertVO) |
|
|
|
|
|
)); |
|
|
|
|
|
|
|
|
|
|
|
List<Long> allVersionProjectId = projectService.getAllVersionProjectId(projectInfo); |
|
|
|
|
|
//查询采购备案 |
|
|
|
|
|
List<Purchase> purchases = purchaseService.listByProjectId(projectId); |
|
|
|
|
|
vo.setPurchases(BeanUtil.copyToList(purchases, PurchaseVO.class)); |
|
|
|
|
|
|
|
|
|
|
|
//查询合同备案 |
|
|
|
|
|
Contract contract = contractService.getOne(Wrappers.lambdaQuery(Contract.class) |
|
|
|
|
|
.in(Contract::getProjectId, allVersionProjectId) |
|
|
|
|
|
.last(BizConst.LIMIT_1)); |
|
|
|
|
|
ContractVO contractVO = BeanUtil.copyProperties(contract, ContractVO.class); |
|
|
|
|
|
vo.setContract(contractVO); |
|
|
|
|
|
List<PaymentPlan> payments = paymentPlanService.list(Wrappers.lambdaQuery(PaymentPlan.class) |
|
|
|
|
|
.in(PaymentPlan::getProjectId, allVersionProjectId) |
|
|
|
|
|
.orderByAsc(PaymentPlan::getPaymentTime)); |
|
|
|
|
|
if (Objects.nonNull(contractVO)) { |
|
|
|
|
|
contractVO.setPayments(convertPayments(payments, |
|
|
|
|
|
contractVO.getTotalAmount())); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询初验信息 |
|
|
|
|
|
List<PreInsAcceptancePerson> acceptancePersons = acceptancePersonService.list(Wrappers.lambdaQuery(PreInsAcceptancePerson.class) |
|
|
|
|
|
.in(PreInsAcceptancePerson::getProjectId, allVersionProjectId) |
|
|
|
|
|
.orderByAsc(PreInsAcceptancePerson::getCreateOn)); |
|
|
|
|
|
vo.setAcceptancePersons(convertPersons(acceptancePersons)); |
|
|
|
|
|
|
|
|
|
|
|
//查询终验信息 |
|
|
|
|
|
//查询年度投资金额 要是已验收的项目 |
|
|
|
|
|
if (ProjectStatusEnum.ACCEPTED.getCode().equals(projectInfo.getStatus())) { |
|
|
|
|
|
List<AnnualAmountVO> annualAmounts = Lists.newArrayList(); |
|
|
|
|
|
annualAmounts.add(AnnualAmountVO.builder() |
|
|
|
|
|
.projectId(projectInfo.getId()) |
|
|
|
|
|
.projectYear(projectInfo.getProjectYear()) |
|
|
|
|
|
.annualAmount(projectInfo.getAnnualPlanAmount()) |
|
|
|
|
|
.build()); |
|
|
|
|
|
List<ProjectRenewalFundDeclaration> renewalDeclarations = renewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class) |
|
|
|
|
|
.eq(ProjectRenewalFundDeclaration::getProjectId, vo.getId()) |
|
|
|
|
|
.orderByAsc(ProjectRenewalFundDeclaration::getProjectYear)); |
|
|
|
|
|
Optional.ofNullable(renewalDeclarations).ifPresent(declarations -> |
|
|
|
|
|
declarations.forEach(declaration -> { |
|
|
|
|
|
annualAmounts.add(AnnualAmountVO.builder() |
|
|
|
|
|
.projectId(projectInfo.getId()) |
|
|
|
|
|
.projectYear(declaration.getProjectYear()) |
|
|
|
|
|
.annualAmount(declaration.getAnnualPaymentAmount()) |
|
|
|
|
|
.build()); |
|
|
|
|
|
}) |
|
|
|
|
|
); |
|
|
|
|
|
vo.setAnnualAccumulateAmountList(annualAmounts); |
|
|
|
|
|
} |
|
|
|
|
|
// 处理文件名 |
|
|
|
|
|
List<Long> fileIdList = new ArrayList<>(); |
|
|
|
|
|
BizUtils.notBlank(vo.getApprovedFile(), w -> fileIdList.add(Long.parseLong(w))); |
|
|
|
|
|
BizUtils.notBlank(vo.getApprovedConstructionPlanFile(), w -> fileIdList.add(Long.parseLong(w))); |
|
|
|
|
|
if (!fileIdList.isEmpty()) { |
|
|
|
|
|
List<File> files = fileService.listByIds(fileIdList); |
|
|
|
|
|
Map<String, String> fileMap = CollUtils.listToMap(files, w -> w.getId().toString(), File::getOriginalFileName); |
|
|
|
|
|
vo.setApprovedFileName(fileMap.get(vo.getApprovedFile())); |
|
|
|
|
|
vo.setApprovedConstructionPlanFileName(fileMap.get(vo.getApprovedConstructionPlanFile())); |
|
|
|
|
|
} |
|
|
|
|
|
return vo; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @param projectId 项目详情 不查询最新版本 |
|
|
|
|
|
* @return com.ningdatech.pmapi.projectlib.model.entity.vo.ProjectDetailVO |
|
|
|
|
|
* @author ZPF |
|
|
|
|
|
* @since 2023/02/11 11:15 |
|
|
|
|
|
*/ |
|
|
|
|
|
public ProjectDetailVO getProjectDetailThisVersion(Long projectId) { |
|
|
|
|
|
// 查询最新的项目申报信息 |
|
|
|
|
|
Project projectInfo = projectService.getById(projectId); |
|
|
|
|
|
if (Objects.isNull(projectInfo)) { |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
ProjectDetailVO vo = new ProjectDetailVO(); |
|
|
|
|
|
BeanUtils.copyProperties(projectInfo, vo); |
|
|
|
|
|
vo.buildDynamicForm(projectInfo.getDynamicForm()); |
|
|
|
|
|
// 查询应用 |
|
|
|
|
|
List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) |
|
|
|
|
|
.eq(ProjectApplication::getProjectCode, vo.getProjectCode()) |
|
|
|
|
|
.eq(ProjectApplication::getIsConstruct, projectInfo.getIsConstruct()) |
|
|
|
|
|
.eq(ProjectApplication::getProjectVersion, projectInfo.getVersion())); |
|
|
|
|
|
|
|
|
|
|
|
Optional.ofNullable(applications).ifPresent(apps -> |
|
|
|
|
|
vo.setProjectApplications(CollUtils.convert(apps, |
|
|
|
|
|
ProjectHelper::convertVO) |
|
|
|
|
|
)); |
|
|
|
|
|
|
|
|
|
|
|
//审批信息 |
|
|
|
|
|
ProcessDetailReq req = new ProcessDetailReq(); |
|
|
|
|
|
req.setInstanceId(projectInfo.getInstCode()); |
|
|
|
|
|
req.setProjectId(projectId); |
|
|
|
|
|
vo.setProcess(todoService.getProcessDetail(req)); |
|
|
|
|
|
|
|
|
|
|
|
List<Long> allVersionProjectId = projectService.getAllVersionProjectId(projectInfo); |
|
|
|
|
|
//查询采购备案 |
|
|
|
|
|
List<Purchase> purchases = purchaseService.listByProjectId(projectId); |
|
|
|
|
|
vo.setPurchases(BeanUtil.copyToList(purchases, PurchaseVO.class)); |
|
|
|
|
|
|
|
|
|
|
|
//查询合同备案 |
|
|
|
|
|
Contract contract = contractService.getOne(Wrappers.lambdaQuery(Contract.class) |
|
|
|
|
|
.in(Contract::getProjectId, allVersionProjectId) |
|
|
|
|
|
.last(BizConst.LIMIT_1)); |
|
|
|
|
|
ContractVO contractVO = BeanUtil.copyProperties(contract, ContractVO.class); |
|
|
|
|
|
vo.setContract(contractVO); |
|
|
|
|
|
List<PaymentPlan> payments = paymentPlanService.list(Wrappers.lambdaQuery(PaymentPlan.class) |
|
|
|
|
|
.in(PaymentPlan::getProjectId, allVersionProjectId) |
|
|
|
|
|
.orderByAsc(PaymentPlan::getPaymentTime)); |
|
|
|
|
|
if (Objects.nonNull(contractVO)) { |
|
|
|
|
|
contractVO.setPayments(convertPayments(payments, |
|
|
|
|
|
contractVO.getTotalAmount())); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询初验信息 |
|
|
|
|
|
List<PreInsAcceptancePerson> acceptancePersons = acceptancePersonService.list(Wrappers.lambdaQuery(PreInsAcceptancePerson.class) |
|
|
|
|
|
.in(PreInsAcceptancePerson::getProjectId, allVersionProjectId) |
|
|
|
|
|
.orderByAsc(PreInsAcceptancePerson::getCreateOn)); |
|
|
|
|
|
vo.setAcceptancePersons(convertPersons(acceptancePersons)); |
|
|
|
|
|
|
|
|
|
|
|
//查询终验信息 |
|
|
|
|
|
//查询年度投资金额 要是已验收的项目 |
|
|
|
|
|
if (ProjectStatusEnum.ACCEPTED.getCode().equals(projectInfo.getStatus())) { |
|
|
|
|
|
List<AnnualAmountVO> annualAmounts = Lists.newArrayList(); |
|
|
|
|
|
annualAmounts.add(AnnualAmountVO.builder() |
|
|
|
|
|
.projectId(projectInfo.getId()) |
|
|
|
|
|
.projectYear(projectInfo.getProjectYear()) |
|
|
|
|
|
.annualAmount(projectInfo.getAnnualPlanAmount()) |
|
|
|
|
|
.build()); |
|
|
|
|
|
List<ProjectRenewalFundDeclaration> renewalDeclarations = renewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class) |
|
|
|
|
|
.eq(ProjectRenewalFundDeclaration::getProjectId, vo.getId()) |
|
|
|
|
|
.orderByAsc(ProjectRenewalFundDeclaration::getProjectYear)); |
|
|
|
|
|
Optional.ofNullable(renewalDeclarations).ifPresent(declarations -> |
|
|
|
|
|
declarations.forEach(declaration -> { |
|
|
|
|
|
annualAmounts.add(AnnualAmountVO.builder() |
|
|
|
|
|
.projectId(projectInfo.getId()) |
|
|
|
|
|
.projectYear(declaration.getProjectYear()) |
|
|
|
|
|
.annualAmount(declaration.getAnnualPaymentAmount()) |
|
|
|
|
|
.build()); |
|
|
|
|
|
}) |
|
|
|
|
|
); |
|
|
|
|
|
vo.setAnnualAccumulateAmountList(annualAmounts); |
|
|
|
|
|
} |
|
|
|
|
|
// 处理文件名 |
|
|
|
|
|
List<Long> fileIdList = new ArrayList<>(); |
|
|
|
|
|
BizUtils.notBlank(vo.getApprovedFile(), w -> fileIdList.add(Long.parseLong(w))); |
|
|
|
|
|
BizUtils.notBlank(vo.getApprovedConstructionPlanFile(), w -> fileIdList.add(Long.parseLong(w))); |
|
|
|
|
|
if (!fileIdList.isEmpty()) { |
|
|
|
|
|
List<File> files = fileService.listByIds(fileIdList); |
|
|
|
|
|
Map<String, String> fileMap = CollUtils.listToMap(files, w -> w.getId().toString(), File::getOriginalFileName); |
|
|
|
|
|
vo.setApprovedFileName(fileMap.get(vo.getApprovedFile())); |
|
|
|
|
|
vo.setApprovedConstructionPlanFileName(fileMap.get(vo.getApprovedConstructionPlanFile())); |
|
|
|
|
|
} |
|
|
|
|
|
return vo; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 获取项目初步方案详情 |
|
|
* 获取项目初步方案详情 |
|
|
* |
|
|
* |
|
|
* @param projectId |
|
|
* @param projectId |
|
|