#
Junjie
1 天以前 7b87595a7379c7b250233e2bfcbf8b44ab4a539d
src/main/java/com/zy/asrs/service/impl/StationCycleCapacityServiceImpl.java
@@ -1,6 +1,7 @@
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;
@@ -372,17 +373,13 @@
                        continue;
                    }
                    for (NavigateNode nextNode : nextNodeList) {
                        JSONObject nextValueObj = parseNodeValue(nextNode.getNodeValue());
                        if (nextValueObj == null) {
                            continue;
                        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);
                        }
                        Integer nextStationId = nextValueObj.getInteger("stationId");
                        if (nextStationId == null || stationId.equals(nextStationId)) {
                            continue;
                        }
                        context.graph.computeIfAbsent(nextStationId, k -> new HashSet<>());
                        context.graph.get(stationId).add(nextStationId);
                    }
                }
            }
@@ -434,6 +431,27 @@
                || (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>()