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())) {