|
@ -389,22 +389,25 @@ public class FlowableRest implements FlowableFeign { |
|
|
boolean isChange = false; |
|
|
boolean isChange = false; |
|
|
String firstName = ""; |
|
|
String firstName = ""; |
|
|
String firstSid = ""; |
|
|
String firstSid = ""; |
|
|
|
|
|
String changeName = ""; |
|
|
if (StringUtils.isBlank(nextUserSid)) { |
|
|
if (StringUtils.isBlank(nextUserSid)) { |
|
|
ResultBean<UserAndOrgPath> nextNodeUserSidsOfSubmit = getNextNodeUserSidsOfSubmit(dto); |
|
|
ResultBean<UserAndOrgPath> nextNodeUserSidsOfSubmit = getNextNodeUserSidsOfSubmit(dto); |
|
|
if (!nextNodeUserSidsOfSubmit.getSuccess()) { |
|
|
if (!nextNodeUserSidsOfSubmit.getSuccess()) { |
|
|
// return rb.setMsg("nextUserSid 不能为空!");
|
|
|
//下一环节用户为空的情况
|
|
|
//=================================添加系统个管理员自动审批
|
|
|
|
|
|
nextUserSid = ProcDefEnum.DEFAUL_TADMIN_SID.getProDefId(); |
|
|
nextUserSid = ProcDefEnum.DEFAUL_TADMIN_SID.getProDefId(); |
|
|
adminContains = true; |
|
|
adminContains = true; |
|
|
} else { |
|
|
} else { |
|
|
nextUserSid = nextNodeUserSidsOfSubmit.getData().getUserSid(); |
|
|
nextUserSid = nextNodeUserSidsOfSubmit.getData().getUserSid(); |
|
|
formVariables.put(BusinessVariables.ORGPATH, nextNodeUserSidsOfSubmit.getData().getOrgPath()); |
|
|
formVariables.put(BusinessVariables.ORGPATH, nextNodeUserSidsOfSubmit.getData().getOrgPath()); |
|
|
|
|
|
//下一环节不为空,查询下一环节用户是否有转办人
|
|
|
if (nextUserSid != null) { |
|
|
if (nextUserSid != null) { |
|
|
List<String> nextUserList = Arrays.asList(nextUserSid.split(",")); |
|
|
List<String> nextUserList = Arrays.asList(nextUserSid.split(",")); |
|
|
if (nextUserList.size() == 1) { |
|
|
if (nextUserList.size() == 1) { |
|
|
|
|
|
//下一环节用户sid
|
|
|
firstSid = nextUserList.get(0); |
|
|
firstSid = nextUserList.get(0); |
|
|
ResultBean<SysUserVo> sysUserVoResultBean = sysUserFeign.fetchBySid(firstSid); |
|
|
ResultBean<SysUserVo> sysUserVoResultBean = sysUserFeign.fetchBySid(firstSid); |
|
|
if (sysUserVoResultBean.getData() != null) { |
|
|
if (sysUserVoResultBean.getData() != null) { |
|
|
|
|
|
//下一环节用户名称
|
|
|
firstName = sysUserVoResultBean.getData().getName(); |
|
|
firstName = sysUserVoResultBean.getData().getName(); |
|
|
} |
|
|
} |
|
|
SysFlowableConfigQuery sysFlowableConfigQuery = new SysFlowableConfigQuery(); |
|
|
SysFlowableConfigQuery sysFlowableConfigQuery = new SysFlowableConfigQuery(); |
|
@ -413,7 +416,10 @@ public class FlowableRest implements FlowableFeign { |
|
|
ResultBean<SysFlowableConfigVvo> sysFlowableConfigVvoResultBean = sysFlowableConfigFeign.selectByUserSid(sysFlowableConfigQuery); |
|
|
ResultBean<SysFlowableConfigVvo> sysFlowableConfigVvoResultBean = sysFlowableConfigFeign.selectByUserSid(sysFlowableConfigQuery); |
|
|
if (sysFlowableConfigVvoResultBean.getData() != null) { |
|
|
if (sysFlowableConfigVvoResultBean.getData() != null) { |
|
|
if (StringUtils.isNotBlank(sysFlowableConfigVvoResultBean.getData().getChangeUserSid())) { |
|
|
if (StringUtils.isNotBlank(sysFlowableConfigVvoResultBean.getData().getChangeUserSid())) { |
|
|
|
|
|
//转办人sid
|
|
|
nextUserSid = sysFlowableConfigVvoResultBean.getData().getChangeUserSid(); |
|
|
nextUserSid = sysFlowableConfigVvoResultBean.getData().getChangeUserSid(); |
|
|
|
|
|
//转办人名称
|
|
|
|
|
|
changeName = sysFlowableConfigVvoResultBean.getData().getChangeName(); |
|
|
isChange = true; |
|
|
isChange = true; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -422,6 +428,7 @@ public class FlowableRest implements FlowableFeign { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
//若下一环节用户与系统管理员一致,则自动审批
|
|
|
if (ProcDefEnum.DEFAUL_TADMIN_SID.getProDefId().equals(nextUserSid)) { |
|
|
if (ProcDefEnum.DEFAUL_TADMIN_SID.getProDefId().equals(nextUserSid)) { |
|
|
adminContains = true; |
|
|
adminContains = true; |
|
|
} |
|
|
} |
|
@ -442,6 +449,7 @@ public class FlowableRest implements FlowableFeign { |
|
|
if (StringUtils.isBlank(businessSid)) { |
|
|
if (StringUtils.isBlank(businessSid)) { |
|
|
return rb.setMsg("业务sid 不能为空!"); |
|
|
return rb.setMsg("业务sid 不能为空!"); |
|
|
} |
|
|
} |
|
|
|
|
|
//查询任务id为taskId的任务是否存在
|
|
|
Task task = taskService.createTaskQuery().taskId(taskId).singleResult(); |
|
|
Task task = taskService.createTaskQuery().taskId(taskId).singleResult(); |
|
|
if (Objects.isNull(task)) { |
|
|
if (Objects.isNull(task)) { |
|
|
return rb.setMsg("任务不存在"); |
|
|
return rb.setMsg("任务不存在"); |
|
@ -454,7 +462,7 @@ public class FlowableRest implements FlowableFeign { |
|
|
String taskDefKey = ""; |
|
|
String taskDefKey = ""; |
|
|
vo.setSid(businessSid); |
|
|
vo.setSid(businessSid); |
|
|
|
|
|
|
|
|
if (DelegationState.PENDING.equals(task.getDelegationState())) { |
|
|
if (DelegationState.PENDING.equals(task.getDelegationState())) {//加签
|
|
|
taskService.addComment(taskId, instanceId, |
|
|
taskService.addComment(taskId, instanceId, |
|
|
FlowComment.DELEGATE.getType(), comment); |
|
|
FlowComment.DELEGATE.getType(), comment); |
|
|
taskService.resolveTask(taskId, formVariables); |
|
|
taskService.resolveTask(taskId, formVariables); |
|
@ -469,15 +477,11 @@ public class FlowableRest implements FlowableFeign { |
|
|
if (ll.getData().size() > 0) { |
|
|
if (ll.getData().size() > 0) { |
|
|
LatestTaskVo latestTaskVo = ll.getData().get(0); |
|
|
LatestTaskVo latestTaskVo = ll.getData().get(0); |
|
|
String id_ = latestTaskVo.getId_(); |
|
|
String id_ = latestTaskVo.getId_(); |
|
|
if(isChange){//添加评论
|
|
|
if (isChange) {//若下一环节用户存在转办人则添加评论
|
|
|
ResultBean<SysUserVo> sysUserVoResultBean = sysUserFeign.fetchBySid(nextUserSid); |
|
|
|
|
|
ProcessCommentDto processCommentDto = new ProcessCommentDto(); |
|
|
ProcessCommentDto processCommentDto = new ProcessCommentDto(); |
|
|
processCommentDto.setReviewerSid(firstSid); |
|
|
processCommentDto.setReviewerSid(firstSid); |
|
|
if(sysUserVoResultBean.getData() != null){ |
|
|
|
|
|
String changeName = sysUserVoResultBean.getData().getName(); |
|
|
|
|
|
processCommentDto.setReviewer(firstName); |
|
|
processCommentDto.setReviewer(firstName); |
|
|
processCommentDto.setContent("交" + changeName + "转办"); |
|
|
processCommentDto.setContent("交" + changeName + "转办"); |
|
|
} |
|
|
|
|
|
processCommentDto.setTime(new Date()); |
|
|
processCommentDto.setTime(new Date()); |
|
|
processCommentDto.setProcessId(dto.getInstanceId()); |
|
|
processCommentDto.setProcessId(dto.getInstanceId()); |
|
|
processCommentService.saveOrUpdateDto(processCommentDto); |
|
|
processCommentService.saveOrUpdateDto(processCommentDto); |
|
@ -494,7 +498,7 @@ public class FlowableRest implements FlowableFeign { |
|
|
vo.setNodeState(FlowComment.SETTLE.getRemark()); |
|
|
vo.setNodeState(FlowComment.SETTLE.getRemark()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (adminContains) { |
|
|
if (adminContains) {//若下一环节用户与系统管理员一致,则自动审批
|
|
|
dto.setUserSid(nextUserSid); |
|
|
dto.setUserSid(nextUserSid); |
|
|
dto.setTaskId(vo.getTaskId()); |
|
|
dto.setTaskId(vo.getTaskId()); |
|
|
dto.setTaskDefKey(taskDefKey); |
|
|
dto.setTaskDefKey(taskDefKey); |
|
@ -516,7 +520,7 @@ public class FlowableRest implements FlowableFeign { |
|
|
UserTask userTask = (UserTask) flowElement2; |
|
|
UserTask userTask = (UserTask) flowElement2; |
|
|
List<String> candidateGroups = userTask.getCandidateGroups(); |
|
|
List<String> candidateGroups = userTask.getCandidateGroups(); |
|
|
//根据角色查询用户
|
|
|
//根据角色查询用户
|
|
|
for (String roleSid : candidateGroups) { |
|
|
/*for (String roleSid : candidateGroups) { |
|
|
UserQuery userQuery = new UserQuery(); |
|
|
UserQuery userQuery = new UserQuery(); |
|
|
userQuery.setRoleSid(roleSid); |
|
|
userQuery.setRoleSid(roleSid); |
|
|
userQuery.setOrgSidPath(dto.getOrgSidPath()); |
|
|
userQuery.setOrgSidPath(dto.getOrgSidPath()); |
|
@ -526,6 +530,13 @@ public class FlowableRest implements FlowableFeign { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
sysUserVoLists2.addAll(userByRole.getData()); |
|
|
sysUserVoLists2.addAll(userByRole.getData()); |
|
|
|
|
|
}*/ |
|
|
|
|
|
UserssQuery userssQuery = new UserssQuery(); |
|
|
|
|
|
userssQuery.setCandidateGroups(candidateGroups); |
|
|
|
|
|
userssQuery.setOrgSidPath(dto.getOrgSidPath()); |
|
|
|
|
|
sysUserVoLists2 = sysUserFeign.getUsersByRoles(userssQuery).getData(); |
|
|
|
|
|
if (sysUserVoLists2 == null) { |
|
|
|
|
|
sysUserVoLists2 = new ArrayList<>(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -534,7 +545,7 @@ public class FlowableRest implements FlowableFeign { |
|
|
List<String> candidateGroups = userTask.getCandidateGroups(); |
|
|
List<String> candidateGroups = userTask.getCandidateGroups(); |
|
|
List<SysUserVo> sysUserVoLists = new ArrayList<>(); |
|
|
List<SysUserVo> sysUserVoLists = new ArrayList<>(); |
|
|
//根据角色查询用户
|
|
|
//根据角色查询用户
|
|
|
for (String roleSid : candidateGroups) { |
|
|
/* for (String roleSid : candidateGroups) { |
|
|
UserQuery userQuery = new UserQuery(); |
|
|
UserQuery userQuery = new UserQuery(); |
|
|
userQuery.setRoleSid(roleSid); |
|
|
userQuery.setRoleSid(roleSid); |
|
|
userQuery.setOrgSidPath(dto.getOrgSidPath()); |
|
|
userQuery.setOrgSidPath(dto.getOrgSidPath()); |
|
@ -544,6 +555,13 @@ public class FlowableRest implements FlowableFeign { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
sysUserVoLists.addAll(userByRole.getData()); |
|
|
sysUserVoLists.addAll(userByRole.getData()); |
|
|
|
|
|
}*/ |
|
|
|
|
|
UserssQuery userssQuery = new UserssQuery(); |
|
|
|
|
|
userssQuery.setCandidateGroups(candidateGroups); |
|
|
|
|
|
userssQuery.setOrgSidPath(dto.getOrgSidPath()); |
|
|
|
|
|
sysUserVoLists = sysUserFeign.getUsersByRoles(userssQuery).getData(); |
|
|
|
|
|
if (sysUserVoLists == null) { |
|
|
|
|
|
sysUserVoLists = new ArrayList<>(); |
|
|
} |
|
|
} |
|
|
//当前环节运营部总经理 刘丽艳 点击同意 下一环节 事业部副总经理 (nextUserSid) 和事业部总经理(sysUserVoLists.get(0).getSid())
|
|
|
//当前环节运营部总经理 刘丽艳 点击同意 下一环节 事业部副总经理 (nextUserSid) 和事业部总经理(sysUserVoLists.get(0).getSid())
|
|
|
//判断查询回来的用户的集合size是1 并且用户的sid和下一环节的用户的sid相同。
|
|
|
//判断查询回来的用户的集合size是1 并且用户的sid和下一环节的用户的sid相同。
|
|
@ -579,6 +597,7 @@ public class FlowableRest implements FlowableFeign { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 未添加系统管理员自动审批功能 |
|
|
* 未添加系统管理员自动审批功能 |
|
|
|
|
|
* |
|
|
* @param dto |
|
|
* @param dto |
|
|
* @param b 是否连续跳转环节 |
|
|
* @param b 是否连续跳转环节 |
|
|
* @return |
|
|
* @return |
|
|