package com.ruoyi.web.calculate.domain;

import java.math.BigDecimal;
import java.math.RoundingMode;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.annotation.Excel.ColumnType;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 同坐标系中空间坐标转大地坐标
 * 
 * @author qyx
 * @date 2026-06-10
 */
public class CmcSpatialToGeodetic extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private Long id;

    /** 待求点号 */
    @Excel(name = "待求点")
    private String pointNumber;

    /** 坐标系 */
    @Excel(name = "坐标系")
    private String coordinateSystem;

    /** 空间直角坐标X */
    @Excel(name = "空间坐标X", cellType = ColumnType.NUMERIC, numberFormat = "0.0000")
    private Double spatialX;

    /** 空间直角坐标Y */
    @Excel(name = "空间坐标Y", cellType = ColumnType.NUMERIC, numberFormat = "0.0000")
    private Double spatialY;

    /** 空间直角坐标Z */
    @Excel(name = "空间坐标Z", cellType = ColumnType.NUMERIC, numberFormat = "0.0000")
    private Double spatialZ;

    /** 大地经度 */
    @Excel(name = "大地经度" , cellType = ColumnType.NUMERIC,numberFormat = "0.000000000")
    private Double longitude;

    /** 经度位置 */
    @Excel(name = "经度位置")
    private String longitudePosition;

    /** 大地纬度 */
    @Excel(name = "大地纬度", cellType = ColumnType.NUMERIC, numberFormat = "0.000000000")
    private Double latitude;

    /** 纬度位置 */
    @Excel(name = "纬度位置")
    private String latitudePosition;

    /** 大地高 */
    @Excel(name = "大地高", cellType = ColumnType.NUMERIC, numberFormat = "0.0000")
    private Double height;

    /** 投影面高程 */
    @Excel(name = "投影面高程", cellType = ColumnType.NUMERIC)
    private double projectionHeight;

    /** 输出角度格式：degree(度) / dms(度分秒) */
    private String outputFormat;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    
    public void setPointNumber(String pointNumber) 
    {
        this.pointNumber = pointNumber;
    }

    public String getPointNumber() 
    {
        return pointNumber;
    }
    
    public void setCoordinateSystem(String coordinateSystem) 
    {
        this.coordinateSystem = coordinateSystem;
    }

    public String getCoordinateSystem() 
    {
        return coordinateSystem;
    }
    
    public void setSpatialX(Double spatialX) 
    {
        this.spatialX = spatialX;
    }

    public Double getSpatialX() 
    {
        return spatialX;
    }
    
    public void setSpatialY(Double spatialY) 
    {
        this.spatialY = spatialY;
    }

    public Double getSpatialY() 
    {
        return spatialY;
    }
    
    public void setSpatialZ(Double spatialZ) 
    {
        this.spatialZ = spatialZ;
    }

    public Double getSpatialZ() 
    {
        return spatialZ;
    }
    
    public void setLongitude(Double longitude) 
    {
        // 大地经度保留10位小数
        if (longitude != null) {
            BigDecimal bd = new BigDecimal(longitude);
            this.longitude = bd.setScale(10, RoundingMode.HALF_UP).doubleValue();
        } else {
            this.longitude = null;
        }
    }

    public Double getLongitude() 
    {
        return longitude;
    }
    
    public void setLongitudePosition(String longitudePosition) 
    {
        this.longitudePosition = longitudePosition;
    }

    public String getLongitudePosition() 
    {
        return longitudePosition;
    }
    
    public void setLatitude(Double latitude) 
    {
        // 大地纬度保留10位小数
        if (latitude != null) {
            BigDecimal bd = new BigDecimal(latitude);
            this.latitude = bd.setScale(10, RoundingMode.HALF_UP).doubleValue();
        } else {
            this.latitude = null;
        }
    }

    public Double getLatitude() 
    {
        return latitude;
    }
    
    public void setLatitudePosition(String latitudePosition) 
    {
        this.latitudePosition = latitudePosition;
    }

    public String getLatitudePosition() 
    {
        return latitudePosition;
    }
    
    public void setHeight(Double height) 
    {
        // 大地高保留3位小数
        if (height != null) {
            BigDecimal bd = new BigDecimal(height);
            this.height = bd.setScale(6, RoundingMode.HALF_UP).doubleValue();
        } else {
            this.height = null;
        }
    }

    public Double getHeight() 
    {
        return height;
    }
    
    public void setProjectionHeight(double projectionHeight) 
    {
        this.projectionHeight = projectionHeight;
    }

    public double getProjectionHeight() 
    {
        return projectionHeight;
    }
    
    public void setOutputFormat(String outputFormat) 
    {
        this.outputFormat = outputFormat;
    }

    public String getOutputFormat() 
    {
        return outputFormat;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("pointNumber", getPointNumber())
            .append("coordinateSystem", getCoordinateSystem())
            .append("spatialX", getSpatialX())
            .append("spatialY", getSpatialY())
            .append("spatialZ", getSpatialZ())
            .append("longitude", getLongitude())
            .append("longitudePosition", getLongitudePosition())
            .append("latitude", getLatitude())
            .append("latitudePosition", getLatitudePosition())
            .append("height", getHeight())
            .append("projectionHeight", getProjectionHeight())
            .append("createTime", getCreateTime())
            .append("createBy", getCreateBy())
            .append("updateTime", getUpdateTime())
            .append("updateBy", getUpdateBy())
            .toString();
    }
}
