大屏项目初始化
This commit is contained in:
@@ -39,19 +39,20 @@ public class ChartInfoController {
|
|||||||
@PostMapping("setting")
|
@PostMapping("setting")
|
||||||
public Result<Message> save(@RequestBody List<ChartConfig> configs) {
|
public Result<Message> save(@RequestBody List<ChartConfig> configs) {
|
||||||
for (ChartConfig config : configs) {
|
for (ChartConfig config : configs) {
|
||||||
if (!config.getChartId().equals(config.getOldChartId())){
|
LambdaQueryWrapper<ChartInfo> newQuery = new LambdaQueryWrapper<ChartInfo>()
|
||||||
LambdaQueryWrapper<ChartInfo> newQuery = new LambdaQueryWrapper<ChartInfo>()
|
.eq(ChartInfo::getChartId, config.getChartId())
|
||||||
.eq(ChartInfo::getChartId, config.getChartId())
|
.eq(ChartInfo::getChartCode, config.getChartCode());
|
||||||
.eq(ChartInfo::getChartCode, config.getChartCode());
|
ChartInfo newChartInfo = chartInfoService.getOne(newQuery);
|
||||||
ChartInfo newChartInfo = chartInfoService.getOne(newQuery);
|
newChartInfo.setSort(config.getSort());
|
||||||
newChartInfo.setSort(config.getSort());
|
chartInfoService.updateById(newChartInfo);
|
||||||
chartInfoService.updateById(newChartInfo);
|
LambdaUpdateWrapper<ChartInfo> updateWrapper = new LambdaUpdateWrapper<ChartInfo>()
|
||||||
LambdaUpdateWrapper<ChartInfo> updateWrapper = new LambdaUpdateWrapper<ChartInfo>()
|
.eq(ChartInfo::getChartId, config.getOldChartId())
|
||||||
.eq(ChartInfo::getChartId, config.getOldChartId())
|
.eq(ChartInfo::getChartCode, config.getChartCode())
|
||||||
.eq(ChartInfo::getChartCode, config.getChartCode())
|
.notIn(ChartInfo::getChartId, configs.stream()
|
||||||
.set(ChartInfo::getSort, null);
|
.map(ChartConfig::getChartId)
|
||||||
chartInfoService.update(updateWrapper);
|
.toList())
|
||||||
}
|
.set(ChartInfo::getSort, null);
|
||||||
|
chartInfoService.update(updateWrapper);
|
||||||
}
|
}
|
||||||
return Result.success(new Message("配置保存成功", 200));
|
return Result.success(new Message("配置保存成功", 200));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user