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 : silliter.yuan
 * @CreateDate : 2018-11-22 9:33
 * @Modify:
 **/
@Data
@Entity
@Table(name="WMS_ACTION_STEP")
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Api(value="作业步骤信息",description = "作业步骤信息")
public class WmsActionStep extends BaseBean {

    private static final long serialVersionUID = 6460096995982059959L;
    @Column(name = "AS_NAME_E", columnDefinition = "varchar(225) default ''")
    @ApiParam(value = "英文类型名称")
    private String asNameE;

    @Column(name = "AS_DESC_E", columnDefinition = "varchar(225) default ''")
    @ApiParam(value = "英文类型描述")
    private String asDescE;

    @Column(name = "AS_NAME_C", nullable = false)
    @ApiParam(value = "中文类型名称")
    @AnnoOutputColumn
    private String asNameC;

    @Column(name = "AS_DESC_C", nullable = false)
    @ApiParam(value = "中文类型描述")
    @AnnoOutputColumn
    private String asDescC;

    @Column(name = "AT_NAME_C_RDD",  nullable = false)
    @ApiParam(value = "步骤类型名称")
    @AnnoOutputColumn
    private String atNameCRdd;

    @Column(name = "AT_ID", nullable = false)
    @ApiParam(value = "步骤类型编号", example = "0")
    @JsonSerialize(using = ToStringSerializer.class)
    @AnnoOutputColumn
    private Long atId;

    //get单独处理
    public Long getAtId() {
        if(atId != null) {
            return atId.longValue();
        }else{
            return atId;
        }
    }
}
