薪酬系统-福利档案,删除待办功能添加批量处理逻辑

This commit is contained in:
sy 2022-12-12 16:55:22 +08:00
parent 1b376464c4
commit 1fb706b7da
1 changed files with 20 additions and 6 deletions

View File

@ -956,7 +956,11 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
}
if (insuranceArchivesBaseInfoPO.getRunStatus().equals(EmployeeStatusEnum.STAY_DEL.getValue())) {
List<InsuranceArchivesBaseInfoPO> nowList = getInsuranceBaseInfoMapper().listByIds(insuranceArchivesBaseInfoPO.getIds());
List<List<Long>> baseInfoIdsPartition = Lists.partition((List<Long>) insuranceArchivesBaseInfoPO.getIds(), 100);
List<InsuranceArchivesBaseInfoPO> nowList = new ArrayList<>();
baseInfoIdsPartition.forEach(part -> {
nowList.addAll(getInsuranceBaseInfoMapper().listByIds(part));
});
//置空社保公积金其他福利档案的最后缴纳月信息并将福利档案基础信息表的状态置为正在缴纳
if (nowList.size() > 0) {
List<Long> socialIds = nowList.stream()
@ -966,12 +970,22 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
List<Long> otherIds = nowList.stream()
.map(InsuranceArchivesBaseInfoPO::getOtherArchivesId).collect(Collectors.toList());
getSocialSchemeMapper().batchUpdateEndTimeToNull(socialIds);
getFundSchemeMapper().batchUpdateEndTimeToNull(fundIds);
getOtherSchemeMapper().batchUpdateEndTimeToNull(otherIds);
List<List<Long>> socialIdsPartition = Lists.partition(socialIds, 100);
socialIdsPartition.forEach(getSocialSchemeMapper()::batchUpdateEndTimeToNull);
List<List<Long>> fundIdsPartition = Lists.partition(fundIds, 100);
fundIdsPartition.forEach(getFundSchemeMapper()::batchUpdateEndTimeToNull);
List<List<Long>> otherIdsPartition = Lists.partition(otherIds, 100);
otherIdsPartition.forEach(getOtherSchemeMapper()::batchUpdateEndTimeToNull);
baseInfoIdsPartition.forEach(part -> {
getInsuranceBaseInfoMapper().updateRunStatusByIds(InsuranceArchivesBaseInfoPO.builder()
.ids(part)
.runStatus(EmployeeStatusEnum.PAYING.getValue())
.build());
});
insuranceArchivesBaseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue());
getInsuranceBaseInfoMapper().updateRunStatusByIds(insuranceArchivesBaseInfoPO);
}
}