|
@@ -147,31 +147,34 @@ public class ProjectFileManage { |
|
|
vo.setProjectName(p.getProjectName()); |
|
|
vo.setProjectName(p.getProjectName()); |
|
|
// 判断当前项目,当前登录用户是否已经开启了申请借阅并且没有审批完成 |
|
|
// 判断当前项目,当前登录用户是否已经开启了申请借阅并且没有审批完成 |
|
|
ProjectApplyBorrow projectApplyBorrow = projectApplyBorrowService.getOne(Wrappers.lambdaQuery(ProjectApplyBorrow.class) |
|
|
ProjectApplyBorrow projectApplyBorrow = projectApplyBorrowService.getOne(Wrappers.lambdaQuery(ProjectApplyBorrow.class) |
|
|
|
|
|
.eq(ProjectApplyBorrow::getApplyBorrowEmployeeCode,employeeCode) |
|
|
.eq(ProjectApplyBorrow::getProjectId, p.getId()) |
|
|
.eq(ProjectApplyBorrow::getProjectId, p.getId()) |
|
|
.orderByDesc(ProjectApplyBorrow::getCreateOn) |
|
|
.orderByDesc(ProjectApplyBorrow::getCreateOn) |
|
|
.last("limit 1")); |
|
|
.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; |
|
|
return vo; |
|
|