| @@ -779,7 +779,6 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | ||||
| wxMsgValidationcode.setTenantId(tenantId); | wxMsgValidationcode.setTenantId(tenantId); | ||||
| Map<String,Object> userMap = (Map<String,Object>)mapInfo.get("starter"); | Map<String,Object> userMap = (Map<String,Object>)mapInfo.get("starter"); | ||||
| List<Map<String,String>> taskAssigneeList = (List)mapInfo.get("taskAssignee"); | |||||
| Long businessId = Long.parseLong(mapInfo.get("businessId").toString()); | Long businessId = Long.parseLong(mapInfo.get("businessId").toString()); | ||||
| String email = (String)userMap.get("email"); | String email = (String)userMap.get("email"); | ||||
| List<Map<String,Object>> variables = (List)mapInfo.get("variables"); | List<Map<String,Object>> variables = (List)mapInfo.get("variables"); | ||||
| @@ -787,7 +786,18 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| // 判断下个节点是否有设置审批人,没有,直接通过,有,发短信通知 | // 判断下个节点是否有设置审批人,没有,直接通过,有,发短信通知 | ||||
| if(!isEnded(processInstanceId)){ | if(!isEnded(processInstanceId)){ | ||||
| if(hasAssignee(taskAssigneeList,taskKey,processInstanceId)){ | |||||
| boolean hasAssignee; | |||||
| if(flowType.intValue() <= EnumFlowKey.END_CONTRACT.getCode().intValue()) { | |||||
| //老数据 | |||||
| List<Map<String, String>> taskAssigneeList = (List) mapInfo.get("taskAssignee"); | |||||
| hasAssignee = hasAssignee(taskAssigneeList,taskKey,processInstanceId); | |||||
| }else{ | |||||
| WxFlowModel flowModel = (WxFlowModel)JsonUtil.readValue((String)mapInfo.get("taskAssignee"),WxFlowModel.class); | |||||
| List<UserTaskVo> taskAssigneeList = flowModel.getLists(); | |||||
| hasAssignee = hasAssigneeForNew(taskAssigneeList,taskKey,processInstanceId); | |||||
| } | |||||
| if(hasAssignee){ | |||||
| // 给代办人发送通知短信 | // 给代办人发送通知短信 | ||||
| String assignee = ""; | String assignee = ""; | ||||
| List<MallUserInfo> mallUserInfoList = getUserByProcessInstanceId(processInstanceId); | List<MallUserInfo> mallUserInfoList = getUserByProcessInstanceId(processInstanceId); | ||||
| @@ -895,6 +905,25 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| * @param taskKey | * @param taskKey | ||||
| * @param processInstanceId | * @param processInstanceId | ||||
| */ | */ | ||||
| public boolean hasAssigneeForNew(List<UserTaskVo> taskAssigneeList,String taskKey,String processInstanceId){ | |||||
| boolean has = true; | |||||
| for (int i = 0; i < taskAssigneeList.size(); i++) { | |||||
| UserTaskVo taskAssignee = taskAssigneeList.get(i); | |||||
| if(taskAssignee.getKey().equals(taskKey)){ | |||||
| if(i != taskAssigneeList.size() -1){ | |||||
| UserTaskVo nextTaskAssignee = taskAssigneeList.get(i+1); | |||||
| if(CollectionUtils.isEmpty(nextTaskAssignee.getUserList())){ | |||||
| Task task = taskService.createTaskQuery().processInstanceId(processInstanceId).singleResult(); | |||||
| taskService.complete(task.getId()); | |||||
| has = false; | |||||
| break; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| return has; | |||||
| } | |||||
| public boolean hasAssignee(List<Map<String,String>> taskAssigneeList,String taskKey,String processInstanceId){ | public boolean hasAssignee(List<Map<String,String>> taskAssigneeList,String taskKey,String processInstanceId){ | ||||
| boolean has = true; | boolean has = true; | ||||
| for (int i = 0; i < taskAssigneeList.size(); i++) { | for (int i = 0; i < taskAssigneeList.size(); i++) { | ||||