开关机功能增加设备参数校验
This commit is contained in:
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user