/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.security.trans.basic.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.security.trans.basic.dto.DeviceDTO;
import org.security.ht.entity.basic.Device;
import org.security.ht.vo.basic.DeviceVO;
import org.security.trans.dataStatistics.entity.DeviceData;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.web.multipart.MultipartFile;

import java.text.ParseException;
import java.util.List;

/**
 * 基础信息-设备信息 服务类
 *
 * @author BladeX
 * @since 2022-03-16
 */
public interface IDeviceService extends IService<Device> {

	/**
	 * 自定义分页
	 *
	 * @param page
	 * @param deviceDto
	 * @return
	 */
	IPage<DeviceVO> selectDevicePage(IPage<DeviceVO> page, DeviceDTO deviceDto);

	DeviceVO getDeviceById(Long id);

	Boolean saveDevice(DeviceDTO deviceDTO);

	/**
	 * 分页查询使用、超期使用设备
	 * @param query
	 * @return
	 */
	IPage<Device> getCheckList(Query query);

	/**
	 * 生成二维码
	 * @param toLongList 设备id
	 * @return
	 */
    boolean createQrCode(List<Long> toLongList);
	/**
	 * 处置设备
	 * @param toLongList 设备id
	 * @return
	 */
	R disposalByIds(List<Long> toLongList);

	/**
	 * 获取设备统计旭日图统计数据
	 */
	List<DeviceData> getRisSunChartData(List<String> aimDepts);
	/**
	 * 获取设备统计-按机构分布数据
	 */
	List<DeviceData> getPieDeptData(String aimDept);
	/**
	 * 批量导入设备信息
	 */
	R importData(MultipartFile file);
	/**
	 * 查询当前正在使用中的设备
	 */
	List<Device> getUsingList();
	/**
	 * 删除设备
	 */
	R removeDevice(List<Long> ids);

}
