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 d7dc0e729..1c6921e6f 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -179,6 +179,16 @@ public class WxFlowServiceImpl implements WxFlowService { } } + public Map mallUserInfoToMap(MallUserInfo userInfo){ + Map map = new HashedMap(); + if(userInfo != null){ + map.put("name",userInfo.getName()); + map.put("id",userInfo.getId()); + map.put("phone",userInfo.getPhone()); + } + return map; + } + @Override @Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class}) public ResultData start(Map params,Long userId,String userName,String tenantId) { @@ -196,7 +206,7 @@ public class WxFlowServiceImpl implements WxFlowService { } // map info,设置发起人等信息 MallUserInfo starterInfo = this.mallUserInfoService.getById(userId); - map.put("starter", starterInfo); + map.put("starter", mallUserInfoToMap(starterInfo)); map.put("startTime",new Date().getTime()); map.put("businessId",businessId+""); map.put("flowType",flowType); @@ -272,7 +282,8 @@ public class WxFlowServiceImpl implements WxFlowService { Map taskInfoMap = new HashedMap(); Map mapInfo = taskService.getVariables(task.getId()); if(mapInfo!=null){ - taskInfoMap.put("starter",((MallUserInfo)mapInfo.get("starter")).getName()); + Map userMap = (Map)mapInfo.get("starter"); + taskInfoMap.put("starter",userMap!=null?userMap.get("name"):""); taskInfoMap.put("startTime",mapInfo.get("startTime")); taskInfoMap.put("processInstanceId",task.getProcessInstanceId()); taskInfoMap.put("taskId",task.getId()); @@ -442,7 +453,7 @@ public class WxFlowServiceImpl implements WxFlowService { Map msgReplaceMap = new HashedMap(); WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); wxMsgValidationcode.setTenantId(tenantId); - MallUserInfo starter = (MallUserInfo)mapInfo.get("starter"); + Map userMap = (Map)mapInfo.get("starter"); List> taskAssigneeList = (List)mapInfo.get("taskAssignee"); Long businessId = Long.parseLong(mapInfo.get("businessId").toString()); @@ -470,7 +481,7 @@ public class WxFlowServiceImpl implements WxFlowService { msgReplaceMap.put("toUserName",assignee.trim()); wxMsgValidationcode = new WxMsgValidationcode(); - wxMsgValidationcode.setPhone(starter.getPhone()); + wxMsgValidationcode.setPhone(userMap!=null?(String)userMap.get("phone"):""); wxMsgValidationcode.setType(EnumMsgModel.FLOW_APPLY_NODIFY.getCode()); wxMsgValidationcodeService.sendWorkFlowNodify(wxMsgValidationcode,msgReplaceMap); return false; @@ -486,7 +497,7 @@ public class WxFlowServiceImpl implements WxFlowService { msgReplaceMap.put("contract",businessId+""); msgReplaceMap.put("page",Constant.adminPage); wxMsgValidationcode = new WxMsgValidationcode(); - wxMsgValidationcode.setPhone(starter.getPhone()); + wxMsgValidationcode.setPhone(userMap!=null?(String)userMap.get("phone"):""); wxMsgValidationcode.setType(EnumMsgModel.FLOW_PASS_NODIFY.getCode()); wxMsgValidationcodeService.sendWorkFlowNodify(wxMsgValidationcode,msgReplaceMap); return true; @@ -528,7 +539,7 @@ public class WxFlowServiceImpl implements WxFlowService { Map mapInfo = taskService.getVariables(task.getId()); Long businessId = Long.parseLong(mapInfo.get("businessId").toString()); Integer flowType = (Integer)mapInfo.get("flowType"); - MallUserInfo starter = (MallUserInfo)mapInfo.get("starter"); + Map userMap = (Map)mapInfo.get("starter"); String taskName; String taskKey; @@ -568,7 +579,7 @@ public class WxFlowServiceImpl implements WxFlowService { msgReplaceMap.put("page",Constant.adminPage); wxMsgValidationcode = new WxMsgValidationcode(); - wxMsgValidationcode.setPhone(starter.getPhone()); + wxMsgValidationcode.setPhone(userMap!=null?(String)userMap.get("phone"):""); wxMsgValidationcode.setType(EnumMsgModel.FLOW_REJECT_NODIFY.getCode()); wxMsgValidationcodeService.sendWorkFlowNodify(wxMsgValidationcode,msgReplaceMap); return new ResultData();