Browse Source

# 设备新增时去掉编码验证

zhongwei
haungxing 2 years ago
parent
commit
55881a014f
  1. 2
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java

2
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java

@ -485,10 +485,12 @@ public class EmInfoServiceImpl extends BaseServiceImpl<EmInfoMapper, EmInfoEntit
}); });
} }
// 查询设备编码设备实例是否已存在 // 查询设备编码设备实例是否已存在
if(Func.isNotEmpty(em_info.getInfo().getNumber())) {
R<Boolean> existResult = deviceClient.isDeviceCodeExist(em_info.getInfo().getNumber()); R<Boolean> existResult = deviceClient.isDeviceCodeExist(em_info.getInfo().getNumber());
Assert.isTrue(existResult.isSuccess() && !existResult.getData(),() -> { Assert.isTrue(existResult.isSuccess() && !existResult.getData(),() -> {
throw new ServiceException("该设备编码在设备实例中找到对应记录,保存失败!"); throw new ServiceException("该设备编码在设备实例中找到对应记录,保存失败!");
}); });
}
// 验证设备编号是否已存在 // 验证设备编号是否已存在
EmInfoEntity emInfoEntity = this.baseMapper.selectEmInfoByCode(em_info.getInfo().getNumber()); EmInfoEntity emInfoEntity = this.baseMapper.selectEmInfoByCode(em_info.getInfo().getNumber());
Assert.isTrue(ObjectUtil.isEmpty(emInfoEntity),() -> { Assert.isTrue(ObjectUtil.isEmpty(emInfoEntity),() -> {

Loading…
Cancel
Save