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", indexes = {
        @Index(columnList = "TASK_NO")
}, uniqueConstraints = {
        @UniqueConstraint(columnNames = {"ORGANIZE_CODE", "TASK_NO"})
})
@Api("设备作业任务")
public class MesEquTask extends BaseBean implements Serializable {

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

    @Column(name = "TASK_TYPE")
    @ApiParam("作业类型")
    private Integer taskType;

    @Column(name = "TASK_STATUS")
    @ApiParam("任务状态")
    private Integer taskStatus;

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

    @Column(name = "PLAN_TIME")
    @ApiParam("计划日期")
    private String planTime;

    @Column(name = "TASK_SOURCE")
    @ApiParam("任务来源")
    private Integer taskSource;

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

    @Column(name = "NOTIFY_FLAG")
    @ApiParam("通知标识")
    private Integer notifyFlag;

    @Column(name = "RELATE_TASK")
    @ApiParam("关联任务")
    private String relateTask;

    @Transient
    @ApiParam(value = "设备代码")
    private String equipmentCode;

    @Transient
    @ApiParam(value = "计划日期起始时间")
    private String planTimeStart;

    @Transient
    @ApiParam(value = "计划日期结束时间")
    private String planTimeEnd;

    @Transient
    @ApiParam(value = "用于设备点检保养维修作业页面开窗查询任务，点检保养=1，维修=2")
    private String pageType;

    @Transient
    @ApiParam(value = "明细列表")
    private List<MesEquTaskDetail> mesEquTaskDetailList;

}
