设备修改校验code修改

This commit is contained in:
huguanghan 2024-11-25 11:31:59 +08:00
parent fa02fe3406
commit 10ca189479

View File

@ -98,7 +98,7 @@ public class SysEquipmentServiceImpl implements SysEquipmentService {
SysUserVo sysUserVo = (SysUserVo) StpUtil.getTokenSession().get(SessionUtil.SESSION_USER_KEY);
SysEquipmentVo oldSysEquipment = sysEquipmentMapper.queryEquipmentInfoByCode(sysEquipmentDto.getCode());
// 判断设备编码是否存在
if (sysEquipmentMapper.queryEquipmentByCode(sysEquipment.getCode()) > 0) {
if (oldSysEquipment != null && sysEquipmentMapper.queryEquipmentByCode(sysEquipment.getCode()) > 0) {
if (!oldSysEquipment.getId().equals(sysEquipmentDto.getId())) {
throw new RuntimeException("设备编码已存在");
}