Commit ab516479acfe7b2a6426029ab2d2f42c4b12cf77
Merge branch 'pudong' of http://222.66.0.204:8090/panzhaov5/bsth_control
into pudong
Showing
4 changed files
with
20 additions
and
84 deletions
src/main/java/com/bsth/controller/realcontrol/ServiceDataInterface.java
src/main/java/com/bsth/data/gpsdata_v2/handlers/InStationProcess.java
| ... | ... | @@ -146,8 +146,8 @@ public class InStationProcess { |
| 146 | 146 | dayOfSchedule.removeExecPlan(nbbm); |
| 147 | 147 | |
| 148 | 148 | //通知误点停靠程序,有车辆到站 |
| 149 | - //LateAdjustHandle.carArrive(gps, next); | |
| 150 | - LateAdjustHandle.carArrive(gps); | |
| 149 | + LateAdjustHandle.carArrive(gps, next); | |
| 150 | + //LateAdjustHandle.carArrive(gps); | |
| 151 | 151 | |
| 152 | 152 | //路牌的下一个班次,页面显示起点实际到达时间 |
| 153 | 153 | ScheduleRealInfo lpNext = dayOfSchedule.nextByLp(sch); | ... | ... |
src/main/java/com/bsth/data/schedule/late_adjust/LateAdjustHandle.java
| 1 | 1 | |
| 2 | 2 | package com.bsth.data.schedule.late_adjust; |
| 3 | 3 | |
| 4 | -import com.bsth.data.BasicData; | |
| 5 | 4 | import com.bsth.data.LineConfigData; |
| 6 | 5 | import com.bsth.data.gpsdata_v2.entity.GpsEntity; |
| 7 | 6 | import com.bsth.entity.realcontrol.LineConfig; |
| ... | ... | @@ -9,7 +8,6 @@ import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 9 | 8 | import com.bsth.util.Arith; |
| 10 | 9 | import com.bsth.websocket.handler.SendUtils; |
| 11 | 10 | import com.google.common.collect.ArrayListMultimap; |
| 12 | -import org.apache.commons.lang3.StringUtils; | |
| 13 | 11 | import org.slf4j.Logger; |
| 14 | 12 | import org.slf4j.LoggerFactory; |
| 15 | 13 | import org.springframework.beans.BeansException; |
| ... | ... | @@ -154,37 +152,18 @@ public class LateAdjustHandle implements ApplicationContextAware { |
| 154 | 152 | } |
| 155 | 153 | |
| 156 | 154 | /** |
| 157 | - * 车辆到站 | |
| 155 | + * 车辆到站 进站 进 的哪个班次,就调该车辆的下一个班次 | |
| 158 | 156 | * |
| 159 | 157 | * @param gps |
| 160 | 158 | */ |
| 161 | - public static void carArrive(GpsEntity gps) { | |
| 159 | + public static void carArrive(GpsEntity gps, ScheduleRealInfo sch) { | |
| 162 | 160 | try { |
| 163 | - if (gps.getInstation() <= 0) { | |
| 161 | + if (gps.getInstation() <= 0 || null == sch) | |
| 164 | 162 | return; |
| 165 | - } | |
| 166 | 163 | |
| 167 | 164 | List<ScheduleRealInfo> list = lateSchMaps.get(gps.getNbbm()); |
| 168 | 165 | |
| 169 | - if (null == list || list.size() == 0) | |
| 170 | - return; | |
| 171 | - | |
| 172 | - | |
| 173 | - String key = gps.getLineId() + "_" + gps.getUpDown() + "_" + gps.getStopNo(), name1 = BasicData.stationCode2NameMap.get(key)//站点名称 | |
| 174 | - , name2 = null; | |
| 175 | - if (StringUtils.isNotEmpty(gps.getCarparkNo())) { | |
| 176 | - name2 = BasicData.stationCode2NameMap.get(gps.getCarparkNo()); | |
| 177 | - } | |
| 178 | - | |
| 179 | - if (gps.getInstation() == 2) { | |
| 180 | - name1 = name2;//进场,没有站 | |
| 181 | - } | |
| 182 | - | |
| 183 | - gps.setStationName(name1); | |
| 184 | - //根据起点站获取误点班次 | |
| 185 | - ScheduleRealInfo sch = findExistQdz(list, gps.getStopNo(), name1, name2); | |
| 186 | - | |
| 187 | - if (null == sch) | |
| 166 | + if (null == list || list.size() == 0 || !list.contains(sch)) | |
| 188 | 167 | return; |
| 189 | 168 | |
| 190 | 169 | //可能是延迟信号,gps时间没有误点 |
| ... | ... | @@ -194,21 +173,17 @@ public class LateAdjustHandle implements ApplicationContextAware { |
| 194 | 173 | return; |
| 195 | 174 | } |
| 196 | 175 | |
| 197 | - if (gps.getStationName().equals(sch.getQdzName()) | |
| 198 | - || gps.getStopNo().equals(sch.getQdzCode()) | |
| 199 | - || sch.getQdzName().equals(name2)) { | |
| 200 | 176 | |
| 201 | - //自动调整待发 到达时间 + 停靠时间 | |
| 202 | - long dt = Arith.addLong(gps.getTimestamp(), (sch.getLateMinute() * 60 * 1000)); | |
| 177 | + //自动调整待发 到达时间 + 停靠时间 | |
| 178 | + long dt = Arith.addLong(gps.getTimestamp(), (sch.getLateMinute() * 60 * 1000)); | |
| 203 | 179 | |
| 204 | - sch.setDfsjAll(dt); | |
| 205 | - sch.setDfAuto(true); | |
| 206 | - //取消应发未到标记 | |
| 207 | - sch.setLate2(false); | |
| 180 | + sch.setDfsjAll(dt); | |
| 181 | + sch.setDfAuto(true); | |
| 182 | + //取消应发未到标记 | |
| 183 | + sch.setLate2(false); | |
| 208 | 184 | |
| 209 | - lateSchMaps.remove(sch.getClZbh(), sch); | |
| 210 | - logger.info("【应发未到】车辆到站 " + sch.getClZbh() + " -" + sch.getDfsj() + " -到站时间:" + gps.getTimestamp() + " -停靠时间:" + sch.getLateMinute() + " -自动设置的待发时间:" + dt); | |
| 211 | - } | |
| 185 | + lateSchMaps.remove(sch.getClZbh(), sch); | |
| 186 | + logger.info("【应发未到】车辆到站 " + sch.getClZbh() + " -" + sch.getDfsj() + " -到站时间:" + gps.getTimestamp() + " -停靠时间:" + sch.getLateMinute() + " -自动设置的待发时间:" + dt); | |
| 212 | 187 | } catch (Exception e) { |
| 213 | 188 | e.printStackTrace(); |
| 214 | 189 | logger.error("late2 car arrive", e); |
| ... | ... | @@ -216,47 +191,6 @@ public class LateAdjustHandle implements ApplicationContextAware { |
| 216 | 191 | } |
| 217 | 192 | |
| 218 | 193 | |
| 219 | - /** | |
| 220 | - * 车辆到站, 进站 进 的哪个班次,就调该车辆的下一个班次 | |
| 221 | - * | |
| 222 | - * @param gps | |
| 223 | - * @param sch public static void carArrive(GpsEntity gps, ScheduleRealInfo sch) { | |
| 224 | - * try { | |
| 225 | - * if (gps.getInstation() <= 0 || null == sch) { | |
| 226 | - * return; | |
| 227 | - * } | |
| 228 | - * <p> | |
| 229 | - * List<ScheduleRealInfo> list = lateSchMaps.get(gps.getNbbm()); | |
| 230 | - * <p> | |
| 231 | - * if (null == list || list.size() == 0 || !list.contains(sch)) { | |
| 232 | - * return; | |
| 233 | - * } | |
| 234 | - * <p> | |
| 235 | - * //可能是延迟信号,gps时间没有误点 | |
| 236 | - * if (gps.getTimestamp() <= sch.getDfsjT()) { | |
| 237 | - * sch.setLate2(false); | |
| 238 | - * lateSchMaps.remove(sch.getClZbh(), sch); | |
| 239 | - * return; | |
| 240 | - * } | |
| 241 | - * <p> | |
| 242 | - * <p> | |
| 243 | - * //自动调整待发 到达时间 + 停靠时间 | |
| 244 | - * long dt = Arith.addLong(gps.getTimestamp(), (sch.getLateMinute() * 60 * 1000)); | |
| 245 | - * <p> | |
| 246 | - * sch.setDfsjAll(dt); | |
| 247 | - * sch.setDfAuto(true); | |
| 248 | - * //取消应发未到标记 | |
| 249 | - * sch.setLate2(false); | |
| 250 | - * <p> | |
| 251 | - * lateSchMaps.remove(sch.getClZbh(), sch); | |
| 252 | - * logger.info("【应发未到】车辆到站 " + sch.getClZbh() + " -" + sch.getDfsj() + " -到站时间:" + gps.getTimestamp() + " -停靠时间:" + sch.getLateMinute() + " -自动设置的待发时间:" + dt); | |
| 253 | - * } catch (Exception e) { | |
| 254 | - * e.printStackTrace(); | |
| 255 | - * logger.error("late2 car arrive", e); | |
| 256 | - * } | |
| 257 | - * } | |
| 258 | - */ | |
| 259 | - | |
| 260 | 194 | @Override |
| 261 | 195 | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { |
| 262 | 196 | lineConfigData = applicationContext.getBean(LineConfigData.class); | ... | ... |
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
| ... | ... | @@ -150,9 +150,9 @@ public class GpsServiceImpl implements GpsService { |
| 150 | 150 | * @return -1无效 0上行 1下行 |
| 151 | 151 | */ |
| 152 | 152 | public static byte getUpOrDown(long serviceState) { |
| 153 | - if ((serviceState & 0x00020000) == 0x00020000 || (serviceState & 0x80000000) == 0x80000000 | |
| 153 | + /*if ((serviceState & 0x00020000) == 0x00020000 || (serviceState & 0x80000000) == 0x80000000 | |
| 154 | 154 | || (serviceState & 0x01000000) == 0x01000000 || (serviceState & 0x08000000) == 0x08000000) |
| 155 | - return -1; | |
| 155 | + return -1;*/ | |
| 156 | 156 | return (byte) (((serviceState & 0x10000000) == 0x10000000) ? 1 : 0); |
| 157 | 157 | } |
| 158 | 158 | |
| ... | ... | @@ -162,8 +162,8 @@ public class GpsServiceImpl implements GpsService { |
| 162 | 162 | * @return -1无效 0运营 1未运营 |
| 163 | 163 | */ |
| 164 | 164 | public static byte getService(long serviceState) { |
| 165 | - if ((serviceState & 0x00020000) == 0x00020000 || (serviceState & 0x80000000) == 0x80000000) | |
| 166 | - return -1; | |
| 165 | + /*if ((serviceState & 0x00020000) == 0x00020000 || (serviceState & 0x80000000) == 0x80000000) | |
| 166 | + return -1;*/ | |
| 167 | 167 | return (byte) (((serviceState & 0x02000000) == 0x02000000) ? 1 : 0); |
| 168 | 168 | } |
| 169 | 169 | ... | ... |