package com.xisc.pm.domain.entity;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.choerodon.mybatis.annotation.ModifyAudit;
import io.choerodon.mybatis.annotation.VersionAudit;
import io.choerodon.mybatis.domain.AuditDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Objects;


/**
 * 钢板切缝切头尾范围基准表(PmPlateCutLenBt)实体类
 *
 * @author 纪文桃 wentao.ji01@hand-china.com
 * @since 2024-09-20 16:54:58
 */

@Getter
@Setter
@ApiModel("钢板切缝切头尾范围基准表")
@VersionAudit
@ModifyAudit
@JsonInclude(value = JsonInclude.Include.NON_NULL)
@Table(name = "PM_PLATE_CUT_LEN_BT")
public class PmPlateCutLenBt extends AuditDomain implements Serializable {
    private static final long serialVersionUID = 331801813395910990L;

    public static final String FIELD_PPCLB_ID = "ppclbId";
    public static final String FIELD_PLATE_THICK_FROM = "plateThickFrom";
    public static final String FIELD_PLATE_THICK_TO = "plateThickTo";
    public static final String FIELD_COMBINE_PLATE_WIDTH_FROM = "combinePlateWidthFrom";
    public static final String FIELD_COMBINE_PLATE_WIDTH_TO = "combinePlateWidthTo";
    public static final String FIELD_BRR_NEED = "brrNeed";
    public static final String FIELD_ROLL_MODE = "rollMode";
    public static final String FIELD_ROLL_DIRECT_CODE = "rollDirectCode";
    public static final String FIELD_MSC_LINE_NO = "mscLineNo";
    public static final String FIELD_PLATE_CUT_WIDTH = "plateCutWidth";
    public static final String FIELD_HEAD_CUT = "headCut";
    public static final String FIELD_TAIL_CUT = "tailCut";
    public static final String FIELD_TENANT_ID = "tenantId";
    public static final String FIELD_ATTRIBUTE1 = "attribute1";
    public static final String FIELD_ATTRIBUTE2 = "attribute2";
    public static final String FIELD_ATTRIBUTE3 = "attribute3";
    public static final String FIELD_ATTRIBUTE4 = "attribute4";
    public static final String FIELD_ATTRIBUTE5 = "attribute5";
    public static final String FIELD_SLAB_THICK_FROM = "slabThickFrom";
    public static final String FIELD_SLAB_THICK_TO = "slabThickTo";

    @ApiModelProperty("主键ID")
    @Id
    @GeneratedValue
    private Long ppclbId;

    @ApiModelProperty(value = "钢板厚度起", required = true)
    @NotNull
    private BigDecimal plateThickFrom;

    @ApiModelProperty(value = "钢板厚度止", required = true)
    @NotNull
    private BigDecimal plateThickTo;

    @ApiModelProperty(value = "组合板宽度起", required = true)
    @NotNull
    private BigDecimal combinePlateWidthFrom;

    @ApiModelProperty(value = "组合板宽度止", required = true)
    @NotNull
    private BigDecimal combinePlateWidthTo;

    @ApiModelProperty(value = "是否展宽", required = true)
    @NotBlank
    private String brrNeed;

    @Transient
    @ApiModelProperty(value = "是否展宽含义")
    private String brrNeedDesc;

    @ApiModelProperty(value = "轧制模式", required = true)
    @NotBlank
    private String rollMode;

    @Transient
    @ApiModelProperty(value = "轧制模式含义")
    private String rollModeDesc;

    @ApiModelProperty(value = "轧制方向代码", required = true)
    @NotBlank
    private String rollDirectCode;

    @Transient
    @ApiModelProperty(value = "轧制方向代码含义")
    private String rollDirectCodeDesc;

    @ApiModelProperty(value = "设计产线号", required = true)
    @NotBlank
    private String mscLineNo;

    @Transient
    @ApiModelProperty(value = "设计产线号含义")
    private String mscLineNoDesc;

    @ApiModelProperty(value = "钢板切缝宽度", required = true)
    @NotNull
    private BigDecimal plateCutWidth;

    @ApiModelProperty(value = "头部切舍量", required = true)
    @NotNull
    private BigDecimal headCut;

    @ApiModelProperty(value = "尾部切舍量", required = true)
    @NotNull
    private BigDecimal tailCut;

    @ApiModelProperty(value = "租户ID", required = true)
    @NotNull
    private Long tenantId;

    private String attribute1;

    private String attribute2;

    private String attribute3;

    private String attribute4;

    private String attribute5;

    @ApiModelProperty(value = "板坯厚度起")
    private BigDecimal slabThickFrom;

    @ApiModelProperty(value = "板坯厚度止")
    private BigDecimal slabThickTo;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        PmPlateCutLenBt that = (PmPlateCutLenBt) o;
        return Objects.equals(ppclbId, that.ppclbId) && Objects.equals(plateThickFrom, that.plateThickFrom)
                && Objects.equals(plateThickTo, that.plateThickTo) && Objects.equals(combinePlateWidthFrom, that.combinePlateWidthFrom)
                && Objects.equals(combinePlateWidthTo, that.combinePlateWidthTo) && Objects.equals(brrNeed, that.brrNeed)
                && Objects.equals(brrNeedDesc, that.brrNeedDesc) && Objects.equals(rollMode, that.rollMode)
                && Objects.equals(rollModeDesc, that.rollModeDesc) && Objects.equals(rollDirectCode, that.rollDirectCode)
                && Objects.equals(rollDirectCodeDesc, that.rollDirectCodeDesc) && Objects.equals(mscLineNo, that.mscLineNo)
                && Objects.equals(mscLineNoDesc, that.mscLineNoDesc) && Objects.equals(plateCutWidth, that.plateCutWidth)
                && Objects.equals(headCut, that.headCut) && Objects.equals(tailCut, that.tailCut) && Objects.equals(tenantId, that.tenantId)
                && Objects.equals(attribute1, that.attribute1) && Objects.equals(attribute2, that.attribute2)
                && Objects.equals(attribute3, that.attribute3) && Objects.equals(attribute4, that.attribute4)
                && Objects.equals(attribute5, that.attribute5) && Objects.equals(slabThickFrom, that.slabThickFrom)
                && Objects.equals(slabThickTo, that.slabThickTo);
    }

    @Override
    public int hashCode() {
        return Objects.hash(ppclbId, plateThickFrom, plateThickTo, combinePlateWidthFrom, combinePlateWidthTo, brrNeed,
                brrNeedDesc, rollMode, rollModeDesc, rollDirectCode, rollDirectCodeDesc, mscLineNo, mscLineNoDesc,
                plateCutWidth, headCut, tailCut, tenantId, attribute1, attribute2, attribute3, attribute4, attribute5,
                slabThickFrom, slabThickTo);
    }
}
