| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.zy.asrs.domain.vo.StationCycleCapacityVo; |
| | |
| | | continue; |
| | | } |
| | | for (NavigateNode nextNode : nextNodeList) { |
| | | JSONObject nextValueObj = parseNodeValue(nextNode.getNodeValue()); |
| | | if (nextValueObj == null) { |
| | | continue; |
| | | } |
| | | Integer nextStationId = nextValueObj.getInteger("stationId"); |
| | | for (Integer nextStationId : resolveConnectedStationIds(stationId, nextNode)) { |
| | | if (nextStationId == null || stationId.equals(nextStationId)) { |
| | | continue; |
| | | } |
| | | |
| | | context.graph.computeIfAbsent(nextStationId, k -> new HashSet<>()); |
| | | context.graph.get(stationId).add(nextStationId); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | || (isBarcodeStation != null && isBarcodeStation == 1); |
| | | } |
| | | |
| | | private Set<Integer> resolveConnectedStationIds(Integer currentStationId, NavigateNode nextNode) { |
| | | Set<Integer> stationIdSet = new HashSet<>(); |
| | | JSONObject nextValueObj = parseNodeValue(nextNode == null ? null : nextNode.getNodeValue()); |
| | | if (nextValueObj == null) { |
| | | return stationIdSet; |
| | | } |
| | | Integer directStationId = nextValueObj.getInteger("stationId"); |
| | | if (directStationId != null && !directStationId.equals(currentStationId)) { |
| | | stationIdSet.add(directStationId); |
| | | } |
| | | JSONArray bridgeStationIds = nextValueObj.getJSONArray("bridgeStationIds"); |
| | | if (bridgeStationIds != null) { |
| | | for (Integer bridgeStationId : bridgeStationIds.toJavaList(Integer.class)) { |
| | | if (bridgeStationId != null && !bridgeStationId.equals(currentStationId)) { |
| | | stationIdSet.add(bridgeStationId); |
| | | } |
| | | } |
| | | } |
| | | return stationIdSet; |
| | | } |
| | | |
| | | private StationOccupancyContext buildStationOccupancyContext() { |
| | | StationOccupancyContext context = new StationOccupancyContext(); |
| | | List<DeviceConfig> devpList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |