薪酬系统-福利台账,福利核算、明细列表、导出数据,适配拆分福利档案个人和公司基数逻辑

This commit is contained in:
sy 2023-12-08 11:16:18 +08:00
parent bb1b785f55
commit 1c5249c76e
13 changed files with 730 additions and 108 deletions

View File

@ -631,11 +631,13 @@ public class SIAccountBiz extends Service {
}
public InsuranceAccountDetailPO accountOther(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth, String tenantKey) {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
if (accountPO.getOther() != null) {
InsuranceArchivesOtherSchemePO otherPO = accountPO.getOther();
insuranceAccountDetailPO.setOtherPayOrg(otherPO.getPaymentOrganization());
insuranceAccountDetailPO.setOtherSchemeId(otherPO.getOtherSchemeId());
insuranceAccountDetailPO.setOtherPaymentBaseString(otherPO.getOtherPaymentBaseString());
insuranceAccountDetailPO.setOtherPaymentComBaseString(otherPO.getOtherPaymentComBaseString());
//判断是否在起始缴纳月和最后缴纳月之间
Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), otherPO.getOtherStartTime(), otherPO.getOtherEndTime());
if ((Objects.equals(NonPaymentEnum.YES.getValue(), otherPO.getNonPayment()) || otherPO.getNonPayment() == null) && otherPO.getOtherSchemeId() != null && inDataRange) {
@ -719,7 +721,13 @@ public class SIAccountBiz extends Service {
.collect(
Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity()));
//档案中包含的基数信息
HashMap<String, String> archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap<String, String>().getClass());
// HashMap<String, String> archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap<String, String>().getClass());
HashMap<String, String> archivesCom = new HashMap<>();
if (welBaseDiffSign) {
archivesCom = JSON.parseObject(otherPO.getOtherPaymentComBaseString(), new HashMap<String, String>().getClass());
} else {
archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap<String, String>().getClass());
}
//需要核算其他的福利id 单位
List<Long> needArchivesCom = new ArrayList<>();
if (archivesCom != null) {
@ -742,10 +750,11 @@ public class SIAccountBiz extends Service {
List<BigDecimal> otherComList = new ArrayList<>();
Map<String, String> otherComJsonMap = new HashMap<>();
HashMap<String, String> finalArchivesCom = archivesCom;
needArchivesCom.stream().forEach(e -> {
InsuranceSchemeDetailPO po = otherCom.get(e);
BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100"));
BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e)));
BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e)));
BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost());
Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum();
// BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost));
@ -787,6 +796,7 @@ public class SIAccountBiz extends Service {
public InsuranceAccountDetailPO accountFund(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth, String tenantKey) {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
if (accountPO.getFund() != null) {
InsuranceArchivesFundSchemePO fundPO = accountPO.getFund();
insuranceAccountDetailPO.setFundPayOrg(fundPO.getPaymentOrganization());
@ -794,6 +804,7 @@ public class SIAccountBiz extends Service {
insuranceAccountDetailPO.setSupplementFundAccount(fundPO.getSupplementFundAccount());
insuranceAccountDetailPO.setFundSchemeId(fundPO.getFundSchemeId());
insuranceAccountDetailPO.setFundPaymentBaseString(fundPO.getFundPaymentBaseString());
insuranceAccountDetailPO.setFundPaymentComBaseString(fundPO.getFundPaymentComBaseString());
//判断是否在起始缴纳月和最后缴纳月之间
Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), fundPO.getFundStartTime(), fundPO.getFundEndTime());
if ((NonPaymentEnum.YES.getValue() == fundPO.getNonPayment() || fundPO.getNonPayment() == null) && fundPO.getFundSchemeId() != null && inDataRange) {
@ -876,7 +887,13 @@ public class SIAccountBiz extends Service {
.collect(
Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity()));
//档案中包含的基数信息
HashMap<String, String> archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap<String, String>().getClass());
// HashMap<String, String> archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap<String, String>().getClass());
HashMap<String, String> archivesCom = new HashMap<>();
if (welBaseDiffSign) {
archivesCom = JSON.parseObject(fundPO.getFundPaymentComBaseString(), new HashMap<String, String>().getClass());
} else {
archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap<String, String>().getClass());
}
//需要核算公积金的福利id 单位
List<Long> needArchivesCom = new ArrayList<>();
if (archivesCom != null) {
@ -899,10 +916,11 @@ public class SIAccountBiz extends Service {
List<BigDecimal> fundComList = new ArrayList<>();
Map<String, String> fundComJsonMap = new HashMap<>();
HashMap<String, String> finalArchivesCom = archivesCom;
needArchivesCom.stream().forEach(e -> {
InsuranceSchemeDetailPO po = fundCom.get(e);
BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100"));
BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e)));
BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e)));
BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost());
Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum();
// BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost));
@ -945,12 +963,14 @@ public class SIAccountBiz extends Service {
public InsuranceAccountDetailPO accountSocial(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth, String tenantKey) {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
if (accountPO.getSocial() != null) {
InsuranceArchivesSocialSchemePO socialPO = accountPO.getSocial();
insuranceAccountDetailPO.setSocialPayOrg(socialPO.getPaymentOrganization());
insuranceAccountDetailPO.setSocialAccount(socialPO.getSocialAccount());
insuranceAccountDetailPO.setSocialSchemeId(socialPO.getSocialSchemeId());
insuranceAccountDetailPO.setSocialPaymentBaseString(socialPO.getSocialPaymentBaseString());
insuranceAccountDetailPO.setSocialPaymentComBaseString(socialPO.getSocialPaymentComBaseString());
//判断是否在起始缴纳月和最后缴纳月之间
Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), socialPO.getSocialStartTime(), socialPO.getSocialEndTime());
if ((NonPaymentEnum.YES.getValue().equals(socialPO.getNonPayment()) || socialPO.getNonPayment() == null) && socialPO.getSocialSchemeId() != null && inDataRange) {
@ -1036,7 +1056,13 @@ public class SIAccountBiz extends Service {
.collect(
Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity()));
//档案中包含的基数信息
HashMap<String, String> archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
// HashMap<String, String> archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
HashMap<String, String> archivesCom = new HashMap<>();
if (welBaseDiffSign) {
archivesCom = JSON.parseObject(socialPO.getSocialPaymentComBaseString(), new HashMap<String, String>().getClass());
} else {
archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
}
//需要核算社保的福利id 单位
List<Long> needArchivesCom = new ArrayList<>();
if (archivesCom != null) {
@ -1059,10 +1085,11 @@ public class SIAccountBiz extends Service {
List<BigDecimal> socialCom = new ArrayList<>();
Map<String, String> sociaComJsonMap = new HashMap<>();
HashMap<String, String> finalArchivesCom = archivesCom;
needArchivesCom.stream().forEach(e -> {
InsuranceSchemeDetailPO po = schemeCom.get(e);
BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100"));
BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e)));
BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e)));
BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost());
Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum();
// BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost));
@ -1510,7 +1537,6 @@ public class SIAccountBiz extends Service {
} else {
accountFund(insuranceAccountDetailPO, accountPO, baseParam.getSupplementaryMonth());
}
}
if (projects.contains(ProjectTypeEnum.OTHER.getValue())) {
@ -1532,11 +1558,13 @@ public class SIAccountBiz extends Service {
public InsuranceAccountDetailPO accountOther(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth) {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
if (accountPO.getOther() != null) {
InsuranceArchivesOtherSchemePO otherPO = accountPO.getOther();
insuranceAccountDetailPO.setOtherPayOrg(otherPO.getPaymentOrganization());
insuranceAccountDetailPO.setOtherSchemeId(otherPO.getOtherSchemeId());
insuranceAccountDetailPO.setOtherPaymentBaseString(otherPO.getOtherPaymentBaseString());
insuranceAccountDetailPO.setOtherPaymentComBaseString(otherPO.getOtherPaymentComBaseString());
//判断是否在起始缴纳月和最后缴纳月之间
Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, otherPO.getOtherStartTime(), otherPO.getOtherEndTime());
if ((Objects.equals(NonPaymentEnum.YES.getValue(), otherPO.getNonPayment()) || otherPO.getNonPayment() == null) && otherPO.getOtherSchemeId() != null && inDataRange) {
@ -1611,7 +1639,13 @@ public class SIAccountBiz extends Service {
.collect(
Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity()));
//档案中包含的基数信息
HashMap<String, String> archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap<String, String>().getClass());
// HashMap<String, String> archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap<String, String>().getClass());
HashMap<String, String> archivesCom = new HashMap<>();
if (welBaseDiffSign) {
archivesCom = JSON.parseObject(otherPO.getOtherPaymentComBaseString(), new HashMap<String, String>().getClass());
} else {
archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap<String, String>().getClass());
}
//需要核算其他的福利id 单位
List<Long> needArchivesCom = new ArrayList<>();
if (archivesCom != null) {
@ -1626,10 +1660,11 @@ public class SIAccountBiz extends Service {
List<BigDecimal> otherComList = new ArrayList<>();
Map<String, String> otherComJsonMap = new HashMap<>();
HashMap<String, String> finalArchivesCom = archivesCom;
needArchivesCom.stream().forEach(e -> {
InsuranceSchemeDetailPO po = otherCom.get(e);
BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100"));
BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e)));
BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e)));
BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost());
Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum();
// BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost));
@ -1671,6 +1706,7 @@ public class SIAccountBiz extends Service {
}
public InsuranceAccountDetailPO accountFund(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth) {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
if (accountPO.getFund() != null) {
InsuranceArchivesFundSchemePO fundPO = accountPO.getFund();
insuranceAccountDetailPO.setFundPayOrg(fundPO.getPaymentOrganization());
@ -1678,6 +1714,7 @@ public class SIAccountBiz extends Service {
insuranceAccountDetailPO.setSupplementFundAccount(fundPO.getSupplementFundAccount());
insuranceAccountDetailPO.setFundSchemeId(fundPO.getFundSchemeId());
insuranceAccountDetailPO.setFundPaymentBaseString(fundPO.getFundPaymentBaseString());
insuranceAccountDetailPO.setFundPaymentComBaseString(fundPO.getFundPaymentComBaseString());
//判断是否在起始缴纳月和最后缴纳月之间
Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, fundPO.getFundStartTime(), fundPO.getFundEndTime());
if ((Objects.equals(NonPaymentEnum.YES.getValue(), fundPO.getNonPayment()) || fundPO.getNonPayment() == null) && fundPO.getFundSchemeId() != null && inDataRange) {
@ -1751,7 +1788,13 @@ public class SIAccountBiz extends Service {
.collect(
Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity()));
//档案中包含的基数信息
HashMap<String, String> archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap<String, String>().getClass());
// HashMap<String, String> archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap<String, String>().getClass());
HashMap<String, String> archivesCom = new HashMap<>();
if (welBaseDiffSign) {
archivesCom = JSON.parseObject(fundPO.getFundPaymentComBaseString(), new HashMap<String, String>().getClass());
} else {
archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap<String, String>().getClass());
}
//需要核算公积金的福利id 单位
List<Long> needArchivesCom = new ArrayList<>();
if (archivesCom != null) {
@ -1766,10 +1809,11 @@ public class SIAccountBiz extends Service {
List<BigDecimal> fundComList = new ArrayList<>();
Map<String, String> fundComJsonMap = new HashMap<>();
HashMap<String, String> finalArchivesCom = archivesCom;
needArchivesCom.stream().forEach(e -> {
InsuranceSchemeDetailPO po = fundCom.get(e);
BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100"));
BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e)));
BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e)));
BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost());
Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum();
// BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost));
@ -1812,12 +1856,14 @@ public class SIAccountBiz extends Service {
}
public InsuranceAccountDetailPO accountSocial(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth) {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
if (accountPO.getSocial() != null) {
InsuranceArchivesSocialSchemePO socialPO = accountPO.getSocial();
insuranceAccountDetailPO.setSocialPayOrg(socialPO.getPaymentOrganization());
insuranceAccountDetailPO.setSocialAccount(socialPO.getSocialAccount());
insuranceAccountDetailPO.setSocialSchemeId(socialPO.getSocialSchemeId());
insuranceAccountDetailPO.setSocialPaymentBaseString(socialPO.getSocialPaymentBaseString());
insuranceAccountDetailPO.setSocialPaymentComBaseString(socialPO.getSocialPaymentComBaseString());
//判断是否在起始缴纳月和最后缴纳月之间
Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, socialPO.getSocialStartTime(), socialPO.getSocialEndTime());
if ((Objects.equals(NonPaymentEnum.YES.getValue(), socialPO.getNonPayment()) || socialPO.getNonPayment() == null) && socialPO.getSocialSchemeId() != null && inDataRange) {
@ -1896,7 +1942,13 @@ public class SIAccountBiz extends Service {
.collect(
Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity()));
//档案中包含的基数信息
HashMap<String, String> archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
// HashMap<String, String> archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
HashMap<String, String> archivesCom = new HashMap<>();
if (welBaseDiffSign) {
archivesCom = JSON.parseObject(socialPO.getSocialPaymentComBaseString(), new HashMap<String, String>().getClass());
} else {
archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
}
//需要核算社保的福利id 单位
List<Long> needArchivesCom = new ArrayList<>();
if (archivesCom != null) {
@ -1911,10 +1963,11 @@ public class SIAccountBiz extends Service {
List<BigDecimal> socialCom = new ArrayList<>();
Map<String, String> sociaComJsonMap = new HashMap<>();
HashMap<String, String> finalArchivesCom = archivesCom;
needArchivesCom.stream().forEach(e -> {
InsuranceSchemeDetailPO po = schemeCom.get(e);
BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100"));
BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e)));
BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e)));
BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost());
Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum();
// BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost));
@ -1964,6 +2017,7 @@ public class SIAccountBiz extends Service {
insuranceAccountDetailPO.setSocialAccount(socialPO.getSocialAccount());
insuranceAccountDetailPO.setSocialSchemeId(socialPO.getSocialSchemeId());
insuranceAccountDetailPO.setSocialPaymentBaseString(socialPO.getSocialPaymentBaseString());
insuranceAccountDetailPO.setSocialPaymentComBaseString(socialPO.getSocialPaymentComBaseString());
//判断是否在起始缴纳月和最后缴纳月之间
Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, socialPO.getSocialStartTime(), socialPO.getSocialEndTime());

View File

@ -41,7 +41,7 @@ public class InsuranceComparisonResultBO {
* 构建福利核算结果列表的表头线下对比
*
*/
public static List<Column> buildTableColumns4ComparisonResult(Set<Long> insuranceBaseSet, Set<Long> insurancePerPaySet, Set<Long> insuranceComPaySet) {
public static List<Column> buildTableColumns4ComparisonResult(Set<Long> insuranceBaseSet, Set<Long> insurancePerPaySet, Set<Long> insuranceComPaySet, boolean welBaseDiffSign) {
List<ICategoryPO> listAll = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll();
List<ICategoryPO> socialWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 1 && e.getIsUse() == 1 && insuranceBaseSet.contains(e.getId())).collect(Collectors.toList());
@ -67,21 +67,63 @@ public class InsuranceComparisonResultBO {
columns.add(new Column("社保账号", "socialAccount", "socialAccount"));
columns.add(new Column("社保方案名称", "socialSchemeName", "socialSchemeName"));
//组装社保基数
for (ICategoryPO po : socialWelfareList) {
columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "socialBase", po.getId() + "socialBase"));
if (welBaseDiffSign) {
List<Column> socialComColumns = Lists.newArrayList();
for (ICategoryPO po : socialWelfareList) {
columns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")
, po.getId() + "socialPerBase", po.getId() + "socialPerBase"));
socialComColumns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")
, po.getId() + "socialComBase", po.getId() + "socialComBase"));
}
columns.addAll(socialComColumns);
} else {
for (ICategoryPO po : socialWelfareList) {
columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "socialBase", po.getId() + "socialBase"));
}
}
// for (ICategoryPO po : socialWelfareList) {
// columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "socialBase", po.getId() + "socialBase"));
// }
columns.add(new Column("公积金账号", "fundAccount", "fundAccount"));
columns.add(new Column("公积金方案名称", "fundSchemeName", "fundSchemeName"));
//组装公积金基数
for (ICategoryPO po : fundWelfareList) {
columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "fundBase", po.getId() + "fundBase"));
if (welBaseDiffSign) {
List<Column> fundComColumns = Lists.newArrayList();
for (ICategoryPO po : fundWelfareList) {
columns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")
, po.getId() + "fundPerBase", po.getId() + "fundPerBase"));
fundComColumns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")
, po.getId() + "fundComBase", po.getId() + "fundComBase"));
}
columns.addAll(fundComColumns);
} else {
for (ICategoryPO po : fundWelfareList) {
columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "fundBase", po.getId() + "fundBase"));
}
}
// for (ICategoryPO po : fundWelfareList) {
// columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "fundBase", po.getId() + "fundBase"));
// }
columns.add(new Column("补充公积金账号", "supplementFundAccount", "supplementFundAccount"));
columns.add(new Column("其他福利方案名称", "otherSchemeName", "otherSchemeName"));
//组装其他福利基数
for (ICategoryPO po : otherWelfareList) {
columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "otherBase", po.getId() + "otherBase"));
if (welBaseDiffSign) {
List<Column> otherComColumns = Lists.newArrayList();
for (ICategoryPO po : otherWelfareList) {
columns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")
, po.getId() + "otherPerBase", po.getId() + "otherPerBase"));
otherComColumns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")
, po.getId() + "otherComBase", po.getId() + "otherComBase"));
}
columns.addAll(otherComColumns);
} else {
for (ICategoryPO po : otherWelfareList) {
columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "otherBase", po.getId() + "otherBase"));
}
}
// for (ICategoryPO po : otherWelfareList) {
// columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "otherBase", po.getId() + "otherBase"));
// }
//社保个人生育保险个人工伤保险个人失业保险个人养老保险个人医疗保险个人
for (ICategoryPO po : socialWelPerList) {
@ -127,7 +169,8 @@ public class InsuranceComparisonResultBO {
* 构建福利核算线下对比结果
*
*/
public static List<Map<String, Object>> buildComparisonTableData(List<AccountExportPO> accountExportPOS, List<ExcelAccountExportPO> excelAccountExportPOS, Map<Long, String> schemeIdNameMap) {
public static List<Map<String, Object>> buildComparisonTableData(List<AccountExportPO> accountExportPOS, List<ExcelAccountExportPO> excelAccountExportPOS
, Map<Long, String> schemeIdNameMap, boolean welBaseDiffSign) {
Map<Long, List<ExcelAccountExportPO>> excelResultMap = SalaryEntityUtil.group2Map(excelAccountExportPOS, ExcelAccountExportPO::getEmployeeId);
// Map<String, List<AccountExportPO>> acctResultMap = SalaryEntityUtil.group2Map(accountExportPOS, AccountExportPO::getWorkcode);
@ -177,6 +220,28 @@ public class InsuranceComparisonResultBO {
if (excelResultValueList != null && excelResultValueList.size() == 1) {
excelAccountExportPO = excelResultValueList.get(0);
}
if (welBaseDiffSign) {
//社保基数-个人socialPaymentBaseString
welfareElementCompare(map, accountExportPO.getSocialPaymentBaseString(), excelAccountExportPO.getSocialPaymentBaseString(), "PerBase", 1);
//公积金基数-个人fundPaymentBaseString
welfareElementCompare(map, accountExportPO.getFundPaymentBaseString(), excelAccountExportPO.getFundPaymentBaseString(), "PerBase", 2);
//其他福利基数-个人otherPaymentBaseString
welfareElementCompare(map, accountExportPO.getOtherPaymentBaseString(), excelAccountExportPO.getOtherPaymentBaseString(), "PerBase", 3);
//社保基数-公司socialPaymentComBaseString
welfareElementCompare(map, accountExportPO.getSocialPaymentComBaseString(), excelAccountExportPO.getSocialPaymentComBaseString(), "ComBase", 1);
//公积金基数-公司fundPaymentComBaseString
welfareElementCompare(map, accountExportPO.getFundPaymentComBaseString(), excelAccountExportPO.getFundPaymentComBaseString(), "ComBase", 2);
//其他福利基数-公司otherPaymentComBaseString
welfareElementCompare(map, accountExportPO.getOtherPaymentComBaseString(), excelAccountExportPO.getOtherPaymentComBaseString(), "ComBase", 3);
} else {
//社保基数socialPaymentBaseString
welfareElementCompare(map, accountExportPO.getSocialPaymentBaseString(), excelAccountExportPO.getSocialPaymentBaseString(), "Base", 1);
//公积金基数fundPaymentBaseString
welfareElementCompare(map, accountExportPO.getFundPaymentBaseString(), excelAccountExportPO.getFundPaymentBaseString(), "Base", 2);
//其他福利基数otherPaymentBaseString
welfareElementCompare(map, accountExportPO.getOtherPaymentBaseString(), excelAccountExportPO.getOtherPaymentBaseString(), "Base", 3);
}
//社保基数socialPaymentBaseString
welfareElementCompare(map, accountExportPO.getSocialPaymentBaseString(), excelAccountExportPO.getSocialPaymentBaseString(), "Base", 1);
//公积金基数fundPaymentBaseString

View File

@ -101,6 +101,12 @@ public class ExcelInsuranceDetailPO {
@Encrypt
private String socialPaymentBaseString;
/**
* 社保缴纳基数单位
*/
@Encrypt
private String socialPaymentComBaseString;
/**
* 公积金方案ID
*/
@ -112,6 +118,12 @@ public class ExcelInsuranceDetailPO {
@Encrypt
private String fundPaymentBaseString;
/**
* 公积金缴纳基数单位
*/
@Encrypt
private String fundPaymentComBaseString;
/**
* 其他福利方案id
*/
@ -123,6 +135,12 @@ public class ExcelInsuranceDetailPO {
@Encrypt
private String otherPaymentBaseString;
/**
* 其他福利缴纳基数单位
*/
@Encrypt
private String otherPaymentComBaseString;
/**
* 社保个人缴费明细
*/

View File

@ -102,6 +102,11 @@ public class InsuranceAccountDetailTempPO {
@Encrypt
private String socialPaymentBaseString;
/**
* 社保缴纳基数单位
*/
@Encrypt
private String socialPaymentComBaseString;
/**
* 公积金方案ID
*/
@ -113,6 +118,12 @@ public class InsuranceAccountDetailTempPO {
@Encrypt
private String fundPaymentBaseString;
/**
* 公积金缴纳基数单位
*/
@Encrypt
private String fundPaymentComBaseString;
/**
* 其他福利方案id
*/
@ -124,6 +135,13 @@ public class InsuranceAccountDetailTempPO {
@Encrypt
private String otherPaymentBaseString;
/**
* 其他福利缴纳基数单位
*/
@Encrypt
private String otherPaymentComBaseString;
/**
* 社保个人缴费明细
*/

View File

@ -18,10 +18,13 @@
<result column="other_pay_org" property="otherPayOrg"/>
<result column="social_scheme_id" property="socialSchemeId"/>
<result column="social_payment_base_string" property="socialPaymentBaseString"/>
<result column="social_payment_com_base_string" property="socialPaymentComBaseString"/>
<result column="fund_scheme_id" property="fundSchemeId"/>
<result column="fund_payment_base_string" property="fundPaymentBaseString"/>
<result column="fund_payment_com_base_string" property="fundPaymentComBaseString"/>
<result column="other_scheme_id" property="otherSchemeId"/>
<result column="other_payment_base_string" property="otherPaymentBaseString"/>
<result column="other_payment_com_base_string" property="otherPaymentComBaseString"/>
<result column="social_per_json" property="socialPerJson"/>
<result column="social_per_sum" property="socialPerSum"/>
<result column="fund_per_json" property="fundPerJson"/>
@ -69,10 +72,13 @@
, t.other_pay_org
, t.social_scheme_id
, t.social_payment_base_string
, t.social_payment_com_base_string
, t.fund_scheme_id
, t.fund_payment_base_string
, t.fund_payment_com_base_string
, t.other_scheme_id
, t.other_payment_base_string
, t.other_payment_com_base_string
, t.social_per_json
, t.social_per_sum
, t.fund_per_json
@ -117,10 +123,13 @@
, t.other_pay_org
, t.social_scheme_id
, t.social_payment_base_string
, t.social_payment_com_base_string
, t.fund_scheme_id
, t.fund_payment_base_string
, t.fund_payment_com_base_string
, t.other_scheme_id
, t.other_payment_base_string
, t.other_payment_com_base_string
, t.social_per_json
, t.social_per_sum
, t.fund_per_json
@ -420,7 +429,8 @@
t.other_com_json,t.social_per_sum,t.social_com_sum,
t.fund_per_sum,t.fund_com_sum,t.other_per_sum,
t.other_com_sum,t.per_sum,t.com_sum,t.payment_organization,
t.social_payment_base_string, t.fund_payment_base_string, t.other_payment_base_string
t.social_payment_base_string, t.fund_payment_base_string, t.other_payment_base_string,
t.social_payment_com_base_string, t.fund_payment_com_base_string, t.other_payment_com_base_string
FROM
hrsa_bill_detail t
WHERE t.delete_type = 0
@ -711,7 +721,8 @@
(employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string,
fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json,
social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum,
com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization)
com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization,
social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string)
VALUES
<foreach collection="accounts" item="item" separator=",">
(
@ -757,7 +768,10 @@
#{item.updateTime},
#{item.deleteType},
#{item.tenantKey},
#{item.paymentOrganization}
#{item.paymentOrganization},
#{item.socialPaymentComBaseString},
#{item.fundPaymentComBaseString},
#{item.otherPaymentComBaseString}
)
</foreach>
</insert>
@ -766,7 +780,8 @@
(employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string,
fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json,
social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum,
com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization)
com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization,
social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string)
<foreach collection="accounts" item="item" separator="union all">
select
#{item.employeeId,jdbcType=DOUBLE},
@ -811,7 +826,10 @@
#{item.updateTime},
#{item.deleteType},
#{item.tenantKey,jdbcType=VARCHAR},
#{item.paymentOrganization,jdbcType=DOUBLE}
#{item.paymentOrganization,jdbcType=DOUBLE},
#{item.socialPaymentComBaseString,jdbcType=VARCHAR},
#{item.fundPaymentComBaseString,jdbcType=VARCHAR},
#{item.otherPaymentComBaseString,jdbcType=VARCHAR}
from dual
</foreach>
</insert>
@ -821,7 +839,8 @@
(employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string,
fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json,
social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum,
com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization)
com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization,
social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string)
VALUES
(
#{item.employeeId},
@ -866,7 +885,10 @@
#{item.updateTime},
#{item.deleteType},
#{item.tenantKey},
#{item.paymentOrganization}
#{item.paymentOrganization},
#{item.socialPaymentComBaseString},
#{item.fundPaymentComBaseString},
#{item.otherPaymentComBaseString}
)
</foreach>
</insert>

View File

@ -18,10 +18,13 @@
<result column="other_pay_org" property="otherPayOrg"/>
<result column="social_scheme_id" property="socialSchemeId"/>
<result column="social_payment_base_string" property="socialPaymentBaseString"/>
<result column="social_payment_com_base_string" property="socialPaymentComBaseString"/>
<result column="fund_scheme_id" property="fundSchemeId"/>
<result column="fund_payment_base_string" property="fundPaymentBaseString"/>
<result column="fund_payment_com_base_string" property="fundPaymentComBaseString"/>
<result column="other_scheme_id" property="otherSchemeId"/>
<result column="other_payment_base_string" property="otherPaymentBaseString"/>
<result column="other_payment_com_base_string" property="otherPaymentComBaseString"/>
<result column="social_per_json" property="socialPerJson"/>
<result column="social_per_sum" property="socialPerSum"/>
<result column="fund_per_json" property="fundPerJson"/>
@ -68,10 +71,13 @@
, t.other_pay_org
, t.social_scheme_id
, t.social_payment_base_string
, t.social_payment_com_base_string
, t.fund_scheme_id
, t.fund_payment_base_string
, t.fund_payment_com_base_string
, t.other_scheme_id
, t.other_payment_base_string
, t.other_payment_com_base_string
, t.social_per_json
, t.social_per_sum
, t.fund_per_json
@ -130,7 +136,8 @@
(employee_id,bill_month,bill_status,payment_status,supplementary_month,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string,
fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json,
social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum,
com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization)
com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization,
social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string)
VALUES
<foreach collection="accounts" item="item" separator=",">
(
@ -175,7 +182,10 @@
#{item.updateTime},
#{item.deleteType},
#{item.tenantKey},
#{item.paymentOrganization}
#{item.paymentOrganization},
#{item.socialPaymentComBaseString},
#{item.fundPaymentComBaseString},
#{item.otherPaymentComBaseString}
)
</foreach>
</insert>
@ -184,7 +194,8 @@
(employee_id,bill_month,bill_status,payment_status,supplementary_month,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string,
fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json,
social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum,
com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization)
com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization,
social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string)
<foreach collection="accounts" item="item" separator="union all">
select
@ -229,7 +240,10 @@
#{item.updateTime},
#{item.deleteType},
#{item.tenantKey,jdbcType=VARCHAR},
#{item.paymentOrganization,jdbcType=DOUBLE}
#{item.paymentOrganization,jdbcType=DOUBLE},
#{item.socialPaymentComBaseString,jdbcType=VARCHAR},
#{item.fundPaymentComBaseString,jdbcType=VARCHAR},
#{item.otherPaymentComBaseString,jdbcType=VARCHAR}
from dual
</foreach>
</insert>
@ -239,7 +253,8 @@
(employee_id,bill_month,bill_status,payment_status,supplementary_month,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string,
fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json,
social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum,
com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization)
com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization,
social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string)
VALUES
(
#{item.employeeId},
@ -283,7 +298,10 @@
#{item.updateTime},
#{item.deleteType},
#{item.tenantKey},
#{item.paymentOrganization}
#{item.paymentOrganization},
#{item.socialPaymentComBaseString},
#{item.fundPaymentComBaseString},
#{item.otherPaymentComBaseString}
)
</foreach>
</insert>

View File

@ -1,6 +1,7 @@
package com.engine.salary.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.cloudstore.eccom.constant.WeaBoolAttr;
import com.cloudstore.eccom.pc.table.WeaTableColumn;
import com.engine.core.impl.Service;
@ -31,6 +32,8 @@ import java.util.stream.Collectors;
**/
public class ColumnBuildServiceImpl extends Service implements ColumnBuildService {
private SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
private ICategoryMapper getICategoryMapper() {
return MapperProxyFactory.getProxy(ICategoryMapper.class);
}
@ -122,58 +125,128 @@ public class ColumnBuildServiceImpl extends Service implements ColumnBuildServic
}
private Map<Integer, Map<String, String>> buildPaymentTitle(List<InsuranceAccountDetailPO> pos, Map<String, String> categoryIdNameMap, Long employeeId, String tenantKey) {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
Set<String> socailIds = new HashSet<>();
Set<String> fundIds = new HashSet<>();
Set<String> otherIds = new HashSet<>();
Set<String> socailComIds = new HashSet<>();
Set<String> fundComIds = new HashSet<>();
Set<String> otherComIds = new HashSet<>();
Map<Integer, Map<String, String>> result = new HashMap<>();
pos.stream().forEach(item -> {
if (StringUtils.isNotBlank(item.getSocialPaymentBaseString())) {
if (StringUtils.isNotBlank(item.getSocialPaymentBaseString()) || StringUtils.isNotBlank(item.getSocialPaymentComBaseString())) {
Map<String, String> socialJson = JSON.parseObject(item.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
if(socialJson!=null){
socialJson.forEach((k, v) -> {
socailIds.add(k);
});
}
//如果需要区分个人和公司福利基数
if (welBaseDiffSign) {
Map<String, Object> socialComJson = JSON.parseObject(item.getSocialPaymentComBaseString(), new TypeReference<Map<String, Object>>() {
});
if (socialComJson != null) {
socialComJson.forEach((k, v) -> socailComIds.add(k));
}
}
}
if (StringUtils.isNotBlank(item.getFundPaymentBaseString())) {
if (StringUtils.isNotBlank(item.getFundPaymentBaseString()) || StringUtils.isNotBlank(item.getFundPaymentComBaseString())) {
Map<String, String> fundJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap<String, String>().getClass());
if(fundJson!=null){
fundJson.forEach((k, v) -> {
fundIds.add(k);
});
}
//如果需要区分个人和公司福利基数
if (welBaseDiffSign) {
Map<String, Object> fundComJson = JSON.parseObject(item.getFundPaymentComBaseString(), new TypeReference<Map<String, Object>>() {
});
if (fundComJson != null) {
fundComJson.forEach((k, v) -> fundComIds.add(k));
}
}
}
if (StringUtils.isNotBlank(item.getOtherPaymentBaseString())) {
if (StringUtils.isNotBlank(item.getOtherPaymentBaseString()) || StringUtils.isNotBlank(item.getOtherPaymentComBaseString())) {
Map<String, String> otherJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap<String, String>().getClass());
if(otherJson!=null){
otherJson.forEach((k, v) -> {
otherIds.add(k);
});
}
//如果需要区分个人和公司福利基数
if (welBaseDiffSign) {
Map<String, Object> otherComJson = JSON.parseObject(item.getOtherPaymentComBaseString(), new TypeReference<Map<String, Object>>() {
});
if (otherComJson != null) {
otherComJson.forEach((k, v) -> otherComIds.add(k));
}
}
}
});
Map<String, String> socialColumns = new HashMap<>();
Map<String, String> fundColumns = new HashMap<>();
Map<String, String> otherColumns = new HashMap<>();
socailIds.stream().forEach(social -> {
if (categoryIdNameMap.containsKey(social)) {
socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(100293, "申报基数"), social + "socialBase");
}
});
fundIds.stream().forEach(social -> {
if (categoryIdNameMap.containsKey(social)) {
fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 100293, "申报基数"), social + "fundBase");
}
});
otherIds.stream().forEach(social -> {
if (categoryIdNameMap.containsKey(social)) {
otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 100293, "申报基数"), social + "otherBase");
}
});
Map<String, String> socialComColumns = new HashMap<>();
Map<String, String> fundComColumns = new HashMap<>();
Map<String, String> otherComColumns = new HashMap<>();
if (welBaseDiffSign) {
socailIds.stream().forEach(social -> {
if (categoryIdNameMap.containsKey(social)) {
socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"), social + "socialPerBase");
}
});
fundIds.stream().forEach(social -> {
if (categoryIdNameMap.containsKey(social)) {
fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"), social + "fundPerBase");
}
});
otherIds.stream().forEach(social -> {
if (categoryIdNameMap.containsKey(social)) {
otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"), social + "otherPerBase");
}
});
socailComIds.stream().forEach(social -> {
if (categoryIdNameMap.containsKey(social)) {
socialComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"), social + "socialComBase");
}
});
fundComIds.stream().forEach(social -> {
if (categoryIdNameMap.containsKey(social)) {
fundComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"), social + "fundComBase");
}
});
otherComIds.stream().forEach(social -> {
if (categoryIdNameMap.containsKey(social)) {
otherComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"), social + "otherComBase");
}
});
} else {
socailIds.stream().forEach(social -> {
if (categoryIdNameMap.containsKey(social)) {
socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "申报基数"), social + "socialBase");
}
});
fundIds.stream().forEach(social -> {
if (categoryIdNameMap.containsKey(social)) {
fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数"), social + "fundBase");
}
});
otherIds.stream().forEach(social -> {
if (categoryIdNameMap.containsKey(social)) {
otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数"), social + "otherBase");
}
});
}
// map根据value排序
LinkedHashMap<String, String> socialColumnsWithAscValue = socialColumns.entrySet().stream()
.sorted(Map.Entry.comparingByValue())
@ -188,6 +261,24 @@ public class ColumnBuildServiceImpl extends Service implements ColumnBuildServic
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue,
LinkedHashMap::new));
if (welBaseDiffSign) {
LinkedHashMap<String, String> socialComMapWithAscKey = socialComColumns.entrySet().stream()
.sorted(Map.Entry.comparingByKey())
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue,
LinkedHashMap::new));
LinkedHashMap<String, String> fundComMapWithAscKey = fundComColumns.entrySet().stream()
.sorted(Map.Entry.comparingByKey())
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue,
LinkedHashMap::new));
LinkedHashMap<String, String> otherComMapWithAscKey = otherComColumns.entrySet().stream()
.sorted(Map.Entry.comparingByKey())
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue,
LinkedHashMap::new));
socialColumnsWithAscValue.putAll(socialComMapWithAscKey);
fundColumnsWithAscValue.putAll(fundComMapWithAscKey);
otherColumnsWithAscValue.putAll(otherComMapWithAscKey);
}
result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialColumnsWithAscValue);
result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundColumnsWithAscValue);
result.put(WelfareTypeEnum.OTHER.getValue(), otherColumnsWithAscValue);

View File

@ -1,6 +1,7 @@
package com.engine.salary.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.biz.SIArchivesBiz;
@ -15,6 +16,7 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.enums.UserStatusEnum;
import com.engine.salary.enums.siaccount.BillStatusEnum;
import com.engine.salary.enums.siaccount.ResourceFromEnum;
import com.engine.salary.enums.sicategory.PaymentScopeEnum;
import com.engine.salary.mapper.datacollection.EmployMapper;
import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper;
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
@ -60,8 +62,11 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
}
private SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
@Override
public List<Map<String, Object>> buildCommonRecords(List<InsuranceAccountDetailPO> list, Long employeeId) {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
List<Map<String, Object>> result = new ArrayList<>();
if (CollectionUtils.isEmpty(list)) {
return result;
@ -99,34 +104,130 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
record.put("socialAccount", item.getSocialAccount());
record.put("socialSchemeName", getInsuranceSchemeMapper().querySchemeName(item.getSocialSchemeId()));
if (StringUtils.isNotEmpty(item.getSocialPaymentBaseString())) {
if (StringUtils.isNotEmpty(item.getSocialPaymentBaseString()) || StringUtils.isNotEmpty(item.getSocialPaymentComBaseString())) {
Map<String, Object> socialJson = JSON.parseObject(item.getSocialPaymentBaseString(), new HashMap<String, Object>().getClass());
if(socialJson!=null){
socialJson.forEach((k, v) -> {
record.put(k + "socialBase", (String) v);
// if(socialJson!=null){
// socialJson.forEach((k, v) -> {
// record.put(k + "socialBase", (String) v);
// });
// }
if (welBaseDiffSign) {
if (socialJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue());
socialJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "socialPerBase", v);
}
});
}
Map<String, Object> socialComJson = JSON.parseObject(item.getSocialPaymentComBaseString(), new TypeReference<Map<String, Object>>() {
});
if (socialComJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
socialComJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "socialComBase", v);
}
});
}
} else {
if (socialJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId());
socialJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "socialBase", v);
}
});
}
}
}
record.put("fundPayOrg", item.getFundPayOrg() == null ? "" : (paymentMap.getOrDefault(item.getFundPayOrg(),TaxAgentPO.builder().build())).getName());
record.put("fundAccount", item.getFundAccount());
record.put("fundSchemeName", getInsuranceSchemeMapper().querySchemeName(item.getFundSchemeId()));
record.put("supplementFundAccount", item.getSupplementFundAccount());
if (StringUtils.isNotEmpty(item.getFundPaymentBaseString())) {
Map<String, Object> socialJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap<String, Object>().getClass());
if(socialJson!=null){
socialJson.forEach((k, v) -> {
record.put(k + "fundBase", (String) v);
if (StringUtils.isNotEmpty(item.getFundPaymentBaseString()) || StringUtils.isNotEmpty(item.getFundPaymentComBaseString())) {
Map<String, Object> fundJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap<String, Object>().getClass());
// if(fundJson!=null){
// fundJson.forEach((k, v) -> {
// record.put(k + "fundBase", (String) v);
// });
// }
if (welBaseDiffSign) {
if (fundJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
fundJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "fundPerBase", v);
}
});
}
Map<String, Object> fundComJson = JSON.parseObject(item.getFundPaymentComBaseString(), new TypeReference<Map<String, Object>>() {
});
if (fundComJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
fundComJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "fundComBase", v);
}
});
}
} else {
if (fundJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId());
fundJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "fundBase", v);
}
});
}
}
}
record.put("otherPayOrg", item.getOtherPayOrg() == null ? "" : (paymentMap.getOrDefault(item.getOtherPayOrg(),TaxAgentPO.builder().build())).getName());
record.put("otherSchemeName", getInsuranceSchemeMapper().querySchemeName(item.getOtherSchemeId()));
if (StringUtils.isNotEmpty(item.getOtherPaymentBaseString())) {
Map<String, Object> socialJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap<String, Object>().getClass());
if(socialJson!=null){
socialJson.forEach((k, v) -> {
record.put(k + "otherBase", (String) v);
if (StringUtils.isNotEmpty(item.getOtherPaymentBaseString()) || StringUtils.isNotEmpty(item.getOtherPaymentComBaseString())) {
Map<String, Object> otherJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap<String, Object>().getClass());
// if(otherJson!=null){
// otherJson.forEach((k, v) -> {
// record.put(k + "otherBase", (String) v);
// });
// }
if (welBaseDiffSign) {
if (otherJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
otherJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "otherPerBase", v);
}
});
}
Map<String, Object> otherComJson = JSON.parseObject(item.getOtherPaymentComBaseString(), new TypeReference<Map<String, Object>>() {
});
if (otherComJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
otherComJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "otherComBase", v);
}
});
}
} else {
if (otherJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId());
otherJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "otherBase", v);
}
});
}
}
}
if (StringUtils.isNotEmpty(item.getSocialPerJson())) {

View File

@ -2,6 +2,7 @@ package com.engine.salary.service.impl;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.biz.SIArchivesBiz;
import com.engine.salary.encrypt.EncryptUtil;
import com.engine.salary.entity.siaccount.bo.InsuranceComparisonResultBO;
import com.engine.salary.entity.siaccount.dto.InsuranceComparisonResultListDTO;
@ -45,6 +46,8 @@ import java.util.stream.Collectors;
public class SIAComparisonResultServiceImpl extends Service implements SIAComparisonResultService {
private EncryptUtil encryptUtil = new EncryptUtil();
private SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
private InsuranceExportMapper getInsuranceExportMapper() {
return MapperProxyFactory.getProxy(InsuranceExportMapper.class);
}
@ -140,6 +143,7 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar
*/
private InsuranceComparisonResultListDTO listByParam(boolean needPage, InsuranceComparisonResultQueryParam queryParam) {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
//排序配置
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
@ -200,10 +204,10 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar
Set<Long> insurancePerPaySet = new HashSet<>(insurancePerPayIds);
Set<Long> insuranceComPaySet = new HashSet<>(insuranceComPayIds);
//3-构建福利核算对比结果列表表头
List<Column> weaTableColumns = InsuranceComparisonResultBO.buildTableColumns4ComparisonResult(insuranceBaseSet, insurancePerPaySet, insuranceComPaySet);
List<Column> weaTableColumns = InsuranceComparisonResultBO.buildTableColumns4ComparisonResult(insuranceBaseSet, insurancePerPaySet, insuranceComPaySet, welBaseDiffSign);
//4-通过线上线下两份数据获得对比结果
Map<Long, String> schemeIdNameMap = getSISchemeService(user).getSchemeIdNameMap();
List<Map<String, Object>> resultMapList = InsuranceComparisonResultBO.buildComparisonTableData(accountExportPOS, excelAccountExportPOS, schemeIdNameMap);
List<Map<String, Object>> resultMapList = InsuranceComparisonResultBO.buildComparisonTableData(accountExportPOS, excelAccountExportPOS, schemeIdNameMap, welBaseDiffSign);
// 系统值和线下值一致的人员
if (queryParam.isOnlyDiffEmployee()) {

View File

@ -65,6 +65,7 @@ import com.engine.salary.util.db.MapperProxyFactory;
import com.engine.salary.util.excel.ExcelParseHelper;
import com.engine.salary.util.excel.ExcelSupport;
import com.engine.salary.util.excel.ExcelUtil;
import com.engine.salary.util.excel.ExcelUtilPlus;
import com.engine.salary.util.page.Column;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.SalaryPageUtil;
@ -2221,7 +2222,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
*/
@Override
public XSSFWorkbook exportComparisonWelfareTemplate(InsuranceAccountDetailParam param) {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
//查询线上福利核算记录
InsuranceExportParam insuranceExportParam = new InsuranceExportParam();
insuranceExportParam.setBillMonth(param.getBillMonth());
@ -2279,20 +2280,57 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
// "养老保险申报基数"
// "医疗保险申报基数"
// "工伤保险申报基数"
for (ICategoryPO po : socialWelfareList) {
headerList.add(po.getInsuranceName() + "申报基数");
// for (ICategoryPO po : socialWelfareList) {
// headerList.add(po.getInsuranceName() + "申报基数");
// }
//组装社保基数
if (welBaseDiffSign) {
List<Object> socialComColumns = Lists.newArrayList();
for (ICategoryPO po : socialWelfareList) {
headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人"));
socialComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位"));
}
headerList.addAll(socialComColumns);
} else {
for (ICategoryPO po : socialWelfareList) {
headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数"));
}
}
headerList.add(SalaryI18nUtil.getI18nLabel(91486, "公积金账号"));
headerList.add(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称"));
//组装公积金基数
for (ICategoryPO po : fundWelfareList) {
headerList.add(po.getInsuranceName() + "申报基数");
// for (ICategoryPO po : fundWelfareList) {
// headerList.add(po.getInsuranceName() + "申报基数");
// }
if (welBaseDiffSign) {
List<Object> fundComColumns = Lists.newArrayList();
for (ICategoryPO po : fundWelfareList) {
headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人"));
fundComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位"));
}
headerList.addAll(fundComColumns);
} else {
for (ICategoryPO po : fundWelfareList) {
headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数"));
}
}
headerList.add(SalaryI18nUtil.getI18nLabel(91487, "补充公积金账号"));
headerList.add(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称"));
//组装其他福利基数
for (ICategoryPO po : otherWelfareList) {
headerList.add(po.getInsuranceName() + "申报基数");
// for (ICategoryPO po : otherWelfareList) {
// headerList.add(po.getInsuranceName() + "申报基数");
// }
if (welBaseDiffSign) {
List<Object> otherComColumns = Lists.newArrayList();
for (ICategoryPO po : otherWelfareList) {
headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人"));
otherComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位"));
}
headerList.addAll(otherComColumns);
} else {
for (ICategoryPO po : otherWelfareList) {
headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数"));
}
}
//社保个人生育保险个人工伤保险个人失业保险个人养老保险个人医疗保险个人
for (ICategoryPO po : socialWelPerList) {
@ -2335,7 +2373,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
rows.add(headerList);
String sheetName = "福利核算-线下对比导入模板";
return ExcelUtil.genWorkbookV2(rows, sheetName);
return ExcelUtilPlus.genWorkbookV2(rows, sheetName);
}
/**

View File

@ -1,10 +1,12 @@
package com.engine.salary.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.cloudstore.eccom.pc.table.WeaTableColumn;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.biz.SIAccountBiz;
import com.engine.salary.biz.SIArchivesBiz;
import com.engine.salary.encrypt.EncryptUtil;
import com.engine.salary.entity.siaccount.dto.InsuranceAccountViewListDTO;
import com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam;
@ -17,6 +19,7 @@ import com.engine.salary.enums.siaccount.BillStatusEnum;
import com.engine.salary.enums.siaccount.PaymentStatusEnum;
import com.engine.salary.enums.siaccount.ResourceFromEnum;
import com.engine.salary.enums.sicategory.DataTypeEnum;
import com.engine.salary.enums.sicategory.PaymentScopeEnum;
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
import com.engine.salary.mapper.InsuranceExportMapper;
import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper;
@ -37,6 +40,7 @@ import com.engine.salary.util.SalaryEnumUtil;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.db.MapperProxyFactory;
import com.engine.salary.util.excel.ExcelUtil;
import com.engine.salary.util.excel.ExcelUtilPlus;
import org.springframework.beans.BeanUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
@ -66,6 +70,8 @@ public class SIExportServiceImpl extends Service implements SIExportService {
private SIAccountBiz siAccountBiz = new SIAccountBiz();
private SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
private SISchemeService getSISchemeService(User user) {
return ServiceUtil.getService(SISchemeServiceImpl.class, user);
}
@ -242,11 +248,12 @@ public class SIExportServiceImpl extends Service implements SIExportService {
}
excelSheetData.addAll(rows);
return ExcelUtil.genWorkbookV2(excelSheetData, sheetName, total);
return ExcelUtilPlus.genWorkbookV2(excelSheetData, sheetName, total);
}
@Override
public List<Map<String, Object>> buildCommonRecords(List<AccountExportPO> list) {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
List<Map<String, Object>> result = new ArrayList<>();
List<TaxAgentPO> paymentList = getTaxAgentMapper().listAll();
@ -272,10 +279,42 @@ public class SIExportServiceImpl extends Service implements SIExportService {
record.put("socialSchemeName", schemeIdNameMap.get(item.getSocialSchemeId()));
if (StringUtils.isNotEmpty(item.getSocialPaymentBaseString())) {
Map<String, Object> socialJson = JSON.parseObject(item.getSocialPaymentBaseString(), new HashMap<String, Object>().getClass());
if (socialJson != null) {
socialJson.forEach((k, v) -> {
record.put(k + "socialBase", v);
// if (socialJson != null) {
// socialJson.forEach((k, v) -> {
// record.put(k + "socialBase", v);
// });
// }
if (welBaseDiffSign) {
if (socialJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue());
socialJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "socialPerBase", v);
}
});
}
Map<String, Object> socialComJson = JSON.parseObject(item.getSocialPaymentComBaseString(), new TypeReference<Map<String, Object>>() {
});
if (socialComJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
socialComJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "socialComBase", v);
}
});
}
} else {
if (socialJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId());
socialJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "socialBase", v);
}
});
}
}
}
@ -284,22 +323,86 @@ public class SIExportServiceImpl extends Service implements SIExportService {
record.put("fundSchemeName", schemeIdNameMap.get(item.getFundSchemeId()));
record.put("supplementFundAccount", item.getSupplementFundAccount());
if (StringUtils.isNotEmpty(item.getFundPaymentBaseString())) {
Map<String, Object> socialJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap<String, Object>().getClass());
if (socialJson != null) {
socialJson.forEach((k, v) -> {
record.put(k + "fundBase", v);
Map<String, Object> fundJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap<String, Object>().getClass());
// if (fundJson != null) {
// fundJson.forEach((k, v) -> {
// record.put(k + "fundBase", v);
// });
// }
if (welBaseDiffSign) {
if (fundJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
fundJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "fundPerBase", v);
}
});
}
Map<String, Object> fundComJson = JSON.parseObject(item.getFundPaymentComBaseString(), new TypeReference<Map<String, Object>>() {
});
if (fundComJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
fundComJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "fundComBase", v);
}
});
}
} else {
if (fundJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId());
fundJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "fundBase", v);
}
});
}
}
}
record.put("otherPayOrg", paymentMap.get(item.getOtherPayOrg()) == null ? "" : paymentMap.get(item.getOtherPayOrg()).getName());
record.put("otherSchemeName", schemeIdNameMap.get(item.getOtherSchemeId()));
if (StringUtils.isNotEmpty(item.getOtherPaymentBaseString())) {
Map<String, Object> socialJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap<String, Object>().getClass());
if (socialJson != null) {
socialJson.forEach((k, v) -> {
record.put(k + "otherBase", v);
Map<String, Object> otherJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap<String, Object>().getClass());
// if (otherJson != null) {
// otherJson.forEach((k, v) -> {
// record.put(k + "otherBase", v);
// });
// }
if (welBaseDiffSign) {
if (otherJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
otherJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "otherPerBase", v);
}
});
}
Map<String, Object> otherComJson = JSON.parseObject(item.getOtherPaymentComBaseString(), new TypeReference<Map<String, Object>>() {
});
if (otherComJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
otherComJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "otherComBase", v);
}
});
}
} else {
if (otherJson != null) {
//查询该福利方案下开启缴纳的福利项
List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId());
otherJson.forEach((k, v) -> {
if (insuranceIdList.contains(Long.valueOf(k))) {
record.put(k + "otherBase", v);
}
});
}
}
}
@ -628,58 +731,127 @@ public class SIExportServiceImpl extends Service implements SIExportService {
}
private Map<Integer, Map<String, String>> buildPaymentTitle(List<AccountExportPO> pos, Map<String, String> categoryIdNameMap) {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
Set<String> socailIds = new HashSet<>();
Set<String> fundIds = new HashSet<>();
Set<String> otherIds = new HashSet<>();
Set<String> socailComIds = new HashSet<>();
Set<String> fundComIds = new HashSet<>();
Set<String> otherComIds = new HashSet<>();
Map<Integer, Map<String, String>> result = new HashMap<>();
pos.stream().forEach(item -> {
if (StringUtils.isNotBlank(item.getSocialPaymentBaseString())) {
if (StringUtils.isNotBlank(item.getSocialPaymentBaseString()) || StringUtils.isNotBlank(item.getSocialPaymentComBaseString())) {
Map<String, String> socialJson = JSON.parseObject(item.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
if (socialJson != null) {
socialJson.forEach((k, v) -> {
socailIds.add(k);
});
}
//如果需要区分个人和公司福利基数
if (welBaseDiffSign) {
Map<String, Object> socialComJson = JSON.parseObject(item.getSocialPaymentComBaseString(), new TypeReference<Map<String, Object>>() {
});
if (socialComJson != null) {
socialComJson.forEach((k, v) -> socailComIds.add(k));
}
}
}
if (StringUtils.isNotBlank(item.getFundPaymentBaseString())) {
if (StringUtils.isNotBlank(item.getFundPaymentBaseString()) || StringUtils.isNotBlank(item.getFundPaymentComBaseString())) {
Map<String, String> fundJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap<String, String>().getClass());
if (fundJson != null) {
fundJson.forEach((k, v) -> {
fundIds.add(k);
});
}
//如果需要区分个人和公司福利基数
if (welBaseDiffSign) {
Map<String, Object> fundComJson = JSON.parseObject(item.getFundPaymentComBaseString(), new TypeReference<Map<String, Object>>() {
});
if (fundComJson != null) {
fundComJson.forEach((k, v) -> fundComIds.add(k));
}
}
}
if (StringUtils.isNotBlank(item.getOtherPaymentBaseString())) {
if (StringUtils.isNotBlank(item.getOtherPaymentBaseString()) || StringUtils.isNotBlank(item.getOtherPaymentComBaseString())) {
Map<String, String> otherJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap<String, String>().getClass());
if (otherJson != null) {
otherJson.forEach((k, v) -> {
otherIds.add(k);
});
}
//如果需要区分个人和公司福利基数
if (welBaseDiffSign) {
Map<String, Object> otherComJson = JSON.parseObject(item.getOtherPaymentComBaseString(), new TypeReference<Map<String, Object>>() {
});
if (otherComJson != null) {
otherComJson.forEach((k, v) -> otherComIds.add(k));
}
}
}
});
Map<String, String> socialColumns = new HashMap<>();
Map<String, String> fundColumns = new HashMap<>();
Map<String, String> otherColumns = new HashMap<>();
socailIds.stream().forEach(social -> {
if (categoryIdNameMap.containsKey(social)) {
socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(100293, "申报基数"), social + "socialBase");
}
});
fundIds.stream().forEach(social -> {
if (categoryIdNameMap.containsKey(social)) {
fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(100293, "申报基数"), social + "fundBase");
}
});
otherIds.stream().forEach(social -> {
if (categoryIdNameMap.containsKey(social)) {
otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(100293, "申报基数"), social + "otherBase");
}
});
Map<String, String> socialComColumns = new HashMap<>();
Map<String, String> fundComColumns = new HashMap<>();
Map<String, String> otherComColumns = new HashMap<>();
if (welBaseDiffSign) {
socailIds.stream().forEach(social -> {
if (categoryIdNameMap.containsKey(social)) {
socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"), social + "socialPerBase");
}
});
fundIds.stream().forEach(social -> {
if (categoryIdNameMap.containsKey(social)) {
fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"), social + "fundPerBase");
}
});
otherIds.stream().forEach(social -> {
if (categoryIdNameMap.containsKey(social)) {
otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"), social + "otherPerBase");
}
});
socailComIds.stream().forEach(social -> {
if (categoryIdNameMap.containsKey(social)) {
socialComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"), social + "socialComBase");
}
});
fundComIds.stream().forEach(social -> {
if (categoryIdNameMap.containsKey(social)) {
fundComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"), social + "fundComBase");
}
});
otherComIds.stream().forEach(social -> {
if (categoryIdNameMap.containsKey(social)) {
otherComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"), social + "otherComBase");
}
});
} else {
socailIds.stream().forEach(social -> {
if (categoryIdNameMap.containsKey(social)) {
socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "申报基数"), social + "socialBase");
}
});
fundIds.stream().forEach(social -> {
if (categoryIdNameMap.containsKey(social)) {
fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数"), social + "fundBase");
}
});
otherIds.stream().forEach(social -> {
if (categoryIdNameMap.containsKey(social)) {
otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数"), social + "otherBase");
}
});
}
// map根据value排序
LinkedHashMap<String, String> socialColumnsWithAscValue = socialColumns.entrySet().stream()
.sorted(Map.Entry.comparingByValue())
@ -694,6 +866,24 @@ public class SIExportServiceImpl extends Service implements SIExportService {
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue,
LinkedHashMap::new));
if (welBaseDiffSign) {
LinkedHashMap<String, String> socialComMapWithAscKey = socialComColumns.entrySet().stream()
.sorted(Map.Entry.comparingByKey())
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue,
LinkedHashMap::new));
LinkedHashMap<String, String> fundComMapWithAscKey = fundComColumns.entrySet().stream()
.sorted(Map.Entry.comparingByKey())
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue,
LinkedHashMap::new));
LinkedHashMap<String, String> otherComMapWithAscKey = otherComColumns.entrySet().stream()
.sorted(Map.Entry.comparingByKey())
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue,
LinkedHashMap::new));
socialColumnsWithAscValue.putAll(socialComMapWithAscKey);
fundColumnsWithAscValue.putAll(fundComMapWithAscKey);
otherColumnsWithAscValue.putAll(otherComMapWithAscKey);
}
result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialColumnsWithAscValue);
result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundColumnsWithAscValue);
result.put(WelfareTypeEnum.OTHER.getValue(), otherColumnsWithAscValue);

View File

@ -197,6 +197,9 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic
// temp.setExternalFlag(insuranceAccountDetailPO.getExternalFlag());
temp.setPaymentOrganization(insuranceAccountDetailPO.getPaymentOrganization());
// temp.setPaymentAgency(insuranceAccountDetailPO.getPaymentAgency());
temp.setSocialPaymentComBaseString(insuranceAccountDetailPO.getSocialPaymentComBaseString());
temp.setFundPaymentComBaseString(insuranceAccountDetailPO.getFundPaymentComBaseString());
temp.setOtherPaymentComBaseString(insuranceAccountDetailPO.getOtherPaymentComBaseString());
}
private void recessionSocial(RecessionParam param, InsuranceAccountDetailPO temp, InsuranceAccountDetailPO insuranceAccountDetailPO) {
//退差社保个人缴费

View File

@ -2,6 +2,7 @@ package com.engine.salary.web;
import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.salary.common.SalaryContext;
import com.engine.salary.entity.hrm.dto.HrmInfoDTO;
import com.engine.salary.entity.hrm.param.HrmQueryParam;
import com.engine.salary.entity.siaccount.dto.InsuranceAccountTabDTO;
@ -37,11 +38,9 @@ import javax.ws.rs.core.StreamingOutput;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.time.LocalDate;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 福利核算控制器
@ -50,6 +49,7 @@ import java.util.stream.Collectors;
public class SIAccountController {
public SIAccountService getService(User user) {
SalaryContext.get().setValue("user",user);
return ServiceUtil.getService(SIAccountServiceImpl.class, user);
}