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

import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.AndonEnumUtil;
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 : ANDON_自处理配置
 * @Reference :
 * @Author : hansen.ke
 * @CreateDate : 2019-05-31 14:08
 * @Modify:
 **/
@Data
@Entity
@Table(name="ANDON_DISPOSAL_CFG")
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Api("ANDON_自处理配置")
public class AndonDisposalCfg extends BaseBean implements Serializable {

    private static final long serialVersionUID = 161656982939855466L;

    @Column(name = "WORK_CENTER_CODE")
    @ApiParam(value = "工作中心代码")
    private String workCenterCode;

    @Column(name = "WORK_CELL_CODE")
    @ApiParam(value = "工位代码")
    private String workCellCode;

    @AnnoOutputColumn(refClass = AndonEnumUtil.ALARM_TYPE.class,refForeignKey = "value",value = "description")
    @Column(name = "ALARM_CODE")
    @ApiParam(value = "安灯类型")
    private String alarmCode;

    @Column(name = "AC_CODE")
    @ApiParam(value = "事件描述编码")
    private String acCode;

    @Column(name = "AC_NAME_RDD")
    @ApiParam(value = "事件描述名称")
    private String acNameRdd;

    @Column(name = "EM_CODE")
    @ApiParam(value = "处理方法")
    private String emCode;

    @Column(name = "EM_NAME_RDD")
    @ApiParam(value = "事件方法描述")
    private String emNameRdd;

    @AnnoOutputColumn(refClass = AndonEnumUtil.KNOWLEDGE_AUDIT_STATUS.class,refForeignKey = "value",value = "description")
    @Column(name = "FLOW_STATUS")
    @ApiParam(value = "审批状态")
    private Integer flowStatus;

    @Column(name = "FLOW_MEMO")
    @ApiParam(value = "审批意见")
    private String flowMemo;

    @Transient
    @ApiParam(value = "审批意见集合")
    @AnnoOutputColumn(hidden = true)
    private Integer[] flowStatusArray;
}
