package com.njcn.prepare.harmonic.service.mysql.line;

import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.device.pms.pojo.po.Monitor;
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
import com.njcn.harmonic.pojo.vo.SourceSteadyIndicator;
import com.njcn.harmonic.pojo.vo.ThsStrategyVo;
import com.njcn.prepare.enums.TypeEnum;
import com.njcn.prepare.harmonic.pojo.param.SuperviseParam;
import com.njcn.prepare.harmonic.pojo.po.ThsOverRunLog;
import com.njcn.prepare.harmonic.pojo.po.ThsSupervise;
import com.njcn.process.pojo.po.ThsWarnStrategyAss;
import com.njcn.user.pojo.po.Dept;

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

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author lxp
 * @since 2023-03-16
 */
public interface ThsSuperviseService extends IService<ThsSupervise> {
    /**
     * 初始化技术监督
     */
    HttpResult<String> initSupervise(SuperviseParam superviseParam);

    /**
     * 查新策略集合
     *
     * @param superviseParam
     * @return
     */
    List<ThsStrategyVo> selectStrategyList(SuperviseParam superviseParam);

    /**
     * 查询LimitTarget数据
     *
     * @param monitorId
     */
    RStatLimitRateDPO queryLimitTargetData(String monitorId);

    /**
     * 生成监督数据
     *
     * @param limitBoolMap
     */
    void buildData(SourceSteadyIndicator steady, Map<String, Object> limitBoolMap, Monitor monitor, RStatLimitRateDPO limitRate, Integer initType, ThsSupervise thsSupervise, List<ThsOverRunLog> thsOverRunLogs);

    /**
     * 查询策略绑定的干扰源列表或指标参数列表
     *
     * @param id
     * @param typeEnum
     * @return
     */
    List<ThsWarnStrategyAss> queryWarnStrategyAss(String id, TypeEnum typeEnum);

    /**
     * 生成监督数据
     *
     * @param steady
     * @param monitor
     * @return
     */
    void buildSuperviseData(SourceSteadyIndicator steady, Monitor monitor, RStatLimitRateDPO limitRate, Map<String, Object> limitBoolMap, Integer initType, ThsSupervise thsSupervise, List<ThsOverRunLog> thsOverRunLogs);

    /**
     * 生成 告警/预警监测点列表 数据
     *
     * @param steady
     * @param thsSupervise
     * @param monitor
     */
    void buildOverRunLog(SourceSteadyIndicator steady, ThsSupervise thsSupervise, Monitor monitor, RStatLimitRateDPO limitRate, Map<String, Object> limitBoolMap, Integer initType, List<ThsOverRunLog> thsOverRunLogs);


    /**
     * 生成技术监督数据
     *
     * @param thsSupervise
     * @param overRunLogList
     */
    void creatData(Dept dept, ThsSupervise thsSupervise, List<ThsOverRunLog> overRunLogList);

    /**
     * 创建技术监督
     *
     * @param superviseParam
     * @return
     */

    void creatSupervise(SuperviseParam superviseParam);
}
