薪酬系统-福利档案,档案数据通过导入excel入库前,根据人员id和个税扣缴义务人进行去重

This commit is contained in:
sy 2022-12-02 17:57:09 +08:00
parent 22a7258229
commit 33aa8ea507
1 changed files with 15 additions and 0 deletions

View File

@ -1226,6 +1226,10 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
// List<Long> socialEmployeeIds = socialSchemePOS.stream().map(InsuranceArchivesSocialSchemePO::getEmployeeId).collect(Collectors.toList());
// List<List<Long>> 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<InsuranceArchivesSocialSchemePO> insuranceArchivesSocialSchemePOS = InsuranceArchivesSocialSchemePOEncrypt.encryptList(socialSchemePOS);
List<List<InsuranceArchivesSocialSchemePO>> partition = Lists.partition(insuranceArchivesSocialSchemePOS, 100);
partition.forEach(getSocialSchemeMapper()::batchSave);
@ -1239,6 +1243,10 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
// List<Long> fundEmployeeIds = fundSchemePOS.stream().map(InsuranceArchivesFundSchemePO::getEmployeeId).collect(Collectors.toList());
// List<List<Long>> 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<InsuranceArchivesFundSchemePO> insuranceArchivesFundSchemePOS = InsuranceArchivesFundSchemePOEncrypt.encryptList(fundSchemePOS);
List<List<InsuranceArchivesFundSchemePO>> partition = Lists.partition(insuranceArchivesFundSchemePOS, 100);
partition.forEach(getFundSchemeMapper()::batchSave);
@ -1252,6 +1260,10 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
// List<Long> otherEmployeeIds = otherSchemePOS.stream().map(InsuranceArchivesOtherSchemePO::getEmployeeId).collect(Collectors.toList());
// List<List<Long>> 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<InsuranceArchivesOtherSchemePO> insuranceArchivesOtherSchemePOS = InsuranceArchivesOtherSchemePOEncrypt.encryptList(otherSchemePOS);
List<List<InsuranceArchivesOtherSchemePO>> partition = Lists.partition(insuranceArchivesOtherSchemePOS, 100);
partition.forEach(getOtherSchemeMapper()::batchSave);
@ -1260,6 +1272,9 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
List<InsuranceArchivesBaseInfoPO> 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);
//分批批量删除