diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java index 0034ff546..821e00ce3 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -779,7 +779,6 @@ public class WxFlowServiceImpl implements WxFlowService { WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); wxMsgValidationcode.setTenantId(tenantId); Map userMap = (Map)mapInfo.get("starter"); - List> taskAssigneeList = (List)mapInfo.get("taskAssignee"); Long businessId = Long.parseLong(mapInfo.get("businessId").toString()); String email = (String)userMap.get("email"); List> variables = (List)mapInfo.get("variables"); @@ -787,7 +786,18 @@ public class WxFlowServiceImpl implements WxFlowService { // 判断下个节点是否有设置审批人,没有,直接通过,有,发短信通知 if(!isEnded(processInstanceId)){ - if(hasAssignee(taskAssigneeList,taskKey,processInstanceId)){ + boolean hasAssignee; + if(flowType.intValue() <= EnumFlowKey.END_CONTRACT.getCode().intValue()) { + //老数据 + List> taskAssigneeList = (List) mapInfo.get("taskAssignee"); + hasAssignee = hasAssignee(taskAssigneeList,taskKey,processInstanceId); + }else{ + WxFlowModel flowModel = (WxFlowModel)JsonUtil.readValue((String)mapInfo.get("taskAssignee"),WxFlowModel.class); + List taskAssigneeList = flowModel.getLists(); + hasAssignee = hasAssigneeForNew(taskAssigneeList,taskKey,processInstanceId); + } + + if(hasAssignee){ // 给代办人发送通知短信 String assignee = ""; List mallUserInfoList = getUserByProcessInstanceId(processInstanceId); @@ -895,6 +905,25 @@ public class WxFlowServiceImpl implements WxFlowService { * @param taskKey * @param processInstanceId */ + public boolean hasAssigneeForNew(List 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> taskAssigneeList,String taskKey,String processInstanceId){ boolean has = true; for (int i = 0; i < taskAssigneeList.size(); i++) {