package com.ym.mec.biz.dal.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ym.mec.biz.dal.enums.DealStatusEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

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

/**
 * 机构付款记录表(TenantOrderRecord)表实体类
 *
 * @author hgw
 * @since 2021-12-20 10:08:28
 */
@ApiModel(value = "tenant_order_record-机构付款记录表")
public class TenantOrderRecord implements Serializable {
    @TableId(value = "id_", type = IdType.AUTO)
    @ApiModelProperty(value = "主键")
    private Integer id;

    @TableField("tenant_id_")
    @ApiModelProperty(value = "机构产品设置表id")
    private Integer tenantId;

    @TableField("order_no_")
    @ApiModelProperty(value = "订单编号(付款前生成订单时生成的编号)")
    private String orderNo;

    @TableField("trans_no_")
    @ApiModelProperty(value = "支付编号(付款后第三方支付给予的)")
    private String transNo;

    @TableField("order_type_")
    @ApiModelProperty(value = "订单类型/机构开通缴费、续费、充值、激活团练宝")
    private String orderType;

    @TableField("payment_channel_")
    @ApiModelProperty(value = "付款渠道/惠支付、双乾")
    private String paymentChannel;

    @TableField("pay_channel_")
    @ApiModelProperty(value = "付款渠道/微信、支付宝、等")
    private String payChannel;

    @TableField("expect_amount")
    @ApiModelProperty(value = "应付金额")
    private BigDecimal expectAmount;

    @TableField("actual_amount")
    @ApiModelProperty(value = "实付金额")
    private BigDecimal actualAmount;

    @TableField("mer_nos_")
    @ApiModelProperty(value = "收款账户")
    private String merNos;

    @TableField("order_state_")
    @ApiModelProperty(value = "订单状态/0待支付、1已支付、2支付失败")
    private Integer orderState;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @TableField("pay_date_")
    @ApiModelProperty(value = "支付日期")
    private Date payDate;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("pay_time_")
    @ApiModelProperty(value = "支付时间")
    private Date payTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("created_time_")
    @ApiModelProperty(value = "订单创建时间")
    private Date createdTime;

    public DealStatusEnum getEnumOrderState() {
        switch (orderState) {
            case 0:
                return DealStatusEnum.ING;
            case 1:
                return DealStatusEnum.SUCCESS;
            default:
                return DealStatusEnum.FAILED;
        }
    }

    private static final long serialVersionUID = 1L;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getTenantId() {
        return tenantId;
    }

    public void setTenantId(Integer tenantId) {
        this.tenantId = tenantId;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getTransNo() {
        return transNo;
    }

    public void setTransNo(String transNo) {
        this.transNo = transNo;
    }

    public String getOrderType() {
        return orderType;
    }

    public void setOrderType(String orderType) {
        this.orderType = orderType;
    }

    public String getPaymentChannel() {
        return paymentChannel;
    }

    public void setPaymentChannel(String paymentChannel) {
        this.paymentChannel = paymentChannel;
    }

    public String getPayChannel() {
        return payChannel;
    }

    public void setPayChannel(String payChannel) {
        this.payChannel = payChannel;
    }

    public BigDecimal getExpectAmount() {
        return expectAmount;
    }

    public void setExpectAmount(BigDecimal expectAmount) {
        this.expectAmount = expectAmount;
    }

    public BigDecimal getActualAmount() {
        return actualAmount;
    }

    public void setActualAmount(BigDecimal actualAmount) {
        this.actualAmount = actualAmount;
    }

    public String getMerNos() {
        return merNos;
    }

    public void setMerNos(String merNos) {
        this.merNos = merNos;
    }

    public Integer getOrderState() {
        return orderState;
    }

    public void setOrderState(Integer orderState) {
        this.orderState = orderState;
    }

    public Date getPayDate() {
        return payDate;
    }

    public void setPayDate(Date payDate) {
        this.payDate = payDate;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }


}

