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.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

/**
 * @Description :设备作业任务明细
 * @Reference :
 * @Author : wangjie
 * @CreateDate : 2019-10-11
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_EQU_TASK_DETAIL", indexes = {
        @Index(columnList = "EQUIPMENT_CODE")
}, uniqueConstraints = {
        @UniqueConstraint(columnNames = {"ORGANIZE_CODE", "TASK_NO", "EQUIPMENT_CODE"})
})
@Api("设备作业任务明细")
public class MesEquTaskDetail extends BaseBean implements Serializable {

    private static final long serialVersionUID = 3317290109159353376L;
    @Column(name = "TASK_NO", nullable = false)
    @ApiParam("作业任务编号")
    private String taskNo;

    @Column(name = "EQUIPMENT_CODE", nullable = false)
    @ApiParam("设备代码")
    private String equipmentCode;

    @Column(name = "EQUIPMENT_NAME")
    @ApiParam("设备名称")
    private String equipmentName;

    @Column(name = "ACTION_STATUS")
    @ApiParam("执行状态")
    private Integer actionStatus;

    @Column(name = "FINAL_RESULT")
    @ApiParam("整体结果")
    private Integer finalResult;

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

    @Column(name = "REPAIR_FLAG")
    @ApiParam("维修标识")
    private Integer repairFlag;

    @Transient
    @ApiParam(value = "点检保养记录")
    private List<MesEquTaskStandardRecord> equTaskStandardRecordList;

    @Transient
    @ApiParam(value = "工位")
    private String workCellCode;

    @Transient
    @ApiParam(value = "生产线")
    private String workCenterCode;

    @Transient
    @ApiParam(value = "故障现象")
    private String fpCode;

    @Transient
    @ApiParam(value = "故障原因")
    private String fcCode;

    @Transient
    @ApiParam(value = "处理方法")
    private String fmCode;

    @Transient
    @ApiParam(value = "任务类型")
    private Integer taskType;

    @Transient
    @ApiParam(value = "关联任务")
    private String relateTask;

}
