package com.fzm.mall.server.admin.order.model;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * <p>
 * 用户购物订单表-订单操作记录
 * </p>
 *
 * @author wulixian
 * @since 2021-03-19
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("order_log")
@ApiModel(value = "Log对象", description = "用户购物订单表-订单操作记录")
@NoArgsConstructor
public class OrderLog implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 提货单发货
     */
    public static final String ORDER_CONSULT_DISCOUNT = "商品订单修改价格";

    /**
     * 退款审核不通过
     */
    public static final String ORDER_EXAMINE_FAILED = "退款审核不通过";

    /**
     * 退款审核通过
     */
    public static final String ORDER_EXAMINE_SUCCESS = "退款审核通过";

    /**
     * 退款失败
     */
    public static final String ORDER_REFUND_FAILED = "退款失败";

    /**
     * 退款成功
     */
    public static final String ORDER_REFUND_SUCCESS = "退款成功";

    @ApiModelProperty(value = "主键自增编号")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "商品订单编号")
    private String oid;

    @ApiModelProperty(value = "订单状态，1->交易成功，2->交易关闭，3->定金已付，4->待退款，5->已退款，6->支付中，7->待支付")
    private Integer orderState;

    @ApiModelProperty(value = "操作信息")
    private String operation;

    @ApiModelProperty(value = "用户编号")
    private String uid;

    @TableField(exist = false)
    @ApiModelProperty(value = "用户名称")
    private String uName;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Long createTime;

    @ApiModelProperty(value = "更改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateTime;

    public OrderLog(String oid, Integer orderState, String operation, String adminId, String remark) {
        this.setOid(oid);
        this.setOrderState(orderState);
        this.setOperation(operation);
        this.setUid(adminId);
        this.setRemark(remark);
    }
}
