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_allowance")
@ApiModel(value = "SalesAllowance对象", description = "销售折让单")
public class SalesAllowance 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 allowanceDate;

    @ApiModelProperty(value = "折让编号")
    @Excel(name = "折让编号")
    private String allowanceNum;

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

    @TableField(exist = false)
    @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 departmentNum;

    @TableField(exist = false)
    @ApiModelProperty(value = "部门名称")
    private String departmentName;

    @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<SalesAllowanceItem> items;

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

    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "折让日期结束")
    private Date allowanceDateEnd;
}
