优化 普通火点来了只发送微信群通知

This commit is contained in:
liuchengqian 2023-03-05 14:51:51 +08:00
parent 7be85ebda4
commit 070a2e8e22

View File

@ -36,18 +36,18 @@ public class FirePointPushManager {
private PushHelper pushHelper; private PushHelper pushHelper;
public void pushNotification(FirePointOrdinaryEntity firePointOrdinaryEntity) { public void pushNotification(FirePointOrdinaryEntity firePointOrdinaryEntity) {
pushNotification(FirePointConvertUtils.convert(firePointOrdinaryEntity)); pushNotification(FirePointConvertUtils.convert(firePointOrdinaryEntity), false);
} }
public void pushNotification(FirePointPreciseEntity firePointPreciseEntity) { public void pushNotification(FirePointPreciseEntity firePointPreciseEntity) {
pushNotification(FirePointConvertUtils.convert(firePointPreciseEntity)); pushNotification(FirePointConvertUtils.convert(firePointPreciseEntity), true);
} }
private void pushNotification(AllFirePointVo firePoint) { private void pushNotification(AllFirePointVo firePoint, boolean precise) {
//发送微信群聊消息 //发送微信群聊消息
sendWeChatGroupMessage(firePoint); sendWeChatGroupMessage(firePoint);
if ("耕地".equals(firePoint.getLandType())) { if (precise && firePoint.getLandType().contains("耕地")) {
//过滤短信通知收件人 //过滤短信通知收件人
List<SysUserEntity> sysUserList = sysUserDao.findAll(); List<SysUserEntity> sysUserList = sysUserDao.findAll();
List<SysUserEntity> smsReceiverList = FirePointCodeUtils.filterSmsReceiver(firePoint.getTownCode(), sysUserList); List<SysUserEntity> smsReceiverList = FirePointCodeUtils.filterSmsReceiver(firePoint.getTownCode(), sysUserList);
@ -61,6 +61,7 @@ public class FirePointPushManager {
//分发短信通知 //分发短信通知
smsHelper.dispatchSMSMessage(smsReceiverList, new String[]{firePoint.getFirePointAddress()}, new AllFirePointVo[]{firePoint}); smsHelper.dispatchSMSMessage(smsReceiverList, new String[]{firePoint.getFirePointAddress()}, new AllFirePointVo[]{firePoint});
} }
} }