‘liusuyi’
2023-06-28 d7e18fe5f9962b2fc6d8fd7da7692a9aabe50bdf
ard-work/src/main/java/com/ruoyi/utils/tube/TubeTools.java
@@ -1,6 +1,7 @@
package com.ruoyi.utils.tube;
import com.ruoyi.alarmpoints.tube.domain.ArdTubesDetails;
import com.ruoyi.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.gavaghan.geodesy.Ellipsoid;
import org.gavaghan.geodesy.GeodeticCalculator;
@@ -61,6 +62,11 @@
     */
    public static GeoPoint CalculateCoordinates(List<ArdTubesDetails> ardTubesDetails, Integer alarmPointDistance) {
            try {
                if(StringUtils.isNull(alarmPointDistance))
                {
                    log.debug("报警点距离为空,无法计算坐标");
                    return null;
                }
                Comparator<ArdTubesDetails> comparator = Comparator.comparingInt(person -> Integer.parseInt(person.getInflectionPointNumber())); // 使用Collections.sort方法进行排序
                Collections.sort(ardTubesDetails, comparator);
                GeoPoint point0 = new GeoPoint(ardTubesDetails.get(0).getLongitude(), ardTubesDetails.get(0).getLatitude(), ardTubesDetails.get(0).getAltitude() - ardTubesDetails.get(0).getDepth());