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 lombok.ToString;
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;

/**
 * @Description : 销售订单明细表
 * @Reference :
 * @Author : jimmy.zeng
 * @CreateDate : 2020-04-13 13:30
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "WMS_DOC_SO_DETAILS")
@Api("销售订单明细表")
@ToString
public class WmsDocSoDetails extends BaseBean {
    private static final long serialVersionUID = -8900949569711082994L;

    @Column(name = "ORDER_NO")
    @ApiParam(value = "单据号")
    private String orderNo;

    @Column(name = "ITEM")
    @ApiParam("行号")
    public Integer item;

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

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

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

    @Column(name = "SNP_QTY")
    @ApiParam(value = "标准包装", example = "1")
    private Double snpQty;

    @Column(name = "ITEM_STATUS")
    @ApiParam(value = "状态", example = "1")
    @AnnoOutputColumn(refClass = WmsEnumUtil.ORDER_DETAILS_STATUS.class, refForeignKey = "value", value = "description")
    private Integer itemStatus;

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

    @Transient
    @ApiParam(value = "客户编号")
    private String custCode;

    @Column(name = "CUST_PART_NO")
    @ApiParam("客户物料编码")
    public String custPartNo;


    @Column(name = "REMAIN_QTY", columnDefinition = "decimal(18,8)")
    @ApiParam(value = "剩余数量", example = "0")
    public Double remainQty;

    @Transient
    @ApiParam(value = "存储区代码")
    private String zoneNo;

    @Transient
    @ApiParam(value = "单据编号")
    private String docOrderNo;

    @Transient
    @ApiParam(value = "数量")
    private Double docQty;

    @Transient
    @ApiParam("业务类型")
    @AnnoOutputColumn(refClass = WmsEnumUtil.OUT_MOVEMENT_BUSI_TYPE.class, refForeignKey = "value", value = "description")
    public Integer busiType;

    @Transient
    @ApiParam(value = "客户发往地代码")
    private String custDeliveryCode;
}
