From de5b5d4c1954ba5bc8b4c3095b4a623a998f2704 Mon Sep 17 00:00:00 2001 From: sy Date: Wed, 8 Feb 2023 11:33:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-=E7=A6=8F?= =?UTF-8?q?=E5=88=A9=E5=8F=B0=E8=B4=A6=EF=BC=8C=E7=A6=8F=E5=88=A9=E7=BC=B4?= =?UTF-8?q?=E7=BA=B3=E5=91=A8=E6=9C=9F=E6=A0=B8=E7=AE=97=E6=97=B6=E8=80=83?= =?UTF-8?q?=E8=99=91=E8=B5=B7=E5=A7=8B=E7=BC=B4=E7=BA=B3=E6=9C=88=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E9=80=BB=E8=BE=91=EF=BC=8C=E7=A6=8F=E5=88=A9=E8=A1=A5?= =?UTF-8?q?=E7=BC=B4=E4=B8=8D=E5=85=81=E8=AE=B8=E8=A1=A5=E7=BC=B4=E8=B5=B7?= =?UTF-8?q?=E5=A7=8B=E7=BC=B4=E7=BA=B3=E6=9C=88=E4=B9=8B=E5=89=8D=E7=9A=84?= =?UTF-8?q?=E6=9C=88=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIAccountBiz.java | 60 +++++++++++++++++++-- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index e7b8e7538..4207393fc 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -553,6 +553,8 @@ public class SIAccountBiz extends Service { } }); } + //判断核算周期、核算月、福利起始缴纳月的关系 + checkCycleSettingWithStartMonth(otherPerson, billMonth, otherPO.getOtherStartTime()); List otherPer = new ArrayList<>(); Map otherPerJsonMap = new HashMap<>(); @@ -613,6 +615,8 @@ public class SIAccountBiz extends Service { } }); } + //判断核算周期、核算月、福利起始缴纳月的关系 + checkCycleSettingWithStartMonth(otherCom, billMonth, otherPO.getOtherStartTime()); List otherComList = new ArrayList<>(); Map otherComJsonMap = new HashMap<>(); @@ -691,6 +695,8 @@ public class SIAccountBiz extends Service { } }); } + //判断核算周期、核算月、福利起始缴纳月的关系 + checkCycleSettingWithStartMonth(fundperson, billMonth, fundPO.getFundStartTime()); List fundPer = new ArrayList<>(); Map fundPerJsonMap = new HashMap<>(); @@ -750,6 +756,8 @@ public class SIAccountBiz extends Service { } }); } + //判断核算周期、核算月、福利起始缴纳月的关系 + checkCycleSettingWithStartMonth(fundCom, billMonth, fundPO.getFundStartTime()); List fundComList = new ArrayList<>(); Map fundComJsonMap = new HashMap<>(); @@ -831,6 +839,8 @@ public class SIAccountBiz extends Service { } }); } + //判断核算周期、核算月、福利起始缴纳月的关系 + checkCycleSettingWithStartMonth(schemeperson, billMonth, socialPO.getSocialStartTime()); List socialPer = new ArrayList<>(); Map socialPerJsonMap = new HashMap<>(); @@ -890,6 +900,8 @@ public class SIAccountBiz extends Service { } }); } + //判断核算周期、核算月、福利起始缴纳月的关系 + checkCycleSettingWithStartMonth(schemeCom, billMonth, socialPO.getSocialStartTime()); List socialCom = new ArrayList<>(); Map sociaComJsonMap = new HashMap<>(); @@ -938,6 +950,29 @@ public class SIAccountBiz extends Service { return insuranceAccountDetailPO; } + /** + * 对于核算月和福利起始缴纳月处于同年时,要避免根据周期缴纳福利费用时,可能出现的多余费用缴纳情况 + * @param schemeDetail 福利方案明细 + * @param billMonth 核算月 + * @param startMonth 福利起始缴纳月 + * @return + */ + public Map checkCycleSettingWithStartMonth(Map schemeDetail, String billMonth, String startMonth) { + String billYear = billMonth.substring(0,4); + if (StringUtils.isNotBlank(startMonth) && billYear.equals(startMonth.substring(0,4))) { + int startMonthIndex = Integer.parseInt(startMonth.split("-")[1]) - 1; + schemeDetail.forEach((k, v) -> { + if (v.getPaymentCycle() != null && v.getPaymentCycle().equals(1) && startMonthIndex != 0) { + StringBuilder newCycleSetting = new StringBuilder(v.getCycleSetting()); + newCycleSetting.setCharAt(startMonthIndex - 1, '1'); + v.setCycleSetting(newCycleSetting.toString()); + } + }); + + } + return schemeDetail; + } + public void batchSaveAccountInspectDetail(List list, String billMonth, String tenantKey) { List insuranceAccountInspectAllPOS = accountInspect(list, true); batchDelInspectDetail(insuranceAccountInspectAllPOS); @@ -1338,7 +1373,9 @@ public class SIAccountBiz extends Service { insuranceAccountDetailPO.setOtherPayOrg(otherPO.getPaymentOrganization()); insuranceAccountDetailPO.setOtherSchemeId(otherPO.getOtherSchemeId()); insuranceAccountDetailPO.setOtherPaymentBaseString(otherPO.getOtherPaymentBaseString()); - if ((Objects.equals(NonPaymentEnum.YES.getValue(), otherPO.getNonPayment()) || otherPO.getNonPayment() == null) && otherPO.getOtherSchemeId() != null) { + //判断是否在起始缴纳月和最后缴纳月之间 + 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) { List detailPOS = MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class).queryListBySchemeId(otherPO.getOtherSchemeId()); encryptUtil.decryptList(detailPOS, InsuranceSchemeDetailPO.class); //方案中包含的需要缴纳其他的个人福利 @@ -1358,6 +1395,8 @@ public class SIAccountBiz extends Service { } }); } + //判断核算周期、核算月、福利起始缴纳月的关系 + checkCycleSettingWithStartMonth(otherPerson, billMonth, otherPO.getOtherStartTime()); List otherPer = new ArrayList<>(); Map otherPerJsonMap = new HashMap<>(); @@ -1418,6 +1457,8 @@ public class SIAccountBiz extends Service { } }); } + //判断核算周期、核算月、福利起始缴纳月的关系 + checkCycleSettingWithStartMonth(otherCom, billMonth, otherPO.getOtherStartTime()); List otherComList = new ArrayList<>(); Map otherComJsonMap = new HashMap<>(); @@ -1473,7 +1514,9 @@ public class SIAccountBiz extends Service { insuranceAccountDetailPO.setSupplementFundAccount(fundPO.getSupplementFundAccount()); insuranceAccountDetailPO.setFundSchemeId(fundPO.getFundSchemeId()); insuranceAccountDetailPO.setFundPaymentBaseString(fundPO.getFundPaymentBaseString()); - if ((NonPaymentEnum.YES.getValue() == fundPO.getNonPayment() || fundPO.getNonPayment() == null) && fundPO.getFundSchemeId() != null) { + //判断是否在起始缴纳月和最后缴纳月之间 + Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), fundPO.getFundStartTime(), fundPO.getFundEndTime()); + if ((NonPaymentEnum.YES.getValue() == fundPO.getNonPayment() || fundPO.getNonPayment() == null) && fundPO.getFundSchemeId() != null && inDataRange) { List detailPOS = MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class).queryListBySchemeId(fundPO.getFundSchemeId()); encryptUtil.decryptList(detailPOS, InsuranceSchemeDetailPO.class); //方案中包含的需要缴纳社保的个人福利 @@ -1493,6 +1536,8 @@ public class SIAccountBiz extends Service { } }); } + //判断核算周期、核算月、福利起始缴纳月的关系 + checkCycleSettingWithStartMonth(fundperson, billMonth, fundPO.getFundStartTime()); List fundPer = new ArrayList<>(); Map fundPerJsonMap = new HashMap<>(); @@ -1552,6 +1597,8 @@ public class SIAccountBiz extends Service { } }); } + //判断核算周期、核算月、福利起始缴纳月的关系 + checkCycleSettingWithStartMonth(fundCom, billMonth, fundPO.getFundStartTime()); List fundComList = new ArrayList<>(); Map fundComJsonMap = new HashMap<>(); @@ -1607,7 +1654,9 @@ public class SIAccountBiz extends Service { insuranceAccountDetailPO.setSocialAccount(socialPO.getSocialAccount()); insuranceAccountDetailPO.setSocialSchemeId(socialPO.getSocialSchemeId()); insuranceAccountDetailPO.setSocialPaymentBaseString(socialPO.getSocialPaymentBaseString()); - if ((NonPaymentEnum.YES.getValue() == socialPO.getNonPayment() || socialPO.getNonPayment() == null) && socialPO.getSocialSchemeId() != null) { + //判断是否在起始缴纳月和最后缴纳月之间 + Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), socialPO.getSocialStartTime(), socialPO.getSocialEndTime()); + if ((NonPaymentEnum.YES.getValue() == socialPO.getNonPayment() || socialPO.getNonPayment() == null) && socialPO.getSocialSchemeId() != null && inDataRange) { List detailPOS = MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class).queryListBySchemeId(socialPO.getSocialSchemeId()); encryptUtil.decryptList(detailPOS, InsuranceSchemeDetailPO.class); //方案中包含的需要缴纳社保的个人福利 @@ -1631,6 +1680,9 @@ public class SIAccountBiz extends Service { } }); } + //判断核算周期、核算月、福利起始缴纳月的关系 + checkCycleSettingWithStartMonth(schemeperson, billMonth, socialPO.getSocialStartTime()); + List socialPer = new ArrayList<>(); Map socialPerJsonMap = new HashMap<>(); needArchivesPerson.forEach(e -> { @@ -1690,6 +1742,8 @@ public class SIAccountBiz extends Service { } }); } + //判断核算周期、核算月、福利起始缴纳月的关系 + checkCycleSettingWithStartMonth(schemeCom, billMonth, socialPO.getSocialStartTime()); List socialCom = new ArrayList<>(); Map sociaComJsonMap = new HashMap<>();