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;


/**
 * 钢板切边量基准表(PmPlateTrimBt)实体类
 *
 * @author 纪文桃 wentao.ji01@hand-china.com
 * @since 2024-07-24 10:37:37
 */

@Getter
@Setter
@ApiModel("钢板切边量基准表")
@VersionAudit
@ModifyAudit
@JsonInclude(value = JsonInclude.Include.NON_NULL)
@Table(name = "PM_PLATE_TRIM_BT")
public class PmPlateTrimBt extends AuditDomain implements Serializable {
    private static final long serialVersionUID = -13058131031536856L;

    public static final String FIELD_PPTB_ID = "pptbId";
    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_SMALL_PLATE_LEN_FROM = "smallPlateLenFrom";
    public static final String FIELD_SMALL_PLATE_LEN_TO = "smallPlateLenTo";
    public static final String FIELD_WITH_SIDE_FLAG = "withSideFlag";
    public static final String FIELD_WIDEN_FROM = "widenFrom";
    public static final String FIELD_WIDEN_TO = "widenTo";
    public static final String FIELD_TRIM_WIDTH = "trimWidth";
    public static final String FIELD_MSC_LINE_NO = "mscLineNo";
    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 pptbId;

    @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 smallPlateLenFrom;

    @ApiModelProperty(value = "小板长度止", required = true)
    @NotNull
    private BigDecimal smallPlateLenTo;

    @ApiModelProperty(value = "切边标记", required = true)
    private String withSideFlag;

    @ApiModelProperty(value = "展宽比起", required = true)
    @NotNull
    private BigDecimal widenFrom;

    @ApiModelProperty(value = "展宽比止", required = true)
    @NotNull
    private BigDecimal widenTo;

    @Transient
    @ApiModelProperty(value = "切边标记含义")
    private String withSideFlagDesc;

    @ApiModelProperty(value = "切边量", required = true)
    @NotNull
    private BigDecimal trimWidth;

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

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

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

    private String attribute1;

    private String attribute2;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        PmPlateTrimBt that = (PmPlateTrimBt) o;
        return Objects.equals(pptbId, that.pptbId) && Objects.equals(plateThickFrom, that.plateThickFrom) &&
                Objects.equals(plateThickTo, that.plateThickTo) &&
                Objects.equals(combinePlateWidthFrom, that.combinePlateWidthFrom) &&
                Objects.equals(combinePlateWidthTo, that.combinePlateWidthTo) &&
                Objects.equals(smallPlateLenFrom, that.smallPlateLenFrom) &&
                Objects.equals(smallPlateLenTo, that.smallPlateLenTo) && Objects.equals(withSideFlag, that.withSideFlag) &&
                Objects.equals(widenFrom, that.widenFrom) && Objects.equals(widenTo, that.widenTo) &&
                Objects.equals(withSideFlagDesc, that.withSideFlagDesc) && Objects.equals(trimWidth, that.trimWidth) &&
                Objects.equals(mscLineNo, that.mscLineNo) && Objects.equals(mscLineNoDesc, that.mscLineNoDesc) &&
                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(pptbId, plateThickFrom, plateThickTo, combinePlateWidthFrom, combinePlateWidthTo,
                smallPlateLenFrom, smallPlateLenTo, withSideFlag, widenFrom, widenTo, withSideFlagDesc, trimWidth,
                mscLineNo, mscLineNoDesc, tenantId, attribute1, attribute2, attribute3, attribute4, attribute5);
    }

    private String attribute3;

    private String attribute4;

    private String attribute5;

}
