package com.zfire.mall.manager.bean.engin.order;

import com.zfire.mall.manager.bean.wallet.CustomerWalletBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

@Data
@Accessors(chain = true)
@ApiModel
public class EnginOrderItemBean {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "明细id")
    private String id;

    @ApiModelProperty(value = "工程订单id")
    private String parentId;

    @ApiModelProperty(value = "工程订单编号")
    private String enginOrderNo;

    @ApiModelProperty(value = "引用记录")
    private Integer useRefCount;

    @NotBlank(message = "家用工程订单销售类型不能空")
    @ApiModelProperty(value = "销售类型")
    private String saleTypeId;

    @NotBlank(message = "家用工程订单销售类型编码不能空")
    @ApiModelProperty(value = "销售类型编码")
    private String saleTypeCode;

    @NotBlank(message = "家用工程订单销售类型名称不能空")
    @ApiModelProperty(value = "销售类型名称")
    private String saleTypeName;

    @NotBlank(message = "产品不能空")
    @ApiModelProperty(value = "金蝶物料id")
    private String materialId;

    @ApiModelProperty(value = "金蝶物料编码")
    private String materialNumber;

    @ApiModelProperty(value = "金蝶物料名称")
    private String materialName;

    @ApiModelProperty(value = "金蝶物料旧编码")
    private String materialOldNumber;

    @ApiModelProperty(value = "规格型号")
    private String specification;

    @ApiModelProperty(value = "金蝶物料类型id")
    private String k3CategoryId;

    @ApiModelProperty(value = "金蝶物料类型编码")
    private String k3CategoryNumber;

    @ApiModelProperty(value = "金蝶物料类型名称")
    private String k3CategoryName;

    @ApiModelProperty(value = "基本单位编码")
    private String unit;

    @ApiModelProperty(value = "工程单单价")
    private BigDecimal enginPrice = new BigDecimal("0");

    @ApiModelProperty(value = "工程单金额")
    private BigDecimal enginTotality = new BigDecimal("0");

    @ApiModelProperty(value = "工程单记录数量")
    private Integer enginNum = 0;

    @Min(value = 0, message = "单价不少于0")
    @ApiModelProperty(value = "单价")
    private BigDecimal price = new BigDecimal("0");

    @Min(value = 0, message = "数量不少于0")
    @ApiModelProperty(value = "数量")
    private Integer qty = 0;

    @Min(value = 0, message = "折扣金额不少于0")
    @ApiModelProperty(value = "折扣金额")
    private BigDecimal discAmount;

    @ApiModelProperty(value = "订单金额")
    private BigDecimal totalAmount;

    @ApiModelProperty(value = "原数量")
    private Integer oldQty = 0;

    @ApiModelProperty(value = "原实付金额")
    private BigDecimal oldPayAmount;

    @ApiModelProperty(value = "原实付返利金额")
    private BigDecimal oldRebateAmount;

    @ApiModelProperty(value = "返利钱包的返利比例")
    private BigDecimal rebateRate;

    @ApiModelProperty(value = "返利金额")
    private BigDecimal rebateAmount;

    @ApiModelProperty(value = "押金比例")
    private BigDecimal depositRate;

    @NotBlank(message = "经销商现金钱包不能空")
    @ApiModelProperty(value = "经销商现金钱包id")
    private String customerWalletId;

    @ApiModelProperty(value = "经销商现金钱包名称")
    private String customerWalletName;

    @ApiModelProperty(value = "经销商返利钱包id")
    private String customerWalletId2;

    @ApiModelProperty(value = "经销商返利钱包名称")
    private String customerWalletName2;

    @ApiModelProperty(value = "业务员id")
    private String serviceId;

    @ApiModelProperty(value = "业务员名称")
    private String serviceName;

    @ApiModelProperty(value = "是否直调 false=否 true=是")
    private Boolean isDirectTransfer;

    @ApiModelProperty(value = "直调数量")
    private Integer directTransferQty;

    @ApiModelProperty(value = "已发货数量")
    private Integer hasSendQty;

    @ApiModelProperty(value = "单个商品的返利金额(实际扣除的返利金额/qty)")
    private BigDecimal singleRebateAmount;

    @ApiModelProperty(value = "单个商品的折扣金额(折扣金额/qty)")
    private BigDecimal singleDiscAmount;

    @ApiModelProperty(value = "单个商品的实际支付金额(实际支付金额/qty)")
    private BigDecimal singlePayPrice;

    @ApiModelProperty(value = "单个商品的押金金额(单个商品的实际支付金额*押金比例)")
    private BigDecimal singleDepositAmount;

    @ApiModelProperty(value = "实付金额(订单金额-返利金额-折扣金额-不够扣的返利金额)")
    private BigDecimal payAmount;

    @ApiModelProperty(value = "实际扣除的返利金额")
    private BigDecimal payRebateAmount;

    @ApiModelProperty(value = "实际支付的现金金额")
    private BigDecimal payCashAmount;

    @ApiModelProperty(value = "实际支付的信用金额")
    private BigDecimal payCreditAmount;

    @ApiModelProperty(value = "总押金金额")
    private BigDecimal totalDepositAmount;

    @ApiModelProperty(value = "税率例如: 0.13")
    private BigDecimal tax;

    @ApiModelProperty(value = "实装金蝶物料id")
    private String realMaterialId;

    @ApiModelProperty(value = "实装金蝶物料名称")
    private String realMaterialName;

    @ApiModelProperty(value = "实装金蝶物料编码")
    private String realMaterialNumber;

    @ApiModelProperty(value = "实装金蝶物料旧编码")
    private String realMaterialOldNumber;

    @ApiModelProperty(value = "实装规格型号")
    private String realSpecification;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "可退数量")
    private Integer refundableQty = 0;

    @ApiModelProperty(value = "已退订数量")
    private Integer retiredQty = 0;

    @ApiModelProperty(value = "实直调数量")
    private Integer realDirectTransferQty = 0;

    @ApiModelProperty("退订数量")
    private Integer tdQty = 0;

    @ApiModelProperty("历史已订数量")
    private Integer historyHasOrderQty = 0;

    @ApiModelProperty(value = "可用钱包列表")
    private List<CustomerWalletBean> customerWalletList = new ArrayList<>();

    @ApiModelProperty(value = "金蝶内码")
    private String kingDeeEntryId;

    @ApiModelProperty(value = "退货数量")
    private Integer refundProductQty;

    @ApiModelProperty(value = "退货金额")
    private BigDecimal refundProductAmount;

    @ApiModelProperty(value = "销售数量（总订单数量-退货数量-退订数量）")
    private Integer salesQty;

    @ApiModelProperty(value = "销售金额（销售数量*单价）")
    private BigDecimal salesAmount;


}
