forked from github/dataease
Merge pull request #2874 from dataease/pr@dev@feat_export_view_log
feat(系统管理-日志管理): 导出视图数据日志
This commit is contained in:
commit
6b471f7ed1
@ -131,13 +131,20 @@ public class PanelGroupController {
|
||||
return panelGroupService.queryPanelComponents(id);
|
||||
}
|
||||
|
||||
@ApiOperation("导出仪表板视图明细")
|
||||
@ApiOperation("公共连接导出仪表板视图明细")
|
||||
@PostMapping("/exportDetails")
|
||||
@I18n
|
||||
public void exportDetails(@RequestBody PanelViewDetailsRequest request, HttpServletResponse response) throws IOException {
|
||||
panelGroupService.exportPanelViewDetails(request, response);
|
||||
}
|
||||
|
||||
@ApiOperation("站内导出仪表板视图明细")
|
||||
@PostMapping("/innerExportDetails")
|
||||
@I18n
|
||||
public void innerExportDetails(@RequestBody PanelViewDetailsRequest request, HttpServletResponse response) throws IOException {
|
||||
panelGroupService.exportPanelViewDetails(request, response);
|
||||
}
|
||||
|
||||
@ApiOperation("更新仪表板状态")
|
||||
@PostMapping("/updatePanelStatus/{panelId}")
|
||||
@I18n
|
||||
|
@ -12,6 +12,8 @@ import java.util.List;
|
||||
@Data
|
||||
public class PanelViewDetailsRequest {
|
||||
|
||||
private String viewId;
|
||||
|
||||
private String viewName;
|
||||
|
||||
private String[] header;
|
||||
|
@ -620,6 +620,12 @@ public class PanelGroupService {
|
||||
} catch (Exception e) {
|
||||
DataEaseException.throwException(e);
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(AuthUtils.getUser())) {
|
||||
String viewId = request.getViewId();
|
||||
ChartViewWithBLOBs chartViewWithBLOBs = chartViewService.get(viewId);
|
||||
String pid = chartViewWithBLOBs.getSceneId();
|
||||
DeLogUtils.save(SysLogConstants.OPERATE_TYPE.EXPORT, SysLogConstants.SOURCE_TYPE.VIEW, viewId,pid, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
public void updatePanelStatus(String panelId, PanelGroupBaseInfoRequest request) {
|
||||
|
@ -181,13 +181,18 @@ public class LogService {
|
||||
|
||||
List<FolderItem> folderItems = viewPanelTypes();
|
||||
results.addAll(folderItems);
|
||||
results.addAll(viewRelativeTypes());
|
||||
return results;
|
||||
}
|
||||
|
||||
private List<FolderItem> viewPanelTypes () {
|
||||
private List<FolderItem> viewRelativeTypes() {
|
||||
Integer[] opTypes = new Integer[]{15};
|
||||
Integer[] sourceTypes = new Integer[]{4};
|
||||
return typesByArr(opTypes, sourceTypes);
|
||||
}
|
||||
|
||||
private List<FolderItem> typesByArr(Integer[] opTypes, Integer[] sourceTypes) {
|
||||
List<FolderItem> results = new ArrayList<>();
|
||||
Integer[] opTypes = new Integer[]{13, 14};
|
||||
Integer[] sourceTypes = new Integer[]{3};
|
||||
for (int i = 0; i < sourceTypes.length; i++) {
|
||||
Integer sourceVal = sourceTypes[i];
|
||||
String sourceTypeName = SysLogConstants.sourceTypeName(sourceVal);
|
||||
@ -204,7 +209,11 @@ public class LogService {
|
||||
}
|
||||
}
|
||||
return results;
|
||||
|
||||
}
|
||||
private List<FolderItem> viewPanelTypes () {
|
||||
Integer[] opTypes = new Integer[]{13, 14};
|
||||
Integer[] sourceTypes = new Integer[]{3};
|
||||
return typesByArr(opTypes, sourceTypes);
|
||||
}
|
||||
|
||||
public SysLogGridDTO convertDTO(SysLogWithBLOBs vo) {
|
||||
|
@ -145,6 +145,7 @@ OPERATE_TYPE_UPLOADFILE=Upload
|
||||
OPERATE_TYPE_LOGIN=Login
|
||||
OPERATE_TYPE_PC_VIEW=View with pc
|
||||
OPERATE_TYPE_MB_VIEW=View with mobile device
|
||||
OPERATE_TYPE_EXPORT=Export
|
||||
|
||||
SOURCE_TYPE_DATASOURCE=DATASOURCE
|
||||
SOURCE_TYPE_DATASET=DATASET
|
||||
|
@ -143,6 +143,7 @@ OPERATE_TYPE_UPLOADFILE=\u4E0A\u4F20
|
||||
OPERATE_TYPE_LOGIN=\u767B\u5F55
|
||||
OPERATE_TYPE_PC_VIEW=\u4F7F\u7528PC\u67E5\u770B
|
||||
OPERATE_TYPE_MB_VIEW=\u4F7F\u7528\u79FB\u52A8\u7AEF\u67E5\u770B
|
||||
OPERATE_TYPE_EXPORT=\u5BFC\u51FA
|
||||
|
||||
SOURCE_TYPE_DATASOURCE=\u6570\u636E\u6E90
|
||||
SOURCE_TYPE_DATASET=\u6570\u636E\u96C6
|
||||
|
@ -144,6 +144,7 @@ OPERATE_TYPE_UPLOADFILE=\u4E0A\u50B3
|
||||
OPERATE_TYPE_LOGIN=\u767B\u9304
|
||||
OPERATE_TYPE_PC_VIEW=\u4F7F\u7528PC\u67E5\u770B
|
||||
OPERATE_TYPE_MB_VIEW=\u4F7F\u7528\u79FB\u52D5\u7AEF\u67E5\u770B
|
||||
OPERATE_TYPE_EXPORT=\u5C0E\u51FA
|
||||
|
||||
SOURCE_TYPE_DATASOURCE=\u6578\u64DA\u6E90
|
||||
SOURCE_TYPE_DATASET=\u6578\u64DA\u96C6
|
||||
|
Loading…
Reference in New Issue
Block a user