账套sql类型的人员范围接入状态
This commit is contained in:
parent
b4994dab3f
commit
3dd8db37dc
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
||||
|
|
@ -174,7 +175,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
}
|
||||
|
||||
//外部人员
|
||||
if(hasExtEmp){
|
||||
if (hasExtEmp) {
|
||||
List<SalarySobExtRangePO> salarySobExtRangePOS = getSalarySobExtRangeService(user).listBySalarySobId(salarySobId);
|
||||
if (CollectionUtils.isNotEmpty(salarySobExtRangePOS)) {
|
||||
List<Long> ids = SalaryEntityUtil.properties(salarySobExtRangePOS, SalarySobExtRangePO::getTargetId, Collectors.toList());
|
||||
|
|
@ -418,20 +419,24 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
|
||||
result.addAll(employBiz.listByVirtualParams(virtualParams));
|
||||
|
||||
List<Long> empIds = new ArrayList<>();
|
||||
includeQueryParams.stream()
|
||||
.filter(param -> param.getTargetType().equals(TargetTypeEnum.SQL.name()))
|
||||
.forEach(param -> {
|
||||
String sql = param.getTarget();
|
||||
RecordSet rs = new RecordSet();
|
||||
if (rs.execute(sql)) {
|
||||
while (rs.next()) {
|
||||
empIds.add((long) rs.getInt("id"));
|
||||
}
|
||||
for (SalarySobRangeEmpQueryParam param:includeQueryParams) {
|
||||
if(param.getTargetType().equals(TargetTypeEnum.SQL.name())){
|
||||
List<Long> empIds = new ArrayList<>();
|
||||
String sql = param.getTarget();
|
||||
RecordSet rs = new RecordSet();
|
||||
if (rs.execute(sql)) {
|
||||
while (rs.next()) {
|
||||
empIds.add((long) rs.getInt("id"));
|
||||
}
|
||||
});
|
||||
List<DataCollectionEmployee> employees = getSalaryEmployeeService(user).getEmployeeByIdsAll(empIds);
|
||||
result.addAll(employees);
|
||||
}
|
||||
if(CollUtil.isNotEmpty(empIds)){
|
||||
Collection<String> employeeStatus = param.getEmployeeStatus();
|
||||
List<DataCollectionEmployee> employeeByIdsAll = getSalaryEmployeeService(user).getEmployeeByIdsAll(empIds);
|
||||
List<DataCollectionEmployee> collect = employeeByIdsAll.stream().filter(e -> employeeStatus.contains(e.getStatus())).collect(Collectors.toList());
|
||||
result.addAll(collect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 从hrmresource和hrmresourcevirtual可能获取到重复人员数据,需要根据人员id去重
|
||||
result = result.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparingLong(DataCollectionEmployee::getEmployeeId))), ArrayList::new));
|
||||
|
|
|
|||
Loading…
Reference in New Issue