nishiwei
5 days ago 3f43e40ed1a1e9f66b3ad2862da9dbc4b710c712
ard-route/src/main/java/com/ard/route/util/ToolUtils.java
@@ -2,10 +2,12 @@
import com.ard.inspection.domain.ArdPointCloud;
import com.ard.route.domain.djuav.UavRouteReq;
import com.ard.route.enums.kml.DroneEnumValueEnums;
import java.io.*;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Objects;
/**
 * 工具类
@@ -139,6 +141,15 @@
    }
    /**
     * 截取机型子类型
     * 参数: "0-67-1" 返回 1;格式不足三段时返回 0
     */
    public static Integer subStringSubDroneType(String str) {
        String[] parts = str.split("-");
        return parts.length > 2 ? Integer.valueOf(parts[2]) : 0;
    }
    /**
     * 截取字符串
     * 获取经纬度高度
     */
@@ -173,6 +184,12 @@
     * 获取无人机类型方法
     */
    public static String droneTypeData(UavRouteReq uavRouteReq) {
        // 机场1:M30(67-0) / M30T(67-1) 需要保留 subType,避免航线记录的 aircraft 都变成 0-67-0。
        // 其它机型保持原有返回值,机场2/3 不受影响。
        if (Objects.equals(DroneEnumValueEnums.M30_M30T.getValue(), uavRouteReq.getDroneType())) {
            return "0-" + uavRouteReq.getDroneType() + "-"
                    + (uavRouteReq.getSubDroneType() == null ? 0 : uavRouteReq.getSubDroneType());
        }
        return "0-" + uavRouteReq.getDroneType() + "-0";
    }