fix 修复 根据key更新参数配置报null问题

This commit is contained in:
疯狂的狮子Li
2022-12-21 21:34:29 +08:00
parent 8503c44602
commit 8030d1bd62

View File

@@ -117,12 +117,12 @@ public class SysConfigServiceImpl implements ISysConfigService {
@CachePut(cacheNames = CacheNames.SYS_CONFIG, key = "#config.configKey")
@Override
public String updateConfig(SysConfig config) {
SysConfig temp = baseMapper.selectById(config.getConfigId());
if (!StringUtils.equals(temp.getConfigKey(), config.getConfigKey())) {
CacheUtils.evict(CacheNames.SYS_CONFIG, temp.getConfigKey());
}
int row = 0;
if (config.getConfigId() != null) {
SysConfig temp = baseMapper.selectById(config.getConfigId());
if (!StringUtils.equals(temp.getConfigKey(), config.getConfigKey())) {
CacheUtils.evict(CacheNames.SYS_CONFIG, temp.getConfigKey());
}
row = baseMapper.updateById(config);
} else {
row = baseMapper.update(config, new LambdaQueryWrapper<SysConfig>()