diff --git a/src/com/engine/salary/service/impl/SIRepairServiceImpl.java b/src/com/engine/salary/service/impl/SIRepairServiceImpl.java index 270fbb143..9ce45ed5a 100644 --- a/src/com/engine/salary/service/impl/SIRepairServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIRepairServiceImpl.java @@ -223,13 +223,18 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { List> resultList = new ArrayList<>(); if (projects.contains(ProjectTypeEnum.ALL.getValue())) { - 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)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); String welfareTypeSign = welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "social" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "fund" : "other" ); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) { @@ -257,13 +262,18 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { }); } - 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)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); String welfareTypeSign = welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "social" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "fund" : "other" ); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) { @@ -291,13 +301,18 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { }); } - 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())) { @@ -327,13 +342,18 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { return resultList; } if (projects.contains(ProjectTypeEnum.SOCIAL.getValue())) { - 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)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); String welfareTypeSign = welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "social" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "fund" : "other" ); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) { @@ -365,15 +385,22 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { if ((!projects.contains(ProjectTypeEnum.SOCIAL.getValue())) && (projects.contains(ProjectTypeEnum.ENDOWMENT_INSURANCE.getValue())) && (projects.contains(ProjectTypeEnum.MEDICAL_INSURANCE.getValue()))) { - 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()); socialMap = socialMap.entrySet().stream().filter(e -> "9001".equals(e.getKey()) || "9002".equals(e.getKey())) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + Map socialComMap = JSON.parseObject(socialSchemePO.getSocialPaymentComBaseString(), new HashMap().getClass()); + socialComMap = socialComMap.entrySet().stream().filter(e -> "9001".equals(e.getKey()) || "9002".equals(e.getKey())) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + 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)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); String welfareTypeSign = welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "social" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "fund" : "other" ); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) { @@ -405,15 +432,23 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { if ((!projects.contains(ProjectTypeEnum.SOCIAL.getValue())) && (projects.contains(ProjectTypeEnum.ENDOWMENT_INSURANCE.getValue())) && (!projects.contains(ProjectTypeEnum.MEDICAL_INSURANCE.getValue()))) { - 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()); socialMap = socialMap.entrySet().stream().filter(e -> "9001".equals(e.getKey())) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + + Map socialComMap = JSON.parseObject(socialSchemePO.getSocialPaymentComBaseString(), new HashMap().getClass()); + socialComMap = socialComMap.entrySet().stream().filter(e -> "9001".equals(e.getKey())) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + 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)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); String welfareTypeSign = welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "social" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "fund" : "other" ); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) { @@ -445,15 +480,22 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { if ((!projects.contains(ProjectTypeEnum.SOCIAL.getValue())) && (!projects.contains(ProjectTypeEnum.ENDOWMENT_INSURANCE.getValue())) && (projects.contains(ProjectTypeEnum.MEDICAL_INSURANCE.getValue()))) { - 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()); socialMap = socialMap.entrySet().stream().filter(e -> "9002".equals(e.getKey())) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + Map socialComMap = JSON.parseObject(socialSchemePO.getSocialPaymentComBaseString(), new HashMap().getClass()); + socialComMap = socialComMap.entrySet().stream().filter(e -> "9002".equals(e.getKey())) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + 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)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); String welfareTypeSign = welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "social" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "fund" : "other" ); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) { @@ -483,14 +525,18 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { } } if (projects.contains(ProjectTypeEnum.FUND.getValue())) { - 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)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); String welfareTypeSign = welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "social" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "fund" : "other" ); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) { @@ -520,14 +566,18 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { } } if (projects.contains(ProjectTypeEnum.OTHER.getValue())) { - 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)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); String welfareTypeSign = welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "social" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "fund" : "other" ); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) {