package com.ruoyi.web.sales.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.web.base.domain.base.Base;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sales_delivery")
@ApiModel(value = "SalesDelivery对象", description = "销售出库单")
public class SalesDelivery extends Base {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "单据日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "单据日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date documentDate;

    @ApiModelProperty(value = "单据编号")
    @Excel(name = "单据编号")
    private String deliveryNum;

    @ApiModelProperty(value = "客户编号")
    @Excel(name = "客户编号")
    private String customerNum;

    @ApiModelProperty(value = "客户名称")
    @Excel(name = "客户名称")
    private String customerName;

    @ApiModelProperty(value = "业务员")
    @Excel(name = "业务员")
    private String employeeNum;

    @TableField(exist = false)
    @ApiModelProperty(value = "业务员姓名")
    private String employeeName;

    @ApiModelProperty(value = "总计金额")
    @Excel(name = "总计金额")
    private String totalAmount;

    @ApiModelProperty(value = "审核状态")
    @Excel(name = "审核状态", readConverterExp = "0=未审核,1=已审核")
    private Integer auditStatus;

    @ApiModelProperty(value = "冲销状态")
    private Integer offsetStatus;

    @TableField(exist = false)
    @ApiModelProperty(value = "货品清单")
    private List<SalesDeliveryGoods> goods;

    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "单据日期开始")
    private Date documentDateStart;

    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "单据日期结束")
    private Date documentDateEnd;

    @TableField(exist = false)
    @ApiModelProperty(value = "查询-货品编号")
    private String goodsNum;
}
