package com.xinelu.manage.domain.refundinfo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

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

/**
 * 退款记录信息对象 refund_info
 *
 * @author xinyilu
 * @date 2022-10-18
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "退款记录信息对象", description = "refund_info")
public class RefundInfo extends BaseDomain implements Serializable {

    private static final long serialVersionUID = -3202049270867033957L;
    /**
     * 主键id
     */
    private Long id;

    /**
     * 会员id
     */
    @ApiModelProperty(value = "会员id")
    @Excel(name = "会员id")
    private Long patientId;

    /**
     * 护理员表id
     */
    private Long nurseStationPersonId;

    /**
     * 商品订单号
     */
    @ApiModelProperty(value = "商品订单号")
    @Excel(name = "商品订单号")
    private String orderNo;

    /**
     * 支付退款单号，多种支付方式共用
     */
    @ApiModelProperty(value = "支付退款单号，多种支付方式共用")
    @Excel(name = "支付退款单号，多种支付方式共用")
    private String refundNo;

    /**
     * 商户退款单号，系统自动生成
     */
    @ApiModelProperty(value = "商户退款单号，系统自动生成")
    @Excel(name = "商户退款单号，系统自动生成")
    private String outRefundNo;

    /**
     * 支付交易订单号，多种支付方式共用
     */
    @ApiModelProperty(value = "支付交易订单号，多种支付方式共用")
    @Excel(name = "支付交易订单号，多种支付方式共用")
    private String transactionNo;

    /**
     * 退款原因
     */
    @ApiModelProperty(value = "退款原因")
    @Excel(name = "退款原因")
    private String refundReason;

    /**
     * 退款方式，微信：WE_CHAT，支付宝：ALI_PAY
     */
    @ApiModelProperty(value = "退款方式，微信：WE_CHAT，支付宝：ALI_PAY")
    @Excel(name = "退款方式，微信：WE_CHAT，支付宝：ALI_PAY")
    private String refundType;

    /**
     * 微信退款状态，退款成功：SUCCESS，退款关闭：CLOSED，退款处理中：PROCESSING，退款异常：ABNORMAL
     */
    @ApiModelProperty(value = "微信退款状态，退款成功：SUCCESS，退款关闭：CLOSED，退款处理中：PROCESSING，退款异常：ABNORMAL")
    @Excel(name = "微信退款状态，退款成功：SUCCESS，退款关闭：CLOSED，退款处理中：PROCESSING，退款异常：ABNORMAL")
    private String wechatRefundStatus;

    /**
     * 支付宝退款状态，退款成功：SUCCESS，退款关闭：CLOSED，退款处理中：PROCESSING，退款异常：ABNORMAL
     */
    @ApiModelProperty(value = "支付宝退款状态，退款成功：SUCCESS，退款关闭：CLOSED，退款处理中：PROCESSING，退款异常：ABNORMAL")
    @Excel(name = "支付宝退款状态，退款成功：SUCCESS，退款关闭：CLOSED，退款处理中：PROCESSING，退款异常：ABNORMAL")
    private String alipayRefundStatus;

    /**
     * 订单金额（分）
     */
    @ApiModelProperty(value = "订单金额")
    @Excel(name = "订单金额", readConverterExp = "分=")
    private BigDecimal orderTotalPrice;

    /**
     * 退款金额（分）
     */
    @ApiModelProperty(value = "退款金额")
    @Excel(name = "退款金额", readConverterExp = "分=")
    private BigDecimal refundPrice;

    /**
     * 退款币种，人民币：CNY
     */
    @ApiModelProperty(value = "退款币种，人民币：CNY")
    @Excel(name = "退款币种，人民币：CNY")
    private String currency;

    /**
     * ORIGINAL：原路退款，BALANCE：退回到余额，OTHER_BALANCE：原账户异常退到其他余额账户，OTHER_BANKCARD：原银行卡异常退到其他银行卡
     */
    @ApiModelProperty(value = "ORIGINAL：原路退款，BALANCE：退回到余额，OTHER_BALANCE：原账户异常退到其他余额账户，OTHER_BANKCARD：原银行卡异常退到其他银行卡")
    @Excel(name = "ORIGINAL：原路退款，BALANCE：退回到余额，OTHER_BALANCE：原账户异常退到其他余额账户，OTHER_BANKCARD：原银行卡异常退到其他银行卡")
    private String channel;

    /**
     * 退款入账账户
     */
    @ApiModelProperty(value = "退款入账账户")
    @Excel(name = "退款入账账户")
    private String userreceivedaccount;

    /**
     * 退款成功时间
     */
    @ApiModelProperty(value = "退款成功时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "退款成功时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime successTime;

    /**
     * 退款回调通知内容，微信或者支付款退款通知内容
     */
    @ApiModelProperty(value = "退款回调通知内容，微信或者支付款退款通知内容")
    @Excel(name = "退款回调通知内容，微信或者支付款退款通知内容")
    private String refundNotifyContent;

    /**
     * 申请退款返回参数内容
     */
    @ApiModelProperty(value = "申请退款返回参数内容")
    @Excel(name = "申请退款返回参数内容")
    private String applyRefundReturnContent;

    /**
     * 退款账户类型，新医路账户：XINYILU，医路优品：YILUYOUPIN
     */
    @ApiModelProperty(value = "退款账户类型，新医路账户：XINYILU，医路优品：YILUYOUPIN")
    @Excel(name = "退款账户类型，新医路账户：XINYILU，医路优品：YILUYOUPIN")
    private String refundMerchantType;

    /**
     * 是否删除，0：否，1：是
     */
    private Integer delFlag;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("patientId", getPatientId())
                .append("orderNo", getOrderNo())
                .append("refundNo", getRefundNo())
                .append("outRefundNo", getOutRefundNo())
                .append("transactionNo", getTransactionNo())
                .append("refundReason", getRefundReason())
                .append("refundType", getRefundType())
                .append("wechatRefundStatus", getWechatRefundStatus())
                .append("alipayRefundStatus", getAlipayRefundStatus())
                .append("orderTotalPrice", getOrderTotalPrice())
                .append("refundPrice", getRefundPrice())
                .append("currency", getCurrency())
                .append("channel", getChannel())
                .append("userreceivedaccount", getUserreceivedaccount())
                .append("successTime", getSuccessTime())
                .append("refundNotifyContent", getRefundNotifyContent())
                .append("applyRefundReturnContent", getApplyRefundReturnContent())
                .append("refundMerchantType", getRefundMerchantType())
                .append("delFlag", getDelFlag())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
