diff --git a/src/com/engine/salary/web/SIExportController.java b/src/com/engine/salary/web/SIExportController.java index 7b7209bb5..a37cd05c8 100644 --- a/src/com/engine/salary/web/SIExportController.java +++ b/src/com/engine/salary/web/SIExportController.java @@ -181,6 +181,33 @@ public class SIExportController { return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build(); } + + /** + * 福利台账-补差核算数据导出 + */ + @GET + @Path("/balance/export") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response exportBalance(@Context HttpServletRequest request, @Context HttpServletResponse response, + @QueryParam("billMonth") String billMonth, @QueryParam("paymentOrganization") String paymentOrganization) { + InsuranceExportParam param = InsuranceExportParam.builder().billMonth(billMonth).paymentOrganization(paymentOrganization).build(); + User user = HrmUserVarify.getUser(request, response); + XSSFWorkbook workbook = getSIExportWrapper(user).exportAccount(PaymentStatusEnum.BALANCE.getValue(),param); + String time = LocalDate.now().toString(); + String fileName = "补差核算报表" + time; + try { + fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + StreamingOutput output = outputStream -> { + workbook.write(outputStream); + outputStream.flush(); + }; + response.setContentType("application/octet-stream"); + return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build(); + } + @GET @Path("/overView/export") @Produces(MediaType.APPLICATION_OCTET_STREAM)