1
zhang
2 天以前 3a49654f51096d4f9f95f4a5e8198e168e38a0c5
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/LaneService.java
@@ -16,9 +16,10 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.time.StopWatch;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.*;
@@ -87,7 +88,7 @@
    // launcher -------------------------------------------------------
    @PostConstruct
    @EventListener(ApplicationReadyEvent.class)
    public void init() {
        Integer lev = MapDataDispatcher.MAP_DEFAULT_LEV;
        String laneDataStr = redis.getValue(RedisConstant.MAP_LANE_DATA, String.valueOf(lev));
@@ -147,6 +148,10 @@
            if (this.adjacencyCodeMap.get(codeData).size() != 2) {
                List<String> neighbors = this.adjacencyCodeMap.get(codeData);
                for (String neighbor : neighbors) {
                    if (this.adjacencyCodeMap.get(neighbor) == null) {
                        log.info("cunzai");
                        continue;
                    }
                    if (this.adjacencyCodeMap.get(neighbor).size() == 2 && !visited.contains(neighbor)) {
                        Lane lane = new Lane(String.valueOf(snowflakeIdWorker.nextId()).substring(3));
                        lane.getCodes().add(codeData); // 包含起点
@@ -295,7 +300,7 @@
                for (String anotherPointNear : anotherPointNears) {
                    if (!lane.getCodes().contains(anotherPointNear) && this.adjacencyCodeMap.get(anotherPointNear).size() == 2) {
                        for (Lane lane0 : lanes) {
                        for (Lane lane0 : new ArrayList<>(lanes)) {
                            if (lane0.getCodes().contains(anotherPointNear)) {
                                lane0.getCodes().addAll(lane.getCodes());