From ab6c0940c23dd14dfe87ec8a3ce087d032640db2 Mon Sep 17 00:00:00 2001 From: sy Date: Thu, 8 Dec 2022 14:51:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-=E7=A6=8F?= =?UTF-8?q?=E5=88=A9=E5=8F=B0=E8=B4=A6=EF=BC=8C=E8=A1=A5=E5=B7=AE=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=AF=BC=E5=87=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/web/SIExportController.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) 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)