package com.xinelu.manage.domain.phonedialrecord;

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;

/**
 * 电话拨打记录对象 phone_dial_record
 *
 * @author xinelu
 * @date 2024-07-29
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "电话拨打记录对象", description = "phone_dial_record")
public class PhoneDialRecord 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 dialTime;

    /**
     * 电话模板id
     */
    @ApiModelProperty(value = "电话模板id")
    private String phoneTemplateId;

    /**
     * 电话模板名称
     */
    @ApiModelProperty(value = "电话模板名称")
    @Excel(name = "模板名称")
    private String phoneTemplateName;

    /**
     * 替换标签之后的电话内容
     */
    @ApiModelProperty(value = "替换标签之后的电话内容")
    private String messageNodeContent;

    /**
     * AI ：自动外呼 或  COMMON：人工随访电话，否则为空
     */
    @ApiModelProperty(value = "AI ：自动外呼 或  COMMON：人工随访电话，否则为空")
    private String phoneDialMethod;

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

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

	/**
	 * 生成通话录音唯一标识,可通过该标识，获取录音
	 */
	@ApiModelProperty(value = "生成通话录音唯一标识,可通过该标识，获取录音")
	private String ctUuid;

	/**
	 * 通话录音存储路径
	 */
	@ApiModelProperty(value = "通话录音存储路径")
	private String phoneDialRecordVideo;

    /**
     * 通话时长
     */
    @ApiModelProperty(value = "通话时长")
    @Excel(name = "通话时长")
    private BigDecimal phoneDuration;

    /**
     * 通话费用
     */
    @ApiModelProperty(value = "单价")
    @Excel(name = "单价")
    private BigDecimal phoneUnitPrice;

    /**
     * 通话费用
     */
    @ApiModelProperty(value = "通话费用")
    @Excel(name = "通话费用")
    private BigDecimal phoneExpense;

    /**
     * 关联账单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("dialTime", getDialTime())
                .append("phoneTemplateId", getPhoneTemplateId())
                .append("phoneTemplateName", getPhoneTemplateName())
                .append("messageNodeContent", getMessageNodeContent())
                .append("phoneDialMethod", getPhoneDialMethod())
                .append("errorCode", getErrorCode())
                .append("errorStatus", getErrorStatus())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("ctUuid", getCtUuid())
                .append("phoneDialRecordVideo", getPhoneDialRecordVideo())
                .append("phoneDuration", getPhoneDuration())
                .append("phoneCost", getPhoneExpense())
                .append("phoneUnitPrice", getPhoneUnitPrice())
                .append("billId", getBillId())
                .toString();
    }
}
