From dd3914887425f2d5964c1e06e37a74f165505247 Mon Sep 17 00:00:00 2001 From: wulin Date: Mon, 23 Nov 2020 11:24:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BE=85=E5=8A=9E=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=E5=8F=91=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../job/business/DingtalkBusiness.java | 45 +++++++++---------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java b/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java index d607ce57..2ac98221 100644 --- a/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java +++ b/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java @@ -270,32 +270,31 @@ public class DingtalkBusiness { public String sendWorkMSGWithAsyn(StaffSimpleInfo fromStaff, List toStaffids, int type) { - if(toStaffids != null && toStaffids.size() > 0){ - if (toStaffids.get(0).getEmployeeId() == null || toStaffids.get(0).getEmployeeId().length() == 0) { - //查询第三方id - List ids = toStaffids.stream().map(new Function() { - @Override - public Long apply(StaffSimpleInfo staffSimpleInfo) { - return staffSimpleInfo.getId(); - } - }).collect(Collectors.toList()); - List staffSimpleInfos = staffService.selectStaffSimpleInfos(ids); - Map map = toStaffids.stream().collect(Collectors.toMap(StaffSimpleInfo::getId, e -> e)); - for (StaffSimpleInfo staff : staffSimpleInfos - ) { - StaffSimpleInfo staff1 = map.get(staff.getId()); - staff1.setEmployeeId(staff1.getEmployeeId()); + + if (toStaffids != null && toStaffids.size() > 0 && (toStaffids.get(0).getEmployeeId() == null || toStaffids.get(0).getEmployeeId().length() == 0)) { + //查询第三方id + List ids = toStaffids.stream().map(new Function() { + @Override + public Long apply(StaffSimpleInfo staffSimpleInfo) { + return staffSimpleInfo.getId(); } + }).collect(Collectors.toList()); + List staffSimpleInfos = staffService.selectStaffSimpleInfos(ids); + Map map = toStaffids.stream().collect(Collectors.toMap(StaffSimpleInfo::getId, e -> e)); + for (StaffSimpleInfo staff : staffSimpleInfos + ) { + StaffSimpleInfo staff1 = map.get(staff.getId()); + staff1.setEmployeeId(staff1.getEmployeeId()); } - WorkMsgTypeEnum workMsgTypeEnum = WorkMsgTypeEnum.findRoleTypeByCode(type); - - ThreadSendMessage threadSendMessage = new ThreadSendMessage(fromStaff, toStaffids, workMsgTypeEnum, appid); - Thread thread = new Thread(threadSendMessage); - thread.start(); - - return "OK"; } - return "error"; + WorkMsgTypeEnum workMsgTypeEnum = WorkMsgTypeEnum.findRoleTypeByCode(type); + + ThreadSendMessage threadSendMessage = new ThreadSendMessage(fromStaff, toStaffids, workMsgTypeEnum, appid); + Thread thread = new Thread(threadSendMessage); + thread.start(); + + return "OK"; + }