forked from github/dataease
feat(视图):视图保留实时计算与渲染功能,但不实时保存,提供保存与重置按钮
This commit is contained in:
parent
46884dbd47
commit
3439988ca2
@ -105,6 +105,6 @@ public class ChartViewController {
|
||||
@ApiOperation("计算结果")
|
||||
@PostMapping("/calcData")
|
||||
public ChartViewDTO calcData(@RequestBody ChartCalRequest request) throws Exception {
|
||||
return chartViewService.calcData(request.getView(), request.getRequestList());
|
||||
return chartViewService.calcData(request.getView(), request.getRequestList(), true);
|
||||
}
|
||||
}
|
||||
|
@ -75,9 +75,9 @@ public class ChartViewService {
|
||||
chartView.setUpdateTime(timestamp);
|
||||
chartViewMapper.insertSelective(chartView);
|
||||
}
|
||||
Optional.ofNullable(chartView.getId()).ifPresent(id -> {
|
||||
CacheUtils.remove(JdbcConstants.VIEW_CACHE_KEY, id);
|
||||
});
|
||||
// Optional.ofNullable(chartView.getId()).ifPresent(id -> {
|
||||
// CacheUtils.remove(JdbcConstants.VIEW_CACHE_KEY, id);
|
||||
// });
|
||||
return getOneWithPermission(chartView.getId());
|
||||
}
|
||||
|
||||
@ -179,10 +179,15 @@ public class ChartViewService {
|
||||
|
||||
public ChartViewDTO getData(String id, ChartExtRequest requestList) throws Exception {
|
||||
ChartViewWithBLOBs view = chartViewMapper.selectByPrimaryKey(id);
|
||||
return calcData(view, requestList);
|
||||
return calcData(view, requestList, false);
|
||||
}
|
||||
|
||||
public ChartViewDTO calcData(ChartViewWithBLOBs view, ChartExtRequest requestList) throws Exception {
|
||||
public ChartViewDTO calcData(ChartViewWithBLOBs view, ChartExtRequest requestList, boolean clearCache) throws Exception {
|
||||
if (clearCache) {
|
||||
Optional.ofNullable(view.getId()).ifPresent(id -> {
|
||||
CacheUtils.remove(JdbcConstants.VIEW_CACHE_KEY, id);
|
||||
});
|
||||
}
|
||||
if (ObjectUtils.isEmpty(view)) {
|
||||
throw new RuntimeException(Translator.get("i18n_chart_delete"));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user