package org.jeecg.modules.system.app.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @Description: 订单表
 * @Author: jeecg-boot
 * @Date:   2025-07-03
 * @Version: V1.0
 */
@Data
@TableName("nm_order")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description="订单表")
public class AppOrder implements Serializable {
    private static final long serialVersionUID = 1L;

	/**id*/
	@TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "id")
    private String id;
	/**订单号*/
	@Excel(name = "订单号", width = 15)
    @Schema(description = "订单号")
    private String orderCode;
    /**订单类型*/
    @Excel(name = "订单类型", width = 15)
    @Schema(description = "订单类型 0场地/1赛事/2课程")
    private Integer type;
    @Excel(name = "订单子类型", width = 15)
    @Schema(description = "订单子类型 0-学校 1-包场 2-无固定场 3-个人赛 4-团队赛 5-课程")
    private Integer orderType;
    /**部门id*/
    @Excel(name = "部门编码", width = 15)
    @Schema(description = "部门编码")
    private String orgCode;
    /**
     * 部门id
     */
    @Excel(name = "部门id", width = 15)
    @Schema(description = "部门id")
    private String tenantId;
	/**产品id列表;场地/赛事/课程*/
	@Excel(name = "产品id列表;场地/赛事/课程", width = 15)
    @Schema(description = "产品id列表;场地/赛事/课程")
    private String productIds;
    /**商品数量*/
    @Excel(name = "商品数量", width = 15)
    @Schema(description = "商品数量")
    private Integer amount;
	/**用户id*/
	@Excel(name = "用户id", width = 15)
    @Schema(description = "用户id")
    private String userId;
    /**用户id*/
    @Excel(name = "用户OpenId", width = 15)
    @Schema(description = "用户OpenId")
    private String userOpenId;
    /**
     * 用户手机号
     */
    @Excel(name = "用户手机号", width = 15)
    @Schema(description = "用户手机号")
    private String userPhone;
	/**原订单总价*/
	@Excel(name = "原订单总价", width = 15)
    @Schema(description = "原订单总价")
    private BigDecimal originalPrice;
	/**实际支付价*/
	@Excel(name = "实际支付价", width = 15)
    @Schema(description = "实际支付价")
    private BigDecimal price;
	/**优惠信息*/
	@Excel(name = "试听优惠金额", width = 15)
    @Schema(description = "试听优惠金额")
    private BigDecimal sDiscounts;
    /**优惠信息*/
    @Excel(name = "团购优惠金额", width = 15)
    @Schema(description = "团购优惠金额")
    private BigDecimal tDiscounts;
	/**支付流水号*/
	@Excel(name = "支付流水号", width = 15)
    @Schema(description = "支付流水号")
    private String payId;
	/**支付类型;0 wx 1zfb 2yl*/
	@Excel(name = "支付类型;0 wx 1zfb 2yl", width = 15)
    @Schema(description = "支付类型;0 wx 1zfb 2yl 3free")
    private Integer payType;
	/**订单状态*/
	@Excel(name = "订单状态", width = 15)
    @Schema(description = "订单状态 0-待付款 1-待使用 2-已使用 3-已到期 4-已取消 5-退款中 6-已退款")
    private Integer orderStatus;

    @Schema(description = "售后状态 0-暂无售后 1-存在退款")
    private Integer afterSaleStatus;

    @Schema(description = "退款类型 0-无 1-整单退款 2-部分退款")
    private Integer refundType;

    @Schema(description = "支付状态 0-待支付 1-支付成功 2-退款中 3-已退款")
    private Integer payStatus;

    @Schema(description = "回调状态 0-未回调 1-已回调")
    private Integer callbackStatus;

    /**
     * 是否分账（0-否 1-是）
     */
    @Schema(description = "是否分账（0-否 1-是）")
    private Integer orProfitSharing;

    /**
     * 分账状态
     */
    @Schema(description = "分账状态 0-未分账 1-分账中 2-已分账")
    private Integer profitSharingStatus;

    /**
     * 微信交易流水号
     */
    @Schema(description = "transactionId")
    private String transactionId;

    /**
     * 商户分账订单号
     */
    @Schema(description = "outOrderNo")
    private String outOrderNo;

    /**
     * 微信分账单号
     */
    @Schema(description = "微信分账单号")
    private String profitSharingOrderId;

	/**参赛资质*/
	@Excel(name = "参赛资质", width = 15)
    @Schema(description = "参赛资质")
    private String gameCertification;
    /**合同编号*/
    @Excel(name = "合同编号", width = 15)
    @Schema(description = "合同编号")
    private String contractNo;
    /**使用人ID*/
    @Excel(name = "使用人ID", width = 15)
    @Schema(description = "使用人ID")
    private String familyIds;
    @Excel(name = "使用人ID", width = 15)
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "支付时间")
    private Date payTime;
	/**取消备注*/
	@Excel(name = "取消备注", width = 15)
    @Schema(description = "取消备注")
    private String remark;
	/**乐观锁*/
	@Excel(name = "乐观锁", width = 15)
    @Schema(description = "乐观锁")
    @Version
    private Integer revision;
	/**创建人;创建人*/
    @Schema(description = "创建人;创建人")
    private String createBy;
	/**创建时间;创建时间*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建时间;创建时间")
    private Date createTime;
	/**更新人;更新人*/
    @Schema(description = "更新人;更新人")
    private String updateBy;
	/**更新时间;更新时间*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @Schema(description = "更新时间;更新时间")
    private Date updateTime;
	/**系统状态;状态(0-正常,1-冻结)*/
	@Excel(name = "系统状态;状态(0-正常,1-冻结)", width = 15)
    @Schema(description = "系统状态;状态(0-正常,1-冻结)")
    private Integer status;
	/**删除标志;删除状态(0-正常,1-已删除)*/
	@Excel(name = "删除标志;删除状态(0-正常,1-已删除)", width = 15)
    @Schema(description = "删除标志;删除状态(0-正常,1-已删除)")
    @TableLogic
    private Integer delFlag;

    @Excel(name = "8小时微信通知标识 0-false 1-true)", width = 15)
    @Schema(description = "8小时微信通知标识 0-false 1-true")
    private Integer notified8h;

    @Excel(name = "24小时微信通知标识 0-false 1-true)", width = 15)
    @Schema(description = "24小时微信通知标识 0-false 1-true)")
    private Integer notified24h;

    @Excel(name = "通知次数标识 限制3次", width = 15)
    @Schema(description = "通知次数标识 限制3次")
    private Integer notifyRetryCount;

    @Excel(name = "地点ID", width = 15)
    @Schema(description = "地点ID")
    private String addressSiteId;

    @Excel(name = "是否免费课订单（0-否 1-是）", width = 15)
    @Schema(description = "是否免费课订单（0-否 1-是）")
    private Integer orderOrFree;
    /**
     * 订单扩展字段
     */
    private String orderExtraField;
}
