润阳项目

新增相关字段和判断
This commit is contained in:
chenhaojie 2024-10-18 13:16:50 +08:00
parent 81b850522d
commit db405cb285

View File

@ -83,8 +83,11 @@ public class SysIotModelServiceImpl implements SysIotModelService {
SysUserVo sysUserVo = (SysUserVo) StpUtil.getTokenSession().get(SessionUtil.SESSION_USER_KEY);
SysIotModelVo sysIotModelQuery = sysIotModelMapper.selectIotModelByCode(sysIotModelDto.getIotModelCode());
if (!(Long.valueOf(sysIotModelQuery.getId()) == Long.valueOf(sysIotModelDto.getId())) && !(sysIotModelQuery == null)) {
throw new ServiceException("物模型code已经存在");
if (!(sysIotModelQuery == null)){
if(!(sysIotModelQuery.getId().equals(sysIotModelDto.getId()))){
throw new ServiceException("物模型code已经存在");
}
}
sysIotModel.setUpdatedTime(new Date());
sysIotModel.setUpdatedBy(sysUserVo.getAccount());