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 lombok.Getter;
import lombok.Setter;

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.io.Serializable;
import java.math.BigDecimal;
import java.util.Objects;


/**
 * 钢板轧制规格及厚度余量基准表(PmPlateThickAddvBt)实体类
 *
 * @author 纪文桃 wentao.ji01@hand-china.com
 * @since 2024-07-24 08:09:53
 * 已废弃
 */

@Getter
@Setter
@ApiModel("钢板轧制规格及厚度余量基准表")
@VersionAudit
@ModifyAudit
@JsonInclude(value = JsonInclude.Include.NON_NULL)
@Table(name = "PM_PLATE_THICK_ADDV_BT")
public class PmPlateThickAddvBt extends AuditDomain implements Serializable {
    private static final long serialVersionUID = -74916181695871159L;

    public static final String FIELD_PPTAB_ID = "pptabId";
    public static final String FIELD_ST_CODE = "stCode";
    public static final String FIELD_FORM_PLATE_MODE = "formPlateMode";
    public static final String FIELD_AD_TYPE_MODE = "adTypeMode";
    public static final String FIELD_ROLL_DIRECT_CODE = "rollDirectCode";
    public static final String FIELD_ROLL_MODE = "rollMode";
    public static final String FIELD_HEAT_TREAT_MODE = "heatTreatMode";
    public static final String FIELD_ROLL_LINE_NO = "rollLineNo";
    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_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_COMBINE_PLATE_LEN_MIN = "combinePlateLenMin";
    public static final String FIELD_COMBINE_PLATE_LEN_MAX = "combinePlateLenMax";
    public static final String FIELD_THICK_ADDV = "thickAddv";
    public static final String FIELD_REMARK = "remark";

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

    @ApiModelProperty(value = "强度级别代码", required = true)
    @NotBlank
    private String stCode;

    @ApiModelProperty(value = "组板方式", required = true)
    @NotBlank
    private String formPlateMode;

    @Transient
    @ApiModelProperty(value = "组板方式含义")
    private String formPlateModeDesc;

    @ApiModelProperty(value = "AD模式")
    private String adTypeMode;

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

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


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

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


    @ApiModelProperty(value = "热处理模式", required = true)
    @NotBlank
    private String heatTreatMode;

    @ApiModelProperty(value = "轧制产线号", required = true)
    @NotBlank
    private String rollLineNo;

    @Transient
    @ApiModelProperty(value = "轧制产线号")
    private String rollLineNoDesc;


    @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 = "租户ID", required = true)
    @NotNull
    private Long tenantId;

    private String attribute1;

    private String attribute2;

    private String attribute3;

    private String attribute4;

    private String attribute5;


    @ApiModelProperty(value = "组合板长度下限 ", required = true)
    @NotNull
    private BigDecimal combinePlateLenMin;


    @ApiModelProperty(value = "组合板长度上限", required = true)
    @NotNull
    private BigDecimal combinePlateLenMax;


    @ApiModelProperty(value = "厚度余量", required = true)
    @NotNull
    private BigDecimal thickAddv;

    @ApiModelProperty(value = "备注说明")
    private String remark;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        PmPlateThickAddvBt that = (PmPlateThickAddvBt) o;
        return Objects.equals(stCode, that.stCode) && Objects.equals(formPlateMode, that.formPlateMode) &&
                Objects.equals(formPlateModeDesc, that.formPlateModeDesc) && Objects.equals(adTypeMode, that.adTypeMode) &&
                Objects.equals(rollDirectCode, that.rollDirectCode) && Objects.equals(rollDirectCodeDesc, that.rollDirectCodeDesc) &&
                Objects.equals(rollMode, that.rollMode) && Objects.equals(rollModeDesc, that.rollModeDesc) &&
                Objects.equals(heatTreatMode, that.heatTreatMode) && Objects.equals(rollLineNo, that.rollLineNo) &&
                Objects.equals(rollLineNoDesc, that.rollLineNoDesc) && Objects.equals(plateThickFrom, that.plateThickFrom) &&
                Objects.equals(plateThickTo, that.plateThickTo) && Objects.equals(combinePlateWidthFrom, that.combinePlateWidthFrom) &&
                Objects.equals(combinePlateWidthTo, that.combinePlateWidthTo) && Objects.equals(tenantId, that.tenantId) &&
                Objects.equals(combinePlateLenMin, that.combinePlateLenMin) && Objects.equals(combinePlateLenMax, that.combinePlateLenMax) &&
                Objects.equals(thickAddv, that.thickAddv) && Objects.equals(remark, that.remark);
    }

    @Override
    public int hashCode() {
        return Objects.hash(stCode, formPlateMode, formPlateModeDesc, adTypeMode, rollDirectCode, rollDirectCodeDesc,
                rollMode, rollModeDesc, heatTreatMode, rollLineNo, rollLineNoDesc, plateThickFrom, plateThickTo,
                combinePlateWidthFrom, combinePlateWidthTo, tenantId, combinePlateLenMin, combinePlateLenMax, thickAddv, remark);
    }
}
