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

import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
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 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.Index;
import javax.persistence.Table;


/**
 * @Description : 自动化策略主表
 * @Reference :
 * @Author : puxiao.liao
 * @CreateDate : 2020-06-20 15:58
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "WMS_AUTO_STRATEGY_MASTER", indexes = {
        @Index(columnList = "STRATEGY_NO"),
        @Index(columnList = "ROUTING_CODE")
})
@Api("自动化策略主表")
public class WmsAutoStrategyMaster extends BaseBean {
    private static final long serialVersionUID = -1818481118386594571L;

    @Column(name = "STRATEGY_NO")
    @ApiParam(value = "策略编码")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String strategyNo;

    @Column(name = "STRATEGY_NAME")
    @ApiParam(value = "策略名称")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String strategyName;

    @Column(name = "STRATEGY_SPEC")
    @ApiParam(value = "策略描述")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String strategySpec;

    @Column(name = "STRATEGY_TYPE")
    @ApiParam(value = "策略类型")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, isRequire = 2, dataSrc = "OUT_MOVEMENT_MOVE_TYPE")
    @AnnoOutputColumn(refClass = WmsEnumUtil.OUT_MOVEMENT_MOVE_TYPE.class, refForeignKey = "value", value = "description", hidden = true)
    private Integer strategyType;

    @Column(name = "ROUTING_CODE")
    @ApiParam(value = "物料路线代码")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String routingCode;

    @Column(name = "ROUTING_NAME")
    @ApiParam(value = "物流路线名称")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String routingName;

    @Column(name = "STRATEGY_QTY_CONTROL")
    @ApiParam(value = "数量控制")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, isRequire = 2, dataSrc = "SHIPP_QTY_CONTROL")
    @AnnoOutputColumn(refClass = WmsEnumUtil.AUTO_STRATEGY_QTY_CONTROL.class, refForeignKey = "value", value = "description", hidden = true)
    private Integer strategyQtyControl;

    @Column(name = "START_EFFECT_DATE")
    @ApiParam(value = "开始生效时间")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String startEffectDate;

    @Column(name = "END_EFFECT_DATE")
    @ApiParam(value = "结束生效时间")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    public String endEffectDate;

}
