From e8aee9ab64e1fa81304c38353a20fbe7ceca94a4 Mon Sep 17 00:00:00 2001 From: sy Date: Fri, 19 Jan 2024 17:32:52 +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=E6=A1=A3=E6=A1=88=EF=BC=8C=E6=A1=A3=E6=A1=88=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E9=A1=B5=E8=AF=A6=E6=83=85=E6=8E=A5=E5=8F=A3=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E8=BF=94=E5=9B=9E=E7=BC=BA=E5=A4=B1=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E9=A1=B9=E6=95=B0=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIArchivesBiz.java | 103 +++++++++++++++---- 1 file changed, 85 insertions(+), 18 deletions(-) diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index 4f62417c6..ff5fe4727 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -1,5 +1,6 @@ package com.engine.salary.biz; +import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; @@ -69,6 +70,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; +import static com.engine.salary.sys.constant.SalarySysConstant.WEL_BASE_AUTO_ADJUST; import static com.engine.salary.sys.constant.SalarySysConstant.WEL_BASE_DIFF_BY_PER_AND_COM; @@ -279,15 +281,19 @@ public class SIArchivesBiz { //判断是否要区分个人和单位福利基数 SalarySysConfPO welBaseDiff = getSalarySysConfService(user).getOneByCode(WEL_BASE_DIFF_BY_PER_AND_COM); boolean welBaseDiffSign = welBaseDiff != null && welBaseDiff.getConfValue().equals(OpenEnum.OPEN.getValue()); + //判断是否要自动调整基数 + SalarySysConfPO welBaseAutoAdjust = getSalarySysConfService(user).getOneByCode(WEL_BASE_AUTO_ADJUST); + boolean welBaseAutoAdjustSign = welBaseAutoAdjust != null && welBaseAutoAdjust.getConfValue().equals(OpenEnum.OPEN.getValue()); + switch (welfareType) { case SOCIAL_SECURITY: - data = buildSocialPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization, welBaseDiffSign); + data = buildSocialPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization, welBaseDiffSign, welBaseAutoAdjustSign); break; case ACCUMULATION_FUND: - data = buildFundPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization, welBaseDiffSign); + data = buildFundPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization, welBaseDiffSign, welBaseAutoAdjustSign); break; case OTHER: - data = buildOtherPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization, welBaseDiffSign); + data = buildOtherPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization, welBaseDiffSign, welBaseAutoAdjustSign); break; default: } @@ -302,19 +308,30 @@ public class SIArchivesBiz { * @param operateId * @return */ - public Map buildOtherPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign) { + public Map buildOtherPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign, boolean welBaseAutoAdjustSign) { Map dataMap = new HashMap<>(); InsuranceArchivesOtherSchemeDTO data = buildOtherForm(employeeId, operateId, paymentOrganization); + Map insuranceValueMap = new HashMap<>(); + Map insuranceComValueMap = new HashMap<>(); if (data != null) { - dataMap.put("data", JSONObject.parseObject(data.getOtherPaymentBaseString(), new TypeReference>() { - })); + insuranceValueMap = StrUtil.isNotBlank(data.getOtherPaymentBaseString()) + ? JSONObject.parseObject(data.getOtherPaymentBaseString(), new TypeReference>() {}) : new HashMap<>(); if (welBaseDiffSign) { - dataMap.put("comData", JSONObject.parseObject(data.getOtherPaymentComBaseString(), new TypeReference>() { - })); + insuranceComValueMap = StrUtil.isNotBlank(data.getOtherPaymentComBaseString()) + ? JSONObject.parseObject(data.getOtherPaymentComBaseString(), new TypeReference>() {}) : new HashMap<>(); } } List addGroups = new ArrayList<>(); List inputItems = buildPaymentBase(user, schemeId, welfareType); + //如果查询结果中存在 方案中缺失福利险种的值,设置初始值 + for (SearchConditionItem item : inputItems) { + String insuranceId = item.getDomkey().length > 0 ? item.getDomkey()[0] : null; + if (StrUtil.isNotBlank(insuranceId) && insuranceValueMap.get(insuranceId) == null) { + String basicValue = welBaseAutoAdjustSign ? ("0.000".equals(item.getMin()) ? "0" : item.getMin()) : "0"; + insuranceValueMap.put(insuranceId, basicValue); + } + } + dataMap.put("data", insuranceValueMap); addGroups.add(new SearchConditionGroup("其它福利缴纳基数", true, inputItems)); dataMap.put("items", addGroups); if (welBaseDiffSign) { @@ -322,6 +339,15 @@ public class SIArchivesBiz { List inputComItems = buildPaymentComBase(user, schemeId, welfareType); addComGroups.add(new SearchConditionGroup("其它福利缴纳基数", true, inputComItems)); dataMap.put("comItems", addComGroups); + + for (SearchConditionItem item : inputComItems) { + String insuranceId = item.getDomkey().length > 0 ? item.getDomkey()[0] : null; + if (StrUtil.isNotBlank(insuranceId) && insuranceComValueMap.get(insuranceId) == null) { + String basicValue = welBaseAutoAdjustSign ? ("0.000".equals(item.getMin()) ? "0" : item.getMin()) : "0"; + insuranceComValueMap.put(insuranceId, basicValue); + } + } + dataMap.put("comData", insuranceComValueMap); } return dataMap; } @@ -334,20 +360,32 @@ public class SIArchivesBiz { * @param operateId * @return */ - public Map buildFundPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign) { + public Map buildFundPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign, boolean welBaseAutoAdjustSign) { Map dataMap = new HashMap<>(); InsuranceArchivesFundSchemeDTO data = buildFundForm(employeeId, operateId, paymentOrganization); + Map insuranceValueMap = new HashMap<>(); + Map insuranceComValueMap = new HashMap<>(); if (data != null) { - dataMap.put("data", JSONObject.parseObject(data.getFundPaymentBaseString(), new TypeReference>() { - })); + insuranceValueMap = StrUtil.isNotBlank(data.getFundPaymentBaseString()) + ? JSONObject.parseObject(data.getFundPaymentBaseString(), new TypeReference>() {}) : new HashMap<>(); if (welBaseDiffSign) { - dataMap.put("comData", JSONObject.parseObject(data.getFundPaymentComBaseString(), new TypeReference>() { - })); + insuranceComValueMap = StrUtil.isNotBlank(data.getFundPaymentComBaseString()) + ? JSONObject.parseObject(data.getFundPaymentComBaseString(), new TypeReference>() {}) : new HashMap<>(); } } + List addGroups = new ArrayList<>(); List inputItems = buildPaymentBase(user, schemeId, welfareType); + //如果查询结果中存在 方案中缺失福利险种的值,设置初始值 + for (SearchConditionItem item : inputItems) { + String insuranceId = item.getDomkey().length > 0 ? item.getDomkey()[0] : null; + if (StrUtil.isNotBlank(insuranceId) && insuranceValueMap.get(insuranceId) == null) { + String basicValue = welBaseAutoAdjustSign ? ("0.000".equals(item.getMin()) ? "0" : item.getMin()) : "0"; + insuranceValueMap.put(insuranceId, basicValue); + } + } + dataMap.put("data", insuranceValueMap); addGroups.add(new SearchConditionGroup("公积金缴纳基数", true, inputItems)); dataMap.put("items", addGroups); if (welBaseDiffSign) { @@ -355,6 +393,15 @@ public class SIArchivesBiz { List inputComItems = buildPaymentComBase(user, schemeId, welfareType); addComGroups.add(new SearchConditionGroup("公积金缴纳基数", true, inputComItems)); dataMap.put("comItems", addComGroups); + + for (SearchConditionItem item : inputComItems) { + String insuranceId = item.getDomkey().length > 0 ? item.getDomkey()[0] : null; + if (StrUtil.isNotBlank(insuranceId) && insuranceComValueMap.get(insuranceId) == null) { + String basicValue = welBaseAutoAdjustSign ? ("0.000".equals(item.getMin()) ? "0" : item.getMin()) : "0"; + insuranceComValueMap.put(insuranceId, basicValue); + } + } + dataMap.put("comData", insuranceComValueMap); } return dataMap; } @@ -367,20 +414,31 @@ public class SIArchivesBiz { * @param operateId * @return */ - public Map buildSocialPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign) { + public Map buildSocialPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign, boolean welBaseAutoAdjustSign) { Map dataMap = new HashMap<>(); InsuranceArchivesSocialSchemeDTO data = buildSocialForm(employeeId, operateId, paymentOrganization); + Map insuranceValueMap = new HashMap<>(); + Map insuranceComValueMap = new HashMap<>(); if (data != null) { - dataMap.put("data", JSONObject.parseObject(data.getSchemePaymentBaseString(), new TypeReference>() { - })); + insuranceValueMap = StrUtil.isNotBlank(data.getSchemePaymentBaseString()) + ? JSONObject.parseObject(data.getSchemePaymentBaseString(), new TypeReference>() {}) : new HashMap<>(); if (welBaseDiffSign) { - dataMap.put("comData", JSONObject.parseObject(data.getSchemePaymentComBaseString(), new TypeReference>() { - })); + insuranceComValueMap = StrUtil.isNotBlank(data.getSchemePaymentComBaseString()) + ? JSONObject.parseObject(data.getSchemePaymentComBaseString(), new TypeReference>() {}) : new HashMap<>(); } } List addGroups = new ArrayList<>(); List inputItems = buildPaymentBase(user, schemeId, welfareType); + //如果查询结果中存在 方案中缺失福利险种的值,设置初始值 + for (SearchConditionItem item : inputItems) { + String insuranceId = item.getDomkey().length > 0 ? item.getDomkey()[0] : null; + if (StrUtil.isNotBlank(insuranceId) && insuranceValueMap.get(insuranceId) == null) { + String basicValue = welBaseAutoAdjustSign ? ("0.000".equals(item.getMin()) ? "0" : item.getMin()) : "0"; + insuranceValueMap.put(insuranceId, basicValue); + } + } + dataMap.put("data", insuranceValueMap); addGroups.add(new SearchConditionGroup("社保缴纳基数", true, inputItems)); dataMap.put("items", addGroups); if (welBaseDiffSign) { @@ -388,6 +446,15 @@ public class SIArchivesBiz { List inputComItems = buildPaymentComBase(user, schemeId, welfareType); addComGroups.add(new SearchConditionGroup("社保缴纳基数", true, inputComItems)); dataMap.put("comItems", addComGroups); + + for (SearchConditionItem item : inputComItems) { + String insuranceId = item.getDomkey().length > 0 ? item.getDomkey()[0] : null; + if (StrUtil.isNotBlank(insuranceId) && insuranceComValueMap.get(insuranceId) == null) { + String basicValue = welBaseAutoAdjustSign ? ("0.000".equals(item.getMin()) ? "0" : item.getMin()) : "0"; + insuranceComValueMap.put(insuranceId, basicValue); + } + } + dataMap.put("comData", insuranceComValueMap); } return dataMap;