From 930427d639e46c152f9b09f0dbc42c33802b5490 Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Tue, 7 Mar 2023 17:49:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xkrs/straw/utils/FirePointPushManager.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/xkrs/straw/utils/FirePointPushManager.java b/src/main/java/com/xkrs/straw/utils/FirePointPushManager.java index fcc8675..57b6728 100644 --- a/src/main/java/com/xkrs/straw/utils/FirePointPushManager.java +++ b/src/main/java/com/xkrs/straw/utils/FirePointPushManager.java @@ -63,7 +63,17 @@ public class FirePointPushManager { telephoneArray[i] = "86" + smsReceiverList.get(i).getUserName(); } int resValue = SMSUtils.sendSmsToUser(telephoneArray, "1425995", new String[]{firePoint.getFirePointAddress()}); - String sendResult = resValue == 0 ? "短信通知发送成功!" : "短信通知发送失败!"; + String sendResult; + if (resValue == 0) { + //联系人列表发送短信成功,在数据库中的已发短信数量字段加一 + for (SysUserEntity smsReceiver : smsReceiverList) { + smsReceiver.setReceiveSmsCount(smsReceiver.getReceiveSmsCount() + 1); + } + sysUserDao.saveAll(smsReceiverList); + sendResult = "短信通知发送成功!"; + } else { + sendResult = "短信通知发送失败!"; + } //记录短信通知日志 StringBuilder stringBuilder = new StringBuilder("发送人:青岛星科瑞升信息科技有限公司\n"); for (String telephone : telephoneArray) {