Commit 29820fe8 authored by fangxinjiang's avatar fangxinjiang

字典更新和新增 调整缓存

parent 9eea297f
......@@ -99,10 +99,12 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
// 系统内置
Assert.state(!DictTypeEnum.SYSTEM.getType().equals(dict.getSystemFlag()),
MsgUtils.getMessage(ErrorCodes.SYS_DICT_UPDATE_SYSTEM));
// 更新字典
extractedRedis(item);
return this.updateById(item);
if (this.updateById(item)){
// 更新字典
extractedRedis(item);
return true;
}
return false;
}
private void extractedRedis(SysDictItem item) {
......@@ -114,12 +116,12 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
@CacheEvict(value = CacheConstants.DICT_DETAILS, allEntries = true)
@Override
public R<Boolean> saveDiy(SysDictItem sysDictItem) {
// 更新字典
extractedRedis(sysDictItem);
int res = baseMapper.insert(sysDictItem);
if (res < 0){
return R.failed();
}
// 更新字典
extractedRedis(sysDictItem);
return R.ok();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment