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.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;


/**
 * 炼钢连铸制造命令LOT表(PmSteelCastLot)实体类
 *
 * @author 纪文桃 wentao.ji01@hand-china.com
 * @since 2024-08-16 08:25:58
 */

@Getter
@Setter
@ApiModel("炼钢连铸制造命令LOT表")
@VersionAudit
@ModifyAudit
@JsonInclude(value = JsonInclude.Include.NON_NULL)
@Table(name = "PM_STEEL_CAST_LOT")
public class PmSteelCastLot extends AuditDomain implements Serializable {
    private static final long serialVersionUID = -86730364051742300L;

    public static final String FIELD_STEEL_CAST_LOT_ID = "steelCastLotId";
    public static final String FIELD_MAIN_BACKLOG_CODE = "mainBacklogCode";
    public static final String FIELD_CAST_LOT_NO = "castLotNo";
    public static final String FIELD_ST_NO = "stNo";
    public static final String FIELD_SG_SIGN = "sgSign";
    public static final String FIELD_LOT_STATUS = "lotStatus";
    public static final String FIELD_CC_TYPE = "ccType";
    public static final String FIELD_ORDER_TYPE_CODE = "orderTypeCode";
    public static final String FIELD_CC_PLAN_MODE = "ccPlanMode";
    public static final String FIELD_URGENCY_ORDER_MARK = "urgencyOrderMark";
    public static final String FIELD_APP_TYPE = "appType";
    public static final String FIELD_BILLET_TYPE = "billetType";
    public static final String FIELD_SLAB_GROUP_SUM = "slabGroupSum";
    public static final String FIELD_SLAB_THICK = "slabThick";
    public static final String FIELD_SLAB_NUM = "slabNum";
    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";

    @Id
    @GeneratedValue
    private Long steelCastLotId;

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

    @ApiModelProperty(value = "CAST_LOT号")
    private String castLotNo;

    @ApiModelProperty(value = "内部钢种")
    private String stNo;

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

    @ApiModelProperty(value = "LOT状态")
    private Long lotStatus;

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

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

    @ApiModelProperty(value = "连铸计划模式")
    private String ccPlanMode;

    @ApiModelProperty(value = "紧急合同标志")
    private String urgencyOrderMark;

    @ApiModelProperty(value = "材料申请类型")
    private String appType;

    @ApiModelProperty(value = "钢坯类型")
    private String billetType;

    @ApiModelProperty(value = "板坯组数")
    private Long slabGroupSum;

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

    @ApiModelProperty(value = "板坯块数")
    private Long slabNum;

    @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 setSlabThick(BigDecimal slabThick) {
        this.slabThick = Utils.conversionDecimal(slabThick, Constants.ConversionType.THICKNESS);
    }

}
