diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index e8c454de5..56c6a6b17 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -1226,6 +1226,10 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { // List socialEmployeeIds = socialSchemePOS.stream().map(InsuranceArchivesSocialSchemePO::getEmployeeId).collect(Collectors.toList()); // List> socialEmployeeIdPartition = Lists.partition(socialEmployeeIds, 100); // socialEmployeeIdPartition.forEach(getSocialSchemeMapper()::batchDeleteByEmployeeIds); + //去除员工id+个税扣缴义务人下重复的数据 + socialSchemePOS = socialSchemePOS.stream() + .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getPaymentOrganization() + "-" + f.getEmployeeId()))), ArrayList::new)); + List insuranceArchivesSocialSchemePOS = InsuranceArchivesSocialSchemePOEncrypt.encryptList(socialSchemePOS); List> partition = Lists.partition(insuranceArchivesSocialSchemePOS, 100); partition.forEach(getSocialSchemeMapper()::batchSave); @@ -1239,6 +1243,10 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { // List fundEmployeeIds = fundSchemePOS.stream().map(InsuranceArchivesFundSchemePO::getEmployeeId).collect(Collectors.toList()); // List> fundEmployeeIdsPartition = Lists.partition(fundEmployeeIds, 100); // fundEmployeeIdsPartition.forEach(getFundSchemeMapper()::batchDeleteByEmployeeIds); + //去除员工id+个税扣缴义务人下重复的数据 + fundSchemePOS = fundSchemePOS.stream() + .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getPaymentOrganization() + "-" + f.getEmployeeId()))), ArrayList::new)); + List insuranceArchivesFundSchemePOS = InsuranceArchivesFundSchemePOEncrypt.encryptList(fundSchemePOS); List> partition = Lists.partition(insuranceArchivesFundSchemePOS, 100); partition.forEach(getFundSchemeMapper()::batchSave); @@ -1252,6 +1260,10 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { // List otherEmployeeIds = otherSchemePOS.stream().map(InsuranceArchivesOtherSchemePO::getEmployeeId).collect(Collectors.toList()); // List> otherEmployeeIdsPartition = Lists.partition(otherEmployeeIds, 100); // otherEmployeeIdsPartition.forEach(getOtherSchemeMapper()::batchDeleteByEmployeeIds); + //去除员工id+个税扣缴义务人下重复的数据 + otherSchemePOS = otherSchemePOS.stream() + .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getPaymentOrganization() + "-" + f.getEmployeeId()))), ArrayList::new)); + List insuranceArchivesOtherSchemePOS = InsuranceArchivesOtherSchemePOEncrypt.encryptList(otherSchemePOS); List> partition = Lists.partition(insuranceArchivesOtherSchemePOS, 100); partition.forEach(getOtherSchemeMapper()::batchSave); @@ -1260,6 +1272,9 @@ 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)); + //去除员工id+个税扣缴义务人下重复的数据 + baseInfoPOS = baseInfoPOS.stream() + .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getPaymentOrganization() + "-" + f.getEmployeeId()))), ArrayList::new)); //根据人员id和个税扣缴义务人id删除对应档案 baseInfoPOS.forEach(getInsuranceBaseInfoMapper()::deleteByEmployeeIdAndPayOrg); //分批批量删除