Commit 7bf33daf authored by duanruiming's avatar duanruiming

[update] 优化海信平峰无左转灯态

parent a2a46f5f
......@@ -71,7 +71,7 @@ public class HisensePhaseCountDownTask {
Map<String, Object> dirLampGroupMap = lightsStatusVO.getDirLampGroupMap();
for (String dir : dirList) {
if (!dirLampGroupMap.containsKey(dir)) {
Map<String, String> value = new HashMap<>();
Map<Integer, String> value = new HashMap<>();
setAllTurnColorRed(value, null, null);
dirLampGroupMap.put(dir, value);
}
......@@ -194,6 +194,7 @@ public class HisensePhaseCountDownTask {
/**
* 统一方向转向倒计时
*
* @param phaseMap
* @param dir
* @param turnCountDown
......@@ -280,6 +281,23 @@ public class HisensePhaseCountDownTask {
List<CrossPhaseDirTurnPojo> crossPhaseDirTurnCache = CrossPhaseDirTurnCache.getCrossPhaseDirTurnCache(crossId);
if (!CollectionUtils.isEmpty(crossPhaseDirTurnCache)) {
Map<String, Object> dirLampGroupMap = new HashMap<>();
setPhaseLampColor(crossId, currentSchemeNo, currentPhaseNo, cyclePhaseCountDown, crossPhaseDirTurnCache, dirLampGroupMap);
// 海信,箭头灯变圆饼灯
for (Map.Entry<String, Object> arrowEntry : dirLampGroupMap.entrySet()) {
String dir = arrowEntry.getKey();
Map<Integer, String> turnColor = (Map<Integer, String>) arrowEntry.getValue();
if (!turnColor.isEmpty() && !turnColor.containsKey(1)) {
// 如果不包含左转, 左转灯色为直行
String straightColor = turnColor.get(2);
turnColor.put(1, straightColor);
dirLampGroupMap.put(dir, turnColor);
}
}
lightsStatusVO.setDirLampGroupMap(dirLampGroupMap);
}
}
private void setPhaseLampColor(String crossId, String currentSchemeNo, String currentPhaseNo, Integer cyclePhaseCountDown, List<CrossPhaseDirTurnPojo> crossPhaseDirTurnCache, Map<String, Object> dirLampGroupMap) throws Exception {
for (CrossPhaseDirTurnPojo phaseDirTurnPojo : crossPhaseDirTurnCache) {
String schemeNo = String.valueOf(phaseDirTurnPojo.getSchemeNo());
String phaseNo = String.valueOf(phaseDirTurnPojo.getPhaseNo());
......@@ -326,10 +344,6 @@ public class HisensePhaseCountDownTask {
if (!dirTurnMap.isEmpty()) {
setDirTurnColor(cyclePhaseCountDown, dirLampGroupMap, yellowTime, redTime, dirTurnMap);
}
lightsStatusVO.setDirLampGroupMap(dirLampGroupMap);
}
lightsStatusVO.setDirLampGroupMap(dirLampGroupMap);
}
}
}
......@@ -394,14 +408,14 @@ public class HisensePhaseCountDownTask {
* @param type
* @param color
*/
private static void setAllTurnColorRed(Map<String, String> turnColor, Integer type, String color) throws Exception {
List<String> allTurn = Arrays.asList("1", "2", "3");
for (String turnStr : allTurn) {
private static void setAllTurnColorRed(Map<Integer, String> turnColor, Integer type, String color) throws Exception {
List<Integer> allTurn = Arrays.asList(1, 2, 3);
for (Integer turnStr : allTurn) {
if (!turnColor.containsKey(turnStr)) {
turnColor.put(turnStr, "red");
}
}
for (Map.Entry<String, String> entry : turnColor.entrySet()) {
for (Map.Entry<Integer, String> entry : turnColor.entrySet()) {
entry.setValue("red");
}
}
......
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