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 5b8c70c..01b91b3 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 @@ -45,6 +45,7 @@ import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; +import com.ningdatech.pmapi.projectlib.model.entity.ProjectDelayApply; import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO; import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService; @@ -145,7 +146,11 @@ public class ProjectFileManage { vo.setPojectCode(p.getProjectCode()); vo.setProjectName(p.getProjectName()); // 判断当前项目,当前登录用户是否已经开启了申请借阅并且没有审批完成 - String instCode = p.getInstCode(); + ProjectApplyBorrow projectApplyBorrow = projectApplyBorrowService.getOne(Wrappers.lambdaQuery(ProjectApplyBorrow.class) + .eq(ProjectApplyBorrow::getProjectId, p.getId()) + .orderByDesc(ProjectApplyBorrow::getCreateOn) + .last("limit 1")); + String instCode = projectApplyBorrow.getInstanceId(); // 获取流程实例 HistoricProcessInstance newInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(instCode).singleResult(); @@ -158,10 +163,16 @@ public class ProjectFileManage { 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) - && !HisProInsEndActId.END.equals(newInstance.getEndActivityId())) { + && 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; }).collect(Collectors.toList());