Commit ca014bdba5cbf4e3f428d9ee0a89866f81c6b832

Authored by haohao
1 parent 68437cd8

fix: 【IoT 物联网】修复 IotDeviceServiceImpl 中的更新支持逻辑,确保在不支持更新时抛出异常

yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/device/IotDeviceServiceImpl.java
@@ -382,7 +382,7 @@ public class IotDeviceServiceImpl implements IotDeviceService { @@ -382,7 +382,7 @@ public class IotDeviceServiceImpl implements IotDeviceService {
382 return; 382 return;
383 } 383 }
384 // 2.2.2 如果存在,判断是否允许更新 384 // 2.2.2 如果存在,判断是否允许更新
385 - if (updateSupport) { 385 + if (!updateSupport) {
386 throw exception(DEVICE_KEY_EXISTS); 386 throw exception(DEVICE_KEY_EXISTS);
387 } 387 }
388 updateDevice(new IotDeviceSaveReqVO().setId(existDevice.getId()) 388 updateDevice(new IotDeviceSaveReqVO().setId(existDevice.getId())