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

import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import com.fasterxml.jackson.annotation.JsonFormat;
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;
import javax.persistence.Transient;

/**
 * @Description :
 * @Reference :
 * @Author : jack.lv
 * @CreateDate : 2019-04-01 11:21
 * @Modify:
 **/
@Data
@Table(name = "SWEB_PURCHASE_ORDER")
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Api("采购订单表-主表")
public class SwebPurchaseOrder extends BaseBean {

    private static final long serialVersionUID = -3748055439346407775L;
    @Column(name = "ORDER_NO")
    @ApiParam("单据号")
    public String orderNo;

    @ApiParam("供应商编号")
    @Column(name = "VENDOR_CODE")
    private String vendorCode;

    @ApiParam("供应商名称")
    @Column(name = "VENDOR_NAME")
    private String vendorName;

    @ApiParam("计划员代码")
    @Column(name = "PLANNER_CODE")
    private String plannerCode;

    @ApiParam(value = "订单类型", example = "1")
    @Column(name = "ORDER_TYPE")
    private Integer orderType;

    @Column(name = "PARENT_PACKAGE_NO")
    @ApiParam("上级包装编号")
    private String parentPackageNo;

    @Column(name = "DOCK")
    @ApiParam("道口")
    private String dock;

    @Column(name = "ERP_WAREHOUSE")
    @ApiParam(value = "库存地")
    private String erpWarehouse;

    @Column(name = "PO_STATUS")
    @ApiParam(value = "PO状态", example = "1")
    private Integer poStatus;

    @Column(name = "SHIP_TIME")
    @ApiParam(value = "发运时间")
    private String shipTime;

    @Column(name = "PUBLISH_TIME")
    @ApiParam(value = "发布时间")
    private String publishTime;

    @Column(name = "DELIVERY_TIME")
    @ApiParam(value = "交货时间")
    private String deliveryTime;

    @Column(name = "REC_TIME")
    @ApiParam(value = "收货时间")
    private String recTime;

    @Column(name = "IS_SYN")
    @ApiParam(value = "是否收货", example = "2")
    private Integer isSyn;

    @Column(name = "ORDER_TIME")
    @ApiParam(value = "订单时间")
    private String orderTime;

    @Column(name = "REF_ORDER_NO")
    @ApiParam(value = "关联单号")
    private String refOrderNo;

    @Column(name = "EXPECTED_TIME")
    @ApiParam(value = "预计交货时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private String expectedTime;

    @Column(name = "REF_NO")
    @ApiParam(value = "合同号")
    private String refNo;

    // SwebEnumUtil.ORDER_SOURCE
    @Column(name = "ORDER_SOURCE")
    @ApiParam(value = "订单来源")
    private Integer orderSource;

    @Column(name = "IS_EXT_ADD")
    @ApiParam(value = "是否追加")
    private Integer isExtAdd;

    @Transient
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @ApiParam(value = "预计到货时间 开始时间")
    private String expectedTimeStart;

    @Transient
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @ApiParam(value = "预计到货时间 结束时间")
    private String expectedTimeEnd;
}
