Commit dd8b9db7c7255fcc669e5a8765c38a789a7da01d
1 parent
ae4b1e0c
update...
Showing
4 changed files
with
35 additions
and
6 deletions
src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
| @@ -175,7 +175,7 @@ public class InOutStationSignalHandle extends SignalHandle{ | @@ -175,7 +175,7 @@ public class InOutStationSignalHandle extends SignalHandle{ | ||
| 175 | dayOfSchedule.save(sch); | 175 | dayOfSchedule.save(sch); |
| 176 | 176 | ||
| 177 | //清理应发未发标记 | 177 | //清理应发未发标记 |
| 178 | - LateAdjustHandle.remove(sch); | 178 | + LateAdjustHandle.remove(sch.getClZbh()); |
| 179 | 179 | ||
| 180 | if(!gps.isService() && !dayOfSchedule.emptyService(sch)){ | 180 | if(!gps.isService() && !dayOfSchedule.emptyService(sch)){ |
| 181 | //切换成营运状态 | 181 | //切换成营运状态 |
src/main/java/com/bsth/data/gpsdata/recovery/GpsDataRecovery.java
| @@ -84,7 +84,7 @@ public class GpsDataRecovery implements ApplicationContextAware { | @@ -84,7 +84,7 @@ public class GpsDataRecovery implements ApplicationContextAware { | ||
| 84 | Calendar calendar = Calendar.getInstance(); | 84 | Calendar calendar = Calendar.getInstance(); |
| 85 | int dayOfYear = calendar.get(Calendar.DAY_OF_YEAR); | 85 | int dayOfYear = calendar.get(Calendar.DAY_OF_YEAR); |
| 86 | 86 | ||
| 87 | - String sql = "select DEVICE_ID,LAT,LON,TS,SPEED_GPS,LINE_ID,SERVICE_STATE from bsth_c_gps_info where days_year=267";// + dayOfYear; | 87 | + String sql = "select DEVICE_ID,LAT,LON,TS,SPEED_GPS,LINE_ID,SERVICE_STATE from bsth_c_gps_info where days_year=285";// + dayOfYear; |
| 88 | JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_MS.getDataSource()); | 88 | JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_MS.getDataSource()); |
| 89 | 89 | ||
| 90 | List<GpsEntity> list = | 90 | List<GpsEntity> list = |
src/main/java/com/bsth/data/pilot80/PilotReport.java
| @@ -162,6 +162,15 @@ public class PilotReport { | @@ -162,6 +162,15 @@ public class PilotReport { | ||
| 162 | 162 | ||
| 163 | LineConfig conf = lineConfigData.get(sch.getXlBm()); | 163 | LineConfig conf = lineConfigData.get(sch.getXlBm()); |
| 164 | if (conf.getOutConfig() == 1) { | 164 | if (conf.getOutConfig() == 1) { |
| 165 | + | ||
| 166 | + try{ | ||
| 167 | + //最大允许时间阈值 2 小时 | ||
| 168 | + if(Math.abs(d80.getTimestamp() - sch.getDfsjT()) > 1000 * 60 * 60 * 2) | ||
| 169 | + return; | ||
| 170 | + }catch (Exception e){ | ||
| 171 | + logger.error("", e); | ||
| 172 | + } | ||
| 173 | + | ||
| 165 | //为相关班次写入请求出场时间 | 174 | //为相关班次写入请求出场时间 |
| 166 | sch.setFcsjActualAll(d80.getTimestamp()); | 175 | sch.setFcsjActualAll(d80.getTimestamp()); |
| 167 | 176 |
src/main/java/com/bsth/data/schedule/late_adjust/LateAdjustHandle.java
| @@ -102,12 +102,25 @@ public class LateAdjustHandle implements ApplicationContextAware{ | @@ -102,12 +102,25 @@ public class LateAdjustHandle implements ApplicationContextAware{ | ||
| 102 | sch.setLate2(false); | 102 | sch.setLate2(false); |
| 103 | sch.setLateMinute(0); | 103 | sch.setLateMinute(0); |
| 104 | sch.setDfAuto(false); | 104 | sch.setDfAuto(false); |
| 105 | + | ||
| 106 | + logger.info("移除误点调整 -" + sch.getClZbh()); | ||
| 105 | } | 107 | } |
| 106 | }catch (Exception e){ | 108 | }catch (Exception e){ |
| 107 | logger.error("", e); | 109 | logger.error("", e); |
| 108 | } | 110 | } |
| 109 | } | 111 | } |
| 110 | 112 | ||
| 113 | + public static void remove(String nbbm){ | ||
| 114 | + if(lateSchMap.containsKey(nbbm)){ | ||
| 115 | + ScheduleRealInfo sch = lateSchMap.get(nbbm); | ||
| 116 | + sch.setLate2(false); | ||
| 117 | + sch.setLateMinute(0); | ||
| 118 | + sch.setDfAuto(false); | ||
| 119 | + | ||
| 120 | + logger.info("移除误点调整 nbbm -" + nbbm); | ||
| 121 | + } | ||
| 122 | + } | ||
| 123 | + | ||
| 111 | /** | 124 | /** |
| 112 | * 车辆到站 | 125 | * 车辆到站 |
| 113 | * @param gps | 126 | * @param gps |
| @@ -127,10 +140,17 @@ public class LateAdjustHandle implements ApplicationContextAware{ | @@ -127,10 +140,17 @@ public class LateAdjustHandle implements ApplicationContextAware{ | ||
| 127 | /*&& sch.getLateMinute() > 0*/){ | 140 | /*&& sch.getLateMinute() > 0*/){ |
| 128 | //自动调整待发 到达时间 + 停靠时间 | 141 | //自动调整待发 到达时间 + 停靠时间 |
| 129 | long dt = Arith.addLong(gps.getTimestamp(), (sch.getLateMinute() * 60 * 1000)); | 142 | long dt = Arith.addLong(gps.getTimestamp(), (sch.getLateMinute() * 60 * 1000)); |
| 130 | - sch.setDfsjAll(dt); | ||
| 131 | - sch.setDfAuto(true); | ||
| 132 | - //取消应发未到标记 | ||
| 133 | - sch.setLate2(false); | 143 | + |
| 144 | + //超过2小时最大阈值,放弃 | ||
| 145 | + if(Math.abs(dt - sch.getDfsjT()) > 1000 * 60 * 60 * 2){ | ||
| 146 | + logger.info(sch.getClZbh() + " 超过误点调整阈值,放弃"); | ||
| 147 | + } | ||
| 148 | + else{ | ||
| 149 | + sch.setDfsjAll(dt); | ||
| 150 | + sch.setDfAuto(true); | ||
| 151 | + //取消应发未到标记 | ||
| 152 | + sch.setLate2(false); | ||
| 153 | + } | ||
| 134 | 154 | ||
| 135 | lateSchMap.remove(sch.getClZbh()); | 155 | lateSchMap.remove(sch.getClZbh()); |
| 136 | logger.info("【应发未到】车辆到站 " + sch.getClZbh() + " -" + sch.getDfsj() + " -到站时间:" + gps.getTimestamp() + " -停靠时间:" + sch.getLateMinute() + " -自动设置的待发时间:" + dt); | 156 | logger.info("【应发未到】车辆到站 " + sch.getClZbh() + " -" + sch.getDfsj() + " -到站时间:" + gps.getTimestamp() + " -停靠时间:" + sch.getLateMinute() + " -自动设置的待发时间:" + dt); |