This commit is contained in:
haozq 2025-01-17 18:29:05 +08:00
commit cf7235f858
2 changed files with 25 additions and 2 deletions

View File

@ -176,4 +176,27 @@ public class HomeIndexController {
List<HomeDispatchDetailVo> list = service.getDispatchDetails(dto.getData());;
return new PageInfo<>(list);
}
@ApiOperation(value = "首页-二级页面-派车详情导出")
@PostMapping("exportDispatchDetails")
public void exportDispatchDetails(HttpServletResponse response, @RequestBody BackParamsDto dto) {
try {
List<HomeDispatchDetailVo> list = service.getDispatchDetails(dto);
final int[] num = {1};
list.forEach(vo -> {
vo.setSerialNum(num[0]);
num[0]++;
});
ExportParams exportParams = new ExportParams("派车详情", "派车详情", ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, HomeDispatchDetailVo.class, list);
response.setContentType("application/vnd.ms-excel");
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("派车详情" + ".xlsx", "UTF-8"));
ServletOutputStream outputStream = response.getOutputStream();
workbook.write(outputStream);
outputStream.close();
workbook.close();
} catch (Exception e) {
log.error(e.toString(), e);
}
}
}

View File

@ -125,7 +125,7 @@ public interface HomeIndexMapper {
*/
List<HomeDispatchDetailVo> getDispatchDetails(BackParamsDto dto);
IndexVo getPayMoney(BackParamsDto dto);
IndexVo getPayMoney(@Param("params") BackParamsDto dto);
IndexVo getNoPayMoney(BackParamsDto dto);
IndexVo getNoPayMoney(@Param("params") BackParamsDto dto);
}