package com.njzscloud.supervisory.order.pojo.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.njzscloud.supervisory.biz.contant.AuditStatus;
import com.njzscloud.supervisory.order.contant.OrderCategory;
import com.njzscloud.supervisory.order.contant.OrderStatus;
import com.njzscloud.supervisory.order.contant.PayerCategory;
import com.njzscloud.supervisory.order.contant.PaymentStatus;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 订单信息
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
@TableName("order_info")
public class OrderInfoEntity {

    /**
     * Id
     */
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 订单编号
     */
    private String sn;

    /**
     * 装货地址 Id
     */
    private Long cargoPlaceId;

    /**
     * 站点 Id
     */
    private Long stationId;

    /**
     * 车道
     */
    private String laneId;

    /**
     * 下单人 Id; sys_user.id
     */
    private Long userId;

    /**
     * 审核状态; 字典代码：audit_status
     */
    private AuditStatus auditStatus;

    /**
     * 审核备注
     */
    private String auditMemo;

    /**
     * 订单类型; 字典代码：order_category
     */
    private OrderCategory orderCategory;

    /**
     * 订单状态; 字典代码：order_status
     */
    private OrderStatus orderStatus;

    /**
     * 看料员 Id; sys_user.id
     */
    private Long checkerId;

    /**
     * 看料状态; 字典代码：check_status
     */
    private String checkStatus;

    /**
     * 车辆 Id
     */
    private Long truckId;

    /**
     * 司机 Id
     */
    private Long driverId;

    /**
     * 产品 Id; order_goods.id
     */
    private Long goodsId;

    /**
     * 优惠金额; 有正负
     */
    private BigDecimal discountMoney;

    /**
     * 手动修正金额; 有正负
     */
    private BigDecimal reviseMoney;

    /**
     * 结算金额; 正
     */
    private BigDecimal settleMoney;

    /**
     * 付款方资金账户 Id
     */
    private Long payer;

    /**
     * 支付方类型; 字典代码：payer_category
     */
    private PayerCategory payerCategory;

    /**
     * 支付状态; 字典代码：payment_status
     */
    private PaymentStatus paymentStatus;

    /**
     * 支付时间
     */
    private LocalDateTime paymentTime;

    /**
     * 客户备注
     */
    private String customerMemo;

    /**
     * 看料员备注
     */
    private String checkerMemo;

    /**
     * 装车照片
     */
    private String cargoPhoto;

    /**
     * 看料照片
     */
    private String checkPhoto;

    /**
     * 创建人 Id; sys_user.id
     */
    @TableField(fill = FieldFill.INSERT)
    private Long creatorId;

    /**
     * 修改人 Id; sys_user.id
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long modifierId;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime modifyTime;

    /**
     * 是否删除; 0-->未删除、1-->已删除
     */
    @TableLogic
    private Boolean deleted;

}
