From f6141a894e217d51163f787492b13d1bf105771f Mon Sep 17 00:00:00 2001 From: sy Date: Thu, 3 Nov 2022 19:03:41 +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=A8=A1=E5=9D=97bug=E4=BF=AE=E5=A4=8Dv6,=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E6=95=B0=E6=8D=AE=E7=94=9F=E6=88=90=E4=B8=BA=E2=80=9C?= =?UTF-8?q?=E5=BE=85=E5=A2=9E=E5=91=98=E2=80=9D=EF=BC=8C=E5=B9=B6=E8=A7=A6?= =?UTF-8?q?=E5=8F=91=E4=B8=80=E6=AC=A1=E5=85=A8=E9=87=8F=E5=A2=9E=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIArchivesBiz.java | 2 +- .../service/impl/SIArchivesServiceImpl.java | 57 +++++++++++++++---- 2 files changed, 47 insertions(+), 12 deletions(-) diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index 69fa88787..16cab17ec 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -1508,7 +1508,7 @@ public class SIArchivesBiz { po.setCreateTime(new Date()); po.setDeleteType(0); po.setCreator(creator); - po.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); + po.setRunStatus(EmployeeStatusEnum.STAY_ADD.getValue()); po.setUpdateTime(new Date()); po.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); diff --git a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java index bd415df5b..d4cf2c5ef 100644 --- a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java @@ -143,7 +143,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService StopWatch sw = new StopWatch(); sw.start("福利档案-历史数据处理"); // 1.历史数据处理 - siArchivesBiz.createOldInsuranceBaseInfo(currentEmployeeId); + handleHistoryData(currentEmployeeId); sw.stop(); sw.start("福利档案-待减员自动处理"); @@ -181,6 +181,22 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService return apidatas; } + /** + * 福利档案中历史数据自动处理 + * @param currentEmployeeId + */ + private void handleHistoryData(long currentEmployeeId) { + List nowBaseInfoList = getInsuranceBaseInfoMapper().getInsuranceBaseInfoList(); + if (nowBaseInfoList.size() == 0) { + siArchivesBiz.createOldInsuranceBaseInfo(currentEmployeeId); + + //全量增员 + allStayAddToPay(); + + } + + } + /** * 福利档案中待减员数据自动处理 * @param currentEmployeeId @@ -708,14 +724,14 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService //减员失败 resultType = "fail"; if (baseInfoPOList.size() == 1) { - resultMsg = "减员失败,失败原因:数据未正常维护"; + resultMsg = "减员失败,失败原因:最后缴纳月数据未正常维护"; } else { resultMsg = "部分或全部失败:【共提交减员数据" + baseInfoIds.size() +"条,成功" + toStopBaseInfoIdList.size() +"条,失败" + noStopBaseInfoIds.size() - +"条,失败原因:数据未正常维护】"; + +"条,失败原因:最后缴纳月数据未正常维护】"; } } @@ -751,7 +767,13 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService if (CollectionUtils.isEmpty(ids)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(145969, "没有可以操作的记录")); } - List baseInfoPOList = getInsuranceBaseInfoMapper().listByIds(ids); + // + List baseInfoPOList = new ArrayList<>(); + + List> partitionInfo = Lists.partition((List) ids, 100); + partitionInfo.forEach(part -> baseInfoPOList.addAll( + getInsuranceBaseInfoMapper().listByIds(part))); + // //分别新建福利档案基础信息相关的社保、公积金、其他福利档案列表 List socialList = new ArrayList<>(); @@ -778,7 +800,10 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService //获取可进行增员的社保档案相关人员数据 if (socialIds.size() > 0) { //获取社保档案 - socialList = getSocialSchemeMapper().getSocialById(socialIds); + List> partitionSocial = Lists.partition((List) socialIds, 100); + partitionSocial.forEach(part -> socialList.addAll( + getSocialSchemeMapper().getSocialById(part))); + //筛选可增员的社保档案相关人员信息 toStopSocialIds = socialList.stream().filter(f-> { @@ -798,7 +823,10 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService } if (fundIds.size() > 0) { - fundList = getFundSchemeMapper().getFundById(fundIds); + List> partitionFund = Lists.partition((List) fundIds, 100); + partitionFund.forEach(part -> fundList.addAll( + getFundSchemeMapper().getFundById(part))); + toStopFundIds = fundList.stream().filter(f-> { boolean flag = true; @@ -816,7 +844,10 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService } if (otherIds.size() > 0) { - otherList = getOtherSchemeMapper().getOtherById(otherIds); + List> partitionOther = Lists.partition((List) otherIds, 100); + partitionOther.forEach(part -> otherList.addAll( + getOtherSchemeMapper().getOtherById(part))); + toStopOtherIds = otherList.stream().filter(f-> { boolean flag = true; @@ -840,8 +871,12 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService //进行增员操作 if (toPayBaseInfoIdList.size() > 0) { - getInsuranceBaseInfoMapper().updateRunStatusByIds(InsuranceArchivesBaseInfoPO.builder() - .ids(toPayBaseInfoIdList).runStatus(EmployeeStatusEnum.PAYING.getValue()).build()); + List> partitionToPay = Lists.partition((List) toPayBaseInfoIdList, 100); + partitionToPay.forEach(part -> { + getInsuranceBaseInfoMapper().updateRunStatusByIds(InsuranceArchivesBaseInfoPO.builder() + .ids(part).runStatus(EmployeeStatusEnum.PAYING.getValue()).build()); + }); + } Map resultMap = new HashMap<>(2); @@ -862,13 +897,13 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService //增员失败 resultType = "fail"; if (baseInfoPOList.size() == 1) { - resultMsg = "增员失败,失败原因:数据未正常维护"; + resultMsg = "增员失败,失败原因:起始缴纳月/福利方案数据未正常维护"; } else { resultMsg = "部分或全部失败:【共提交增员数据" + baseInfoIds.size() +"条,成功" + toPayBaseInfoIdList.size() +"条,失败" + noPayBaseInfoIds.size() - +"条,失败原因:数据未正常维护】"; + +"条,失败原因:起始缴纳月/福利方案数据未正常维护】"; } }