From 5a408e8bfc44c49c47c3a41ce5b69ff745c615cb Mon Sep 17 00:00:00 2001 From: sy Date: Wed, 26 Oct 2022 15:08:17 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=E4=B8=80=E5=AF=B9=E5=A4=9A?= =?UTF-8?q?=E6=94=B9=E9=80=A0v1,=E6=A1=A3=E6=A1=88=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9=EF=BC=8C=E6=A1=A3=E6=A1=88?= =?UTF-8?q?id=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bo/InsuranceArchivesBaseInfoBO.java | 10 ++-- .../mapper/siarchives/FundSchemeMapper.java | 5 ++ .../mapper/siarchives/FundSchemeMapper.xml | 9 ++++ .../siarchives/InsuranceBaseInfoMapper.java | 6 +++ .../siarchives/InsuranceBaseInfoMapper.xml | 9 ++++ .../mapper/siarchives/OtherSchemeMapper.java | 5 ++ .../mapper/siarchives/OtherSchemeMapper.xml | 9 ++++ .../mapper/siarchives/SocialSchemeMapper.java | 5 ++ .../mapper/siarchives/SocialSchemeMapper.xml | 9 ++++ .../service/impl/SIArchivesServiceImpl.java | 34 +++++++----- .../service/impl/SISchemeServiceImpl.java | 52 +++++++++++-------- 11 files changed, 113 insertions(+), 40 deletions(-) diff --git a/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBaseInfoBO.java b/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBaseInfoBO.java index ef62a2a34..f5cd11ee4 100644 --- a/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBaseInfoBO.java +++ b/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBaseInfoBO.java @@ -55,20 +55,20 @@ public class InsuranceArchivesBaseInfoBO { Map insuranceArchivesBaseInfoListMap = SalaryEntityUtil.convert2Map(insuranceArchivesBaseInfoList, k -> k.getPaymentOrganization() + "-" + k.getEmployeeId()); taxAgentEmpChanges.forEach(change -> { - //以人员id筛选出侧面比较的档案数据,避免存在当前个税扣缴义务人外的该人员档案数据 - List moreBaseInfos = insuranceArchivesBaseInfoList.stream().filter(f -> f.getEmployeeId().equals(change.getEmployeeId())).collect(Collectors.toList()); +// //以人员id筛选出侧面比较的档案数据,避免存在当前个税扣缴义务人外的该人员档案数据 +// List moreBaseInfos = insuranceArchivesBaseInfoList.stream().filter(f -> f.getEmployeeId().equals(change.getEmployeeId())).collect(Collectors.toList()); //以个税扣缴义务人和人员id为条件筛选当前数据直接对比的档案数据 InsuranceArchivesBaseInfoPO insuranceBaseInfo = insuranceArchivesBaseInfoListMap.get(change.getTaxAgentId() + "-" + change.getEmployeeId()); // 如果是新增 说明:如果没有档案,则新增,如果有档案而且是停止缴纳,就转移到待增员中,以个税扣缴义务人和人员id判断唯一 if (change.getChangeType() == TaxAgentEmpChangeTypeEnum.ADD.getValue()) { - if (insuranceBaseInfo != null && moreBaseInfos.size() == 1) { + if (insuranceBaseInfo != null) { // 停止缴纳->待增员 if (insuranceBaseInfo.getRunStatus().equals(EmployeeStatusEnum.STOP_PAYMENT_FROM_DEL.getValue()) || insuranceBaseInfo.getRunStatus().equals(EmployeeStatusEnum.STOP_PAYMENT_FROM_ADD.getValue())) { insuranceBaseInfo.setRunStatus(EmployeeStatusEnum.STAY_ADD.getValue()); insuranceBaseInfo.setUpdateTime(now); baseInfoUpdateTodoList.add(insuranceBaseInfo); } - } else if (insuranceBaseInfo == null && moreBaseInfos.size() == 0) { + } else { //新增社保、公积金、其他福利档案 // 新增基础信息 baseInfoAddTodoList.add(InsuranceArchivesBaseInfoPO.builder() @@ -85,7 +85,7 @@ public class InsuranceArchivesBaseInfoBO { } // 如果是删除 说明:如果有档案并且是在缴纳中才处理,没档案不用管 } else if (change.getChangeType() == TaxAgentEmpChangeTypeEnum.DEL.getValue()) { - if (insuranceBaseInfo != null && moreBaseInfos.size() == 1) { + if (insuranceBaseInfo != null) { if (insuranceBaseInfo.getRunStatus().equals(EmployeeStatusEnum.PAYING.getValue())) { // 正在缴纳->待减员 insuranceBaseInfo.setRunStatus(EmployeeStatusEnum.STAY_DEL.getValue()); diff --git a/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.java b/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.java index f55930382..f530b8645 100644 --- a/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.java +++ b/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.java @@ -35,6 +35,11 @@ public interface FundSchemeMapper { */ void batchDeleteByEmployeeIds(@Param("employeeIds") Collection singletonList); + /** + * 根据人员id和个税扣缴义务人删除档案 + * @param insuranceArchivesFundSchemePO + */ + void deleteByEmployeeIdAndPayOrg(@Param("param") InsuranceArchivesFundSchemePO insuranceArchivesFundSchemePO); /** * 批量保存 * @param singletonList diff --git a/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml index db9f435af..f0f908872 100644 --- a/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml @@ -86,6 +86,15 @@ + + + UPDATE hrsa_fund_archives + SET delete_type = 1 + WHERE employee_id = #{param.employeeId} + AND payment_organization = #{param.paymentOrganization} + AND delete_type = 0 + + INSERT INTO hrsa_fund_archives( diff --git a/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.java b/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.java index 0f70dce94..207649a61 100644 --- a/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.java +++ b/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.java @@ -3,6 +3,7 @@ package com.engine.salary.mapper.siarchives; import com.engine.salary.entity.salarysob.po.SalarySobEmpFieldPO; import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam; import com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO; +import com.engine.salary.entity.siarchives.po.InsuranceArchivesOtherSchemePO; import org.apache.ibatis.annotations.Param; import java.util.Collection; @@ -49,6 +50,11 @@ public interface InsuranceBaseInfoMapper { */ void batchDeleteByEmployeeIds(@Param("employeeIds")List employeeIds); + /** + * 根据人员id和个税扣缴义务人删除档案 + * @param insuranceArchivesBaseInfoPO + */ + void deleteByEmployeeIdAndPayOrg(@Param("param") InsuranceArchivesBaseInfoPO insuranceArchivesBaseInfoPO); /** * 根据个税扣缴义务人id获取基础信息列表 * @param paymentOrganization diff --git a/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.xml b/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.xml index 2ebc26d4a..03f072a95 100644 --- a/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.xml @@ -156,6 +156,15 @@ + + + UPDATE hrsa_insurance_base_info + SET delete_type = 1 + WHERE employee_id = #{param.employeeId} + AND payment_organization = #{param.paymentOrganization} + AND delete_type = 0 + + + + + + + + + + + @@ -201,9 +201,9 @@ 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} - AND fund.fund_end_time is not null and fund.fund_end_time ]]> '' and fund.fund_end_time #{today} - AND other.other_end_time is not null and other.other_end_time ]]> '' and other.other_end_time #{today} + AND social.social_end_time is not null and social.social_end_time ]]> ' ' and social.social_end_time #{today} + AND fund.fund_end_time is not null and fund.fund_end_time ]]> ' ' and fund.fund_end_time #{today} + AND other.other_end_time is not null and other.other_end_time ]]> ' ' and other.other_end_time #{today}