Browse Source

# 设备新增时名称唯一性校验bug

zhongwei
haungxing 2 years ago
parent
commit
849cb6553d
  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

@ -472,7 +472,7 @@ public class EmInfoServiceImpl extends BaseServiceImpl<EmInfoMapper, EmInfoEntit
private void validEmInfo(EmInfoAddVo em_info) { private void validEmInfo(EmInfoAddVo em_info) {
// 验证设备名称 // 验证设备名称
List<EmInfoEntity> existName = this.list( List<EmInfoEntity> existName = this.list(
Wrappers.<EmInfoEntity>lambdaQuery().eq(EmInfoEntity::getName, em_info.getInfo().getName()) Wrappers.<EmInfoEntity>lambdaQuery().eq(EmInfoEntity::getName, em_info.getInfo().getName()).eq(EmInfoEntity::getDepartment, em_info.getInfo().getDepartment())
); );
Assert.isTrue(CollectionUtil.isEmpty(existName),()-> { Assert.isTrue(CollectionUtil.isEmpty(existName),()-> {
throw new ServiceException("设备名称已存在"); throw new ServiceException("设备名称已存在");

Loading…
Cancel
Save