package com.cm.central.control.service.clientexception;

import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.exception.UpdateException;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList;
import com.cm.central.control.pojo.dtos.clientexception.ClientExceptionDTO;
import com.cm.central.control.pojo.vos.clientexception.ClientExceptionVO;

import java.util.List;
import java.util.Map;

/**
 * @ClassName: IClientExceptionService
 * @Description: 客户端异常
 * @Author: WenG
 * @Date: 2020-07-30 19:13
 * @Version: 1.0
 **/
public interface IClientExceptionService {

    /**
     * 新增客户端异常
     *
     * @param clientExceptionVO
     * @return clientExceptionId
     * @throws Exception
     */
    String saveClientExceptionReturnId(ClientExceptionVO clientExceptionVO) throws Exception;

    /**
     * 删除客户端异常
     *
     * @param ids
     * @return
     * @throws RemoveException
     */
    SuccessResult removeClientException(String ids) throws RemoveException;

    /**
     * 删除客户端异常（物理删除）
     *
     * @param ids
     * @throws RemoveException
     */
    void deleteClientException(String ids) throws RemoveException;

    /**
     * 删除客户端异常(APP)
     *
     * @param token
     * @param ids
     * @return
     * @throws RemoveException
     */
    SuccessResult removeClientExceptionByToken(String token, String ids) throws RemoveException;

    /**
     * 修改客户端异常
     *
     * @param clientExceptionId
     * @param clientExceptionVO
     * @return
     * @throws Exception
     */
    SuccessResult updateClientException(String clientExceptionId, ClientExceptionVO clientExceptionVO) throws Exception;

    /**
     * 修改客户端异常(APP)
     *
     * @param token
     * @param clientExceptionId
     * @param clientExceptionVO
     * @return
     * @throws Exception
     */
    SuccessResult updateClientExceptionByToken(String token, String clientExceptionId, ClientExceptionVO clientExceptionVO) throws Exception;

    /**
     * 客户端异常详情(通过ID)
     *
     * @param clientExceptionId
     * @return
     * @throws SearchException
     */
    ClientExceptionDTO getClientExceptionById(String clientExceptionId) throws SearchException;

    /**
     * 客户端异常列表
     *
     * @param params
     * @return
     * @throws SearchException
     */
    List<ClientExceptionDTO> listClientException(Map<String, Object> params) throws SearchException;

    /**
     * 客户端异常分页列表
     *
     * @param page
     * @return
     * @throws SearchException
     */
    SuccessResultList<List<ClientExceptionDTO>> listPageClientException(ListPage page) throws SearchException;

    /**
     * 客户端异常统计
     *
     * @param params
     * @return
     * @throws SearchException
     */
    Integer countNumberClientException(Map<String, Object> params) throws SearchException;

    /**
     * 客户端异常统计
     *
     * @param params
     * @return
     * @throws SearchException
     */
    SuccessResultData<Integer> countClientException(Map<String, Object> params) throws SearchException;

    /**
     * 标记处理成功
     *
     * @param clientExceptionId
     * @return
     * @throws UpdateException
     */
    SuccessResult updateIsHandlerByClientExceptionId(String clientExceptionId) throws UpdateException;

    /**
     * 更新客户端异常通知状态并通知负责人
     */
    void updateClientExceptionAndNoticeProjectLeader();

    /**
     * 更新客户端异常通知状态并通知负责人
     *
     * @param projectLeaderId
     */
    void updateClientExceptionAndNoticeProjectLeaderByProjectLeaderId(String projectLeaderId);
}