From 9c4d93a75a5afc3cde71d8cb4a8bbc81b791354d Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Mon, 10 Jul 2023 17:20:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=20=E5=80=9F=E9=98=85?= =?UTF-8?q?=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ProjectFileController.java | 7 +++ .../pmapi/filemanage/manage/ProjectFileManage.java | 34 +++++++++++++ .../filemanage/model/vo/ProjectApplyBorrowVO.java | 59 ++++++++++++++++++++++ 3 files changed, 100 insertions(+) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/filemanage/model/vo/ProjectApplyBorrowVO.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/filemanage/controller/ProjectFileController.java b/pmapi/src/main/java/com/ningdatech/pmapi/filemanage/controller/ProjectFileController.java index f89fe7d..597922a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/filemanage/controller/ProjectFileController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/filemanage/controller/ProjectFileController.java @@ -4,6 +4,7 @@ import com.ningdatech.basic.model.PageVo; import com.ningdatech.log.annotation.WebLog; import com.ningdatech.pmapi.filemanage.manage.ProjectFileManage; import com.ningdatech.pmapi.filemanage.model.param.ProjectFileListParam; +import com.ningdatech.pmapi.filemanage.model.vo.ProjectApplyBorrowVO; import com.ningdatech.pmapi.filemanage.model.vo.ProjectFileListVO; import com.ningdatech.pmapi.filemanage.model.vo.ProjectFileVO; import io.swagger.annotations.Api; @@ -49,6 +50,12 @@ public class ProjectFileController { return "启动申请借阅流程实例 【" + instanceId + "】 成功"; } + @GetMapping("/wantRead-detail/{instanceId}") + @ApiOperation(value = "借阅详情", notes = "借阅详情") + public ProjectApplyBorrowVO wantReadDetail(@PathVariable String instanceId){ + return projectFileManage.wantReadDetail(instanceId); + } + @PostMapping("/download/{projectId}") @ApiOperation(value = "档案下载",notes = "档案下载") public void downloadFile(@PathVariable Long projectId,HttpServletResponse response){ diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java index 61f641b..882ca05 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java @@ -1,5 +1,6 @@ package com.ningdatech.pmapi.filemanage.manage; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; @@ -23,6 +24,7 @@ import com.ningdatech.pmapi.expert.model.vo.ExpertReviewDetailVO; import com.ningdatech.pmapi.expert.model.vo.ProjectReviewDetailVO; import com.ningdatech.pmapi.filemanage.model.entity.ProjectApplyBorrow; import com.ningdatech.pmapi.filemanage.model.param.ProjectFileListParam; +import com.ningdatech.pmapi.filemanage.model.vo.ProjectApplyBorrowVO; import com.ningdatech.pmapi.filemanage.model.vo.ProjectFileListVO; import com.ningdatech.pmapi.filemanage.model.vo.ProjectFileVO; import com.ningdatech.pmapi.filemanage.service.INdProjectApplyBorrowService; @@ -524,4 +526,36 @@ public class ProjectFileManage { List prePlanFileIdList = CollUtils.fieldList(prePlanFileArray, w -> w.getLong(CommonConst.ID_STR)); return prePlanFileIdList; } + + /** + * 查看 借阅的详情 + * @param instanceId + * @return + */ + public ProjectApplyBorrowVO wantReadDetail(String instanceId) { + ProjectApplyBorrow apply = projectApplyBorrowService.getOne(Wrappers.lambdaQuery(ProjectApplyBorrow.class) + .eq(ProjectApplyBorrow::getInstanceId, instanceId) + .last(BizConst.LIMIT_1)); + + if(Objects.isNull(apply)){ + return null; + } + + ProjectApplyBorrowVO vo = BeanUtil.copyProperties(apply,ProjectApplyBorrowVO.class); + if(StringUtils.isNotBlank(vo.getApplyBorrowEmployeeCode())){ + UserFullInfoDTO user = userInfoHelper.getUserFullInfoByEmployeeCode(vo.getApplyBorrowEmployeeCode()); + if(Objects.nonNull(user)){ + vo.setApplyBorrowEmployeeName(user.getUsername()); + } + } + if(StringUtils.isNotBlank(vo.getApplyBorrowEmpPosUnitCode())){ + DingOrganization organization = dingOrganizationService.getOne(Wrappers.lambdaQuery(DingOrganization.class) + .eq(DingOrganization::getOrganizationCode, vo.getApplyBorrowEmpPosUnitCode()) + .last(BizConst.LIMIT_1)); + if(Objects.nonNull(organization)){ + vo.setApplyBorrowEmpPosUnitName(organization.getOrganizationName()); + } + } + return vo; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/filemanage/model/vo/ProjectApplyBorrowVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/filemanage/model/vo/ProjectApplyBorrowVO.java new file mode 100644 index 0000000..1e8e426 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/filemanage/model/vo/ProjectApplyBorrowVO.java @@ -0,0 +1,59 @@ +package com.ningdatech.pmapi.filemanage.model.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * + *

+ * + * @author CMM + * @since 2023-06-16 + */ +@Data +@ApiModel(value = "ProjectApplyBorrowVO", description = "") +public class ProjectApplyBorrowVO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + private Long id; + + @ApiModelProperty("借阅项目ID") + private Long projectId; + + @ApiModelProperty("申请借阅员工code") + private String applyBorrowEmployeeCode; + + @ApiModelProperty("申请借阅员工名字") + private String applyBorrowEmployeeName; + + @ApiModelProperty("申请借阅用户任职单位code") + private String applyBorrowEmpPosUnitCode; + + @ApiModelProperty("申请借阅用户任职单位") + private String applyBorrowEmpPosUnitName; + + @ApiModelProperty("申请借阅审批流程ID") + private String instanceId; + + @ApiModelProperty("创建人") + private Long createBy; + + @ApiModelProperty("创建时间") + private LocalDateTime createOn; + + @ApiModelProperty("更新人") + private Long updateBy; + + @ApiModelProperty("更新时间") + private LocalDateTime updateOn; + + @ApiModelProperty("申请借阅是否成功") + private Boolean isSuccess; +}