package com.xisc.pm.domain.entity;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.xisc.pm.infra.constant.Constants;
import com.xisc.pm.infra.util.Utils;
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;

/**
 * 组板钢板表(PmPdPlate)实体类
 *
 * @author 纪文桃 wentao.ji01@hand-china.com
 * @since 2024-07-31 16:31:09
 */

@Getter
@Setter
@ApiModel("组板钢板表")
@VersionAudit
@ModifyAudit
@JsonInclude(value = JsonInclude.Include.NON_NULL)
@Table(name = "PM_PD_PLATE")
public class PmPdPlate extends AuditDomain implements Serializable {
    private static final long serialVersionUID = -28993241199479502L;

    public static final String FIELD_PM_PD_PLATE_ID = "pmPdPlateId";
    public static final String FIELD_TMP_SLAB_NO = "tmpSlabNo";
    public static final String FIELD_PD_BACKLOG_SEQ = "pdBacklogSeq";
    public static final String FIELD_PD_BACKLOG_CODE = "pdBacklogCode";
    public static final String FIELD_PLATE_NO = "plateNo";
    public static final String FIELD_SLAB_NO = "slabNo";
    public static final String FIELD_MAT_DESIGN_KIND = "matDesignKind";
    public static final String FIELD_PROD_CODE_HP = "prodCodeHp";
    public static final String FIELD_PD_STATUS_HP = "pdStatusHp";
    public static final String FIELD_PD_RESP = "pdResp";
    public static final String FIELD_FORM_PLATE_MODE = "formPlateMode";
    public static final String FIELD_PICK_MODE_LEN_DIR = "pickModeLenDir";
    public static final String FIELD_PICK_MODE_WID_DIR = "pickModeWidDir";
    public static final String FIELD_AUTO_MANUAL_FLAG = "autoManualFlag";
    public static final String FIELD_ORDER_NUM_IN_PLATE = "orderNumInPlate";
    public static final String FIELD_TOT_SMALL_PLATE_NUM = "totSmallPlateNum";
    public static final String FIELD_AD_TYPE_CODE = "adTypeCode";
    public static final String FIELD_AD_MODE_CODE = "adModeCode";
    public static final String FIELD_UOE_FLAG = "uoeFlag";
    public static final String FIELD_ULT_CODE = "ultCode";
    public static final String FIELD_COOL_CODE = "coolCode";
    public static final String FIELD_CTRL_ROLL_CODE = "ctrlRollCode";
    public static final String FIELD_WITH_SIDE_FLAG = "withSideFlag";
    public static final String FIELD_CUT_MODE_CODE = "cutModeCode";
    public static final String FIELD_HEAD_CUT = "headCut";
    public static final String FIELD_TAIL_CUT = "tailCut";
    public static final String FIELD_SG_SIGN = "sgSign";
    public static final String FIELD_ST_NO = "stNo";
    public static final String FIELD_TWO_ROLL_INTERIM_FLAG = "twoRollInterimFlag";
    public static final String FIELD_ROLL_AIM_THICK = "rollAimThick";
    public static final String FIELD_ROLL_AIM_WIDTH = "rollAimWidth";
    public static final String FIELD_ROLL_AIM_LEN = "rollAimLen";
    public static final String FIELD_COMBINE_PLATE_WIDTH = "combinePlateWidth";
    public static final String FIELD_COMBINE_PLATE_LEN = "combinePlateLen";
    public static final String FIELD_ROLL_WT_HP = "rollWtHp";
    public static final String FIELD_ROLL_THICK_TOL_MAX = "rollThickTolMax";
    public static final String FIELD_ROLL_THICK_TOL_MIN = "rollThickTolMin";
    public static final String FIELD_COMMAND_YIELD = "commandYield";
    public static final String FIELD_ROLL_DIRECT_CODE = "rollDirectCode";
    public static final String FIELD_SAMPLE_LEN_HEAD = "sampleLenHead";
    public static final String FIELD_SAMPLE_LEN_TAIL = "sampleLenTail";
    public static final String FIELD_SAMPLE_LEN_MID = "sampleLenMid";
    public static final String FIELD_G_FLAG = "gFlag";
    public static final String FIELD_CS_FLAG = "csFlag";
    public static final String FIELD_DSS_FLAG = "dssFlag";
    public static final String FIELD_SS_FLAG = "ssFlag";
    public static final String FIELD_DS_FLAG = "dsFlag";
    public static final String FIELD_OTHER_PLATE_NO1 = "otherPlateNo1";
    public static final String FIELD_OTHER_PLATE_NO2 = "otherPlateNo2";
    public static final String FIELD_FORM_PLATE_TIME = "formPlateTime";
    public static final String FIELD_REC_DEL_TIME = "recDelTime";
    public static final String FIELD_SHP_CODE = "shpCode";
    public static final String FIELD_TAPER_ROLL_THICK4 = "taperRollThick4";
    public static final String FIELD_TAPER_ROLL_THICK_MAX4 = "taperRollThickMax4";
    public static final String FIELD_TAPER_ROLL_THICK_MIN4 = "taperRollThickMin4";
    public static final String FIELD_TAPER_ROLL_THICK5 = "taperRollThick5";
    public static final String FIELD_TAPER_ROLL_THICK_MAX5 = "taperRollThickMax5";
    public static final String FIELD_TAPER_ROLL_THICK_MIN5 = "taperRollThickMin5";
    public static final String FIELD_TAPER_ROLL_THICK6 = "taperRollThick6";
    public static final String FIELD_TAPER_ROLL_THICK_MAX6 = "taperRollThickMax6";
    public static final String FIELD_TAPER_ROLL_THICK_MIN6 = "taperRollThickMin6";
    public static final String FIELD_TAPER_ROLL_THICK7 = "taperRollThick7";
    public static final String FIELD_TAPER_ROLL_THICK_MAX7 = "taperRollThickMax7";
    public static final String FIELD_TAPER_ROLL_THICK_MIN7 = "taperRollThickMin7";
    public static final String FIELD_TAPER_ROLL_LEN6 = "taperRollLen6";
    public static final String FIELD_TAPER_ROLL_LEN7 = "taperRollLen7";
    public static final String FIELD_TENANT_ID = "tenantId";
    public static final String FIELD_OBJECT_VERSION_NUMBER = "objectVersionNumber";
    public static final String FIELD_CREATION_DATE = "creationDate";
    public static final String FIELD_CREATED_BY = "createdBy";
    public static final String FIELD_LAST_UPDATED_BY = "lastUpdatedBy";
    public static final String FIELD_LAST_UPDATE_DATE = "lastUpdateDate";
    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
    @GeneratedValue
    private Long pmPdPlateId;
    @ApiModelProperty(value = "临时命令板坯号", required = true)
    @NotBlank
    private String tmpSlabNo;
    @ApiModelProperty(value = "组批工序顺序号")
    private Long pdBacklogSeq;
    @ApiModelProperty(value = "组批工序代码")
    private String pdBacklogCode;
    @ApiModelProperty(value = "钢板号")
    private String plateNo;
    @ApiModelProperty(value = "板坯号")
    private String slabNo;
    @ApiModelProperty(value = "材料设计种类")
    private String matDesignKind;
    @ApiModelProperty(value = "厚板品种代码")
    private String prodCodeHp;
    @ApiModelProperty(value = "厚板组板状态")
    private String pdStatusHp;
    @ApiModelProperty(value = "组板责任者")
    private String pdResp;
    @ApiModelProperty(value = "组板方式")
    private String formPlateMode;
    @ApiModelProperty(value = "取板方式_长度方向")
    private Long pickModeLenDir;
    @ApiModelProperty(value = "取板方式_宽度方向")
    private Long pickModeWidDir;
    @ApiModelProperty(value = "自动人工标记")
    private String autoManualFlag;
    @ApiModelProperty(value = "板内合同个数")
    private Long orderNumInPlate;
    @ApiModelProperty(value = "大板内成品小板总块数")
    private Long totSmallPlateNum;
    @ApiModelProperty(value = "AD类型代码")
    private String adTypeCode;
    @ApiModelProperty(value = "AD控制模式代码")
    private String adModeCode;
    @ApiModelProperty(value = "UOE合同标记")
    private String uoeFlag;
    @ApiModelProperty(value = "超声探伤代码")
    private String ultCode;
    @ApiModelProperty(value = "钢板缓冷代码")
    private String coolCode;
    @ApiModelProperty(value = "控轧代码")
    private String ctrlRollCode;
    @ApiModelProperty(value = "毛边切边标记")
    private String withSideFlag;
    @ApiModelProperty(value = "切断方式代码")
    private String cutModeCode;
    @ApiModelProperty(value = "头部切舍量")
    private BigDecimal headCut;
    @ApiModelProperty(value = "尾部切舍量")
    private BigDecimal tailCut;
    @ApiModelProperty(value = "牌号")
    private String sgSign;
    @ApiModelProperty(value = "内部钢种")
    private String stNo;
    @ApiModelProperty(value = "二次开坯标记")
    private String twoRollInterimFlag;
    @ApiModelProperty(value = "轧制目标厚度")
    private BigDecimal rollAimThick;
    @ApiModelProperty(value = "轧制目标宽度")
    private BigDecimal rollAimWidth;
    @ApiModelProperty(value = "轧制目标长度")
    private BigDecimal rollAimLen;
    @ApiModelProperty(value = "组合板宽度")
    private BigDecimal combinePlateWidth;
    @ApiModelProperty(value = "组合板长度")
    private BigDecimal combinePlateLen;
    @ApiModelProperty(value = "厚板轧制重量")
    private BigDecimal rollWtHp;
    @ApiModelProperty(value = "厚度公差最大")
    private BigDecimal rollThickTolMax;
    @ApiModelProperty(value = "厚度公差最小")
    private BigDecimal rollThickTolMin;
    @ApiModelProperty(value = "命令收得率")
    private BigDecimal commandYield;
    @ApiModelProperty(value = "轧制方向代码")
    private String rollDirectCode;
    @ApiModelProperty(value = "头部试材长度")
    private BigDecimal sampleLenHead;
    @ApiModelProperty(value = "尾部试材长度")
    private BigDecimal sampleLenTail;
    @ApiModelProperty(value = "中部试材长度")
    private BigDecimal sampleLenMid;
    @ApiModelProperty(value = "气切可否")
    private String gFlag;
    @ApiModelProperty(value = "CS可否")
    private String csFlag;
    @ApiModelProperty(value = "DSS可否")
    private String dssFlag;
    @ApiModelProperty(value = "SS可否")
    private String ssFlag;
    @ApiModelProperty(value = "DS可否")
    private String dsFlag;
    @ApiModelProperty(value = "余母板号1")
    private String otherPlateNo1;
    @ApiModelProperty(value = "余母板号2")
    private String otherPlateNo2;
    @ApiModelProperty(value = "组板时间")
    private String formPlateTime;
    @ApiModelProperty(value = "记录删除时刻")
    private String recDelTime;
    @ApiModelProperty(value = "钢板形状代码")
    private String shpCode;
    @ApiModelProperty(value = "特殊形状板轧制厚度4")
    private BigDecimal taperRollThick4;
    @ApiModelProperty(value = "特殊形状板轧制厚度上限4")
    private BigDecimal taperRollThickMax4;
    @ApiModelProperty(value = "特殊形状板轧制厚度下限4")
    private BigDecimal taperRollThickMin4;
    @ApiModelProperty(value = "特殊形状板轧制厚度5")
    private BigDecimal taperRollThick5;
    @ApiModelProperty(value = "特殊形状板轧制厚度上限5")
    private BigDecimal taperRollThickMax5;
    @ApiModelProperty(value = "特殊形状板轧制厚度下限5")
    private BigDecimal taperRollThickMin5;
    @ApiModelProperty(value = "特殊形状板轧制厚度6")
    private BigDecimal taperRollThick6;
    @ApiModelProperty(value = "特殊形状板轧制厚度上限6")
    private BigDecimal taperRollThickMax6;
    @ApiModelProperty(value = "特殊形状板轧制厚度下限6")
    private BigDecimal taperRollThickMin6;
    @ApiModelProperty(value = "特殊形状板轧制厚度7")
    private BigDecimal taperRollThick7;
    @ApiModelProperty(value = "特殊形状板轧制厚度上限7")
    private BigDecimal taperRollThickMax7;
    @ApiModelProperty(value = "特殊形状板轧制厚度下限7")
    private BigDecimal taperRollThickMin7;
    @ApiModelProperty(value = "特殊形状板轧制长度6")
    private BigDecimal taperRollLen6;
    @ApiModelProperty(value = "特殊形状板轧制长度7")
    private BigDecimal taperRollLen7;
    @ApiModelProperty(value = "租户ID", required = true)
    @NotNull
    private Long tenantId;
    @ApiModelProperty(value = "行版本号，用来处理锁", required = true)
    @NotNull
    private Long objectVersionNumber;
    @ApiModelProperty(value = "")
    private String attribute1;
    @ApiModelProperty(value = "")
    private String attribute2;
    @ApiModelProperty(value = "")
    private String attribute3;
    @ApiModelProperty(value = "")
    private String attribute4;
    @ApiModelProperty(value = "")
    private String attribute5;

    @ApiModelProperty("mmPlate关联id")
    private Long mmPlateId;
    
    @Transient
    @ApiModelProperty(value = "添加试样标记")
    private Long addSampleFlag;


    public void setRollAimThick(BigDecimal slabThick) {
        this.rollAimThick = Utils.conversionDecimal(slabThick, Constants.ConversionType.THICKNESS);
    }

    public void setRollAimWidth(BigDecimal slabWidth) {
        this.rollAimWidth = Utils.conversionDecimal(slabWidth, Constants.ConversionType.WIDTH);
    }

    public void setRollAimLen(BigDecimal slabLen) {
        this.rollAimLen = Utils.conversionDecimal(slabLen, Constants.ConversionType.LENGTH);
    }

    public void setRollWtHp(BigDecimal slabWeight) {
        this.rollWtHp = Utils.conversionDecimal(slabWeight, Constants.ConversionType.WEIGHT);
    }

    public void setCombinePlateWidth(BigDecimal slabWidth) {
        this.combinePlateWidth = Utils.conversionDecimal(slabWidth, Constants.ConversionType.WIDTH);
    }

    public void setCombinePlateLen(BigDecimal slabLen) {
        this.combinePlateLen = Utils.conversionDecimal(slabLen, Constants.ConversionType.LENGTH);
    }

    public void setSampleLenHead(BigDecimal slabLen) {
        this.sampleLenHead = Utils.conversionDecimal(slabLen, Constants.ConversionType.LENGTH);
    }

    public void setSampleLenTail(BigDecimal slabLen) {
        this.sampleLenTail = Utils.conversionDecimal(slabLen, Constants.ConversionType.LENGTH);
    }

    public void setSampleLenMid(BigDecimal slabLen) {
        this.sampleLenMid = Utils.conversionDecimal(slabLen, Constants.ConversionType.LENGTH);
    }

    public void setTaperRollThick4(BigDecimal slabThick) {
        this.taperRollThick4 = Utils.conversionDecimal(slabThick, Constants.ConversionType.THICKNESS);
    }

    public void setTaperRollThickMax4(BigDecimal slabThick) {
        this.taperRollThickMax4 = Utils.conversionDecimal(slabThick, Constants.ConversionType.THICKNESS);
    }

    public void setTaperRollThickMin4(BigDecimal slabThick) {
        this.taperRollThickMin4 = Utils.conversionDecimal(slabThick, Constants.ConversionType.THICKNESS);
    }

    public void setTaperRollThick5(BigDecimal slabThick) {
        this.taperRollThick5 = Utils.conversionDecimal(slabThick, Constants.ConversionType.THICKNESS);
    }

    public void setTaperRollThickMax5(BigDecimal slabThick) {
        this.taperRollThickMax5 = Utils.conversionDecimal(slabThick, Constants.ConversionType.THICKNESS);
    }

    public void setTaperRollThickMin5(BigDecimal slabThick) {
        this.taperRollThickMin5 = Utils.conversionDecimal(slabThick, Constants.ConversionType.THICKNESS);
    }

    public void setTaperRollThick6(BigDecimal slabThick) {
        this.taperRollThick6 = Utils.conversionDecimal(slabThick, Constants.ConversionType.THICKNESS);
    }

    public void setTaperRollThickMax6(BigDecimal slabThick) {
        this.taperRollThickMax6 = Utils.conversionDecimal(slabThick, Constants.ConversionType.THICKNESS);
    }

    public void setTaperRollThickMin6(BigDecimal slabThick) {
        this.taperRollThickMin6 = Utils.conversionDecimal(slabThick, Constants.ConversionType.THICKNESS);
    }

    public void setTaperRollThick7(BigDecimal slabThick) {
        this.taperRollThick7 = Utils.conversionDecimal(slabThick, Constants.ConversionType.THICKNESS);
    }

    public void setTaperRollThickMax7(BigDecimal slabThick) {
        this.taperRollThickMax7 = Utils.conversionDecimal(slabThick, Constants.ConversionType.THICKNESS);
    }

    public void setTaperRollThickMin7(BigDecimal slabThick) {
        this.taperRollThickMin7 = Utils.conversionDecimal(slabThick, Constants.ConversionType.THICKNESS);
    }

    public void setTaperRollLen6(BigDecimal slabLen) {
        this.taperRollLen6 = Utils.conversionDecimal(slabLen, Constants.ConversionType.LENGTH);
    }

    public void setTaperRollLen7(BigDecimal slabLen) {
        this.taperRollLen7 = Utils.conversionDecimal(slabLen, Constants.ConversionType.LENGTH);
    }

}
