润阳项目

新增相关字段和判断
This commit is contained in:
chenhaojie 2024-10-18 13:20:05 +08:00
parent f0aa4ec5ac
commit 225f5d2d81

View File

@ -85,9 +85,12 @@ public class SysIotModelServiceImpl implements SysIotModelService {
SysIotModelVo sysIotModelQuery = sysIotModelMapper.selectIotModelByCode(sysIotModelDto.getIotModelCode());
if (!(sysIotModelQuery == null)){
if(!(sysIotModelQuery.getId().equals(sysIotModelDto.getId()))){
throw new ServiceException("物模型code已经存在");
throw new ServiceException("物模型code已经存在");
}
}
SysIotModel oldSysIotModel = sysIotModelMapper.selectById(sysIotModelDto.getId());
if(!sysIotModelDto.getIotModelCode().equals(oldSysIotModel.getIotModelCode())) {
throw new ServiceException("物模型code不能修改");
}
sysIotModel.setUpdatedTime(new Date());
sysIotModel.setUpdatedBy(sysUserVo.getAccount());