package com.dk.mdm.model.response.report;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dk.common.infrastructure.annotaiton.ExportTitle;
import com.dk.common.infrastructure.handler.*;
import com.dk.common.model.pojo.PageInfo;
import com.dk.mdm.model.response.pur.PurchaseItemResponse;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 *  采购订单
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ExportTitle("采购订单")
@TableName(value = "t_psi_purchase", autoResultMap = true)
@ApiModel(value="实体类：报表", description="表名：t_psi_purchase")
public class ReportResponse extends PageInfo<ReportResponse> implements Serializable {

    /*
     * 数据库字段
     */


    @ApiModelProperty(value = "采购订单ID")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String Id;


    /**
     * 采购订单号
     */
    @Excel(name = "采购订单号")
    @ApiModelProperty(value = "采购订单号")
    private String No;


    @ApiModelProperty(value = "采购订单ID")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String itemId;

    @Excel(name = "采购订单号")
    @ApiModelProperty(value = "采购订单号")
    private String type;
    /**
     * 联系人
     */
    @Excel(name = "联系人")
    @ApiModelProperty(value = "联系人")
    private String contactName;


    /**
     * 联系电话
     */
    @Excel(name = "联系电话")
    @ApiModelProperty(value = "联系电话")
    private String contactPhone;

    /**
     * 仓库ID
     */
    @Excel(name = "仓库ID")
    @ApiModelProperty(value = "仓库ID")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String whId;


    /**
     * 制单时间
     */
    @Excel(name = "制单时间")
    @ApiModelProperty(value = "制单时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(typeHandler = TimestampTypeHandler.class)
    private LocalDateTime makeTime;

    /**
     * 取货日期
     */
    @Excel(name = "取货日期")
    @ApiModelProperty(value = "取货日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField(typeHandler = TimestampTypeHandler.class)
    private LocalDate pickupDate;

    /**
     * 商品总数量
     */
    @Excel(name = "商品总数量")
    @ApiModelProperty(value = "商品总数量")
    private BigDecimal sumQuantity;


    /**
     * 入库数量 (流入为正数，流出为负数)
     */
    @Excel(name = "入库数量 (流入为正数，流出为负数)")
    @ApiModelProperty(value = "入库数量 (流入为正数，流出为负数)")
    private BigDecimal intoQty;
    /**
     * 已入库退货数量
     */
    @Excel(name = "已入库退货数量")
    @ApiModelProperty(value = "已入库退货数量")
    private BigDecimal returnQty;
    /**
     * 收款金额
     */
    @Excel(name = "收款金额")
    @ApiModelProperty(value = "收款金额")
    private BigDecimal sumAmtRec;

    @Excel(name = "待核销金额")
    @ApiModelProperty(value = "待核销金额")
    private BigDecimal sumShouldHandle;

    @Excel(name = "预付抵扣")
    @ApiModelProperty(value = "预付抵扣")
    private BigDecimal sumUsePaymentResidue;


    @Excel(name = "合计核销金额")
    @ApiModelProperty(value = "合计核销金额")
    private BigDecimal sumWaiveAmt;
    /**
     * 商品ID
     */
    @Excel(name = "商品ID")
    @ApiModelProperty(value = "商品ID")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String skuId;


    /**
     * 商品编号
     */
    @Excel(name = "商品编号")
    @ApiModelProperty(value = "商品编号")
    private String skuCode;


    /**
     * 商品名称
     */
    @Excel(name = "商品名称")
    @ApiModelProperty(value = "商品名称")
    private String skuName;


    /**
     * 商品型号
     */
    @Excel(name = "商品型号")
    @ApiModelProperty(value = "商品型号")
    private String skuModel;
    /**
     * 商品图片 (index（显示顺序）、name（文件名）、path（路径）、type（类型）、time（上传时间）...)
     */
    @Excel(name = "商品图片 (index（显示顺序）、name（文件名）、path（路径）、type（类型）、time（上传时间）...)")
    @ApiModelProperty(value = "商品图片 (index（显示顺序）、name（文件名）、path（路径）、type（类型）、time（上传时间）...)")
    @TableField(typeHandler = JsonTypeHandler.class)
    private JSONArray skuImages;


    /**
     * 商品型号
     */
    @Excel(name = "商品品牌名称")
    @ApiModelProperty(value = "商品品牌名称")
    private String brandName;

    /**
     * 商品型号
     */
    @Excel(name = "品牌简称")
    @ApiModelProperty(value = "商品品牌简称")
    private String shortName;

    /**
     * 采购价
     */
    @Excel(name = "采购价")
    @ApiModelProperty(value = "采购价")
    private BigDecimal pricePur;
    /**
     * 商品数量
     */
    @ApiModelProperty(value = "商品数量")
    private BigDecimal itemQty;

    /**
     * 备注
     */
    @Excel(name = "备注")
    @ApiModelProperty(value = "备注")
    private String remarks;

    @ApiModelProperty(value = "采购订单明细")
    private List<ReportResponse> ItemResponseList;

    private static final long serialVersionUID = 1L;

}
