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.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;

/**
 * @Description :工步
 * @Reference :
 * @Author : jack.jia
 * @CreateDate : 2019-04-02
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_STEP")
@Api("工步")
public class MesStep extends BaseBean implements Serializable {
    private static final long serialVersionUID = -1106608189453496947L;

    @Column(name = "STEP_CODE")
    @ApiParam("工步代码")
    private String stepCode;

    @Column(name = "STEP_NAME")
    @ApiParam("工步名称")
    private String stepName;

    @Column(name = "STEP_TEXT")
    @ApiParam("工步描述")
    private String stepText;

    @Column(name = "STEP_TYPE")
    @ApiParam("工步类型")
    private String stepType;

    @Column(name = "STEP_OBJECT")
    @ApiParam("工步对象")
    private String stepObject;

    @Column(name = "TRIGGER_TYPE")
    @ApiParam("触发类型")
    private Integer triggerType;

    /**
     * 工位扫描业务所需使用字段
     */
    @Transient
    @ApiParam("流程代码")
    private String routeCode;

    /**
     * 工位扫描业务所需使用字段
     */
    @Transient
    @ApiParam("工序代码")
    private String processCode;

    /**
     * 工位扫描业务所需使用字段
     */
    @Transient
    @ApiParam("工步顺序")
    private Integer stepSeq;

    /**
     * 工位扫描业务所需使用字段
     */
    @Transient
    @ApiParam("工步执行完毕")
    private boolean isComplete;

    /**
     * 工位扫描业务所需使用字段
     */
    @Transient
    @ApiParam("工步是否跳过")
    private boolean isJump;

    public MesStep() {
    }

    public MesStep(String stepCode, String stepName, String stepText, String stepType, String stepObject,
                   String routeCode, String processCode, Integer stepSeq) {
        this.stepCode = stepCode;
        this.stepName = stepName;
        this.stepText = stepText;
        this.stepType = stepType;
        this.stepObject = stepObject;
        this.routeCode = routeCode;
        this.processCode = processCode;
        this.stepSeq = stepSeq;
    }
}
