去除字典重复校验
This commit is contained in:
@@ -61,11 +61,11 @@ public class DictDataController extends BaseController {
|
||||
.eq(DictData::getDictDataName, dictData.getDictDataName())) > 0) {
|
||||
return fail("字典数据名称已存在");
|
||||
}
|
||||
if (dictDataService.count(new LambdaQueryWrapper<DictData>()
|
||||
.eq(DictData::getDictId, dictData.getDictId())
|
||||
.eq(DictData::getDictDataCode, dictData.getDictDataCode())) > 0) {
|
||||
return fail("字典数据标识已存在");
|
||||
}
|
||||
// if (dictDataService.count(new LambdaQueryWrapper<DictData>()
|
||||
// .eq(DictData::getDictId, dictData.getDictId())
|
||||
// .eq(DictData::getDictDataCode, dictData.getDictDataCode())) > 0) {
|
||||
// return fail("字典数据标识已存在");
|
||||
// }
|
||||
// 自动添加字典
|
||||
final int count = dictService.count(new LambdaQueryWrapper<Dict>().eq(Dict::getDictCode, dictData.getDictCode()));
|
||||
if (dictData.getDictCode() != null && count == 0) {
|
||||
@@ -95,12 +95,12 @@ public class DictDataController extends BaseController {
|
||||
.ne(DictData::getDictDataId, dictData.getDictDataId())) > 0) {
|
||||
return fail("字典数据名称已存在");
|
||||
}
|
||||
if (dictDataService.count(new LambdaQueryWrapper<DictData>()
|
||||
.eq(DictData::getDictId, dictData.getDictId())
|
||||
.eq(DictData::getDictDataCode, dictData.getDictDataCode())
|
||||
.ne(DictData::getDictDataId, dictData.getDictDataId())) > 0) {
|
||||
return fail("字典数据标识已存在");
|
||||
}
|
||||
// if (dictDataService.count(new LambdaQueryWrapper<DictData>()
|
||||
// .eq(DictData::getDictId, dictData.getDictId())
|
||||
// .eq(DictData::getDictDataCode, dictData.getDictDataCode())
|
||||
// .ne(DictData::getDictDataId, dictData.getDictDataId())) > 0) {
|
||||
// return fail("字典数据标识已存在");
|
||||
// }
|
||||
if (dictDataService.updateById(dictData)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user