diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index 824e6cf74..da3072762 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -6906,10 +6906,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { validIds.addAll(emp2); validIds.addAll(emp3); List finalValidIds = validIds.stream().distinct().collect(Collectors.toList()); - List conNotAddEmpIds = empIds.stream().filter(empId -> !finalValidIds.contains(empId)).collect(Collectors.toList()); + List conNotAddEmpIds = param.getIncludes().stream().filter(empId -> !finalValidIds.contains(empId)).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(conNotAddEmpIds)) { - String canNotAddName = getSalaryEmployeeService(user).listByIds(canAccountIds).stream().map(DataCollectionEmployee::getUsername).collect(Collectors.joining(",")); - throw new SalaryRunTimeException("添加失败,员工:" +canNotAddName + ",社保、公积金、其他福利需至少有一种在当前账单月需缴纳"); + String canNotAddName = getSalaryEmployeeService(user).listByIds(conNotAddEmpIds).stream().map(DataCollectionEmployee::getUsername).collect(Collectors.joining(",")); + throw new SalaryRunTimeException("添加失败,员工:" +canNotAddName + ",社保、公积金、其他福利需至少有一种在当前账单月需缴纳,并且社保档案需为在缴员工"); } addCommonEmpAndAccount(param.getBillMonth(), empIds, param.getPaymentOrganization());