|
|
@ -113,7 +113,7 @@ public class FlowableRest implements FlowableFeign { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultBean<String> getNextNodeUserSidsOfCreate(BusinessVariables bv) { |
|
|
|
public ResultBean<UserAndOrgPath> getNextNodeUserSidsOfCreate(BusinessVariables bv) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String orgSidPath=bv.getOrgSidPath(); |
|
|
|
String orgPath = bv.getOrgPath(); |
|
|
@ -130,7 +130,8 @@ public class FlowableRest implements FlowableFeign { |
|
|
|
return getNextUserSids(rb, orgSidPath, o,orgPath); |
|
|
|
} |
|
|
|
|
|
|
|
private ResultBean getNextUserSids(ResultBean rb, String orgSidPath, Object o,String orgPath) { |
|
|
|
private ResultBean< UserAndOrgPath> getNextUserSids(ResultBean rb, String orgSidPath, Object o,String orgPath) { |
|
|
|
UserAndOrgPath mapParam=new UserAndOrgPath(); |
|
|
|
JSONArray jsonArray = JSONArray.parseArray(JSON.toJSONString(o)); |
|
|
|
String roleSid = jsonArray.get(0).toString(); |
|
|
|
//根据组织架构、角色两个参数取相关符合条件的用户信息
|
|
|
@ -143,20 +144,26 @@ public class FlowableRest implements FlowableFeign { |
|
|
|
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); |
|
|
|
return rb.success().setData(nextNodeUserSids_); |
|
|
|
nextNodeOrgPathSids_ = nextNodeOrgPathSids_.substring(0, nextNodeOrgPathSids_.length() - 1); |
|
|
|
mapParam.setUserSid(nextNodeUserSids_); |
|
|
|
mapParam.setOrgPath(nextNodeOrgPathSids_); |
|
|
|
return rb.success().setData(mapParam); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultBean getNextNodeUserSidsOfSubmit(BusinessVariables bv) { |
|
|
|
ResultBean rb = ResultBean.fireSuccess(); |
|
|
|
public ResultBean<UserAndOrgPath> getNextNodeUserSidsOfSubmit(BusinessVariables bv) { |
|
|
|
ResultBean<UserAndOrgPath> rb = ResultBean.fireSuccess(); |
|
|
|
String orgSidPath=bv.getOrgSidPath(); |
|
|
|
String taskDefKey=bv.getTaskDefKey(); |
|
|
|
String orgPath = bv.getOrgPath(); |
|
|
@ -175,7 +182,7 @@ public class FlowableRest implements FlowableFeign { |
|
|
|
} |
|
|
|
if(endTask){ |
|
|
|
task_map.put("name","结束"); |
|
|
|
return rb.setData(""); |
|
|
|
return rb.setData(new UserAndOrgPath()); |
|
|
|
}else{ |
|
|
|
Object o = task_map.get("candidateGroups"); |
|
|
|
return getNextUserSids(rb, orgSidPath, o,orgPath); |
|
|
@ -195,12 +202,13 @@ public class FlowableRest implements FlowableFeign { |
|
|
|
dto.getFormVariables().put("businessSid",dto.getBusinessSid()); |
|
|
|
String nextNodeUserSids_ = dto.getNextNodeUserSids(); |
|
|
|
if(StringUtils.isBlank(nextNodeUserSids_)){ |
|
|
|
ResultBean<String> nextNodeUserSidsOfCreate = getNextNodeUserSidsOfCreate(dto); |
|
|
|
ResultBean<UserAndOrgPath> nextNodeUserSidsOfCreate = getNextNodeUserSidsOfCreate(dto); |
|
|
|
boolean success = nextNodeUserSidsOfCreate.getSuccess(); |
|
|
|
if(!success){ |
|
|
|
return rb.setMsg(nextNodeUserSidsOfCreate.getMsg()); |
|
|
|
} |
|
|
|
nextNodeUserSids_=nextNodeUserSidsOfCreate.getData(); |
|
|
|
nextNodeUserSids_=nextNodeUserSidsOfCreate.getData().getUserSid(); |
|
|
|
dto.getFormVariables().put("orgPath",nextNodeUserSidsOfCreate.getData().getOrgPath()); |
|
|
|
} |
|
|
|
dto.setNextNodeUserSids(nextNodeUserSids_); |
|
|
|
ResultBean resultBean1 = flowableService.businessStart(dto); |
|
|
@ -252,11 +260,12 @@ public class FlowableRest implements FlowableFeign { |
|
|
|
|
|
|
|
String nextUserSid = dto.getNextNodeUserSids(); |
|
|
|
if(StringUtils.isBlank(nextUserSid)){ |
|
|
|
ResultBean<String> nextNodeUserSidsOfSubmit = getNextNodeUserSidsOfSubmit(dto); |
|
|
|
ResultBean<UserAndOrgPath> nextNodeUserSidsOfSubmit = getNextNodeUserSidsOfSubmit(dto); |
|
|
|
if (!nextNodeUserSidsOfSubmit.getSuccess()) { |
|
|
|
return rb.setMsg("nextUserSid 不能为空!"); |
|
|
|
} |
|
|
|
nextUserSid=nextNodeUserSidsOfSubmit.getData(); |
|
|
|
nextUserSid=nextNodeUserSidsOfSubmit.getData().getUserSid(); |
|
|
|
formVariables.put("orgPath",nextNodeUserSidsOfSubmit.getData().getOrgPath()); |
|
|
|
} |
|
|
|
String comment = dto.getComment(); |
|
|
|
if (StringUtils.isBlank(comment)) { |
|
|
|