package com.ho.flow.service;


import com.ho.business.entity.TranslateName;
import com.ho.business.vo.req.MonitorQuery;
import com.ho.common.tools.entity.SimpleUser;
import com.ho.common.tools.entity.UserDetailRespVO;
import com.ho.common.tools.util.PageResult;
import com.ho.flow.vo.Event;
import com.ho.flow.vo.req.event.*;
import com.ho.flow.vo.resp.event.EventDayNum;
import com.ho.flow.vo.resp.event.EventDemo;
import com.ho.flow.vo.resp.event.EventNumRespVO;
import com.ho.flow.vo.resp.event.EventRespVO;

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

/**
 * @author yule
 * @description 针对表【event】的数据库操作Service
 * @createDate 2022-08-25 16:05:20
 */
public interface EventService {

    List<EventDemo> getFaultDuration(EventDemoReqVo vo);

    PageResult<EventRespVO> pageEventInfo(EventReqPageVO vo);

    List<EventRespVO> eventInfo(EventReqPageVO vo);

    //告警列表
    List<EventRespVO> eventList(EventReqPageVO vo);

    int updateById(List<Long> ids, UserDetailRespVO userDetail);

    //批量新增
    int insertEventBatch(List<Event> events);

    //批量修改
    int updateEventBatch(List<Event> events);

    EventNumRespVO selectNum(EventReqPageVO vo, SimpleUser user);

    //事件转工单
    void conversionWorkOrder(List<Long> eventIds, SimpleUser user);

    List<EventRespVO> getDropDownList(SimpleUser user, DropDownReq req);

    /**
     * 批量查询根据电站id和设备srcId
     *
     * @param user
     * @param list
     * @return
     */
    List<EventRespVO> dropDownBatchList(SimpleUser user, List<DropDownReq> list);

    Event selectById(Long eventId);

    int eventNum(EventReqPageVO vo, SimpleUser user);

    Event selectByParams(Event event);

    /**
     * 判断电站接入点状态(是否产生告警数据)定时任务
     */
    void accessPointEvent();

    /**
     * 判断外接电表状态（是否产生告警数据）定时任务
     */
    void outsideEleEvent();

    void regularlySendNotifications(MonitorQuery monitorQuery);
    /**
     * 告警转工单
     *
     * @param eventWorkOrder 告警转工单入参
     */
    void conversion(EventWorkOrder eventWorkOrder);

    /**
     * 根据id集合查询
     *
     * @param eventIds
     * @return
     */
    List<Event> selectByIds(List<Long> eventIds);

    List<EventDemo> getFaultDurations(EventDemoReqVo vo);

    /**
     * 根据天统计告警数量
     * @return
     */
    List<EventDayNum> countEventByDay(EventReqPageVO vo);

    Map<String,Integer> eventDeviceNum(EventNumReq vo);

    TranslateName getNameLanguage(String name);

    String getNameByLang(String name,String lang);

}
