diff --git a/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.xml b/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.xml index 1070f0019..63fe3a015 100644 --- a/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.xml @@ -59,8 +59,8 @@ fund.id AS fundArchivesId, other.id AS otherArchivesId FROM hrsa_social_archives social - LEFT JOIN( SELECT fund.employee_id, fund.id FROM hrsa_fund_archives fund WHERE fund.delete_type = 0 )fund ON social.employee_id = fund.employee_id - LEFT JOIN( SELECT other.employee_id, other.id FROM hrsa_other_archives other WHERE other.delete_type = 0 )other ON social.employee_id = other.employee_id + LEFT JOIN( SELECT fund.payment_organization, fund.employee_id, fund.id FROM hrsa_fund_archives fund WHERE fund.delete_type = 0 )fund ON social.employee_id = fund.employee_id AND social.payment_organization = fund.payment_organization + LEFT JOIN( SELECT other.payment_organization, other.employee_id, other.id FROM hrsa_other_archives other WHERE other.delete_type = 0 )other ON social.employee_id = other.employee_id AND social.payment_organization = other.payment_organization WHERE social.delete_type = 0 diff --git a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java index c42b5bfd6..34edf2a2f 100644 --- a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java @@ -303,46 +303,33 @@ 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)); //根据人员id和个税扣缴义务人id删除对应档案 socialList.forEach(getSocialSchemeMapper()::deleteByEmployeeIdAndPayOrg); -// List socialEmployeeIds = socialList.stream().map(InsuranceArchivesSocialSchemePO::getEmployeeId).collect(Collectors.toList()); -// List> socialEmployeeIdPartition = Lists.partition(socialEmployeeIds, 100); -// socialEmployeeIdPartition.forEach(getSocialSchemeMapper()::batchDeleteByEmployeeIds); + List> partition = Lists.partition(socialList, 100); partition.forEach(getSocialSchemeMapper()::batchSave); } //导入公积金档案 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); -// List fundEmployeeIds = fundList.stream().map(InsuranceArchivesFundSchemePO::getEmployeeId).collect(Collectors.toList()); -// List> fundEmployeeIdsPartition = Lists.partition(fundEmployeeIds, 100); -// fundEmployeeIdsPartition.forEach(getFundSchemeMapper()::batchDeleteByEmployeeIds); + List> partition = Lists.partition(fundList, 100); partition.forEach(getFundSchemeMapper()::batchSave); } //导入其他福利档案 if (CollectionUtils.isNotEmpty(otherList)) { -// 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()); -// List> otherEmployeeIdsPartition = Lists.partition(otherEmployeeIds, 100); -// otherEmployeeIdsPartition.forEach(getOtherSchemeMapper()::batchDeleteByEmployeeIds); + List> partition = Lists.partition(otherList, 100); partition.forEach(getOtherSchemeMapper()::batchSave); } //导入福利档案基础信息 if (CollectionUtils.isNotEmpty(baseInfoPOList)) { -// baseInfoPOList = baseInfoPOList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesBaseInfoPO::getEmployeeId))), ArrayList::new)); //根据人员id和个税扣缴义务人id删除对应档案 baseInfoPOList.forEach(getInsuranceBaseInfoMapper()::deleteByEmployeeIdAndPayOrg); // //分批批量删除 List baseInfoEmployeeIds = baseInfoPOList.stream().map(InsuranceArchivesBaseInfoPO::getEmployeeId).collect(Collectors.toList()); -// List> employeeIdPartition = Lists.partition(baseInfoEmployeeIds, 100); -// employeeIdPartition.forEach(getInsuranceBaseInfoMapper()::batchDeleteByEmployeeIds); + //查询目标人员的剩余的福利档案基础信息(社保、公积金、其他福利档案id) List moreBaseInfoPOS = getInsuranceBaseInfoMapper().getInsuranceBaseInfoListByInsuranceDetail(baseInfoEmployeeIds); List newInsuranceArchivesBaseInfoList = new ArrayList<>();