From 0b006725bdd0490c38aef3c8f5e9b1229c67b9b9 Mon Sep 17 00:00:00 2001 From: tianyongbao Date: Sat, 4 Apr 2026 00:29:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AD=90=E8=B4=A6=E5=8F=B7=E6=8A=A5?= =?UTF-8?q?=E8=AD=A6:=20....=E6=82=A8=E7=9A=84xxx=E5=A1=98=E5=8F=A3?= =?UTF-8?q?=EF=BC=8C=20=20=E8=AE=BE=E5=A4=87=E8=AE=BE=E5=A4=87=20=EF=BC=8C?= =?UTF-8?q?=20=20xxx=E5=BC=82=E5=B8=B8...=E3=80=82bug=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WarnCallNoticeServiceImpl.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/intc-modules/intc-iot/src/main/java/com/intc/iot/service/impl/WarnCallNoticeServiceImpl.java b/intc-modules/intc-iot/src/main/java/com/intc/iot/service/impl/WarnCallNoticeServiceImpl.java index 4f58d00..833fea6 100644 --- a/intc-modules/intc-iot/src/main/java/com/intc/iot/service/impl/WarnCallNoticeServiceImpl.java +++ b/intc-modules/intc-iot/src/main/java/com/intc/iot/service/impl/WarnCallNoticeServiceImpl.java @@ -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 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();