|
@@ -16,6 +16,7 @@
|
|
|
*/
|
|
|
package org.springblade.control.controller;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import io.swagger.annotations.*;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
@@ -84,13 +85,13 @@ public class DictInfoController extends BladeController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- Long userCount = dictInfoService.getBaseMapper().selectCount(
|
|
|
- Wrappers.<DictInfo>query().lambda()
|
|
|
+ DictInfo dictInfoOne = dictInfoService.getOne(new LambdaQueryWrapper<DictInfo>()
|
|
|
.eq(DictInfo::getDictName, dictInfo.getDictName())
|
|
|
.eq(DictInfo::getType, dictInfo.getType())
|
|
|
.eq(DictInfo::getIsDeleted, 0));
|
|
|
- if(userCount>=1){
|
|
|
- return R.success("数据已存在,请勿重复添加");
|
|
|
+
|
|
|
+ if(dictInfoOne !=null && StringUtil.isNotBlank(dictInfoOne.getId()+"")) {
|
|
|
+ dictInfoOne.setId(dictInfoOne.getId());
|
|
|
}
|
|
|
|
|
|
CacheUtil.clear(DICT_CACHE, Boolean.FALSE);
|