|
@@ -2,8 +2,8 @@ package com.ruoyi.powerdistribution.controller;
|
|
|
|
|
|
import com.alibaba.excel.EasyExcel;
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
-import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
+import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
import com.ruoyi.powerdistribution.domain.*;
|
|
|
import com.ruoyi.powerdistribution.domain.vo.ReportDayVO;
|
|
|
import com.ruoyi.powerdistribution.domain.vo.ReportDayWeek;
|
|
@@ -20,8 +20,6 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
-import java.io.InputStream;
|
|
|
-import java.io.OutputStream;
|
|
|
import java.util.List;
|
|
|
|
|
|
@RestController
|
|
@@ -78,18 +76,6 @@ public class ReportController extends BaseController {
|
|
|
@PostMapping("/dayExport")
|
|
|
@ApiOperation(value = "日报导出")
|
|
|
public void dayExport(HttpServletResponse response,String reportDate) throws IOException {
|
|
|
- InputStream fis = null;
|
|
|
- OutputStream ops = null;
|
|
|
-
|
|
|
- response.setContentType("application/vnd.ms-excel");
|
|
|
- response.setCharacterEncoding("utf-8");
|
|
|
- String fileName = java.util.UUID.randomUUID() + ".xlsx";
|
|
|
- response.setHeader("Content-disposition", "attachment;filename=" + fileName);
|
|
|
- String templateFileName = "excelTemplate/invoiceExport.xlsx";
|
|
|
- fis = Thread.currentThread().getContextClassLoader().getResourceAsStream(templateFileName);
|
|
|
- ops = response.getOutputStream();
|
|
|
-
|
|
|
-
|
|
|
PdmReportIllegalDay pdmReportIllegalDay = new PdmReportIllegalDay();
|
|
|
pdmReportIllegalDay.setReportDate(reportDate);
|
|
|
List<PdmReportIllegalDay> illegalList = pdmReportIllegalDayService.selectPdmReportIllegalDayList(pdmReportIllegalDay);
|
|
@@ -103,16 +89,8 @@ public class ReportController extends BaseController {
|
|
|
nextDay.setReportDate(DateUtils.getNextDateStr(reportDate,DateUtils.YYYYMMDD,1));
|
|
|
List<PdmReportPlanNextDay> nextDayList = pdmReportPlanNextDayService.selectPdmReportPlanNextDayList(nextDay);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- //填充导出信息
|
|
|
- ExcelWriter excelWriter = EasyExcel.write(ops, AdsMatHyxtInvoiceD.class).withTemplate(fis).build();
|
|
|
- //WriteSheet writeSheet = EasyExcel.writerSheet().build();
|
|
|
- //FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
|
|
|
- //excelWriter.fill(list, fillConfig, writeSheet);
|
|
|
- //excelWriter.finish();
|
|
|
+ ExcelUtil<PdmReportIllegalDay> util = new ExcelUtil<>(PdmReportIllegalDay.class);
|
|
|
+ util.exportExcel(response, illegalList, "违章");
|
|
|
}
|
|
|
|
|
|
/**
|