|
@@ -30,13 +30,10 @@ import com.fs.system.service.ISysConfigService;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 参数配置 信息操作处理
|
|
* 参数配置 信息操作处理
|
|
|
- *
|
|
|
|
|
-
|
|
|
|
|
*/
|
|
*/
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequestMapping("/system/config")
|
|
@RequestMapping("/system/config")
|
|
|
-public class SysConfigController extends BaseController
|
|
|
|
|
-{
|
|
|
|
|
|
|
+public class SysConfigController extends BaseController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ISysConfigService configService;
|
|
private ISysConfigService configService;
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -47,8 +44,7 @@ public class SysConfigController extends BaseController
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('system:config:list')")
|
|
@PreAuthorize("@ss.hasPermi('system:config:list')")
|
|
|
@GetMapping("/list")
|
|
@GetMapping("/list")
|
|
|
- public TableDataInfo list(SysConfig config)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public TableDataInfo list(SysConfig config) {
|
|
|
startPage();
|
|
startPage();
|
|
|
List<SysConfig> list = configService.selectConfigList(config);
|
|
List<SysConfig> list = configService.selectConfigList(config);
|
|
|
return getDataTable(list);
|
|
return getDataTable(list);
|
|
@@ -57,8 +53,7 @@ public class SysConfigController extends BaseController
|
|
|
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
|
|
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
|
|
|
@PreAuthorize("@ss.hasPermi('system:config:export')")
|
|
@PreAuthorize("@ss.hasPermi('system:config:export')")
|
|
|
@GetMapping("/export")
|
|
@GetMapping("/export")
|
|
|
- public AjaxResult export(SysConfig config)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult export(SysConfig config) {
|
|
|
List<SysConfig> list = configService.selectConfigList(config);
|
|
List<SysConfig> list = configService.selectConfigList(config);
|
|
|
ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
|
|
ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
|
|
|
return util.exportExcel(list, "参数数据");
|
|
return util.exportExcel(list, "参数数据");
|
|
@@ -69,8 +64,7 @@ public class SysConfigController extends BaseController
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('system:config:query')")
|
|
@PreAuthorize("@ss.hasPermi('system:config:query')")
|
|
|
@GetMapping(value = "/{configId}")
|
|
@GetMapping(value = "/{configId}")
|
|
|
- public AjaxResult getInfo(@PathVariable Long configId)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult getInfo(@PathVariable Long configId) {
|
|
|
return AjaxResult.success(configService.selectConfigById(configId));
|
|
return AjaxResult.success(configService.selectConfigById(configId));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -78,8 +72,7 @@ public class SysConfigController extends BaseController
|
|
|
* 根据参数键名查询参数值
|
|
* 根据参数键名查询参数值
|
|
|
*/
|
|
*/
|
|
|
@GetMapping(value = "/configKey/{configKey}")
|
|
@GetMapping(value = "/configKey/{configKey}")
|
|
|
- public AjaxResult getConfigKey(@PathVariable String configKey)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult getConfigKey(@PathVariable String configKey) {
|
|
|
return AjaxResult.success(configService.selectConfigByKey(configKey));
|
|
return AjaxResult.success(configService.selectConfigByKey(configKey));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -90,10 +83,8 @@ public class SysConfigController extends BaseController
|
|
|
@Log(title = "参数管理", businessType = BusinessType.INSERT)
|
|
@Log(title = "参数管理", businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
@PostMapping
|
|
|
@RepeatSubmit
|
|
@RepeatSubmit
|
|
|
- public AjaxResult add(@Validated @RequestBody SysConfig config)
|
|
|
|
|
- {
|
|
|
|
|
- if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult add(@Validated @RequestBody SysConfig config) {
|
|
|
|
|
+ if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) {
|
|
|
return AjaxResult.error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
|
return AjaxResult.error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
|
|
}
|
|
}
|
|
|
config.setCreateBy(getUsername());
|
|
config.setCreateBy(getUsername());
|
|
@@ -106,10 +97,8 @@ public class SysConfigController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('system:config:edit')")
|
|
@PreAuthorize("@ss.hasPermi('system:config:edit')")
|
|
|
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
|
|
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping
|
|
@PutMapping
|
|
|
- public AjaxResult edit(@Validated @RequestBody SysConfig config)
|
|
|
|
|
- {
|
|
|
|
|
- if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult edit(@Validated @RequestBody SysConfig config) {
|
|
|
|
|
+ if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) {
|
|
|
return AjaxResult.error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
|
return AjaxResult.error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
|
|
}
|
|
}
|
|
|
config.setUpdateBy(getUsername());
|
|
config.setUpdateBy(getUsername());
|
|
@@ -122,8 +111,7 @@ public class SysConfigController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('system:config:remove')")
|
|
@PreAuthorize("@ss.hasPermi('system:config:remove')")
|
|
|
@Log(title = "参数管理", businessType = BusinessType.DELETE)
|
|
@Log(title = "参数管理", businessType = BusinessType.DELETE)
|
|
|
@DeleteMapping("/{configIds}")
|
|
@DeleteMapping("/{configIds}")
|
|
|
- public AjaxResult remove(@PathVariable Long[] configIds)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult remove(@PathVariable Long[] configIds) {
|
|
|
configService.deleteConfigByIds(configIds);
|
|
configService.deleteConfigByIds(configIds);
|
|
|
return success();
|
|
return success();
|
|
|
}
|
|
}
|
|
@@ -134,50 +122,53 @@ public class SysConfigController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('system:config:remove')")
|
|
@PreAuthorize("@ss.hasPermi('system:config:remove')")
|
|
|
@Log(title = "参数管理", businessType = BusinessType.CLEAN)
|
|
@Log(title = "参数管理", businessType = BusinessType.CLEAN)
|
|
|
@DeleteMapping("/refreshCache")
|
|
@DeleteMapping("/refreshCache")
|
|
|
- public AjaxResult refreshCache()
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult refreshCache() {
|
|
|
configService.resetConfigCache();
|
|
configService.resetConfigCache();
|
|
|
return AjaxResult.success();
|
|
return AjaxResult.success();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@GetMapping(value = "/getConfigByKey/{configKey}")
|
|
@GetMapping(value = "/getConfigByKey/{configKey}")
|
|
|
- public AjaxResult getConfigByKey(@PathVariable String configKey)
|
|
|
|
|
- {
|
|
|
|
|
- SysConfig config=configService.selectConfigByConfigKey(configKey);
|
|
|
|
|
|
|
+ public AjaxResult getConfigByKey(@PathVariable String configKey) {
|
|
|
|
|
+ SysConfig config = configService.selectConfigByConfigKey(configKey);
|
|
|
return AjaxResult.success(config);
|
|
return AjaxResult.success(config);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PostMapping(value = "/updateConfigByKey")
|
|
@PostMapping(value = "/updateConfigByKey")
|
|
|
@Log(title = "更改参数", businessType = BusinessType.UPDATE)
|
|
@Log(title = "更改参数", businessType = BusinessType.UPDATE)
|
|
|
@RepeatSubmit
|
|
@RepeatSubmit
|
|
|
- public AjaxResult updateConfigByKey(@Validated @RequestBody SysConfig config)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult updateConfigByKey(@Validated @RequestBody SysConfig config) {
|
|
|
config.setCreateBy(SecurityUtils.getUsername());
|
|
config.setCreateBy(SecurityUtils.getUsername());
|
|
|
- return toAjax(configService.updateConfig(config));
|
|
|
|
|
|
|
+ //修复只能更新的BUG
|
|
|
|
|
+ if (null != config.getConfigId()) {
|
|
|
|
|
+ return toAjax(configService.updateConfig(config));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return toAjax(configService.insertConfig(config));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 启用-关闭小程序销售管理
|
|
* 启用-关闭小程序销售管理
|
|
|
|
|
+ *
|
|
|
* @param bock
|
|
* @param bock
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/updateIsTownOn")
|
|
@GetMapping("/updateIsTownOn")
|
|
|
- public R queryIsTownOn(String bock, String appId)
|
|
|
|
|
- {
|
|
|
|
|
- String key = appId+"start_status_001";
|
|
|
|
|
|
|
+ public R queryIsTownOn(String bock, String appId) {
|
|
|
|
|
+ String key = appId + "start_status_001";
|
|
|
String start = redisCache.getCacheObject(key);
|
|
String start = redisCache.getCacheObject(key);
|
|
|
- if (ObjectUtil.isNotEmpty(bock)){
|
|
|
|
|
- if (bock.equals("001")){
|
|
|
|
|
- redisCache.setCacheObject(key,bock);
|
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(bock)) {
|
|
|
|
|
+ if (bock.equals("001")) {
|
|
|
|
|
+ redisCache.setCacheObject(key, bock);
|
|
|
return R.ok("调整成功");
|
|
return R.ok("调整成功");
|
|
|
- }else if (bock.equals("002")){
|
|
|
|
|
- redisCache.setCacheObject(key,bock);
|
|
|
|
|
|
|
+ } else if (bock.equals("002")) {
|
|
|
|
|
+ redisCache.setCacheObject(key, bock);
|
|
|
return R.ok("调整成功");
|
|
return R.ok("调整成功");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- return R.ok().put("date",start);
|
|
|
|
|
|
|
+ return R.ok().put("date", start);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|