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 : silliter.yuan
 * @CreateDate : 2018-11-06 15:58
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "WMS_DOC_SHIPPING")
@Api("产品发运信息")
public class WmsShipping extends BaseBean {

    private static final long serialVersionUID = 5760351204320621363L;
    @Column(name = "ORDER_NO")
    @ApiParam("发运单号")
    public String orderNo;

    @Column(name = "PART_NO")
    @ApiParam("物料编码")
    public String partNo;

    @Column(name = "PART_NAME_RDD")
    @ApiParam("物料名称")
    public String partNameRdd;

    @Column(name = "QTY", columnDefinition = "decimal(18,8)", nullable = false)
    @ColumnDefault("0")
    @ApiParam(value = "需求数量", example = "0")
    public Double qty;

    @Column(name = "UNIT")
    @ApiParam("单位")
    public String unit;

    @Column(name = "SN")
    @ApiParam("条码")
    public String sn;

    /**
     * 状态:10=新建,20=已处理,30=处理出错
     */
    @Column(name = "ORDER_STATUS")
    @ApiParam(value = "状态", example = "10")
    public Integer orderStatus;

    @Transient
    @ApiParam(value = "状态")
    public List<Integer> orderStatusList;

    @Column(name = "REMARK")
    @ApiParam("备注")
    public String remark;

    @Column(name = "SRC")
    @ApiParam("单据来源")
    public String src;

    @Column(name = "CUST_NO")
    @ApiParam("客户编码")
    public String custNo;

    @Column(name = "SHIPPING_FLAG")
    @ApiParam("特殊发货标志")
    public String shippingFlag;

    @Column(name = "SHIPPING_TIME")
    @ApiParam("发运时间")
    public String shippingTime;

    @Transient
    @ApiParam(value = "客户简称")
    private String custName;

    @Transient
    @ApiParam(value = "发往地简称")
    private String flagName;

    @Column(name = "AREA_NO")
    @ApiParam("ERP库存地")
    public String areaNo;

    @Column(name = "CAR_NO")
    @ApiParam("车号")
    public String carNo;

    @Column(name = "ERROR_MESSAGE")
    @ApiParam("错误信息")
    public String errorMessage;

    @Column(name = "IS_LOCK")
    @ApiParam("是否锁定 是否锁定：1=锁定 2=未锁定")
    public Integer isLock;

    @Column(name = "ERP_SYNC_FLAG")
    @ApiParam("ERP同步标识 ERP同步标识：10=待同步，20=同步成功，30=同步失败")
    public Integer erpSyncFlag;

    public WmsShipping() {
    }

    public WmsShipping(Long id, Double qty, String carNo, String partNo, String partNameRdd, String custNo, String unit, String areaNo) {
        this.id = id;
        this.partNo = partNo;
        this.partNameRdd = partNameRdd;
        this.qty = qty;
        this.unit = unit;
        this.custNo = custNo;
        this.carNo = carNo;
        this.areaNo = areaNo;
    }
}
