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;


/**
 * 钢板轧制规格基准表(PmPlateSpecBt)实体类
 *
 * @author 蒋雨航 yuhang.jiang02@hand-china.com
 * @since 2024-09-05 14:45:53
 */

@Getter
@Setter
@ApiModel("钢板轧制规格基准表")
@VersionAudit
@ModifyAudit
@JsonInclude(value = JsonInclude.Include.NON_NULL)
@Table(name = "PM_PLATE_SPEC_BT")
public class PmPlateSpecBt extends AuditDomain implements Serializable {
    private static final long serialVersionUID = -47858152571127423L;

    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_MODE = "rollMode";
    public static final String FIELD_WHOLE_HEAT_TREATMENT_TYPE = "wholeHeatTreatmentType";
    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_COMBINE_PLATE_LEN_MAX = "combinePlateLenMax";
    public static final String FIELD_REMARK = "remark";
    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";

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

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

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

    @ApiModelProperty(value = "AD模式，分为D和ND")
    private String adTypeMode;

    @ApiModelProperty(value = "轧制模式, * 匹配所有轧制模式", required = true)
    @NotBlank
    private String rollMode;

    @ApiModelProperty(value = "全程热处理类型，Q（全程热处理类型含Q），* 匹配全部热处理类型", required = true)
    @NotBlank
    private String wholeHeatTreatmentType;

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

    @ApiModelProperty(value = "轧制产线号含义")
    @Transient
    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 = "组合板长度上限", required = true)
    @NotNull
    private BigDecimal combinePlateLenMax;

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

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

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        PmPlateSpecBt that = (PmPlateSpecBt) o;
        return Objects.equals(pptabId, that.pptabId) && Objects.equals(stCode, that.stCode) &&
                Objects.equals(formPlateMode, that.formPlateMode) && Objects.equals(adTypeMode, that.adTypeMode) &&
                Objects.equals(rollMode, that.rollMode) && Objects.equals(wholeHeatTreatmentType, that.wholeHeatTreatmentType)
                && Objects.equals(rollLineNo, that.rollLineNo) && Objects.equals(plateThickFrom, that.plateThickFrom)
                && Objects.equals(plateThickTo, that.plateThickTo) &&
                Objects.equals(combinePlateWidthFrom, that.combinePlateWidthFrom) &&
                Objects.equals(combinePlateWidthTo, that.combinePlateWidthTo) &&
                Objects.equals(combinePlateLenMax, that.combinePlateLenMax) && Objects.equals(remark, that.remark) &&
                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);
    }

    @Override
    public int hashCode() {
        return Objects.hash(pptabId, stCode, formPlateMode, adTypeMode, rollMode, wholeHeatTreatmentType,
                rollLineNo, plateThickFrom, plateThickTo, combinePlateWidthFrom, combinePlateWidthTo, combinePlateLenMax,
                remark, tenantId, attribute1, attribute2, attribute3, attribute4, attribute5);
    }

    private String attribute1;

    private String attribute2;

    private String attribute3;

    private String attribute4;

    private String attribute5;


}
