package com.ruoyi.system.domain;

import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.GeneratedValue;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 父订单对象 order_parent
 *
 * @author ruoyi
 * @date 2025-09-02
 */
@Data
@TableName(value = "order_parent")
@EqualsAndHashCode(callSuper = false)
public class OrderParent
{
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    @GeneratedValue
    /** 父订单ID */
    private Long id;

    /** 用户ID */
    @Excel(name = "用户ID")
    private Long userId;

    /** 订单状态：0待支付，1已支付，2已取消 */
    @Excel(name = "订单状态：0待支付，1已支付，2已取消")
    private Long orderStatus;

    /** 订单总金额(分) */
    @Excel(name = "订单总金额(分)")
    private Long totalAmount;

    /** 总优惠金额(分) */
    @Excel(name = "总优惠金额(分)")
    private Long totalDiscount;

    /** 实际支付金额(分) */
    @Excel(name = "实际支付金额(分)")
    private Long actualPayAmount;

    /** 支付方式 */
    @Excel(name = "支付方式")
    private String paymentMethod;

    /** 支付时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date paymentTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    private String ddId;
    /** 餐桌码ID，关联 table_qrcode.id */
    private Long tableId;

    /**
     * 收货地址id
     */

    private Long shdzId;

    /**
     * 收货地址
     */

    private String shAddress;

    /**
     * 订单类型：0外送，1自取，2堂食
     */
    private Long type;
    /** 整单备注 */
    private String remarks;
    @TableField(exist = false)
    private List<PosOrder> items;


}
