package com.xisc.pm.domain.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;

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;

/**
 * 板坯信息表(PmPdSlabInfo)实体类
 *
 * @author 纪文桃 wentao.ji01@hand-china.com
 * @since 2024-08-12 14:59:21
 */

@Getter
@Setter
@ApiModel("板坯信息表")
@VersionAudit
@ModifyAudit
@JsonInclude(value = JsonInclude.Include.NON_NULL)
@Table(name = "PM_PD_SLAB_INFO")
public class PmPdSlabInfo extends AuditDomain implements Serializable {
    private static final long serialVersionUID = -62362702095703037L;

    public static final String FIELD_PM_PD_SLAB_INFO_ID = "pmPdSlabInfoId";
    public static final String FIELD_SLAB_NO = "slabNo";
    public static final String FIELD_WHOLE_BACKLOG_SEQ = "wholeBacklogSeq";
    public static final String FIELD_WHOLE_BACKLOG_CODE = "wholeBacklogCode";
    public static final String FIELD_NEXT_WHOLE_BACKLOG_SEQ = "nextWholeBacklogSeq";
    public static final String FIELD_NEXT_WHOLE_BACKLOG_CODE = "nextWholeBacklogCode";
    public static final String FIELD_OU_BACKLOG_SEQ = "ouBacklogSeq";
    public static final String FIELD_OU_BACKLOG_CODE = "ouBacklogCode";
    public static final String FIELD_PONO = "pono";
    public static final String FIELD_MAT_STATUS = "matStatus";
    public static final String FIELD_SLAB_FLAG = "slabFlag";
    public static final String FIELD_PD_STATUS_HP = "pdStatusHp";
    public static final String FIELD_AUTO_MANUAL_FLAG = "autoManualFlag";
    public static final String FIELD_PD_BEGIN_TIME = "pdBeginTime";
    public static final String FIELD_PD_END_TIME = "pdEndTime";
    public static final String FIELD_PD_PROGRAM = "pdProgram";
    public static final String FIELD_PD_RESP = "pdResp";
    public static final String FIELD_STOCK_CODE = "stockCode";
    public static final String FIELD_SG_SIGN = "sgSign";
    public static final String FIELD_ST_NO = "stNo";
    public static final String FIELD_PREC_ST_NO = "precStNo";
    public static final String FIELD_DECI_ST_NO = "deciStNo";
    public static final String FIELD_FIN_ST_NO = "finStNo";
    public static final String FIELD_PSC = "psc";
    public static final String FIELD_APN = "apn";
    public static final String FIELD_MSC = "msc";
    public static final String FIELD_MSC_LINE_NO = "mscLineNo";
    public static final String FIELD_OLD_PSC = "oldPsc";
    public static final String FIELD_OLD_APN = "oldApn";
    public static final String FIELD_OLD_MSC = "oldMsc";
    public static final String FIELD_OLD_MSC_LINE = "oldMscLine";
    public static final String FIELD_CAN_ASSIGN_FLAG = "canAssignFlag";
    public static final String FIELD_REMAIN_CAUSE_CODE = "remainCauseCode";
    public static final String FIELD_COMPLEX_DECIDE_CODE = "complexDecideCode";
    public static final String FIELD_MAT_ACT_THICK = "matActThick";
    public static final String FIELD_MAT_ACT_WIDTH = "matActWidth";
    public static final String FIELD_MAT_ACT_LEN = "matActLen";
    public static final String FIELD_MAT_ACT_WT = "matActWt";
    public static final String FIELD_MAT_THEORY_WT = "matTheoryWt";
    public static final String FIELD_SLAB_PLACE_CODE = "slabPlaceCode";
    public static final String FIELD_TWO_ROLL_INTERIM_FLAG = "twoRollInterimFlag";
    public static final String FIELD_CC_TYPE = "ccType";
    public static final String FIELD_PD_RESP_AUTO = "pdRespAuto";
    public static final String FIELD_PD_TIME_AUTO = "pdTimeAuto";
    public static final String FIELD_PD_AUTO_FLAG = "pdAutoFlag";
    public static final String FIELD_INGOT_TYPE = "ingotType";
    public static final String FIELD_COMPOSITE_SLAB_NO = "compositeSlabNo";
    public static final String FIELD_SLAB_TYPE = "slabType";
    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")
    @Id
    @GeneratedValue
    private Long pmPdSlabInfoId;
    @ApiModelProperty(value = "板坯号")
    private String slabNo;
    @ApiModelProperty(value = "全程工序顺序号")
    private Long wholeBacklogSeq;
    @ApiModelProperty(value = "全程工序代码")
    private String wholeBacklogCode;
    @ApiModelProperty(value = "后全程工序顺序号")
    private Long nextWholeBacklogSeq;
    @ApiModelProperty(value = "后全程工序代码")
    private String nextWholeBacklogCode;
    @ApiModelProperty(value = "组批工序顺序号")
    private Long ouBacklogSeq;
    @ApiModelProperty(value = "组批工序代码")
    private String ouBacklogCode;
    @ApiModelProperty(value = "制造命令号")
    private String pono;
    @ApiModelProperty(value = "材料状态号")
    private String matStatus;
    @ApiModelProperty(value = "长板坯标记")
    private String slabFlag;
    @ApiModelProperty(value = "厚板组板状态")
    private String pdStatusHp;
    @ApiModelProperty(value = "自动人工标记")
    private String autoManualFlag;
    @ApiModelProperty(value = "组批开始时间")
    private Date pdBeginTime;
    @ApiModelProperty(value = "组批结束时间")
    private Date pdEndTime;
    @ApiModelProperty(value = "组批程序")
    private String pdProgram;
    @ApiModelProperty(value = "组板责任者")
    private String pdResp;
    @ApiModelProperty(value = "库区代码")
    private String stockCode;
    @ApiModelProperty(value = "牌号（钢级）")
    private String sgSign;
    @ApiModelProperty(value = "出钢记号")
    private String stNo;
    @ApiModelProperty(value = "预定出钢记号")
    private String precStNo;
    @ApiModelProperty(value = "决定出钢记号")
    private String deciStNo;
    @ApiModelProperty(value = "最终出钢记号")
    private String finStNo;
    @ApiModelProperty(value = "产品规范码")
    private String psc;
    @ApiModelProperty(value = "产品最终用途码")
    private String apn;
    @ApiModelProperty(value = "冶金规范码")
    private String msc;
    @ApiModelProperty(value = "产线号")
    private String mscLineNo;
    @ApiModelProperty(value = "原产品规范码")
    private String oldPsc;
    @ApiModelProperty(value = "原产品用途码")
    private String oldApn;
    @ApiModelProperty(value = "原冶金规范码")
    private String oldMsc;
    @ApiModelProperty(value = "原产线号")
    private String oldMscLine;
    @ApiModelProperty(value = "可充当标记")
    private String canAssignFlag;
    @ApiModelProperty(value = "余材原因代码")
    private String remainCauseCode;
    @ApiModelProperty(value = "综合判定代码")
    private String complexDecideCode;
    @ApiModelProperty(value = "材料实际厚度")
    private BigDecimal matActThick;
    @ApiModelProperty(value = "材料实际宽度")
    private BigDecimal matActWidth;
    @ApiModelProperty(value = "材料实际长度")
    private BigDecimal matActLen;
    @ApiModelProperty(value = "材料实际重量")
    private BigDecimal matActWt;
    @ApiModelProperty(value = "材料理论重量")
    private BigDecimal matTheoryWt;
    @ApiModelProperty(value = "板坯位置代码")
    private String slabPlaceCode;
    @ApiModelProperty(value = "二次开坯标记")
    private Long twoRollInterimFlag;
    @ApiModelProperty(value = "连铸机类型")
    private String ccType;
    @ApiModelProperty(value = "收小池责任者")
    private String pdRespAuto;
    @ApiModelProperty(value = "收小池时间")
    private Date pdTimeAuto;
    @ApiModelProperty(value = "正在自动组板中标记")
    private String pdAutoFlag;
    @ApiModelProperty(value = "锭坯型")
    private String ingotType;
    
    @ApiModelProperty(value = "复合板类型")
    private String slabType ;
    
    @ApiModelProperty(value = "复合板类型")
    private String compositeSlabNo ;
    
    @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(value = "临时命令板坯号")
    @Transient
    private String tmpSlabNo;

    public void setMatActThick(BigDecimal matActThick) {
        this.matActThick = Utils.conversionDecimal(matActThick, Constants.ConversionType.THICKNESS);
    }

    public void setMatActWidth(BigDecimal matActWidth) {
        this.matActWidth = Utils.conversionDecimal(matActWidth, Constants.ConversionType.WIDTH);
    }

    public void setMatActLen(BigDecimal matActLen) {
        this.matActLen = Utils.conversionDecimal(matActLen, Constants.ConversionType.LENGTH);
    }

    public void setMatActWt(BigDecimal matActWt) {
        this.matActWt = Utils.conversionDecimal(matActWt, Constants.ConversionType.WEIGHT);
    }

}
