修复了“字典无法给不同字典类型添加或编辑相同字典数据”的bug,现在只有同字典类型且同字典数据才会添加失败。

This commit is contained in:
Guan 2026-03-06 17:00:05 +08:00
parent d85ebeb7f0
commit b02c901180
1 changed files with 2 additions and 0 deletions

View File

@ -165,6 +165,7 @@ public class SettingDictDataServiceImpl implements ISettingDictDataService {
Assert.isNull(dictDataMapper.selectOne(new QueryWrapper<DictData>()
.select("id")
.eq("name", createValidate.getName())
.eq("type_id", createValidate.getTypeId())
.isNull("delete_time")
.last("limit 1")), "字典数据已存在!");
@ -200,6 +201,7 @@ public class SettingDictDataServiceImpl implements ISettingDictDataService {
.select("id")
.ne("id", updateValidate.getId())
.eq("name", updateValidate.getName())
.eq("type_id", updateValidate.getTypeId())
.isNull("delete_time")
.last("limit 1")), "字典数据已存在!");