From e01a0cc0bd3be087fc4c1ad1f6596b00dd5ed47b Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Fri, 7 Jul 2023 19:08:51 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=80=9F=E9=98=85=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/filemanage/manage/ProjectFileManage.java | 47 ++++++++++++---------- .../projectdeclared/manage/DelayedApplyManage.java | 36 +++++++++-------- 2 files changed, 44 insertions(+), 39 deletions(-) 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 01b91b3..488d3eb 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 @@ -147,31 +147,34 @@ public class ProjectFileManage { vo.setProjectName(p.getProjectName()); // 判断当前项目,当前登录用户是否已经开启了申请借阅并且没有审批完成 ProjectApplyBorrow projectApplyBorrow = projectApplyBorrowService.getOne(Wrappers.lambdaQuery(ProjectApplyBorrow.class) + .eq(ProjectApplyBorrow::getApplyBorrowEmployeeCode,employeeCode) .eq(ProjectApplyBorrow::getProjectId, p.getId()) .orderByDesc(ProjectApplyBorrow::getCreateOn) .last("limit 1")); - String instCode = projectApplyBorrow.getInstanceId(); - // 获取流程实例 - HistoricProcessInstance newInstance = - historyService.createHistoricProcessInstanceQuery().processInstanceId(instCode).singleResult(); - ProjectInst projectInst = projectInstService - .getOne(Wrappers.lambdaQuery(ProjectInst.class).eq(ProjectInst::getInstCode, instCode)); - // 推送省局联审的项目流程实例为EMPTY - if (Objects.nonNull(projectInst)) { - Integer instType = projectInst.getInstType(); - // 从申请借阅信息表中查询当前项目是否有当前登录用户发起的申请借阅审批流程 - ProjectApplyBorrow applyBorrow = projectApplyBorrowService.getOne(Wrappers - .lambdaQuery(ProjectApplyBorrow.class).eq(ProjectApplyBorrow::getApplyBorrowEmployeeCode, employeeCode) - .eq(ProjectApplyBorrow::getProjectId, p.getId()).eq(ProjectApplyBorrow::getInstanceId, instCode)); - // 延期申请流程还未审核结束 - if (Objects.nonNull(applyBorrow) && InstTypeEnum.APPLY_BORROW.getCode().equals(instType) - && Objects.isNull(newInstance.getEndActivityId())) { - vo.setCanApplyBorrow(Boolean.FALSE); - } - // 如果是延期申请审核被驳回,设置项目可以申请延期申报 - else if (InstTypeEnum.APPLY_BORROW.getCode().equals(instType) && - HisProInsEndActId.REJECT.equals(newInstance.getEndActivityId())) { - vo.setCanApplyBorrow(Boolean.TRUE); + if (Objects.nonNull(projectApplyBorrow)) { + String instCode = projectApplyBorrow.getInstanceId(); + // 获取流程实例 + HistoricProcessInstance newInstance = + historyService.createHistoricProcessInstanceQuery().processInstanceId(instCode).singleResult(); + ProjectInst projectInst = projectInstService + .getOne(Wrappers.lambdaQuery(ProjectInst.class).eq(ProjectInst::getInstCode, instCode)); + // 推送省局联审的项目流程实例为EMPTY + if (Objects.nonNull(projectInst)) { + Integer instType = projectInst.getInstType(); + // 从申请借阅信息表中查询当前项目是否有当前登录用户发起的申请借阅审批流程 + ProjectApplyBorrow applyBorrow = projectApplyBorrowService.getOne(Wrappers + .lambdaQuery(ProjectApplyBorrow.class).eq(ProjectApplyBorrow::getApplyBorrowEmployeeCode, employeeCode) + .eq(ProjectApplyBorrow::getProjectId, p.getId()).eq(ProjectApplyBorrow::getInstanceId, instCode)); + // 延期申请流程还未审核结束 + if (Objects.nonNull(applyBorrow) && InstTypeEnum.APPLY_BORROW.getCode().equals(instType) + && Objects.isNull(newInstance.getEndActivityId())) { + vo.setCanApplyBorrow(Boolean.FALSE); + } + // 如果是延期申请审核被驳回,设置项目可以申请延期申报 + else if (InstTypeEnum.APPLY_BORROW.getCode().equals(instType) && + HisProInsEndActId.REJECT.equals(newInstance.getEndActivityId())) { + vo.setCanApplyBorrow(Boolean.TRUE); + } } } return vo; 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 b06e90c..c3aef15 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 @@ -143,23 +143,25 @@ public class DelayedApplyManage { .eq(ProjectDelayApply::getProjectId, w.getId()) .orderByDesc(ProjectDelayApply::getCreateOn) .last("limit 1")); - String instCode = delayApply.getInstanceId(); - // 获取流程实例 - HistoricProcessInstance newInstance = historyService.createHistoricProcessInstanceQuery() - .processInstanceId(instCode) - .singleResult(); - ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) - .eq(ProjectInst::getInstCode, instCode)); - Integer instType = projectInst.getInstType(); - // 延期申请流程还未审核结束 - if (InstTypeEnum.APPLY_DELAY.getCode().equals(instType) && - Objects.isNull(newInstance.getEndActivityId())){ - item.setCanDelayApply(Boolean.FALSE); - } - // 如果是延期申请审核被驳回,设置项目可以申请延期申报 - else if (InstTypeEnum.APPLY_DELAY.getCode().equals(instType) && - HisProInsEndActId.REJECT.equals(newInstance.getEndActivityId())) { - item.setCanDelayApply(Boolean.TRUE); + if (Objects.nonNull(delayApply)) { + String instCode = delayApply.getInstanceId(); + // 获取流程实例 + HistoricProcessInstance newInstance = historyService.createHistoricProcessInstanceQuery() + .processInstanceId(instCode) + .singleResult(); + ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) + .eq(ProjectInst::getInstCode, instCode)); + Integer instType = projectInst.getInstType(); + // 延期申请流程还未审核结束 + if (InstTypeEnum.APPLY_DELAY.getCode().equals(instType) && + Objects.isNull(newInstance.getEndActivityId())) { + item.setCanDelayApply(Boolean.FALSE); + } + // 如果是延期申请审核被驳回,设置项目可以申请延期申报 + else if (InstTypeEnum.APPLY_DELAY.getCode().equals(instType) && + HisProInsEndActId.REJECT.equals(newInstance.getEndActivityId())) { + item.setCanDelayApply(Boolean.TRUE); + } } return item; });