薪酬系统-福利台账,补差数据导出功能
This commit is contained in:
parent
f31e176cab
commit
ab6c0940c2
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue