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

import cn.estsh.i3plus.pojo.base.annotation.DynamicField;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
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 :
 * @CreateDate : 2019-11-07 16:06
 * @Modify:  2020-04-27 修改头部描述-dragon
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "WMS_PACKAGE_SPEC")
@Api("包装规格")
public class WmsPackageSpec extends BaseBean {
    private static final long serialVersionUID = 4849044986767609445L;
    @ApiParam(value = "包装规格代码")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String specCode;

    @Column(name = "SPEC_NAME")
    @ApiParam(value = "包装规格名称")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String specName;

    @Column(name = "QTY")
    @ApiParam(value = "包装数量")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.NUMBER)
    private Double qty;

    @Column(name = "PARENT_SPEC")
    @ApiParam(value = "上级规格")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.URL,
            isRequire = 2, dataSrc = "/wms/base-data/wms-package-spec/query", listColumnName = "specName", explicitColumnName = "specCode")
    private String parentSpec;

    @Column(name = "SPEC_LEVEL")
    @ApiParam(value = "规格层级")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, dataSrc = "SPEC_LEVEL")
    private Integer specLevel;

    @Column(name = "IS_MIXED")
    @ApiParam(value = "是否混包")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, dataSrc = "TRUE_OR_FALSE")
    private Integer isMixed;


    @Column(name = "POCKET_TYPE")
    @ApiParam(value = "容器类型")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.URL,
             dataSrc = "/wms/base-data/wms-container-type/query", listColumnName = "ctName", explicitColumnName = "ctCode")
    private String pocketType;

    @ApiParam(value = "上级规格名称")
    @Column(name = "PARENT_NAME")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.URL,
            isRequire = 2, dataSrc = "/wms/base-data/wms-package-spec/query", listColumnName = "specName", explicitColumnName = "specName")
    private String parentName;

    @Column(name = "DIRECTION")
    @ApiParam(value = "方向")
    private Integer direction;
}
