Commit da1cc1cb authored by hanbing's avatar hanbing

[update] 单独适配旅游路与转山西路通道号

parent 05973af0
......@@ -10,21 +10,38 @@ import java.util.Map;
* @date 2023/7/6 15:43
*/
public class ComplexCrossCache {
private static final Map<String, Map<Integer, Integer>> cacheMap;
private static final Map<String, Map<Integer, Integer>> turnCacheMap;
private static final Map<String, Map<Integer, Integer>> dirCacheMap;
static {
cacheMap = new HashMap<>();
turnCacheMap = new HashMap<>();
dirCacheMap = new HashMap<>();
Map<Integer, Integer> innerMap1 = new HashMap<>();
innerMap1.put(2, 1);
innerMap1.put(6, 2);
innerMap1.put(14, 2);
innerMap1.put(15, 1);
cacheMap.put("13NI00B5RM0", innerMap1); // 旅游路与转山西路交叉口
// 旅游路与转山西路交叉口
Map<Integer, Integer> turnInnerMap13NI00B5RM0 = new HashMap<>();
turnInnerMap13NI00B5RM0.put(2, 1);
turnInnerMap13NI00B5RM0.put(6, 2);
turnInnerMap13NI00B5RM0.put(14, 2);
turnInnerMap13NI00B5RM0.put(15, 1);
turnInnerMap13NI00B5RM0.put(8, 20);
turnInnerMap13NI00B5RM0.put(12, 20);
turnCacheMap.put("13NI00B5RM0", turnInnerMap13NI00B5RM0);
Map<Integer, Integer> dirInnerMap13NI00B5RM0 = new HashMap<>();
dirInnerMap13NI00B5RM0.put(2, 1);
dirInnerMap13NI00B5RM0.put(6, 3);
dirInnerMap13NI00B5RM0.put(14, 7);
dirInnerMap13NI00B5RM0.put(15, 7);
dirInnerMap13NI00B5RM0.put(8, 1);
dirInnerMap13NI00B5RM0.put(12, 3);
dirCacheMap.put("13NI00B5RM0", dirInnerMap13NI00B5RM0);
}
public static Map<String, Map<Integer, Integer>> getCacheMap() {
return cacheMap;
public static Map<String, Map<Integer, Integer>> getTurnCacheMap() {
return turnCacheMap;
}
public static Map<String, Map<Integer, Integer>> getDirCacheMap() {
return dirCacheMap;
}
}
......@@ -64,16 +64,21 @@ public class SignalStatusServiceImpl implements SignalStatusService {
turn = CommonUtils.getTurnByLightsId(i);
// 复杂路口处理
Map<String, Map<Integer, Integer>> cacheMap = ComplexCrossCache.getCacheMap();
if (cacheMap.containsKey(crossId)) {
Map<Integer, Integer> innerMap = cacheMap.get(crossId);
if (innerMap.containsKey(i)) {
turn = innerMap.get(i);
}
Map<String, Map<Integer, Integer>> turnCacheMap = ComplexCrossCache.getTurnCacheMap();
if (turnCacheMap.containsKey(crossId)) {
Map<Integer, Integer> innerMap = turnCacheMap.get(crossId);
turn = innerMap.get(i);
}
turnColorMap.put(turn, wjLightColor);
String dir = String.valueOf(CommonUtils.getDirByLightsId(i));
// 复杂路口处理
Map<String, Map<Integer, Integer>> dirCacheMap = ComplexCrossCache.getDirCacheMap();
if (dirCacheMap.containsKey(crossId)) {
Map<Integer, Integer> innerMap = dirCacheMap.get(crossId);
dir = String.valueOf(innerMap.get(i));
}
if (dirLampGroupMap.isEmpty() || Objects.isNull(dirLampGroupMap.get(dir))) {
dirLampGroupMap.put(dir, turnColorMap);
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment