薪酬系统-福利台账,补缴新增功能改造v1

This commit is contained in:
sy 2022-12-27 14:01:08 +08:00
parent c49017f63b
commit af15ffcc23
3 changed files with 311 additions and 7 deletions

View File

@ -166,6 +166,9 @@ public class SIAccountBiz extends Service {
.updateTime(new Date())
.deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
.paymentOrganization(param.getPaymentOrganization())
.socialPay("0")
.fundPay("0")
.otherPay("0")
.build();
encryptUtil.encrypt(build, InsuranceAccountBatchPO.class);
getInsuranceAccountBatchMapper().insert(build);
@ -1067,13 +1070,43 @@ public class SIAccountBiz extends Service {
//缴纳组织=个税扣缴义务人
insuranceAccountDetailPO.setSocialPayOrg(baseParam.getPaymentOrganization());
if (projects.contains(ProjectTypeEnum.ALL.getValue())) {
accountSocial(insuranceAccountDetailPO, accountPO);
accountFund(insuranceAccountDetailPO, accountPO);
accountOther(insuranceAccountDetailPO, accountPO);
if ("2".equals(baseParam.getSupplementType())) {
if (accountPO.getSocial() != null) {
accountPO.getSocial().setSocialPaymentBaseString(baseParam.getSocialPaymentBaseString());
}
if (accountPO.getFund() != null) {
accountPO.getFund().setFundPaymentBaseString(baseParam.getFundPaymentBaseString());
}
if (accountPO.getOther() != null) {
accountPO.getOther().setOtherPaymentBaseString(baseParam.getOtherPaymentBaseString());
}
accountSocial(insuranceAccountDetailPO, accountPO);
accountFund(insuranceAccountDetailPO, accountPO);
accountOther(insuranceAccountDetailPO, accountPO);
} else if ("3".equals(baseParam.getSupplementType())) {
accountSocialByData(insuranceAccountDetailPO, baseParam);
accountFundByData(insuranceAccountDetailPO, baseParam);
accountOtherByData(insuranceAccountDetailPO, baseParam);
} else {
accountSocial(insuranceAccountDetailPO, accountPO);
accountFund(insuranceAccountDetailPO, accountPO);
accountOther(insuranceAccountDetailPO, accountPO);
}
return account(insuranceAccountDetailPO);
}
if (projects.contains(ProjectTypeEnum.SOCIAL.getValue())) {
accountSocial(insuranceAccountDetailPO, accountPO);
if ("2".equals(baseParam.getSupplementType())) {
if (accountPO.getSocial() != null) {
accountPO.getSocial().setSocialPaymentBaseString(baseParam.getSocialPaymentBaseString());
}
accountSocial(insuranceAccountDetailPO, accountPO);
} else if ("3".equals(baseParam.getSupplementType())) {
// accountSocialByData(insuranceAccountDetailPO, baseParam);
} else {
accountSocial(insuranceAccountDetailPO, accountPO);
}
}
if (!projects.contains(ProjectTypeEnum.SOCIAL.getValue())) {
List<Long> ids = new ArrayList<>();
@ -1089,13 +1122,44 @@ public class SIAccountBiz extends Service {
.get();
ids.add(insuranceCategoryPO.getId());
}
accountEndowmentInsurance(insuranceAccountDetailPO, accountPO, ids);
if ("2".equals(baseParam.getSupplementType())) {
if (accountPO.getSocial() != null) {
accountPO.getSocial().setSocialPaymentBaseString(baseParam.getSocialPaymentBaseString());
}
accountEndowmentInsurance(insuranceAccountDetailPO, accountPO, ids);
} else if ("3".equals(baseParam.getSupplementType())) {
accountEndowmentInsuranceByData(insuranceAccountDetailPO, baseParam, ids);
} else {
accountEndowmentInsurance(insuranceAccountDetailPO, accountPO, ids);
}
}
if (projects.contains(ProjectTypeEnum.FUND.getValue())) {
accountFund(insuranceAccountDetailPO, accountPO);
if ("2".equals(baseParam.getSupplementType())) {
if (accountPO.getFund() != null) {
accountPO.getFund().setFundPaymentBaseString(baseParam.getFundPaymentBaseString());
}
accountFund(insuranceAccountDetailPO, accountPO);
} else if ("3".equals(baseParam.getSupplementType())) {
accountFundByData(insuranceAccountDetailPO, baseParam);
} else {
accountFund(insuranceAccountDetailPO, accountPO);
}
}
if (projects.contains(ProjectTypeEnum.OTHER.getValue())) {
accountOther(insuranceAccountDetailPO, accountPO);
if ("2".equals(baseParam.getSupplementType())) {
if (accountPO.getOther() != null) {
accountPO.getOther().setOtherPaymentBaseString(baseParam.getOtherPaymentBaseString());
}
accountOther(insuranceAccountDetailPO, accountPO);
} else if ("3".equals(baseParam.getSupplementType())) {
accountOtherByData(insuranceAccountDetailPO, baseParam);
} else {
accountOther(insuranceAccountDetailPO, accountPO);
}
}
return account(insuranceAccountDetailPO);
@ -1835,4 +1899,144 @@ public class SIAccountBiz extends Service {
getInsuranceAccountDetailMapper().updateByEmployeeIdAndBillMonth(insuranceAccountDetailPO);
}
public void accountFundByData(InsuranceAccountDetailPO insuranceAccountDetailPO, SupplementAccountBaseParam baseParam) {
//公积金个人
if (StringUtils.isNotBlank(baseParam.getFundPaymentPerString())) {
List<BigDecimal> fundPer = new ArrayList<>();
HashMap<String, String> fundPerson = JSON.parseObject(baseParam.getFundPaymentPerString(), new HashMap<String, String>().getClass());
fundPerson.forEach((k, v) -> {
BigDecimal result = new BigDecimal(v);
fundPer.add(result);
});
insuranceAccountDetailPO.setFundPerJson(baseParam.getFundPaymentPerString());
BigDecimal fundPerSum = new BigDecimal("0");
for (BigDecimal bigDecimal : fundPer) {
fundPerSum = fundPerSum.add(bigDecimal);
}
insuranceAccountDetailPO.setFundPerSum(fundPerSum.toPlainString());
}
//公积金单位
if (StringUtils.isNotBlank(baseParam.getFundPaymentComString())) {
List<BigDecimal> fundCom = new ArrayList<>();
HashMap<String, String> fundComMap = JSON.parseObject(baseParam.getFundPaymentComString(), new HashMap<String, String>().getClass());
fundComMap.forEach((k, v) -> {
BigDecimal result = new BigDecimal(v);
fundCom.add(result);
});
insuranceAccountDetailPO.setFundComJson(baseParam.getFundPaymentComString());
BigDecimal fundComSum = new BigDecimal("0");
for (BigDecimal bigDecimal : fundCom) {
fundComSum = fundComSum.add(bigDecimal);
}
insuranceAccountDetailPO.setFundComSum(fundComSum.toPlainString());
}
}
public void accountOtherByData(InsuranceAccountDetailPO insuranceAccountDetailPO, SupplementAccountBaseParam baseParam) {
//其他福利个人
if (StringUtils.isNotBlank(baseParam.getOtherPaymentPerString())) {
List<BigDecimal> otherPer = new ArrayList<>();
HashMap<String, String> otherPerMap = JSON.parseObject(baseParam.getOtherPaymentPerString(), new HashMap<String, String>().getClass());
otherPerMap.forEach((k, v) -> {
BigDecimal result = new BigDecimal(v);
otherPer.add(result);
});
insuranceAccountDetailPO.setOtherPerJson(baseParam.getOtherPaymentPerString());
BigDecimal otherPerSum = new BigDecimal("0");
for (BigDecimal bigDecimal : otherPer) {
otherPerSum = otherPerSum.add(bigDecimal);
}
insuranceAccountDetailPO.setOtherPerSum(otherPerSum.toPlainString());
}
//其他福利单位
if (StringUtils.isNotBlank(baseParam.getOtherPaymentComString())) {
List<BigDecimal> otherCom = new ArrayList<>();
HashMap<String, String> otherComMap = JSON.parseObject(baseParam.getOtherPaymentComString(), new HashMap<String, String>().getClass());
otherComMap.forEach((k, v) -> {
BigDecimal result = new BigDecimal(v);
otherCom.add(result);
});
insuranceAccountDetailPO.setOtherComJson(baseParam.getOtherPaymentComString());
BigDecimal otherComSum = new BigDecimal("0");
for (BigDecimal bigDecimal : otherCom) {
otherComSum = otherComSum.add(bigDecimal);
}
insuranceAccountDetailPO.setOtherComSum(otherComSum.toPlainString());
}
}
public void accountSocialByData(InsuranceAccountDetailPO insuranceAccountDetailPO, SupplementAccountBaseParam baseParam) {
//社保个人
if (StringUtils.isNotBlank(baseParam.getSocialPaymentPerString())) {
List<BigDecimal> socialPer = new ArrayList<>();
HashMap<String, String> archivesPerson = JSON.parseObject(baseParam.getSocialPaymentPerString(), new HashMap<String, String>().getClass());
archivesPerson.forEach((k, v) -> {
BigDecimal result = new BigDecimal(v);
socialPer.add(result);
});
insuranceAccountDetailPO.setSocialPerJson(baseParam.getSocialPaymentPerString());
BigDecimal socialPerSum = new BigDecimal("0");
for (BigDecimal bigDecimal : socialPer) {
socialPerSum = socialPerSum.add(bigDecimal);
}
insuranceAccountDetailPO.setSocialPerSum(socialPerSum.toPlainString());
}
//社保单位
if (StringUtils.isNotBlank(baseParam.getSocialPaymentComString())) {
List<BigDecimal> socialCom = new ArrayList<>();
HashMap<String, String> archivesCom = JSON.parseObject(baseParam.getSocialPaymentComString(), new HashMap<String, String>().getClass());
archivesCom.forEach((k, v) -> {
BigDecimal result = new BigDecimal(v);
socialCom.add(result);
});
insuranceAccountDetailPO.setSocialComJson(baseParam.getSocialPaymentComString());
BigDecimal socialComSum = new BigDecimal("0");
for (BigDecimal bigDecimal : socialCom) {
socialComSum = socialComSum.add(bigDecimal);
}
insuranceAccountDetailPO.setSocialComSum(socialComSum.toPlainString());
}
}
public void accountEndowmentInsuranceByData(InsuranceAccountDetailPO insuranceAccountDetailPO, SupplementAccountBaseParam baseParam, List<Long> ids) {
//社保个人
if (StringUtils.isNotBlank(baseParam.getSocialPaymentPerString())) {
List<BigDecimal> socialPer = new ArrayList<>();
HashMap<String, String> archivesPerson = JSON.parseObject(baseParam.getSocialPaymentPerString(), new HashMap<String, String>().getClass());
HashMap<String, String> socialPerson = new HashMap<>();
archivesPerson.forEach((k, v) -> {
if (ids.contains(Long.valueOf(k))) {
socialPerson.put(k, v);
BigDecimal result = new BigDecimal(v);
socialPer.add(result);
}
});
insuranceAccountDetailPO.setSocialPerJson(JSON.toJSONString(socialPerson));
BigDecimal socialPerSum = new BigDecimal("0");
for (BigDecimal bigDecimal : socialPer) {
socialPerSum = socialPerSum.add(bigDecimal);
}
insuranceAccountDetailPO.setSocialPerSum(socialPerSum.toPlainString());
}
//社保单位
if (StringUtils.isNotBlank(baseParam.getSocialPaymentComString())) {
List<BigDecimal> socialCom = new ArrayList<>();
HashMap<String, String> archivesCom = JSON.parseObject(baseParam.getSocialPaymentComString(), new HashMap<String, String>().getClass());
HashMap<String, String> socialComMap = new HashMap<>();
archivesCom.forEach((k, v) -> {
if (ids.contains(Long.valueOf(k))) {
socialComMap.put(k, v);
BigDecimal result = new BigDecimal(v);
socialCom.add(result);
}
});
insuranceAccountDetailPO.setSocialComJson(JSON.toJSONString(socialComMap));
BigDecimal socialComSum = new BigDecimal("0");
for (BigDecimal bigDecimal : socialCom) {
socialComSum = socialComSum.add(bigDecimal);
}
insuranceAccountDetailPO.setSocialComSum(socialComSum.toPlainString());
}
}
}

View File

@ -45,4 +45,54 @@ public class SaveSupplementaryAccountParam {
*/
@DataCheck(require = true,message = "个税扣缴义务人不能为空")
private Long paymentOrganization;
/**
* 社保补缴基数
*/
private String socialPaymentBaseString;
/**
* 公积金补缴基数
*/
private String fundPaymentBaseString;
/**
* 其他福利补缴基数
*/
private String otherPaymentBaseString;
/**
* 社保补缴金额_个人
*/
private String socialPaymentPerString;
/**
* 社保补缴金额_单位
*/
private String socialPaymentComString;
/**
* 公积金补缴金额_个人
*/
private String fundPaymentPerString;
/**
* 公积金补缴金额_单位
*/
private String fundPaymentComString;
/**
* 其他福利补缴金额_个人
*/
private String otherPaymentPerString;
/**
* 其他福利补缴金额_单位
*/
private String otherPaymentComString;
/**
* 补缴类型
*/
private String supplementType;
}

View File

@ -37,4 +37,54 @@ public class SupplementAccountBaseParam {
//补缴项目")
private List<Integer> projects;
/**
* 社保补缴基数
*/
private String socialPaymentBaseString;
/**
* 公积金补缴基数
*/
private String fundPaymentBaseString;
/**
* 其他福利补缴基数
*/
private String otherPaymentBaseString;
/**
* 社保补缴金额_个人
*/
private String socialPaymentPerString;
/**
* 社保补缴金额_单位
*/
private String socialPaymentComString;
/**
* 公积金补缴金额_个人
*/
private String fundPaymentPerString;
/**
* 公积金补缴金额_单位
*/
private String fundPaymentComString;
/**
* 其他福利补缴金额_个人
*/
private String otherPaymentPerString;
/**
* 其他福利补缴金额_单位
*/
private String otherPaymentComString;
/**
* 补缴类型
*/
private String supplementType;
}