Commit 60e8d247975c4e87058b25762e74247f096e6a28

Authored by 潘钊
1 parent 48436fa4

update...

src/main/java/com/bsth/data/LineConfigData.java
@@ -77,7 +77,7 @@ public class LineConfigData implements CommandLineRunner { @@ -77,7 +77,7 @@ public class LineConfigData implements CommandLineRunner {
77 public long applyIn(ScheduleRealInfo sch, Long timestamp){ 77 public long applyIn(ScheduleRealInfo sch, Long timestamp){
78 LineConfig config = lineConfMap.get(sch.getXlBm()); 78 LineConfig config = lineConfMap.get(sch.getXlBm());
79 int diff = sch.getXlDir().equals("0")?config.getUpInDiff():config.getDownInDiff(); 79 int diff = sch.getXlDir().equals("0")?config.getUpInDiff():config.getDownInDiff();
80 - return timestamp - (diff * 1000); 80 + return timestamp + (diff * 1000);
81 } 81 }
82 82
83 @Component 83 @Component
src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
@@ -239,9 +239,14 @@ public class InOutStationSignalHandle extends SignalHandle{ @@ -239,9 +239,14 @@ public class InOutStationSignalHandle extends SignalHandle{
239 long t2 = gps.getTimestamp(); 239 long t2 = gps.getTimestamp();
240 long c = sch.getDfsjT(); 240 long c = sch.getDfsjT();
241 241
242 - if(c - t1 > 1000 * 60 * 15 && Math.abs(t2 - c) < 1000 * 60 * 5){ 242 + /*if(c - t1 > 1000 * 60 * 15 && Math.abs(t2 - c) < 1000 * 60 * 5){
  243 + return true;
  244 + }*/
  245 + int threshold = 1000 * 60 * 5;
  246 + if(Math.abs(t2 - c) < threshold && c - t1 > threshold){
243 return true; 247 return true;
244 } 248 }
  249 + //if(Math.abs(t2 - c) < 1000 * 60 * 5 && c - t1 > 1000 * 60 * 5)
245 return false; 250 return false;
246 } 251 }
247 252
@@ -255,7 +260,7 @@ public class InOutStationSignalHandle extends SignalHandle{ @@ -255,7 +260,7 @@ public class InOutStationSignalHandle extends SignalHandle{
255 if (config != null && config.getOutConfig() == 2) { 260 if (config != null && config.getOutConfig() == 2) {
256 //出站既出场 261 //出站既出场
257 ScheduleRealInfo schPrev = dayOfSchedule.prev(sch); 262 ScheduleRealInfo schPrev = dayOfSchedule.prev(sch);
258 - if (schPrev != null && schPrev.getBcType().equals("out") 263 + if (schPrev != null && schPrev.getBcType().equals("out") && (schPrev.getBcsj()==0 || schPrev.getJhlcOrig().equals(0))
259 && (!limitPark || park.equals(schPrev.getQdzCode()))) { 264 && (!limitPark || park.equals(schPrev.getQdzCode()))) {
260 265
261 schPrev.setFcsjActualAll(sch.getFcsjActualTime()); 266 schPrev.setFcsjActualAll(sch.getFcsjActualTime());
@@ -447,7 +452,7 @@ public class InOutStationSignalHandle extends SignalHandle{ @@ -447,7 +452,7 @@ public class InOutStationSignalHandle extends SignalHandle{
447 boolean limitPark = StringUtils.isNotEmpty(park); 452 boolean limitPark = StringUtils.isNotEmpty(park);
448 453
449 454
450 - if (next.getBcType().equals("in") && config.getOutConfig() == 2 455 + if (next.getBcType().equals("in") && config.getOutConfig() == 2 && (next.getBcsj()==0 || next.getJhlcOrig().equals(0))
451 && (!limitPark || park.equals(next.getZdzCode()))) { 456 && (!limitPark || park.equals(next.getZdzCode()))) {
452 457
453 next.setFcsjActualAll(sch.getZdsjActualTime()); 458 next.setFcsjActualAll(sch.getZdsjActualTime());
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("W9H-088")) 63 + /*if(nbbm.equals("W09-164"))
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=207";// + dayOfYear; 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;
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() >= 1500942270000L){ 156 + /*if(gps.getTimestamp() >= 1503960000000L){
157 System.out.println("debugger..."); 157 System.out.println("debugger...");
158 }*/ 158 }*/
159 //是否有任务 159 //是否有任务
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
@@ -573,7 +573,7 @@ public class DayOfSchedule { @@ -573,7 +573,7 @@ public class DayOfSchedule {
573 continue; 573 continue;
574 574
575 //出站既出场,忽略出场班次 575 //出站既出场,忽略出场班次
576 - if (outConfig == 2 && temp.getBcType().equals("out") 576 + if (outConfig == 2 && temp.getBcType().equals("out") && (temp.getBcsj()==0 || temp.getJhlcOrig().equals(0))
577 && (!limitPark || park.equals(temp.getQdzCode()))) 577 && (!limitPark || park.equals(temp.getQdzCode())))
578 continue; 578 continue;
579 579
src/main/java/com/bsth/data/schedule/ScheduleComparator.java
@@ -3,6 +3,8 @@ package com.bsth.data.schedule; @@ -3,6 +3,8 @@ package com.bsth.data.schedule;
3 import com.bsth.entity.realcontrol.ScheduleRealInfo; 3 import com.bsth.entity.realcontrol.ScheduleRealInfo;
4 4
5 import java.util.Comparator; 5 import java.util.Comparator;
  6 +import java.util.HashMap;
  7 +import java.util.Map;
6 8
7 /** 9 /**
8 * 10 *
@@ -20,20 +22,38 @@ public class ScheduleComparator { @@ -20,20 +22,38 @@ public class ScheduleComparator {
20 return s1.getFcno() - s2.getFcno(); 22 return s1.getFcno() - s2.getFcno();
21 } 23 }
22 }*/ 24 }*/
  25 +
  26 + static Map<String, Integer> bcTypeOrderMap = new HashMap<>();
  27 +
  28 + static{
  29 + bcTypeOrderMap.put("out", 0);
  30 + bcTypeOrderMap.put("normal", 1);
  31 + bcTypeOrderMap.put("region", 2);
  32 + bcTypeOrderMap.put("major", 3);
  33 + bcTypeOrderMap.put("venting", 4);
  34 + bcTypeOrderMap.put("ldks", 5);
  35 + bcTypeOrderMap.put("in", 6);
  36 + }
23 37
24 public static class FCSJ implements Comparator<ScheduleRealInfo>{ 38 public static class FCSJ implements Comparator<ScheduleRealInfo>{
25 39
26 @Override 40 @Override
27 public int compare(ScheduleRealInfo s1, ScheduleRealInfo s2) { 41 public int compare(ScheduleRealInfo s1, ScheduleRealInfo s2) {
28 - return (int) (s1.getFcsjT() - s2.getFcsjT()); 42 + int diff = (int) (s1.getFcsjT() - s2.getFcsjT());
  43 + return diff!=0?diff:typeOrder(s1.getBcType()) - typeOrder(s2.getBcType());
29 } 44 }
30 } 45 }
31 46
  47 + private static int typeOrder(String bcType){
  48 + return bcTypeOrderMap.get(bcType)!=null?bcTypeOrderMap.get(bcType):0;
  49 + }
  50 +
32 public static class DFSJ implements Comparator<ScheduleRealInfo>{ 51 public static class DFSJ implements Comparator<ScheduleRealInfo>{
33 52
34 @Override 53 @Override
35 public int compare(ScheduleRealInfo s1, ScheduleRealInfo s2) { 54 public int compare(ScheduleRealInfo s1, ScheduleRealInfo s2) {
36 - return (int) (s1.getDfsjT() - s2.getDfsjT()); 55 + int diff = (int) (s1.getDfsjT() - s2.getDfsjT());
  56 + return diff!=0?diff:typeOrder(s1.getBcType()) - typeOrder(s2.getBcType());
37 } 57 }
38 } 58 }
39 } 59 }
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
@@ -7,10 +7,26 @@ var gb_schedule_table = (function () { @@ -7,10 +7,26 @@ var gb_schedule_table = (function () {
7 var line2Schedule = {}; 7 var line2Schedule = {};
8 //车辆应发未发车辆数 8 //车辆应发未发车辆数
9 var car_yfwf_map = {}; 9 var car_yfwf_map = {};
  10 +
  11 + var bcTypeOrderMap = {
  12 + 'out':0,
  13 + 'normal':1,
  14 + 'region':2,
  15 + 'major':3,
  16 + 'venting':4,
  17 + 'ldks':5,
  18 + 'in':6
  19 + };
  20 + var typeOrder = function (type) {
  21 + return bcTypeOrderMap[type]?bcTypeOrderMap[type]:0;
  22 + };
10 var schedule_sort = function (s1, s2) { 23 var schedule_sort = function (s1, s2) {
11 - return s1.fcsjT - s2.fcsjT; 24 + var diff = s1['fcsjT'] - s2['fcsjT'];
  25 + return diff!=0?diff:typeOrder(s1['bcType'])-typeOrder(s2['bcType']);
12 }; 26 };
13 27
  28 +
  29 +
14 /** 30 /**
15 * 检查是否存在重复班次 31 * 检查是否存在重复班次
16 * @param list 32 * @param list
@@ -118,17 +134,27 @@ var gb_schedule_table = (function () { @@ -118,17 +134,27 @@ var gb_schedule_table = (function () {
118 134
119 //计算实发时间差值 135 //计算实发时间差值
120 var calc_sch_real_shift = function (sch) { 136 var calc_sch_real_shift = function (sch) {
121 - if (sch.fcsjActualTime) {  
122 - var diff = parseInt((sch.fcsjActualTime - sch.dfsjT) / 1000 / 60);  
123 - if (diff > 0)  
124 - sch.fcsj_diff = '( +' + diff + ' )';  
125 - else if (diff < 0)  
126 - sch.fcsj_diff = '( ' + diff + ' )'; 137 + if (sch['fcsjActualTime']){
  138 + var diff = sch['fcsjActualTime'] - sch['dfsjT'], fcsj_diff;
  139 + fcsj_diff = parseInt(diff / 60000);
  140 + if(diff % 60000 != 0){
  141 + /*if(fcsj_diff > 0)
  142 + fcsj_diff ++;
  143 + else */if(fcsj_diff < 0)
  144 + fcsj_diff --;
  145 + }
  146 +
  147 + if(fcsj_diff > 0)
  148 + sch.fcsj_diff = '( +' + fcsj_diff + ' )';
  149 + else if (fcsj_diff < 0)
  150 + sch.fcsj_diff = '( ' + fcsj_diff + ' )';
127 else 151 else
128 sch.fcsj_diff = ''; 152 sch.fcsj_diff = '';
129 } 153 }
130 }; 154 };
131 155
  156 +
  157 +
132 function arrayIsNull(array) { 158 function arrayIsNull(array) {
133 return !array || array.length == 0; 159 return !array || array.length == 0;
134 } 160 }