瀏覽代碼

编码分类处理

lipenghui 6 天之前
父節點
當前提交
036943949a

+ 4 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/IotDeviceServiceImpl.java

@@ -299,6 +299,10 @@ public class IotDeviceServiceImpl implements IotDeviceService {
         if (CollUtil.isNotEmpty(iotDeviceDOS)) {
             throw new ServiceException(IOT_DEVICE_EXISTED);
         }
+        List<IotDeviceDO> iotDeviceDOSS = iotDeviceMapper.selectList("yf_device_code", createReqVO.getYfDeviceCode());
+        if (CollUtil.isNotEmpty(iotDeviceDOSS)) {
+            throw new ServiceException(IOT_DEVICE_EXISTED);
+        }
         // 插入
         IotDeviceDO iotDevice = BeanUtils.toBean(createReqVO, IotDeviceDO.class);
         iotDevice.setSortColumn(NumberUtils.extractNumber(iotDevice.getDeviceCode()));