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

import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
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.Lob;
import javax.persistence.Table;

/**
 * @Description :作业记录参数表
 * @Reference :
 * @Author : jessica.chen
 * @CreateDate : 2018-11-23 13:14
 * @Modify:
 **/
@Data
@Entity
@Table(name="WMS_ACTION_LOG_DATA")
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Api(value="作业记录参数表",description = "作业记录参数表")
public class WmsActionLogData extends BaseBean {

    private static final long serialVersionUID = -8150713013135101134L;

    @Column(name = "TASK_NO")
    @ApiParam(value = "作业任务编号", example = "1")
    @JsonSerialize(using = ToStringSerializer.class)
    public String taskNo;

    @Column(name = "TRANS_TYPE_CODE")
    @ApiParam(value = "交易类型编号")
    public String transTypeCode;

    @Column(name = "ORDER_NO")
    @ApiParam(value = "业务单号")
    public String orderNo;

    @Column(name = "MOVE_NO")
    @ApiParam(value = "移动单单号")
    public String moveNo;

    @Column(name = "AG_ID")
    @ApiParam(value = "作业流程编号", example = "1")
    @JsonSerialize(using = ToStringSerializer.class)
    public Long agId;

    @Column(name = "AL_NAME_RDD")
    @ApiParam(value = "流程名称")
    public String agNameRdd;

    @Column(name = "ACTION_USER_NAME")
    @ApiParam(value = "作业人员")
    public String actionUserName;

    @Column(name = "FIX_NO")
    @ApiParam(value = "设备编号")
    public String fixNo;

    @Column(name = "AGD_SEQ")
    @ApiParam(value = "作业步骤序号")
    private Integer agdSeq;

    @Column(name = "CALL_CLASS")
    @ApiParam(value = "实现类")
    private String callClass;

    @Column(name = "CALL_FUN")
    @ApiParam(value = "调用方法")
    private String callFun;

    @Column(name = "EXECUTE_STATUS")
    @ApiParam(value = "执行状态")
    private Integer executeStatus;

    /**
     * 保存调用组件时的 params
     */
    @Lob
    @Column(name = "IN_PARAMS", columnDefinition = "TEXT")
    @ApiParam(value = "输入参数")
    private String inParams;

    /**
     * 保存调用组件后的返回值
     */
    @Lob
    @Column(name = "OUT_PARAMS", columnDefinition = "TEXT")
    @ApiParam(value = "输出参数")
    private String outParams;

    @Lob
    @Column(name = "ERROR_MSG", columnDefinition = "TEXT")
    @ApiParam(value = "异常信息")
    private String errorMsg;

    @Column(name = "DURATION")
    @ApiParam(value = "执行耗时，单位：毫秒", example = "0")
    public Integer duration = 0;
}
