#
vincentlu
2025-03-27 cd67e854d4715bc92a16dc7bffdbde7be1da9957
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/LaneService.java
@@ -39,6 +39,8 @@
    private final Map<String, List<int[]>> laneCodeIdxMap = new HashMap<>();
    private final Map<String, Lane> codeLaneMap = new HashMap<>();
    private boolean initialized = Boolean.FALSE;
    @Autowired
@@ -62,12 +64,14 @@
        if (Cools.isEmpty(codeData) || !this.initialized) {
            return null;
        }
        for (Lane lane : this.lanes) {
            if (lane.getCodes().contains(codeData)) {
                return lane;
            }
        }
        return null;
//        if (result == null) {
//            for (Lane lane : this.lanes) {
//                if (lane.getCodes().contains(codeData)) {
//                    return lane;
//                }
//            }
//        }
        return this.codeLaneMap.get(codeData);
    }
    public List<int[]> getLaneCodeIdxList(String codeData) {
@@ -131,7 +135,7 @@
        for (Code code : codeList) {
            List<Long> adjacencyNode = routeService.getAdjacencyNode(code.getId());
            this.adjacencyCodeMap.put(code.getData(), adjacencyNode.stream().map(node -> (
                    codeService.getById(node).getData()
                    codeService.getCacheById(node).getData()
            )).collect(Collectors.toList()));
        }
    }
@@ -348,7 +352,6 @@
    public void generateLaneCodeIdx(Integer lev) {
        log.info("There is initializing Lane CodeIdxMap......");
        long l = System.currentTimeMillis();
        if (Cools.isEmpty(this.lanes)) {
            return;
        }
@@ -358,6 +361,7 @@
                int[] codeMatrixIdx = mapDataDispatcher.getCodeMatrixIdx(lev, code);
                codeIdxList.add(codeMatrixIdx);
                this.laneCodeIdxMap.put(code, codeIdxList);
                this.codeLaneMap.put(code, lane);
            }
        }
    }