Browse Source

告警短信推送指定用户,微信公众号推送模板更改

zhongwei
ty 7 months ago
parent
commit
18de968416
  1. 12
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/MessageServiceImpl.java

12
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/MessageServiceImpl.java

@ -108,7 +108,7 @@ public class MessageServiceImpl implements MessageService {
// }
//写死传给固定用户
// List<String> phoneList=Arrays.asList("18351807087","18163793336","13725599914");
List<String> phoneList=Arrays.asList("18351807087","18163793336");
List<String> phoneList=Arrays.asList("18351807087","18163793336","18285121497");
for (String phone : phoneList) {
R<UserInfo> userByPhone = userClient.getUserByPhone("200000", phone);
if (userByPhone.isSuccess()&&ObjectUtils.isNotEmpty(userByPhone.getData())){
@ -157,9 +157,9 @@ public class MessageServiceImpl implements MessageService {
}
WxMessageDTO message = new WxMessageDTO();
// 模板Id
message.setTemplateId("Ce2YAZtX0UyoNrAag6CANtC8XQeLuil7domvJrUivhM");
// 微信消息跳转地址
message.setSkipUrl("http://baidu.com");
message.setTemplateId("hIgINCsjpG-gyCKh8wzwBeRL9tanTLqRDgv-X8B9vyc");
// // 微信消息跳转地址
// message.setSkipUrl("http://baidu.com");
// 机构Id
message.setDeptId(result.getData().get(0).getId());
// 业务关键字
@ -171,10 +171,10 @@ public class MessageServiceImpl implements MessageService {
// 微信参数键值对
HashMap<String,Object> map = new HashMap<>();
map.put("thing18",entity.getStationName());
map.put("thing5",Optional.ofNullable(entity.getDeviceCode()).orElse("未知设备"));
// map.put("thing5",Optional.ofNullable(entity.getDeviceCode()).orElse("未知设备"));
map.put("thing11",entity.getAlarmContext());
map.put("thing14", DictCache.getValue("alarm_source", entity.getAlarmSource()));
map.put("time2",entity.getAlarmTime());
map.put("thing14", DictCache.getValue("alarm_source", entity.getAlarmSource()));
message.setMap(map);
// 消息内容
message.setContent(entity.getAlarmContext());

Loading…
Cancel
Save