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

import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
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", nullable = false)
    @ApiParam(value = "组件ID")
    @JsonSerialize(using = ToStringSerializer.class)
    @AnnoOutputColumn
    public Long amId;

    @Column(name = "METHOD_NAME", columnDefinition = "varchar(255) default ''")
    @ApiParam("组件执行方法名称")
    @AnnoOutputColumn
    public String methodName;

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

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

    @Column(name = "PARAM_VALUE_LIST", columnDefinition = "varchar(225) default ''")
    @ApiParam("参数可选值列表")
    public String paramValueList;

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

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

}
