From 55dbe6569bf597450b18dc21d22a1a9219b361fe Mon Sep 17 00:00:00 2001 From: ty <1577900710@qq.com> Date: Fri, 15 Mar 2024 16:51:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E4=B8=AD=E5=BF=83-=E7=9F=AD?= =?UTF-8?q?=E4=BF=A1=E5=A4=9A=E4=BA=BA=E6=8E=A8=E9=80=81-=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0param=E5=AD=97=E6=95=B0=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/hnac/hzims/message/fegin/MessageClient.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java index 0dcf5c5..8918d39 100644 --- a/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java +++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java @@ -184,6 +184,9 @@ public class MessageClient extends BladeController implements IMessageClient{ record.setMessageId(IdWorker.getId()); for (Long pushId : Func.toLongList(",", smsImmediatelyPushDTO.getPusher())) { User user = UserCache.getUser(pushId); + if (ObjectUtil.isEmpty(user)||ObjectUtil.isEmpty(user.getPhone())){ + continue; + } record.setPusherName(user.getName()); record.setPusher(pushId.toString()); record.setPushType(MessageConstants.IMMEDIATELY); @@ -195,14 +198,13 @@ public class MessageClient extends BladeController implements IMessageClient{ record.setStatus(MessageConstants.NOT_PUSH); Map params = smsImmediatelyPushDTO.getParams(); int maxSize=35; - params.put("ruleDefName",getTruncateString(params.get("ruleDefName"), maxSize)); - params.put("projectName",getTruncateString(params.get("projectName"), maxSize)); - params.put("deviceName",getTruncateString(params.get("deviceName"), maxSize)); + for (Map.Entry stringStringEntry : params.entrySet()) { + params.put(stringStringEntry.getKey(),getTruncateString(stringStringEntry.getValue(), maxSize)); + } record.setSmsParam(JSON.toJSONString(params)); Boolean flag = recordService.sendSmsImmediatelyMsg(record); if (!flag) { log.error("短信推送失败,参数:" + record.toString()); - return R.data(false); } } return R.data(true);