设备编码 没做唯一性校验,可以新增相同编码的设备
This commit is contained in:
chenhaojie 2024-10-17 09:40:59 +08:00
parent 1d42ee709d
commit 7bdfa19716
2 changed files with 2 additions and 2 deletions

View File

@ -34,6 +34,6 @@ public interface SysEquipmentMapper extends BaseMapperPlus<SysEquipment, SysEqui
int queryEquipmentByCode(@Param("code")String code);
SysEquipment queryEquipmentInfoByCode(@Param("code")String code);
SysEquipmentVo queryEquipmentInfoByCode(@Param("code")String code);
}

View File

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