package com.fs.company.domain;

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

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;

/**
 * 调用日志_发送短信对象 company_voice_robotic_call_log_sendmsg
 *
 * @author fs
 * @date 2026-01-15
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class CompanyVoiceRoboticCallLogSendmsg extends BaseEntity{

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

    /** 任务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 = "执行状态", readConverterExp = "1=执行中,2=执行成功,3=执行失败")
    private Integer status;

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

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

    /** 发送短信模板id */
    @Excel(name = "发送短信模板id")
    private Long tempId;

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

    /** 内容长度 */
    @Excel(name = "内容长度")
    private Integer contentLen;

    @TableField(exist = false)
    private Long customerId;

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

    private String callbackUuid;

    private String name;

    private Integer totalRecordCount;

    private Integer successCount;

    private Integer failCount;

    private Integer runningCount;

    private String phone;



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

}
