fix: 子账号报警: ....您的xxx塘口, 设备设备 , xxx异常...。bug修复。
This commit is contained in:
@@ -2,6 +2,8 @@ package com.intc.iot.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.intc.fishery.domain.Device;
|
||||
import com.intc.fishery.mapper.DeviceMapper;
|
||||
import com.intc.iot.domain.AquWarnCallNotice;
|
||||
import com.intc.iot.domain.VmsCallback;
|
||||
import com.intc.iot.domain.VmsNoticeResponse;
|
||||
@@ -35,6 +37,7 @@ public class WarnCallNoticeServiceImpl implements WarnCallNoticeService {
|
||||
private final AquWarnCallNoticeMapper warnCallNoticeMapper;
|
||||
private final VmsCallbackMapper vmsCallbackMapper;
|
||||
private final VmsNoticeService vmsNoticeService;
|
||||
private final DeviceMapper deviceMapper;
|
||||
|
||||
/**
|
||||
* 呼叫状态枚举(对应 C# EnumCallNoticeStatus)
|
||||
@@ -255,10 +258,19 @@ public class WarnCallNoticeServiceImpl implements WarnCallNoticeService {
|
||||
String rawMessage = warnCallNoticeMapper.selectWarnMessageByCallNoticeId(notice.getId());
|
||||
String warnMessageShort = parseWarnMessageShort(rawMessage);
|
||||
|
||||
// 通过 deviceId 查询设备名称
|
||||
String deviceName = null;
|
||||
if (notice.getDeviceId() != null) {
|
||||
Device device = deviceMapper.selectById(notice.getDeviceId());
|
||||
if (device != null) {
|
||||
deviceName = device.getDeviceName() != null ? device.getDeviceName() : device.getSerialNum();
|
||||
}
|
||||
}
|
||||
|
||||
// 构建 TTS 参数
|
||||
Map<String, String> ttsParams = new HashMap<>();
|
||||
ttsParams.put("pondName", notice.getPondName() != null ? notice.getPondName() : "未知塘口");
|
||||
ttsParams.put("deviceName", "设备");
|
||||
ttsParams.put("deviceName", deviceName != null ? deviceName : "未知设备");
|
||||
ttsParams.put("warnMessage", warnMessageShort);
|
||||
|
||||
String outId = "ALARM_" + notice.getId() + "_" + System.currentTimeMillis();
|
||||
|
||||
Reference in New Issue
Block a user