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 | 175 | dayOfSchedule.save(sch); |
| 176 | 176 | |
| 177 | 177 | //清理应发未发标记 |
| 178 | - LateAdjustHandle.remove(sch); | |
| 178 | + LateAdjustHandle.remove(sch.getClZbh()); | |
| 179 | 179 | |
| 180 | 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 | 84 | Calendar calendar = Calendar.getInstance(); |
| 85 | 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 | 88 | JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_MS.getDataSource()); |
| 89 | 89 | |
| 90 | 90 | List<GpsEntity> list = | ... | ... |
src/main/java/com/bsth/data/pilot80/PilotReport.java
| ... | ... | @@ -162,6 +162,15 @@ public class PilotReport { |
| 162 | 162 | |
| 163 | 163 | LineConfig conf = lineConfigData.get(sch.getXlBm()); |
| 164 | 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 | 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 | 102 | sch.setLate2(false); |
| 103 | 103 | sch.setLateMinute(0); |
| 104 | 104 | sch.setDfAuto(false); |
| 105 | + | |
| 106 | + logger.info("移除误点调整 -" + sch.getClZbh()); | |
| 105 | 107 | } |
| 106 | 108 | }catch (Exception e){ |
| 107 | 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 | 126 | * @param gps |
| ... | ... | @@ -127,10 +140,17 @@ public class LateAdjustHandle implements ApplicationContextAware{ |
| 127 | 140 | /*&& sch.getLateMinute() > 0*/){ |
| 128 | 141 | //自动调整待发 到达时间 + 停靠时间 |
| 129 | 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 | 155 | lateSchMap.remove(sch.getClZbh()); |
| 136 | 156 | logger.info("【应发未到】车辆到站 " + sch.getClZbh() + " -" + sch.getDfsj() + " -到站时间:" + gps.getTimestamp() + " -停靠时间:" + sch.getLateMinute() + " -自动设置的待发时间:" + dt); | ... | ... |