Merge remote-tracking branch 'remotes/origin/feature/v4-siAcctImprove-0420' into release/2.7.4.2304.02

This commit is contained in:
sy 2023-04-25 09:22:03 +08:00
commit cea8d14c18
1 changed files with 11 additions and 0 deletions

View File

@ -980,6 +980,17 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
baseInfoIdsPartition.forEach(part -> {
nowList.addAll(getInsuranceBaseInfoMapper().listByIds(part));
});
//判断当前被操作人员是否都在对应的个税扣缴义务人下
List<TaxAgentEmployeeDTO> taxAgentManageRangeEmployees = getTaxAgentService(user).listTaxAgentAndEmployee((long) user.getUID());
boolean isNotExist = nowList.stream().anyMatch(te ->
taxAgentManageRangeEmployees.stream().noneMatch(p ->
p.getEmployeeId() != null && p.getEmployeeId().equals(te.getEmployeeId()) && p.getTaxAgentId().equals(te.getPaymentOrganization())));
if (isNotExist) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(116196, "个税扣缴义务人不存在或不在权限范围内,删除失败!"));
}
//置空社保公积金其他福利档案的最后缴纳月信息并将福利档案基础信息表的状态置为正在缴纳
if (nowList.size() > 0) {
List<Long> socialIds = nowList.stream()