/*
 * Author: wangjian
 * 生成Service
 */
package com.tofly.xrtygis.service.callCenter.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tofly.xrtygis.custom.entity.callCenter.FlowNum;
import com.tofly.xrtygis.custom.entity.callCenter.dto.MissedCallsDto;
import com.tofly.xrtygis.entity.callCenter.PltCalllist1000;
import com.tofly.xrtygis.entity.callCenter.CallSearch;

import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 通话记录(话单)坐席或分机之间呼叫只产生一条记录
 *
 * @author wangjieliu
 * @date Thu Jun 17 00:00:00 CST 2021
 */
public interface PltCalllist1000Service extends IService<PltCalllist1000> {

    IPage<PltCalllist1000> getPltCalllist(Page page, CallSearch search);

    /**
     * 获取未接来电信息
     * @param dto 条件
     * @return list
     */
    List<Map<String, Object>> missedCalls(MissedCallsDto dto);

    Map<String, Long> getCallInCount();

    List<Map> getSatisfaction(String yearMonth);

    IPage<Map> getTelephoneSta(HttpServletResponse response,Page page, CallSearch search);

    IPage<Map> getSatisfactionStatis(HttpServletResponse response,Page page, CallSearch search);

    IPage<Map> getStateStatis(HttpServletResponse response,Page page, CallSearch search);

    IPage<Map> getSatisfactionStatisInfo(HttpServletResponse response,Page page, CallSearch search);

    boolean configFlow(FlowNum flowNum);

    /**
     * 获取今日话务流量
     *
     * @return map
     */
    Map<String, List<Map>> getTodayFlow();

    /**
     * 获取当月呼入统计
     *
     * @return list
     */
    Map<String, Long> incomingCallCount();

    /**
     * 获取当月呼出统计
     *
     * @return list
     */
    Map<String, Long> exhalationCount();

    /**
     * 获取呼入呼出总数
     *
     * @param userName 人员名称
     * @return map
     */
    Map<String, Long> getCallCount(String userName);
    Map<String, BigDecimal> getUserScoreInfo(Date start, Date end, String userName);
//    Object getSatisfaction(Satisfaction satisfaction);

    String listenRecordFile(String connectionId, HttpServletResponse response);
}
