Merge pull request #3006 from dataease/pr@dev@fix_email_task_view

perf(系统管理-定时报告): 定时报告带模版视图数据报错
This commit is contained in:
fit2cloud-chenyw 2022-08-31 11:18:46 +08:00 committed by GitHub
commit ba10fd8041
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,6 +38,9 @@ public class ViewExportExcel {
private Type tokenType = new TypeToken<List<Map<String, Object>>>() {
}.getType();
private Type fieldTokenType = new TypeToken<List<ChartViewFieldDTO>>() {
}.getType();
@DePermissionProxy(paramIndex = 2)
public List<File> export(String panelId, List<String> viewIds, PermissionProxy proxy) throws Exception {
if (CollectionUtils.isEmpty(viewIds)) {
@ -91,7 +94,7 @@ public class ViewExportExcel {
Map<String, Object> chart = chartViewDTO.getData();
Object objectFields = chart.get("fields");
List<ChartViewFieldDTO> fields = (List<ChartViewFieldDTO>) objectFields;
List<ChartViewFieldDTO> fields = gson.fromJson(gson.toJson(objectFields), fieldTokenType);
List<String> heads = new ArrayList<>();
List<String> headKeys = new ArrayList<>();
fields.forEach(field -> {