From a51941e849cbe876db5ff8d63ea5af3f10e009a2 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Mon, 7 Aug 2023 14:21:50 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=BB=B6=E6=9C=9F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/projectlib/model/entity/Project.java | 9 ++++++++- .../ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java | 8 ++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java index fcb7571..fc2113d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java @@ -453,10 +453,17 @@ public class Project implements Serializable { @Compare("合同总金额") private BigDecimal contractAmount; - @ApiModelProperty("计划验收时间") + @ApiModelProperty("计划验收时间(有可能是延期后的)") @Compare("计划验收时间") private LocalDateTime planAcceptanceTime; + @ApiModelProperty("原本计划验收时间") + @Compare("原本计划验收时间") + private LocalDateTime originPlanAcceptanceTime; + + @ApiModelProperty("延期月份数") + private Integer applyDelayMonths; + @ApiModelProperty("申请延期佐证材料") private String applyDelayFile; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java index edaab44..d783d14 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.annotation.JSONField; import com.fasterxml.jackson.annotation.JsonFormat; import com.ningdatech.basic.util.NdDateUtils; +import com.ningdatech.pmapi.common.compare.Compare; import com.ningdatech.pmapi.common.util.BizUtils; import com.ningdatech.pmapi.projectdeclared.model.entity.Contract; import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; @@ -398,6 +399,13 @@ public class ProjectDetailVO { @ApiModelProperty("是否退回|驳回的项目版本") private Boolean isBackReject; + @ApiModelProperty("原本计划验收时间") + @Compare("原本计划验收时间") + private LocalDateTime originPlanAcceptanceTime; + + @ApiModelProperty("延期月份数") + private Integer applyDelayMonths; + public String getVersionStr() { if (Objects.nonNull(this.newest) && this.newest) { this.versionStr = "当前版本"; From 62d5d2aac757cd4dd744e11126f96eb8a15e9a9f Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Mon, 7 Aug 2023 15:26:05 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=A2=84=E8=AD=A6debug=20=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projectdeclared/manage/OperationManage.java | 2 + .../projectlib/manage/AnnualPlanLibManage.java | 12 +- .../pmapi/projectlib/manage/ProjectLibManage.java | 364 ++++++++++----------- .../pmapi/projectlib/model/entity/Project.java | 4 + .../pmapi/projectlib/model/vo/ProjectDetailVO.java | 4 + .../pmapi/todocenter/manage/HandlerManage.java | 3 + 6 files changed, 204 insertions(+), 185 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/OperationManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/OperationManage.java index 0dbee64..7a33308 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/OperationManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/OperationManage.java @@ -81,6 +81,8 @@ public class OperationManage { entity.setProjectCode(project.getProjectCode()); entity.setUpdateOn(LocalDateTime.now()); entity.setUpdateBy(user.getUsername()); + //强制放入 计划终验时间 + entity.setFinalInspectionDate(project.getPlanAcceptanceTime()); if(operationService.saveOrUpdate(entity)){ stateMachineUtils.pass(project); project.setUpdateOn(LocalDateTime.now()); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java index 069841d..37a7e07 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java @@ -164,12 +164,18 @@ public class AnnualPlanLibManage { //计划出 计划验收时间 LocalDateTime planAcceptanceTime = getPlanAcceptanceTime(req); LambdaUpdateWrapper update = - Wrappers.lambdaUpdate(Project.class).set(Project::getApprovalAmount, req.getApprovedAmount()) - .set(Project::getApprovedFile, req.getApprovedFileId()).set(Project::getBuildCycle, req.getBuildCycle()) + Wrappers.lambdaUpdate(Project.class) + .set(Project::getApprovalAmount, req.getApprovedAmount()) + .set(Project::getApprovedFile, req.getApprovedFileId()) + .set(Project::getBuildCycle, req.getBuildCycle()) + .set(Project::getOriginBuildCycle,req.getBuildCycle()) .set(Project::getApprovedConstructionPlanFile, req.getBuildPlanFileId()) - .set(Project::getApprovalDate, req.getApprovedDate()).set(Project::getStatus, project.getStatus()) + .set(Project::getApprovalDate, req.getApprovedDate()) + .set(Project::getStatus, project.getStatus()) .set(Project::getStage, project.getStage()) .set(Objects.nonNull(planAcceptanceTime),Project::getPlanAcceptanceTime,planAcceptanceTime) + //记录原始的 计划验收时间 + .set(Objects.nonNull(planAcceptanceTime),Project::getOriginPlanAcceptanceTime,planAcceptanceTime) .eq(Project::getId, req.getProjectId()); projectService.update(update); } 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 cd7651f..ef83ccd 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 @@ -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 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 allVersionProjectId = projectService.getAllVersionProjectId(projectInfo); + //查询采购备案 + List 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 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 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 annualAmounts = Lists.newArrayList(); + annualAmounts.add(AnnualAmountVO.builder() + .projectId(projectInfo.getId()) + .projectYear(projectInfo.getProjectYear()) + .annualAmount(projectInfo.getAnnualPlanAmount()) + .build()); + List 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 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 files = fileService.listByIds(fileIdList); + Map 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 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 allVersionProjectId = projectService.getAllVersionProjectId(projectInfo); + //查询采购备案 + List 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 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 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 annualAmounts = Lists.newArrayList(); + annualAmounts.add(AnnualAmountVO.builder() + .projectId(projectInfo.getId()) + .projectYear(projectInfo.getProjectYear()) + .annualAmount(projectInfo.getAnnualPlanAmount()) + .build()); + List 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 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 files = fileService.listByIds(fileIdList); + Map 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 @@ -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 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 allVersionProjectId = projectService.getAllVersionProjectId(projectInfo); - //查询采购备案 - List 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 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 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 annualAmounts = Lists.newArrayList(); - annualAmounts.add(AnnualAmountVO.builder() - .projectId(projectInfo.getId()) - .projectYear(projectInfo.getProjectYear()) - .annualAmount(projectInfo.getAnnualPlanAmount()) - .build()); - List 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 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 files = fileService.listByIds(fileIdList); - Map 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 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 allVersionProjectId = projectService.getAllVersionProjectId(projectInfo); - //查询采购备案 - List 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 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 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 annualAmounts = Lists.newArrayList(); - annualAmounts.add(AnnualAmountVO.builder() - .projectId(projectInfo.getId()) - .projectYear(projectInfo.getProjectYear()) - .annualAmount(projectInfo.getAnnualPlanAmount()) - .build()); - List 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 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 files = fileService.listByIds(fileIdList); - Map 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 diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java index fc2113d..2254f84 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java @@ -325,6 +325,10 @@ public class Project implements Serializable { @Compare("建设周期(月)") private String buildCycle; + @ApiModelProperty("原始建设周期(月)") + @Compare("建设周期(月)") + private Integer originBuildCycle; + @ApiModelProperty("建设方案文件") @Compare("建设方案文件") private String constructionPlanFile; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java index d783d14..f55753e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java @@ -406,6 +406,10 @@ public class ProjectDetailVO { @ApiModelProperty("延期月份数") private Integer applyDelayMonths; + @ApiModelProperty("原始建设周期(月)") + @Compare("建设周期(月)") + private Integer originBuildCycle; + public String getVersionStr() { if (Objects.nonNull(this.newest) && this.newest) { this.versionStr = "当前版本"; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java index 3cac81b..2e83e0d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java @@ -256,6 +256,9 @@ public class HandlerManage { declaredProject.setInstCode(instanceId); declaredProject.setApplyDelayFile(delayApply.getDelayApplyFile()); declaredProject.setApplyDelayReason(delayApply.getDelayApplyReason()); + //增加总延期的月份 + declaredProject.setApplyDelayMonths(Objects.nonNull(declaredProject.getApplyDelayMonths()) ? + declaredProject.getApplyDelayMonths() + delayApply.getDelayTime() : delayApply.getDelayTime()); projectService.updateById(declaredProject); } From cba39ebf197ef30496f90990323d565d76ece75a Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Mon, 7 Aug 2023 15:34:17 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=BB=B6=E6=9C=9F=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DelayedApplyController.java | 8 +++++++- .../projectdeclared/manage/DelayedApplyManage.java | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/DelayedApplyController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/DelayedApplyController.java index 22db56a..a5a2702 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/DelayedApplyController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/DelayedApplyController.java @@ -4,7 +4,6 @@ import com.ningdatech.basic.model.PageVo; import com.ningdatech.log.annotation.WebLog; import com.ningdatech.pmapi.common.util.ExcelDownUtil; import com.ningdatech.pmapi.projectdeclared.manage.DelayedApplyManage; -import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO; import com.ningdatech.pmapi.projectdeclared.model.dto.DelayedApplyDTO; import com.ningdatech.pmapi.projectdeclared.model.vo.DelayedApplyVO; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; @@ -16,6 +15,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; +import java.util.List; /** * @Classname DelayedProjectController @@ -39,6 +39,12 @@ public class DelayedApplyController { return delayedApplyManage.projectLibList(req); } + @ApiOperation(value = "查看某个项目的延期列表", notes = "查看某个项目的延期列表") + @GetMapping("/delay-list/{projectId}") + public List delayList(@PathVariable Long projectId) { + return delayedApplyManage.delayList(projectId); + } + @ApiOperation(value = "延期的内容详情", notes = "延期的内容详情") @GetMapping("/detail/{projectId}") public DelayedApplyVO detailByProjectId(@PathVariable Long projectId) { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DelayedApplyManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DelayedApplyManage.java index 956116a..6665360 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DelayedApplyManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DelayedApplyManage.java @@ -304,4 +304,22 @@ public class DelayedApplyManage { } return BeanUtil.copyProperties(delayApply,DelayedApplyVO.class); } + + /** + * 查看某个项目的 延期列表 + * @param projectId + * @return + */ + public List delayList(Long projectId) { + List allVersionProjectId = projectService.getAllVersionProjectId(projectId); + List delays = projectDelayApplyService.list(Wrappers.lambdaQuery(ProjectDelayApply.class) + .in(ProjectDelayApply::getProjectId, allVersionProjectId)); + + if(CollUtil.isEmpty(delays)){ + return Collections.emptyList(); + } + + return delays.stream().map(d -> BeanUtil.copyProperties(d,DelayedApplyVO.class)) + .collect(Collectors.toList()); + } }