package cn.com.taiji.beidou.ship.track.service;

import cn.com.taiji.beidou.ship.track.domain.ShipContainsReq;
import cn.com.taiji.beidou.ship.track.domain.ShipContainsResult;
import cn.com.taiji.beidou.ship.track.domain.ShipTrackReq;
import cn.com.taiji.beidou.ship.track.domain.ShipTrackResult;

import java.util.List;

/**
 * @Author CHEN
 * @Date 2023/1/12 18:06
 */
public interface ShipTrackService {
    /**
     * 查询轨迹详情
     * @param shipTrackReq
     * @return
     */
    List<ShipTrackResult> selectShipTrackDetail(ShipTrackReq shipTrackReq);


    /**
     * 将经纬度转换为度分秒格式
     *
     * @param du 116.41884740.0897315
     * @return 116°25'7.85"       40°5'23.03"
     */
    default  String latLng2Dfm(double du) {
        int du1 = (int) du;
        double tp = (du - du1) * 60;
        int fen = (int) tp;
        String miao = String.format("%.0f", Math.abs(((tp - fen) * 60)));
        return du1 + "°" + Math.abs(fen) + "'" + miao + "\"";
    }

    List<ShipContainsResult> selectShipContainsResults(ShipContainsReq shipContainsReq);
}
