薪酬系统-福利台账,退差数据导出功能v1
This commit is contained in:
parent
b647089eaf
commit
c339798dc8
|
|
@ -50,7 +50,7 @@ public class InsuranceAccountDetailPO {
|
|||
private Integer paymentStatus;
|
||||
|
||||
/**
|
||||
* 补缴月份
|
||||
* 补缴月份/退差月份
|
||||
*/
|
||||
private String supplementaryMonth;
|
||||
|
||||
|
|
|
|||
|
|
@ -151,12 +151,14 @@ public class SIExportServiceImpl extends Service implements SIExportService {
|
|||
AccountExportPOEncrypt.decryptAccountExportPOList(accountExportPOS);
|
||||
List<WeaTableColumn> columns = new ArrayList<>();
|
||||
List<Map<String, Object>> records = new ArrayList<>();
|
||||
if (Objects.equals(PaymentStatusEnum.COMMON.getValue(), paymentStatus)) {
|
||||
columns = buildCommonColumns(accountExportPOS, false);
|
||||
}
|
||||
if (Objects.equals(PaymentStatusEnum.REPAIR.getValue(), paymentStatus)) {
|
||||
columns = buildCommonColumns(accountExportPOS, true);
|
||||
}
|
||||
// if (Objects.equals(PaymentStatusEnum.COMMON.getValue(), paymentStatus)) {
|
||||
// columns = buildCommonColumns(accountExportPOS, false);
|
||||
// }
|
||||
// if (Objects.equals(PaymentStatusEnum.REPAIR.getValue(), paymentStatus)) {
|
||||
// columns = buildCommonColumns(accountExportPOS, true);
|
||||
// }
|
||||
columns = buildCommonColumns(accountExportPOS, paymentStatus);
|
||||
|
||||
records = buildCommonRecords(accountExportPOS);
|
||||
List<List<Object>> excelSheetData = new ArrayList<>();
|
||||
//工作簿名称
|
||||
|
|
@ -428,7 +430,7 @@ public class SIExportServiceImpl extends Service implements SIExportService {
|
|||
}
|
||||
|
||||
|
||||
private List<WeaTableColumn> buildCommonColumns(List<AccountExportPO> pos, boolean flag) {
|
||||
private List<WeaTableColumn> buildCommonColumns(List<AccountExportPO> pos, Integer paymentStatus) {
|
||||
List<WeaTableColumn> list = new ArrayList<>();
|
||||
Map<String, String> categoryIdNameMap = categoryIdNameMap();
|
||||
Map<Integer, Map<String, String>> columns = buildPaymentTitle(pos, categoryIdNameMap);
|
||||
|
|
@ -440,8 +442,10 @@ public class SIExportServiceImpl extends Service implements SIExportService {
|
|||
list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(86317, "工号"), "workcode"));
|
||||
list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(86187, "员工状态"), "employeeStatus"));
|
||||
list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(100377, "数据来源"), "sourceFrom"));
|
||||
if (flag) {
|
||||
if (paymentStatus.equals(PaymentStatusEnum.REPAIR.getValue())) {
|
||||
list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(100379, "补缴月份"), "supplementaryMonth"));
|
||||
} else if (paymentStatus.equals(PaymentStatusEnum.RECESSION.getValue())) {
|
||||
list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(100379, "退差月份"), "supplementaryMonth"));
|
||||
}
|
||||
list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(91325, "个税扣缴义务人"), "socialPayOrg"));
|
||||
list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(91324, "社保账号"), "socialAccount"));
|
||||
|
|
|
|||
|
|
@ -155,6 +155,32 @@ public class SIExportController {
|
|||
return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 福利台账-退差核算数据导出
|
||||
*/
|
||||
@GET
|
||||
@Path("/recession/export")
|
||||
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
||||
public Response exportRecession(@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.RECESSION.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