From 4db89f09402a812828589c486875f6dc94574f88 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期三, 09 八月 2023 11:30:01 +0800 Subject: [PATCH] 1 --- src/main/java/com/yssh/service/XlsExportService.java | 26 +++++++++++++++++++++++--- 1 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/yssh/service/XlsExportService.java b/src/main/java/com/yssh/service/XlsExportService.java index dc788a8..e8964c7 100644 --- a/src/main/java/com/yssh/service/XlsExportService.java +++ b/src/main/java/com/yssh/service/XlsExportService.java @@ -1,6 +1,8 @@ package com.yssh.service; import com.yssh.entity.xls.DayExcel; +import com.yssh.entity.xls.MonthExcel; +import com.yssh.entity.xls.WeekExcel; import com.yssh.utils.ExcelUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -73,7 +75,7 @@ } String source = getXslTemplate(type); - String target = String.format("%s\\%d.xlsx", getExpPath(type), 20230808); + String target = String.format("%s\\%d.xlsx", getExpPath(type), 20230809); createExcel(source, target, list); } catch (Exception ex) { @@ -86,8 +88,17 @@ */ public void createWeekReport() { try { - String source = getXslTemplate("week"); + String type = "week"; + List<WeekExcel> list = new ArrayList<>(); + for (int i = 1; i < 47; i++) { + WeekExcel day = new WeekExcel("AI-" + (i < 10 ? "0" : "") + i, "zhb", "ztq", "ztb", "zhb2", "lj", "ljtb", "syn", "ys", "fs", "fx", "wd"); + list.add(day); + } + String source = getXslTemplate(type); + String target = String.format("%s\\%d.xlsx", getExpPath(type), 20230807); + + createExcel(source, target, list); } catch (Exception ex) { logger.error(ex.getMessage(), ex); } @@ -98,8 +109,17 @@ */ public void createMonthReport() { try { - String source = getXslTemplate("month"); + String type = "month"; + List<MonthExcel> list = new ArrayList<>(); + for (int i = 1; i < 47; i++) { + MonthExcel day = new MonthExcel("AI-" + (i < 10 ? "0" : "") + i, "yhb", "ytq", "ytb", "yhb2", "lj", "ljtb", "qyn", "ys", "fs", "fx", "wd"); + list.add(day); + } + String source = getXslTemplate(type); + String target = String.format("%s\\%d.xlsx", getExpPath(type), 202308); + + createExcel(source, target, list); } catch (Exception ex) { logger.error(ex.getMessage(), ex); } -- Gitblit v1.9.3