From 54a3f31cc2a3fcef9c24fe7c6c818853abeb1755 Mon Sep 17 00:00:00 2001 From: sy Date: Thu, 27 Oct 2022 18:21:53 +0800 Subject: [PATCH] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-=E7=A6=8F?= =?UTF-8?q?=E5=88=A9=E6=A1=A3=E6=A1=88=E4=B8=80=E5=AF=B9=E5=A4=9A=E6=94=B9?= =?UTF-8?q?=E9=80=A0=EF=BC=8C=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=E5=A2=9E?= =?UTF-8?q?=E9=87=8F=E6=95=B0=E6=8D=AE=E5=A4=84=E7=90=86=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../siarchives/InsuranceBaseInfoMapper.xml | 4 ++-- .../service/impl/SIArchivesServiceImpl.java | 21 ++++--------------- 2 files changed, 6 insertions(+), 19 deletions(-) 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<>();