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;


/**
 * 特殊钢种余量增加表(PmSpeStAddvBt)实体类
 *
 * @author 纪文桃 wentao.ji01@hand-china.com
 * @since 2024-07-25 08:50:16
 */

@Getter
@Setter
@ApiModel("特殊钢种余量增加表")
@VersionAudit
@ModifyAudit
@JsonInclude(value = JsonInclude.Include.NON_NULL)
@Table(name = "PM_SPE_ST_ADDV_BT")
public class PmSpeStAddvBt extends AuditDomain implements Serializable {
    private static final long serialVersionUID = -52740064562913035L;

    public static final String FIELD_PSSAB_ID = "pssabId";
    public static final String FIELD_MSC_LINE_NO = "mscLineNo";
    public static final String FIELD_ST_NO = "stNo";
    public static final String FIELD_SG_SIGN = "sgSign";
    public static final String FIELD_SLAB_THICK_FROM = "slabThickFrom";
    public static final String FIELD_SLAB_THICK_TO = "slabThickTo";
    public static final String FIELD_PLATE_THICK_FROM = "plateThickFrom";
    public static final String FIELD_PLATE_THICK_TO = "plateThickTo";
    public static final String FIELD_SLAB_ADDV = "slabAddv";
    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 pssabId;

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

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

    @ApiModelProperty(value = "内部钢种", required = true)
    @NotBlank
    private String stNo;

    @ApiModelProperty(value = "外部牌号", required = true)
    @NotNull
    private String sgSign;


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

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

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

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

    @ApiModelProperty(value = "板坯加料")
    private BigDecimal slabAddv;

    @ApiModelProperty(value = "生效标记", required = true)
    @NotNull
    private String validFlag;

    @Transient
    @ApiModelProperty(value = "生效标记含义")
    private String validFlagDesc;

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

    private String attribute1;

    private String attribute2;

    private String attribute3;

    private String attribute4;

    private String attribute5;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        PmSpeStAddvBt that = (PmSpeStAddvBt) o;
        return Objects.equals(mscLineNo, that.mscLineNo) &&
                Objects.equals(stNo, that.stNo) && Objects.equals(sgSign, that.sgSign) &&
                Objects.equals(slabThickFrom, that.slabThickFrom) && Objects.equals(slabThickTo, that.slabThickTo) &&
                Objects.equals(plateThickFrom, that.plateThickFrom) && Objects.equals(plateThickTo, that.plateThickTo) &&
                Objects.equals(slabAddv, that.slabAddv) && Objects.equals(validFlag, that.validFlag) &&
                Objects.equals(validFlagDesc, that.validFlagDesc) && Objects.equals(tenantId, that.tenantId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(mscLineNo, stNo, sgSign, slabThickFrom, slabThickTo, plateThickFrom,
                plateThickTo, slabAddv, validFlag, validFlagDesc, tenantId);
    }
}
