提交 5353d727 authored 作者: taojinlong's avatar taojinlong

Merge branch 'v1.10' of github.com:dataease/dataease into v1.10

...@@ -68,7 +68,7 @@ curl -sSL https://github.com/dataease/dataease/releases/latest/download/quick_st ...@@ -68,7 +68,7 @@ curl -sSL https://github.com/dataease/dataease/releases/latest/download/quick_st
``` ```
- [在线文档](https://dataease.io/docs/) - [在线文档](https://dataease.io/docs/)
- [演示视频](https://www.bilibili.com/video/BV1UB4y1K7jA) - [演示视频](https://www.bilibili.com/video/BV1i34y1v7hq/)
## 微信群 ## 微信群
......
...@@ -5,10 +5,7 @@ import io.dataease.auth.annotation.DePermission; ...@@ -5,10 +5,7 @@ import io.dataease.auth.annotation.DePermission;
import io.dataease.auth.annotation.DePermissionProxy; import io.dataease.auth.annotation.DePermissionProxy;
import io.dataease.commons.constants.DePermissionType; import io.dataease.commons.constants.DePermissionType;
import io.dataease.commons.constants.ResourceAuthLevel; import io.dataease.commons.constants.ResourceAuthLevel;
import io.dataease.controller.request.chart.ChartCalRequest; import io.dataease.controller.request.chart.*;
import io.dataease.controller.request.chart.ChartExtRequest;
import io.dataease.controller.request.chart.ChartViewCacheRequest;
import io.dataease.controller.request.chart.ChartViewRequest;
import io.dataease.controller.response.ChartDetail; import io.dataease.controller.response.ChartDetail;
import io.dataease.dto.chart.ChartViewDTO; import io.dataease.dto.chart.ChartViewDTO;
import io.dataease.plugins.common.base.domain.ChartViewCacheWithBLOBs; import io.dataease.plugins.common.base.domain.ChartViewCacheWithBLOBs;
...@@ -23,6 +20,7 @@ import springfox.documentation.annotations.ApiIgnore; ...@@ -23,6 +20,7 @@ import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @Author gin * @Author gin
...@@ -112,6 +110,13 @@ public class ChartViewController { ...@@ -112,6 +110,13 @@ public class ChartViewController {
return chartViewService.chartCopy(id, panelId); return chartViewService.chartCopy(id, panelId);
} }
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE, paramIndex = 1)
@ApiOperation("批量复制")
@PostMapping("chartBatchCopy/{panelId}")
public Map<String,String> chartBatchCopy(@RequestBody ChartCopyBatchRequest request, @PathVariable String panelId) {
return chartViewService.chartBatchCopy(request,panelId);
}
@ApiIgnore @ApiIgnore
@GetMapping("searchAdviceSceneId/{panelId}") @GetMapping("searchAdviceSceneId/{panelId}")
public String searchAdviceSceneId(@PathVariable String panelId) { public String searchAdviceSceneId(@PathVariable String panelId) {
......
package io.dataease.controller.request.chart;
import lombok.Data;
import java.util.HashMap;
import java.util.Map;
/**
* Author: wangjiahao
* Date: 2022/4/26
* Description:
*/
@Data
public class ChartCopyBatchRequest {
private String panelId;
private Map<String,String> sourceAndTargetIds;
}
package io.dataease.service.chart; package io.dataease.service.chart;
import cn.hutool.core.lang.Assert;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken; import com.google.gson.reflect.TypeToken;
import io.dataease.auth.entity.SysUserEntity; import io.dataease.auth.entity.SysUserEntity;
...@@ -1024,13 +1025,35 @@ public class ChartViewService { ...@@ -1024,13 +1025,35 @@ public class ChartViewService {
return chartViewMapper.selectByPrimaryKey(id); return chartViewMapper.selectByPrimaryKey(id);
} }
public String chartCopy(String id, String panelId) { public String chartCopy(String sourceViewId,String newViewId, String panelId) {
extChartViewMapper.chartCopy(newViewId, sourceViewId, panelId);
extChartViewMapper.copyCache(sourceViewId, newViewId);
extPanelGroupExtendDataMapper.copyExtendData(sourceViewId, newViewId, panelId);
chartViewCacheService.refreshCache(newViewId);
return newViewId;
}
public String chartCopy(String sourceViewId, String panelId) {
String newChartId = UUID.randomUUID().toString(); String newChartId = UUID.randomUUID().toString();
extChartViewMapper.chartCopy(newChartId, id, panelId); return chartCopy(sourceViewId,newChartId,panelId);
extChartViewMapper.copyCache(id, newChartId); }
extPanelGroupExtendDataMapper.copyExtendData(id, newChartId, panelId);
chartViewCacheService.refreshCache(newChartId);
return newChartId; /**
* @Description Copy a set of views with a given source ID and target ID
* @param request
* @param panelId
* @return
*/
public Map<String,String> chartBatchCopy(ChartCopyBatchRequest request,String panelId){
Assert.notNull(panelId,"panelId should not be null");
Map<String,String> sourceAndTargetIds = request.getSourceAndTargetIds();
if(sourceAndTargetIds != null && !sourceAndTargetIds.isEmpty()){
for(Map.Entry<String,String> entry:sourceAndTargetIds.entrySet()){
chartCopy(entry.getKey(),entry.getValue(),panelId);
}
}
return request.getSourceAndTargetIds();
} }
public String searchAdviceSceneId(String panelId) { public String searchAdviceSceneId(String panelId) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论