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

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
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.JsonTypeHandler;
import com.dk.common.infrastructure.handler.TimestampTypeHandler;
import com.dk.common.infrastructure.handler.UuidTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 *  商品档案
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@ExportTitle("商品档案")
@TableName(value = "t_mst_goods_sku", autoResultMap = true ,schema = "dkic_b")
@ApiModel(value="实体类：商品档案", description="表名：t_mst_goods_sku")
public class GoodsSkuResponse implements Serializable {

    /*
     * 数据库字段
     */
    /**
     * 出库中数量
     */
    @Excel(name = "存货数量")
    @ApiModelProperty(value = "存货数量")
    private BigDecimal inventoryCount;
    /**
     * 包装
     */
    @Excel(name = "包装")
    @ApiModelProperty(value = "包装")
    private BigDecimal packBox;
    /**
     * 商品ID
     */
    @TableId(value = "sku_id", type = IdType.AUTO)
    @ApiModelProperty(value = "商品ID")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String skuId;

    /**
     * 辅助单位标识
     */
    @Excel(name = "辅助单位标识")
    @ApiModelProperty(value = "辅助单位标识")
    private Boolean flgSubUnit;
    /**
     * 期初库存标识
     */
    @Excel(name = "期初库存标识")
    @ApiModelProperty(value = "期初库存标识")
    private Boolean flgOpeningInv;
    /**
     * 价格体系标识
     */
    @Excel(name = "价格体系标识")
    @ApiModelProperty(value = "价格体系标识")
    private Boolean flgPrice;
    /**
     * 批发价
     */
    @Excel(name = "其他价格")
    @ApiModelProperty(value = "其他价格")
    private BigDecimal priceOther;
    /**
     * 商品编号
     */
    @Excel(name = "商品编号")
    @ApiModelProperty(value = "商品编号")
    private String skuCode;


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

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


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


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


    /**
     * 计量单位
     */
    @Excel(name = "计量单位")
    @ApiModelProperty(value = "计量单位")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String unitId;


    /**
     * 辅助单位
     */
    @Excel(name = "辅助单位")
    @ApiModelProperty(value = "辅助单位")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String subUnitId;


    /**
     * 单位换算
     */
    @Excel(name = "单位换算")
    @ApiModelProperty(value = "单位换算")
    private BigDecimal conversionFactor;


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


    /**
     * 商品规格
     */
    @Excel(name = "商品规格")
    @ApiModelProperty(value = "商品规格")
    private String skuSpec;


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


    /**
     * 零售价
     */
    @Excel(name = "零售价")
    @ApiModelProperty(value = "零售价")
    private BigDecimal priceStandard;


    /**
     * 批发价
     */
    @Excel(name = "批发价")
    @ApiModelProperty(value = "批发价")
    private BigDecimal priceWholesale;


    /**
     * 销售限价
     */
    @Excel(name = "销售限价")
    @ApiModelProperty(value = "销售限价")
    private BigDecimal priceLimited;



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

    @TableField(exist = false)
    @ApiModelProperty(value = "商品品牌")
    private String brandName;

    @TableField(exist = false)
    @ApiModelProperty(value = "商品系列")
    private String seriesName;

    @TableField(exist = false)
    @ApiModelProperty(value = "商品种类")
    private String catName;

    @TableField(exist = false)
    @ApiModelProperty(value = "计量单位")
    private String unitName;

    @TableField(exist = false)
    @ApiModelProperty(value = "辅助单位")
    private String subUnitName;

    @TableField(exist = false)
    @ApiModelProperty(value = "可售量")
    private Integer usableQty;
    /**
     * 仓库ID
     */
    @Excel(name = "仓库ID")
    @ApiModelProperty(value = "仓库ID")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String whId;
    /**
     * 组织仓库
     */
    @Excel(name = "组织仓库")
    @ApiModelProperty(value = "组织仓库")
    private String whName;
    /**
     * 非标号
     */
    @Excel(name = "非标号")
    @ApiModelProperty(value = "非标号")
    private String nonStdCode;
    /**
     * 库存数量
     */
    @Excel(name = "库存数量")
    @ApiModelProperty(value = "库存数量")
    private BigDecimal invQty;

    /**
     * 成本单价
     */
    @ApiModelProperty(value = "成本单价")
    private BigDecimal costPrice;

    @ApiModelProperty(value = "")
    private BigDecimal priceInto;

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

    /*
     * 相关属性
     * @TableField(exist = false)
     */
    /**
     * 小数位数 ([0-6]能改大，不能改小)
     */
    @ApiModelProperty(value = "小数位数 ([0-6]能改大，不能改小)")
    @TableField(exist = false)
    private Integer decimalPlaces;
    @Excel(name = "箱")
    @ApiModelProperty(value = "箱")
    private  Integer box;

    @Excel(name = "片")
    @ApiModelProperty(value = "片")
    private  BigDecimal piece;
    /*
     * 关联属性 + 查询条件
     * @TableField(exist = false)
     */

    @Excel(name = "警戒下限")
    @ApiModelProperty(value = "警戒下限")
    private Long warningLowerLimit;

    @Excel(name = "警戒上限")
    @ApiModelProperty(value = "警戒上限")
    private Long warningUpperLimit;

    private static final long serialVersionUID = 1L;

}
