Commit e3ca6c44 authored by duanruiming's avatar duanruiming

[update] 优化实体类解析

parent 19376395
...@@ -51,27 +51,23 @@ public class SignalStatusServiceImpl implements SignalStatusService { ...@@ -51,27 +51,23 @@ public class SignalStatusServiceImpl implements SignalStatusService {
lightsStatusVO.setPhaseId(String.valueOf(phaseId)); lightsStatusVO.setPhaseId(String.valueOf(phaseId));
lightsStatusVO.setSchemeId(String.valueOf(runningLightsStatusPojo.getPLN())); lightsStatusVO.setSchemeId(String.valueOf(runningLightsStatusPojo.getPLN()));
List<RunningLightsStatusPojo.Channel> channelList = runningLightsStatusPojo.getCHANNEL(); RunningLightsStatusPojo.Channel channel = runningLightsStatusPojo.getCHANNEL();
Map<String, Object> dirLampGroupMap = new HashMap<>(); Map<String, Object> dirLampGroupMap = new HashMap<>();
if (!CollectionUtils.isEmpty(channelList)) { List<Integer> scs = channel.getSCS();
for (RunningLightsStatusPojo.Channel channel : channelList) { if (!CollectionUtils.isEmpty(scs)) {
List<Integer> scs = channel.getSCS(); for (int i = 0; i < scs.size(); i++) {
if (!CollectionUtils.isEmpty(scs)) { Map<Integer, String> turnColorMap = new HashMap<>();
for (int i = 0; i < scs.size(); i++) { String lightsColor = String.valueOf(scs.get(i));
Map<Integer, String> turnColorMap = new HashMap<>(); String wjLightColor = PhaseLightColorEnum.getWjLightColor(lightsColor);
String lightsColor = String.valueOf(scs.get(i)); Integer turn = CommonUtils.getTurnByLightsId(i);
String wjLightColor = PhaseLightColorEnum.getWjLightColor(lightsColor); turnColorMap.put(turn, wjLightColor);
Integer turn = CommonUtils.getTurnByLightsId(i); String dir = String.valueOf(CommonUtils.getDirByLightsId(i));
turnColorMap.put(turn, wjLightColor); if (dirLampGroupMap.isEmpty() || Objects.isNull(dirLampGroupMap.get(dir))) {
String dir = String.valueOf(CommonUtils.getDirByLightsId(i)); dirLampGroupMap.put(dir, turnColorMap);
if (dirLampGroupMap.isEmpty() || Objects.isNull(dirLampGroupMap.get(dir))) { } else {
dirLampGroupMap.put(dir, turnColorMap); Map<Integer, String> currentTurnColorMap = (Map<Integer, String>) dirLampGroupMap.get(dir);
} else { currentTurnColorMap.put(turn, wjLightColor);
Map<Integer, String> currentTurnColorMap = (Map<Integer, String>) dirLampGroupMap.get(dir); dirLampGroupMap.put(dir, currentTurnColorMap);
currentTurnColorMap.put(turn, wjLightColor);
dirLampGroupMap.put(dir, currentTurnColorMap);
}
}
} }
} }
} }
......
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