|
|
@ -166,7 +166,7 @@ public class FlowableRest implements FlowableFeign { |
|
|
|
dto.getFormVariables().put("businessSid",dto.getBusinessSid()); |
|
|
|
String nextNodeUserSids_ = dto.getNextNodeUserSids(); |
|
|
|
if(StringUtils.isBlank(nextNodeUserSids_)){ |
|
|
|
ResultBean<UserAndOrgPath> nextNodeUserSidsOfCreate = getNextNodeUserSidsOfCreate(dto); |
|
|
|
ResultBean<UserAndOrgPath> nextNodeUserSidsOfCreate = getNextNodeUserSidsOfCreateNoOrgPath(dto); |
|
|
|
boolean success = nextNodeUserSidsOfCreate.getSuccess(); |
|
|
|
if(!success){ |
|
|
|
return rb.setMsg(nextNodeUserSidsOfCreate.getMsg()); |
|
|
@ -190,6 +190,55 @@ public class FlowableRest implements FlowableFeign { |
|
|
|
return rb.success().setData(vo); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultBean<UpdateFlowFieldVo> startProcessNoOrgPath(BusinessVariables dto) { |
|
|
|
log.info("startProcess.dto:{}",dto); |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
|
|
|
|
if (StringUtils.isBlank(dto.getBusinessSid())) { |
|
|
|
return rb.setMsg("businessSid 不能为空!"); |
|
|
|
} |
|
|
|
|
|
|
|
if(dto.getFormVariables()==null) |
|
|
|
dto.setFormVariables(new HashMap<String, Object>()); |
|
|
|
Map<String, Object> formVariables = dto.getFormVariables(); |
|
|
|
if(StringUtils.isNotBlank(dto.getOrgSidPath())){ |
|
|
|
String orgPath=dto.getOrgSidPath(); |
|
|
|
formVariables.put("createrOrgPath",orgPath);//发起人的组织结构sid
|
|
|
|
//dto.setFormVariables(formVariables);
|
|
|
|
} |
|
|
|
|
|
|
|
dto.getFormVariables().put("businessSid",dto.getBusinessSid()); |
|
|
|
String nextNodeUserSids_ = dto.getNextNodeUserSids(); |
|
|
|
if(StringUtils.isBlank(nextNodeUserSids_)){ |
|
|
|
ResultBean<UserAndOrgPath> nextNodeUserSidsOfCreate = getNextNodeUserSidsOfCreateNoOrgPath(dto); |
|
|
|
boolean success = nextNodeUserSidsOfCreate.getSuccess(); |
|
|
|
if(!success){ |
|
|
|
return rb.setMsg(nextNodeUserSidsOfCreate.getMsg()); |
|
|
|
} |
|
|
|
nextNodeUserSids_=nextNodeUserSidsOfCreate.getData().getUserSid(); |
|
|
|
dto.getFormVariables().put(BusinessVariables.ORGPATH,nextNodeUserSidsOfCreate.getData().getOrgPath()); |
|
|
|
} |
|
|
|
dto.setNextNodeUserSids(nextNodeUserSids_); |
|
|
|
ResultBean resultBean1 = flowableService.businessStart(dto); |
|
|
|
UpdateFlowFieldVo vo = new UpdateFlowFieldVo(); |
|
|
|
if (resultBean1.getSuccess() && resultBean1.getData() != null) { |
|
|
|
vo.setSid("" + dto.getBusinessSid()); |
|
|
|
Map<String, String> map = (Map<String, String>) resultBean1.getData(); |
|
|
|
vo.setProcDefId(dto.getModelId()); |
|
|
|
vo.setNodeState(map.get("nodeState")); |
|
|
|
vo.setProcInsId(map.get("procInsId")); |
|
|
|
vo.setTaskDefKey(map.get("taskDefKey")); |
|
|
|
vo.setTaskId(map.get("taskId")); |
|
|
|
vo.setNextNodeUserSids(nextNodeUserSids_); |
|
|
|
} |
|
|
|
return rb.success().setData(vo); |
|
|
|
} |
|
|
|
|
|
|
|
private ResultBean<UserAndOrgPath> getNextNodeUserSidsOfCreateNoOrgPath(BusinessVariables dto) { |
|
|
|
return flowtaskService.getNextNodeUserSidsOfCreateNoOrgPath(dto) ; |
|
|
|
} |
|
|
|
|
|
|
|
Logger log= LoggerFactory.getLogger(FlowableRest.class); |
|
|
|
@Override |
|
|
|
public ResultBean<UpdateFlowFieldVo> handleProsess(BusinessVariables dto) { |
|
|
@ -226,7 +275,7 @@ public class FlowableRest implements FlowableFeign { |
|
|
|
|
|
|
|
String nextUserSid = dto.getNextNodeUserSids(); |
|
|
|
if(StringUtils.isBlank(nextUserSid)){ |
|
|
|
ResultBean<UserAndOrgPath> nextNodeUserSidsOfSubmit = getNextNodeUserSidsOfSubmit(dto); |
|
|
|
ResultBean<UserAndOrgPath> nextNodeUserSidsOfSubmit = getNextNodeUserSidsOfSubmitNoOrgPath(dto); |
|
|
|
if (!nextNodeUserSidsOfSubmit.getSuccess()) { |
|
|
|
return rb.setMsg("nextUserSid 不能为空!"); |
|
|
|
} |
|
|
@ -353,6 +402,32 @@ public class FlowableRest implements FlowableFeign { |
|
|
|
vo.setNextNodeUserSids(nextUserSid); |
|
|
|
return rb.success().setData(vo); |
|
|
|
} |
|
|
|
|
|
|
|
private ResultBean<UserAndOrgPath> getNextNodeUserSidsOfSubmitNoOrgPath(BusinessVariables bv) { |
|
|
|
ResultBean<UserAndOrgPath> rb = ResultBean.fireSuccess(); |
|
|
|
String taskDefKey=bv.getTaskDefKey(); |
|
|
|
//根据业务参数取流程流转的环节 信息
|
|
|
|
List<Map<String, Object>> list = (List<Map<String, Object>>) |
|
|
|
flowtaskService.getProcessCirculationNodesByMap(bv).getData(); |
|
|
|
Map<String, Object> task_map=new HashMap<>(); |
|
|
|
//取第二个环节的配置角色
|
|
|
|
boolean endTask=true; |
|
|
|
for (int i=0;i< list.size();i++){ |
|
|
|
String id=list.get(i).get("id").toString(); |
|
|
|
if(id.equals(taskDefKey)&&i+1<list.size()){ |
|
|
|
task_map=list.get(i+1); |
|
|
|
endTask=false; |
|
|
|
} |
|
|
|
} |
|
|
|
if(endTask){ |
|
|
|
task_map.put("name","结束"); |
|
|
|
return rb.setData(new UserAndOrgPath()); |
|
|
|
}else{ |
|
|
|
Object o = task_map.get("candidateGroups"); |
|
|
|
return flowtaskService.getNextUserSidsNoOrgPath(rb, o); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultBean<UpdateFlowFieldVo> revokeProcess(com.yxt.anrui.flowable.api.flowtask.FlowTaskVo fl) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|