zhou zhou
15 小时以前 6241b8acad2651564c1c668a9a54821361fbb4af
rsf-server/src/main/java/com/vincent/rsf/server/common/service/ListExportService.java
@@ -144,11 +144,31 @@
        String reportDate = getMetaValue(metaMap, "reportDate", "");
        String printedAt = getMetaValue(metaMap, "printedAt", "");
        String operator = getMetaValue(metaMap, "operator", "");
        return new ExcelUtil.ExportMeta(reportTitle, reportDate, printedAt, operator, count);
        return new ExcelUtil.ExportMeta(
                reportTitle,
                reportDate,
                printedAt,
                operator,
                count,
                getReportStyle(metaMap)
        );
    }
    private String getMetaValue(Map<?, ?> metaMap, String key, String defaultValue) {
        Object value = metaMap.get(key);
        return Objects.isNull(value) ? defaultValue : String.valueOf(value);
    }
    private Map<String, Object> getReportStyle(Map<?, ?> metaMap) {
        Object reportStyleObject = metaMap.get("reportStyle");
        if (!(reportStyleObject instanceof Map<?, ?> reportStyleMap)) {
            return Collections.emptyMap();
        }
        Map<String, Object> reportStyle = new HashMap<>();
        for (Map.Entry<?, ?> entry : reportStyleMap.entrySet()) {
            reportStyle.put(String.valueOf(entry.getKey()), entry.getValue());
        }
        return reportStyle;
    }
}