| @@ -610,6 +610,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| if(CollectionUtils.isEmpty(resultList)){ | |||
| return new ResultData(); | |||
| } | |||
| Integer flowType = resultList.get(0).getBusinessType(); | |||
| String processInstanceId = resultList.get(0).getProcessInstanceId(); | |||
| ProcessInstance pi = null; | |||
| try { | |||
| @@ -620,12 +621,11 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| if(pi == null){ | |||
| return new ResultData(ErrorCode.FLOW_INST_NOT_EXIST.getCode(), "任务不存在"); | |||
| } | |||
| Task task = taskService.createTaskQuery().processInstanceId(pi.getId()).singleResult(); | |||
| Map<String,Object> mapInfo = taskService.getVariables(task.getId()); | |||
| Integer flowType = (Integer)mapInfo.get("flowType"); | |||
| if(flowType.intValue() <= EnumFlowKey.END_CONTRACT.getCode().intValue()){ | |||
| //老数据 | |||
| Task task = taskService.createTaskQuery().processInstanceId(pi.getId()).singleResult(); | |||
| Map<String,Object> mapInfo = taskService.getVariables(task.getId()); | |||
| List<Map<String,String>> taskAssigneeList = (List)mapInfo.get("taskAssignee"); | |||
| for (int i = 0; i < taskAssigneeList.size(); i++) { | |||
| Map<String,String> assignee = taskAssigneeList.get(i); | |||
| @@ -667,11 +667,14 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| } | |||
| } | |||
| }else{ | |||
| WxFlowModel flowModel = (WxFlowModel)JsonUtil.readValue((String)mapInfo.get("taskAssignee"),WxFlowModel.class); | |||
| List<Task> taskList = taskService.createTaskQuery().processInstanceId(pi.getId()).list(); | |||
| //Map<String,Object> mapInfo = taskService.getVariables(task.getId()); | |||
| WxFlowModel flowModelDb = getModelByType(flowType,tenantId); | |||
| WxFlowModel flowModel = (WxFlowModel)JsonUtil.readValue(flowModelDb.getFlow(),WxFlowModel.class); | |||
| List<UserTaskVo> taskAssigneeList = flowModel.getLists(); | |||
| for (int i = 0; i < taskAssigneeList.size(); i++) { | |||
| UserTaskVo assignee = taskAssigneeList.get(i); | |||
| if(task.getTaskDefinitionKey().equals(assignee.getKey())){ | |||
| if(taskList.get(0).getTaskDefinitionKey().equals(assignee.getKey())){ | |||
| //设置当前节点代办人信息 | |||
| String userName = ""; | |||
| for (FlowUserVo userVo:assignee.getUserList()) { | |||
| @@ -1245,27 +1248,14 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| userTask.setName("节点" + (i + 1)); | |||
| userTask.setId("userTask" + (i + 1)); | |||
| List<String> userIdList = new ArrayList<>(); | |||
| String collection = ""; | |||
| for (int j = 0; j < taskVo.getUserList().size(); j++) { | |||
| FlowUserVo userVo = taskVo.getUserList().get(j); | |||
| userIdList.add(userVo.getId() + ""); | |||
| if(j==taskVo.getUserList().size()-1){ | |||
| collection += userVo.getId(); | |||
| }else{ | |||
| collection += userVo.getId()+","; | |||
| } | |||
| } | |||
| if (EnumTaskType.NORMAL.getCode().equals(taskVo.getType()) || EnumTaskType.OR.getCode().equals(taskVo.getType())) { | |||
| userTask.setCandidateUsers(userIdList); | |||
| } else if (EnumTaskType.AND.getCode().equals(taskVo.getType())) { | |||
| userTask.setCandidateUsers(userIdList); | |||
| MultiInstanceLoopCharacteristics mi = new MultiInstanceLoopCharacteristics(); | |||
| mi.setLoopCardinality(userIdList.size()+""); | |||
| // mi.setCollectionString(collection); | |||
| mi.setInputDataItem(collection); | |||
| // mi.setElementVariable("assignee"); | |||
| userTask.setLoopCharacteristics(mi); | |||
| // userTask.setCandidateUsers(userIdList); | |||
| } | |||
| userTask.setIncomingFlows(Arrays.asList(flowList.get(i))); | |||