Commit 001f71abe7141d3192b13ede75c7d29cd007ac91
1 parent
a54badcc
update...
Showing
3 changed files
with
16 additions
and
6 deletions
src/main/java/com/bsth/data/BasicData.java
| @@ -169,8 +169,6 @@ public class BasicData implements CommandLineRunner { | @@ -169,8 +169,6 @@ public class BasicData implements CommandLineRunner { | ||
| 169 | geoCacheData.loadData(); | 169 | geoCacheData.loadData(); |
| 170 | station2ParkBuffer.saveAll(); | 170 | station2ParkBuffer.saveAll(); |
| 171 | logger.info("加载基础数据成功!,"); | 171 | logger.info("加载基础数据成功!,"); |
| 172 | - //人员拼音转换 | ||
| 173 | - persionPinYinBuffer.refresh(); | ||
| 174 | } catch (Exception e) { | 172 | } catch (Exception e) { |
| 175 | logger.error("加载基础数据时出现异常,", e); | 173 | logger.error("加载基础数据时出现异常,", e); |
| 176 | } | 174 | } |
| @@ -355,6 +353,9 @@ public class BasicData implements CommandLineRunner { | @@ -355,6 +353,9 @@ public class BasicData implements CommandLineRunner { | ||
| 355 | //spyMap = spyTempMap; | 353 | //spyMap = spyTempMap; |
| 356 | allPerson = allPersonMap; | 354 | allPerson = allPersonMap; |
| 357 | perMap = perTempMap; | 355 | perMap = perTempMap; |
| 356 | + | ||
| 357 | + //人员拼音转换 | ||
| 358 | + persionPinYinBuffer.refresh(); | ||
| 358 | } | 359 | } |
| 359 | } | 360 | } |
| 360 | } | 361 | } |
src/main/java/com/bsth/data/LineConfigData.java
| @@ -64,7 +64,7 @@ public class LineConfigData implements CommandLineRunner { | @@ -64,7 +64,7 @@ public class LineConfigData implements CommandLineRunner { | ||
| 64 | */ | 64 | */ |
| 65 | public long applyOut(ScheduleRealInfo sch, Long timestamp) { | 65 | public long applyOut(ScheduleRealInfo sch, Long timestamp) { |
| 66 | LineConfig config = lineConfMap.get(sch.getXlBm()); | 66 | LineConfig config = lineConfMap.get(sch.getXlBm()); |
| 67 | - int diff = sch.getXlDir()=="0"?config.getUpOutDiff():config.getDownOutDiff(); | 67 | + int diff = sch.getXlDir().equals("0")?config.getUpOutDiff():config.getDownOutDiff(); |
| 68 | return timestamp - (diff * 1000); | 68 | return timestamp - (diff * 1000); |
| 69 | } | 69 | } |
| 70 | 70 | ||
| @@ -76,7 +76,7 @@ public class LineConfigData implements CommandLineRunner { | @@ -76,7 +76,7 @@ public class LineConfigData implements CommandLineRunner { | ||
| 76 | */ | 76 | */ |
| 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()=="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 |
src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
| @@ -2,6 +2,7 @@ package com.bsth.data.gpsdata.arrival.handlers; | @@ -2,6 +2,7 @@ package com.bsth.data.gpsdata.arrival.handlers; | ||
| 2 | 2 | ||
| 3 | import com.bsth.data.LineConfigData; | 3 | import com.bsth.data.LineConfigData; |
| 4 | import com.bsth.data.gpsdata.GpsEntity; | 4 | import com.bsth.data.gpsdata.GpsEntity; |
| 5 | +import com.bsth.data.gpsdata.arrival.GeoCacheData; | ||
| 5 | import com.bsth.data.gpsdata.arrival.SignalHandle; | 6 | import com.bsth.data.gpsdata.arrival.SignalHandle; |
| 6 | import com.bsth.data.gpsdata.arrival.utils.CircleQueue; | 7 | import com.bsth.data.gpsdata.arrival.utils.CircleQueue; |
| 7 | import com.bsth.data.gpsdata.arrival.utils.ScheduleSignalState; | 8 | import com.bsth.data.gpsdata.arrival.utils.ScheduleSignalState; |
| @@ -178,7 +179,7 @@ public class InOutStationSignalHandle extends SignalHandle{ | @@ -178,7 +179,7 @@ public class InOutStationSignalHandle extends SignalHandle{ | ||
| 178 | outStationAndOutPark(sch); | 179 | outStationAndOutPark(sch); |
| 179 | logger.info("车辆:" + sch.getClZbh() + " 班次:" + sch.getDfsj() + "发车, 时间:" + sch.getFcsjActual()); | 180 | logger.info("车辆:" + sch.getClZbh() + " 班次:" + sch.getDfsj() + "发车, 时间:" + sch.getFcsjActual()); |
| 180 | } | 181 | } |
| 181 | - else if(sch.getBcType().equals("out")){ | 182 | + else if(isOutSch(sch)){ |
| 182 | //有出场动作(起点站覆盖停车场时,并且不设置出站既出场,逻辑可能会走到这里) | 183 | //有出场动作(起点站覆盖停车场时,并且不设置出站既出场,逻辑可能会走到这里) |
| 183 | try{ | 184 | try{ |
| 184 | if(isOutPark(gps, prev)){ | 185 | if(isOutPark(gps, prev)){ |
| @@ -364,7 +365,7 @@ public class InOutStationSignalHandle extends SignalHandle{ | @@ -364,7 +365,7 @@ public class InOutStationSignalHandle extends SignalHandle{ | ||
| 364 | } | 365 | } |
| 365 | */ | 366 | */ |
| 366 | //被起点站覆盖的情况下进场,没有设置出站既是出场,逻辑会走到这里(模拟进站信号) | 367 | //被起点站覆盖的情况下进场,没有设置出站既是出场,逻辑会走到这里(模拟进站信号) |
| 367 | - if(sch.getBcType().equals("in")){ | 368 | + if(isInSch(sch)){ |
| 368 | try{ | 369 | try{ |
| 369 | if(isInPark(gps, prev)){ | 370 | if(isInPark(gps, prev)){ |
| 370 | if(gps.getCarparkNo().equals(sch.getZdzCode())){ | 371 | if(gps.getCarparkNo().equals(sch.getZdzCode())){ |
| @@ -505,4 +506,12 @@ public class InOutStationSignalHandle extends SignalHandle{ | @@ -505,4 +506,12 @@ public class InOutStationSignalHandle extends SignalHandle{ | ||
| 505 | return true; | 506 | return true; |
| 506 | return false; | 507 | return false; |
| 507 | } | 508 | } |
| 509 | + | ||
| 510 | + private boolean isOutSch(ScheduleRealInfo sch){ | ||
| 511 | + return sch.getBcType().equals("out") || GeoCacheData.tccMap.keySet().contains(sch.getQdzCode()); | ||
| 512 | + } | ||
| 513 | + | ||
| 514 | + private boolean isInSch(ScheduleRealInfo sch){ | ||
| 515 | + return sch.getBcType().equals("in") || GeoCacheData.tccMap.keySet().contains(sch.getZdzCode()); | ||
| 516 | + } | ||
| 508 | } | 517 | } |
| 509 | \ No newline at end of file | 518 | \ No newline at end of file |