优化 全国火系统不发短信

This commit is contained in:
liuchengqian 2023-03-08 10:17:34 +08:00
parent d841701650
commit e3ab65e0dd

View File

@ -3,7 +3,9 @@ package com.xkrs.service.impl;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.xkrs.common.encapsulation.PromptMessageEnum; import com.xkrs.common.encapsulation.PromptMessageEnum;
import com.xkrs.dao.*; import com.xkrs.dao.*;
import com.xkrs.model.entity.*; import com.xkrs.model.entity.CountyCodeWeiXinEntity;
import com.xkrs.model.entity.FirePointEntity;
import com.xkrs.model.entity.ShanDongFirePointEntity;
import com.xkrs.model.qo.FirePointQo; import com.xkrs.model.qo.FirePointQo;
import com.xkrs.model.vo.GaoDeIgGeocodeVo; import com.xkrs.model.vo.GaoDeIgGeocodeVo;
import com.xkrs.service.FirePointService; import com.xkrs.service.FirePointService;
@ -248,25 +250,25 @@ public class FirePointServiceImpl implements FirePointService {
//发送微信群聊消息 //发送微信群聊消息
sendWeChatGroupMessage(firePointEntity); sendWeChatGroupMessage(firePointEntity);
if ("耕地".equals(firePointEntity.getLandType())) { // if ("耕地".equals(firePointEntity.getLandType())) {
//过滤短信通知收件人 // //过滤短信通知收件人
List<SysUserEntity> sysUserList = sysUserDao.findAll(); // List<SysUserEntity> sysUserList = sysUserDao.findAll();
boolean normalSmsEnable = 1L == globalConfigService.selectGlobalConfigValue(9L); // boolean normalSmsEnable = 1L == globalConfigService.selectGlobalConfigValue(9L);
boolean vipSmsEnable = 1L == globalConfigService.selectGlobalConfigValue(10L); // boolean vipSmsEnable = 1L == globalConfigService.selectGlobalConfigValue(10L);
List<SysUserEntity> smsReceiverList = FirePointCodeUtils.filterSmsReceiver(firePointEntity.getStreetCode(), sysUserList, normalSmsEnable, vipSmsEnable); // List<SysUserEntity> smsReceiverList = FirePointCodeUtils.filterSmsReceiver(firePointEntity.getStreetCode(), sysUserList, normalSmsEnable, vipSmsEnable);
// //推送 //// //推送
// try { //// try {
// List<String> userAccountList = pushHelper.obtainUserAccountList(smsReceiverList); //// List<String> userAccountList = pushHelper.obtainUserAccountList(smsReceiverList);
// pushHelper.dispatchPushMessage(userAccountList, firePointEntity); //// pushHelper.dispatchPushMessage(userAccountList, firePointEntity);
// } catch (Exception e) { //// } catch (Exception e) {
// e.printStackTrace(); //// e.printStackTrace();
//// }
// //对短信通知收件人进行分组
// List<AgentOrgEntity> agentOrgList = agentOrgDao.findAll();
// Map<String, List<SysUserEntity>> agentOrgNameGroupMap = FirePointCodeUtils.groupSmsReceiver(smsReceiverList, agentOrgList);
// //分发短信通知
// smsHelper.dispatchSMSMessage(agentOrgNameGroupMap, new String[]{firePointEntity.getFirePointAddress()}, new FirePointEntity[]{firePointEntity});
// } // }
//对短信通知收件人进行分组
List<AgentOrgEntity> agentOrgList = agentOrgDao.findAll();
Map<String, List<SysUserEntity>> agentOrgNameGroupMap = FirePointCodeUtils.groupSmsReceiver(smsReceiverList, agentOrgList);
//分发短信通知
smsHelper.dispatchSMSMessage(agentOrgNameGroupMap, new String[]{firePointEntity.getFirePointAddress()}, new FirePointEntity[]{firePointEntity});
}
} }
/** /**