From 55881a014fb2ebe0d58484145b432e52d85fef51 Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Mon, 10 Apr 2023 11:24:58 +0800 Subject: [PATCH] =?UTF-8?q?#=20=E8=AE=BE=E5=A4=87=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=97=B6=E5=8E=BB=E6=8E=89=E7=BC=96=E7=A0=81=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java index 7551fd2..15c0e39 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java @@ -485,10 +485,12 @@ public class EmInfoServiceImpl extends BaseServiceImpl existResult = deviceClient.isDeviceCodeExist(em_info.getInfo().getNumber()); - Assert.isTrue(existResult.isSuccess() && !existResult.getData(),() -> { - throw new ServiceException("该设备编码在设备实例中找到对应记录,保存失败!"); - }); + if(Func.isNotEmpty(em_info.getInfo().getNumber())) { + R existResult = deviceClient.isDeviceCodeExist(em_info.getInfo().getNumber()); + Assert.isTrue(existResult.isSuccess() && !existResult.getData(),() -> { + throw new ServiceException("该设备编码在设备实例中找到对应记录,保存失败!"); + }); + } // 验证设备编号是否已存在 EmInfoEntity emInfoEntity = this.baseMapper.selectEmInfoByCode(em_info.getInfo().getNumber()); Assert.isTrue(ObjectUtil.isEmpty(emInfoEntity),() -> {