|
|
@ -114,49 +114,8 @@ public class FlowableRest implements FlowableFeign { |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultBean<UserAndOrgPath> getNextNodeUserSidsOfCreate(BusinessVariables bv) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String orgSidPath=bv.getOrgSidPath(); |
|
|
|
//根据业务参数取流程流转的环节 信息
|
|
|
|
List<Map<String, Object>> list = (List<Map<String, Object>>) flowtaskService.getProcessCirculationNodesByMap(bv).getData(); |
|
|
|
if(list==null||list.size()<2){ |
|
|
|
return rb.setMsg("流程设计问题"); |
|
|
|
} |
|
|
|
//取第二个环节的配置角色
|
|
|
|
Object o = list.get(1).get("candidateGroups"); |
|
|
|
if(o==null){ |
|
|
|
return rb.setMsg("流程设计问题"); |
|
|
|
} |
|
|
|
return getNextUserSids(rb, orgSidPath, o); |
|
|
|
} |
|
|
|
|
|
|
|
private ResultBean< UserAndOrgPath> getNextUserSids(ResultBean rb, String orgSidPath, Object o) { |
|
|
|
UserAndOrgPath mapParam=new UserAndOrgPath(); |
|
|
|
JSONArray jsonArray = JSONArray.parseArray(JSON.toJSONString(o)); |
|
|
|
String roleSid = jsonArray.get(0).toString(); |
|
|
|
//根据组织架构、角色两个参数取相关符合条件的用户信息
|
|
|
|
UserQuery userQuery = new UserQuery(); |
|
|
|
userQuery.setRoleSid(roleSid); |
|
|
|
userQuery.setOrgSidPath(orgSidPath); |
|
|
|
List<SysUserVo> sysUserVos = sysUserFeign.getUserByRole(userQuery).getData(); |
|
|
|
if(sysUserVos==null||sysUserVos.size()<1){ |
|
|
|
return rb.fail().setMsg("环节没有用户"); |
|
|
|
} |
|
|
|
StringBuilder nextNodeUserSids = new StringBuilder(); |
|
|
|
StringBuilder nextNodeOrgPathSids = new StringBuilder(); |
|
|
|
for (SysUserVo su : sysUserVos) { |
|
|
|
nextNodeUserSids.append(su.getSid()).append(","); |
|
|
|
nextNodeOrgPathSids.append(su.getOrgSidPath()).append(","); |
|
|
|
} |
|
|
|
//符合条件的用户的sid,拼接的字符串
|
|
|
|
String nextNodeUserSids_ = nextNodeUserSids.toString(); |
|
|
|
String nextNodeOrgPathSids_ = nextNodeOrgPathSids.toString(); |
|
|
|
if(StringUtils.isBlank(nextNodeUserSids_)) |
|
|
|
return rb.fail().setMsg("环节没有用户"); |
|
|
|
nextNodeUserSids_ = nextNodeUserSids_.substring(0, nextNodeUserSids_.length() - 1); |
|
|
|
nextNodeOrgPathSids_ = nextNodeOrgPathSids_.substring(0, nextNodeOrgPathSids_.length() - 1); |
|
|
|
mapParam.setUserSid(nextNodeUserSids_); |
|
|
|
mapParam.setOrgPath(nextNodeOrgPathSids_); |
|
|
|
return rb.success().setData(mapParam); |
|
|
|
return flowtaskService.getNextNodeUserSidsOfCreate(bv) ; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -182,7 +141,7 @@ public class FlowableRest implements FlowableFeign { |
|
|
|
return rb.setData(new UserAndOrgPath()); |
|
|
|
}else{ |
|
|
|
Object o = task_map.get("candidateGroups"); |
|
|
|
return getNextUserSids(rb, orgSidPath, o); |
|
|
|
return flowtaskService.getNextUserSids(rb, orgSidPath, o); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -350,8 +309,12 @@ public class FlowableRest implements FlowableFeign { |
|
|
|
UserQuery userQuery = new UserQuery(); |
|
|
|
userQuery.setRoleSid(roleSid); |
|
|
|
userQuery.setOrgSidPath(dto.getOrgSidPath()); |
|
|
|
List<SysUserVo> sysUserVos = sysUserFeign.getUserByRole(userQuery).getData(); |
|
|
|
sysUserVoLists.addAll(sysUserVos); |
|
|
|
ResultBean<List<SysUserVo>> userByRole = sysUserFeign.getUserByRole(userQuery); |
|
|
|
boolean success = userByRole.getSuccess(); |
|
|
|
if(!success){ |
|
|
|
continue; |
|
|
|
} |
|
|
|
sysUserVoLists.addAll(userByRole.getData()); |
|
|
|
} |
|
|
|
if(sysUserVoLists.size()==1&&sysUserVoLists.get(0).getSid().equals(nextUserSid)){ |
|
|
|
contains=true; |
|
|
|