package com.zfire.mall.manager.bean.sale;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.zfire.mall.manager.annotation.ZfireField;
import com.zfire.mall.manager.constant.FrontCodeConstant;
import com.zfire.mall.manager.enums.ExamineStatusEnum;
import com.zfire.mall.manager.enums.OrderTypeEnum;
import com.zfire.mall.manager.enums.SalesOrderSyncStatusEnum;
import com.zfire.mall.manager.plus.entity.SalesOrder;
import com.zfire.mall.manager.plus.entity.SalesOrderPicture;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author change
 */
@ApiModel
@Data
public class SaleOrderVO  {

    @ZfireField(type = "select",tbName = "so",colName = "sync_status")
    @ApiModelProperty(value = "推送状态")
    private SalesOrderSyncStatusEnum syncStatus;


    @ZfireField(type = "select",tbName = "so",colName = "examine_status")
    @ApiModelProperty(value = "单据状态")
    private ExamineStatusEnum examineStatus;

    @ZfireField(tbName = "pms",colName = "print_time")
    @ApiModelProperty(value = "打印时间")
    private Date printTime;

    @ZfireField(tbName = "ia",colName = "order_time")
    @ApiModelProperty(value = "发货时间")
    private Date invoiceOrderTime;


    @ZfireField(tbName = "so",colName = "order_time")
    @ApiModelProperty(value = "出库单创建时间")
    private Date orderTime;

    @ZfireField(tbName = "so",colName = "logistics_name")
    @ApiModelProperty(value = "物流公司")
    private String logisticsName;

    @ZfireField(type = "select",tbName = "iao",colName = "order_type")
    @ApiModelProperty(value = "订单类型")
    private OrderTypeEnum orderType;


    @ZfireField(tbName = "so",colName = "bill_receipt")
    @ApiModelProperty(value = "发票号")
    private String billReceipt;

    @ZfireField(tbName = "so",colName = "bill_date")
    @ApiModelProperty(value = "发票时间")
    private Date billDate;

    @ZfireField(tbName = "so",colName = "id")
    @ApiModelProperty(value = "出库单号")
    private String id;

    @ZfireField(tbName = "so",colName = "order_no")
    @ApiModelProperty(value = "发货单号")
    private String orderNo;


    @ZfireField(hide = false,frontCode = FrontCodeConstant.CATEGORY,tbName = "iao",colName = "k3_category_id",type ="select")
    @ApiModelProperty(value = "存货类别")
    private String k3CategoryName;


    @ZfireField(tbName = "iao",colName = "goods_order_id")
    @ApiModelProperty(value = "订单号")
    private String goodsOrderId;

    @ZfireField(hide = true)
    @ApiModelProperty(value = "仓库ID")
    private String correspondId;

    @ZfireField(tbName = "so",colName = "correspond_id",frontCode = FrontCodeConstant.STOCK,type = "select")
    @ApiModelProperty(value = "仓库名称")
    private String correspondName;

    @ZfireField(tbName = "so",colName = "customer_number")
    @ApiModelProperty(value = "经销商编号")
    private String customerNumber;

    @ZfireField(tbName = "so")
    @ApiModelProperty(value = "审批人")
    private String approvalName;
    @ZfireField(tbName = "so")
    @ApiModelProperty(value = "审批时间")
    private Date approvalTime;
    @ZfireField(tbName = "so")
    @ApiModelProperty(value = "审批说明")
    private String approvalRemark;

    @ZfireField(hide = true)
    @ApiModelProperty(value = "经销商id")
    private String customerId;

    @ZfireField(tbName = "so",colName = "customer_name")
    @ApiModelProperty(value = "经销商名称")
    private String customerName;

    @ZfireField(hide = true,tbName = "iao",colName = "sale_type_id")
    @ApiModelProperty(value = "销售类型id")
    private String saleTypeId;

    @ZfireField(hide = true,tbName = "iao",colName = "sale_type_code")
    @ApiModelProperty(value = "销售类型编号")
    private String saleTypeCode;

    @ZfireField(tbName = "iao",colName = "sale_type_name")
    @ApiModelProperty(value = "销售类型名称")
    private String saleTypeName;


    @ZfireField(hide = true,tbName = "iao")
    @ApiModelProperty(value = "金蝶物料id")
    private String materialId;

    @ZfireField(tbName = "iao",colName = "material_old_number")
    @ApiModelProperty(value = "厂产品代码")
    private String materialOldNumber;

    @ZfireField(tbName = "iao",colName = "material_code")
    @ApiModelProperty(value = "物料编号")
    private String materialCode;


    @ZfireField(tbName = "iao",colName = "material_name")
    @ApiModelProperty(value = "产品名称")
    private String materialName;

    @ZfireField(tbName = "iao",colName = "specification")
    @ApiModelProperty(value = "规格型号")
    private String specification;

    @ZfireField(tbName = "iao",colName = "unit")
    @ApiModelProperty(value = "单位")
    private String unit;

    @ZfireField(tbName = "iao")
    @ApiModelProperty(value = "数量")
    private Integer refundableQty;

    @ZfireField(tbName = "iao")
    @ApiModelProperty(value = "单价")
    private BigDecimal price;

    @ZfireField(tbName = "iao")
    @ApiModelProperty(value = "实付金额")
    private BigDecimal payAmount;

    @ZfireField(tbName = "so")
    @ApiModelProperty(value = "订单备注")
    private String remark;

    @ZfireField(tbName = "so")
    @ApiModelProperty(value = "工程登录编号")
    private String refEnginRecordNo;

    @ZfireField(tbName = "iao",colName = "remark")
    @ApiModelProperty(value = "订单表体备注")
    private String invoiceRemark;

    @ZfireField(tbName = "iao",colName = "header_remark")
    @ApiModelProperty(value = "订单表头备注")
    private String headerRemark;

    @ZfireField(tbName = "iao",colName = "service_name")
    @ApiModelProperty("业务员")
    private String serviceName;

    @ZfireField(hide = true)
    @ApiModelProperty("业务员")
    private String serviceId;

    @ZfireField(hide = true)
    @ApiModelProperty(value = "表头业务员id")
    private String k3ServiceId;

    @ZfireField(tbName = "iao",colName = "k3_service_name")
    @ApiModelProperty(value = "表头业务员")
    private String k3ServiceName;



    @ZfireField(hide = true)
    @ApiModelProperty(value = "销售出库单号")
    private String salesOrderNo;

    @ZfireField(hide = false,tbName = "so")
    @ApiModelProperty(value = "项目名称")
    private String refProjectName;


















    @ZfireField(hide = true)
    @ApiModelProperty(value = "创建人（制单人）")
    private String createBy;
    @ZfireField(hide = true,tbName = "so")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "更新人")
    private String updateBy;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "附近名")
    private String fileName;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "附件")
    private String fileUrl;


    @ZfireField(hide = true)
    @ApiModelProperty(value = "审批人账号")
    private String correspondUserName;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "工程信息单号")
    private String enginInfoNo;


    @ZfireField(hide = true)
    @ApiModelProperty(value = "关闭人")
    private String closeName;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "关闭时间")
    private Date closeTime;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "工程订单编号")
    private String enginOrderNo;

    @ZfireField(hide = true)
    @ApiModelProperty(value = "使用单位")
    private String refUseUnit;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "工程类型 TRADE=商用 HOME=家用")
    private String enginOrderType;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "厂编号")
    private String refFactoryNo;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "安装地址")
    private String refInstallAddress;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "联系人")
    private String refLinkman;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "联系电话")
    private String refPhone;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "固定电话")
    private String refTel;



    @ZfireField(hide = true)
    @ApiModelProperty(value = "1销售出库单  2销售退库单")
    private Integer type;


    @ZfireField(hide = true)
    @ApiModelProperty(value = "1销售订单 2直接调拨单  3直调单")
    private Integer invoiceType;

    @ZfireField(hide = true)
    @ApiModelProperty(value = "1 反审过得到得数据   0未反审")
    private Boolean counterclaim;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "1 旧单处理   2新单处理")
    private Integer syncType;


    @ZfireField(hide = true)
    @ApiModelProperty(value = "新单是否同步到金蝶 1同步 0 未同步")
    private Boolean syncKingOrderStatus;


    @ZfireField(hide = true)
    @ApiModelProperty(value = "主订单id")
    private String mainOrderId;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "销售明细订单id")
    private String salesOrderItemId;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "订单商品id")
    private String orderId;


    @ZfireField(hide = true)
    @ApiModelProperty(value = "申请发货订单号")
    private String invoiceId;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "申请数量")
    private Integer invoiceNum;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "审批数量")
    private Integer approvalNumber;


    @ZfireField(hide = true)
    @ApiModelProperty(value = "已退数量")
    private Integer retiredQty;







    @ZfireField(hide = true)
    @ApiModelProperty(value = "税率例如: 0.13")
    private BigDecimal tax;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "数量")
    private Integer qty;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "单价")
    private BigDecimal singlePayPrice;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "税后单价")
    private BigDecimal afterTaxPrice;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "无税金额")
    private BigDecimal noTotalAmount;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "实际扣除的返利金额")
    private BigDecimal payRebateAmount;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "总的格力折扣金额")
    private BigDecimal totalDiscAmount;

    @ZfireField(hide = true)
    @ApiModelProperty(value = "金蝶行号")
    private String kingDeeSeq;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "金蝶内码")
    private String kingDeeEntryId;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "金蝶销售出库单id")
    private String kingSaleId;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "金蝶销售出库单行号")
    private String kingDeeOrderSeq;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "金蝶销售出库单内码")
    private String kingDeeOrderId;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "金蝶销售出库number")
    private String kingBillNo;

    @ZfireField(hide = true)
    @ApiModelProperty(value = "存货类别")
    private String categoryName;

    @ZfireField(hide = true)
    @ApiModelProperty(value = "金蝶部门编号")
    private String k3OrgNumber;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "金蝶部门编号")
    private String k3OrgName;
    @ZfireField(hide = true)
    @ApiModelProperty(value = "钱包")
    private String customerWalletName;

    @ZfireField(hide = true)
    @ApiModelProperty(value = "图片")
    private List<SalesOrderPicture> salesOrderPictures;

}
