package com.fs.company.domain;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.UUID;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fs.common.annotation.Excel;
import lombok.Data;
import com.fs.common.core.domain.BaseEntity;
import lombok.EqualsAndHashCode;

/**
 * 调用日志_ai打电话对象 company_voice_robotic_call_log_callphone
 *
 * @author fs
 * @date 2026-01-15
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class CompanyVoiceRoboticCallLogCallphone extends BaseEntity{

    /** $column.columnComment */
    @TableId(value = "log_id", type = IdType.AUTO)
    private Long logId;

    private String callbackUuid;

    /** 任务id */
    @Excel(name = "任务id")
    private Long roboticId;

    /** caller_id */
    @Excel(name = "caller_id")
    private Long callerId;

    /** 记录调用时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "记录调用时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date runTime;

    /** 调用参数 */
    @Excel(name = "调用参数")
    private String runParam;

    /** 回调返回结果 */
    @Excel(name = "回调返回结果")
    private String result;

    /** 执行状态：1、执行中，2、执行成功，3、执行失败 */
    @Excel(name = "执行状态：1、执行中，2、执行成功，3、执行失败")
    private Integer status;

    /** 录音地址 */
    @Excel(name = "录音地址")
    private String recordPath;

    /** 通话详细列表 */
    @Excel(name = "通话详细列表")
    private String contentList;

    /** 客户号码 */
    @Excel(name = "客户号码")
    private String callerNum;

    /** 话术号码 */
    @Excel(name = "话术号码")
    private String calleeNum;

    /** 通话的唯一标识 */
    @Excel(name = "通话的唯一标识")
    private String uuid;

    /** 呼入时间 */
    @Excel(name = "呼入时间")
    private Long callCreateTime;

    /** 应答时间 */
    @Excel(name = "应答时间")
    private Long callAnswerTime;

    /** 客户类型 */
    @Excel(name = "客户类型")
    private String intention;

    /** 公司id */
    @Excel(name = "公司id")
    private Long companyId;

    /** 销售id */
    @Excel(name = "销售id")
    private Long companyUserId;

    /** 通话时长，单位秒 */
    @Excel(name = "通话时长，单位秒")
    private Long callTime;

    /** 花费金额 */
    @Excel(name = "花费金额")
    private BigDecimal cost;

    @TableField(exist = false)
    private String companyName;

    @TableField(exist = false)
    private String companyUserName;

    @TableField(exist = false)
    private Long customerId;

    @TableField(exist = false)
    private List<Long> callerIds;

    @TableField(exist = false)
    private String roboticName;

    @TableField(exist = false)
    private Integer totalRecordCount;

    @TableField(exist = false)
    private Integer successCount;

    @TableField(exist = false)
    private Integer failCount;

    @TableField(exist = false)
    private Integer runningCount;

    public static CompanyVoiceRoboticCallLogCallphone initCallLog( String runParam, Long keyId, Long taskId,Long companyId) {
        CompanyVoiceRoboticCallLogCallphone log = new CompanyVoiceRoboticCallLogCallphone();
        log.callerId = keyId;
        log.runParam = runParam;
        log.roboticId = taskId;
        log.runTime = new Date();
        log.companyId = companyId;
        return log;
    }

}
