package com.ssj.service.sys.fx.service;

import com.ssj.bean.sys.fx.domain.Device;
import com.ssj.bean.sys.fx.domain.Merchant;
import com.ssj.bean.sys.role.domain.Admin;
import com.ssj.framework.core.common.service.BaseService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

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

public interface DeviceService extends BaseService<Device, String> {
	
	//批量分配到指定商户
	int matchDeviceByMerchant(List<String> ids,String posCode,Admin admin,String emsNumber,String emsAddress,String emsUsername,String emsTelephone,String emsImg,String remarks);
	
	
	//商户设备的总量
	Integer countDeviceByPosCode(String posCode);
	
	//更新商户的升级与保存激活的数据
	void updateMerchantLeveAndActive(String posCode,String imei);
	
	
	//imei范围查询
	Page<Device> findDeviceByPage(Map<String, Object> params, Pageable sp);


	/**
	 *
	 * @param imei 小塾imei号
	 * @param checkLng 自检时经度
	 * @param checkLat 自检时纬度
	 * @param activeLng 激活时经度
	 * @param activeLat 激活时纬度
	 */
	Merchant checkIsRage(String imei,String checkLng,String checkLat,String activeLng,String activeLat);
	
	Page<Map<String, Object>> findDeviceActivationList(Map<String, Object> params, Pageable pageable);
	
	Device getDeviceByImei(String imei);
	
	void matchDeviceByMQ(Device device);
	
	//推送数据到爱加
	void pushDeviceToAijia(Device device);
	
	
	Page<Map<String, Object>> deviceUnloadingList(Map<String, Object> params, Pageable pageable);


    Page<Map<String, Object>> deviceInAndOutList(Map<String, Object> params, Pageable initPage);

	Page<Map<String, Object>> deviceOutList(Map<String, Object> params, Pageable initPage);
}
