Commit 94ff0ce86aa963cef4582572078c34d71f328eb8

Authored by 潘钊
1 parent a2ddae30

update

src/main/java/com/bsth/data/gpsdata/GpsRealData.java
... ... @@ -74,17 +74,19 @@ public class GpsRealData implements CommandLineRunner{
74 74 public GpsEntity add(GpsEntity gps) {
75 75 String device = gps.getDeviceId();
76 76 GpsEntity old = gpsMap.get(device);
77   -
78   - //定时定距数据附带站点编码改变
79   - if(null == old || !old.getStopNo().equals(gps.getStopNo())){
80   - gps.setArrTime(gps.getTimestamp());
81   - //预测到达终点时间
82   - forecastRealServer.forecast(gps.getNbbm(), gps);
83   - }
84   - else{
85   - gps.setArrTime(old.getArrTime());
86   - //不预测, 重新计算终点时间
87   - gps.setExpectStopTime(forecastRealServer.expectStopTime(gps.getNbbm()));
  77 +
  78 + if(!StringUtils.isEmpty(gps.getStopNo())){
  79 + //定时定距数据附带站点编码改变
  80 + if(null == old || !gps.getStopNo().equals(old.getStopNo())){
  81 + gps.setArrTime(gps.getTimestamp());
  82 + //预测到达终点时间
  83 + forecastRealServer.forecast(gps.getNbbm(), gps);
  84 + }
  85 + else{
  86 + gps.setArrTime(old.getArrTime());
  87 + //不预测, 重新计算终点时间
  88 + gps.setExpectStopTime(forecastRealServer.expectStopTime(gps.getNbbm()));
  89 + }
88 90 }
89 91  
90 92 gpsMap.put(device, gps);
... ...