| | |
| | | locItems = LocManageUtil.getFirstInFirstOutItemList(item.getMatnrCode(), item.getBatch(), item.getAnfme()); |
| | | } |
| | | } |
| | | |
| | | for (LocItem locItem : locItems) { |
| | | Loc loc = locService.getById(locItem.getLocId()); |
| | | List<LocItem> itemList = locItemService.list(new LambdaQueryWrapper<LocItem>().eq(LocItem::getLocId, loc.getId())); |
| | |
| | | orderOutItemDto.setLoc(loc); |
| | | orderOutItemDto.getLocItemList().add(locItem); |
| | | BasContainer containerType = getContainerType(loc.getBarcode()); |
| | | if (Cools.isEmpty(containerType)){ |
| | | continue; |
| | | } |
| | | List<BasStationArea> basStationAreas = basStationAreaService.list(new LambdaQueryWrapper<BasStationArea>() |
| | | .apply("JSON_CONTAINS(cross_zone_area, '{0}') = 1", loc.getAreaId())//可执行库区区区域id |
| | | .apply("JSON_CONTAINS(container_type, '{0}') = 1", containerType)//容器类型 |
| | | .apply("cross_zone_area != '[]'") // 不是空数组 |
| | | .apply("container_type != '[]'") |
| | | .apply("station_alias != '[]'") |
| | | .apply("JSON_CONTAINS(cross_zone_area, {0}) = 1", loc.getAreaId().toString())//可执行库区区区域id |
| | | .apply("JSON_CONTAINS(container_type, {0}) = 1", containerType.getContainerType().toString())//容器类型 |
| | | .eq(BasStationArea::getDeleted, 0)); |
| | | // .apply("JSON_CONTAINS(station_alias, '\"{0}\"') = 1", null)//区域包含站点集 |
| | | .eq(BasStationArea::getDeleted, 0));// 通常需要加上未删除条件 |
| | | if (basStationAreas.isEmpty()){ |
| | | throw new CoolException("未找到符合条件站点!!!请检查库区配置!!!"); |
| | | } |
| | | List<String> targSiteAreaList = new ArrayList<>(); |
| | | for (BasStationArea basStationArea : basStationAreas) { |
| | | targSiteAreaList.add(basStationArea.getStationAreaId()); |
| | | if (basStationArea.getStationAlias().isEmpty()){ |
| | | continue; |
| | | } |
| | | targSiteAreaList.add(basStationArea.getId().toString()); |
| | | } |
| | | if (targSiteAreaList.isEmpty()){ |
| | | throw new CoolException("未找到符合条件站点!!!请检查库区配置!!!"); |
| | | } |
| | | int count = 0; |
| | | for (BasStationArea basStationArea : basStationAreas) { |
| | |
| | | // Set<String> stationSet = deviceSites.stream().map(DeviceSite::getSite).collect(Collectors.toSet()); |
| | | //已使用站点 |
| | | Set<String> stas = stations.stream().map(BasStation::getStationName).collect(Collectors.toSet()); |
| | | if (stas.size() == maps.size()) { |
| | | stations = new ArrayList<>(); |
| | | stas = stations.stream().map(BasStation::getStationName).collect(Collectors.toSet()); |
| | | } |
| | | BasStationService basStationService = SpringUtils.getBean(BasStationService.class); |
| | | BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>() |
| | | .eq(BasStation::getUseStatus, LocStsType.LOC_STS_TYPE_O.type) |
| | |
| | | if (!Objects.isNull(basStation)) { |
| | | orderOutItemDto.setSiteNo(basStation.getStationName()); |
| | | // throw new CoolException("站點不存在!!"); |
| | | } else if (!stas.isEmpty()) { |
| | | orderOutItemDto.setSiteNo(basStationArea.getStationAlias().get(0)); |
| | | } else { |
| | | throw new CoolException("未找到符合条件站点!!!请检查库区或者路径配置!!!"); |
| | | } |
| | | } else { |
| | | if (Objects.isNull(basStation)) { |