package cn.estsh.i3plus.pojo.mes.bean;

import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.mes.model.StepResult;
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;

/**
 * @author Wynne.Lu
 * @date 2020/3/30 11:12
 * @desc
 */
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_STATE_MACHINE_STATUS")
@Api("MES状态机步骤")
public class MesStateMachineStatus extends BaseBean implements Serializable {
    private static final long serialVersionUID = 6093522587973076640L;

    @Column(name = "SM_CODE")
    @ApiParam("状态机代码")
    private String smCode;

    @Column(name = "ROUTE_CODE")
    @ApiParam("流程代码")
    private String routeCode;

    @Column(name = "STATUS_CODE")
    @ApiParam("状态代码")
    private String statusCode;

    @Column(name = "NEXT_STATUS")
    @ApiParam("下一状态")
    private String nextStatus;

    @Column(name = "STATUS_NAME")
    @ApiParam("状态名称")
    private String statusName;

    @Column(name = "TRIGGER_TYPE")
    @ApiParam("触发类型 10=内部触发 20=外部触发")
    private Integer triggerType;

    @Column(name = "TRIGGER_EVENT")
    @ApiParam("触发事件")
    private String triggerEvent;

    @Column(name = "TRIGGER_WHERE")
    @ApiParam("触发条件")
    private String triggerWhere;

    @Column(name = "TRIGGER_AMG_ID")
    @ApiParam("触发调用")
    private Long triggerAmgId;

    @Column(name = "IN_AMG_ID")
    @ApiParam("进入调用")
    private Long inAmgId;

    @Column(name = "OUT_AMG_ID")
    @ApiParam("离开调用")
    private Long outAmgId;

    @Column(name = "STATUS_TYPE")
    @ApiParam("状态类型 10=初始化状态")
    private Integer statusType;

    @Column(name = "SEQ")
    @ApiParam("状态点顺序")
    private Integer seq;

    @Column(name = "IS_INIT")
    @ApiParam("是否初始化")
    private Integer isInit = 1;

    @Transient
    @ApiParam("状态点是否完成")
    private boolean isComplete;

    @Transient
    @ApiParam("状态点是否完成")
    private boolean isJump;

    @Transient
    @ApiParam("前端显示颜色")
    private String color;

//    @Transient
//    @ApiParam("状态执行情况")
//    private StepResult stepResult;

}
