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