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 : jason
 * @CreateDate : 2020-04-14
 * @Modify:
 **/
@Data
@Entity
@Table(name="WMS_CUST_WINDOW")
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Api(value="客户窗口时间",description = "客户窗口时间")
public class WmsCustWindow extends BaseBean {

    private static final long serialVersionUID = -6544671103929721988L;
    @Column(name = "CUST_NO")
    @ApiParam(value = "客户编码")
    private String custNo;

    @Column(name = "CUST_WINDOW_TIME")
    @ApiParam(value = "窗口时间")
    private String custWindowTime;

    @Column(name = "WEEKS")
    @AnnoOutputColumn(refClass = WmsEnumUtil.WEEK_TYPE.class, refForeignKey = "value", value = "description")
    @ApiParam(value = "星期")
    private String weeks;

    @Column(name = "DELAY_HOUR")
    @ApiParam(value = "容差")
    private Integer delayHour;

    public WmsCustWindow(WmsCustWindow custWindow) {
        this.custNo = custWindow.getCustNo();
        this.custWindowTime = custWindow.getCustWindowTime();
        this.weeks = custWindow.getWeeks();
        this.delayHour = custWindow.getDelayHour();
    }

    public WmsCustWindow() {
    }
}
