From 9819bb25e0339f2727692a546527fdf8a5a6c41d Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Mon, 29 Jul 2024 10:58:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A4=BE=E4=BF=9D=E7=A6=8F?= =?UTF-8?q?=E5=88=A9=E5=8F=B0=E8=B4=A6=E8=A1=A5=E5=B7=AE=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SIBalanceServiceImpl.java | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/com/engine/salary/service/impl/SIBalanceServiceImpl.java b/src/com/engine/salary/service/impl/SIBalanceServiceImpl.java index b9ec0de27..bb0c776b3 100644 --- a/src/com/engine/salary/service/impl/SIBalanceServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIBalanceServiceImpl.java @@ -167,13 +167,18 @@ public class SIBalanceServiceImpl extends Service implements SIBalanceService { List> resultList = new ArrayList<>(); - if (socialSchemePO != null && StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString())) { + if (socialSchemePO != null && (StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString()) || StringUtils.isNotBlank(socialSchemePO.getSocialPaymentComBaseString()) )) { Map socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap().getClass()); + Map socialComMap = JSON.parseObject(socialSchemePO.getSocialPaymentComBaseString(), new HashMap().getClass()); + List socialIds = new ArrayList<>(); + socialIds.addAll(socialMap.keySet()); + socialIds.addAll(socialComMap.keySet()); + socialIds = socialIds.stream().distinct().collect(Collectors.toList()); //查询该福利方案下开启缴纳的福利项 List insuranceIdAndScopeList = payInsuranceIdAndScopeList(socialSchemePO.getSocialSchemeId()); List insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().listBySchemeIds(Collections.singletonList(socialSchemePO.getSocialSchemeId())); Map schemeValidNumMap = SalaryEntityUtil.convert2Map(insuranceSchemeDetailPOS, po -> po.getInsuranceId() + "-" + po.getPaymentScope(), InsuranceSchemeDetailPO::getValidNum); - socialMap.forEach((k, v) -> { + socialIds.forEach(k -> { String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); String welfareTypeSign = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "social" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "fund" : "other" ); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) { @@ -203,13 +208,18 @@ public class SIBalanceServiceImpl extends Service implements SIBalanceService { }); } - if (fundSchemePO != null && StringUtils.isNotBlank(fundSchemePO.getFundPaymentBaseString())) { + if (fundSchemePO != null && (StringUtils.isNotBlank(fundSchemePO.getFundPaymentBaseString()) || StringUtils.isNotBlank(fundSchemePO.getFundPaymentComBaseString()))) { Map fundMap = JSON.parseObject(fundSchemePO.getFundPaymentBaseString(), new HashMap().getClass()); + Map fundComMap = JSON.parseObject(fundSchemePO.getFundPaymentComBaseString(), new HashMap().getClass()); + List fundIds = new ArrayList<>(); + fundIds.addAll(fundMap.keySet()); + fundIds.addAll(fundComMap.keySet()); + fundIds = fundIds.stream().distinct().collect(Collectors.toList()); //查询该福利方案下开启缴纳的福利项 List insuranceIdAndScopeList = payInsuranceIdAndScopeList(fundSchemePO.getFundSchemeId()); List insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().listBySchemeIds(Collections.singletonList(fundSchemePO.getFundSchemeId())); Map schemeValidNumMap = SalaryEntityUtil.convert2Map(insuranceSchemeDetailPOS, po -> po.getInsuranceId() + "-" + po.getPaymentScope(), InsuranceSchemeDetailPO::getValidNum); - fundMap.forEach((k, v) -> { + fundIds.forEach(k -> { String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); String welfareTypeSign = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "social" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "fund" : "other" ); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) { @@ -239,14 +249,19 @@ public class SIBalanceServiceImpl extends Service implements SIBalanceService { }); } - if (otherSchemePO != null && StringUtils.isNotBlank(otherSchemePO.getOtherPaymentBaseString())) { + if (otherSchemePO != null && (StringUtils.isNotBlank(otherSchemePO.getOtherPaymentBaseString()) || StringUtils.isNotBlank(otherSchemePO.getOtherPaymentComBaseString()))) { Map otherMap = JSON.parseObject(otherSchemePO.getOtherPaymentBaseString(), new HashMap().getClass()); + Map otherComMap = JSON.parseObject(otherSchemePO.getOtherPaymentComBaseString(), new HashMap().getClass()); + List otherIds = new ArrayList<>(); + otherIds.addAll(otherMap.keySet()); + otherIds.addAll(otherComMap.keySet()); + otherIds = otherIds.stream().distinct().collect(Collectors.toList()); //查询该福利方案下开启缴纳的福利项 List insuranceIdAndScopeList = payInsuranceIdAndScopeList(otherSchemePO.getOtherSchemeId()); List insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().listBySchemeIds(Collections.singletonList(otherSchemePO.getOtherSchemeId())); Map schemeValidNumMap = SalaryEntityUtil.convert2Map(insuranceSchemeDetailPOS, po -> po.getInsuranceId() + "-" + po.getPaymentScope(), InsuranceSchemeDetailPO::getValidNum); - otherMap.forEach((k, v) -> { + otherIds.forEach(k -> { String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); String welfareTypeSign = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "social" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "fund" : "other" ); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) {