From 31fe793e971cdbac4cb21fbc436d6e49563d6e5e Mon Sep 17 00:00:00 2001 From: zq Date: Thu, 8 Jan 2026 17:16:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=85=B3=E6=9C=BA=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AE=BE=E5=A4=87=E5=8F=82=E6=95=B0=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ems/service/impl/EmsDeviceSettingServiceImpl.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ems-system/src/main/java/com/xzzn/ems/service/impl/EmsDeviceSettingServiceImpl.java b/ems-system/src/main/java/com/xzzn/ems/service/impl/EmsDeviceSettingServiceImpl.java index cc19d4b..546a5fc 100644 --- a/ems-system/src/main/java/com/xzzn/ems/service/impl/EmsDeviceSettingServiceImpl.java +++ b/ems-system/src/main/java/com/xzzn/ems/service/impl/EmsDeviceSettingServiceImpl.java @@ -10,6 +10,7 @@ import com.xzzn.common.core.modbus.domain.DeviceConfig; import com.xzzn.common.core.modbus.domain.WriteTagConfig; import com.xzzn.common.core.redis.RedisCache; import com.xzzn.common.enums.DeviceCategory; +import com.xzzn.common.enums.DeviceType; import com.xzzn.common.enums.PointType; import com.xzzn.common.enums.SiteEnum; import com.xzzn.common.enums.WorkStatus; @@ -523,6 +524,14 @@ public class EmsDeviceSettingServiceImpl implements IEmsDeviceSettingService if (device == null) { throw new ServiceException("未找到对应设备配置信息"); } + if (DeviceType.TCP.name().equals(device.getDeviceType())) { + if (device.getSlaveId() == null) { + throw new ServiceException("设备未配置从站地址"); + } + if (device.getIpPort() == null) { + throw new ServiceException("设备未配置端口号"); + } + } // 查询设备的开关机配置 EmsPcsSetting pcsSetting = emsPcsSettingMapper.selectEmsPcsSettingByDeviceId(device.getId()); if (pcsSetting == null) {