Commit 29820fe8 authored by fangxinjiang's avatar fangxinjiang

字典更新和新增 调整缓存

parent 9eea297f
...@@ -99,10 +99,12 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi ...@@ -99,10 +99,12 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
// 系统内置 // 系统内置
Assert.state(!DictTypeEnum.SYSTEM.getType().equals(dict.getSystemFlag()), Assert.state(!DictTypeEnum.SYSTEM.getType().equals(dict.getSystemFlag()),
MsgUtils.getMessage(ErrorCodes.SYS_DICT_UPDATE_SYSTEM)); MsgUtils.getMessage(ErrorCodes.SYS_DICT_UPDATE_SYSTEM));
// 更新字典 if (this.updateById(item)){
extractedRedis(item); // 更新字典
extractedRedis(item);
return this.updateById(item); return true;
}
return false;
} }
private void extractedRedis(SysDictItem item) { private void extractedRedis(SysDictItem item) {
...@@ -114,12 +116,12 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi ...@@ -114,12 +116,12 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
@CacheEvict(value = CacheConstants.DICT_DETAILS, allEntries = true) @CacheEvict(value = CacheConstants.DICT_DETAILS, allEntries = true)
@Override @Override
public R<Boolean> saveDiy(SysDictItem sysDictItem) { public R<Boolean> saveDiy(SysDictItem sysDictItem) {
// 更新字典
extractedRedis(sysDictItem);
int res = baseMapper.insert(sysDictItem); int res = baseMapper.insert(sysDictItem);
if (res < 0){ if (res < 0){
return R.failed(); return R.failed();
} }
// 更新字典
extractedRedis(sysDictItem);
return R.ok(); 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