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.Table;

/**
 * @Description : 作业步骤处理组参数
 * @Reference :
 * @Author : dragon.xu
 * @CreateDate : 2018-11-22 16:53
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "WMS_ACTION_MODULE_PARAM")
@Api("作业步骤处理组参数")
public class WmsActionModuleParam extends BaseBean {

    private static final long serialVersionUID = 8099621042858629818L;
    @Column(name = "AM_ID")
    @ApiParam(value = "组件ID", example = "0")
    @JsonSerialize(using = ToStringSerializer.class)
    public Long amId;

    @Column(name = "METHOD_NAME")
    @ApiParam("组件执行方法名称")
    public String methodName;

    @Column(name = "PARAM_CODE")
    @ApiParam("参数编码")
    public String paramCode;

    @Column(name = "PARAM_NAME")
    @ApiParam("参数名称")
    public String paramName;

    @Column(name = "PARAM_VALUE_LIST")
    @ApiParam("参数可选值列表")
    public String paramValueList;

    @Column(name = "PARAM_TYPE")
    @ApiParam(value = "参数类型【1=可选列表,10=数字,20=字符串,30=出参】", example = "0")
    public Integer paramType;

    public int getParamTypeVal() {
        return this.paramType == null ? 0 : this.paramType;
    }

}
