package com.gxwebsoft.shop.entity;

import java.math.BigDecimal;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 分销商订单记录表
 *
 * @author 科技小王子
 * @since 2025-08-12 11:55:18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(name = "ShopDealerOrder对象", description = "分销商订单记录表")
public class ShopDealerOrder implements Serializable {
    private static final long serialVersionUID = 1L;

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

    @Schema(description = "买家用户ID")
    private Integer userId;

    @Excel(name = "公司名称")
    private String title;

    @Excel(name = "订单编号")
    private String orderNo;

    @Excel(name = "订单状态")
    @TableField(exist = false)
    private Integer orderStatus;

    @Schema(description = "买家用户昵称")
    @TableField(exist = false)
    private String nickname;

    @Schema(description = "订单总金额(不含运费)")
    private BigDecimal orderPrice;

    @Schema(description = "结算金额")
    private BigDecimal settledPrice;

    @Schema(description = "换算成度")
    private BigDecimal degreePrice;

    @Schema(description = "实发金额")
    private BigDecimal payPrice;

    @Schema(description = "分销商用户id(一级)")
    private Integer firstUserId;

    @Schema(description = "分销商用户昵称(一级)")
    @TableField(exist = false)
    private String firstNickname;

    @Schema(description = "分销商用户id(二级)")
    private Integer secondUserId;

    @Schema(description = "分销商用户昵称(二级)")
    @TableField(exist = false)
    private String secondNickname;

    @Schema(description = "分销商用户id(三级)")
    private Integer thirdUserId;

    @Schema(description = "分销商用户昵称(三级)")
    @TableField(exist = false)
    private String thirdNickname;

    @Schema(description = "分销佣金(一级)")
    private BigDecimal firstMoney;

    @Schema(description = "分销佣金(二级)")
    private BigDecimal secondMoney;

    @Schema(description = "分销佣金(三级)")
    private BigDecimal thirdMoney;

    @Schema(description = "门店(一级)")
    private Integer firstDividendUser;

    @Schema(description = "门店名称(一级)")
    @TableField(exist = false)
    private String firstDividendUserName;

    @Schema(description = "分红(一级)")
    private BigDecimal firstDividend;

    @Schema(description = "门店(二级)")
    private Integer secondDividendUser;

    @Schema(description = "门店名称(二级)")
    @TableField(exist = false)
    private String secondDividendUserName;

    @Schema(description = "分红(二级)")
    private BigDecimal secondDividend;

    @Schema(description = "佣金比例")
    private BigDecimal rate;

    @Schema(description = "单价")
    private BigDecimal price;

    @Schema(description = "结算月份")
    private String month;

    @Schema(description = "订单是否失效(0未失效 1已失效)")
    private Integer isInvalid;

    @Schema(description = "佣金结算(0未结算 1已结算)")
    private Integer isSettled;

    @Schema(description = "佣金冻结(1解冻中 0已解冻)")
    private Integer isUnfreeze;

    @Schema(description = "结算时间")
    private LocalDateTime settleTime;

    @Schema(description = "解冻时间")
    private LocalDateTime unfreezeTime;

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

    @Schema(description = "商城ID")
    private Integer tenantId;

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

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

}
