Browse Source

申请借阅列表修改

master
CMM 1 year ago
parent
commit
b800e6a851
1 changed files with 13 additions and 2 deletions
  1. +13
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java

+ 13
- 2
pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java View File

@@ -45,6 +45,7 @@ import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage;
import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; 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.entity.ProjectInst;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO; import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO;
import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService; import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService;
@@ -145,7 +146,11 @@ public class ProjectFileManage {
vo.setPojectCode(p.getProjectCode()); vo.setPojectCode(p.getProjectCode());
vo.setProjectName(p.getProjectName()); 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 = HistoricProcessInstance newInstance =
historyService.createHistoricProcessInstanceQuery().processInstanceId(instCode).singleResult(); historyService.createHistoricProcessInstanceQuery().processInstanceId(instCode).singleResult();
@@ -158,10 +163,16 @@ public class ProjectFileManage {
ProjectApplyBorrow applyBorrow = projectApplyBorrowService.getOne(Wrappers ProjectApplyBorrow applyBorrow = projectApplyBorrowService.getOne(Wrappers
.lambdaQuery(ProjectApplyBorrow.class).eq(ProjectApplyBorrow::getApplyBorrowEmployeeCode, employeeCode) .lambdaQuery(ProjectApplyBorrow.class).eq(ProjectApplyBorrow::getApplyBorrowEmployeeCode, employeeCode)
.eq(ProjectApplyBorrow::getProjectId, p.getId()).eq(ProjectApplyBorrow::getInstanceId, instCode)); .eq(ProjectApplyBorrow::getProjectId, p.getId()).eq(ProjectApplyBorrow::getInstanceId, instCode));
// 延期申请流程还未审核结束
if (Objects.nonNull(applyBorrow) && InstTypeEnum.APPLY_BORROW.getCode().equals(instType) if (Objects.nonNull(applyBorrow) && InstTypeEnum.APPLY_BORROW.getCode().equals(instType)
&& !HisProInsEndActId.END.equals(newInstance.getEndActivityId())) {
&& Objects.isNull(newInstance.getEndActivityId())) {
vo.setCanApplyBorrow(Boolean.FALSE); 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;
}).collect(Collectors.toList()); }).collect(Collectors.toList());


Loading…
Cancel
Save