package com.huimv.eartag.service;

import com.alibaba.fastjson.JSONObject;

import java.sql.Timestamp;
import java.text.ParseException;
import java.util.Map;

/**
 * @Project : huimv.shiwan
 * @Package : com.huimv.biosafety.uface.controller
 * @Description : TODO
 * @Version : 1.0
 * @Author : ZhuoNing
 * @Create : 2020-12-25
 **/
public interface IDeviceService {
    //处理采集器设备信息
    void handleDeviceInfo();

    //保存原始数据
    void saveRawData(String askText) throws ParseException;

    //{根据芯片id读取设备编码}
    String getDeviceCodeByChipId(String chipId);

    String getFarmIdByDeviceCode(String deviceCode);

    //计算设备总数
    int getDeviceTotalByFarmIdFromDeviceRegister(String farmId);


    //计算注销设备数量
    int getDeviceCancelTotalFromDeviceRegister(String farmId);

    //计算处于不同生存状态的设备数量
    Integer getDeviceSum(String farmId, Integer liveStatus);

    //更新设备环境信息
    void updateEnvtempOfDeviceAllStatus(String farmId, String todayDateText, java.sql.Date todayDate, Timestamp nowTimestamp) throws ParseException;

    void handleDeviceHeartbeat(JSONObject dataJo) throws ParseException;

    void handleDeviceEnvtemp(JSONObject dataJo) throws ParseException;

    void countEffectiveDeviceTotal(JSONObject deviceRegisterJo);

    void countEffectiveDeviceTotal(Map inMap);

    void countFarmAllStatus(JSONObject deviceRegisterJo) throws ParseException;

    void unCancelDeviceOnlineLiveStatus(JSONObject deviceRegisterJo, String todayDateText);

    void cancelFarmAllStatus(Map map) throws ParseException;

    void cancelDeviceOnlineLiveStatus(Map map, String todayDateText);
}
