| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | | /** |
| | | * @author Munch D. Luffy |
| | |
| | | //没有路径 进入库区筛选站点 |
| | | List<String> targSiteArea = task.getTargSiteArea(); |
| | | //提取出所有站点 |
| | | List<String> siteList = new ArrayList<>(); |
| | | // List<String> siteList = new ArrayList<>(); |
| | | ConcurrentHashMap<String,List<String>> siteList = new ConcurrentHashMap<>(); |
| | | //筛选出存在路径的站点 |
| | | List<String> siteListRoute = new ArrayList<>(); |
| | | List<String[]> siteListRoute = new ArrayList<>(); |
| | | //筛选可替换选项 |
| | | List<String> siteListUp = new ArrayList<>(); |
| | | if (targSiteArea != null && !targSiteArea.isEmpty()) { |
| | |
| | | if (basStationArea == null || basStationArea.getStationAlias() == null || basStationArea.getStationAlias().isEmpty()) { |
| | | continue; |
| | | } |
| | | siteList.addAll(basStationArea.getStationAlias()); |
| | | siteList.put(basStationArea.getStationAreaId(), basStationArea.getStationAlias()); |
| | | // siteList.addAll(basStationArea.getStationAlias()); |
| | | } |
| | | if (!siteList.isEmpty()) { |
| | | //查询站点路径 |
| | | for (String site : siteList) { |
| | | List<Long> routeGet = RouteWmsStepFlow.routeGet(stationList, sou, site); |
| | | if (routeGet!=null && !routeGet.isEmpty()){ |
| | | siteListRoute.add(site); |
| | | for (ConcurrentHashMap.Entry<String, List<String>> entry : siteList.entrySet()) { |
| | | String stationAreaId = entry.getKey(); // 获取String键 |
| | | List<String> valueList = entry.getValue(); // 获取对应的List<String> |
| | | for (String value : valueList) { |
| | | List<Long> routeGet = RouteWmsStepFlow.routeGet(stationList, sou, value); |
| | | if (routeGet!=null && !routeGet.isEmpty()){ |
| | | siteListRoute.add(new String[]{stationAreaId, value}); |
| | | } |
| | | } |
| | | } |
| | | Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, task.getOrgLoc())); |
| | | //查询站点配置 |
| | | if (!siteListRoute.isEmpty()) { |
| | | for (String site : siteListRoute) { |
| | | //拣料出库 -- 盘点出库 |
| | | for (String[] siteArray : siteListRoute) { |
| | | //出库路径排查 |
| | | DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>() |
| | | .eq(DeviceSite::getSite, site) |
| | | .eq(DeviceSite::getSite, siteArray[1]) |
| | | .eq(!Objects.isNull(loc.getChannel()),DeviceSite::getChannel, loc.getChannel()) |
| | | .eq(DeviceSite::getType, task.getTaskType()).last("limit 1"),false); |
| | | if (!Objects.isNull(deviceSite)) { |
| | | BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>() |
| | | .eq(BasStation::getStationName, site) |
| | | .eq(BasStation::getStationName, siteArray[1]) |
| | | .eq(BasStation::getUseStatus, LocStsType.LOC_STS_TYPE_O.type) |
| | | ); |
| | | if (Cools.isEmpty(basStation) || !basStation.getUseStatus().equals(LocStsType.LOC_STS_TYPE_O.type)) { |
| | | continue; |
| | | } |
| | | task.setTargSite(site); |
| | | task.setTargSiteAreaNow(siteArray[0]); |
| | | task.setTargSite(siteArray[1]); |
| | | taskService.updateById(task); |
| | | break; |
| | | } |