package com.gxwebsoft.cms.entity;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 网站订单
 *
 * @author 科技小王子
 * @since 2026-01-27 13:03:24
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(name = "CmsOrder对象", description = "网站订单")
public class CmsOrder implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "订单类型，0售前咨询 1售后服务 2意见反馈")
    private Integer type;

    @Schema(description = "订单标题")
    private String title;

    @Schema(description = "公司/团队名称")
    private String company;

    @Schema(description = "订单内容")
    private String content;

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

    @Schema(description = "快递/自提")
    private Integer deliveryType;

    @Schema(description = "下单渠道，0网站 1微信小程序 2其他")
    private Integer channel;

    @Schema(description = "微信支付交易号号")
    private String transactionId;

    @Schema(description = "微信退款订单号")
    private String refundOrder;

    @Schema(description = "商户ID")
    private Integer merchantId;

    @Schema(description = "商户名称")
    private String merchantName;

    @Schema(description = "商户编号")
    private String merchantCode;

    @Schema(description = "使用的优惠券id")
    private Integer couponId;

    @Schema(description = "使用的会员卡id")
    private String cardId;

    @Schema(description = "关联管理员id")
    private Integer adminId;

    @Schema(description = "核销管理员id")
    private Integer confirmId;

    @Schema(description = "IC卡号")
    private String icCard;

    @Schema(description = "真实姓名")
    private String realName;

    @Schema(description = "关联收货地址")
    private Integer addressId;

    @Schema(description = "收货地址")
    private String address;

    private String addressLat;

    private String addressLng;

    @Schema(description = "自提店铺id")
    private Integer selfTakeMerchantId;

    @Schema(description = "自提店铺")
    private String selfTakeMerchantName;

    @Schema(description = "配送开始时间")
    private String sendStartTime;

    @Schema(description = "配送结束时间")
    private String sendEndTime;

    @Schema(description = "发货店铺id")
    private Integer expressMerchantId;

    @Schema(description = "发货店铺")
    private String expressMerchantName;

    @Schema(description = "订单总额")
    private BigDecimal totalPrice;

    @Schema(description = "减少的金额，使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格")
    private BigDecimal reducePrice;

    @Schema(description = "实际付款")
    private BigDecimal payPrice;

    @Schema(description = "用于统计")
    private BigDecimal price;

    @Schema(description = "价钱，用于积分赠送")
    private BigDecimal money;

    @Schema(description = "取消时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime cancelTime;

    @Schema(description = "取消原因")
    private String cancelReason;

    @Schema(description = "退款金额")
    private BigDecimal refundMoney;

    @Schema(description = "教练价格")
    private BigDecimal coachPrice;

    @Schema(description = "购买数量")
    private Integer totalNum;

    @Schema(description = "教练id")
    private Integer coachId;

    @Schema(description = "商品ID")
    private Integer formId;

    @Schema(description = "支付的用户id")
    private Integer payUserId;

    @Schema(description = "0余额支付，1微信支付，2支付宝支付，3银联支付，4现金支付，5POS机支付，6免费，7积分支付")
    private Integer payType;

    @Schema(description = "微信支付子类型：JSAPI小程序支付，NATIVE扫码支付")
    private String wechatPayType;

    @Schema(description = "0余额支付，1微信支付，2支付宝支付，3银联支付，4现金支付，5POS机支付，6免费，7积分支付")
    private Integer friendPayType;

    @Schema(description = "0未付款，1已付款")
    private Integer payStatus;

    @Schema(description = "0未使用，1已完成，2已取消，3取消中，4退款申请中，5退款被拒绝，6退款成功，7客户端申请退款")
    private Integer orderStatus;

    @Schema(description = "发货状态(10未发货 20已发货 30部分发货)")
    private Integer deliveryStatus;

    @Schema(description = "无需发货备注")
    private String deliveryNote;

    @Schema(description = "发货时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime deliveryTime;

    @Schema(description = "评价状态(0未评价 1已评价)")
    private Integer evaluateStatus;

    @Schema(description = "评价时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime evaluateTime;

    @Schema(description = "优惠类型：0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡，5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡")
    private Integer couponType;

    @Schema(description = "优惠说明")
    private String couponDesc;

    @Schema(description = "二维码地址，保存订单号，支付成功后才生成")
    private String qrcode;

    @Schema(description = "vip月卡年卡、ic月卡年卡回退次数")
    private Integer returnNum;

    @Schema(description = "vip充值回退金额")
    private BigDecimal returnMoney;

    @Schema(description = "预约详情开始时间数组")
    private String startTime;

    @Schema(description = "是否已开具发票：0未开发票，1已开发票，2不能开具发票")
    private Integer isInvoice;

    @Schema(description = "发票流水号")
    private String invoiceNo;

    @Schema(description = "商家留言")
    private String merchantRemarks;

    @Schema(description = "支付时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime payTime;

    @Schema(description = "退款时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime refundTime;

    @Schema(description = "申请退款时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime refundApplyTime;

    @Schema(description = "过期时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime expirationTime;

    @Schema(description = "自提码")
    private String selfTakeCode;

    @Schema(description = "是否已收到赠品")
    private Boolean hasTakeGift;

    @Schema(description = "对账情况：0=未对账；1=已对账；3=已对账，金额对不上；4=未查询到该订单")
    private Integer checkBill;

    @Schema(description = "订单是否已结算(0未结算 1已结算)")
    private Integer isSettled;

    @Schema(description = "系统版本号 0当前版本 value=其他版本")
    private Integer version;

    @Schema(description = "用户id")
    private Integer userId;

    @Schema(description = "备注")
    private String comments;

    @Schema(description = "排序号")
    private Integer sortNumber;

    @Schema(description = "是否删除, 0否, 1是")
    @TableLogic
    private Integer deleted;

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

    @Schema(description = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

}
