package cn.estsh.i3plus.ext.mes.pcn.pojo.model.bu;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiParam;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Transient;
import java.io.Serializable;

/**
 * @author wangjie
 * @version 1.0
 * @date 2021/1/15 15:32
 **/
@Data
@ApiModel("BU关键件绑定规则 MODEL")
public class BuMesKpsnRuleModel implements Serializable {

    private static final long serialVersionUID = 3615465424941928548L;

    @ApiParam("项目代码")
    private String prodCfgTypeCode;

    @ApiParam("物料号")
    private String partNo;

    @ApiParam("长度")
    private Integer length;

    @ApiParam("起始1")
    private Integer from1;

    @ApiParam("至1")
    private Integer to1;

    @ApiParam("内容1")
    private String fix1;

    @ApiParam("起始2")
    private Integer from2;

    @ApiParam("至2")
    private Integer to2;

    @ApiParam("内容2")
    private String fix2;

    @ApiParam("类型")
    private String type;

    @ApiParam("绑定规则")
    private Integer bandRule;

    @ApiParam("供应商代码")
    private String supplierCode;

    @ApiParam("工序BOM序号")
    private Double seq;

    public int getLengthVal() {
        return this.length == null ? 0 : this.length;
    }

    public int getFrom1Val() {
        return this.from1 == null ? 0 : this.from1;
    }

    public int getTo1Val() {
        return this.to1 == null ? 0 : this.to1;
    }

    public int getFrom2Val() {
        return this.from2 == null ? 0 : this.from2;
    }

    public int getTo2Val() {
        return this.to2 == null ? 0 : this.to2;
    }
}
