package com.huashe.park.domain.entity;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.huashe.common.annotation.Excel;
import com.huashe.common.domain.BaseEntity;
import com.huashe.park.common.animations.FixedLength;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 桩机施工结果数据（2025-02-26版协议）对象 cons_machine_process_result
 * 
 * @author ruoyi
 * @date 2025-02-26
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class MachineProcessResult extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 自增主键 */
    private Long id;

    /** 施工类型编码（0-1字节） */
    @Excel(name = "施工类型编码", readConverterExp = "0=-1字节")
    @FixedLength(value = 2)
    private Short consType;

    /** 数据协议版本（2-2字节） */
    @Excel(name = "数据协议版本", readConverterExp = "2=-2字节")
    @FixedLength(value = 1)
    private Byte dataVersion;

    /** 数据采集时间戳（3-10字节） */
    @Excel(name = "数据采集时间戳", readConverterExp = "3=-10字节")
    @FixedLength(value = 8)
    private Long dataTime;

    /** 桩体编号（11-18字节） */
    @Excel(name = "桩体编号", readConverterExp = "1=1-18字节")
    @FixedLength(value = 8)
    private String pileId;

    /** 设计图纸编号（19-26字节） */
    @Excel(name = "设计图纸编号", readConverterExp = "1=9-26字节")
    @FixedLength(value = 8)
    private String designId;

    /** 施工机械编号（27-34字节） */
    @Excel(name = "施工机械编号", readConverterExp = "2=7-34字节")
    @FixedLength(value = 8)
    private String machineId;

    /** 设计X坐标（米） */
    @Excel(name = "设计X坐标", readConverterExp = "米=")
    @FixedLength(value = 8)
    private Double designX;

    /** 设计Y坐标（米） */
    @Excel(name = "设计Y坐标", readConverterExp = "米=")
    @FixedLength(value = 8)
    private Double designY;

    /** 实际X坐标（米） */
    @Excel(name = "实际X坐标", readConverterExp = "米=")
    @FixedLength(value = 8)
    private Double realX;

    /** 实际Y坐标（米） */
    @Excel(name = "实际Y坐标", readConverterExp = "米=")
    @FixedLength(value = 8)
    private Double realY;

    /** 纬度 */
    @Excel(name = "纬度")
    @FixedLength(value = 8)
    private Double latitude;

    /** 经度 */
    @Excel(name = "经度")
    @FixedLength(value = 8)
    private Double longitude;

    /** 成桩长度（米） */
    @Excel(name = "成桩长度", readConverterExp = "米=")
    @FixedLength(value = 4)
    private Float pileLength;

    /** 平均钻速（mm/min） */
    @Excel(name = "平均钻速", readConverterExp = "m=m/min")
    @FixedLength(value = 4)
    private Float avgSpeed;

    /** 平均电流（A） */
    @Excel(name = "平均电流", readConverterExp = "A=")
    @FixedLength(value = 4)
    private Float avgCurrent;

    /** 持力层电流阈值（A） */
    @Excel(name = "持力层电流阈值", readConverterExp = "A=")
    @FixedLength(value = 4)
    private Float holdCurrent;

    /** 垂直度偏差（%） */
    @Excel(name = "垂直度偏差", readConverterExp = "%=")
    @FixedLength(value = 4)
    private Float verticalDeviation;

    /** 灌浆体积（m³） */
    @Excel(name = "灌浆体积", readConverterExp = "m=³")
    @FixedLength(value = 4)
    private Float sprayVolume;

    /** 施工开始时间 */
    @Excel(name = "施工开始时间")
    @FixedLength(value = 8)
    private Long startTime;

    /** 施工结束时间 */
    @Excel(name = "施工结束时间")
    @FixedLength(value = 8)
    private Long endTime;

    /** 结果评价（0:合格 1:异常） */
    @Excel(name = "结果评价", readConverterExp = "0=:合格,1=:异常")
    @FixedLength(value = 4)
    private Integer resultEvaluation;

    /** 起桩高度（米） */
    @Excel(name = "起桩高度", readConverterExp = "米=")
    @FixedLength(value = 8)
    private Double startHeight;

    /** 入岩深度（米） */
    @Excel(name = "入岩深度", readConverterExp = "米=")
    @FixedLength(value = 4)
    private Float inDepth;

    /** 有效下行深度（米） */
    @Excel(name = "有效下行深度", readConverterExp = "米=")
    @FixedLength(value = 4)
    private Float effectiveDown;

    /** 有效桩长（米） */
    @Excel(name = "有效桩长", readConverterExp = "米=")
    @FixedLength(value = 4)
    private Float effectiveLength;

    /** 桩点编号 */
    @Excel(name = "桩点编号")
    @FixedLength(value = 4)
    private Integer pileNumber;

    /** 平均喷浆压力（MPa） */
    @Excel(name = "平均喷浆压力", readConverterExp = "M=Pa")
    @FixedLength(value = 4)
    private Float avgSprayPressure;

    /** 平均喷浆速度（L/min） */
    @Excel(name = "平均喷浆速度", readConverterExp = "L=/min")
    @FixedLength(value = 4)
    private Float avgSpraySpeed;

    /** 设计桩长（米） */
    @Excel(name = "设计桩长", readConverterExp = "米=")
    @FixedLength(value = 4)
    private Float designLength;

    /** 平均上行速度（mm/min） */
    @Excel(name = "平均上行速度", readConverterExp = "m=m/min")
    @FixedLength(value = 4)
    private Float avgUpSpeed;

    /** 钻杆总节数 */
    @Excel(name = "钻杆总节数")
    @FixedLength(value = 4)
    private Integer drillTotalNumber;

    /** 机械类型（1:旋挖 2:冲击） */
    @Excel(name = "机械类型", readConverterExp = "1=:旋挖,2=:冲击")
    @FixedLength(value = 4)
    private Integer currentMechanicalType;

    /** 送土次数 */
    @Excel(name = "送土次数")
    private Integer sendTotalNumber;

    /** 送土总时长（秒） */
    @Excel(name = "送土总时长", readConverterExp = "秒=")
    private Double sendTotalTime;

    /** 总夯击次数 */
    @Excel(name = "总夯击次数")
    private Integer totalHammerNumber;

    @FixedLength(value = 8)
    private Long sendStartTime;

    @FixedLength(value = 8)
    private Long sendEndTime;

    @FixedLength(value = 8)
    private Long pullingStartTime;

    @FixedLength(value = 8)
    private Long pullingEndTime;

    @FixedLength(value = -1)
    /** 设备唯一标识（UUID） */
    @Excel(name = "设备唯一标识", readConverterExp = "U=UID")
    private String uuid;

    private String dt;

    private String recordTime;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId())
            .append("consType", getConsType()).append("dataVersion", getDataVersion()).append("dataTime", getDataTime())
            .append("pileId", getPileId()).append("designId", getDesignId()).append("machineId", getMachineId())
            .append("designX", getDesignX()).append("designY", getDesignY()).append("realX", getRealX())
            .append("realY", getRealY()).append("latitude", getLatitude()).append("longitude", getLongitude())
            .append("pileLength", getPileLength()).append("avgSpeed", getAvgSpeed())
            .append("avgCurrent", getAvgCurrent()).append("holdCurrent", getHoldCurrent())
            .append("verticalDeviation", getVerticalDeviation()).append("sprayVolume", getSprayVolume())
            .append("startTime", getStartTime()).append("endTime", getEndTime())
            .append("resultEvaluation", getResultEvaluation()).append("startHeight", getStartHeight())
            .append("inDepth", getInDepth()).append("effectiveDown", getEffectiveDown())
            .append("effectiveLength", getEffectiveLength()).append("pileNumber", getPileNumber())
            .append("avgSprayPressure", getAvgSprayPressure()).append("avgSpraySpeed", getAvgSpraySpeed())
            .append("designLength", getDesignLength()).append("avgUpSpeed", getAvgUpSpeed())
            .append("drillTotalNumber", getDrillTotalNumber())
            .append("currentMechanicalType", getCurrentMechanicalType()).append("sendTotalNumber", getSendTotalNumber())
            .append("sendTotalTime", getSendTotalTime()).append("totalHammerNumber", getTotalHammerNumber())
            .append("uuid", getUuid()).append("dt", getDt()).append("recordTime", getRecordTime()).toString();
    }
}
