Commit bb3e1e56 authored by duanruiming's avatar duanruiming

[update] 优化海信灯态车道灯态问题2

parent d159c659
...@@ -24,5 +24,4 @@ public class SignalDataCache { ...@@ -24,5 +24,4 @@ public class SignalDataCache {
public static final Map<String, RunningLightsStatusPojo> runningStateInfoCacheUdp = new HashMap<>(); public static final Map<String, RunningLightsStatusPojo> runningStateInfoCacheUdp = new HashMap<>();
public static final Map<String, LightsStatusVO> runningStateInfoCache = new HashMap<>(); public static final Map<String, LightsStatusVO> runningStateInfoCache = new HashMap<>();
public static final Map<String, Long> runningStatusStampMap = new HashMap<>(); public static final Map<String, Long> runningStatusStampMap = new HashMap<>();
public static final Map<String, Integer> currentCrossPhaseNoRunPhaseTimeMap = new HashMap<>();
} }
...@@ -153,8 +153,8 @@ public class SignalStatusServiceImpl implements SignalStatusService { ...@@ -153,8 +153,8 @@ public class SignalStatusServiceImpl implements SignalStatusService {
} }
Date date = new Date(); Date date = new Date();
Long time = date.getTime(); Long time = date.getTime();
int offsetTime = (int) ((time - signalMachineStamp) / 1000); int offsetTime = (int) ((time - signalMachineStamp) / 1000) - 6; //37.12.182.29服务器比北京时间快6秒
int cycleCountDown = content.getCycleCountDown() - offsetTime; int cycleCountDown = content.getCycleCountDown() - Math.max(offsetTime, 0);
int hiControlMode = content.getControlMode(); int hiControlMode = content.getControlMode();
int period = content.getPeriod(); int period = content.getPeriod();
int runTime = period - cycleCountDown; int runTime = period - cycleCountDown;
...@@ -204,7 +204,6 @@ public class SignalStatusServiceImpl implements SignalStatusService { ...@@ -204,7 +204,6 @@ public class SignalStatusServiceImpl implements SignalStatusService {
Integer changePhaseTime = phaseCountDownDTO.getChangePhaseTime(); Integer changePhaseTime = phaseCountDownDTO.getChangePhaseTime();
if (lastPhaseCountTime <= runTime && runTime < changePhaseTime) { if (lastPhaseCountTime <= runTime && runTime < changePhaseTime) {
phaseTimeCountDown = changePhaseTime - runTime; phaseTimeCountDown = changePhaseTime - runTime;
SignalDataCache.currentCrossPhaseNoRunPhaseTimeMap.put(crossId, phaseTimeCountDown);
break; break;
} }
lastPhaseCountTime = changePhaseTime; lastPhaseCountTime = changePhaseTime;
......
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