package com.xinelu.manage.domain.shortmessagesendrecord;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseEntity;
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.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 短信发送结果记录对象 short_message_send_record
 *
 * @author xinelu
 * @date 2024-07-30
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "短信发送结果记录对象", description = "short_message_send_record")
public class ShortMessageSendRecord extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    private Long id;

    /**
     * 患者id
     */
    @ApiModelProperty(value = "患者id")
    private Long patientId;

    /**
     * 签约患者管理任务节点表id
     */
    @ApiModelProperty(value = "签约患者管理任务节点表id")
    private Long manageRouteNodeId;

    /**
     * 患者手机号
     */
    @ApiModelProperty(value = "患者手机号")
    @Excel(name = "手机号")
    private String patientPhone;

    /**
     * 消息发送时间
     */
    @ApiModelProperty(value = "消息发送时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "消息发送时间", width = 30, dateFormat = "yyyy-MM-dd")
    private LocalDateTime sendTime;

    /**
     * 消息模板id
     */
    @ApiModelProperty(value = "消息模板id")
    private String messageTemplateId;

    /**
     * 消息内容
     */
    @ApiModelProperty(value = "消息内容")
    private String messageNodeContent;

    /**
     * 推送结果状态码（0表示成功）
     */
    @ApiModelProperty(value = "推送结果状态码")
    private Long errorCode;

    /**
     * 推送结果状态码，success：成功，fail：失败
     */
    @ApiModelProperty(value = "推送结果状态码，success：成功，fail：失败")
    private String errorStatus;

    /**
     * 错误码信息描述
     */
    @ApiModelProperty(value = "错误码信息描述")
    private String errMsg;

    /**
     * PHONE_MSG:电话同时发短信时；COMMON:通用
     */
    @ApiModelProperty(value = "PHONE_MSG:电话同时发短信时；COMMON:通用")
    private String messageType;

    /**
     * 短信长度
     */
    @ApiModelProperty(value = "短信长度")
    @Excel(name = "短信长度")
    private Long messageLength;

    /**
     * 短信数量
     */
    @ApiModelProperty(value = "短信数量")
    @Excel(name = "短信数量")
    private Long messageQuantity;

    /**
     * 短信单价
     */
    @ApiModelProperty(value = "短信单价")
    @Excel(name = "短信单价")
    private BigDecimal messageUnitPrice;

    /**
     * 短信价格
     */
    @ApiModelProperty(value = "短信价格")
    @Excel(name = "短信价格")
    private BigDecimal messageExpense;

    /**
     * 关联账单id
     */
    @ApiModelProperty(value = "关联账单id")
    private Long billId;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("patientId", getPatientId())
                .append("manageRouteNodeId", getManageRouteNodeId())
                .append("patientPhone", getPatientPhone())
                .append("sendTime", getSendTime())
                .append("messageTemplateId", getMessageTemplateId())
                .append("messageNodeContent", getMessageNodeContent())
                .append("errorCode", getErrorCode())
                .append("errorStatus", getErrorStatus())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("messageType", getMessageType())
                .append("messageLength", getMessageLength())
                .append("messageQuantity", getMessageQuantity())
                .append("messageUnitPrice", getMessageUnitPrice())
                .append("messageExpense", getMessageExpense())
                .append("billId", getBillId())
                .toString();
    }
}
