using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using ZhonTai.Admin.Core.Repositories;
namespace NPP.SmartSchedue.Api.Contracts.Domain.Equipment;
///
/// 设备仓储接口
///
public interface IEquipmentRepository : IRepositoryBase
{
///
/// 根据设备类型获取设备列表
///
/// 设备类型
/// 设备列表
Task> GetByTypeAsync(string equipmentType);
///
/// 根据状态获取设备列表
///
/// 设备状态
/// 设备列表
Task> GetByStatusAsync(int status);
///
/// 根据内部编号获取设备
///
/// 内部编号
/// 设备信息
Task GetByInternalNumberAsync(string internalNumber);
///
/// 获取可用设备列表(正常状态)
///
/// 指定日期
/// 可用设备列表
Task> GetAvailableEquipmentAsync(DateTime date);
///
/// 根据工序获取适配设备列表
///
/// 工序名称
/// 适配设备列表
Task> GetByProcessAsync(string processName);
///
/// 检查设备是否可用
///
/// 设备ID
/// 指定日期
/// 是否可用
Task IsEquipmentAvailableAsync(long equipmentId, DateTime date);
///
/// 获取设备使用情况
///
/// 设备ID
/// 开始日期
/// 结束日期
/// 设备使用情况
Task GetUsageAsync(long equipmentId, DateTime startDate, DateTime endDate);
///
/// 获取需要维护的设备列表
///
/// 指定日期
/// 需要维护的设备列表
Task> GetNeedMaintenanceAsync(DateTime date);
///
/// 获取需要校验的设备列表
///
/// 指定日期
/// 需要校验的设备列表
Task> GetNeedCalibrationAsync(DateTime date);
///
/// 检查指定设备类型是否有可用设备
///
/// 设备类型
/// 是否有可用设备
Task HasAvailableEquipmentByTypeAsync(string equipmentType);
}
///
/// 设备使用情况信息
///
public class EquipmentUsageInfo
{
///
/// 设备ID
///
public long EquipmentId { get; set; }
///
/// 设备名称
///
public string EquipmentName { get; set; }
///
/// 使用天数
///
public int UsageDays { get; set; }
///
/// 使用小时数
///
public int UsageHours { get; set; }
///
/// 维护次数
///
public int MaintenanceCount { get; set; }
///
/// 校验次数
///
public int CalibrationCount { get; set; }
///
/// 故障次数
///
public int FaultCount { get; set; }
}