2025-04-15 15:49:51 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
2025-04-15 16:05:07 +08:00
|
|
|
|
namespace JiShe.CollectBus.Common.Models
|
2025-04-15 15:49:51 +08:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设备缓存基础模型
|
|
|
|
|
|
/// </summary>
|
2025-04-15 16:48:35 +08:00
|
|
|
|
public abstract class DeviceCacheBasicModel
|
2025-04-15 15:49:51 +08:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 集中器Id
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int FocusId { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 表Id
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int MeterId { get; set; }
|
2025-04-15 16:48:35 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-04-16 17:36:46 +08:00
|
|
|
|
/// 关系映射标识,用于ZSet的Member字段和Set的Value字段,具体值可以根据不同业务场景进行定义
|
2025-04-15 16:48:35 +08:00
|
|
|
|
/// </summary>
|
2025-04-17 11:29:26 +08:00
|
|
|
|
public virtual string MemberId => $"{FocusId}:{MeterId}";
|
2025-04-16 17:36:46 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// ZSet排序索引分数值,具体值可以根据不同业务场景进行定义,例如时间戳
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public virtual long ScoreValue=> ((long)FocusId << 32) | (uint)MeterId;
|
2025-04-18 11:31:23 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 是否已处理
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public virtual bool IsHandle { get; set; } = false;
|
2025-04-18 17:46:24 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 集中器地址
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string FocusAddress { get; set;}
|
2025-04-15 15:49:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|