| | |
| | | package com.dy.pipIrrProject.controller; |
| | | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.support.ExcelTypeEnum; |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrGlobal.excel.CellWriteHandler; |
| | | import com.dy.pipIrrGlobal.excel.ExcelUtil; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaClient; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrController; |
| | | import com.dy.pipIrrGlobal.voPr.VoController; |
| | |
| | | import java.io.IOException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLEncoder; |
| | | import java.time.LocalDate; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | @SneakyThrows(IOException.class) |
| | | @RequestMapping(value = "/export", method = RequestMethod.GET) |
| | | public void export(HttpServletResponse response, QueryVo vo) { |
| | | setExcelRespProp(response, "控制器列表"); |
| | | //List<VoDivide> memberList = LocalJsonUtil.getListFromJson("json/members.json", VoDivide.class); |
| | | List<VoController> memberList = controllerSv.export(vo); |
| | | //setExcelRespProp(response, "控制器列表"); |
| | | List<VoController> controllerList = controllerSv.export(vo); |
| | | ExcelUtil.setExcelRespProp(response, "控制器列表" + LocalDate.now()); |
| | | EasyExcel.write(response.getOutputStream(), VoController.class) |
| | | .registerWriteHandler(new CellWriteHandler("控制器列表")) |
| | | .sheet("控制器") |
| | | .doWrite(controllerList); |
| | | |
| | | EasyExcel.write(response.getOutputStream()) |
| | | .head(VoController.class) |
| | | .excelType(ExcelTypeEnum.XLSX) |
| | | .sheet("控制器列表") |
| | | .doWrite(memberList); |
| | | //EasyExcel.write(response.getOutputStream()) |
| | | // .head(VoController.class) |
| | | // .excelType(ExcelTypeEnum.XLSX) |
| | | // .sheet("控制器列表") |
| | | // .doWrite(memberList); |
| | | } |
| | | |
| | | /** |