Browse Source

[refactor]#北斗-天奥

chenfangchao 2 years ago
parent
commit
a9619634de

+ 14 - 12
es-track-common/src/main/java/cn/com/taiji/entity/TianaoNewRadar.java

@@ -14,23 +14,25 @@ import java.io.Serializable;
 @Data
 public class TianaoNewRadar implements Serializable {
     private static final long serialVersionUID = -8434894021166439952L;
-    private String id;
-    private String shipId;
-    private String fusionTime;
-    private Double latitude;
-    private String shiptracktime;
-    private String shipName;
     private String fusionBatchNum;
+    private Double longitude;
+    private Double latitude;
     private Double altitude;
     private Double course;
-    private Double longitude;
-    private Integer radarCode;
-    private String receiveTime;
-    private String reliability;
     private Double speed;
     private Double targetSize;
+    private Double targetProper;
+    private String reliability;
     private String traceState;
+    private String fusionTime;
+    private Integer radarCode;
+    private String radarBatchNum;
     private String collectTime;
-    private String shipTrack;
-    private Double targetProper;
+
+    private String trackId;
+    private String receiveTime;
+
+
+
+
 }

+ 57 - 51
simulation-track/src/main/java/cn/com/taiji/service/impl/SimulationTrackImpl.java

@@ -253,7 +253,7 @@ public class SimulationTrackImpl implements SimulationTrackService {
                             beidouShipTrackDTO.setLatitude(location.getLat());
                             String data = JSONUtil.toJsonStr(beidouShipTrackDTO);
                             try {
-                                Thread.sleep(1000);
+                                Thread.sleep(2500);
                                 kafkaTemplate.send(TopicConstants.BEIDOU_TOPIC, data);
                                 log.info(DateUtil.now() + "模拟北斗船舶:20236688测试船舶,终端号为20236688完成");
                             } catch (InterruptedException e) {
@@ -280,7 +280,7 @@ public class SimulationTrackImpl implements SimulationTrackService {
                             hlxOneLevelTrack.setVesselName("20236688测试船舶");
                             String data = JSONUtil.toJsonStr(hlxOneLevelTrack);
                             try {
-                                Thread.sleep(1000);
+                                Thread.sleep(2500);
                                 kafkaTemplate.send(TopicConstants.HLX_ONE_LEVEL, data);
                                 log.info(DateUtil.now() + "模拟海兰信一级融合船舶:20236688测试船舶,终端号为20236666完成");
                             } catch (InterruptedException e) {
@@ -318,37 +318,38 @@ public class SimulationTrackImpl implements SimulationTrackService {
                         List<Location> list1 = LocationUtils.generateLogLatTianao("2023-02-19 14:00:00", "2023-02-19 14:30:00", 109.09300314810106, 19.671012727042697, 109.09690281197237, 19.669125831751618);
                         for (Location location : list1) {
                             TianaoNewRadar tianaoRadar = new TianaoNewRadar();
-                            tianaoRadar.setId("202302191");
-                            tianaoRadar.setShipId("202302191");
-                            tianaoRadar.setFusionTime(DateUtil.now());
-                            tianaoRadar.setShiptracktime(DateUtil.now());
-                            tianaoRadar.setShipName("天奥模拟船舶1");
-                            tianaoRadar.setFusionBatchNum("202302191");
-                            tianaoRadar.setAltitude(15D);
+                            tianaoRadar.setTrackId("202302191");
+                            tianaoRadar.setAltitude(10.6D);
+                            tianaoRadar.setCollectTime(DateUtil.now());
                             tianaoRadar.setCourse(180D);
+                            tianaoRadar.setFusionBatchNum("202302191");
+                            tianaoRadar.setFusionTime(DateUtil.now());
+                            tianaoRadar.setRadarBatchNum("202302191");
                             tianaoRadar.setRadarCode(202302191);
                             tianaoRadar.setReceiveTime(DateUtil.now());
-                            tianaoRadar.setReliability("0.9");
-                            tianaoRadar.setSpeed(18D);
-                            tianaoRadar.setTargetSize(10D);
-                            tianaoRadar.setTraceState("T");
-                            tianaoRadar.setCollectTime(DateUtil.now());
-                            tianaoRadar.setShipTrack("202302191");
-                            tianaoRadar.setTargetProper(1D);
-
+                            tianaoRadar.setReliability("100.0");
+                            tianaoRadar.setSpeed(18.8D);
+                            tianaoRadar.setTargetProper(0D);
+                            tianaoRadar.setTargetSize(10.0D);
+                            tianaoRadar.setTraceState("84");
                             tianaoRadar.setLatitude(location.getLat());
                             tianaoRadar.setLongitude(location.getLog());
 
                             String data = JSONUtil.toJsonStr(tianaoRadar);
-                            try {
-                                if(0 == tianaoType){
-                                    Thread.sleep(1000);
+
+                            if(0 == tianaoType){
+                                try {
+                                    Thread.sleep(2500);
+                                    kafkaTemplate.send(TopicConstants.TIANAO_TOPIC, data);
+                                    log.info(DateUtil.now() + "模拟天奥船舶:天奥模拟船舶1,FusionBatchNum为202302191完成");
+                                } catch (InterruptedException e) {
+                                    Thread.currentThread().interrupt();
+                                    e.printStackTrace();
                                 }
+                            }
+                            if(1 == tianaoType){
                                 kafkaTemplate.send(TopicConstants.TIANAO_TOPIC, data);
                                 log.info(DateUtil.now() + "模拟天奥船舶:天奥模拟船舶1,FusionBatchNum为202302191完成");
-                            } catch (InterruptedException e) {
-                                Thread.currentThread().interrupt();
-                                e.printStackTrace();
                             }
                         }
                     }
@@ -364,38 +365,38 @@ public class SimulationTrackImpl implements SimulationTrackService {
                         List<Location> list2 = LocationUtils.generateLogLatTianao("2023-02-19 14:00:00", "2023-02-19 14:30:00", 109.0929925146248, 19.67097869991864, 109.0968340253979, 19.66891947202822);
                         for (Location location : list2) {
                             TianaoNewRadar tianaoRadar = new TianaoNewRadar();
-                            tianaoRadar.setId("202302192");
-                            tianaoRadar.setShipId("202302192");
-                            tianaoRadar.setAltitude(15D);
-                            tianaoRadar.setFusionTime(DateUtil.now());
-                            tianaoRadar.setShiptracktime(DateUtil.now());
-                            tianaoRadar.setShipName("天奥模拟船舶2");
-                            tianaoRadar.setFusionBatchNum("202302192");
+                            tianaoRadar.setTrackId("202302192");
+                            tianaoRadar.setAltitude(10.6D);
+                            tianaoRadar.setCollectTime(DateUtil.now());
                             tianaoRadar.setCourse(180D);
+                            tianaoRadar.setFusionBatchNum("202302192");
+                            tianaoRadar.setFusionTime(DateUtil.now());
+                            tianaoRadar.setRadarBatchNum("202302192");
                             tianaoRadar.setRadarCode(202302192);
                             tianaoRadar.setReceiveTime(DateUtil.now());
-                            tianaoRadar.setReliability("0.9");
-                            tianaoRadar.setSpeed(18D);
-                            tianaoRadar.setTargetSize(10D);
-                            tianaoRadar.setTraceState("T");
-                            tianaoRadar.setCollectTime(DateUtil.now());
-                            tianaoRadar.setShipTrack("202302192");
-                            tianaoRadar.setTargetProper(0.9D);
-
+                            tianaoRadar.setReliability("100.0");
+                            tianaoRadar.setSpeed(18.8D);
+                            tianaoRadar.setTargetProper(0D);
+                            tianaoRadar.setTargetSize(10.0D);
+                            tianaoRadar.setTraceState("84");
                             tianaoRadar.setLatitude(location.getLat());
                             tianaoRadar.setLongitude(location.getLog());
-
                             String data = JSONUtil.toJsonStr(tianaoRadar);
-                            try {
-                                if(0 == tianaoType){
-                                    Thread.sleep(1000);
+                            if(0 == tianaoType){
+                                try {
+                                    Thread.sleep(2500);
+                                    kafkaTemplate.send(TopicConstants.TIANAO_TOPIC, data);
+                                    log.info(DateUtil.now() + "模拟天奥船舶:天奥模拟船舶2,FusionBatchNum为202302192完成");
+                                } catch (InterruptedException e) {
+                                    Thread.currentThread().interrupt();
+                                    e.printStackTrace();
                                 }
+                            }
+                            if(1 == tianaoType){
                                 kafkaTemplate.send(TopicConstants.TIANAO_TOPIC, data);
                                 log.info(DateUtil.now() + "模拟天奥船舶:天奥模拟船舶2,FusionBatchNum为202302192完成");
-                            } catch (InterruptedException e) {
-                                Thread.currentThread().interrupt();
-                                e.printStackTrace();
                             }
+
                         }
                     }
                 }
@@ -440,16 +441,21 @@ public class SimulationTrackImpl implements SimulationTrackService {
                             beidouShipTrackDTO.setLongitude(location.getLog());
                             beidouShipTrackDTO.setLatitude(location.getLat());
                             String data = JSONUtil.toJsonStr(beidouShipTrackDTO);
-                            try {
-                                if(0 == beidouType){
-                                    Thread.sleep(1000);
+                            if(0 == beidouType){
+                                try {
+                                    Thread.sleep(1000 * 60);
+                                    kafkaTemplate.send(TopicConstants.BEIDOU_TOPIC, data);
+                                    log.info(DateUtil.now() + "模拟北斗船舶:202302193测试船舶,终端号为202302193完成");
+                                } catch (InterruptedException e) {
+                                    Thread.currentThread().interrupt();
+                                    e.printStackTrace();
                                 }
+                            }
+                            if(1 == beidouType){
                                 kafkaTemplate.send(TopicConstants.BEIDOU_TOPIC, data);
                                 log.info(DateUtil.now() + "模拟北斗船舶:202302193测试船舶,终端号为202302193完成");
-                            } catch (InterruptedException e) {
-                                Thread.currentThread().interrupt();
-                                e.printStackTrace();
                             }
+
                         }
                     }
                 }