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.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
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 java.io.Serializable;

/**
 * @Description:
 * @Reference:
 * @Author: joke.wang
 * @CreateDate: 2019\11\15 10:12
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "IF_PRODUCT_OFF_LINE")
@NoArgsConstructor
@AllArgsConstructor
@Api("生产报工表")
public class IfProductOffLine extends BaseBean implements Serializable {

    private static final long serialVersionUID = -4960147948435537306L;
    @Column(name = "PART_NO")
    @ApiParam("物料号")
    private String partNo;

    @Column(name = "PART_NAME")
    @ApiParam("物料名称")
    private String partName;

    @Column(name = "PACKAGE_NO")
    @ApiParam("包装条码")
    private String packageNo;

    @Column(name = "QTY", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("数量")
    private Double qty;

    @Column(name = "UNIT")
    @ApiParam("单位")
    private String unit;

    @Column(name = "LOT_NO")
    @ApiParam("生产批次")
    private String lotNo;

    @Column(name = "FIX_LOT_NO")
    @ApiParam("特殊批次")
    private String fixLotNo;

    @Column(name = "ITEM_PART_NO")
    @ApiParam("原材料物料号")
    private String itemPartNo;

    @Column(name = "ITEM_PART_NAME")
    @ApiParam("原材料物料名称")
    private String itemPartName;

    @Column(name = "ITEM_QTY", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("原材料用量")
    private Double itemQty;

    @Column(name = "ITEM_UNIT")
    @ApiParam("原材料单位")
    private String itemUnit;

    @Column(name = "SUPPLIER_CODE")
    @ApiParam("供应商代码")
    private String supplierCode;

    @Column(name = "ACTION_USER")
    @ApiParam("操作人")
    private String actionUser;

    @Column(name = "ACTION_DATE_TIME")
    @ApiParam("操作时间")
    private String actionDateTime;

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

    @Column(name = "SYNC_STATUS")
    @ApiParam("同步状态")
    private Integer syncStatus;

    @Column(name = "ERROR_MESSAGE")
    @ApiParam("异常消息")
    private String errorMessage;

    @Column(name = "ACTION_CODE")
    @ApiParam("动作代码")
    private String actionCode;

    @Column(name = "IF_CODE")
    @ApiParam("接口代码")
    private String ifCode;

    @Column(name = "PRODUCE_CATEGORY_CODE")
    @ApiParam("产品位置")
    private String produceCategoryCode;

    @Column(name = "QUEUE_GROUP_NO")
    @ApiParam("分组队列编号")
    private String queueGroupNo;

    @Column(name = "JIT_LOT_NO")
    @ApiParam("JIT队列批次")
    private String jitLotNo;

    @Column(name = "VIN_CODE")
    @ApiParam("vin")
    private String vinCode;

    @Column(name = "CT_NO")
    @ApiParam("容器编号")
    private String ctNo;

    @Column(name = "CUSTOMER_CODE")
    @ApiParam("客户代码")
    private String customerCode;

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

    @Column(name = "QC_STATUS")
    @ApiParam("质量状态")
    private Integer qcStatus = 10;

    @Column(name = "JIS_BACKFLUSH_STATUS")
    @ApiParam("回冲状态")
    private String jisBackflushStatus;

    @Column(name = "CUST_PROD_LINE_CODE")
    @ApiParam("客户产线代码")
    private String custProdLineCode;

    @Column(name = "BASE_MODULE")
    @ApiParam("BaseModule零件号")
    private String baseModule;

    @Column(name = "QUEUE_GROUP_FLAG")
    @ApiParam("分组标识")
    private String queueGroupFlag;

    public IfProductOffLine(String partNo, String packageNo, Double qty, String workCenterCode, Integer qcStatus) {
        this.partNo = partNo;
        this.packageNo = packageNo;
        this.qty = qty;
        this.workCenterCode = workCenterCode;
        this.qcStatus = qcStatus;
    }

    public IfProductOffLine(String workCenterCode, String partNo, String partName, String packageNo, Double qty, String createDatetime, String workOrderNo) {
        this.workCenterCode = workCenterCode;
        this.partNo = partNo;
        this.partName = partName;
        this.packageNo = packageNo;
        this.qty = qty;
        this.createDatetime = createDatetime;
        this.workOrderNo = workOrderNo;
    }
}
