Commit c56e0ee3 authored by duanruiming's avatar duanruiming

[add] 相位倒计时

parent 06b917fe
......@@ -17,12 +17,7 @@ import net.wanji.utc.po.CrossLightsPO;
import net.wanji.utc.po.ManufacturerInfoPO;
import net.wanji.utc.po.hk.request.HKRequest;
import net.wanji.utc.po.hk.request.RealTimeStateInfoQueryPO;
import net.wanji.utc.po.hk.response.ChannelStatePO;
import net.wanji.utc.po.hk.response.HKResponse;
import net.wanji.utc.po.hk.response.PhaseInfoPO;
import net.wanji.utc.po.hk.response.RealTimeStateInfoListPO;
import net.wanji.utc.po.hk.response.RealTimeStateInfoPO;
import net.wanji.utc.po.hk.response.RingsPO;
import net.wanji.utc.po.hk.response.*;
import net.wanji.utc.service.runninginfo.HkLightsStatusService;
import net.wanji.utc.util.PathUtil;
import net.wanji.utc.util.StringUtils;
......@@ -30,12 +25,7 @@ import net.wanji.utc.vo.LightsStatusVO;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
/**
* @author Kent HAN
......@@ -151,10 +141,13 @@ public class HkLightsStatusServiceImpl implements HkLightsStatusService {
if (2 != vehicleStatus) { // 2红灯
infoVo.setPhaseId(String.valueOf(phaseNo));
}
Integer runTime = phaseInfoPO.getRunTime();
if (!Objects.equals(runTime, 0) && runTime <= phaseLength) {
infoVo.setCyclePhaseCountDown(phaseLength - runTime);
if (phaseInfoPO.getCountdown() <= phaseLength && !Objects.equals(phaseInfoPO.getRunTime(), phaseLength)) {
infoVo.setCyclePhaseCountDown(phaseInfoPO.getCountdown());
infoVo.setCycleCountDown(phaseInfoPO.getCountdown());
break;
}
}
}
infoVo.setPhaseMap(phaseMap);
......
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