|
@@ -14,6 +14,7 @@ import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.List;
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -49,11 +50,18 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
|
|
|
public List<SysConfig> selectAll() {
|
|
|
List<SysConfig> sysConfigList = null;
|
|
|
try {
|
|
|
+ String platform = System.getProperties().getProperty("os.name");
|
|
|
QueryWrapper<SysConfig> sysConfigQueryWrapper = new QueryWrapper<>();
|
|
|
sysConfigQueryWrapper.lambda().isNull(SysConfig::getSchoolId);
|
|
|
sysConfigList = this.list(sysConfigQueryWrapper);
|
|
|
if (!CollectionUtils.isEmpty(sysConfigList)) {
|
|
|
for (SysConfig s : sysConfigList) {
|
|
|
+ if (s.getConfigKey().contains(SystemConstant.SYS_CONFIG_KEY_CHARSETS) && Objects.nonNull(platform) && platform.contains(SystemConstant.WINDOWS)) {
|
|
|
+ if (!Objects.equals(s.getConfigValue(), SystemConstant.CHARSET_GBK)) {
|
|
|
+ s.setConfigValue(SystemConstant.CHARSET_GBK);
|
|
|
+ this.updateById(s);
|
|
|
+ }
|
|
|
+ }
|
|
|
commonCacheService.updateSysConfigCacheForDb(s.getConfigKey(), s);
|
|
|
}
|
|
|
}
|