diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index d20ce0ab0..0b3b52ca9 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -92,6 +92,18 @@ public class SIArchivesBiz { return MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class); } + private SocialSchemeMapper getSocialSchemeMapper() { + return MapperProxyFactory.getProxy(SocialSchemeMapper.class); + } + + private FundSchemeMapper getFundSchemeMapper() { + return MapperProxyFactory.getProxy(FundSchemeMapper.class); + } + + private OtherSchemeMapper getOtherSchemeMapper() { + return MapperProxyFactory.getProxy(OtherSchemeMapper.class); + } + /** * @param welfareType * @param employeeId @@ -1412,6 +1424,36 @@ public class SIArchivesBiz { public void createOldInsuranceBaseInfo(Long creator) { List nowBaseInfoList = getInsuranceBaseInfoMapper().getInsuranceBaseInfoList(); if (nowBaseInfoList.size() == 0) { + //处理公积金、其他福利档案中个税扣缴义务人为空的情况 + List socialList = getSocialSchemeMapper().listAll(); + List fundList = getFundSchemeMapper().listAll(); + List otherList = getOtherSchemeMapper().listAll(); + + List updateFundList = new ArrayList<>(); + List updateOtherList = new ArrayList<>(); + for (InsuranceArchivesSocialSchemePO socialSchemePO : socialList) { + List toDealFundList = fundList.stream().filter(f -> f.getEmployeeId().equals(socialSchemePO.getEmployeeId()) && f.getPaymentOrganization() == null).collect(Collectors.toList()); + if (toDealFundList.size() > 0) { + for (InsuranceArchivesFundSchemePO toDealFundPO : toDealFundList) { + toDealFundPO.setPaymentOrganization(socialSchemePO.getPaymentOrganization()); + updateFundList.add(toDealFundPO); + } + } + + List toDealOtherList = otherList.stream().filter(f -> f.getEmployeeId().equals(socialSchemePO.getEmployeeId()) && f.getPaymentOrganization() == null).collect(Collectors.toList()); + if (toDealOtherList.size() > 0) { + for (InsuranceArchivesOtherSchemePO toDealOtherPO : toDealOtherList) { + toDealOtherPO.setPaymentOrganization(socialSchemePO.getPaymentOrganization()); + updateOtherList.add(toDealOtherPO); + } + } + //更新公积金和其他福利档案 + updateFundList.forEach(getFundSchemeMapper()::updateById); + updateOtherList.forEach(getOtherSchemeMapper()::updateById); + } + + + // List addBaseInfoList = new ArrayList<>(); List oldBaseInfoList = getInsuranceBaseInfoMapper().getInsuranceBaseInfoListByInsuranceDetail(null); if (oldBaseInfoList.size() > 0) {