领悦凭证

This commit is contained in:
Harryxzy 2024-10-22 11:33:00 +08:00
parent 8c49838adc
commit bd76b44fbf
6 changed files with 98 additions and 55 deletions

View File

@ -143,8 +143,8 @@ public class LyFundReportServiceImpl extends Service implements LyFundReportServ
param.setSalaryMonthDate(salaryMonthDate);
// 获取本月是否已有报表数据
List<LyFundReportPO> lySocialReportPOS = listBySalaryMonth(salaryMonthDate);
if (CollectionUtils.isNotEmpty(lySocialReportPOS)) {
List<LyFundReportPO> lyFundReportPOS = listBySalaryMonth(salaryMonthDate);
if (CollectionUtils.isNotEmpty(lyFundReportPOS)) {
throw new SalaryRunTimeException("本薪资所属月已生成公积金汇总报表,无法生成公积金汇总报表数据");
}
BaseBean baseBean = new BaseBean();
@ -177,16 +177,16 @@ public class LyFundReportServiceImpl extends Service implements LyFundReportServ
Long znxmmcItemId = getPropLongValue(baseBean, "lySalaryNCReport", "fund_znxmmc_item_id");
salaryItemIds.add(znxmmcItemId);
// 公积金-公司部分
Long gjjgsbfItemId = getPropLongValue(baseBean, "lySalaryNCReport", "social_gjj_gsbf_item_id");
Long gjjgsbfItemId = getPropLongValue(baseBean, "lySalaryNCReport", "fund_gjj_gsbf_item_id");
salaryItemIds.add(gjjgsbfItemId);
// 公积金-个人部分
Long gjjgrbfItemId = getPropLongValue(baseBean, "lySalaryNCReport", "social_gjj_grbf_item_id");
Long gjjgrbfItemId = getPropLongValue(baseBean, "lySalaryNCReport", "fund_gjj_grbf_item_id");
salaryItemIds.add(gjjgrbfItemId);
// 公积金-公积金合计
Long gjjgjjhjItemId = getPropLongValue(baseBean, "lySalaryNCReport", "social_gjj_gjjhj_item_id");
Long gjjgjjhjItemId = getPropLongValue(baseBean, "lySalaryNCReport", "fund_gjj_gjjhj_item_id");
salaryItemIds.add(gjjgjjhjItemId);
// 服务费
Long fwfItemId = getPropLongValue(baseBean, "lySalaryNCReport", "social_fwf_item_id");
Long fwfItemId = getPropLongValue(baseBean, "lySalaryNCReport", "fund_fwf_item_id");
salaryItemIds.add(fwfItemId);
List<SalaryItemPO> salaryItemList = getSalaryItemService(user).listByIds(salaryItemIds);
@ -511,23 +511,42 @@ public class LyFundReportServiceImpl extends Service implements LyFundReportServ
List<WeaTableColumnGroup> columns = (List<WeaTableColumnGroup>)resultMap.get("columns");
LyFundReportPO sum = (LyFundReportPO)resultMap.get("sum");
sum.setGmgsqc("合计");
dataList.add(sum);
// dataList.add(sum);
List<Object> headerList = new ArrayList<>(columns);
List<List<Object>> rows = new ArrayList<>();
rows.add(headerList);
for (LyFundReportPO lySocialReportPO : dataList) {
for (LyFundReportPO lyFundReportPO : dataList) {
List<Object> row = Lists.newArrayList();
row.add(lySocialReportPO.getGmgsqc() == null ? "" : lySocialReportPO.getGmgsqc().toString());
row.add(lySocialReportPO.getFtempNum() == null ? "" : lySocialReportPO.getFtempNum().toString());
row.add(lySocialReportPO.getFycdgsqc() == null ? "" : lySocialReportPO.getFycdgsqc().toString());
row.add(lySocialReportPO.getZnxmmc() == null ? "" : lySocialReportPO.getZnxmmc().toString());
row.add(lyFundReportPO.getGmgsqc() == null ? "" : lyFundReportPO.getGmgsqc().toString());
row.add(lyFundReportPO.getFtempNum() == null ? "" : lyFundReportPO.getFtempNum().toString());
row.add(lyFundReportPO.getFycdgsqc() == null ? "" : lyFundReportPO.getFycdgsqc().toString());
row.add(lyFundReportPO.getZnxmmc() == null ? "" : lyFundReportPO.getZnxmmc().toString());
row.add(param.getSalaryMonth());
row.add(lySocialReportPO.getGjjGsbf() == null ? "" : lySocialReportPO.getGjjGsbf());
row.add(lySocialReportPO.getGjjGrbf() == null ? "" : lySocialReportPO.getGjjGrbf());
row.add(lySocialReportPO.getGjjGjjhj() == null ? "" : lySocialReportPO.getGjjGjjhj());
row.add(lySocialReportPO.getFwf() == null ? "" : lySocialReportPO.getFwf());
row.add((lyFundReportPO.getGjjjtpzFlag() != null && lyFundReportPO.getGjjjtpzFlag().equals(NumberUtils.INTEGER_ONE)) ? "已推送" : "未推送");
row.add((lyFundReportPO.getGjjffpzFlag() != null && lyFundReportPO.getGjjffpzFlag().equals(NumberUtils.INTEGER_ONE)) ? "已推送" : "未推送");
row.add(lyFundReportPO.getGjjGsbf() == null ? "" : lyFundReportPO.getGjjGsbf());
row.add(lyFundReportPO.getGjjGrbf() == null ? "" : lyFundReportPO.getGjjGrbf());
row.add(lyFundReportPO.getGjjGjjhj() == null ? "" : lyFundReportPO.getGjjGjjhj());
row.add(lyFundReportPO.getFwf() == null ? "" : lyFundReportPO.getFwf());
rows.add(row);
}
// 合计行
if (sum != null) {
List<Object> row = Lists.newArrayList();
row.add(sum.getGmgsqc() == null ? "" : sum.getGmgsqc().toString());
row.add(sum.getFtempNum() == null ? "" : sum.getFtempNum().toString());
row.add(sum.getFycdgsqc() == null ? "" : sum.getFycdgsqc().toString());
row.add(sum.getZnxmmc() == null ? "" : sum.getZnxmmc().toString());
row.add(param.getSalaryMonth());
row.add("");
row.add("");
row.add(sum.getGjjGsbf() == null ? "" : sum.getGjjGsbf());
row.add(sum.getGjjGrbf() == null ? "" : sum.getGjjGrbf());
row.add(sum.getGjjGjjhj() == null ? "" : sum.getGjjGjjhj());
row.add(sum.getFwf() == null ? "" : sum.getFwf());
rows.add(row);
}

View File

@ -931,8 +931,6 @@ public class LyPZServiceImpl extends Service implements LyPZService {
lyNCVoucherUfinterface.setSender(sender);
// "<?xml version=\"1.0\" encoding='gb2312'?>"
String xml = XStreamUtil.marshal(lyNCVoucherUfinterface);
System.out.println(xml);
HttpClient httpClient = new HttpClient();
String accountParam = baseBean.getPropValue("lySalaryNCVoucherPushParam", "account_param");
@ -960,6 +958,7 @@ public class LyPZServiceImpl extends Service implements LyPZService {
}
} catch (Exception e) {
baseBean.writeLog("推送错误" + e.getMessage());
baseBean.writeLog("push detail" + xml);
throw new SalaryRunTimeException("推送错误,请联系管理员");
}
}

View File

@ -654,6 +654,8 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport
map.put("shkcxTcf" ,map.getOrDefault("shkcxTcf", BigDecimal.valueOf(0)).add(shkcxTcf));
BigDecimal shkcxGstz = NumberUtils.isCreatable(reportPO.getShkcxGstz()) ? new BigDecimal(reportPO.getShkcxGstz()) : BigDecimal.ZERO;
map.put("shkcxGstz" ,map.getOrDefault("shkcxGstz", BigDecimal.valueOf(0)).add(shkcxGstz));
BigDecimal shkcxQt = NumberUtils.isCreatable(reportPO.getShkcxQt()) ? new BigDecimal(reportPO.getShkcxQt()) : BigDecimal.ZERO;
map.put("shkcxQt" ,map.getOrDefault("shkcxQt", BigDecimal.valueOf(0)).add(shkcxQt));
BigDecimal bysf = NumberUtils.isCreatable(reportPO.getBysf()) ? new BigDecimal(reportPO.getBysf()) : BigDecimal.ZERO;
map.put("bysf" ,map.getOrDefault("bysf", BigDecimal.valueOf(0)).add(bysf));
});
@ -674,6 +676,7 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport
.shkcxAxhzj(map.getOrDefault("shkcxAxhzj", BigDecimal.ZERO).toString())
.shkcxTcf(map.getOrDefault("shkcxTcf", BigDecimal.ZERO).toString())
.shkcxGstz(map.getOrDefault("shkcxGstz", BigDecimal.ZERO).toString())
.shkcxQt(map.getOrDefault("shkcxQt", BigDecimal.ZERO).toString())
.bysf(map.getOrDefault("bysf", BigDecimal.ZERO).toString())
.build();
}

View File

@ -230,15 +230,15 @@ public class LySocialReportServiceImpl extends Service implements LySocialReport
// 社保-社保合计
Long sbsbhjItemId = getPropLongValue(baseBean, "lySalaryNCReport", "social_sb_sbhj_item_id");
salaryItemIds.add(sbsbhjItemId);
// 公积金-公司部分
Long gjjgsbfItemId = getPropLongValue(baseBean, "lySalaryNCReport", "social_gjj_gsbf_item_id");
salaryItemIds.add(gjjgsbfItemId);
// 公积金-个人部分
Long gjjgrbfItemId = getPropLongValue(baseBean, "lySalaryNCReport", "social_gjj_grbf_item_id");
salaryItemIds.add(gjjgrbfItemId);
// 公积金-公积金合计
Long gjjgjjhjItemId = getPropLongValue(baseBean, "lySalaryNCReport", "social_gjj_gjjhj_item_id");
salaryItemIds.add(gjjgjjhjItemId);
// // 公积金-公司部分
// Long gjjgsbfItemId = getPropLongValue(baseBean, "lySalaryNCReport", "social_gjj_gsbf_item_id");
// salaryItemIds.add(gjjgsbfItemId);
// // 公积金-个人部分
// Long gjjgrbfItemId = getPropLongValue(baseBean, "lySalaryNCReport", "social_gjj_grbf_item_id");
// salaryItemIds.add(gjjgrbfItemId);
// // 公积金-公积金合计
// Long gjjgjjhjItemId = getPropLongValue(baseBean, "lySalaryNCReport", "social_gjj_gjjhj_item_id");
// salaryItemIds.add(gjjgjjhjItemId);
// 服务费
Long fwfItemId = getPropLongValue(baseBean, "lySalaryNCReport", "social_fwf_item_id");
salaryItemIds.add(fwfItemId);
@ -295,9 +295,9 @@ public class LySocialReportServiceImpl extends Service implements LySocialReport
.sbGsbf(valueMap.getOrDefault(sbgsbfItemId.toString(), "0").toString())
.sbGrbf(valueMap.getOrDefault(sbgrbfItemId.toString(), "0").toString())
.sbSbhj(valueMap.getOrDefault(sbsbhjItemId.toString(), "0").toString())
.gjjGsbf(valueMap.getOrDefault(gjjgsbfItemId.toString(), "0").toString())
.gjjGrbf(valueMap.getOrDefault(gjjgrbfItemId.toString(), "0").toString())
.gjjGjjhj(valueMap.getOrDefault(gjjgjjhjItemId.toString(), "0").toString())
// .gjjGsbf(valueMap.getOrDefault(gjjgsbfItemId.toString(), "0").toString())
// .gjjGrbf(valueMap.getOrDefault(gjjgrbfItemId.toString(), "0").toString())
// .gjjGjjhj(valueMap.getOrDefault(gjjgjjhjItemId.toString(), "0").toString())
.fwf(valueMap.getOrDefault(fwfItemId.toString(), "0").toString())
.gkgrygzhje("")
.dataSorce(dataSourceStr)
@ -524,14 +524,6 @@ public class LySocialReportServiceImpl extends Service implements LySocialReport
sbGroup.setChildren(sbChildList);
columns.add(sbGroup);
WeaTableColumnGroup gjjGroup = new WeaTableColumnGroup("150px", "公积金", "公积金");
List<WeaTableColumnGroup> gjjChildList = new ArrayList<>();
gjjChildList.add(new WeaTableColumnGroup("150px", "公司部分", "gjjGsbf"));
gjjChildList.add(new WeaTableColumnGroup("150px", "个人部分", "gjjGrbf"));
gjjChildList.add(new WeaTableColumnGroup("150px", "公积金合计", "gjjGjjhj"));
gjjGroup.setChildren(gjjChildList);
columns.add(gjjGroup);
columns.add(new WeaTableColumnGroup("150px", "服务费", "fwf"));
columns.add(new WeaTableColumnGroup("150px", "挂靠个人应该转回金额", "gkgrygzhje"));
@ -600,14 +592,18 @@ public class LySocialReportServiceImpl extends Service implements LySocialReport
map.put("sbGsbf" ,map.getOrDefault("sbGsbf", BigDecimal.valueOf(0)).add(sbGsbf));
BigDecimal sbGrbf = NumberUtils.isCreatable(reportPO.getSbGrbf()) ? new BigDecimal(reportPO.getSbGrbf()) : BigDecimal.ZERO;
map.put("sbGrbf" ,map.getOrDefault("sbGrbf", BigDecimal.valueOf(0)).add(sbGrbf));
BigDecimal gjjGsbf = NumberUtils.isCreatable(reportPO.getGjjGsbf()) ? new BigDecimal(reportPO.getGjjGsbf()) : BigDecimal.ZERO;
map.put("gjjGsbf" ,map.getOrDefault("gjjGsbf", BigDecimal.valueOf(0)).add(gjjGsbf));
BigDecimal gjjGrbf = NumberUtils.isCreatable(reportPO.getGjjGrbf()) ? new BigDecimal(reportPO.getGjjGrbf()) : BigDecimal.ZERO;
map.put("gjjGrbf" ,map.getOrDefault("gjjGrbf", BigDecimal.valueOf(0)).add(gjjGrbf));
BigDecimal gjjGjjhj = NumberUtils.isCreatable(reportPO.getGjjGjjhj()) ? new BigDecimal(reportPO.getGjjGjjhj()) : BigDecimal.ZERO;
map.put("gjjGjjhj" ,map.getOrDefault("gjjGjjhj", BigDecimal.valueOf(0)).add(gjjGjjhj));
BigDecimal sbSbhj = NumberUtils.isCreatable(reportPO.getSbSbhj()) ? new BigDecimal(reportPO.getSbSbhj()) : BigDecimal.ZERO;
map.put("sbSbhj" ,map.getOrDefault("sbSbhj", BigDecimal.valueOf(0)).add(sbSbhj));
// BigDecimal gjjGsbf = NumberUtils.isCreatable(reportPO.getGjjGsbf()) ? new BigDecimal(reportPO.getGjjGsbf()) : BigDecimal.ZERO;
// map.put("gjjGsbf" ,map.getOrDefault("gjjGsbf", BigDecimal.valueOf(0)).add(gjjGsbf));
// BigDecimal gjjGrbf = NumberUtils.isCreatable(reportPO.getGjjGrbf()) ? new BigDecimal(reportPO.getGjjGrbf()) : BigDecimal.ZERO;
// map.put("gjjGrbf" ,map.getOrDefault("gjjGrbf", BigDecimal.valueOf(0)).add(gjjGrbf));
// BigDecimal gjjGjjhj = NumberUtils.isCreatable(reportPO.getGjjGjjhj()) ? new BigDecimal(reportPO.getGjjGjjhj()) : BigDecimal.ZERO;
// map.put("gjjGjjhj" ,map.getOrDefault("gjjGjjhj", BigDecimal.valueOf(0)).add(gjjGjjhj));
BigDecimal fwf = NumberUtils.isCreatable(reportPO.getFwf()) ? new BigDecimal(reportPO.getFwf()) : BigDecimal.ZERO;
map.put("fwf" ,map.getOrDefault("fwf", BigDecimal.valueOf(0)).add(fwf));
BigDecimal gkgrygzhje = NumberUtils.isCreatable(reportPO.getGkgrygzhje()) ? new BigDecimal(reportPO.getGkgrygzhje()) : BigDecimal.ZERO;
map.put("gkgrygzhje" ,map.getOrDefault("gkgrygzhje", BigDecimal.valueOf(0)).add(gkgrygzhje));
});
return LySocialReportPO.builder()
@ -623,10 +619,12 @@ public class LySocialReportServiceImpl extends Service implements LySocialReport
.bcyljqtGsbf(map.getOrDefault("bcyljqtGsbf", BigDecimal.valueOf(0)).toString())
.sbGsbf(map.getOrDefault("sbGsbf", BigDecimal.valueOf(0)).toString())
.sbGrbf(map.getOrDefault("sbGrbf", BigDecimal.valueOf(0)).toString())
.gjjGsbf(map.getOrDefault("gjjGsbf", BigDecimal.valueOf(0)).toString())
.gjjGrbf(map.getOrDefault("gjjGrbf", BigDecimal.valueOf(0)).toString())
.gjjGjjhj(map.getOrDefault("gjjGjjhj", BigDecimal.valueOf(0)).toString())
.sbSbhj(map.getOrDefault("sbSbhj", BigDecimal.valueOf(0)).toString())
// .gjjGsbf(map.getOrDefault("gjjGsbf", BigDecimal.valueOf(0)).toString())
// .gjjGrbf(map.getOrDefault("gjjGrbf", BigDecimal.valueOf(0)).toString())
// .gjjGjjhj(map.getOrDefault("gjjGjjhj", BigDecimal.valueOf(0)).toString())
.fwf(map.getOrDefault("fwf", BigDecimal.valueOf(0)).toString())
// .gkgrygzhje(map.getOrDefault("gkgrygzhje", BigDecimal.valueOf(0)).toString())
.build();
}
@ -661,7 +659,7 @@ public class LySocialReportServiceImpl extends Service implements LySocialReport
List<WeaTableColumnGroup> columns = (List<WeaTableColumnGroup>)resultMap.get("columns");
LySocialReportPO sum = (LySocialReportPO)resultMap.get("sum");
sum.setGmgsqc("合计");
dataList.add(sum);
// dataList.add(sum);
List<Object> headerList = new ArrayList<>(columns);
List<List<Object>> rows = new ArrayList<>();
@ -674,6 +672,8 @@ public class LySocialReportServiceImpl extends Service implements LySocialReport
row.add(lySocialReportPO.getFycdgsqc() == null ? "" : lySocialReportPO.getFycdgsqc().toString());
row.add(lySocialReportPO.getZnxmmc() == null ? "" : lySocialReportPO.getZnxmmc().toString());
row.add(param.getSalaryMonth());
row.add((lySocialReportPO.getSbjtpzFlag() != null && lySocialReportPO.getSbjtpzFlag().equals(NumberUtils.INTEGER_ONE)) ? "已推送" : "未推送");
row.add((lySocialReportPO.getSbffpzFlag() != null && lySocialReportPO.getSbffpzFlag().equals(NumberUtils.INTEGER_ONE)) ? "已推送" : "未推送");
row.add(lySocialReportPO.getYlGsbf() == null ? "" : lySocialReportPO.getYlGsbf());
row.add(lySocialReportPO.getYlGrbf() == null ? "" : lySocialReportPO.getYlGrbf());
row.add(lySocialReportPO.getYiliaoGsbf() == null ? "" : lySocialReportPO.getYiliaoGsbf());
@ -686,12 +686,34 @@ public class LySocialReportServiceImpl extends Service implements LySocialReport
row.add(lySocialReportPO.getSbGsbf() == null ? "" : lySocialReportPO.getSbGsbf());
row.add(lySocialReportPO.getSbGrbf() == null ? "" : lySocialReportPO.getSbGrbf());
row.add(lySocialReportPO.getSbSbhj() == null ? "" : lySocialReportPO.getSbSbhj());
row.add(lySocialReportPO.getGjjGsbf() == null ? "" : lySocialReportPO.getGjjGsbf());
row.add(lySocialReportPO.getGjjGrbf() == null ? "" : lySocialReportPO.getGjjGrbf());
row.add(lySocialReportPO.getGjjGjjhj() == null ? "" : lySocialReportPO.getGjjGjjhj());
row.add(lySocialReportPO.getFwf() == null ? "" : lySocialReportPO.getFwf());
rows.add(row);
}
// 合计行
if (sum != null) {
List<Object> row = Lists.newArrayList();
row.add(sum.getGmgsqc() == null ? "" : sum.getGmgsqc().toString());
row.add(sum.getFtempNum() == null ? "" : sum.getFtempNum().toString());
row.add(sum.getFycdgsqc() == null ? "" : sum.getFycdgsqc().toString());
row.add(sum.getZnxmmc() == null ? "" : sum.getZnxmmc().toString());
row.add(param.getSalaryMonth());
row.add("");
row.add("");
row.add(sum.getYlGsbf() == null ? "" : sum.getYlGsbf());
row.add(sum.getYlGrbf() == null ? "" : sum.getYlGrbf());
row.add(sum.getYiliaoGsbf() == null ? "" : sum.getYiliaoGsbf());
row.add(sum.getYiliaoGrbf() == null ? "" : sum.getYiliaoGrbf());
row.add(sum.getSyGsbf() == null ? "" : sum.getSyGsbf());
row.add(sum.getSyGrbf() == null ? "" : sum.getSyGrbf());
row.add(sum.getShengyGsbf() == null ? "" : sum.getShengyGsbf());
row.add(sum.getGsGsbf() == null ? "" : sum.getGsGsbf());
row.add(sum.getBcyljqtGsbf() == null ? "" : sum.getBcyljqtGsbf());
row.add(sum.getSbGsbf() == null ? "" : sum.getSbGsbf());
row.add(sum.getSbGrbf() == null ? "" : sum.getSbGrbf());
row.add(sum.getSbSbhj() == null ? "" : sum.getSbSbhj());
row.add(sum.getFwf() == null ? "" : sum.getFwf());
rows.add(row);
}
//获取excel
return ExcelUtilPlus.genWorkbookWithChildTitleColumn(rows, "社保统计报表", true);

View File

@ -273,7 +273,7 @@ public class LySalaryController {
User user = HrmUserVarify.getUser(request, response);
XSSFWorkbook workbook = getLySalaryWrapper(user).exportSIReport(param);
String time = LocalDate.now().toString();
String fileName = param.getSalaryMonth() +"社保公积金汇总报表" + "-" + time;
String fileName = param.getSalaryMonth() +"社保汇总报表" + "-" + time;
try {
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
} catch (UnsupportedEncodingException e) {
@ -286,7 +286,7 @@ public class LySalaryController {
response.setContentType("application/octet-stream");
return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build();
} catch (Exception e) {
log.error("社保公积金汇总报表导出异常", e);
log.error("社保汇总报表导出异常", e);
throw e;
}
}
@ -385,7 +385,7 @@ public class LySalaryController {
* @return
*/
@POST
@Path("/FundReport/export")
@Path("/fundReport/export")
@Produces(MediaType.APPLICATION_OCTET_STREAM)
public Response exportFundReport(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody LySalaryReportQueryParam param) {
try {

View File

@ -92,7 +92,7 @@ public class LySalaryWrapper extends Service {
}
/**
* 社保公积金汇总报表 合计行
* 社保汇总报表 合计行
*
* @param param
*/