Commit bf1ff55223d1e663ff692743159fca10473d474e
1 parent
9024e8ac
update...
Showing
4 changed files
with
14 additions
and
11 deletions
src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
| ... | ... | @@ -206,8 +206,8 @@ public class InOutStationSignalHandle extends SignalHandle{ |
| 206 | 206 | } |
| 207 | 207 | if(next != null && prev.getStopNo().equals(next.getQdzCode())){ |
| 208 | 208 | //发下一个班次 |
| 209 | - dayOfSchedule.addExecPlan(next); | |
| 210 | - outStation(gps, prev); | |
| 209 | + if(dayOfSchedule.addExecPlan(next)) | |
| 210 | + outStation(gps, prev); | |
| 211 | 211 | } |
| 212 | 212 | } |
| 213 | 213 | //当前班次是区间 |
| ... | ... | @@ -219,8 +219,8 @@ public class InOutStationSignalHandle extends SignalHandle{ |
| 219 | 219 | //是环线 |
| 220 | 220 | if(prev.getStopNo().equals(next.getQdzCode())){ |
| 221 | 221 | //发下一个班次 |
| 222 | - dayOfSchedule.addExecPlan(next); | |
| 223 | - outStation(gps, prev); | |
| 222 | + if(dayOfSchedule.addExecPlan(next)) | |
| 223 | + outStation(gps, prev); | |
| 224 | 224 | } |
| 225 | 225 | } |
| 226 | 226 | } |
| ... | ... | @@ -402,9 +402,8 @@ public class InOutStationSignalHandle extends SignalHandle{ |
| 402 | 402 | |
| 403 | 403 | if(nearSch != null){ |
| 404 | 404 | //直接跳到这个班次 |
| 405 | - dayOfSchedule.addExecPlan(nearSch); | |
| 406 | - //重新进站 | |
| 407 | - inStation(gps, prev); | |
| 405 | + if(dayOfSchedule.addExecPlan(nearSch)) | |
| 406 | + inStation(gps, prev);//重新进站 | |
| 408 | 407 | } |
| 409 | 408 | } |
| 410 | 409 | } | ... | ... |
src/main/java/com/bsth/data/gpsdata/arrival/utils/SignalSchPlanMatcher.java
| ... | ... | @@ -69,8 +69,8 @@ public class SignalSchPlanMatcher { |
| 69 | 69 | double s = (int) (next.getDfsjT() - sch.getDfsjT()); |
| 70 | 70 | double r = (int) (t - sch.getDfsjT()); |
| 71 | 71 | if(r / s > 0.7){ |
| 72 | - dayOfSchedule.addExecPlan(next); | |
| 73 | - outMatch(outSigal, next); | |
| 72 | + if(dayOfSchedule.addExecPlan(next)) | |
| 73 | + outMatch(outSigal, next); | |
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | ... | ... |
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=245";// + dayOfYear; | |
| 87 | + String sql = "select DEVICE_ID,LAT,LON,TS,SPEED_GPS,LINE_ID,SERVICE_STATE from bsth_c_gps_info where days_year=246";// + dayOfYear; | |
| 88 | 88 | JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_MS.getDataSource()); |
| 89 | 89 | |
| 90 | 90 | List<GpsEntity> list = | ... | ... |
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
| ... | ... | @@ -912,7 +912,8 @@ public class DayOfSchedule { |
| 912 | 912 | return nbbmScheduleMap.values(); |
| 913 | 913 | } |
| 914 | 914 | |
| 915 | - public void addExecPlan(ScheduleRealInfo sch) { | |
| 915 | + public boolean addExecPlan(ScheduleRealInfo sch) { | |
| 916 | + ScheduleRealInfo oldExec = executeCurr(sch.getClZbh()); | |
| 916 | 917 | if (sch != null){ |
| 917 | 918 | if(sch.getStatus()==2) |
| 918 | 919 | reCalcExecPlan(sch.getClZbh()); |
| ... | ... | @@ -921,6 +922,8 @@ public class DayOfSchedule { |
| 921 | 922 | } |
| 922 | 923 | else |
| 923 | 924 | carExecutePlanMap.remove(sch.getClZbh()); |
| 925 | + | |
| 926 | + return executeCurr(sch.getClZbh()) != oldExec; | |
| 924 | 927 | } |
| 925 | 928 | |
| 926 | 929 | public void removeExecPlan(String clzbh) { |
| ... | ... | @@ -977,6 +980,7 @@ public class DayOfSchedule { |
| 977 | 980 | } |
| 978 | 981 | |
| 979 | 982 | public void reCalcExecPlan(String nbbm) { |
| 983 | + logger.info("reCalcExecPlan...: " + nbbm); | |
| 980 | 984 | List<ScheduleRealInfo> list = nbbmScheduleMap.get(nbbm); |
| 981 | 985 | Collections.sort(list, schFCSJComparator); |
| 982 | 986 | ... | ... |