using Dlhis.Entity.Device.Enums;
using Kurisu.AspNetCore.Utils.Extensions;
namespace Dlhis.Basic.Device.Response;
public class DevicePageResponse
{
public long Id { get; set; }
///
/// 设备code
///
public Guid Code { get; set; }
///
/// 设备唯一码,IP/MAC/SNO
///
public string UniqueNo { get; set; }
///
/// 心跳间隔
///
public int HeartbeatInterval { get; set; }
///
/// 品牌
///
public string Brand { get; set; }
///
/// 供应商
///
public string Supplier { get; set; }
///
/// 设备功能 DeviceFuncEnumType
///
public List Funcs
{
get
{
if (FuncsStr.IsEmpty()) FuncsStr = "[]";
return FuncsStr.ToObject>();
}
}
public string FuncsStr { get; set; }
///
/// 设备机功能类型
///
public DeviceTypeEnumType Type { get; set; }
public string TypeDescription => Type.GetDescription();
///
/// 部署点
///
public string DeployPlace { get; set; }
///
/// 部署坐标
///
public string DeployPosition { get; set; }
///
/// 部署方向
///
public DeviceDeployDirectionEnumType? DeployDirection { get; set; }
///
/// 模板code
///
public Guid TemplateCode { get; set; }
///
/// 连接信息
///
public string ConnectionInfo { get; set; }
///
/// 是否启用
///
public bool Enable { get; set; }
///
/// 是否作为考勤
///
public bool AsAttendance { get; set; }
//*********************************************************附加信息**************************************************************/
///
/// 最后心跳时间
///
public DateTime? LastHeartbeatTime { get; set; }
///
/// 是否在线
///
public bool IsOnline
{
get
{
if (!LastHeartbeatTime.HasValue)
return false;
if (HeartbeatInterval <= 0)
return true;
return LastHeartbeatTime.Value.AddSeconds(HeartbeatInterval * 3) >= DateTime.Now;
}
}
///
/// 消费总额
///
public decimal Amount { get; set; }
///
/// 消费人次
///
public int UserCount { get; set; }
///
/// 营业点code
///
public Guid? BusinessPlaceCode { get; set; }
///
/// 营业点名称
///
public string BusinessPlaceName { get; set; }
}