初始化

This commit is contained in:
2025-11-21 08:48:01 +08:00
commit b4d684a84c
202 changed files with 28585 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MessagePack" Version="3.1.4" />
<PackageReference Include="MongoDB.Bson" Version="3.4.1" />
</ItemGroup>
</Project>

153
CommonEntity/DeviceType.cs Normal file
View File

@@ -0,0 +1,153 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CommonEntity
{
public enum DeviceType
{
/// <summary>
/// 主机继电器
/// </summary>
[Description("主机继电器")]
Relay = 1,
/// <summary>
/// 弱电输出
/// </summary>
[Description("弱电输出")]
LVout = 3,
/// <summary>
/// 服务信息
/// </summary>
[Description("服务信息")]
ServiceInfo = 4,
/// <summary>
/// 窗帘
/// </summary>
[Description("窗帘")]
Curtain = 5,
/// <summary>
/// 开关扩展
/// </summary>
[Description("开关扩展")]
SwitchExpand = 6,
/// <summary>
/// 空调
/// </summary>
[Description("空调")]
AirConditioner = 7,
/// <summary>
/// 红外感应
/// </summary>
[Description("红外感应")]
InFrared = 8,
/// <summary>
/// 空气质量检测
/// </summary>
[Description("空气质量检测")]
AirDetect = 9,
/// <summary>
/// 插卡取电
/// </summary>
[Description("插卡取电")]
CardPower = 10,
/// <summary>
/// 地暖
/// </summary>
[Description("地暖")]
FloorHot = 11,
/// <summary>
/// 扩展继电器
/// </summary>
[Description("扩展继电器")]
Expand = 14,
/// <summary>
/// 电视
/// </summary>
[Description("电视")]
TV = 15,
/// <summary>
/// LED调光
/// </summary>
[Description("LED调光")]
Dimmer = 16,
/// <summary>
/// 可控硅调光
/// </summary>
[Description("可控硅调光")]
Traic = 17,
/// <summary>
/// 灯带调光
/// </summary>
[Description("灯带调光")]
Strip = 18,
/// <summary>
/// PWM调光
/// </summary>
[Description("PWM调光")]
PWMDimmer = 23,
/// <summary>
/// PWM扩展
/// </summary>
[Description("PWM扩展")]
PWMExpand = 24,
/// <summary>
/// 音乐
/// </summary>
[Description("音乐")]
Music = 21,
/// <summary>
/// 微信锁
/// </summary>
[Description("微信锁")]
WXLock = 20,
/// <summary>
/// PB LED
/// </summary>
[Description("PB LED")]
PBLED = 25,
/// <summary>
/// 485A9IO继电器
/// </summary>
[Description("485A9IO继电器")]
A9IORelay = 28,
/// <summary>
/// PB20
/// </summary>
[Description("PB20")]
PB20 = 30,
/// <summary>
/// PB20-LD
/// </summary>
[Description("PB20-LD")]
PB20_LD = 31,
/// <summary>
/// PB20-LS
/// </summary>
[Description("PB20-LS")]
PB20_LS = 32,
/// <summary>
/// PB20-RELAY
/// </summary>
[Description("PB20-RELAY")]
PB20_RELAY = 33,
/// <summary>
/// 色温
/// </summary>
[Description("色温")]
ColorTemp = 34,
/// <summary>
/// 地址是054000001
/// </summary>
[Description("碳达人")]
CarbonVIP = 54,
//窗帘地址是013001000
[Description("485窗帘")]
Curtain485 = 100
}
}

View File

@@ -0,0 +1,24 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MessagePack;
namespace CommonEntity
{
[MessagePackObject]
public class ForkSystem
{
[Key(0)]
public string? EndPoint { get; set; }
[Key(1)]
public byte[] Data { get; set; }
[Key(2)]
public DateTime CurrentTime { get; set; }
}
}

170
CommonEntity/Iot.cs Normal file
View File

@@ -0,0 +1,170 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MessagePack;
using MongoDB.Bson;
namespace CommonEntity
{
[MessagePackObject()]
public class IOTMonitorData
{
[Key(0)]
public double Step { get; set; }
[Key(1)]
public string? RequestId { get; set; }
[Key(2)]
public string? Platform { get; set; }
[Key(3)]
public string? TriggerTime { get; set; }
[Key(4)]
public string? HotelId { get; set; }
[Key(5)]
public int HotelCode { get; set; }
[Key(6)]
public string? HotelName { get; set; }
[Key(7)]
public string RoomNumber { get; set; }
[Key(8)]
public string CommandDescription { get; set; }
[Key(9)]
public DateTime CreateTime { get; set; }
[Key(10)]
public string? RemoteIP { get; set; }
[Key(11)]
public string? ControlClass { get; set; }
[Key(12)]
public string? SceneName { get; set; }
[Key(13)]
public List<IotDeviceData>? WhichOneDevice { get; set; }
}
[MessagePackObject()]
public class IotDeviceData
{
[Key(0)]
public string? DeviceName { get; set; }
[Key(1)]
public string? DeviceAddress { get; set; }
}
[MessagePackObject()]
public class OnOffLineData
{
[Key(0)]
public string? HotelCode { get; set; }
[Key(1)]
public string? MAC { get; set; }
[Key(2)]
public string? HostNumber { get; set; }
[Key(3)]
public string? EndPoint { get; set; }
[Key(4)]
public string? CurrentStatus { get; set; }
[Key(5)]
public DateTime CurrentTime { get; set; }
}
[MessagePackObject()]
public class MTakeCardData
{
[Key(0)]
public string? HostNUMBER { get; set; }
[Key(1)]
public string? HotelCode { get; set; }
[Key(2)]
public byte Status { get; set; }
[Key(3)]
public DateTime LastUpdateTime { get; set; }
}
public class IOTMonitorData_db
{
public ObjectId _id { get; set; }
public double Step { get; set; }
public string? RequestId { get; set; }
public string? Platform { get; set; }
public string? TriggerTime { get; set; }
public string? HotelId { get; set; }
public int HotelCode { get; set; }
public string? HotelName { get; set; }
public string? RoomNumber { get; set; }
public string? CommandDescription { get; set; }
public DateTime CreateTime { get; set; }
public string? RemoteIP { get; set; }
public string? ControlClass { get; set; }
public string? SceneName { get; set; }
public List<IotDeviceData>? WhichOneDevice { get; set; }
}
public class DevMonitorIOTLogResult_WITH_Count
{
public int TotalCount { get; set; }
public int RequestIdCount { get; set; }
public int RequestNotContainerCount { get; set; }
public List<IOTMonitorData_db>? devMonitorLogResults { get; set; }
}
public class MTakeCardData_db
{
public ObjectId _id { get; set; }
public string? HostNUMBER { get; set; }
public string? HotelCode { get; set; }
public byte Status { get; set; }
public DateTime LastUpdateTime { get; set; }
}
public class OnOffLineData_db
{
public ObjectId _id { get; set; }
public string? HotelCode { get; set; }
public string? MAC { get; set; }
public string? HostNumber { get; set; }
public string? EndPoint { get; set; }
public string? CurrentStatus { get; set; }
public DateTime CurrentTime { get; set; }
}
}

30
CommonEntity/LogBase.cs Normal file
View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MongoDB.Bson;
using static System.Runtime.InteropServices.JavaScript.JSType;
namespace CommonEntity
{
public class LogBase
{
public ObjectId _id { get; set; }
public string? MessageId { get; set; }
public string HotelCode { get; set; }
public string RoomNum { get; set; }
public string MessageType { get; set; }
public DataContext Context { get; set; }
public DateTime CreateDateTime { get; set; }
}
public class DataContext
{
public string Data { get; set; }
public int Age { get; set; }
}
}

35
CommonEntity/LogQuery.cs Normal file
View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CommonEntity
{
public class LogQuery
{
public List<QueryData> Data { get; set; }
/// <summary>
/// 时间片
/// </summary>
public string? Start_Time { get; set; }
public string? End_Time { get; set; }
public string? Start_Time_Really { get; set; }
public string? End_Time_Really { get; set; }
public bool IsQuery_Really { get; set; }
public int PageSize { get; set; }
public int PageIndex { get; set; }
public List<string> CommandType { get; set; }
}
public class QueryData
{
public string? HotelCode { get; set; }
public string? Key_HostNumber { get; set; }
public string? RoomNumber { get; set; }
public string? MAC { get; set; }
}
}

View File

@@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MessagePack;
using MongoDB.Bson;
namespace CommonEntity
{
[MessagePackObject()]
public class NewVersionHexData
{
[Key(0)]
public byte CmdType { get; set; }
[Key(1)]
public string? HotelCode { get; set; }
[Key(2)]
public string? HostNumber { get; set; }
[Key(3)]
public string? RoomNumber { get; set; }
[Key(4)]
public string? RemoteEndPoint { get; set; }
[Key(5)]
public string? HexData { get; set; }
[Key(6)]
public DateTime CurrentTime { get; set; }
}
public class NewVersionHexData_db
{
public ObjectId _id { get; set; }
public byte CmdType { get; set; }
public string? HotelCode { get; set; }
public string? HostNumber { get; set; }
public string? RoomNumber { get; set; }
public string? RemoteEndPoint { get; set; }
public string? HexData { get; set; }
public DateTime CurrentTime { get; set; }
public List<Dictionary<string, string>>? Data { get; set; }
}
}

123
CommonEntity/PMSData.cs Normal file
View File

@@ -0,0 +1,123 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MessagePack;
using MongoDB.Bson;
namespace CommonEntity
{
public class PMSData
{
}
public class CheckInYuanShidata_db: CheckInYuanShidata
{
public ObjectId _id { get; set; }
}
[MessagePackObject()]
public class CheckInYuanShidata
{
[Key(0)]
public string? CommandType { get; set; }
[Key(1)]
public double Step { get; set; }
[Key(2)]
public string? IP { get; set; }
[Key(3)]
public string? RequestId { get; set; }
[Key(4)]
public ZhiJie? ZhiJieData { get; set; }
[Key(5)]
public JianJie? JianJieData { get; set; }
[Key(6)]
public DateTime CurrentTime { get; set; }
}
[MessagePackObject()]
public class ZhiJie
{
[Key(0)]
public CheckInData? CheckInData { get; set; }
[Key(1)]
public CheckOutData? CheckOutData { get; set; }
[Key(2)]
public RentData? RentData { get; set; }
}
[MessagePackObject()]
public class JianJie
{
[Key(0)]
public string? OriginallData { get; set; }
}
[MessagePackObject()]
public class CheckInData
{
[Key(0)]
public string? key { get; set; }
[Key(1)]
public string? code { get; set; }
[Key(2)]
public string? roomNumber { get; set; }
[Key(3)]
public DateTime checkInDate;
[Key(4)]
public string? xmlString { get; set; }
[Key(5)]
public string? phoneNumber { get; set; }
[Key(6)]
public string? idNumber { get; set; }
}
[MessagePackObject()]
public class CheckOutData
{
[Key(0)]
public string? key { get; set; }
[Key(1)]
public string? code { get; set; }
[Key(2)]
public string? roomNumber { get; set; }
[Key(3)]
public DateTime checkOutDate { get; set; }
}
[MessagePackObject()]
public class RentData
{
[Key(0)]
public string? key { get; set; }
[Key(1)]
public string? code { get; set; }
[Key(2)]
public string? roomNumber { get; set; }
[Key(3)]
public DateTime rentDate { get; set; }
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CommonEntity
{
public class ReturnInfo
{
public bool isok { set; get; } // 是否成功true成功
public string message { set; get; } // 传递接口信息or报错信息
public int status { set; get; } // 服务器报错信息正确为200错误404/500等
public object response { set; get; } // 获取到的信息本体若报错则为null
}
}

514
CommonEntity/UDPPackage.cs Normal file
View File

@@ -0,0 +1,514 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MessagePack;
using MongoDB.Bson;
namespace CommonEntity
{
public class KafkaKey
{
/// <summary>
/// 自己用 的系统的主题
/// </summary>
public static string BLWLog_RCU_Topic = "blwlog-rcu-udppackage-topic";
/// <summary>
/// 新数据会分区
/// </summary>
public static string BLWLog_RCU_Topic_Partition = "blwlog-data-topic";
//public static string BLWLog_RCU_Topic_Partition = "firsttopic";
/// <summary>
/// 宝镜系统使用的数据
/// </summary>
public static string BLWLog4BaoJing_RCU_Topic = "blwlog4BaoJing-rcu-udppackage-topic";
/// <summary>
/// 设备动作数据
/// </summary>
public static string UDPPackage_ActionData = "action_change_push";
public static string UDPPackageKey = "blwlog-rcu-topic";
public static string UDPPackageForkSystemKey = "forksystem";
public static string UDPPackageStepMonitor = "stepmonitor";
public static string UDPPackagePowerMonitor = "power";
public static string UDPPackageWholeDataMonitor = "original-power-data";
public static string IotMonitor = "iot";
public static string RCUOnLineStatus = "rcu-status";
public static string TakeCardStatus = "takecard-status";
public static string ServiceInfoStatus = "serviceinfo-status";
public static string InvokceThirdHttpInterface = "invoke3httpinterface";
public static string PMSLogMonitor = "pms";
public static string RCUNewVersion_RestartReason = "restart-reason";
public static string RCUNewVersion_TakeCard = "takecard";
public static string RCUNewVersion_0E = "0X0E";
public static string RCUNewVersion_Register = "0X01";
public static string RCUNewTimerData = "0X34";
}
//public class UDPPackage
//{
// public string? CommandType { get; set; }
// public long TotalCount { get; set; }
// public Dictionary<string, long> FenLei { get; set; }
// public string? RemoveTime { get; set; }
//}
[MessagePackObject]
public class UDPPackage
{
[Key(0)]
public string? CommandType { get; set; }
[Key(1)]
public long TotalCount { get; set; }
[Key(2)]
public Dictionary<string, long> FenLei { get; set; }
[Key(3)]
public string? RemoveTime { get; set; }
[Key(4)]
public Dictionary<string, string> ExtraData { get; set; }
}
[MessagePackObject()]
public class StepInfo
{
[Key(0)]
public string MessageId { get; set; }
[Key(1)]
public string? TriggerTime { get; set; }
[Key(2)]
public double Step { get; set; }
[Key(3)]
public string? StepDescription { get; set; }
[Key(4)]
public byte[]? Content { get; set; }
[Key(5)]
public long EveryMessageId { get; set; }
[Key(6)]
public long Monitor_0E_01 { get; set; }
[Key(7)]
public string? HotelCode { get; set; }
[Key(8)]
public string? HostNumber { get; set; }
}
[MessagePackObject()]
public class DingShiReportDate
{
[Key(0)]
/// <summary>
/// HostID
/// </summary>
public int HostID { get; set; }
/// <summary>
/// 设备类型
/// </summary>
[Key(1)]
public string DeviceType { get; set; }
/// <summary>
/// 设备地址
/// </summary>
[Key(2)]
public string Address { get; set; }
/// <summary>
/// 状态1开2关
/// </summary>
[Key(3)]
public int Status { get; set; }
/// <summary>
/// 亮度
/// </summary>
[Key(4)]
public int Brightness { get; set; }
/// <summary>
/// 当前温度
/// </summary>
[Key(5)]
public int CurrentTemp { get; set; }
/// <summary>
/// 设定温度
/// </summary>
[Key(6)]
public int SettingTemp { get; set; }
/// <summary>
/// 风速
/// </summary>
[Key(7)]
public int FanSpeed { get; set; }
/// <summary>
/// 模式
/// </summary>
[Key(8)]
public int Mode { get; set; }
/// <summary>
/// 阀门
/// </summary>
[Key(9)]
public int Valve { get; set; }
}
[MessagePackObject()]
public class NengHao
{
[Key(0)]
public long HotelCode { get; set; }
[Key(1)]
public string? HostNumber { get; set; }
[Key(2)]
public string? Mac { get; set; }
[Key(3)]
public string? EndPoint { get; set; }
[Key(4)]
public string? Version { get; set; }
[Key(5)]
public bool IsTakeCard { get; set; }
[Key(6)]
public double V { get; set; }
[Key(7)]
public double A { get; set; }
[Key(8)]
public double P { get; set; }
/// <summary>
/// 能耗
/// </summary>
[Key(9)]
public double Energy_Consumption { get; set; }
/// <summary>
/// 总能耗
/// </summary>
[Key(10)]
public double Sum_Energy_Consumption { get; set; }
[Key(11)]
public long CreateTime { get; set; }
[Key(12)]
public string? ReportTime { get; set; }
[Key(13)]
public string? RoomNumber { get; set; }
[Key(14)]
public int CarbonVIP { get; set; }
[Key(15)]
public List<DingShiReportDate>? AllDeviceData { get; set; }
[Key(16)]
public int IdentityInfo { get; set; }
}
[MessagePackObject()]
public class NewRoomtusPush
{
/// <summary>
/// 酒店编码
/// </summary>
[Key(0)]
public long code { get; set; }
[Key(1)]
public string hostnumber { get; set; }
/// <summary>
/// 房号
/// </summary>
[Key(2)]
public string roomNumber { get; set; }
/// <summary>
/// 回路地址
/// </summary>
[Key(3)]
public string address { get; set; }
/// <summary>
/// 回路名称
/// </summary>
[Key(4)]
public string name { get; set; }
/// <summary>
/// 状态
/// </summary>
[Key(5)]
public int status { get; set; }
/// <summary>
/// 亮度
/// </summary>
[Key(6)]
public int brightness { get; set; }
/// <summary>
/// 当前温度
/// </summary>
[Key(7)]
public int currentTemp { get; set; }
/// <summary>
/// 设定温度
/// </summary>
[Key(8)]
public int settingTemp { get; set; }
/// <summary>
/// 风速
/// </summary>
[Key(9)]
public int fanSpeed { get; set; }
/// <summary>
/// 模式
/// </summary>
[Key(10)]
public int mode { get; set; }
/// <summary>
/// 阀门
/// </summary>
[Key(11)]
public int valve { get; set; }
[Key(12)]
public long createtime { get; set; }
}
[MessagePackObject()]
public class OtherServiceInfo
{
[Key(0)]
public string? HotelCode { get; set; }
[Key(1)]
public string? HostNumber { get; set; }
[Key(2)]
public string? Address { get; set; }
[Key(3)]
public ushort StatusReceiver { get; set; }
[Key(4)]
public DateTime LastUpdateTime { get; set; }
}
[MessagePackObject()]
public class Interface3Log
{
[Key(0)]
public string? HotelCode { get; set; }
[Key(1)]
public string? HostNumber { get; set; }
[Key(2)]
public string? RoomNumber { get; set; }
[Key(3)]
public HttpActionData? ActionData { get; set; }
[Key(4)]
public DateTime TriggerTime { get; set; }
[Key(5)]
public string? CommandType { get; set; }
}
[MessagePackObject()]
public class HttpActionData
{
[Key(0)]
public double Step { get; set; }
[Key(1)]
public string? RequestData { get; set; }
[Key(2)]
public string? ResponseData { get; set; }
}
public class Interface3Log_db
{
public ObjectId _id { get; set; }
public string? HotelCode { get; set; }
public string? HostNumber { get; set; }
public string? RoomNumber { get; set; }
public HttpActionData? ActionData { get; set; }
public DateTime TriggerTime { get; set; }
public string? CommandType { get; set; }
}
public class StepInfo_db
{
public ObjectId _id { get; set; }
public string MessageId { get; set; }
public DateTime? TriggerTime { get; set; }
public string? TriggerTimeString { get; set; }
public double Step { get; set; }
public string? StepDescription { get; set; }
public byte[]? Content { get; set; }
public long EveryMessageId { get; set; }
public long Monitor_0E_01 { get; set; }
public string? HotelCode { get; set; }
public string? HostNumber { get; set; }
}
public class UDPPackage_db
{
public ObjectId _id { get; set; }
public string? CommandType { get; set; }
public long TotalCount { get; set; }
public Dictionary<string, long> FenLei { get; set; }
public Dictionary<string, string> ExtraData { get; set; }
public DateTime RemoveTime { get; set; }
public string? RemoveTimeString { get; set; }
}
public class NengHao_db
{
public ObjectId _id { get; set; }
public long HotelCode { get; set; }
public string? HostNumber { get; set; }
public string? Mac { get; set; }
public string? EndPoint { get; set; }
public string? Version { get; set; }
public bool IsTakeCard { get; set; }
public double V { get; set; }
public double A { get; set; }
public double P { get; set; }
public double Energy_Consumption { get; set; }
public double Sum_Energy_Consumption { get; set; }
public long CreateTime { get; set; }
public DateTime ReportTime { get; set; }
public string? RoomNumber { get; set; }
public int CarbonVIP { get; set; }
public List<DingShiReportDate>? AllDeviceData { get; set; }
public int IdentityInfo { get; set; }
}
public class OtherServiceInfo_db
{
public ObjectId _id { get; set; }
public string? HotelCode { get; set; }
public string? HostNumber { get; set; }
public string? Address { get; set; }
public ushort StatusReceiver { get; set; }
public DateTime LastUpdateTime { get; set; }
}
public class QueryDate
{
public string? HotelCode { get; set; }
public string? HostNumber { get; set; }
public string? Mac { get; set; }
public string Start_Time { get; set; }
public string End_Time { get; set; }
public int PageSize { get; set; }
public int PageIndex { get; set; }
}
public class TimerData
{
public int interval_Minutes { get; set; }
}
public class Root
{
public List<DataItem> data { get; set; }
}
public class DataItem
{
/// <summary>
///
/// </summary>
public string ExtendedLocation { get; set; }
/// <summary>
///
/// </summary>
public string OriginQuery { get; set; }
/// <summary>
///
/// </summary>
public string appinfo { get; set; }
/// <summary>
///
/// </summary>
public int disp_type { get; set; }
/// <summary>
///
/// </summary>
public string fetchkey { get; set; }
/// <summary>
/// 本地局域网
/// </summary>
public string location { get; set; }
/// <summary>
///
/// </summary>
public string origip { get; set; }
/// <summary>
///
/// </summary>
public string origipquery { get; set; }
/// <summary>
///
/// </summary>
public string resourceid { get; set; }
/// <summary>
///
/// </summary>
public int role_id { get; set; }
/// <summary>
///
/// </summary>
public int shareImage { get; set; }
/// <summary>
///
/// </summary>
public int showLikeShare { get; set; }
/// <summary>
///
/// </summary>
public string showlamp { get; set; }
/// <summary>
/// IP地址查询
/// </summary>
public string titlecont { get; set; }
/// <summary>
///
/// </summary>
public string tplt { get; set; }
}
}