3 Commits 89d90be18a ... 4ac315f0ba

Autor SHA1 Mensaje Fecha
  wurui 4ac315f0ba Merge remote-tracking branch 'origin/master' hace 1 mes
  wurui 6b53bcbe93 移动目标条带算法修改 hace 1 mes
  wurui 5bdaa86c91 目标类型修改 hace 1 mes

+ 3 - 0
orbit-base-biz/base-biz-service/src/main/java/com/base/biz/model/dto/request/QueryTargetListDTO.java

@@ -9,5 +9,8 @@ public class QueryTargetListDTO extends PageDTO {
 
     @ApiModelProperty("目标名称")
     private String targetName;
+    @ApiModelProperty("目标类型")
+    private Integer type;
+
 
 }

+ 2 - 0
orbit-base-biz/base-biz-service/src/main/java/com/base/biz/model/dto/response/TargetPointDTO.java

@@ -38,4 +38,6 @@ public class TargetPointDTO {
 
     @ApiModelProperty("目标点集合")
     private List<PointDTO> pointDTOList;
+    private String pointType;//目标类型
+
 }

+ 5 - 1
orbit-base-biz/base-biz-service/src/main/java/com/base/biz/model/enums/TargetTypeEnums.java

@@ -2,7 +2,11 @@ package com.base.biz.model.enums;
 
 public enum TargetTypeEnums {
 
-    FIXED_TARGET("0", "固定目标"),MOVING_TARGET("1", "移动目标"),REGIONAL_TARGET("2", "区域目标"),UNDEFINED("-1", "未知");
+    FIXED_TARGET("0", "固定目标"),MOVING_TARGET("1", "移动目标"),REGIONAL_TARGET("2", "区域目标")
+    ,LINE("3", "线目标")
+    ,GROUPPOINT("4", "点群目标")
+    ,UNDEFINED("-1", "未知")
+    ;
 
     private String key;
 

+ 1 - 1
orbit-base-biz/base-biz-service/src/main/java/com/base/biz/service/SceneBasisTargetService.java

@@ -92,7 +92,7 @@ public class SceneBasisTargetService {
             String targetId = target.getTargetId();
             List<SceneTargetPoint> sceneTargetPointList = sceneTargetPoints.stream().filter(e -> targetId.equals(e.getTargetId())).collect(Collectors.toList());
             List<PointDTO> pointDTOList = sceneTargetPointsCastToDTO(sceneTargetPointList);
-            target.setType(TargetTypeEnums.getTargetTypeEnums(StringUtils.isEmpty(target.getType()) ? "-1" : target.getType()).getValue());
+            //target.setType(TargetTypeEnums.getTargetTypeEnums(StringUtils.isEmpty(target.getType()) ? "-1" : target.getType()).getValue());
             target.setPointDTOList(pointDTOList);
         });
         com.github.pagehelper.PageInfo<TargetPointDTO> pageInfo = new com.github.pagehelper.PageInfo<>(targetList);

+ 2 - 0
orbit-base-biz/base-biz-service/src/main/java/com/base/biz/service/TargetDemandService.java

@@ -287,6 +287,8 @@ public class TargetDemandService extends ServiceImpl<TargetDemandMapper, TargetD
         List<SceneTargetPoint> sceneTargetPoints = sceneTargetPointMapper.selectList(pointQueryWrapper);
 
         for (TargetDemandRpcDTO targetDemandRpcDTO : targetDemandRpcDTOS) {
+            SceneBasisTarget sceneBasisTarget = sceneBasisTargetMapper.selectById(targetDemandRpcDTO.getTargetId());
+            targetDemandRpcDTO.setType(sceneBasisTarget.getType());
             //  点目标集合
             List<PointRpcDTO> pointDTOList = new ArrayList<>();
             //  根据目标id匹配点目标

+ 4 - 0
orbit-base-biz/base-biz-service/src/main/resources/mapper/SceneTargetPointMapper.xml

@@ -91,9 +91,13 @@
         FROM
             scene_basis_target t
         <where>
+        1=1
             <if test="req.targetName!=null and req.targetName!=''">
                 and t.target_name like concat('%', #{req.targetName}, '%')
             </if>
+            <if test="req.type!=null">
+                and t.type = #{req.type}
+            </if>
         </where>
         ORDER BY
             CAST(SUBSTRING_INDEX(t.target_name, '测试点位', -1) AS UNSIGNED)

+ 11 - 1
orbit-base-plan/base-plan-service/src/main/java/com/base/plan/model/enums/PointTypeEnumes.java

@@ -14,5 +14,15 @@ public enum PointTypeEnumes {
     /**
      * 点群目标
      */
-    GROUPPOINT;
+    GROUPPOINT,
+
+    /**
+     * 点目标
+     */
+    POINTTARGET,
+
+    /**
+     * 区域目标
+     */
+    REGIONTARGET;
 }

+ 10 - 4
orbit-base-plan/base-plan-service/src/main/java/com/base/plan/service/StripService.java

@@ -831,15 +831,19 @@ public class StripService extends ServiceImpl<StripMapper, StripInfo> {
                 System.out.println("====================构建观测区域===================");
 
                 //判断是那个类型的目标 目前只有移动点目标 线目标 点群目标需要做单独处理
-                if (value.get(0).getTargetType().equals(PointTypeEnumes.MOVEPOINT.toString())){
+                if (targetRelationDTO.getType()==1){
                     //移动点目标
                     //根据 航向 航速 时间进行轨迹推算 取得所需时刻后的目标点位
-                    LaLonUtil.deadReckoning("","","","","");
+                    String startlon=value.get(0).getLongitude() ;
+                    String startlat=value.get(0).getLatitude();
+                    PointRpcDTO pointRpcDTO=LaLonUtil.deadReckoning(startlon,startlat,"10","1","90");
+                    value.get(0).setLatitude(pointRpcDTO.getLatitude());
+                    value.get(0).setLongitude(pointRpcDTO.getLongitude());
                 }
 
                 Map<Integer, List<PointRpcDTO>> PointRpcDTOmapNew=new HashMap<>();
 
-                if (value.get(0).getTargetType().equals(PointTypeEnumes.LINE.toString())){
+                if (targetRelationDTO.getType()==3){
                     //线目标
                     //先将多点目标按照时间连城线并绘制区域
                     PointRpcDTO pointRpcDTO1=new PointRpcDTO();
@@ -856,7 +860,7 @@ public class StripService extends ServiceImpl<StripMapper, StripInfo> {
                     }
 
                 }
-                if (value.get(0).getTargetType().equals(PointTypeEnumes.GROUPPOINT.toString())){
+                if (targetRelationDTO.getType()==4){
                     //点群目标
                     //先绘制点群外接四边形区域
                     List<PointRpcDTO> pointRpcDTOList2=new ArrayList<>();
@@ -867,11 +871,13 @@ public class StripService extends ServiceImpl<StripMapper, StripInfo> {
 
                 if (!CollectionUtils.isEmpty(PointRpcDTOmapNew)) {
                     PointRpcDTOmapNew.forEach((key1, value1) -> {
+                        targetRelationDTO.setPointDTOList(value1);
                         count( targetRelationDTO, payloadRpcDTOList, stripCalcResults, primaryKeyGenerator
                         );
                     });
 
                 }else {
+                    targetRelationDTO.setPointDTOList(value);
                     count( targetRelationDTO, payloadRpcDTOList, stripCalcResults, primaryKeyGenerator
                     );
                 }

+ 26 - 4
orbit-base-plan/base-plan-service/src/main/java/com/base/plan/utils/LaLonUtil.java

@@ -6,6 +6,8 @@ import org.geotools.geometry.jts.JTSFactoryFinder;
 import org.locationtech.jts.geom.*;
 import org.locationtech.jts.operation.distance.DistanceOp;
 
+import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -83,21 +85,41 @@ public class LaLonUtil {
         return pointRpcDTOS;
     }
 
-    public static void deadReckoning(String startlon ,String startlat,String speed,String time,String heading){
+    public static PointRpcDTO deadReckoning(String startlon ,String startlat,String speed,String time,String heading){
         double startlond=Double.valueOf(startlon);
         double startlatd=Double.valueOf(startlat);
         double speedd=Double.valueOf(speed); //公里每小时
         double timed=Double.valueOf(time);//小时
         double headingd=Double.valueOf(heading);//航向 度
 
-        double deltaLat = calculateDeltaLat(speedd, timed, headingd, startlatd);
+/*        double deltaLat = calculateDeltaLat(speedd, timed, headingd, startlatd);
         double deltaLon = calculateDeltaLon(speedd, timed, headingd, startlond);
 
         double nextLatitude = deltaLat + deltaLat;
-        double nextLongitude = deltaLon + deltaLon;
+        double nextLongitude = deltaLon + deltaLon;*/
 
-        System.out.println("下一个点的经纬度是: " + nextLatitude + ", " + nextLongitude);
+        double distance = speedd * timed; // 计算距离,单位可以是米或者千米
+        double nextLatitude = startlatd + distance * Math.sin(Math.toRadians(headingd));
+        double nextLongitude = startlond + distance * Math.cos(Math.toRadians(headingd)) / Math.cos(Math.toRadians(startlatd));
 
+
+/*        BigDecimal nextLongitudeb = new BigDecimal(nextLongitude);
+        nextLongitudeb.setScale(6,BigDecimal.ROUND_HALF_UP);*/
+        String nextLongituden =String.format("%.6f",nextLongitude);
+
+/*        BigDecimal nextLatitudeb = new BigDecimal(nextLatitude);
+        nextLatitudeb.setScale(6, BigDecimal.ROUND_HALF_UP);*/
+        /*String nextLatituden = nextLatitudeb.toPlainString();*/
+        String nextLatituden = String.format("%.6f",nextLatitude);
+
+
+
+        PointRpcDTO pointRpcDTO=new PointRpcDTO();
+        pointRpcDTO.setLongitude(nextLongituden);
+        pointRpcDTO.setLatitude(nextLatituden);
+        System.out.println("下一个点的经纬度是: " + nextLatituden + ", " + nextLongituden);
+
+        return pointRpcDTO;
     }
 
     public static double calculateDeltaLat(double speed, double time, double heading, double currentLatitude) {