薪酬系统-福利档案,批量减员逻辑变更,自动减员逻辑变更,无福利方案时,不关注最终缴纳月

This commit is contained in:
sy 2022-12-12 17:53:05 +08:00
parent 1fb706b7da
commit 32cffdccf5
2 changed files with 9 additions and 9 deletions

View File

@ -214,14 +214,14 @@
SELECT
<include refid="baseColumns"/>
FROM hrsa_insurance_base_info t
LEFT JOIN( SELECT social.payment_organization, social.employee_id, social.social_end_time FROM hrsa_social_archives social WHERE social.delete_type = 0 )social ON t.employee_id = social.employee_id AND t.payment_organization = social.payment_organization
LEFT JOIN( SELECT fund.payment_organization, fund.employee_id, fund.fund_end_time FROM hrsa_fund_archives fund WHERE fund.delete_type = 0 )fund ON t.employee_id = fund.employee_id AND t.payment_organization = fund.payment_organization
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
LEFT JOIN( SELECT social.payment_organization, social.employee_id, social.social_end_time, social.social_scheme_id FROM hrsa_social_archives social WHERE social.delete_type = 0 )social ON t.employee_id = social.employee_id AND t.payment_organization = social.payment_organization
LEFT JOIN( SELECT fund.payment_organization, fund.employee_id, fund.fund_end_time, fund.fund_scheme_id FROM hrsa_fund_archives fund WHERE fund.delete_type = 0 )fund ON t.employee_id = fund.employee_id AND t.payment_organization = fund.payment_organization
LEFT JOIN( SELECT other.payment_organization, other.employee_id, other.other_end_time, other.other_scheme_id 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 <![CDATA[ <> ]]> ' ' and social.social_end_time <![CDATA[ <= ]]> #{today}
AND fund.fund_end_time is not null and fund.fund_end_time <![CDATA[ <> ]]> ' ' and fund.fund_end_time <![CDATA[ <= ]]> #{today}
AND other.other_end_time is not null and other.other_end_time <![CDATA[ <> ]]> ' ' and other.other_end_time <![CDATA[ <= ]]> #{today}
AND (social.social_scheme_id is null or (social.social_end_time is not null and social.social_end_time <![CDATA[ <> ]]> ' ' and social.social_end_time <![CDATA[ <= ]]> #{today}))
AND (fund.fund_scheme_id is null or (fund.fund_end_time is not null and fund.fund_end_time <![CDATA[ <> ]]> ' ' and fund.fund_end_time <![CDATA[ <= ]]> #{today}))
AND (other.other_scheme_id is null or (other.other_end_time is not null and other.other_end_time <![CDATA[ <> ]]> ' ' and other.other_end_time <![CDATA[ <= ]]> #{today}))
</select>
<select id="getAbnormalList" resultType="com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO">

View File

@ -668,7 +668,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
socialList = getSocialSchemeMapper().getSocialById(socialIds);
//筛选可减员的社保档案相关信息
toStopSocialIds = socialList.stream().filter(f->f.getSocialEndTime() != null && f.getSocialEndTime().length() > 0 && (f.getSocialEndTime().compareTo(todayMonth)) <= 0)
toStopSocialIds = socialList.stream().filter(f-> f.getSocialSchemeId() == null || (f.getSocialEndTime() != null && f.getSocialEndTime().length() > 0 && (f.getSocialEndTime().compareTo(todayMonth)) <= 0))
.map(InsuranceArchivesSocialSchemePO::getId).collect(Collectors.toList());
//
List<Long> finalToStopSocialIds = toStopSocialIds;
@ -678,7 +678,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
if (fundIds.size() > 0) {
fundList = getFundSchemeMapper().getFundById(fundIds);
toStopFundIds = fundList.stream().filter(f->f.getFundEndTime() != null && f.getFundEndTime().length() > 0 && (f.getFundEndTime().compareTo(todayMonth)) <= 0)
toStopFundIds = fundList.stream().filter(f->f.getFundSchemeId() == null || (f.getFundEndTime() != null && f.getFundEndTime().length() > 0 && (f.getFundEndTime().compareTo(todayMonth)) <= 0))
.map(InsuranceArchivesFundSchemePO::getId).collect(Collectors.toList());
List<Long> finalToStopFundIds = toStopFundIds;
noStopBaseInfoIds = (List<Long>) CollectionUtils.union(noStopBaseInfoIds, baseInfoPOList.stream().filter(f -> !finalToStopFundIds.contains(f.getFundArchivesId())).map(InsuranceArchivesBaseInfoPO::getId).collect(Collectors.toList()));
@ -687,7 +687,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
if (otherIds.size() > 0) {
otherList = getOtherSchemeMapper().getOtherById(otherIds);
toStopOtherIds= otherList.stream().filter(f->f.getOtherEndTime() != null && f.getOtherEndTime().length() > 0 && (f.getOtherEndTime().compareTo(todayMonth)) <= 0)
toStopOtherIds= otherList.stream().filter(f->f.getOtherSchemeId() == null || (f.getOtherEndTime() != null && f.getOtherEndTime().length() > 0 && (f.getOtherEndTime().compareTo(todayMonth)) <= 0))
.map(InsuranceArchivesOtherSchemePO::getId).collect(Collectors.toList());
List<Long> finalToStopOtherIds = toStopOtherIds;
noStopBaseInfoIds = (List<Long>) CollectionUtils.union(noStopBaseInfoIds, baseInfoPOList.stream().filter(f -> !finalToStopOtherIds.contains(f.getOtherArchivesId())).map(InsuranceArchivesBaseInfoPO::getId).collect(Collectors.toList()));