package cn.estsh.i3plus.pojo.mes.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.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @Description:
 * @Reference:
 * @Author: joke.wang
 * @CreateDate: 2019\11\6 11:45
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_CUST_ORDER", indexes = {@Index(columnList = "ORDER_NO")
}, uniqueConstraints = {
        @UniqueConstraint(columnNames = {"ORGANIZE_CODE", "ORDER_NO"})
})
@Api("客户信息")
public class MesCustOrder extends BaseBean implements Serializable {

    private static final long serialVersionUID = 4990079075654538033L;
    @Column(name = "ORDER_NO", nullable = false)
    @ApiParam("订单号")
    private String orderNo;

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

    @Column(name = "PART_NO")
    @ApiParam("物料号")
    private String partNo;

    @Column(name = "PART_NAME")
    @ApiParam("物料名称")
    private String partName;

    @Column(name = "QTY")
    @ApiParam("数量")
    private Integer qty;

    @Column(name = "STATUS")
    @ApiParam("状态")
    private Integer status;

    @Column(name = "ORDER_DATE")
    @ApiParam("订单日期")
    private String orderDate;

    @Column(name = "CUST_CODE")
    @ApiParam("客户代码")
    private String custCode;

    @Column(name = "CUST_ORDER_NO")
    @ApiParam("客户订单号")
    private String custOrderNo;

    @Column(name = "SOURCE")
    @ApiParam("计划来源")
    private String source;

    @Column(name = "MEMO")
    @ApiParam("备注")
    private String memo;

    @Transient
    @ApiParam(value = "订单日期查询用，查询开始日期", example = "2019-01-31 23:59:59")
    public String orderTimeStart;

    @Transient
    @ApiParam(value = "订单日期查询用，查询结束日期", example = "2019-12-31 23:59:59")
    public String orderTimeEnd;

    @Transient
    @ApiParam("订单类型名称")
    private String orderTypeName;

    @Transient
    @ApiParam("状态名称")
    private String statusName;
}
