package com.xhpc.card.service;

import com.xhpc.card.domain.*;
import com.xhpc.card.pojo.TIccardClientUsers;
import com.xhpc.card.pojo.TIccardInfo;
import com.xhpc.common.core.domain.R;

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

/**
 * @author yuyang
 * @date 2022/1/20 13:44
 */
public interface IXhpcCardService {

    /**
     * 卡启动充电判断
     *
     * @param cardno       卡物理卡号
     * @param serialNumber 终端卡号
     * @return
     */
    R cardStartup(String cardno, String serialNumber,String rateModelId);

    /**
     * 查询卡授权设备列表
     *
     * @param currentPage 当前页码
     * @param items       当前显示条数
     * @return 返回卡授权列表
     * @author WH
     * @date 2022/1/25 16:18
     * @since version-1.0
     */
    R<ListOfAuthorizedDevices> queryDeviceList(Long currentPage, Long items);

    /**
     * 逻辑删除指定卡授权设备
     *
     * @param deviceId 卡授权设备id
     * @return 返回Result结果集对象
     * @author WH
     * @date 2022/1/26 10:39
     * @since version-1.0
     */
    R<Object> deleteDevice(Integer deviceId);

    /**
     * 通过查询条件来查询卡列表
     *
     * @param queryConditions 查询条件
     * @return 装有卡列表数据的结果集
     * @author WH
     * @date 2022/1/26 13:56
     * @since version-1.0
     */
    R<CardList> queryCardListBy(QueryConditions queryConditions);

    /**
     * 绑定卡回显信息
     *
     * @param cardId 卡记录id
     * @return 返回需要回显的卡数据
     * @author WH
     * @date 2022/1/28 10:44
     * @since version-1.0
     */
    R<BindCardEcho> noBindCardInfo(Long cardId);

    /**
     * 平台、运营商选择用户时，查询指定类型下的所有用户数据
     *
     * @param queryCondition 查询条件
     * @return 平台、运营商选择用户时，查询指定类型下的所有用户数据
     * @author WH
     * @date 2022/1/28 15:31
     * @since version-1.0
     */
    R<SearchCardResponse> searchCardUser(SearchCardUserQueryCondition queryCondition);

    /**
     * 联网卡绑定
     *
     * @param bindCardInfo 要绑定的联网卡信息
     * @return 操作结果
     * @author WH
     * @date 2022/2/9 10:48
     * @since version-1.0
     */
    R<Object> onlineCardBind(BindCardInfo bindCardInfo);

    /**
     * 查询卡用户信息
     *
     * @return 卡用户的完整信息
     * @author WH
     * @date 2022/2/9 17:50
     * @since version-1.0
     */
    R<CardUserInfo> queryWholeUserInfo(Long cardRecordId);

    /**
     * Platform query that it own all grantOperators
     *
     * @return infos of all grantOperator
     * @author WH
     * @date 2022/2/12 15:14
     * @since version-1.0
     */
    R<List<Map<String, Object>>> queryOperatorUser();

    /**
     * report the loss of card
     *
     * @author WH
     * @date 2022/2/13 13:30
     * @since version-1.0
     */
    R<Object> reportTheLossOfCard(Integer cardId);

    /**
     * query to operate log of card
     *
     * @author WH
     * @date 2022/2/13 22:35
     * @since version-1.0
     */
    R<OperateCardsLogResponse> operateCardLog(OperateCardsLogRequest operateCardsLogRequest);

    /**
     * query log of operation devices
     *
     * @param operateDevicesLogRequest wrapper class of condition
     * @return return response wrapper class OperateCardsLogResponse
     * @author WH
     * @date 2022/2/14 11:10
     * @since version-1.0
     */
    R<OperateDevicesLogResponse> operateDevicesLog(OperateDevicesLogRequest operateDevicesLogRequest);

    /**
     * query recharge record of card
     * ps:query card equals query account
     *
     * @author WH
     * @date 2022/2/14 15:55
     * @since version-1.0
     */
    R<QueryRechargingRecordResponse> queryRechargingRecord(QueryRechargingRecordRequest queryRechargingRecordRequest);

    /**
     * remove binding of card
     *
     * @author WH
     * @date 2022/2/16 10:30
     * @since version-1.0
     */
    R<Object> removeBinding(Long cardRecordId);

    /**
     * add a client user info
     *
     * @author WH
     * @date 2022/2/24 17:15
     * @since version-1.0
     */
    R<Object> addClientUser(TIccardClientUsers userInfo);

    /**
     * update the client user info
     *
     * @author WH
     * @date 2022/2/24 17:20
     * @since version-1.0
     */
    R<Object> updateClientUser(TIccardClientUsers userInfo);

    /**
     * delete the client user by user id
     *
     * @author WH
     * @date 2022/2/24 17:27
     * @since version-1.0
     */
    R<Object> deleteClientUser(Integer userInfo);

    /**
     * query client users by query condition
     *
     * @author WH
     * @date 2022/2/24 17:39
     * @since version-1.0
     */
    R<Object> queryClientUsers(queryClientUsersCondition queryCondition);

    /**
     * @param cardId card id
     * @author WH
     * @date 2022/3/3 14:29
     * @since version-1.0
     */
    R<Object> recoverToReportTheLossOfCard(Integer cardId);

    R addIccardInfo(TIccardInfo iccardInfo);

    R removeIccardInfo(Integer id);

    List<Map<String, Object>> getSerialNumberList();

    void updateXhpcTerminalAll(Integer status);

}
