diff --git a/src/com/engine/salary/service/SalaryEmployeeService.java b/src/com/engine/salary/service/SalaryEmployeeService.java index e5b25c281..eac54cc5e 100644 --- a/src/com/engine/salary/service/SalaryEmployeeService.java +++ b/src/com/engine/salary/service/SalaryEmployeeService.java @@ -41,9 +41,10 @@ public interface SalaryEmployeeService { * 根据薪资账套id查询人员 * * @param salarySobId 薪资账套id + * @param hasExtEmp 是否含非系统人员 * @return */ - List listBySalarySobId(Long salarySobId); + List listBySalarySobId(Long salarySobId, boolean hasExtEmp); /** * 获取人员信息 diff --git a/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java b/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java index 48648cc57..ee7e00713 100644 --- a/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java +++ b/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java @@ -371,7 +371,7 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa SalarySobPO salarySobPO = getSalarySobService(user).getById(salarySobId); // 根据薪资账套查询人员 - List salaryEmployees = getSalaryEmployeeService(user).listBySalarySobId(salarySobId); + List salaryEmployees = getSalaryEmployeeService(user).listBySalarySobId(salarySobId,false); if (CollectionUtils.isEmpty(salaryEmployees)) { errorMsg = errorMsg + "【" + salarySobPO.getName() + "】薪资账套没有人员; "; } else { diff --git a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java index 6f0bbb2e2..abd8d6216 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java @@ -564,7 +564,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct @Override public void initBySalaryAcctRecord(SalaryAcctRecordPO salaryAcctRecordPO) { // 根据薪资账套查询人员 - List salaryEmployees = getSalaryEmployeeService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId()); + List salaryEmployees = getSalaryEmployeeService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId(), true); if (CollectionUtils.isEmpty(salaryEmployees)) { return; } @@ -610,7 +610,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct } // 根据薪资账套查询人员 - List salaryEmployees = getSalaryEmployeeService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId()); + List salaryEmployees = getSalaryEmployeeService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId(), true); if (CollectionUtils.isEmpty(salaryEmployees)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "未查询到账套下关联人员")); } diff --git a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java index 1dedb0bfb..cf04d1e76 100644 --- a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java @@ -141,7 +141,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee } @Override - public List listBySalarySobId(Long salarySobId) { + public List listBySalarySobId(Long salarySobId, boolean hasExtEmp) { List includeSalaryEmployees = new ArrayList<>(); @@ -174,13 +174,15 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee } //外部人员 - List salarySobExtRangePOS = getSalarySobExtRangeService(user).listBySalarySobId(salarySobId); - if (CollectionUtils.isNotEmpty(salarySobExtRangePOS)) { - List ids = SalaryEntityUtil.properties(salarySobExtRangePOS, SalarySobExtRangePO::getTargetId, Collectors.toList()); - List extEmps = getExtEmpService(user).getEmployeeByIds(ids); - extEmps = extEmps.stream().distinct().collect(Collectors.toList()); + if(hasExtEmp){ + List salarySobExtRangePOS = getSalarySobExtRangeService(user).listBySalarySobId(salarySobId); + if (CollectionUtils.isNotEmpty(salarySobExtRangePOS)) { + List ids = SalaryEntityUtil.properties(salarySobExtRangePOS, SalarySobExtRangePO::getTargetId, Collectors.toList()); + List extEmps = getExtEmpService(user).getEmployeeByIds(ids); + extEmps = extEmps.stream().distinct().collect(Collectors.toList()); - includeSalaryEmployees.addAll(extEmps); + includeSalaryEmployees.addAll(extEmps); + } } if (!openSecondaryAccount) { @@ -639,11 +641,11 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee .departmentName(hrmSnapshotPO.getDepartmentname()) .departmentId(hrmSnapshotPO.getDepartmentid() == null ? null : NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getDepartmentid()))) .subcompanyName(hrmSnapshotPO.getSubcompanyname()) - .subcompanyid(hrmSnapshotPO.getSubcompanyid1() == null ? null :NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getSubcompanyid1()))) - .costcenterId(hrmSnapshotPO.getCostcenterid() == null ? null :NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getCostcenterid()))) - .locationId(hrmSnapshotPO.getLocationid() == null ? null :NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getLocationid()))) + .subcompanyid(hrmSnapshotPO.getSubcompanyid1() == null ? null : NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getSubcompanyid1()))) + .costcenterId(hrmSnapshotPO.getCostcenterid() == null ? null : NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getCostcenterid()))) + .locationId(hrmSnapshotPO.getLocationid() == null ? null : NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getLocationid()))) .jobtitleName(hrmSnapshotPO.getJobtitlename()) - .jobtitleId(hrmSnapshotPO.getJobtitle() == null ? null :NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getJobtitle()))) + .jobtitleId(hrmSnapshotPO.getJobtitle() == null ? null : NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getJobtitle()))) .companystartdate(hrmSnapshotPO.getCompanystartdate()) .mobile(hrmSnapshotPO.getMobile()) // .dismissdate() @@ -654,7 +656,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee .email(hrmSnapshotPO.getEmail()) .telephone(hrmSnapshotPO.getTelephone()) .jobcall(hrmSnapshotPO.getJobcallname()) - .jobcallId(hrmSnapshotPO.getJobcall() == null ? null :NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getJobcall()))) + .jobcallId(hrmSnapshotPO.getJobcall() == null ? null : NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getJobcall()))) .birthday(hrmSnapshotPO.getBirthday()) .workYear(hrmSnapshotPO.getWorkyear() == null ? null : hrmSnapshotPO.getWorkyear().doubleValue()) .companyWorkYear(hrmSnapshotPO.getCompanyworkyear() == null ? null : hrmSnapshotPO.getCompanyworkyear().doubleValue())