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;


/**
 * 炼钢连铸制造命令铸机流表(PmSteelCastFlow)实体类
 *
 * @author 纪文桃 wentao.ji01@hand-china.com
 * @since 2024-10-15 14:45:52
 */

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

    public static final String FIELD_STEEL_CAST_FLOW_ID = "steelCastFlowId";
    public static final String FIELD_MAIN_BACKLOG_CODE = "mainBacklogCode";
    public static final String FIELD_PONO = "pono";
    public static final String FIELD_HEAT_SLAB_NUM = "heatSlabNum";
    public static final String FIELD_SLAB_THICK = "slabThick";
    public static final String FIELD_SLAB_WIDTH = "slabWidth";
    public static final String FIELD_ADJUST_WIDTH_NUM = "adjustWidthNum";
    public static final String FIELD_UNAPP_SLAB_LEN = "unappSlabLen";
    public static final String FIELD_UNAPP_SLAB_LEN_MAX = "unappSlabLenMax";
    public static final String FIELD_UNAPP_SLAB_LEN_MIN = "unappSlabLenMin";
    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";
    public static final String FIELD_STRAND_NO = "strandNo";

    @Id
    @GeneratedValue
    private Long steelCastFlowId;

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

    @ApiModelProperty(value = "制造命令号")
    private String pono;

    @ApiModelProperty(value = "炉内板坯块数")
    private Long heatSlabNum;

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

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

    @ApiModelProperty(value = "板坯宽度")
    private BigDecimal slabWidth;

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

    @ApiModelProperty(value = "调宽次数")
    private Long adjustWidthNum;

    @ApiModelProperty(value = "请求外板坯长度")
    private BigDecimal unappSlabLen;

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

    @ApiModelProperty(value = "请求外板坯长度上限")
    private BigDecimal unappSlabLenMax;

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

    @ApiModelProperty(value = "请求外板坯长度下限")
    private BigDecimal unappSlabLenMin;

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

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

    private String attribute1;

    private String attribute2;

    private String attribute3;

    private String attribute4;

    private String attribute5;

    @ApiModelProperty(value = "流号")
    private String strandNo;


}
