2025-05-12 17:08:09 +08:00
|
|
|
|
using FreeSql.DataAnnotations;
|
|
|
|
|
|
using JiShe.CollectBus.Analyzers.Shared;
|
|
|
|
|
|
using JiShe.CollectBus.Common.Enums;
|
|
|
|
|
|
using JiShe.CollectBus.Common.Models;
|
|
|
|
|
|
using JiShe.CollectBus.IoTDB.Attributes;
|
|
|
|
|
|
using JiShe.CollectBus.IoTDB.Model;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
namespace JiShe.CollectBus.IotSystems.Devices
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
2025-05-13 14:51:38 +08:00
|
|
|
|
/// 设备信息
|
2025-05-12 17:08:09 +08:00
|
|
|
|
/// </summary>
|
2025-05-13 14:51:38 +08:00
|
|
|
|
public class DeviceInfo : DeviceCacheBasicModel
|
2025-05-12 17:08:09 +08:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 关系映射标识,用于ZSet的Member字段和Set的Value字段,具体值可以根据不同业务场景进行定义
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Column(IsIgnore = true)]
|
|
|
|
|
|
public override string MemberId => $"{FocusAddress}:{MeteringCode}";
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// ZSet排序索引分数值,具体值可以根据不同业务场景进行定义,例如时间戳
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Column(IsIgnore = true)]
|
|
|
|
|
|
public override long ScoreValue => Common.Helpers.CommonHelper.GetFocusScores(FocusAddress, MeteringCode);
|
2025-05-13 14:51:38 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 通讯方案:
|
|
|
|
|
|
/// NB-IOT常德水表、NB-IOT泽联电表、GPRS华立水表、
|
|
|
|
|
|
/// RS-485、无线、载波
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string LinkType { get; set; }
|
2025-05-12 17:08:09 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-05-13 14:51:38 +08:00
|
|
|
|
/// HaveValve: 是否带阀 (0 不带阀, 1 带阀)
|
|
|
|
|
|
/// 注意:NULL表示未设置
|
2025-05-12 17:08:09 +08:00
|
|
|
|
/// </summary>
|
2025-05-13 14:51:38 +08:00
|
|
|
|
public int? HaveValve { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设备类型: 水表\气表、流量计
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string MeterTypeName { get; set; }
|
2025-05-21 10:14:33 +08:00
|
|
|
|
|
2025-05-13 14:51:38 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 倍率
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public decimal TimesRate { get; set; }
|
2025-05-12 17:08:09 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 电表名称
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 集中器地址
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string Address { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 集中器区域代码
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string AreaCode { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-05-21 10:14:33 +08:00
|
|
|
|
/// 仅当MeterType为电表时,电表类别 (1单相、2三相三线、3三相四线),
|
2025-05-12 17:08:09 +08:00
|
|
|
|
/// 07协议: 开合闸指令(1A开闸断电,1C单相表合闸,1B多相表合闸) 645 2007 表
|
|
|
|
|
|
/// 97协议://true(合闸);false(跳闸) 545 1997 没有单相多相 之分 "true" ? "9966" : "3355"
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int TypeName { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 跳合闸状态字段: 0 合闸,1 跳闸
|
|
|
|
|
|
/// 电表:TripState (0 合闸-通电, 1 断开、跳闸);
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int TripState { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 规约 -电表default(30) 1:97协议,30:07协议
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int? Protocol { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 一个集中器下的[MeteringCode]必须唯一。 PN
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int MeteringCode { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-05-13 14:51:38 +08:00
|
|
|
|
/// 表通信地址
|
2025-05-12 17:08:09 +08:00
|
|
|
|
/// </summary>
|
2025-05-13 14:51:38 +08:00
|
|
|
|
public string MeterAddress { get; set; }
|
2025-05-12 17:08:09 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 波特率 default(2400)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int Baudrate { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// MeteringPort 端口就几个可以枚举。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int MeteringPort { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 电表密码
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string Password { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 该电表方案下采集项,JSON格式,如:["0D_80","0D_80"]
|
|
|
|
|
|
/// </summary>
|
2025-05-22 17:29:54 +08:00
|
|
|
|
[Column(IsIgnore = true)]
|
|
|
|
|
|
public List<string> ItemCodes { get; set; }
|
2025-05-12 17:08:09 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// State表状态:
|
|
|
|
|
|
/// 0新装(未下发),1运行(档案下发成功时设置状态值1), 2暂停, 100销表(销表后是否重新启用)
|
|
|
|
|
|
/// 特定:State -1 已删除
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int State { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 是否自动采集(0:主动采集,1:自动采集)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int AutomaticReport { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 该电表方案下采集项编号
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string DataTypes { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 品牌型号
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string BrandType { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 采集器编号
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string GatherCode { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 是否特殊表,1是特殊电表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int Special { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 费率类型,单、多 (SingleRate :单费率(单相表1),多费率(其他0) ,与TypeName字段无关)
|
|
|
|
|
|
/// SingleRate ? "单" : "复"
|
|
|
|
|
|
/// [SingleRate] --0 复费率 false , 1 单费率 true (与PayPlanID保持一致)
|
|
|
|
|
|
///对应 TB_PayPlan.Type: 1复费率,2单费率
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool SingleRate { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 项目ID
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int ProjectID { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 数据库业务ID
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int DatabaseBusiID { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 是否异常集中器 0:正常,1异常
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int AbnormalState { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|