|
|
@@ -67,25 +67,25 @@ public class TodoServiceImpl implements ITodoService { |
|
|
|
String nodeId = request.getNodeId(); |
|
|
|
Long projectId = request.getProjectId(); |
|
|
|
String taskId = request.getTaskId(); |
|
|
|
ProcessProgressVo progressInstanceDetail = processInstanceService.getProgressInstanceDetail(nodeId, instanceId,taskId); |
|
|
|
ProcessProgressVo instDetail = processInstanceService.getProgressInstanceDetail(nodeId, instanceId, taskId); |
|
|
|
|
|
|
|
if(Objects.isNull(progressInstanceDetail)){ |
|
|
|
if (Objects.isNull(instDetail)) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
List<ProgressNode> progressInfo = progressInstanceDetail.getProgressInfo(); |
|
|
|
List<ProgressNode> progressInfo = instDetail.getProgressInfo(); |
|
|
|
Boolean isHighLine = Boolean.FALSE; |
|
|
|
if (CollUtil.isNotEmpty(progressInfo)){ |
|
|
|
if (CollUtil.isNotEmpty(progressInfo)) { |
|
|
|
buildUserUtils.buildUserByProcessInfo(progressInfo); |
|
|
|
isHighLine = checkHighLine(progressInfo,taskId,LoginUserUtil.loginUserDetail()); |
|
|
|
isHighLine = checkHighLine(progressInfo, taskId, LoginUserUtil.loginUserDetail()); |
|
|
|
} |
|
|
|
ProcessProgressDetailVO res = new ProcessProgressDetailVO(); |
|
|
|
res.setProcessProgressVo(progressInstanceDetail); |
|
|
|
res.setStatus(progressInstanceDetail.getStatus()); |
|
|
|
res.setProcessProgressVo(instDetail); |
|
|
|
res.setStatus(instDetail.getStatus()); |
|
|
|
res.setProjectId(projectId); |
|
|
|
res.setCanWithdraw(withDrawHandle.checkCanWithdraw(instanceId,progressInstanceDetail,request.getTaskId())); |
|
|
|
res.setCanWithdraw(withDrawHandle.checkCanWithdraw(instanceId, instDetail, request.getTaskId())); |
|
|
|
res.setIsHighLine(isHighLine); |
|
|
|
passHandle.checkCanPassOrSeal(request.getInstanceId(),request.getTaskId(),employeeCode,res); |
|
|
|
passHandle.checkCanPassOrSeal(request.getInstanceId(), request.getTaskId(), employeeCode, res); |
|
|
|
//是不是被 驳回|退回 |
|
|
|
res.setIsChange(isChangeRecord(projectId)); |
|
|
|
return res; |
|
|
@@ -93,38 +93,38 @@ public class TodoServiceImpl implements ITodoService { |
|
|
|
|
|
|
|
/** |
|
|
|
* 筛选 当前登录人 是不是 上级条线单位的审批 |
|
|
|
* @param progressInfo |
|
|
|
* @param taskId |
|
|
|
* @param user |
|
|
|
* @return |
|
|
|
* |
|
|
|
* @param progressInfo \ |
|
|
|
* @param taskId \ |
|
|
|
* @param user \ |
|
|
|
* @return \ |
|
|
|
*/ |
|
|
|
private boolean checkHighLine(List<ProgressNode> progressInfo, String taskId, UserInfoDetails user) { |
|
|
|
if(CollUtil.isEmpty(progressInfo)){ |
|
|
|
if (CollUtil.isEmpty(progressInfo)) { |
|
|
|
return Boolean.FALSE; |
|
|
|
} |
|
|
|
|
|
|
|
final Boolean[] res = {Boolean.FALSE}; |
|
|
|
progressInfo.forEach(p -> { |
|
|
|
//如果是 子流程 |
|
|
|
if(Objects.nonNull(p.getNodeType()) && NodeTypeEnum.SUB.name().equals(p.getNodeType().name())){ |
|
|
|
if (Objects.nonNull(p.getNodeType()) && NodeTypeEnum.SUB.name().equals(p.getNodeType().name())) { |
|
|
|
//如果不是上级条线单位 根本不用理 |
|
|
|
if(!p.getIsHighLine()){ |
|
|
|
if (Boolean.FALSE.equals(p.getIsHighLine())) { |
|
|
|
return; |
|
|
|
} |
|
|
|
List<ProgressNode> children = p.getChildren(); |
|
|
|
ProgressNode progressNode = children.get(0); |
|
|
|
String userId = progressNode.getUserId(); |
|
|
|
if(StringUtils.isBlank(userId)){ |
|
|
|
if (StringUtils.isBlank(userId)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
UserFullInfoDTO userFullInfoDTO = userInfoHelper.getUserFullInfo(Long.valueOf(userId)); |
|
|
|
if(Objects.nonNull(userFullInfoDTO) && user.getMhUnitId() |
|
|
|
.equals(userFullInfoDTO.getMhUnitId())){ |
|
|
|
UserFullInfoDTO currUser = userInfoHelper.getUserFullInfo(userId); |
|
|
|
if (Objects.nonNull(currUser) && user.getMhUnitId().equals(currUser.getMhUnitId())) { |
|
|
|
//说明是此单位的人 |
|
|
|
//那么要去看 taskId 是不是 在这个单位内的任务 |
|
|
|
boolean isContainsTask = HandlerManage.checkIsContainsTask(children,taskId); |
|
|
|
if(isContainsTask){ |
|
|
|
res[0] = Boolean.TRUE; |
|
|
|
boolean isContainsTask = HandlerManage.checkIsContainsTask(children, taskId); |
|
|
|
if (isContainsTask) { |
|
|
|
res[0] = Boolean.TRUE; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@@ -134,14 +134,15 @@ public class TodoServiceImpl implements ITodoService { |
|
|
|
|
|
|
|
/** |
|
|
|
* 判断 当前项目是不是被驳回 或者 退回过 |
|
|
|
* @param projectId |
|
|
|
* @return |
|
|
|
* |
|
|
|
* @param projectId \ |
|
|
|
* @return \ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public boolean isChangeRecord(Long projectId) { |
|
|
|
//1.先判断下 项目存不存在 |
|
|
|
Project project = projectService.getById(projectId); |
|
|
|
if(Objects.isNull(project)){ |
|
|
|
if (Objects.isNull(project)) { |
|
|
|
return Boolean.FALSE; |
|
|
|
} |
|
|
|
|
|
|
@@ -152,12 +153,12 @@ public class TodoServiceImpl implements ITodoService { |
|
|
|
.in(ProjectInst::getProjectId, projectIds) |
|
|
|
.orderByDesc(ProjectInst::getInstType) |
|
|
|
.last("limit 2")); |
|
|
|
if(CollUtil.isEmpty(pis)){ |
|
|
|
if (CollUtil.isEmpty(pis)) { |
|
|
|
return Boolean.FALSE; |
|
|
|
} |
|
|
|
//判断 项目关联的最新的2个实例 如果类型不匹配 也不属于是变更了 |
|
|
|
//还要看 项目当前的流程实例code 是不是 关联的最新实例 |
|
|
|
if( pis.size() < 2 || |
|
|
|
if (pis.size() < 2 || |
|
|
|
!pis.get(0).getInstCode().equals(project.getInstCode()) || |
|
|
|
pis.get(0).getProjectId().equals(pis.get(1).getProjectId()) || |
|
|
|
!pis.get(0).getInstType().equals(pis.get(1).getInstType())) { |
|
|
|