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

import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.ColumnDefault;
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;
import java.util.List;

/**
 * @Description : 波次规则数据
 * @Reference :
 * @Author : siliter.yuan
 * @CreateDate : 2020-03-25 10:10
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "WMS_WAVE_RULE")
@Api(value = "波次规则数据表")
public class WmsWaveRule extends BaseBean {

    private static final long serialVersionUID = 8664373854844368961L;

    @Column(name = "RULE_CODE")
    @ApiParam(value = "波次规则代码")
    public String ruleCode;

    @Column(name = "RULE_DESC")
    @ApiParam(value = "波次规则描述")
    public String ruleDesc;

    /**
     *  分配规则 2-不分配(默认) 1-分配到责任区
     */
    @Column(name = "ALLOCATE_RULE")
    @ApiParam(value = "分配规则", example = "1")
    public Integer allocateRule;

    @Column(name = "EXTEND_SQL")
    @ApiParam(value = "扩展脚本")
    public String extendSql;

    @Column(name = "START_EFFECT_DATE")
    @ApiParam(value = "开始生效时间")
    public String startEffectDate;

    @Column(name = "END_EFFECT_DATE")
    @ApiParam(value = "结束生效时间")
    public String endEffectDate;

    @Column(name = "SORT_CONDITIONS")
    @ApiParam(value = "单据排序条件")
    public String sortConditions;

    @Column(name = "ORDER_CONTROL_TIME")
    @ApiParam(value = "单据控制时间")
    public String orderControlTime;

    @Column(name = "FIXED_ORDER_QTY", nullable = false)
    @ApiParam(value = "固定单据数量", example = "0")
    @ColumnDefault("0")
    public Integer fixedOrderQty;

    @Column(name = "FIXED_PART_QTY", nullable = false)
    @ApiParam(value = "固定物料箱数", example = "0")
    @ColumnDefault("0")
    public Integer fixedPartQty;

    @Column(name = "WAVE_QTY", nullable = false)
    @ApiParam(value = "波次数量", example = "0")
    @ColumnDefault("0")
    public Integer waveQty;

    @Column(name = "ORDER_MAX_QTY", nullable = false)
    @ApiParam(value = "最大单据数量", example = "0")
    @ColumnDefault("0")
    public Integer orderMaxQty;

    @Column(name = "PART_MAX_QTY", nullable = false)
    @ApiParam(value = "最大物料数量", example = "0")
    @ColumnDefault("0")
    public Double partMaxQty;

    @Column(name = "ORDER_TIMEOUT_TIME", nullable = false)
    @ApiParam(value = "单据等待时间", example = "0")
    @ColumnDefault("0")
    public Integer orderTimeOutTime;

    @Column(name = "NEXT_WAVE_TIME")
    @ApiParam(value = "下次波次时间")
    public String nextWaveTime;

    @Column(name = "IS_CROSS_AREA")
    @ApiParam(value = "允许跨区", example = "0")
    public Integer isCrossArea;

    @Column(name = "IS_COLLECTION")
    @ApiParam(value = "允许整箱归集")
    public Integer isCollection;

    @Transient
    @ApiParam(value = "波次规则明细信息")
    private List<WmsWaveRuleDetails> waveRuleDetailsList;
}
