From 4d55ec554aa3b94545abe920775cd0e408e3e9c8 Mon Sep 17 00:00:00 2001 From: gaojiabao Date: Wed, 29 Mar 2023 13:55:18 +0800 Subject: [PATCH] =?UTF-8?q?OA=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WebServiceOAServiceImpl.java | 66 ++++++++++++------- 1 file changed, 44 insertions(+), 22 deletions(-) diff --git a/src/main/java/com/ydw/bat/wkflow/business_oa/webService/service/impl/WebServiceOAServiceImpl.java b/src/main/java/com/ydw/bat/wkflow/business_oa/webService/service/impl/WebServiceOAServiceImpl.java index 9422c1b2..9a2a33d2 100644 --- a/src/main/java/com/ydw/bat/wkflow/business_oa/webService/service/impl/WebServiceOAServiceImpl.java +++ b/src/main/java/com/ydw/bat/wkflow/business_oa/webService/service/impl/WebServiceOAServiceImpl.java @@ -191,28 +191,50 @@ public class WebServiceOAServiceImpl implements WebServiceOAService { List list = iBusProcessNewService.list(queryWrapper1); if(!list.isEmpty()){ List notifyTodoSendContexts = new ArrayList<>(); - list.forEach(busProcessNew -> { - NotifyTodoSendContext notifyTodoSendContext = new NotifyTodoSendContext(); - notifyTodoSendContext.setAppName("SRMS"); - notifyTodoSendContext.setModelId(busProcessNew.getId()); - notifyTodoSendContext.setModelName(busProcessNew.getTaskInfo()); - notifyTodoSendContext.setType("1"); - notifyTodoSendContext.setOptType("2"); - Map map = new HashMap<>(); - ResponseMessage byId = lawsUserInfoService.getById(busProcessNew.getUserId()); - map.put("LoginName",byId == null ? "" : byId.getData().getAccount()); - JSONObject jsonLoginName = new JSONObject(map); - notifyTodoSendContext.setTargets(jsonLoginName.toJSONString()); - notifyTodoSendContext.setUserId(busProcessNew.getUserId()); - notifyTodoSendContexts.add(notifyTodoSendContext); - //每次调用进行循环 - Map ObjectMap = new TreeMap<>(); - map.put("todoId",pId); - map.put("list",notifyTodoSendContexts); - net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(ObjectMap); - log.info("调用MQ数据!!!:"+jsonObject.toString()); - oaService.setTodoDeleteMq(jsonObject.toString()); - }); +// list.forEach(busProcessNew -> { +// NotifyTodoSendContext notifyTodoSendContext = new NotifyTodoSendContext(); +// notifyTodoSendContext.setAppName("SRMS"); +// notifyTodoSendContext.setModelId(busProcessNew.getId()); +// notifyTodoSendContext.setModelName(busProcessNew.getTaskInfo()); +// notifyTodoSendContext.setType("1"); +// notifyTodoSendContext.setOptType("2"); +// Map map = new HashMap<>(); +// ResponseMessage byId = lawsUserInfoService.getById(busProcessNew.getUserId()); +// map.put("LoginName",byId == null ? "" : byId.getData().getAccount()); +// JSONObject jsonLoginName = new JSONObject(map); +// notifyTodoSendContext.setTargets(jsonLoginName.toJSONString()); +// notifyTodoSendContext.setUserId(busProcessNew.getUserId()); +// notifyTodoSendContexts.add(notifyTodoSendContext); +// //循环调用 +// map.put("todoId",pId); +// map.put("list",notifyTodoSendContexts); +// net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(map); +// log.info("调用MQ数据!!!:"+jsonObject.toString()); +// oaService.setTodoDeleteMq(jsonObject.toString()); + + for (BusProcessNew busProcessNew : list) { + NotifyTodoSendContext notifyTodoSendContext = new NotifyTodoSendContext(); + notifyTodoSendContext.setAppName("SRMS"); + notifyTodoSendContext.setModelId(busProcessNew.getId()); + notifyTodoSendContext.setModelName(busProcessNew.getTaskInfo()); + notifyTodoSendContext.setType("1"); + notifyTodoSendContext.setOptType("2"); + Map map = new HashMap<>(); + ResponseMessage byId = lawsUserInfoService.getById(busProcessNew.getUserId()); + map.put("LoginName",byId == null ? "" : byId.getData().getAccount()); + JSONObject jsonLoginName = new JSONObject(map); + notifyTodoSendContext.setTargets(jsonLoginName.toJSONString()); + notifyTodoSendContext.setUserId(busProcessNew.getUserId()); + //notifyTodoSendContexts.add(notifyTodoSendContext); + //循环调用 + map.put("todoId",pId); + map.put("list",notifyTodoSendContext); + net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(map); + log.info("调用MQ数据!!!:"+jsonObject.toString()); + oaService.setTodoDeleteMq(jsonObject.toString()); + } + +// }); } }