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

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.annotation.*;
import java.io.Serializable;

import com.dk.common.infrastructure.annotaiton.ExportTitle;
import com.dk.common.infrastructure.handler.*;
import com.dk.common.model.pojo.PageInfo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.alibaba.fastjson.JSONObject;

import java.math.BigDecimal;
import java.util.List;
import java.time.LocalDateTime;

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

    /*
     * 数据库字段
     */
    /**
     * 明细ID
     */
    @TableId(value = "item_id", type = IdType.AUTO)
    @ApiModelProperty(value = "明细ID")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String itemId;

    @Excel(name = "箱")
    @ApiModelProperty(value = "箱")
    private  Integer box;

    @Excel(name = "片")
    @ApiModelProperty(value = "片")
    private  BigDecimal piece;

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

    /**
     * 收货仓库
     */
    @ApiModelProperty(value = "收货仓库")
    private String whName;


    @ApiModelProperty(value = "基本单位")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String unitId;

    @ApiModelProperty(value = "包装单位")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String subUnitId;

    @Excel(name = "包装")
    @ApiModelProperty(value = "包装")
    private BigDecimal packBox;

    @Excel(name = "基本单位名称")
    @ApiModelProperty(value = "基本单位名称")
    private String unitName;

    @Excel(name = "包装单位名称")
    @ApiModelProperty(value = "包装单位名称")
    private String subUnitName;
    /**
     * 辅助单位标识
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "辅助单位标识")
    private Boolean flgSubUnit;


    /**
     * 采购订单号
     */
    @Excel(name = "采购订单号")
    @ApiModelProperty(value = "采购订单号")
    private String purNo;
    /**
     * 来源单ID (采购订单、出库退货)
     */
    @Excel(name = "来源单ID (采购订单、出库退货)")
    @ApiModelProperty(value = "来源单ID (采购订单、出库退货)")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String fromId;
    /**
     * 来源单ID (采购订单、出库退货)
     */
    @Excel(name = "来源单明细ID")
    @ApiModelProperty(value = "来源单明细ID")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String fromItemId;

    /**
     * 销售订单
     */
    @Excel(name = "销售订单")
    @ApiModelProperty(value = "销售订单")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String orderId;

    @ApiModelProperty(value = "订单单号")
    private String orderNo;
    /**
     * 商品规格
     */
    @Excel(name = "商品规格")
    @ApiModelProperty(value = "商品规格")
    private String skuSpec;
    /**
     * 订单ID
     */
    @Excel(name = "订单ID")
    @ApiModelProperty(value = "订单ID")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String purId;
    /**
     * 零售价
     */
    @Excel(name = "零售价")
    @ApiModelProperty(value = "零售价")
    private BigDecimal priceStandard;
    /**
     * 采购价
     */
    @Excel(name = "采购价")
    @ApiModelProperty(value = "采购价")
    private BigDecimal pricePurchase;
    /**
     * 商品顺序
     */
    @Excel(name = "商品顺序")
    @ApiModelProperty(value = "商品顺序")
    private Integer itemIndex;



    /**
     * 商品ID
     */
    @Excel(name = "商品ID")
    @ApiModelProperty(value = "商品ID")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String skuId;


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


    /**
     * 标价
     */
    @Excel(name = "标价")
    @ApiModelProperty(value = "标价")
    private BigDecimal priceStd;


    /**
     * 标价金额 (商品数量*标价)
     */
    @Excel(name = "标价金额 (商品数量*标价)")
    @ApiModelProperty(value = "标价金额 (商品数量*标价)")
    private BigDecimal amtStd;


    /**
     * 采购价
     */
    @Excel(name = "采购价")
    @ApiModelProperty(value = "采购价")
    private BigDecimal pricePur;


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


    /**
     * 折扣 (采购价/标价)
     */
    @Excel(name = "折扣 (采购价/标价)")
    @ApiModelProperty(value = "折扣 (采购价/标价)")
    private BigDecimal priceDiscount;


    /**
     * 非标号
     */
    @Excel(name = "非标号")
    @ApiModelProperty(value = "非标号")
    private String nonStdCode;


    /**
     * 入库状态 (【系统字典】)
     */
    @Excel(name = "入库状态 (【系统字典】)")
    @ApiModelProperty(value = "入库状态 (【系统字典】)")
    private String intoStatus;


    /**
     * 入库中数量
     */
    @Excel(name = "入库中数量")
    @ApiModelProperty(value = "入库中数量")
    private BigDecimal intoingQty;


    /**
     * 入库中金额
     */
    @Excel(name = "入库中金额")
    @ApiModelProperty(value = "入库中金额")
    private BigDecimal intoingAmt;


    /**
     * 已入库数量
     */
    @Excel(name = "已入库数量")
    @ApiModelProperty(value = "已入库数量")
    private BigDecimal intoQty;


    /**
     * 已入库金额
     */
    @Excel(name = "已入库金额")
    @ApiModelProperty(value = "已入库金额")
    private BigDecimal intoAmt;


    /**
     * 已入库退货数量
     */
    @Excel(name = "已入库退货数量")
    @ApiModelProperty(value = "已入库退货数量")
    private BigDecimal returnQty;


    /**
     * 已入库退货金额
     */
    @Excel(name = "已入库退货金额")
    @ApiModelProperty(value = "已入库退货金额")
    private BigDecimal returnAmt;


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


    /**
     * 有效标识 (1：正常 0：停用)
     */
    @Excel(name = "有效标识 (1：正常 0：停用)")
    @ApiModelProperty(value = "有效标识 (1：正常 0：停用)")
    private Boolean flgValid;


    /**
     * 企业ID
     */
    @Excel(name = "企业ID")
    @ApiModelProperty(value = "企业ID")
    private Integer cpId;


    /**
     * 创建时间 (触发器自动处理)
     */
    @Excel(name = "创建时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
    @ApiModelProperty(value = "创建时间 (触发器自动处理)")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(typeHandler = TimestampTypeHandler.class)
    private LocalDateTime opCreateTime;


    /**
     * 创建用户 (触发器自动处理)
     */
    @Excel(name = "创建用户 (触发器自动处理)")
    @ApiModelProperty(value = "创建用户 (触发器自动处理)")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String opCreateUserId;


    /**
     * 修改时间 (触发器自动处理)
     */
    @Excel(name = "修改时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
    @ApiModelProperty(value = "修改时间 (触发器自动处理)")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(typeHandler = TimestampTypeHandler.class)
    private LocalDateTime opUpdateTime;


    /**
     * 修改用户 (触发器自动处理)
     */
    @Excel(name = "修改用户 (触发器自动处理)")
    @ApiModelProperty(value = "修改用户 (触发器自动处理)")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String opUpdateUserId;


    /**
     * 数据操作应用 (触发器自动处理)
     */
    @Excel(name = "数据操作应用 (触发器自动处理)")
    @ApiModelProperty(value = "数据操作应用 (触发器自动处理)")
    private String opAppCode;


    /**
     * 数据时间戳 (触发器自动处理)
     */
    @Excel(name = "数据时间戳 (触发器自动处理)")
    @ApiModelProperty(value = "数据时间戳 (触发器自动处理)")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(typeHandler = TimestampTypeHandler.class)
    private LocalDateTime opTimestamp;


    /**
     * 数据操作数据库用户 (触发器自动处理)
     */
    @Excel(name = "数据操作数据库用户 (触发器自动处理)")
    @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
    private String opDbUser;

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

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

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



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

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

    @ApiModelProperty(value = "入库状态")
    private String intoStatusName;
    /*
     * 相关属性
     * @TableField(exist = false)
     */

    /*
     * 关联属性 + 查询条件
     * @TableField(exist = false)
     */

    private String invId;

    private BigDecimal invQty;

    private BigDecimal usableQty;


    /**
     * 商品图片 (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;

    //箱片规格
    private String specsName;

    @Excel(name = "箱（入库中）")
    @ApiModelProperty(value = "箱（入库中）")
    private  Integer intoingBox;

    @Excel(name = "片（入库中）")
    @ApiModelProperty(value = "片（入库中）")
    private  BigDecimal intoingPiece;

    @Excel(name = "箱（已入库")
    @ApiModelProperty(value = "箱（已入库）")
    private  Integer intoBox;

    @Excel(name = "片（已入库")
    @ApiModelProperty(value = "片（已入库）")
    private  BigDecimal intoPiece;

    /**
     * 小数位数 ([0-6]能改大，不能改小)
     */
    @ApiModelProperty(value = "小数位数 ([0-6]能改大，不能改小)")
    @TableField(exist = false)
    private Integer decimalPlaces;

    private static final long serialVersionUID = 1L;

}
