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;
import javax.persistence.Transient;

/**
 * @Description 拉动规则实体
 * @Author Jason
 * @Date 2020-03-20
 * @ModifyDate 2020-03-20
 */
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "WMS_PULL_RULE")
@Api("拉动规则")
public class WmsPullRule extends BaseBean {
    private static final long serialVersionUID = -4259512587710548316L;
    @Column(name = "PULL_WAY")
    @ApiParam(value = "拉动类型", example = "10")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, dataSrc = "PULL_WAY_STATUS")
    private Integer pullWay;

    @Column(name = "CONTAIN_UNFINISH_ORDER")
    @ApiParam(value = "考虑未完成的移库单", example = "0")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, isRequire = 2, dataSrc = "TRUE_OR_FALSE")
    private Integer containUnfinishOrder;

    @Column(name = "CONTAIN_EXIST_PERIOD")
    @ApiParam(value = "考虑现有库存", example = "0")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, isRequire = 2, dataSrc = "TRUE_OR_FALSE")
    private Integer containExistStock;

    @Column(name = "TAIL_QTY_MODE")
    @ApiParam(value = "尾数计算方式", example = "0")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, isRequire = 2, dataSrc = "TAIL_QTY_MODE")
    private Integer tailQtyMode;

    @Transient
    @ApiParam(value = "通过存储区物料获取物流路线")
    private boolean routingbyZonePartDisAble;
}
