Commit 28c7a87db77ae1184569b21d48eaa981a0283fbe
1 parent
afed5209
update...
Showing
4 changed files
with
40 additions
and
13 deletions
src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
| @@ -260,7 +260,7 @@ public class InOutStationSignalHandle extends SignalHandle{ | @@ -260,7 +260,7 @@ public class InOutStationSignalHandle extends SignalHandle{ | ||
| 260 | if (config != null && config.getOutConfig() == 2) { | 260 | if (config != null && config.getOutConfig() == 2) { |
| 261 | //出站既出场 | 261 | //出站既出场 |
| 262 | ScheduleRealInfo schPrev = dayOfSchedule.prev(sch); | 262 | ScheduleRealInfo schPrev = dayOfSchedule.prev(sch); |
| 263 | - if (schPrev != null && schPrev.getBcType().equals("out") && (schPrev.getBcsj()==0 || schPrev.getJhlcOrig().equals(0)) | 263 | + if (schPrev != null && schPrev.getBcType().equals("out") && (schPrev.getBcsj()==0 || schPrev.getJhlcOrig().intValue()==0) |
| 264 | && (!limitPark || park.equals(schPrev.getQdzCode()))) { | 264 | && (!limitPark || park.equals(schPrev.getQdzCode()))) { |
| 265 | 265 | ||
| 266 | schPrev.setFcsjActualAll(sch.getFcsjActualTime()); | 266 | schPrev.setFcsjActualAll(sch.getFcsjActualTime()); |
| @@ -429,7 +429,7 @@ public class InOutStationSignalHandle extends SignalHandle{ | @@ -429,7 +429,7 @@ public class InOutStationSignalHandle extends SignalHandle{ | ||
| 429 | String stopId = gps.getStopNo(); | 429 | String stopId = gps.getStopNo(); |
| 430 | for(int i = 0; i < halfList.size(); i ++){ | 430 | for(int i = 0; i < halfList.size(); i ++){ |
| 431 | sch = halfList.get(i); | 431 | sch = halfList.get(i); |
| 432 | - if(!sch.getZdzCode().equals(stopId)) | 432 | + if(!sch.getZdzCode().equals(stopId) || sch.getStatus()==2) |
| 433 | continue; | 433 | continue; |
| 434 | 434 | ||
| 435 | if(sch.getZdsjT() < gps.getTimestamp()) | 435 | if(sch.getZdsjT() < gps.getTimestamp()) |
src/main/java/com/bsth/data/gpsdata/recovery/GpsDataRecovery.java
| @@ -60,7 +60,7 @@ public class GpsDataRecovery implements ApplicationContextAware { | @@ -60,7 +60,7 @@ public class GpsDataRecovery implements ApplicationContextAware { | ||
| 60 | for (String nbbm : keys) { | 60 | for (String nbbm : keys) { |
| 61 | Collections.sort(listMap.get(nbbm), comp); | 61 | Collections.sort(listMap.get(nbbm), comp); |
| 62 | threadPool.execute(new RecoveryThread(listMap.get(nbbm), count)); | 62 | threadPool.execute(new RecoveryThread(listMap.get(nbbm), count)); |
| 63 | - /*if(nbbm.equals("W09-164")) | 63 | + /*if(nbbm.equals("S0K-004")) |
| 64 | new RecoveryThread(listMap.get(nbbm), count).run();*/ | 64 | new RecoveryThread(listMap.get(nbbm), count).run();*/ |
| 65 | /*if(lineId.equals("60028")) | 65 | /*if(lineId.equals("60028")) |
| 66 | new RecoveryThread(listMap.get(lineId), count).run();*/ | 66 | new RecoveryThread(listMap.get(lineId), count).run();*/ |
| @@ -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=241";// + dayOfYear; | 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; |
| 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 = |
| @@ -153,7 +153,7 @@ public class GpsDataRecovery implements ApplicationContextAware { | @@ -153,7 +153,7 @@ public class GpsDataRecovery implements ApplicationContextAware { | ||
| 153 | boolean task; | 153 | boolean task; |
| 154 | for (GpsEntity gps : list) { | 154 | for (GpsEntity gps : list) { |
| 155 | try { | 155 | try { |
| 156 | - /*if(gps.getTimestamp() >= 1503960000000L){ | 156 | + /*if(gps.getTimestamp() >= 1504298280000L){ |
| 157 | System.out.println("debugger..."); | 157 | System.out.println("debugger..."); |
| 158 | }*/ | 158 | }*/ |
| 159 | //是否有任务 | 159 | //是否有任务 |
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
| @@ -592,7 +592,7 @@ public class DayOfSchedule { | @@ -592,7 +592,7 @@ public class DayOfSchedule { | ||
| 592 | * @param sch 当前班次 | 592 | * @param sch 当前班次 |
| 593 | * @return | 593 | * @return |
| 594 | */ | 594 | */ |
| 595 | - private ScheduleRealInfo next2(Collection<ScheduleRealInfo> list, ScheduleRealInfo sch) { | 595 | + private ScheduleRealInfo next2_lp(Collection<ScheduleRealInfo> list, ScheduleRealInfo sch) { |
| 596 | int outConfig = -1; | 596 | int outConfig = -1; |
| 597 | LineConfig config = lineConfigData.get(sch.getXlBm()); | 597 | LineConfig config = lineConfigData.get(sch.getXlBm()); |
| 598 | if (config != null) | 598 | if (config != null) |
| @@ -605,8 +605,35 @@ public class DayOfSchedule { | @@ -605,8 +605,35 @@ public class DayOfSchedule { | ||
| 605 | flag = true; | 605 | flag = true; |
| 606 | continue; | 606 | continue; |
| 607 | } | 607 | } |
| 608 | - //忽略烂班 | ||
| 609 | - if (temp.isDestroy()) | 608 | + |
| 609 | + if (flag) { | ||
| 610 | + next = temp; | ||
| 611 | + break; | ||
| 612 | + } | ||
| 613 | + } | ||
| 614 | + return next; | ||
| 615 | + } | ||
| 616 | + | ||
| 617 | + private ScheduleRealInfo next3_lp(Collection<ScheduleRealInfo> list, ScheduleRealInfo sch) { | ||
| 618 | + int outConfig = -1; | ||
| 619 | + LineConfig config = lineConfigData.get(sch.getXlBm()); | ||
| 620 | + if (config != null) | ||
| 621 | + outConfig = config.getOutConfig(); | ||
| 622 | + | ||
| 623 | + //限定出站既出场的停车场 | ||
| 624 | + String park = config.getTwinsPark(); | ||
| 625 | + boolean limitPark = StringUtils.isNotEmpty(park); | ||
| 626 | + boolean flag = false; | ||
| 627 | + ScheduleRealInfo next = null; | ||
| 628 | + for (ScheduleRealInfo temp : list) { | ||
| 629 | + if (temp.getId() == sch.getId()) { | ||
| 630 | + flag = true; | ||
| 631 | + continue; | ||
| 632 | + } | ||
| 633 | + | ||
| 634 | + //出站既出场,忽略出场班次 | ||
| 635 | + if (outConfig == 2 && temp.getBcType().equals("out") && (temp.getBcsj()==0 || temp.getJhlcOrig().equals(0)) | ||
| 636 | + && (!limitPark || park.equals(temp.getQdzCode()))) | ||
| 610 | continue; | 637 | continue; |
| 611 | 638 | ||
| 612 | if (flag) { | 639 | if (flag) { |
| @@ -1121,7 +1148,7 @@ public class DayOfSchedule { | @@ -1121,7 +1148,7 @@ public class DayOfSchedule { | ||
| 1121 | public ScheduleRealInfo nextByLp(ScheduleRealInfo sch) { | 1148 | public ScheduleRealInfo nextByLp(ScheduleRealInfo sch) { |
| 1122 | List<ScheduleRealInfo> list = lpScheduleMap.get(sch.getXlBm() + "_" + sch.getLpName()); | 1149 | List<ScheduleRealInfo> list = lpScheduleMap.get(sch.getXlBm() + "_" + sch.getLpName()); |
| 1123 | Collections.sort(list, schFCSJComparator); | 1150 | Collections.sort(list, schFCSJComparator); |
| 1124 | - return next(list, sch); | 1151 | + return next3_lp(list, sch); |
| 1125 | } | 1152 | } |
| 1126 | 1153 | ||
| 1127 | /** | 1154 | /** |
| @@ -1133,7 +1160,7 @@ public class DayOfSchedule { | @@ -1133,7 +1160,7 @@ public class DayOfSchedule { | ||
| 1133 | public ScheduleRealInfo nextByLp2(ScheduleRealInfo sch) { | 1160 | public ScheduleRealInfo nextByLp2(ScheduleRealInfo sch) { |
| 1134 | List<ScheduleRealInfo> list = lpScheduleMap.get(sch.getXlBm() + "_" + sch.getLpName()); | 1161 | List<ScheduleRealInfo> list = lpScheduleMap.get(sch.getXlBm() + "_" + sch.getLpName()); |
| 1135 | Collections.sort(list, schFCSJComparator); | 1162 | Collections.sort(list, schFCSJComparator); |
| 1136 | - return next2(list, sch); | 1163 | + return next2_lp(list, sch); |
| 1137 | } | 1164 | } |
| 1138 | 1165 | ||
| 1139 | public ArrayListMultimap<String, ScheduleRealInfo> getLpScheduleMap() { | 1166 | public ArrayListMultimap<String, ScheduleRealInfo> getLpScheduleMap() { |
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
| @@ -223,7 +223,7 @@ public class ScheduleRealInfo { | @@ -223,7 +223,7 @@ public class ScheduleRealInfo { | ||
| 223 | * 2:到站漂移 | 223 | * 2:到站漂移 |
| 224 | * 3:中途漂移 | 224 | * 3:中途漂移 |
| 225 | */ | 225 | */ |
| 226 | - private int driftStatus = 0; | 226 | + private Integer driftStatus = 0; |
| 227 | 227 | ||
| 228 | public boolean isDfAuto() { | 228 | public boolean isDfAuto() { |
| 229 | return dfAuto; | 229 | return dfAuto; |
| @@ -942,11 +942,11 @@ public class ScheduleRealInfo { | @@ -942,11 +942,11 @@ public class ScheduleRealInfo { | ||
| 942 | this.siginCompate = siginCompate; | 942 | this.siginCompate = siginCompate; |
| 943 | } | 943 | } |
| 944 | 944 | ||
| 945 | - public int getDriftStatus() { | 945 | + public Integer getDriftStatus() { |
| 946 | return driftStatus; | 946 | return driftStatus; |
| 947 | } | 947 | } |
| 948 | 948 | ||
| 949 | - public void setDriftStatus(int driftStatus) { | 949 | + public void setDriftStatus(Integer driftStatus) { |
| 950 | this.driftStatus = driftStatus; | 950 | this.driftStatus = driftStatus; |
| 951 | } | 951 | } |
| 952 | } | 952 | } |