package cn.estsh.i3plus.pojo.mes.bean;


import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

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

/**
 * @Description:
 * @Reference:
 * @Author: jessica.chen
 * @CreateDate: 2019\11\15 10:01
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_QC_ORDER_DETAIL")
@Api("MES_检验单明细")
public class MesQcOrderDetail extends BaseBean implements Serializable {

    private static final long serialVersionUID = -5412635747424111476L;
    @Column(name = "ORDER_NO")
    @ApiParam("质检单号")
    private String orderNo;

    @Column(name = "CHECK_TYPE")
    @ApiParam("检测类型")
    private Integer checkType;

    @Column(name = "CHECK_ITEM_TYPE")
    @ApiParam("检测项类型")
    private String checkItemType;

    @Column(name = "CHECK_ITEM")
    @ApiParam("检测项")
    private String checkItem;

    @Column(name = "CHECK_STANDARD")
    @ApiParam("检测标准")
    private String checkStandard;

    @Column(name = "CHECK_GUIDE")
    @ApiParam("检测指导")
    private String checkGuide;

    @Column(name = "CHECK_FREQUENCY")
    @ApiParam("频率")
    private String checkFrequency;

    @Column(name = "IS_CONCESSION")
    @ApiParam("是否允许让步")
    private Integer isConcession = 0;

    @Column(name = "ITEM_NO")
    @ApiParam("检验行号")
    private Integer itemNo = 0;

    @Column(name = "SERIAL_NUMBER")
    @ApiParam("产品条码")
    private String serialNumber;

    @Column(name = "QTY")
    @ApiParam("数量")
    private Integer qty;

    @Column(name = "FINISH_QTY")
    @ApiParam("已检数量")
    private Integer finishQty;

    @Column(name = "MAXIMUM", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("最大数")
    private Double maximum = 0d;

    @Column(name = "MINIMUM", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("最小数")
    private Double minimum = 0d;

    @Column(name = "WORK_CENTER_CODE")
    @ApiParam("产线")
    private String workCenterCode;

    @Column(name = "WORK_CELL_CODE")
    @ApiParam("工位")
    private String workCellCode;

    @Column(name = "DATA_SOURCE")
    @ApiParam("数据源")
    private String dataSource;

    @Column(name = "CHECK_VALUE_TYPE")
    @ApiParam("检测值类型")
    private String checkValueType;

    @Column(name = "IS_KEY_CHECK_ITEM")
    @ApiParam("是否关键检测项")
    private Integer isKeyCheckItem;

    @ApiParam(value = "检测项类型名称")
    @Transient
    private String businessTypeName;

    @Column(name = "CHECK_CFG_NO")
    @ApiParam("检测值配置编号")
    private String checkCfgNo;

    @Transient
    @ApiParam("判定结果")
    private Integer checkResult = 0;

    @Transient
    @ApiParam("检测值")
    private String checkValue;

}
