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

2.X
疯狂的狮子Li 2 years ago
parent 8503c44602
commit 8030d1bd62

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

Loading…
Cancel
Save