diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index ba84404eb..16cab17ec 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -807,8 +807,9 @@ public class SIArchivesBiz { if (primaryId ==null || paymentBaseString == null) { return true; } - //设置缴纳对象 + //设置缴纳对象和缴费状态 Integer paymentScope = 2; + Integer isPayment = 1; Map paymentBaseJson = JSON.parseObject(paymentBaseString, new HashMap().getClass()); if (paymentBaseJson == null) { return true; @@ -824,8 +825,8 @@ public class SIArchivesBiz { return false; } - //根据福利方案id、险种id、缴纳对象查询明细 - InsuranceSchemeDetailPO insuranceSchemeDetailPO = getInsuranceSchemeDetailMapper().getByPPI(primaryId, paymentScope, Long.valueOf(entry.getKey())); + //根据福利方案id、险种id、缴纳对象、缴费状态查询明细 + InsuranceSchemeDetailPO insuranceSchemeDetailPO = getInsuranceSchemeDetailMapper().getByPPII(primaryId, paymentScope, Long.valueOf(entry.getKey()), isPayment); log.info("福利方案id: {}, 缴纳所属: {}, 福利明细项id:{}", primaryId, paymentScope, Long.valueOf(entry.getKey())); if (insuranceSchemeDetailPO == null) { log.info("根据福利方案id、险种id、缴纳对象查询明细为null!福利方案id: {}, 缴纳所属: {}, 福利明细项id:{}", primaryId, paymentScope, Long.valueOf(entry.getKey())); @@ -1507,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/mapper/sischeme/InsuranceSchemeDetailMapper.java b/src/com/engine/salary/mapper/sischeme/InsuranceSchemeDetailMapper.java index f58bc8354..91b1d195f 100644 --- a/src/com/engine/salary/mapper/sischeme/InsuranceSchemeDetailMapper.java +++ b/src/com/engine/salary/mapper/sischeme/InsuranceSchemeDetailMapper.java @@ -56,6 +56,8 @@ public interface InsuranceSchemeDetailMapper { InsuranceSchemeDetailPO getByPPI(@Param("primaryId") Long primaryId, @Param("paymentScope") Integer paymentScope, @Param("insuranceId") Long insuranceId); + InsuranceSchemeDetailPO getByPPII(@Param("primaryId") Long primaryId, @Param("paymentScope") Integer paymentScope, + @Param("insuranceId") Long insuranceId, @Param("isPayment") Integer isPayment); /** * 根据主键和是否缴费查询 diff --git a/src/com/engine/salary/mapper/sischeme/InsuranceSchemeDetailMapper.xml b/src/com/engine/salary/mapper/sischeme/InsuranceSchemeDetailMapper.xml index 407796412..ac30d8a24 100644 --- a/src/com/engine/salary/mapper/sischeme/InsuranceSchemeDetailMapper.xml +++ b/src/com/engine/salary/mapper/sischeme/InsuranceSchemeDetailMapper.xml @@ -95,6 +95,17 @@ AND delete_type = 0 + + nowBaseInfoList = getInsuranceBaseInfoMapper().getInsuranceBaseInfoList(); + if (nowBaseInfoList.size() == 0) { + siArchivesBiz.createOldInsuranceBaseInfo(currentEmployeeId); + + //全量增员 + allStayAddToPay(); + + } + + } + /** * 福利档案中待减员数据自动处理 * @param currentEmployeeId @@ -706,14 +722,14 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService //减员失败 resultType = "fail"; if (baseInfoPOList.size() == 1) { - resultMsg = "减员失败,失败原因:数据未正常维护"; + resultMsg = "减员失败,失败原因:最后缴纳月数据未正常维护"; } else { resultMsg = "部分或全部失败:【共提交减员数据" + baseInfoIds.size() +"条,成功" + toStopBaseInfoIdList.size() +"条,失败" + noStopBaseInfoIds.size() - +"条,失败原因:数据未正常维护】"; + +"条,失败原因:最后缴纳月数据未正常维护】"; } } @@ -749,7 +765,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<>(); @@ -776,7 +798,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-> { @@ -796,7 +821,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; @@ -814,7 +842,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; @@ -838,8 +869,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); @@ -860,13 +895,13 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService //增员失败 resultType = "fail"; if (baseInfoPOList.size() == 1) { - resultMsg = "增员失败,失败原因:数据未正常维护"; + resultMsg = "增员失败,失败原因:起始缴纳月/福利方案数据未正常维护"; } else { resultMsg = "部分或全部失败:【共提交增员数据" + baseInfoIds.size() +"条,成功" + toPayBaseInfoIdList.size() +"条,失败" + noPayBaseInfoIds.size() - +"条,失败原因:数据未正常维护】"; + +"条,失败原因:起始缴纳月/福利方案数据未正常维护】"; } }