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

import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.WmsEnumUtil;
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 : hansen.ke
 * @CreateDate : 2018-11-06 11:50
 * @Modify:
 **/
@Data
@Entity
@Table(name="WMS_ROUTING_RULE")
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Api(value="物流线路规则表",description = "物流线路规则表")
public class WmsRoutingRule extends BaseBean {

    private static final long serialVersionUID = 7759454799191378612L;
    @Column(name = "RULE_CODE")
    @ApiParam(value = "规则编号")
    private String ruleCode;

    @Column(name = "RULE_NAME")
    @ApiParam(value = "规则名称")
    private String ruleName;

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

    @Column(name = "SEQ")
    @ApiParam(value = "排序号")
    private Integer seq;

    @Column(name = "RULE_TYPE")
    @ApiParam(value = "规则类型(10 推动规则，20 补货规则)", example ="10")
    @AnnoOutputColumn(refClass = WmsEnumUtil.ROUTING_RULE_TYPE.class, refForeignKey = "value", value = "description")
    private Integer ruleType;

    @Column(name = "SRC_ZONE_NO")
    @ApiParam(value = "源存储区")
    private String srcZoneNo;

    @Column(name = "DEST_ZONE_NO")
    @ApiParam(value = "目标存储区" , example = "2")
    private String destZoneNo;

    @Column(name = "DEST_BUSI_TYPE_CODE")
    @ApiParam(value = "目标业务类型编码" , example = "")
    @AnnoOutputColumn(refClass = WmsEnumUtil.OUT_MOVEMENT_BUSI_TYPE.class, refForeignKey = "value", value = "description")
    private String destBusiTypeCode;

    @Column(name = "SRC_BUSI_TYPE_CODE")
    @ApiParam(value = "源业务类型编码" , example = "")
    @AnnoOutputColumn(refClass = WmsEnumUtil.OUT_MOVEMENT_BUSI_TYPE.class, refForeignKey = "value", value = "description")
    private String srcBusiTypeCode;

    @Column(name = "DEST_OP_TYPE_CODE")
    @ApiParam(value = "目标作业类型" , example = "2")
    private String destOpTypeCode;

    @Column(name = "DEST_TRANS_TYPE_CODE")
    @ApiParam(value = "目标交易类型" , example = "1")
    private String destTransTypeCode;

    @Column(name = "SRC_TRANS_TYPE_CODE")
    @ApiParam(value = "源交易类型" , example = "1")
    private String srcTransTypeCode;

    @Column(name = "DEST_SN_STATUS")
    @ApiParam(value = "目标条码状态" , example = "1")
    @AnnoOutputColumn(refClass = WmsEnumUtil.STOCK_SN_STATUS.class, refForeignKey = "value", value = "description")
    private Integer destSnStatus;

    @Column(name = "DEST_QC_STATUS")
    @ApiParam(value = "目标质量状态" , example = "1")
    @AnnoOutputColumn(refClass = WmsEnumUtil.STOCK_SN_QC_STATUS.class, refForeignKey = "value", value = "description")
    private Integer destQcStatus;

    @Column(name = "MODE_CODE")
    @ApiParam(value = "处理模式(10:生成任务,20:自动操作,30手工操作，40:自动操作 无交易)" , example = "1")
    @AnnoOutputColumn(refClass = WmsEnumUtil.ROUTING_RULE_MODE.class, refForeignKey = "value", value = "description")
    private Integer modeCode;

    @Column(name = "DELAY_TIME")
    @ApiParam(value = "延迟时间" , example = "1")
    private Integer dalayTime;

    @Column(name = "DELAY_UNIT")
    @ApiParam(value = "延迟时间单位(M:分钟，D:天)")
    private String delayUnit;

    @Column(name = "ROUTING_CODE")
    @ApiParam(value = "线路代码")
    private String routingCode;

    @Column(name = "DEST_LOCATE_NO")
    @ApiParam(value = "目的库位")
    private String destLocateNo;

    @Column(name = "DEST_MOVE_TYPE")
    @ApiParam(value = "目的库位")
    private String destMoveType;

    @Column(name = "DEST_MOVE_SN_STATUS")
    @ApiParam(value = "目的单据条码状态")
    private Integer destMoveSnStatus;

    @Column(name = "FILTER_SCRIPT_NO", length = 50)
    @ApiParam(value = "过滤条件")
    private String filterScriptNo;

    public WmsRoutingRule(){}

}
