revert: 回滚校验字典code代码修改

This commit is contained in:
Kang_Yang committed 2024-11-07 14:19:31 +08:00
1 parent 8b4fcfe4ca
commit 5639c8b800
3 files changed
+3 -19

No files matched your search

@@ -36,14 +36,6 @@ public interface DictMapper extends BaseMapper<Dict> {
*/
List<DictVO> getAllDictWithData();
/**
* 获取指定字典编码对应的的数量
*
* @param dictCode 字典编码
* @return
*/
long getDictCodeCount(String dictCode);
}
@@ -67,7 +67,9 @@ public class DictServiceImpl extends ServiceImpl<DictMapper, Dict> implements Di
// 校验 code 是否唯一
String dictCode = entity.getDictCode();
long count = this.baseMapper.getDictCodeCount(dictCode);
long count = this.count(new LambdaQueryWrapper<Dict>()
.eq(Dict::getDictCode, dictCode)
);
Assert.isTrue(count == 0, "字典编码已存在");