调整字典类型新增校验

This commit is contained in:
TinyAnts 2022-08-12 17:45:08 +08:00
parent 3b628d4450
commit b422110c3c
1 changed files with 11 additions and 1 deletions

View File

@ -131,6 +131,11 @@ public class SettingDictTypeServiceImpl implements ISettingDictTypeService {
Assert.isNull(dictTypeMapper.selectOne(new QueryWrapper<DictType>()
.select("id")
.eq("dict_name", dictTypeParam.getDictName())
.eq("is_delete", 0)
.last("limit 1")), "字典名称已存在!");
Assert.isNull(dictTypeMapper.selectOne(new QueryWrapper<DictType>()
.select("id")
.eq("dict_type", dictTypeParam.getDictType())
.eq("is_delete", 0)
.last("limit 1")), "字典类型已存在!");
@ -163,6 +168,11 @@ public class SettingDictTypeServiceImpl implements ISettingDictTypeService {
Assert.isNull(dictTypeMapper.selectOne(new QueryWrapper<DictType>()
.ne("id", dictTypeParam.getId())
.eq("dict_name", dictTypeParam.getDictName())
.eq("is_delete", 0)
.last("limit 1")), "字典类型已存在!");
Assert.isNull(dictTypeMapper.selectOne(new QueryWrapper<DictType>()
.ne("id", dictTypeParam.getId())
.eq("dict_type", dictTypeParam.getDictType())
.eq("is_delete", 0)
.last("limit 1")), "字典类型已存在!");