package cn.estsh.i3plus.ext.mes.pcn.api.busi;

import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesCellEquipContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesEquipLogDispatchContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesEquipVariableCollectContext;
import cn.estsh.i3plus.pojo.mes.bean.MesEquipmentLog;
import cn.estsh.i3plus.pojo.mes.bean.MesEquipmentRecord;
import cn.estsh.i3plus.pojo.mes.bean.MesEquipmentVariable;
import cn.estsh.i3plus.pojo.mes.bean.MesEquipmentVariableCfg;
import io.swagger.annotations.ApiOperation;

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

public interface IMesEquipmentLogExtService {

    @ApiOperation(value = "根据设备ID,设备LOG表ID集合 修改设备ID分表采集数据的状态")
    void updateEquipmentLogList(String organizeCode, Integer equipId, Map<Long, String> equipmentLogIdMap);

    @ApiOperation(value = "获取设备数据变量对应的采集数据")
    MesEquipLogDispatchContext getEquipLogDispatchContext(MesCellEquipContext cellEquipContext, List<MesEquipmentVariable> equipmentVariableList, List<MesEquipmentVariableCfg> equipmentVariableCfgList);

    @ApiOperation(value = "验证设备通信质量")
    Boolean checkEquipQuality(Integer quality);

    @ApiOperation(value = "根据设备ID,是否常变值状态,变量类型查询设备ID分表采集数据")
    List<MesEquipVariableCollectContext> getEquipmentLogCollectList(String organizeCode, Integer equipId, Integer needNewValue, Integer variableType);

    @ApiOperation(value = "根据设备ID,是否常变值状态,设备数据变量ID集合,变量类型 查询设备ID分表采集数据")
    List<MesEquipVariableCollectContext> getEquipmentLogCollectList(String organizeCode, Integer equipId, Integer needNewValue, Integer variableType, List<Long> equipVariableIdList);

    @ApiOperation(value = "根据设备ID,是否常变值状态,变量类型查询设备ID分表采集数据, 再根据设备数据变量ID集合过滤数据")
    List<MesEquipVariableCollectContext> getEquipmentLogCollectListThenFilter(String organizeCode, Integer equipId, Integer needNewValue, Integer variableType, List<Long> equipVariableIdList);

    @ApiOperation(value = "根据设备ID, 批量写入设备LOG明细数据")
    void insertBatchEquipmentLogDetail(String organizeCode, Integer equipId, String userInfo, MesEquipmentRecord mesEquipmentRecord, List<MesEquipmentLog> equipmentLogList);
}
