57 lines
1.6 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using JiShe.CollectBus.Common.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JiShe.CollectBus.Common.Models
{
/// <summary>
/// 设备缓存基础模型
/// </summary>
public abstract class DeviceCacheBasicModel
{
/// <summary>
/// 集中器Id
/// </summary>
public int FocusId { get; set; }
/// <summary>
/// 表Id
/// </summary>
public int MeterId { get; set; }
/// <summary>
/// 关系映射标识用于ZSet的Member字段和Set的Value字段具体值可以根据不同业务场景进行定义
/// </summary>
public virtual string MemberId => $"{FocusId}:{MeterId}";
/// <summary>
/// ZSet排序索引分数值具体值可以根据不同业务场景进行定义例如时间戳
/// </summary>
public virtual long ScoreValue=> ((long)FocusId << 32) | (uint)MeterId;
/// <summary>
/// 是否已处理
/// </summary>
public virtual bool IsHandle { get; set; } = false;
/// <summary>
/// 集中器地址
/// </summary>
public string FocusAddress { get; set;}
/// <summary>
/// 采集时间间隔(分钟如15)
/// </summary>
public int TimeDensity { get; set; }
/// <summary>
/// 表计类型
/// 电表= 1,水表= 2,燃气表= 3,热能表= 4,水表流量计=5燃气表流量计=6,特殊电表=7
/// </summary>
public MeterTypeEnum MeterType { get; set; }
}
}