package com.wzj.soopin.order.domain.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.wzj.soopin.order.domain.entity.VerificationCodes;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.dromara.common.core.domain.model.BaseAudit;
import org.dromara.common.excel.annotation.Excel;

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

/**
 * 订单详情
 *
 * @author zcc
 */
@Data
public class OrderVO extends BaseAudit {

    @Schema(description ="订单id")
    private Long id;

    @Schema(description ="支付id")
    private Long payId;

    @Schema(description ="订单编号")
    private String orderSn;

    @Schema(description ="MEMBER_ID  精确匹配")
    @Excel(name = "MEMBER_ID")
    private Long memberId;

    @Schema(description ="租户id")
    private String tenantId;

    @Schema(description ="用户帐号")
    @Excel(name = "用户帐号")
    private String memberUsername;

    @Schema(description ="商家备注")
    @Excel(name = "商家备注")
    private String merchantNote;

    @Schema(description ="订单总金额")
    @Excel(name = "订单总金额")
    private BigDecimal totalAmount;

    @Schema(description ="采购价")
    @Excel(name = "采购价")
    private BigDecimal purchasePrice;

    @Schema(description ="应付金额")
    @Excel(name = "应付金额", readConverterExp = "实=际支付金额")
    private BigDecimal payAmount;


    @Schema(description ="支付方式：0->未支付；1->支付宝；2->微信")
    @Excel(name = "支付方式：0->未支付；1->支付宝；2->微信")
    private Integer payType;

    /**
     *  订单状态枚举类型见{@link com.wzj.soopin.order.emum.OrderStatusEnum}
     */
    private Integer status;

    @Schema(description="是否处于退款状态")
    private Boolean aftersale;


    @Schema(description ="省份/直辖市")
    @Excel(name = "省份/直辖市")
    private String receiverProvince;

    @Schema(description ="城市")
    @Excel(name = "城市")
    private String receiverCity;

    @Schema(description ="区")
    @Excel(name = "区")
    private String receiverDistrict;

    @Schema(description ="省份/直辖市id")
    @Excel(name = "省份/直辖市id")
    private Long receiverProvinceId;

    @Schema(description ="城市id")
    @Excel(name = "城市id")
    private Long receiverCityId;

    @Schema(description ="区idvv")
    @Excel(name = "区id")
    private Long receiverDistrictId;

    @Schema(description ="详细地址")
    @Excel(name = "详细地址")
    private String receiverDetailAddress;

    @Schema(description ="订单备注")
    @Excel(name = "订单备注")
    private String note;

    @Schema(description ="支付时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime paymentTime;

    private List<OrderItemVO> items;

    @Excel(name = "用户昵称")
    @Schema(description ="用户昵称")
    private String memberNickname;
    @Excel(name = "用户手机号")
    @Schema(description ="用户手机号")
    private String memberPhoneEncrypted;

    @Excel(name = "卖家昵称")
    @Schema(description ="卖家昵称")
    private String tenantContactName;

    @Excel(name = "卖家手机号")
    @Schema(description ="卖家手机号")
    private String tenantContactPhone;

    @Excel(name = "itemID")
    @Schema(description ="itemID")
    private Long itemId;

    @Excel(name = "商品id")
    @Schema(description ="商品id")
    private Long productId;

    @Excel(name = "商品品牌")
    @Schema(description ="商品品牌id")
    private Long productBrandId;

    @Schema(description ="商品名称")
    @Excel(name = "商品名称")
    private String productName;

    @Schema(description ="商品价格")
    @Excel(name = "商品价格")
    private BigDecimal productPrice;

    @Schema(description = "订单类型：1->团购；2->拼团;3->秒杀；")
    @Excel(name = "订单类型：1->团购；2->拼团;3->秒杀；")
    private Integer type;

    @Schema(description = "提现状态：1->等待转账；2->转帐中;3->转账成功;4->转账失败")
    @Excel(name = "提现状态：1->等待转账；2->转帐中;3->转账成功;4->转账失败")
    private Integer withdrawStatus;

    @Schema(name = "productInfo", description = "订单商品数据")
    private List<Map<String, Object>> productList;

    @Schema(description = "配送方式 1->到店核销；2->自提;3->配送;")
    private Integer distribution;

    @Schema(description = "核销码")
    private List<VerificationCodes> verificationCodes;

    @Schema(description = "使用的优惠卷id")
    private Long memberCouponId;

    @Schema(description = "优惠卷金额")
    private BigDecimal couponAmount;


}
