|
@@ -3,12 +3,15 @@ package com.yr.warehouse.admin.service.areastaff.impl;
|
|
|
import com.supplychain.api.response.areastaff.AreaStaffResponse;
|
|
import com.supplychain.api.response.areastaff.AreaStaffResponse;
|
|
|
import com.yr.bluecat.common.entity.utils.StringUtils;
|
|
import com.yr.bluecat.common.entity.utils.StringUtils;
|
|
|
import com.yr.warehouse.admin.areastaff.fase.AreaStaffIdFace;
|
|
import com.yr.warehouse.admin.areastaff.fase.AreaStaffIdFace;
|
|
|
|
|
+import com.yr.warehouse.admin.areastaff.mapper.DriverWarehouseMapper;
|
|
|
|
|
+import com.yr.warehouse.admin.areastaff.vo.AreaStaffVo;
|
|
|
import com.yr.warehouse.admin.component.areastaff.AreaStaffComponent;
|
|
import com.yr.warehouse.admin.component.areastaff.AreaStaffComponent;
|
|
|
import com.yr.warehouse.admin.driver.face.AreaStaffNameSearchFace;
|
|
import com.yr.warehouse.admin.driver.face.AreaStaffNameSearchFace;
|
|
|
import com.yr.warehouse.admin.service.areastaff.AreaStaffService;
|
|
import com.yr.warehouse.admin.service.areastaff.AreaStaffService;
|
|
|
import jakarta.annotation.Resource;
|
|
import jakarta.annotation.Resource;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
@@ -21,6 +24,9 @@ public class AreaStaffServiceImpl implements AreaStaffService {
|
|
|
@Resource
|
|
@Resource
|
|
|
private AreaStaffComponent areaStaffComponent;
|
|
private AreaStaffComponent areaStaffComponent;
|
|
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private DriverWarehouseMapper driverWarehouseMapper;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public Map<Long, AreaStaffResponse> searchAreaStaffMap(List<? extends AreaStaffIdFace> areaStaffIdFaces) {
|
|
public Map<Long, AreaStaffResponse> searchAreaStaffMap(List<? extends AreaStaffIdFace> areaStaffIdFaces) {
|
|
|
List<Long> areaStaffIds = areaStaffIdFaces.stream().map(AreaStaffIdFace::getAreaStaffId).collect(Collectors.toList());
|
|
List<Long> areaStaffIds = areaStaffIdFaces.stream().map(AreaStaffIdFace::getAreaStaffId).collect(Collectors.toList());
|
|
@@ -56,4 +62,19 @@ public class AreaStaffServiceImpl implements AreaStaffService {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<Long> filterSearchableAreaStaffIds(Long warehouseId, List<Long> areaStaffIds) {
|
|
|
|
|
+ List<Long> res;
|
|
|
|
|
+ List<AreaStaffVo> areaStaffVos = driverWarehouseMapper.searchByWarehouseId(warehouseId);
|
|
|
|
|
+ // 仓库下的司机ids
|
|
|
|
|
+ List<Long> inWarehouseAreaStaffId = areaStaffVos.stream().map(AreaStaffVo::getId).collect(Collectors.toList());
|
|
|
|
|
+ if (null == areaStaffIds || areaStaffIds.isEmpty()) {
|
|
|
|
|
+ res = inWarehouseAreaStaffId;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 仓库下能搜索的司机id
|
|
|
|
|
+ res = areaStaffIds.stream().filter(inWarehouseAreaStaffId::contains).collect(Collectors.toList());
|
|
|
|
|
+ }
|
|
|
|
|
+ return res;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|