package com.zksy.base.warning.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.zksy.base.warning.domain.EarlyWarning;
import com.zksy.base.warning.domain.WarningArchive;
import com.zksy.base.warning.domain.WarningDisposal;
import org.springframework.web.multipart.MultipartFile;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

public interface EarlyWarningService extends IService<EarlyWarning> {

    IPage<Map<String, Object>> getWarningList(Page<?> page, String warningName, String warningType, String warningLevel, String status);

    IPage<Map<String, Object>> searchWarnings(Page<?> page, String warningName, String warningNo, String warningType, String warningLevel, String status, String location, String publisher, String ownershipUnit, LocalDateTime startTime, LocalDateTime endTime);

    IPage<Map<String, Object>> getTodoList(Page<?> page, String userName, String todoType, String warningName);

    Map<String, Object> getWarningDetail(String warningId);

    Map<String, Object> getWarningFullDetail(String warningId);

    boolean saveWarning(EarlyWarning warning, List<String> alarmIds, List<MultipartFile> files);

    boolean updateWarning(EarlyWarning warning, List<String> alarmIds, List<MultipartFile> files);

    boolean deleteWarning(String warningId);

    boolean deleteBatchWarning(List<String> warningIds);

    boolean publishWarning(String warningId);

    boolean upgradeWarning(String warningId, String newLevel, String disposalContent);

    boolean resolveWarning(String warningId, String disposalContent);

    boolean returnWarning(String warningId, String disposalContent);

    boolean supervisionWarning(String warningId, String supervisionUser, String supervisionContent, String notificationType, String notificationContent, String attachmentUrl);

    boolean addLeaderInstruction(String warningId, String leaderName, String instructionContent, String smsReceivers);

    boolean linkAlarms(String warningId, List<String> alarmIds);

    List<Map<String, Object>> getLinkedAlarms(String warningId);

    List<Map<String, Object>> getDisposalList(String warningId);

    List<Map<String, Object>> getDisposalHistory(String warningId);

    IPage<Map<String, Object>> getProcessingWarnings(Page<?> page, String warningType, String warningLevel);

    IPage<Map<String, Object>> getCompletedWarnings(Page<?> page, String warningType, String warningLevel, LocalDateTime startTime, LocalDateTime endTime);

    List<Map<String, Object>> getAttachments(String warningId);

    Map<String, Object> getStatistics();

    Map<String, Object> getDashboardStatistics();

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

    WarningArchive getArchiveByWarningId(String warningId);

    IPage<WarningArchive> getArchiveList(Page<WarningArchive> page, String warningName, String warningType, String warningLevel, LocalDateTime startTime, LocalDateTime endTime);

    List<WarningDisposal> getDisposalProcess(String warningId);

    Map<String, Object> getProcessDiagram(String warningId);

    Map<String, Object> getDisposalDetail(String disposalId);

    Map<String, Object> getProcessStatistics(String warningId);
}
