| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotBlank; |
| | |
| | | @ApiOperation(value = "导出社保四险员工") |
| | | @PostMapping(value = "export/insurance") |
| | | @ControllerEndpoint(operation = "导出社保四险数据", exceptionMessage = "导出 Excel 失败") |
| | | public void exportInsuranceWithField(QueryRequest request, HttpServletResponse response, String exportField, EmpBaseInfo empBaseinfo) throws IOException { |
| | | public void exportInsuranceWithField(QueryRequest request, HttpServletRequest httpRequest, HttpServletResponse response, EmpBaseInfo empBaseinfo) throws IOException { |
| | | String exportField = httpRequest.getParameter("exportField"); |
| | | log.info("exportField: {}", exportField); |
| | | request.setPageSize(25535); |
| | | request.setPageNum(1); |
| | | List<EmpBaseInfo> exportList = this.empBaseInfoService.findInsuranceEmpBaseInfos(request, empBaseinfo).getRecords(); |
| | |
| | | * @throws IOException IO 异常 |
| | | */ |
| | | private void exportExcel(HttpServletResponse response, String exportField, List<EmpBaseInfo> exportList, String fileName) throws IOException { |
| | | log.info("导出Excel - exportField: {}", exportField); |
| | | log.info("导出Excel - exportList size: {}", exportList != null ? exportList.size() : 0); |
| | | List<Map<String, Object>> allList = PoiExportExcel.getDataList(exportField, exportList, null); |
| | | Date currentDate = new Date(); |
| | | String dateStr = DateUtil.formatDate(currentDate); |