package cn.estsh.i3plus.pojo.andon.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;

/**
 * @author wangjie
 * @date 2020/2/12 17:41
 * @desc
 */

@Data
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "ANDON_ROUTE_STATUS")
@EqualsAndHashCode(callSuper = true)
@Api("流程状态")
public class AndonRouteStatus extends BaseBean implements Serializable {

    private static final long serialVersionUID = 2091426896667989586L;

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

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

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

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

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

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

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

    @Column(name = "ACTION_AMG_ID")
    @ApiParam("触发调用")
    private Long actionAmgId;

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

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

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

    @Column(name = "INTERFACE_NO")
    @ApiParam("界面编号")
    private String interfaceNo;

    @Transient
    @ApiParam("安灯流程ID")
    private Long alarmRouteId;

    @Transient
    @ApiParam("当前状态点的触发组件集默认未执行")
    private boolean actionAmgIdFalg = false;

    @Transient
    @ApiParam("进入触发方法时默认不需要校验外部触发")
    private boolean checkTriggerTypeFalg = false;

    @Transient
    @ApiParam("每个组件执行完成根据业务设置下个触发事件，如果需要外部告知下个触发事件则设置null，一个组件集执行完毕后将这个值赋给CommonMsgModel的triggerEvent")
    private String nextTriggerEvent;

}
