| | |
| | | if (Cools.isEmpty(basStation)) { |
| | | throw new CoolException("未找到接驳站点信息,请检查站点状态"); |
| | | } |
| | | List<Long> ids = new ArrayList<>(); |
| | | ids.add(basStation.getArea()); |
| | | if (basStation.getIsCrossZone() == 1) { |
| | | String content = basStation.getCrossZoneArea().substring(1, basStation.getCrossZoneArea().length() - 1); |
| | | String[] parts = content.split(","); |
| | | for (int i = 0; i < parts.length; i++) { |
| | | ids.add(Long.parseLong(parts[i].trim())); |
| | | } |
| | | } |
| | | List<Long> ids = basStation.getCrossZoneArea(); |
| | | // ids.add(basStation.getArea()); |
| | | // if (basStation.getIsCrossZone() == 1) { |
| | | // String content = basStation.getCrossZoneArea().substring(1,.length() - 1); |
| | | // String[] parts = content.split(","); |
| | | // for (int i = 0; i < parts.length; i++) { |
| | | // ids.add(Long.parseLong(parts[i].trim())); |
| | | // } |
| | | // } |
| | | List<WarehouseAreas> warehouseAreasList = warehouseAreasService.list(new LambdaQueryWrapper<WarehouseAreas>() |
| | | .in(WarehouseAreas::getId, ids) |
| | | ); |
| | |
| | | String sta = waitPakinPda.getStaNo(); |
| | | String area = waitPakinPda.getArea(); |
| | | if (Cools.isEmpty(sta)) { |
| | | throw new CoolException("接驳位条码不能为空"); |
| | | throw new CoolException("起点不能为空"); |
| | | } |
| | | if (Cools.isEmpty(area)) { |
| | | throw new CoolException("目标库区不能为空"); |
| | | } |
| | | |
| | | DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>() |
| | | .eq(DeviceSite::getSite, sta) |
| | | .eq(DeviceSite::getAreaIdEnd, Long.parseLong(area)) |
| | | .eq(DeviceSite::getType, TaskType.TASK_TYPE_IN.type).last("limit 1")); |
| | | if (Cools.isEmpty(deviceSite)) { |
| | | throw new CoolException("无可用路径!!"); |
| | | } |
| | | |
| | | BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>() |
| | | .eq(BasStation::getStationName, sta) |
| | | .eq(BasStation::getUseStatus, LocStsType.LOC_STS_TYPE_F.type) |
| | | ); |
| | | if (Cools.isEmpty(basStation)) { |
| | | throw new CoolException("未找到接驳站点信息,请检查站点状态"); |
| | | throw new CoolException("未找到起点站点信息,请检查站点状态"); |
| | | } |
| | | if (Cools.isEmpty(basStation.getBarcode())) { |
| | | throw new CoolException("数据错误,接驳站无条码信息"); |
| | |
| | | } |
| | | String targetLoc = LocManageUtil.getTargetLoc(Long.parseLong(area)); |
| | | |
| | | DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>() |
| | | .eq(DeviceSite::getSite, sta) |
| | | .eq(DeviceSite::getAreaIdEnd, Long.parseLong(area)) |
| | | .eq(DeviceSite::getType, TaskType.TASK_TYPE_IN.type).last("limit 1")); |
| | | if (Cools.isEmpty(deviceSite)) { |
| | | throw new CoolException("无可用路径!!"); |
| | | } |
| | | |
| | | taskService.generateAGVTasks(waitPakin, targetLoc, sta, deviceSite.getTarget(),loginUserId); |
| | | taskService.generateAGVTasks(waitPakin, targetLoc, sta, deviceSite.getDeviceCode(),loginUserId); |
| | | |
| | | basStation.setUseStatus(LocStsType.LOC_STS_TYPE_R.type); |
| | | if (!basStationService.updateById(basStation)) { |
| | |
| | | if (Cools.isEmpty(waitPakinItems)) { |
| | | throw new CoolException("数据错误,未找到组托明细"); |
| | | } |
| | | List<Long> ids = new ArrayList<>(); |
| | | ids.add(basStation.getArea()); |
| | | if (basStation.getIsCrossZone() == 1) { |
| | | String content = basStation.getCrossZoneArea().substring(1, basStation.getCrossZoneArea().length() - 1); |
| | | String[] parts = content.split(","); |
| | | for (int i = 0; i < parts.length; i++) { |
| | | ids.add(Long.parseLong(parts[i].trim())); |
| | | } |
| | | } |
| | | List<Long> ids = basStation.getCrossZoneArea(); |
| | | // ids.add(basStation.getArea()); |
| | | // if (basStation.getIsCrossZone() == 1) { |
| | | // String content = basStation.getCrossZoneArea().substring(1, basStation.getCrossZoneArea().length() - 1); |
| | | // String[] parts = content.split(","); |
| | | // for (int i = 0; i < parts.length; i++) { |
| | | // ids.add(Long.parseLong(parts[i].trim())); |
| | | // } |
| | | // } |
| | | List<WarehouseAreas> warehouseAreasList = warehouseAreasService.list(new LambdaQueryWrapper<WarehouseAreas>() |
| | | .in(WarehouseAreas::getId, ids) |
| | | ); |
| | |
| | | |
| | | BasStation isBarcodeSta = basStationService.getOne(new LambdaQueryWrapper<BasStation>() |
| | | .eq(BasStation::getBarcode, barcode) |
| | | , false |
| | | .last("limit 1") |
| | | ); |
| | | if (!Cools.isEmpty(isBarcodeSta)) { |
| | | throw new CoolException("该条码已被" + isBarcodeSta.getStationName() + "站绑定"); |
| | |
| | | throw new CoolException("未找到站点信息"); |
| | | } |
| | | if (!Cools.isEmpty(basStation.getContainerType())) { |
| | | List<Long> longs1 = JSONObject.parseArray(basStation.getContainerType(), Long.class); |
| | | List<Long> longs1 = basStation.getCrossZoneArea(); |
| | | List<BasContainer> containers = basContainerService.list( |
| | | new LambdaQueryWrapper<BasContainer>() |
| | | .in(BasContainer::getContainerType, longs1) |
| | |
| | | throw new CoolException("站点为光电站点,禁止呼叫AGV"); |
| | | } |
| | | |
| | | List<String> areaList = JSONObject.parseArray(basStation.getCrossZoneArea(), String.class); |
| | | if (!areaList.contains(area)) { |
| | | List<Long> areaList = basStation.getCrossZoneArea(); |
| | | if (!areaList.contains(Long.parseLong(area))) { |
| | | throw new CoolException("当前站点不支持目标库区"); |
| | | } |
| | | if (!Cools.isEmpty(basStation.getContainerType())) { |
| | | List<Long> longs1 = JSONObject.parseArray(basStation.getContainerType(), Long.class); |
| | | List<Long> longs1 = basStation.getContainerType(); |
| | | List<BasContainer> containers = basContainerService.list( |
| | | new LambdaQueryWrapper<BasContainer>() |
| | | .in(BasContainer::getContainerType, longs1) |
| | |
| | | for (BasContainer container : containers) { |
| | | String codeType = container.getCodeType(); // 获取正则表达式 |
| | | if (barcode.matches(codeType)) { // 判断条码是否符合这个正则 |
| | | List<Integer> areaList2 = container.getAreas(); |
| | | List<Integer> areaList2 = container.getAreasIds(); |
| | | if (!areaList2.contains(Integer.valueOf(area))) { |
| | | matches2 = false; |
| | | continue; |