fix:数据字典(一级),修复无法新增已删除字典Bug

This commit is contained in:
2023-05-06 11:11:33 +08:00
parent 9e1341867d
commit 60913300d4
@@ -90,12 +90,14 @@ public class DictServiceImpl extends ServiceImpl<DictDao, DictEntity>
@Override
public ResponseMessage add(DictVo dictVo) {
//判断字典名是否重复
Integer dicNameCount = query().eq("dic_name", dictVo.getDicName()).count();
Integer dicNameCount = query().eq("dic_name", dictVo.getDicName())
.eq("del_flag", 0).count();
if (dicNameCount > 0) {
return Result.error("字典名重复");
}
//判断字典编码是否重复
Integer dicCodeCount = query().eq("dic_code", dictVo.getDicCode()).count();
Integer dicCodeCount = query().eq("dic_code", dictVo.getDicCode())
.eq("del_flag", 0).count();
if (dicCodeCount > 0) {
return Result.error("字典编码重复");
}