package cn.estsh.i3plus.ext.mes.pcn.pojo.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.*;
import java.io.Serializable;

/**
 * @author yumingxing
 * @version 1.0
 * @date 2021/1/12 15:58
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_WORK_ORDER_TRAVEL")
@NoArgsConstructor
@AllArgsConstructor
@Api("生产工单履历表")
public class MesWorkOrderTravel extends BaseBean implements Serializable {

    private static final long serialVersionUID = -5960921602026614463L;

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

    @Column(name = "ORDER_NO",nullable = false)
    @ApiParam("工单号")
    private String orderNo;

    @Column(name = "PART_NO",nullable = false)
    @ApiParam("物料号")
    private String partNo;

    @Column(name = "PART_NAME_RDD")
    @ApiParam("物料名称")
    private String partNameRdd;

    @Column(name = "PROD_CFG_CODE")
    @ApiParam("产品配置代码")
    private String prodCfgCode;

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

    @Column(name = "COMPLETE_QTY",columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("完成数量")
    private Double completeQty;

    @Column(name = "REPAIR_QTY",columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("返修数量")
    private Double repairQty;

    @Column(name = "SCRAP_QTY",columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("报废数量")
    private Double scrapQty;

    @Column(name = "SEQ",columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("工单序号")
    private Double seq;

    @Column(name = "WO_STATUS")
    @ApiParam("工单状态")
    private Integer workOrderStatus;

    @Column(name = "IS_PULL")
    @ApiParam("是否投料")
    private Integer isPull = 1;

    @Column(name = "WO_TYPE")
    @ApiParam("工单类型")
    private Integer workOrderType;

    @Column(name = "NEXT_ORDER")
    @ApiParam("下一工单")
    private String nextOrder;

    @Column(name = "PLAN_ORDER_NO")
    @ApiParam("生产计划单号")
    private String planOrderNo;

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

    @Column(name = "AREA_CODE")
    @ApiParam("区域代码")
    private String areaCode;

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

    @Column(name = "SCHEDULE_DATE")
    @ApiParam("排产日期")
    private String scheduleDate;

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

    @Column(name = "SHIFT_CODE")
    @ApiParam("班次")
    private String shiftCode;

    @Column(name = "START_TIME")
    @ApiParam("开始时间")
    private String startTime;

    @Column(name = "END_TIME")
    @ApiParam("结束时间")
    private String endTime;

    @Column(name = "WO_SOURCE")
    @ApiParam("工单来源")
    private String workOrderSource;

    @Column(name = "MEMO")
    @ApiParam("备注")
    private String memo;

    @Column(name = "SHIFT_GROUP")
    @ApiParam("班组")
    private String shiftGroup;

    @Column(name = "APPROVAL_STATUS")
    @ApiParam("审批状态")
    private Integer approvalStatus;

    @Column(name = "CUST_CODE")
    @ApiParam("客户代码")
    private String custCode;

    @Column(name = "CUST_ORDER_NO")
    @ApiParam("客户订单号")
    private String custOrderNo;

    @Column(name = "FI_QTY",columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("首检数量")
    private Double fiQty;

    @Column(name = "FI_COMPLETE_QTY",columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("首检完成数量")
    private Double fiCompleteQty;

    @Column(name = "FI_GENERATE_QTY", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("首检生成数量")
    private Double fiGenerateQty;

    @Lob
    @Column(name = "EXTEND")
    @ApiParam("扩展数据")
    public String extend;

    @Column(name = "RESERVED1")
    @ApiParam("预留字段1")
    private String reserved1;

    @Column(name = "RESERVED2")
    @ApiParam("预留字段2")
    private String reserved2;

    @Column(name = "RESERVED3")
    @ApiParam("预留字段3")
    private String reserved3;

    @Column(name = "RESERVED4")
    @ApiParam("预留字段4")
    private String reserved4;

    @Column(name = "PARENT_PART_NO")
    @ApiParam("父阶物料号")
    private String parentPartNo;

    @Column(name = "PRINT_STATUS")
    @ApiParam("打印状态")
    private Integer printStatus;

    @Column(name = "SORT_SEQ")
    @ApiParam("排序序号")
    private String sortSeq;

    @Column(name = "PLAN_QTY",columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("计划返工数量")
    private Double planQty;

    @Column(name = "PLAN_COMPLETE_QTY",columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("计划完成数量")
    private Double planCompleteQty;

    @Column(name = "SN_CREATE_STATUS")
    @ApiParam("条码生成状态")
    private Integer snCreateStatus;

    @Column(name = "MISSING_QTY", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("缺件数量")
    private Double missingQty;

    @Column(name = "ERP_WARE_HOUSE")
    @ApiParam("Erp库存地")
    private String erpWarehouse;

    @Column(name = "SEQ1")
    @ApiParam("工单序号1")
    private String seq1;

    @Column(name = "PID")
    @ApiParam("pid")
    private Long pid;

    @Column(name = "SYNC_SEQ")
    @ApiParam("同步序号")
    private Integer syncSeq;

}
