diff --git a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java index 30995ae..58e7e8c 100644 --- a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java @@ -370,7 +370,7 @@ public class FirePointServiceImpl implements FirePointService { List agentOrgList = agentOrgDao.findAll(); Map> agentOrgNameGroupMap = FirePointCodeUtils.groupSmsReceiver(smsReceiverList, agentOrgList); //分发短信通知 - smsHelper.dispatchSMSMessage(agentOrgNameGroupMap, new String[]{firePointEntity.getFirePointAddress()}); + smsHelper.dispatchSMSMessage(agentOrgNameGroupMap, new String[]{firePointEntity.getFirePointAddress()}, new FirePointEntity[]{firePointEntity}); } /** diff --git a/src/main/java/com/xkrs/sms/SMSHelper.java b/src/main/java/com/xkrs/sms/SMSHelper.java index 8bc92b7..7eb1119 100644 --- a/src/main/java/com/xkrs/sms/SMSHelper.java +++ b/src/main/java/com/xkrs/sms/SMSHelper.java @@ -2,6 +2,7 @@ package com.xkrs.sms; import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse; import com.fasterxml.jackson.databind.ObjectMapper; +import com.xkrs.model.entity.FirePointEntity; import com.xkrs.model.entity.SysUserEntity; import com.xkrs.utils.AliYunSmsUtils; import com.xkrs.utils.HttpClientUtils; @@ -22,7 +23,7 @@ public class SMSHelper { public SMSHelper() { } - public void dispatchSMSMessage(Map> agentOrgNameGroupMap, String[] templateParamArray) { + public void dispatchSMSMessage(Map> agentOrgNameGroupMap, String[] templateParamArray, FirePointEntity[] detailParamArray) { for (Map.Entry> entry : agentOrgNameGroupMap.entrySet()) { String targetAgentOrgName = entry.getKey(); List groupSmsReceiverList = entry.getValue(); @@ -33,12 +34,12 @@ public class SMSHelper { } if ("青岛星科瑞升信息科技有限公司".equals(targetAgentOrgName)) { - xingkeSMSMessage(telephoneArray, templateParamArray); + xingkeSMSMessage(telephoneArray, templateParamArray, detailParamArray); } else if ("青岛华正信息技术股份有限公司".equals(targetAgentOrgName)) { try { - huazhengSMSMessage(telephoneArray, templateParamArray); + huazhengSMSMessage(telephoneArray, templateParamArray, detailParamArray); } catch (Exception e) { e.printStackTrace(); } @@ -51,7 +52,7 @@ public class SMSHelper { /** * 星科瑞升向用户发送短信 */ - private void xingkeSMSMessage(String[] telephoneArray, String[] templateParamArray) { + private void xingkeSMSMessage(String[] telephoneArray, String[] templateParamArray, FirePointEntity[] detailParamArray) { int resValue = SMSUtils.sendSmsToUser(telephoneArray, "1425995", templateParamArray); String sendResult = resValue == 0 ? "短信通知发送成功!" : "短信通知发送失败!"; //记录短信通知日志 @@ -62,6 +63,9 @@ public class SMSHelper { for (String templateParam : templateParamArray) { stringBuilder.append("模板参数:").append(templateParam).append("\n"); } + for (FirePointEntity detailParam : detailParamArray) { + stringBuilder.append("超级详细的参数:").append(detailParam.toString()).append("\n"); + } stringBuilder.append(sendResult); log.info(stringBuilder.toString()); } @@ -69,7 +73,7 @@ public class SMSHelper { /** * 华正信息向用户发送短信 */ - private void huazhengSMSMessage(String[] telephoneArray, String[] templateParamArray) throws Exception { + private void huazhengSMSMessage(String[] telephoneArray, String[] templateParamArray, FirePointEntity[] detailParamArray) throws Exception { StringBuilder telephoneBuilder = new StringBuilder(); for (int i = 0; i < telephoneArray.length; i++) { telephoneBuilder.append(telephoneArray[i]); @@ -93,6 +97,9 @@ public class SMSHelper { for (String templateParam : templateParamArray) { stringBuilder.append("模板参数:").append(templateParam).append("\n"); } + for (FirePointEntity detailParam : detailParamArray) { + stringBuilder.append("超级详细的参数:").append(detailParam.toString()).append("\n"); + } log.info(stringBuilder.toString()); }