| | |
| | | } |
| | | |
| | | if(commandType == StationCommandType.WRITE_INFO){ |
| | | if (command.getBarcode() != null) { |
| | | updateStationBarcode(deviceNo, stationId, command.getBarcode()); |
| | | return; |
| | | } |
| | | if (taskNo == 9998 && targetStationId == 0) { |
| | | //生成出库站点仿真数据 |
| | | generateFakeOutStationData(deviceNo, stationId); |
| | |
| | | } |
| | | } |
| | | |
| | | private void updateStationBarcode(Integer deviceNo, Integer stationId, String barcode) { |
| | | List<ZyStationStatusEntity> statusList = deviceStatusMap.get(deviceNo); |
| | | if (statusList == null) { |
| | | return; |
| | | } |
| | | |
| | | ZyStationStatusEntity status = statusList.stream() |
| | | .filter(item -> item.getStationId().equals(stationId)).findFirst().orElse(null); |
| | | if (status == null) { |
| | | return; |
| | | } |
| | | |
| | | synchronized (status) { |
| | | status.setBarcode(barcode); |
| | | } |
| | | } |
| | | |
| | | private void currentLevCommand(StationCommand command, boolean generateBarcode) { |
| | | NavigateUtils navigateUtils = SpringUtils.getBean(NavigateUtils.class); |
| | | if (navigateUtils == null) { |
| | |
| | | Integer stationId = command.getStationId(); |
| | | Integer targetStationId = command.getTargetStaNo(); |
| | | |
| | | List<NavigateNode> navigateNodes = null; |
| | | List<NavigateNode> navigateNodes = new ArrayList<>(); |
| | | try { |
| | | navigateNodes = navigateUtils.calcByStationId(stationId, targetStationId); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | if (navigateNodes == null) { |
| | | if (navigateNodes.isEmpty()) { |
| | | return; |
| | | } |
| | | |
| | |
| | | Integer stationId = command.getStationId(); |
| | | Integer targetStationId = command.getTargetStaNo(); |
| | | |
| | | List<NavigateNode> navigateNodes = null; |
| | | List<NavigateNode> targetNavigateNodes = null; |
| | | List<NavigateNode> navigateNodes = new ArrayList<>(); |
| | | List<NavigateNode> targetNavigateNodes = new ArrayList<>(); |
| | | |
| | | try { |
| | | BasStation startStation = basStationService.selectById(stationId); |
| | |
| | | continue; |
| | | } |
| | | |
| | | navigateNodes = navigateUtils.calcByStationId(stationId, liftStationId); |
| | | if(navigateNodes == null){ |
| | | try { |
| | | navigateNodes = navigateUtils.calcByStationId(stationId, liftStationId); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | if(navigateNodes.isEmpty()){ |
| | | continue; |
| | | } |
| | | |
| | | //计算提升机到目标站的路径 |
| | | targetNavigateNodes = navigateUtils.calcByStationId(targetLiftStationId, targetStationId); |
| | | if(targetNavigateNodes == null) { |
| | | try { |
| | | //计算提升机到目标站的路径 |
| | | targetNavigateNodes = navigateUtils.calcByStationId(targetLiftStationId, targetStationId); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | if(targetNavigateNodes.isEmpty()) { |
| | | continue; |
| | | } |
| | | } |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | if (navigateNodes == null || targetNavigateNodes == null) { |
| | | if (navigateNodes.isEmpty() || targetNavigateNodes.isEmpty()) { |
| | | return; |
| | | } |
| | | |