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.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:
 * @Author: xiangming.liao
 * @Date: 2021/02/04 17:44
 * @Modify:
 */
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_REPAIR_TASK", indexes = {
        @Index(columnList = "PART_NO"),
        @Index(columnList = "WORK_TIME"),
        @Index(columnList = "PRODUCT_SN"),
        @Index(columnList = "THIRD_PARTY_PID")
})
@Api("MES_维修作业单")
public class MesRepairTask extends BaseBean implements Serializable {
    private static final long serialVersionUID = -4222952384923759596L;

    @Column(
            name = "REPAIR_NO",
            nullable = false
    )
    @ApiParam("维修单号")
    private String repairNo;

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

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

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

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

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

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

    @Column(name = "REPAIR_DATE")
    @ApiParam("维修日期")
    private String repairDate;

    @Column(name = "REPAIR_USER")
    @ApiParam("维修人员")
    private String repairUser;

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

    @Column(name = "WORK_TIME")
    @ApiParam("作业时间")
    private String workTime;

    //EP
    @Column(name = "DEFECT_TYPE")
    @ApiParam("不良类型代码")
    private String defectType;

    @Column(name = "MANAGE_CODE")
    @ApiParam("管理码")
    private String manageCode;

    @Column(name = "PRODUCT_SN")
    @ApiParam("产品条码")
    private String productSn;

    @Column(name = "THIRD_PARTY_PID")
    @ApiParam("关联ID")
    private String thirdPartyPid;

}
