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

import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtEnumUtil;
import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
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.Index;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * @Description :
 * @Reference :
 * @Author : steven.peng
 * @CreateDate : 2023-01-10 13:24
 * @Modify:
 **/
@Data
@Entity
@DynamicUpdate
@DynamicInsert
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_OUTER_PACKAGE_DETAIL", indexes = {
        @Index(columnList = "WORK_ORDER_NO"),
        @Index(columnList = "INNER_PACKAGE_NO"),
        @Index(columnList = "OUTER_PACKAGE_NO")
})
@Api("大包装条码明细表")
public class MesOuterPackageDetail extends BaseBean implements Serializable {


    private static final long serialVersionUID = 730507520101612655L;

    /** 生产工单号 */
    @Column(name = "WORK_ORDER_NO")
    @ApiParam("生产工单号")
    private String workOrderNo ;

    /** 工作单元代码 */
    @Column(name = "WORK_CELL_CODE")
    @ApiParam("工作单元代码")
    private String workCellCode ;

    /** 工作单元名称 */
    @Column(name = "WORK_CELL_NAME")
    @ApiParam("工作单元名称")
    private String workCellName ;

    /** 工作中心代码 */
    @Column(name = "WORK_CENTER_CODE")
    @ApiParam("工作中心代码")
    private String workCenterCode ;

    /** 生产线名称 */
    @Column(name = "WORK_CENTER_NAME")
    @ApiParam("生产线名称")
    private String workCenterName ;

    @Column(name = "OUTER_PACKAGE_NO")
    @ApiParam("大包装条码")
    private String outerPackageNo ;

    @Column(name = "INNER_PACKAGE_NO")
    @ApiParam("小包装条码")
    private String innerPackageNo ;

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

    /** 绑定状态 10表示绑定 20表示未绑定*/
    @Column(name = "BIND_STATUS")
    @ApiParam("绑定状态")
    @AnnoOutputColumn(refClass = MesPcnExtEnumUtil.PACKAGE_BIND_STATUS.class, refForeignKey = "value", value = "description")
    private Integer bindStatus ;

    /** 系统同步标志 */
    @Column(name = "SYSTEM_SYNC_STATUS")
    @ApiParam("系统同步标志")
    @ColumnDefault("2")
    private Integer systemSyncStatus = 2;


}
