From b24ad49a0043b0e09da4ee56a441102b3705c694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=98=89=E4=BC=9F?= <1724121454@qq.com> Date: Tue, 17 Aug 2021 07:40:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=82=E5=B8=B8=E4=BB=A3=E7=A0=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/AbnormalBillServiceImpl.java | 67 ++++++------------- 1 file changed, 22 insertions(+), 45 deletions(-) diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java index 439be7a4..ccd6611f 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java @@ -237,17 +237,6 @@ public class AbnormalBillServiceImpl extends ServiceImpl status = new ArrayList<>(); -// status.add(Constants.PROGRAM_CONFIRM); -// status.add(Constants.CANCEL); -// status.add(Constants.SHUT_DOWN); -// List abnormalBillList = abnormalBillMapper.findCountBySfc(abnormalBill.getSite(), abnormalBill.getType(), abnormalBill.getSfc(), status); -// if(abnormalBillList.size() >= 1 ){ -// throw BusinessException.build("设备异常有未处理完成的sfc"); -// } -// } abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose); this.saveOrUpdate(abnormalBill); //发送消息 @@ -398,7 +387,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl nwaUsers = nwaUserService.checkUserGroup(site,abnormalMessage.getSendUserGroup()); -// -// StringBuilder sendUsers = new StringBuilder(); -// -// for (int i = 0; i < nwaUsers.size(); i++) { -// if(i == (nwaUsers.size() - 1)){ -// sendUsers.append(nwaUsers.get(i)); -// }else{ -// sendUsers.append(nwaUsers.get(i)).append("|"); -// } -// } -// activeMQUtil.wechatSendMessage(sendUsers.toString(),abnormalMessage.getContent()); -// } + if(!Constants.ABNORMAL_MESSAGE_RESPONSE.equals(abnormalMessage.getNode())){ + List nwaUsers = nwaUserService.checkUserGroup(site,abnormalMessage.getSendUserGroup()); + + StringBuilder sendUsers = new StringBuilder(); + + for (int i = 0; i < nwaUsers.size(); i++) { + if(i == (nwaUsers.size() - 1)){ + sendUsers.append(nwaUsers.get(i)); + }else{ + sendUsers.append(nwaUsers.get(i)).append("|"); + } + } + activeMQUtil.wechatSendMessage(sendUsers.toString(),abnormalMessage.getContent()); + } messageService.saveOrUpdate(abnormalMessage); return true; } - @Override public String formatMessage(AbnormalBill abnormalBill,String messageType, String site) { //找到消息内容