考勤引用排除非系统人员
This commit is contained in:
parent
5e95742508
commit
b206fd984c
|
|
@ -41,9 +41,10 @@ public interface SalaryEmployeeService {
|
|||
* 根据薪资账套id查询人员
|
||||
*
|
||||
* @param salarySobId 薪资账套id
|
||||
* @param hasExtEmp 是否含非系统人员
|
||||
* @return
|
||||
*/
|
||||
List<DataCollectionEmployee> listBySalarySobId(Long salarySobId);
|
||||
List<DataCollectionEmployee> listBySalarySobId(Long salarySobId, boolean hasExtEmp);
|
||||
|
||||
/**
|
||||
* 获取人员信息
|
||||
|
|
|
|||
|
|
@ -371,7 +371,7 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
|
|||
SalarySobPO salarySobPO = getSalarySobService(user).getById(salarySobId);
|
||||
|
||||
// 根据薪资账套查询人员
|
||||
List<DataCollectionEmployee> salaryEmployees = getSalaryEmployeeService(user).listBySalarySobId(salarySobId);
|
||||
List<DataCollectionEmployee> salaryEmployees = getSalaryEmployeeService(user).listBySalarySobId(salarySobId,false);
|
||||
if (CollectionUtils.isEmpty(salaryEmployees)) {
|
||||
errorMsg = errorMsg + "【" + salarySobPO.getName() + "】薪资账套没有人员; ";
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -564,7 +564,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
@Override
|
||||
public void initBySalaryAcctRecord(SalaryAcctRecordPO salaryAcctRecordPO) {
|
||||
// 根据薪资账套查询人员
|
||||
List<DataCollectionEmployee> salaryEmployees = getSalaryEmployeeService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
List<DataCollectionEmployee> salaryEmployees = getSalaryEmployeeService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId(), true);
|
||||
if (CollectionUtils.isEmpty(salaryEmployees)) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -610,7 +610,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
}
|
||||
|
||||
// 根据薪资账套查询人员
|
||||
List<DataCollectionEmployee> salaryEmployees = getSalaryEmployeeService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
List<DataCollectionEmployee> salaryEmployees = getSalaryEmployeeService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId(), true);
|
||||
if (CollectionUtils.isEmpty(salaryEmployees)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "未查询到账套下关联人员"));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<DataCollectionEmployee> listBySalarySobId(Long salarySobId) {
|
||||
public List<DataCollectionEmployee> listBySalarySobId(Long salarySobId, boolean hasExtEmp) {
|
||||
|
||||
List<DataCollectionEmployee> includeSalaryEmployees = new ArrayList<>();
|
||||
|
||||
|
|
@ -174,13 +174,15 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
}
|
||||
|
||||
//外部人员
|
||||
List<SalarySobExtRangePO> salarySobExtRangePOS = getSalarySobExtRangeService(user).listBySalarySobId(salarySobId);
|
||||
if (CollectionUtils.isNotEmpty(salarySobExtRangePOS)) {
|
||||
List<Long> ids = SalaryEntityUtil.properties(salarySobExtRangePOS, SalarySobExtRangePO::getTargetId, Collectors.toList());
|
||||
List<DataCollectionEmployee> extEmps = getExtEmpService(user).getEmployeeByIds(ids);
|
||||
extEmps = extEmps.stream().distinct().collect(Collectors.toList());
|
||||
if(hasExtEmp){
|
||||
List<SalarySobExtRangePO> salarySobExtRangePOS = getSalarySobExtRangeService(user).listBySalarySobId(salarySobId);
|
||||
if (CollectionUtils.isNotEmpty(salarySobExtRangePOS)) {
|
||||
List<Long> ids = SalaryEntityUtil.properties(salarySobExtRangePOS, SalarySobExtRangePO::getTargetId, Collectors.toList());
|
||||
List<DataCollectionEmployee> 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())
|
||||
|
|
|
|||
Loading…
Reference in New Issue