|
|
|
@@ -396,7 +396,7 @@ public class DmDigitalmanController extends BaseController<DmDigitalmanQuery, Dm |
|
|
|
for (SysDictDataDto dictDataDto : dictDataDtos) { |
|
|
|
if (StringUtils.equals(type,dictDataDto.getValue())) { |
|
|
|
String dingTalkTimestamp = (String) redisTemplate.opsForValue().get("exceptionLog:dingTalk:" + devId + ":" + type); |
|
|
|
if (!StringUtils.isEmpty(dingTalkTimestamp) && System.currentTimeMillis() - Long.parseLong(dingTalkTimestamp) > 10 * 60 * 1000) { |
|
|
|
if (!redisTemplate.hasKey("exceptionLog:dingTalk:" + devId + ":" + type)) { |
|
|
|
//设置当前时间格式为yyyy-MM-dd HH:mm:ss |
|
|
|
LocalDateTime localDateTime = LocalDateTime.now(); |
|
|
|
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
|
|
|
@@ -408,9 +408,9 @@ public class DmDigitalmanController extends BaseController<DmDigitalmanQuery, Dm |
|
|
|
jo.put("content", "【客户】:" + devicePo.getTenantName() + "\n【设备号】:" + devId + "\n【类型】:" + dictDataDto.getLabel() + "\n【发生时间】:" + format + "\n【报警等级】"+ level +"\n请尽快排查原因,并在运维端解除预警状态。"); |
|
|
|
entity.setText(jo); |
|
|
|
remoteDingdingService.send(token, entity); |
|
|
|
// 更新缓存 |
|
|
|
redisTemplate.opsForValue().set("exceptionLog:dingTalk:" + devId + ":" + type, System.currentTimeMillis() + "",10, TimeUnit.MINUTES); |
|
|
|
} |
|
|
|
// 更新缓存 |
|
|
|
redisTemplate.opsForValue().set("exceptionLog:dingTalk:" + devId + ":" + type, System.currentTimeMillis() + ""); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|