薪酬系统-福利模块档案一对多-公积金/其他福利档案个税扣缴义务人默认设置

This commit is contained in:
sy 2022-11-02 19:28:56 +08:00
parent 33e2e0e933
commit 553564a6b6
1 changed files with 42 additions and 0 deletions

View File

@ -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<InsuranceArchivesBaseInfoPO> nowBaseInfoList = getInsuranceBaseInfoMapper().getInsuranceBaseInfoList();
if (nowBaseInfoList.size() == 0) {
//处理公积金其他福利档案中个税扣缴义务人为空的情况
List<InsuranceArchivesSocialSchemePO> socialList = getSocialSchemeMapper().listAll();
List<InsuranceArchivesFundSchemePO> fundList = getFundSchemeMapper().listAll();
List<InsuranceArchivesOtherSchemePO> otherList = getOtherSchemeMapper().listAll();
List<InsuranceArchivesFundSchemePO> updateFundList = new ArrayList<>();
List<InsuranceArchivesOtherSchemePO> updateOtherList = new ArrayList<>();
for (InsuranceArchivesSocialSchemePO socialSchemePO : socialList) {
List<InsuranceArchivesFundSchemePO> 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<InsuranceArchivesOtherSchemePO> 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<InsuranceArchivesBaseInfoPO> addBaseInfoList = new ArrayList<>();
List<InsuranceArchivesBaseInfoPO> oldBaseInfoList = getInsuranceBaseInfoMapper().getInsuranceBaseInfoListByInsuranceDetail(null);
if (oldBaseInfoList.size() > 0) {