|
|
@ -26,6 +26,7 @@ import io.swagger.annotations.ApiOperation;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
@ -186,6 +187,45 @@ public class SysConfigController extends CoreBaseController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 系统参数
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param configs 系统参数集合
|
|
|
|
|
|
|
|
* @return 处理结果
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@PostMapping(value = "/update-batch-value")
|
|
|
|
|
|
|
|
@ApiOperation(value = "修改系统参数内容", notes = "修改系统参数内容")
|
|
|
|
|
|
|
|
public ResultBean updateBatchSysConfigValue(@RequestBody List<SysConfig> configs) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
if (CollectionUtils.isEmpty(configs)) {
|
|
|
|
|
|
|
|
return ResultBean.fail("系统配置集合 入参为空");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (SysConfig config : configs) {
|
|
|
|
|
|
|
|
SysConfig configDb = sysConfigService.getSysConfigByCode(config.getConfigCode());
|
|
|
|
|
|
|
|
if (configDb == null) {
|
|
|
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_DATA_NOT_EXIT.getCode())
|
|
|
|
|
|
|
|
.setErrorDetail("配置项%s 不存在于数据库", config.getConfigCode())
|
|
|
|
|
|
|
|
.setErrorSolution("请在数据库中配置")
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
configDb.setConfigValue(config.getConfigValue());
|
|
|
|
|
|
|
|
ConvertBean.modelUpdate(configDb, getSessionUser());
|
|
|
|
|
|
|
|
sysConfigService.updateSysConfig(configDb);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
systemInitService.putAndLoadSysConfig();
|
|
|
|
|
|
|
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 查询全部系统参数
|
|
|
|
* 查询全部系统参数
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @return 处理结果
|
|
|
|
* @return 处理结果
|
|
|
|