账套sql类型的人员范围接入状态

This commit is contained in:
钱涛 2025-11-03 13:35:06 +08:00
parent b4994dab3f
commit 3dd8db37dc
1 changed files with 19 additions and 14 deletions

View File

@ -1,5 +1,6 @@
package com.engine.salary.service.impl; package com.engine.salary.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.NumberUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.api.formmode.mybatis.util.SqlProxyHandle; 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); List<SalarySobExtRangePO> salarySobExtRangePOS = getSalarySobExtRangeService(user).listBySalarySobId(salarySobId);
if (CollectionUtils.isNotEmpty(salarySobExtRangePOS)) { if (CollectionUtils.isNotEmpty(salarySobExtRangePOS)) {
List<Long> ids = SalaryEntityUtil.properties(salarySobExtRangePOS, SalarySobExtRangePO::getTargetId, Collectors.toList()); 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)); result.addAll(employBiz.listByVirtualParams(virtualParams));
List<Long> empIds = new ArrayList<>(); for (SalarySobRangeEmpQueryParam param:includeQueryParams) {
includeQueryParams.stream() if(param.getTargetType().equals(TargetTypeEnum.SQL.name())){
.filter(param -> param.getTargetType().equals(TargetTypeEnum.SQL.name())) List<Long> empIds = new ArrayList<>();
.forEach(param -> { String sql = param.getTarget();
String sql = param.getTarget(); RecordSet rs = new RecordSet();
RecordSet rs = new RecordSet(); if (rs.execute(sql)) {
if (rs.execute(sql)) { while (rs.next()) {
while (rs.next()) { empIds.add((long) rs.getInt("id"));
empIds.add((long) rs.getInt("id"));
}
} }
}); }
List<DataCollectionEmployee> employees = getSalaryEmployeeService(user).getEmployeeByIdsAll(empIds); if(CollUtil.isNotEmpty(empIds)){
result.addAll(employees); 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去重 // 从hrmresource和hrmresourcevirtual可能获取到重复人员数据需要根据人员id去重
result = result.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparingLong(DataCollectionEmployee::getEmployeeId))), ArrayList::new)); result = result.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparingLong(DataCollectionEmployee::getEmployeeId))), ArrayList::new));