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.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;


/**
 * 组炉收池表(PmSlabPoolIn)实体类
 *
 * @author 纪文桃 wentao.ji01@hand-china.com
 * @since 2024-08-07 17:11:26
 */

@Getter
@Setter
@ApiModel("组炉收池表")
@VersionAudit
@ModifyAudit
@JsonInclude(value = JsonInclude.Include.NON_NULL)
@Table(name = "PM_SLAB_POOL_IN")
public class PmSlabPoolIn extends AuditDomain implements Serializable {
    private static final long serialVersionUID = -56552790856813551L;

    public static final String FIELD_SLAB_POOL_IN_ID = "slabPoolInId";
    public static final String FIELD_VIRTUAL_SLAB_NO = "virtualSlabNo";
    public static final String FIELD_MAIN_BACKLOG_CODE = "mainBacklogCode";
    public static final String FIELD_MSC_LINE_NO = "mscLineNo";
    public static final String FIELD_USER_ID = "userId";
    public static final String FIELD_WHOLE_BACKLOG_CODE = "wholeBacklogCode";
    public static final String FIELD_ORDER_NO = "orderNo";
    public static final String FIELD_ST_NO = "stNo";
    public static final String FIELD_STEEL_PLAN_DATE = "steelPlanDate";
    public static final String FIELD_ROLL_PLAN_DATE = "rollPlanDate";
    public static final String FIELD_ESTA_STATUS = "estaStatus";
    public static final String FIELD_SLAB_DEST = "slabDest";
    public static final String FIELD_NOM_SLAB_THICK = "nomSlabThick";
    public static final String FIELD_NOM_SLAB_WIDTH = "nomSlabWidth";
    public static final String FIELD_NOM_SLAB_LEN = "nomSlabLen";
    public static final String FIELD_SLAB_MAX_NOM_LEN = "slabMaxNomLen";
    public static final String FIELD_SLAB_MIN_NOM_LEN = "slabMinNomLen";
    public static final String FIELD_CC_TYPE = "ccType";
    public static final String FIELD_NOM_SLAB_WT = "nomSlabWt";
    public static final String FIELD_SLAB_MAX_NOM_WT = "slabMaxNomWt";
    public static final String FIELD_SLAB_MIN_NOM_WT = "slabMinNomWt";
    public static final String FIELD_SLAB_PLACE_CODE = "slabPlaceCode";
    public static final String FIELD_NOM_ROLL_WIDTH = "nomRollWidth";
    public static final String FIELD_NOM_ROLL_THICK = "nomRollThick";
    public static final String FIELD_WHOLE_BACKLOG = "wholeBacklog";
    public static final String FIELD_URG_ORDER_FLAG = "urgOrderFlag";
    public static final String FIELD_IG_MAT_DESIGN_KIND = "igMatDesignKind";
    public static final String FIELD_INGOT_TYPE = "ingotType";
    public static final String FIELD_ORDER_TYPE_CODE = "orderTypeCode";
    public static final String FIELD_ORDER_DELAY_FLAG = "orderDelayFlag";
    public static final String FIELD_SG_SIGN = "sgSign";
    public static final String FIELD_NOM_HOT_SEND_FLAG = "nomHotSendFlag";
    public static final String FIELD_DELIVY_DATE = "delivyDate";
    public static final String FIELD_CONSIGN_CUST_CNAME = "consignCustCname";
    public static final String FIELD_DELIVY_PLACE_NAME = "delivyPlaceName";
    public static final String FIELD_ORDER_HOT_CHARGE_FLAG = "orderHotChargeFlag";
    public static final String FIELD_PRESS_USE_CODE = "pressUseCode";
    public static final String FIELD_RF_PATH = "rfPath";
    public static final String FIELD_SG_CODE = "sgCode";
    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 slabPoolInId;

    @ApiModelProperty(value = "虚拟板坯号")
    private String virtualSlabNo;

    @ApiModelProperty(value = "厂别")
    private String mainBacklogCode;

    @ApiModelProperty(value = "产线号")
    private String mscLineNo;

    @ApiModelProperty(value = "组炉责任者", required = true)
    @NotBlank
    private String userId;

    @ApiModelProperty(value = "全程工序代码")
    private String wholeBacklogCode;

    @ApiModelProperty(value = "轴合同号")
    private String orderNo;

    @ApiModelProperty(value = "额定出钢记号")
    private String stNo;

    @ApiModelProperty(value = "炼钢计划日期(yyyy-MM-dd)")
    private Date steelPlanDate;

    @ApiModelProperty(value = "轧制计划日期(yyyy-MM-dd)")
    private Date rollPlanDate;

    @ApiModelProperty(value = "编制状态")
    private String estaStatus;

    @ApiModelProperty(value = "板坯去向")
    private String slabDest;

    @ApiModelProperty(value = "额定板坯厚度")
    private BigDecimal nomSlabThick;

    @ApiModelProperty(value = "额定板坯(钢坯)宽度")
    private BigDecimal nomSlabWidth;

    @ApiModelProperty(value = "额定板坯长度")
    private BigDecimal nomSlabLen;

    @ApiModelProperty(value = "板坯(钢坯)最大额定长度")
    private BigDecimal slabMaxNomLen;

    @ApiModelProperty(value = "板坯(钢坯)最小额定长度")
    private BigDecimal slabMinNomLen;

    @ApiModelProperty(value = "连铸机类型")
    private String ccType;

    @ApiModelProperty(value = "额定板坯重量")
    private BigDecimal nomSlabWt;

    @ApiModelProperty(value = "板坯(钢坯)最大额定重量")
    private BigDecimal slabMaxNomWt;

    @ApiModelProperty(value = "板坯(钢坯)最小额定重量")
    private BigDecimal slabMinNomWt;

    @ApiModelProperty(value = "板坯位置代码")
    private String slabPlaceCode;

    @ApiModelProperty(value = "额定轧制宽度")
    private BigDecimal nomRollWidth;

    @ApiModelProperty(value = "额定轧制厚度")
    private BigDecimal nomRollThick;

    @ApiModelProperty(value = "全程工序途径码")
    private String wholeBacklog;

    @ApiModelProperty(value = "紧急合同标记")
    private String urgOrderFlag;

    @ApiModelProperty(value = "钢锭材料设计种类")
    private String igMatDesignKind;

    @ApiModelProperty(value = "锭坯型")
    private String ingotType;

    @ApiModelProperty(value = "合同性质代码")
    private String orderTypeCode;

    @ApiModelProperty(value = "合同拖期标记")
    private String orderDelayFlag;

    @ApiModelProperty(value = "牌号")
    private String sgSign;

    @ApiModelProperty(value = "额定热送标记")
    private String nomHotSendFlag;

    @ApiModelProperty(value = "交货日期")
    private Date delivyDate;

    @ApiModelProperty(value = "收货单位")
    private String consignCustCname;

    @ApiModelProperty(value = "到站港")
    private String delivyPlaceName;

    @ApiModelProperty(value = "合同热装标记")
    private String orderHotChargeFlag;

    @ApiModelProperty(value = "轻压下采用代码")
    private String pressUseCode;

    @ApiModelProperty(value = "精炼路径")
    private String rfPath;

    @ApiModelProperty(value = "牌号代码")
    private String sgCode;

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

    private String attribute1;

    private String attribute2;

    private String attribute3;

    private String attribute4;

    private String attribute5;

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

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

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

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

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

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

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

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

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

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

}
