diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index 39b8ac2d1..f31ec6133 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -93,7 +93,7 @@ public class SIArchivesBiz { * @param user * @return */ - public Map getBaseForm(WelfareTypeEnum welfareType, Long employeeId, Long operateId, User user) { + public Map getBaseForm(WelfareTypeEnum welfareType, Long employeeId, Long operateId, User user, Long paymentOrganization) { Map data = new HashMap<>(16); SalaryAssert.notNull(employeeId, "员工id不可为空"); EmployBiz employBiz = new EmployBiz(); @@ -141,7 +141,7 @@ public class SIArchivesBiz { //返回数据 switch (welfareType) { case SOCIAL_SECURITY: - InsuranceArchivesSocialSchemeDTO insuranceArchivesSocialSchemeDTO = buildSocialForm(employeeId, operateId); + InsuranceArchivesSocialSchemeDTO insuranceArchivesSocialSchemeDTO = buildSocialForm(employeeId, operateId, paymentOrganization); List socialList = list.stream().filter(e -> Objects.equals(e.getWelfareType(), WelfareTypeEnum.SOCIAL_SECURITY.getValue())).collect(Collectors.toList()); List socialOptions = new ArrayList<>(); socialList.forEach(social -> { @@ -160,7 +160,7 @@ public class SIArchivesBiz { data.put("items", addGroups); break; case ACCUMULATION_FUND: - InsuranceArchivesFundSchemeDTO insuranceArchivesFundSchemeDTO = buildFundForm(employeeId, operateId); + InsuranceArchivesFundSchemeDTO insuranceArchivesFundSchemeDTO = buildFundForm(employeeId, operateId, paymentOrganization); List fundList = list.stream().filter(e -> Objects.equals(e.getWelfareType(), WelfareTypeEnum.ACCUMULATION_FUND.getValue())).collect(Collectors.toList()); List fundOptions = new ArrayList<>(); fundList.forEach(social -> { @@ -178,7 +178,7 @@ public class SIArchivesBiz { data.put("items", addGroups); break; case OTHER: - InsuranceArchivesOtherSchemeDTO insuranceArchivesOtherSchemeDTO = buildOtherForm(employeeId, operateId); + InsuranceArchivesOtherSchemeDTO insuranceArchivesOtherSchemeDTO = buildOtherForm(employeeId, operateId, paymentOrganization); List otherList = list.stream().filter(e -> Objects.equals(e.getWelfareType(), WelfareTypeEnum.OTHER.getValue())).collect(Collectors.toList()); List otherOptions = new ArrayList<>(); otherList.forEach(social -> { @@ -238,17 +238,17 @@ public class SIArchivesBiz { * @param schemeId * @return */ - public Map getPaymentForm(User user, WelfareTypeEnum welfareType, Long employeeId, long operateId, Long schemeId) { + public Map getPaymentForm(User user, WelfareTypeEnum welfareType, Long employeeId, long operateId, Long schemeId, Long paymentOrganization) { Map data = new HashMap<>(16); switch (welfareType) { case SOCIAL_SECURITY: - data = buildSocialPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue()); + data = buildSocialPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization); break; case ACCUMULATION_FUND: - data = buildFundPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue()); + data = buildFundPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization); break; case OTHER: - data = buildOtherPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue()); + data = buildOtherPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization); break; default: } @@ -263,9 +263,9 @@ public class SIArchivesBiz { * @param operateId * @return */ - public Map buildOtherPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType) { + public Map buildOtherPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization) { Map dataMap = new HashMap<>(); - InsuranceArchivesOtherSchemeDTO data = buildOtherForm(employeeId, operateId); + InsuranceArchivesOtherSchemeDTO data = buildOtherForm(employeeId, operateId, paymentOrganization); if (data != null) { dataMap.put("data", JSONObject.parseObject(data.getOtherPaymentBaseString(), new TypeReference>() { })); @@ -285,10 +285,10 @@ public class SIArchivesBiz { * @param operateId * @return */ - public Map buildFundPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType) { + public Map buildFundPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization) { Map dataMap = new HashMap<>(); - InsuranceArchivesFundSchemeDTO data = buildFundForm(employeeId, operateId); + InsuranceArchivesFundSchemeDTO data = buildFundForm(employeeId, operateId, paymentOrganization); if (data != null) { dataMap.put("data", JSONObject.parseObject(data.getFundPaymentBaseString(), new TypeReference>() { })); @@ -308,9 +308,9 @@ public class SIArchivesBiz { * @param operateId * @return */ - public Map buildSocialPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType) { + public Map buildSocialPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization) { Map dataMap = new HashMap<>(); - InsuranceArchivesSocialSchemeDTO data = buildSocialForm(employeeId, operateId); + InsuranceArchivesSocialSchemeDTO data = buildSocialForm(employeeId, operateId, paymentOrganization); if (data != null) { dataMap.put("data", JSONObject.parseObject(data.getSchemePaymentBaseString(), new TypeReference>() { })); @@ -389,11 +389,15 @@ public class SIArchivesBiz { * @param operateId * @return */ - public InsuranceArchivesOtherSchemeDTO buildOtherForm(Long employeeId, Long operateId) { + public InsuranceArchivesOtherSchemeDTO buildOtherForm(Long employeeId, Long operateId, Long paymentOrganization) { SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { OtherSchemeMapper otherSchemeMapper = sqlSession.getMapper(OtherSchemeMapper.class); - List otherList = otherSchemeMapper.getOtherByEmployeeId(Collections.singletonList(employeeId)); +// List otherList = otherSchemeMapper.getOtherByEmployeeId(Collections.singletonList(employeeId)); + List otherList = otherSchemeMapper.getOtherByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder() + .employeeId(employeeId) + .paymentOrganization(paymentOrganization) + .build()); InsuranceArchivesOtherSchemePOEncrypt.decryptList(otherList); InsuranceArchivesOtherSchemePO insuranceArchivesOtherSchemePO = otherList.size() != 0 ? otherList.get(0) : null; InsuranceArchivesOtherSchemeDTO data = InsuranceArchivesBO.convertOtherPOtoDTO(insuranceArchivesOtherSchemePO, employeeId); @@ -415,12 +419,16 @@ public class SIArchivesBiz { * @param operateId * @return */ - public InsuranceArchivesFundSchemeDTO buildFundForm(Long employeeId, Long operateId) { + public InsuranceArchivesFundSchemeDTO buildFundForm(Long employeeId, Long operateId, Long paymentOrganization) { SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { FundSchemeMapper fundSchemeMapper = sqlSession.getMapper(FundSchemeMapper.class); - List fundList = fundSchemeMapper.getFundByEmployeeId(Collections.singletonList(employeeId)); +// List fundList = fundSchemeMapper.getFundByEmployeeId(Collections.singletonList(employeeId)); + List fundList = fundSchemeMapper.getFundByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder() + .employeeId(employeeId) + .paymentOrganization(paymentOrganization) + .build()); InsuranceArchivesFundSchemePOEncrypt.decryptList(fundList); InsuranceArchivesFundSchemePO insuranceArchivesFundSchemePO = fundList.size() != 0 ? fundList.get(0) : null; InsuranceArchivesFundSchemeDTO data = InsuranceArchivesBO.convertFundPOtoDTO(insuranceArchivesFundSchemePO, employeeId); @@ -442,8 +450,8 @@ public class SIArchivesBiz { * @param operateId * @return */ - public InsuranceArchivesSocialSchemeDTO buildSocialForm(Long employeeId, Long operateId) { - InsuranceArchivesSocialSchemePO insuranceArchivesSocialSchemePO = getSocialByEmployeeId(employeeId); + public InsuranceArchivesSocialSchemeDTO buildSocialForm(Long employeeId, Long operateId, Long paymentOrganization) { + InsuranceArchivesSocialSchemePO insuranceArchivesSocialSchemePO = getSocialByEmployeeId(employeeId, paymentOrganization); InsuranceArchivesSocialSchemeDTO data = InsuranceArchivesBO.convertSocialPOtoDTO(insuranceArchivesSocialSchemePO, employeeId); if (insuranceArchivesSocialSchemePO == null) { data.setEmployeeId(employeeId); @@ -459,11 +467,14 @@ public class SIArchivesBiz { * @param employeeId * @return */ - public InsuranceArchivesSocialSchemePO getSocialByEmployeeId(Long employeeId) { + public InsuranceArchivesSocialSchemePO getSocialByEmployeeId(Long employeeId, Long paymentOrganization) { SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { SocialSchemeMapper socialSchemeMapper = sqlSession.getMapper(SocialSchemeMapper.class); - List socialList = socialSchemeMapper.getSocialByEmployeeId(Collections.singletonList(employeeId)); + List socialList = socialSchemeMapper.getSocialByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder() + .employeeId(employeeId) + .paymentOrganization(paymentOrganization) + .build()); InsuranceArchivesSocialSchemePOEncrypt.decryptList(socialList); return socialList.size() != 0 ? socialList.get(0) : null; } finally { @@ -927,6 +938,8 @@ public class SIArchivesBiz { public Map> buildColumnTitle(List insuranceArchivesEmployeePOS, long operateId) { SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); Map> result = new HashMap<>(); + + insuranceArchivesEmployeePOS = insuranceArchivesEmployeePOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesEmployeePO::getEmployeeId))), ArrayList::new)); try { SocialSchemeMapper socialSchemeMapper = sqlSession.getMapper(SocialSchemeMapper.class); diff --git a/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.xml b/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.xml index 03f072a95..1070f0019 100644 --- a/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.xml @@ -178,9 +178,9 @@ SELECT FROM hrsa_insurance_base_info t - LEFT JOIN( SELECT social.employee_id, social.social_end_time FROM hrsa_social_archives social WHERE social.delete_type = 0 )social ON t.employee_id = social.employee_id - LEFT JOIN( SELECT fund.employee_id, fund.fund_end_time FROM hrsa_fund_archives fund WHERE fund.delete_type = 0 )fund ON t.employee_id = fund.employee_id - LEFT JOIN( SELECT other.employee_id, other.other_end_time FROM hrsa_other_archives other WHERE other.delete_type = 0 )other ON t.employee_id = other.employee_id + LEFT JOIN( SELECT social.payment_organization, social.employee_id, social.social_end_time FROM hrsa_social_archives social WHERE social.delete_type = 0 )social ON t.employee_id = social.employee_id AND t.payment_organization = social.payment_organization + LEFT JOIN( SELECT fund.payment_organization, fund.employee_id, fund.fund_end_time FROM hrsa_fund_archives fund WHERE fund.delete_type = 0 )fund ON t.employee_id = fund.employee_id AND t.payment_organization = fund.payment_organization + LEFT JOIN( SELECT other.payment_organization, other.employee_id, other.other_end_time FROM hrsa_other_archives other WHERE other.delete_type = 0 )other ON t.employee_id = other.employee_id AND t.payment_organization = other.payment_organization WHERE t.delete_type = 0 AND t.run_status = '3' AND ( @@ -196,9 +196,9 @@ SELECT FROM hrsa_insurance_base_info t - LEFT JOIN( SELECT social.employee_id, social.social_end_time FROM hrsa_social_archives social WHERE social.delete_type = 0 )social ON t.employee_id = social.employee_id - LEFT JOIN( SELECT fund.employee_id, fund.fund_end_time FROM hrsa_fund_archives fund WHERE fund.delete_type = 0 )fund ON t.employee_id = fund.employee_id - LEFT JOIN( SELECT other.employee_id, other.other_end_time FROM hrsa_other_archives other WHERE other.delete_type = 0 )other ON t.employee_id = other.employee_id + LEFT JOIN( SELECT social.payment_organization, social.employee_id, social.social_end_time FROM hrsa_social_archives social WHERE social.delete_type = 0 )social ON t.employee_id = social.employee_id AND t.payment_organization = social.payment_organization + LEFT JOIN( SELECT fund.payment_organization, fund.employee_id, fund.fund_end_time FROM hrsa_fund_archives fund WHERE fund.delete_type = 0 )fund ON t.employee_id = fund.employee_id AND t.payment_organization = fund.payment_organization + LEFT JOIN( SELECT other.payment_organization, other.employee_id, other.other_end_time FROM hrsa_other_archives other WHERE other.delete_type = 0 )other ON t.employee_id = other.employee_id AND t.payment_organization = other.payment_organization WHERE t.delete_type = 0 AND t.run_status = '2' AND social.social_end_time is not null and social.social_end_time ]]> '' and social.social_end_time #{today} diff --git a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java index db3f60c9c..28fff2e1a 100644 --- a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java @@ -100,7 +100,8 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService siArchivesBiz.setTaxAgentPOS(taxAgentPOS); WelfareTypeEnum welfareTypeEnum = (WelfareTypeEnum) params.get("welfareTypeEnum"); Long employeeId = Long.valueOf(Util.null2String(params.get("employeeId"))); - apidatas = siArchivesBiz.getBaseForm(welfareTypeEnum, employeeId, (long) user.getUID(), user); + Long paymentOrganization = welfareTypeEnum != null ? Long.valueOf(Util.null2String(params.get("paymentOrganization"))) : null; + apidatas = siArchivesBiz.getBaseForm(welfareTypeEnum, employeeId, (long) user.getUID(), user, paymentOrganization); return apidatas; } @@ -111,12 +112,13 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService WelfareTypeEnum welfareTypeEnum = (WelfareTypeEnum) params.get("welfareTypeEnum"); Long employeeId = Long.valueOf(Util.null2String(params.get("employeeId"))); String schemeIdStr = Util.null2String(params.get("schemeId")); + Long paymentOrganization = Long.valueOf(Util.null2String(params.get("paymentOrganization"))); Long schemeId = null; if (StringUtils.isNotBlank(schemeIdStr)) { schemeId = Long.valueOf(schemeIdStr); } - apidatas = siArchivesBiz.getPaymentForm(user, welfareTypeEnum, employeeId, (long) user.getUID(), schemeId); + apidatas = siArchivesBiz.getPaymentForm(user, welfareTypeEnum, employeeId, (long) user.getUID(), schemeId, paymentOrganization); return apidatas; } @@ -301,7 +303,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService } //导入社保档案 if (CollectionUtils.isNotEmpty(socialList)) { - socialList = socialList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesSocialSchemePO::getEmployeeId))), ArrayList::new)); +// socialList = socialList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesSocialSchemePO::getEmployeeId))), ArrayList::new)); //根据人员id和个税扣缴义务人id删除对应档案 socialList.forEach(getSocialSchemeMapper()::deleteByEmployeeIdAndPayOrg); // List socialEmployeeIds = socialList.stream().map(InsuranceArchivesSocialSchemePO::getEmployeeId).collect(Collectors.toList()); @@ -314,7 +316,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService if (CollectionUtils.isNotEmpty(fundList)) { fundList = fundList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesFundSchemePO::getEmployeeId))), ArrayList::new)); //根据人员id和个税扣缴义务人id删除对应档案 - fundList.forEach(getFundSchemeMapper()::deleteByEmployeeIdAndPayOrg); +// fundList.forEach(getFundSchemeMapper()::deleteByEmployeeIdAndPayOrg); // List fundEmployeeIds = fundList.stream().map(InsuranceArchivesFundSchemePO::getEmployeeId).collect(Collectors.toList()); // List> fundEmployeeIdsPartition = Lists.partition(fundEmployeeIds, 100); // fundEmployeeIdsPartition.forEach(getFundSchemeMapper()::batchDeleteByEmployeeIds); @@ -323,7 +325,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService } //导入其他福利档案 if (CollectionUtils.isNotEmpty(otherList)) { - otherList = otherList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesOtherSchemePO::getEmployeeId))), ArrayList::new)); +// otherList = otherList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesOtherSchemePO::getEmployeeId))), ArrayList::new)); //根据人员id和个税扣缴义务人id删除对应档案 otherList.forEach(getOtherSchemeMapper()::deleteByEmployeeIdAndPayOrg); // List otherEmployeeIds = otherList.stream().map(InsuranceArchivesOtherSchemePO::getEmployeeId).collect(Collectors.toList()); @@ -334,7 +336,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService } //导入福利档案基础信息 if (CollectionUtils.isNotEmpty(baseInfoPOList)) { - baseInfoPOList = baseInfoPOList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesBaseInfoPO::getEmployeeId))), ArrayList::new)); +// baseInfoPOList = baseInfoPOList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesBaseInfoPO::getEmployeeId))), ArrayList::new)); //根据人员id和个税扣缴义务人id删除对应档案 baseInfoPOList.forEach(getInsuranceBaseInfoMapper()::deleteByEmployeeIdAndPayOrg); // //分批批量删除 diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index 628d7612d..28b187a70 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -1115,7 +1115,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { //导入社保档案 List socialSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getSocial).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(socialSchemePOS)) { - socialSchemePOS = socialSchemePOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesSocialSchemePO::getEmployeeId))), ArrayList::new)); +// socialSchemePOS = socialSchemePOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesSocialSchemePO::getEmployeeId))), ArrayList::new)); //根据人员id和个税扣缴义务人id删除对应档案 socialSchemePOS.forEach(getSocialSchemeMapper()::deleteByEmployeeIdAndPayOrg); // List socialEmployeeIds = socialSchemePOS.stream().map(InsuranceArchivesSocialSchemePO::getEmployeeId).collect(Collectors.toList()); @@ -1128,7 +1128,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { //导入公积金档案 List fundSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getFund).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(fundSchemePOS)) { - fundSchemePOS = fundSchemePOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesFundSchemePO::getEmployeeId))), ArrayList::new)); +// fundSchemePOS = fundSchemePOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesFundSchemePO::getEmployeeId))), ArrayList::new)); //根据人员id和个税扣缴义务人id删除对应档案 fundSchemePOS.forEach(getFundSchemeMapper()::deleteByEmployeeIdAndPayOrg); // List fundEmployeeIds = fundSchemePOS.stream().map(InsuranceArchivesFundSchemePO::getEmployeeId).collect(Collectors.toList()); @@ -1141,7 +1141,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { //导入其他福利档案 List otherSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getOther).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(otherSchemePOS)) { - otherSchemePOS = otherSchemePOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesOtherSchemePO::getEmployeeId))), ArrayList::new)); +// otherSchemePOS = otherSchemePOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesOtherSchemePO::getEmployeeId))), ArrayList::new)); //根据人员id和个税扣缴义务人id删除对应档案 otherSchemePOS.forEach(getOtherSchemeMapper()::deleteByEmployeeIdAndPayOrg); // List otherEmployeeIds = otherSchemePOS.stream().map(InsuranceArchivesOtherSchemePO::getEmployeeId).collect(Collectors.toList()); @@ -1154,7 +1154,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { //导入福利档案基础信息 List baseInfoPOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getBaseInfo).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(baseInfoPOS)) { - baseInfoPOS = baseInfoPOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesBaseInfoPO::getEmployeeId))), ArrayList::new)); +// baseInfoPOS = baseInfoPOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesBaseInfoPO::getEmployeeId))), ArrayList::new)); //根据人员id和个税扣缴义务人id删除对应档案 baseInfoPOS.forEach(getInsuranceBaseInfoMapper()::deleteByEmployeeIdAndPayOrg); //分批批量删除