Commit fdcc0fc01855727410b8e90efa53134b799b8105
1 parent
d06bd98b
update...
Showing
2 changed files
with
13 additions
and
2 deletions
src/main/java/com/bsth/client/GpsBeforeBuffer.java
| @@ -22,7 +22,7 @@ import java.util.concurrent.*; | @@ -22,7 +22,7 @@ import java.util.concurrent.*; | ||
| 22 | public class GpsBeforeBuffer implements CommandLineRunner{ | 22 | public class GpsBeforeBuffer implements CommandLineRunner{ |
| 23 | 23 | ||
| 24 | static ConcurrentLinkedQueue<GpsEntity> linkedList = new ConcurrentLinkedQueue(); | 24 | static ConcurrentLinkedQueue<GpsEntity> linkedList = new ConcurrentLinkedQueue(); |
| 25 | - static final int MAX_SIZE = 4000 * 20; | 25 | + static final int MAX_SIZE = 4000 * 12; |
| 26 | static int size = 0; | 26 | static int size = 0; |
| 27 | 27 | ||
| 28 | public void put(GpsEntity gps){ | 28 | public void put(GpsEntity gps){ |
src/main/java/com/bsth/entity/GpsEntity.java
| @@ -75,6 +75,9 @@ public class GpsEntity { | @@ -75,6 +75,9 @@ public class GpsEntity { | ||
| 75 | */ | 75 | */ |
| 76 | private int source; | 76 | private int source; |
| 77 | 77 | ||
| 78 | + /** 网关收到时间 */ | ||
| 79 | + private Long serverTimestamp; | ||
| 80 | + | ||
| 78 | public static GpsEntity getInstance(BasicInfo basicInfo, int version, int source){ | 81 | public static GpsEntity getInstance(BasicInfo basicInfo, int version, int source){ |
| 79 | //放弃补发数据 | 82 | //放弃补发数据 |
| 80 | byte cacheData = getCacheState(basicInfo.getServiceState()); | 83 | byte cacheData = getCacheState(basicInfo.getServiceState()); |
| @@ -96,7 +99,7 @@ public class GpsEntity { | @@ -96,7 +99,7 @@ public class GpsEntity { | ||
| 96 | gps.setState((int) getService(basicInfo.getServiceState())); | 99 | gps.setState((int) getService(basicInfo.getServiceState())); |
| 97 | gps.setVersion(version); | 100 | gps.setVersion(version); |
| 98 | gps.setSource(source); | 101 | gps.setSource(source); |
| 99 | - | 102 | + gps.setServerTimestamp(System.currentTimeMillis()); |
| 100 | return gps; | 103 | return gps; |
| 101 | } | 104 | } |
| 102 | /* public GpsEntity(BasicInfo basicInfo, int version, int source) { | 105 | /* public GpsEntity(BasicInfo basicInfo, int version, int source) { |
| @@ -242,4 +245,12 @@ public class GpsEntity { | @@ -242,4 +245,12 @@ public class GpsEntity { | ||
| 242 | public void setSource(int source) { | 245 | public void setSource(int source) { |
| 243 | this.source = source; | 246 | this.source = source; |
| 244 | } | 247 | } |
| 248 | + | ||
| 249 | + public Long getServerTimestamp() { | ||
| 250 | + return serverTimestamp; | ||
| 251 | + } | ||
| 252 | + | ||
| 253 | + public void setServerTimestamp(Long serverTimestamp) { | ||
| 254 | + this.serverTimestamp = serverTimestamp; | ||
| 255 | + } | ||
| 245 | } | 256 | } |