From 2f2b042cb7f4dd5f5187c30fac47565242937a36 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Sat, 8 Apr 2023 18:30:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=AB=8B=E9=A1=B9=E6=89=B9?= =?UTF-8?q?=E5=A4=8D=E6=97=B6=E9=97=B4=E4=B8=8E=E5=BB=BA=E8=AE=BE=E6=96=B9?= =?UTF-8?q?=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/manage/ProjectLibManage.java | 19 +++++++++++++------ .../pmapi/projectlib/model/vo/ProjectDetailVO.java | 11 +++++++++-- 2 files changed, 22 insertions(+), 8 deletions(-) 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 ae09bc6..8777e91 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 @@ -6,14 +6,15 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.google.common.collect.Lists; import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.util.CollUtils; +import com.ningdatech.file.entity.File; +import com.ningdatech.file.service.FileService; import com.ningdatech.pmapi.common.constant.CommonConst; import com.ningdatech.pmapi.common.constant.RegionConst; import com.ningdatech.pmapi.common.helper.RegionCacheHelper; import com.ningdatech.pmapi.common.helper.UserInfoHelper; import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter; -import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; +import com.ningdatech.pmapi.common.util.BizUtils; import com.ningdatech.pmapi.common.util.ExcelDownUtil; -import com.ningdatech.pmapi.common.util.StrUtils; import com.ningdatech.pmapi.datascope.model.DataScopeDTO; import com.ningdatech.pmapi.datascope.utils.DataScopeUtil; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; @@ -22,7 +23,6 @@ import com.ningdatech.pmapi.projectlib.helper.ProjectHelper; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; import com.ningdatech.pmapi.projectlib.model.entity.ProjectRenewalFundDeclaration; -import com.ningdatech.pmapi.projectlib.model.entity.ProjectStatusChange; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; import com.ningdatech.pmapi.projectlib.model.vo.AnnualAmountVO; import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO; @@ -62,6 +62,7 @@ public class ProjectLibManage { private final ProcessExecuteChainHandle processExecuteHandle; private final INdProjectStatusChangeService projectStatusChangeService; private final RegionCacheHelper regionCacheHelper; + private final FileService fileService; private final UserInfoHelper userInfoHelper; @@ -176,9 +177,15 @@ public class ProjectLibManage { ); vo.setAnnualAccumulateAmountList(annualAmounts); } - if (StrUtils.isNotBlank(vo.getApprovedConstructionPlanFile())) { - ProjectStatusChange approved = projectStatusChangeService.getByProjectStatus(ProjectStatusChangeEvent.PROJECT_APPROVAL, projectId); - vo.setApprovedTime(approved.getCreateOn()); + // 处理文件名 + List fileIdList = new ArrayList<>(); + BizUtils.notBlank(vo.getApprovedFile(), w -> fileIdList.add(Long.parseLong(w))); + BizUtils.notBlank(vo.getApprovedConstructionPlanFileName(), 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; } 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 b852ba8..1026a9a 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 @@ -9,6 +9,7 @@ import lombok.Data; import org.apache.commons.lang3.StringUtils; import java.math.BigDecimal; +import java.time.LocalDate; import java.time.LocalDateTime; import java.util.List; import java.util.Map; @@ -253,15 +254,21 @@ public class ProjectDetailVO { @ApiModelProperty("立项批复建设方案文件") private String approvedConstructionPlanFile; + @ApiModelProperty("立项批复建设方案文件名") + private String approvedConstructionPlanFileName; + @ApiModelProperty("立项批复文件") private String approvedFile; - @ApiModelProperty("立项批复时间") - private LocalDateTime approvedTime; + @ApiModelProperty("立项批复文件名") + private String approvedFileName; @ApiModelProperty("批复金额") private BigDecimal approvedTotalInvestmentIncrease; + @ApiModelProperty("立项批复时间") + private LocalDate approvalDate; + @ApiModelProperty("是否有上级条线主管部门 0没有 1有") private Integer isHigherSuperOrg;