增加RCU上离线功能,能耗双通道

This commit is contained in:
2026-01-15 17:32:26 +08:00
parent b746a1da1a
commit 10bf712006
148 changed files with 8075 additions and 290 deletions

View File

@@ -7,12 +7,15 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Confluent.Kafka" Version="2.12.0" /> <PackageReference Include="Confluent.Kafka" Version="2.13.0" />
<PackageReference Include="MessagePack" Version="3.1.4" /> <PackageReference Include="MessagePack" Version="3.1.4" />
<PackageReference Include="Microsoft.Orleans.Core" Version="8.2.0" />
<PackageReference Include="Microsoft.Orleans.Persistence.Redis" Version="8.2.0" />
<PackageReference Include="Microsoft.Orleans.Server" Version="8.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
<PackageReference Include="NLog" Version="6.0.7" /> <PackageReference Include="NLog" Version="6.0.7" />
<PackageReference Include="NLog.Schema" Version="6.0.7" /> <PackageReference Include="NLog.Schema" Version="6.0.7" />
<PackageReference Include="RestSharp" Version="113.0.0" /> <PackageReference Include="RestSharp" Version="113.1.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -0,0 +1,24 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.2.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BLWLogProduce", "BLWLogProduce.csproj", "{8F9FA7BB-447C-17A0-1F51-20CB53EEC52D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8F9FA7BB-447C-17A0-1F51-20CB53EEC52D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F9FA7BB-447C-17A0-1F51-20CB53EEC52D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F9FA7BB-447C-17A0-1F51-20CB53EEC52D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F9FA7BB-447C-17A0-1F51-20CB53EEC52D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7FE22929-3356-4D27-BAB5-6C21C5560899}
EndGlobalSection
EndGlobal

View File

@@ -29,20 +29,24 @@ namespace BLWData.Entity {
"KAkSDwoHQWRkcmVzcxgDIAEoCRIOCgZTdGF0dXMYBCABKAUSEgoKQnJpZ2h0", "KAkSDwoHQWRkcmVzcxgDIAEoCRIOCgZTdGF0dXMYBCABKAUSEgoKQnJpZ2h0",
"bmVzcxgFIAEoBRITCgtDdXJyZW50VGVtcBgGIAEoBRITCgtTZXR0aW5nVGVt", "bmVzcxgFIAEoBRITCgtDdXJyZW50VGVtcBgGIAEoBRITCgtTZXR0aW5nVGVt",
"cBgHIAEoBRIQCghGYW5TcGVlZBgIIAEoBRIMCgRNb2RlGAkgASgFEg0KBVZh", "cBgHIAEoBRIQCghGYW5TcGVlZBgIIAEoBRIMCgRNb2RlGAkgASgFEg0KBVZh",
"bHZlGAogASgFIuICChFFbmVyZ3lDb25zdW1wdGlvbhIRCglIb3RlbENvZGUY", "bHZlGAogASgFIoABChZTaW5nbGVQb3dlckNoYW5uZWxEYXRhEg8KB2FkZHJl",
"ASABKAMSEgoKSG9zdE51bWJlchgCIAEoCRILCgNNYWMYAyABKAkSEAoIRW5k", "c3MYASABKAkSDgoGZGlhbnlhGAIgASgBEg8KB2RpYW5saXUYAyABKAESDgoG",
"UG9pbnQYBCABKAkSDwoHVmVyc2lvbhgFIAEoCRISCgpJc1Rha2VDYXJkGAYg", "Z29uZ2x2GAQgASgBEg8KB25lbmdoYW8YBSABKAESEwoLem9uZ25lbmdoYW8Y",
"ASgIEgkKAVYYByABKAESCQoBQRgIIAEoARIJCgFQGAkgASgBEhoKEkVuZXJn", "BiABKAEihAMKEUVuZXJneUNvbnN1bXB0aW9uEhEKCUhvdGVsQ29kZRgBIAEo",
"eV9Db25zdW1wdGlvbhgKIAEoARIeChZTdW1fRW5lcmd5X0NvbnN1bXB0aW9u", "AxISCgpIb3N0TnVtYmVyGAIgASgJEgsKA01hYxgDIAEoCRIQCghFbmRQb2lu",
"GAsgASgBEhIKCkNyZWF0ZVRpbWUYDCABKAMSEgoKUm9vbU51bWJlchgNIAEo", "dBgEIAEoCRIPCgdWZXJzaW9uGAUgASgJEhIKCklzVGFrZUNhcmQYBiABKAgS",
"CRIRCglDYXJib25WSVAYDiABKAUSFAoMSWRlbnRpdHlJbmZvGA8gASgFEjQK", "QAoQUG93ZXJDaGFubmVsTGlzdBgHIAMoCzImLkJMV0RhdGEuRW50aXR5LlNp",
"EERldmljZVN0YXR1c0xpc3QYECADKAsyGi5CTFdEYXRhLkVudGl0eS5EZXZp", "bmdsZVBvd2VyQ2hhbm5lbERhdGESEgoKQ3JlYXRlVGltZRgIIAEoAxISCgpS",
"Y2VEYXRhYgZwcm90bzM=")); "b29tTnVtYmVyGAkgASgJEhEKCUNhcmJvblZJUBgKIAEoBRIUCgxJZGVudGl0",
"eUluZm8YCyABKAUSNAoQRGV2aWNlU3RhdHVzTGlzdBgMIAMoCzIaLkJMV0Rh",
"dGEuRW50aXR5LkRldmljZURhdGESEQoJQ2FyZEV2ZW50GA0gASgFEhQKDElz",
"SW5zZXJ0Q2FyZBgOIAEoBRISCgpQTVNfU3RhdHVzGA8gASgJYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { }, new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::BLWData.Entity.DeviceData), global::BLWData.Entity.DeviceData.Parser, new[]{ "HostID", "DeviceType", "Address", "Status", "Brightness", "CurrentTemp", "SettingTemp", "FanSpeed", "Mode", "Valve" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::BLWData.Entity.DeviceData), global::BLWData.Entity.DeviceData.Parser, new[]{ "HostID", "DeviceType", "Address", "Status", "Brightness", "CurrentTemp", "SettingTemp", "FanSpeed", "Mode", "Valve" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::BLWData.Entity.EnergyConsumption), global::BLWData.Entity.EnergyConsumption.Parser, new[]{ "HotelCode", "HostNumber", "Mac", "EndPoint", "Version", "IsTakeCard", "V", "A", "P", "EnergyConsumption_", "SumEnergyConsumption", "CreateTime", "RoomNumber", "CarbonVIP", "IdentityInfo", "DeviceStatusList" }, null, null, null, null) new pbr::GeneratedClrTypeInfo(typeof(global::BLWData.Entity.SinglePowerChannelData), global::BLWData.Entity.SinglePowerChannelData.Parser, new[]{ "Address", "Dianya", "Dianliu", "Gonglv", "Nenghao", "Zongnenghao" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::BLWData.Entity.EnergyConsumption), global::BLWData.Entity.EnergyConsumption.Parser, new[]{ "HotelCode", "HostNumber", "Mac", "EndPoint", "Version", "IsTakeCard", "PowerChannelList", "CreateTime", "RoomNumber", "CarbonVIP", "IdentityInfo", "DeviceStatusList", "CardEvent", "IsInsertCard", "PMSStatus" }, null, null, null, null)
})); }));
} }
#endregion #endregion
@@ -580,6 +584,392 @@ namespace BLWData.Entity {
} }
/// <summary>
///定义单个电力通道数据
/// </summary>
[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
public sealed partial class SinglePowerChannelData : pb::IMessage<SinglePowerChannelData>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<SinglePowerChannelData> _parser = new pb::MessageParser<SinglePowerChannelData>(() => new SinglePowerChannelData());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<SinglePowerChannelData> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor {
get { return global::BLWData.Entity.EnergyConsumptionReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public SinglePowerChannelData() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public SinglePowerChannelData(SinglePowerChannelData other) : this() {
address_ = other.address_;
dianya_ = other.dianya_;
dianliu_ = other.dianliu_;
gonglv_ = other.gonglv_;
nenghao_ = other.nenghao_;
zongnenghao_ = other.zongnenghao_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public SinglePowerChannelData Clone() {
return new SinglePowerChannelData(this);
}
/// <summary>Field number for the "address" field.</summary>
public const int AddressFieldNumber = 1;
private string address_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string Address {
get { return address_; }
set {
address_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "dianya" field.</summary>
public const int DianyaFieldNumber = 2;
private double dianya_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public double Dianya {
get { return dianya_; }
set {
dianya_ = value;
}
}
/// <summary>Field number for the "dianliu" field.</summary>
public const int DianliuFieldNumber = 3;
private double dianliu_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public double Dianliu {
get { return dianliu_; }
set {
dianliu_ = value;
}
}
/// <summary>Field number for the "gonglv" field.</summary>
public const int GonglvFieldNumber = 4;
private double gonglv_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public double Gonglv {
get { return gonglv_; }
set {
gonglv_ = value;
}
}
/// <summary>Field number for the "nenghao" field.</summary>
public const int NenghaoFieldNumber = 5;
private double nenghao_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public double Nenghao {
get { return nenghao_; }
set {
nenghao_ = value;
}
}
/// <summary>Field number for the "zongnenghao" field.</summary>
public const int ZongnenghaoFieldNumber = 6;
private double zongnenghao_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public double Zongnenghao {
get { return zongnenghao_; }
set {
zongnenghao_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
return Equals(other as SinglePowerChannelData);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool Equals(SinglePowerChannelData other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Address != other.Address) return false;
if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Dianya, other.Dianya)) return false;
if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Dianliu, other.Dianliu)) return false;
if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Gonglv, other.Gonglv)) return false;
if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Nenghao, other.Nenghao)) return false;
if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Zongnenghao, other.Zongnenghao)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode() {
int hash = 1;
if (Address.Length != 0) hash ^= Address.GetHashCode();
if (Dianya != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Dianya);
if (Dianliu != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Dianliu);
if (Gonglv != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Gonglv);
if (Nenghao != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Nenghao);
if (Zongnenghao != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Zongnenghao);
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (Address.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Address);
}
if (Dianya != 0D) {
output.WriteRawTag(17);
output.WriteDouble(Dianya);
}
if (Dianliu != 0D) {
output.WriteRawTag(25);
output.WriteDouble(Dianliu);
}
if (Gonglv != 0D) {
output.WriteRawTag(33);
output.WriteDouble(Gonglv);
}
if (Nenghao != 0D) {
output.WriteRawTag(41);
output.WriteDouble(Nenghao);
}
if (Zongnenghao != 0D) {
output.WriteRawTag(49);
output.WriteDouble(Zongnenghao);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (Address.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Address);
}
if (Dianya != 0D) {
output.WriteRawTag(17);
output.WriteDouble(Dianya);
}
if (Dianliu != 0D) {
output.WriteRawTag(25);
output.WriteDouble(Dianliu);
}
if (Gonglv != 0D) {
output.WriteRawTag(33);
output.WriteDouble(Gonglv);
}
if (Nenghao != 0D) {
output.WriteRawTag(41);
output.WriteDouble(Nenghao);
}
if (Zongnenghao != 0D) {
output.WriteRawTag(49);
output.WriteDouble(Zongnenghao);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize() {
int size = 0;
if (Address.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Address);
}
if (Dianya != 0D) {
size += 1 + 8;
}
if (Dianliu != 0D) {
size += 1 + 8;
}
if (Gonglv != 0D) {
size += 1 + 8;
}
if (Nenghao != 0D) {
size += 1 + 8;
}
if (Zongnenghao != 0D) {
size += 1 + 8;
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(SinglePowerChannelData other) {
if (other == null) {
return;
}
if (other.Address.Length != 0) {
Address = other.Address;
}
if (other.Dianya != 0D) {
Dianya = other.Dianya;
}
if (other.Dianliu != 0D) {
Dianliu = other.Dianliu;
}
if (other.Gonglv != 0D) {
Gonglv = other.Gonglv;
}
if (other.Nenghao != 0D) {
Nenghao = other.Nenghao;
}
if (other.Zongnenghao != 0D) {
Zongnenghao = other.Zongnenghao;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag;
while ((tag = input.ReadTag()) != 0) {
if ((tag & 7) == 4) {
// Abort on any end group tag.
return;
}
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
Address = input.ReadString();
break;
}
case 17: {
Dianya = input.ReadDouble();
break;
}
case 25: {
Dianliu = input.ReadDouble();
break;
}
case 33: {
Gonglv = input.ReadDouble();
break;
}
case 41: {
Nenghao = input.ReadDouble();
break;
}
case 49: {
Zongnenghao = input.ReadDouble();
break;
}
}
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
if ((tag & 7) == 4) {
// Abort on any end group tag.
return;
}
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
Address = input.ReadString();
break;
}
case 17: {
Dianya = input.ReadDouble();
break;
}
case 25: {
Dianliu = input.ReadDouble();
break;
}
case 33: {
Gonglv = input.ReadDouble();
break;
}
case 41: {
Nenghao = input.ReadDouble();
break;
}
case 49: {
Zongnenghao = input.ReadDouble();
break;
}
}
}
}
#endif
}
/// <summary> /// <summary>
/// 定义一个Person消息类型 /// 定义一个Person消息类型
/// </summary> /// </summary>
@@ -598,7 +988,7 @@ namespace BLWData.Entity {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor { public static pbr::MessageDescriptor Descriptor {
get { return global::BLWData.Entity.EnergyConsumptionReflection.Descriptor.MessageTypes[1]; } get { return global::BLWData.Entity.EnergyConsumptionReflection.Descriptor.MessageTypes[2]; }
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -624,16 +1014,15 @@ namespace BLWData.Entity {
endPoint_ = other.endPoint_; endPoint_ = other.endPoint_;
version_ = other.version_; version_ = other.version_;
isTakeCard_ = other.isTakeCard_; isTakeCard_ = other.isTakeCard_;
v_ = other.v_; powerChannelList_ = other.powerChannelList_.Clone();
a_ = other.a_;
p_ = other.p_;
energyConsumption_ = other.energyConsumption_;
sumEnergyConsumption_ = other.sumEnergyConsumption_;
createTime_ = other.createTime_; createTime_ = other.createTime_;
roomNumber_ = other.roomNumber_; roomNumber_ = other.roomNumber_;
carbonVIP_ = other.carbonVIP_; carbonVIP_ = other.carbonVIP_;
identityInfo_ = other.identityInfo_; identityInfo_ = other.identityInfo_;
deviceStatusList_ = other.deviceStatusList_.Clone(); deviceStatusList_ = other.deviceStatusList_.Clone();
cardEvent_ = other.cardEvent_;
isInsertCard_ = other.isInsertCard_;
pMSStatus_ = other.pMSStatus_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
@@ -715,68 +1104,19 @@ namespace BLWData.Entity {
} }
} }
/// <summary>Field number for the "V" field.</summary> /// <summary>Field number for the "PowerChannelList" field.</summary>
public const int VFieldNumber = 7; public const int PowerChannelListFieldNumber = 7;
private double v_; private static readonly pb::FieldCodec<global::BLWData.Entity.SinglePowerChannelData> _repeated_powerChannelList_codec
= pb::FieldCodec.ForMessage(58, global::BLWData.Entity.SinglePowerChannelData.Parser);
private readonly pbc::RepeatedField<global::BLWData.Entity.SinglePowerChannelData> powerChannelList_ = new pbc::RepeatedField<global::BLWData.Entity.SinglePowerChannelData>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public double V { public pbc::RepeatedField<global::BLWData.Entity.SinglePowerChannelData> PowerChannelList {
get { return v_; } get { return powerChannelList_; }
set {
v_ = value;
}
}
/// <summary>Field number for the "A" field.</summary>
public const int AFieldNumber = 8;
private double a_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public double A {
get { return a_; }
set {
a_ = value;
}
}
/// <summary>Field number for the "P" field.</summary>
public const int PFieldNumber = 9;
private double p_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public double P {
get { return p_; }
set {
p_ = value;
}
}
/// <summary>Field number for the "Energy_Consumption" field.</summary>
public const int EnergyConsumption_FieldNumber = 10;
private double energyConsumption_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public double EnergyConsumption_ {
get { return energyConsumption_; }
set {
energyConsumption_ = value;
}
}
/// <summary>Field number for the "Sum_Energy_Consumption" field.</summary>
public const int SumEnergyConsumptionFieldNumber = 11;
private double sumEnergyConsumption_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public double SumEnergyConsumption {
get { return sumEnergyConsumption_; }
set {
sumEnergyConsumption_ = value;
}
} }
/// <summary>Field number for the "CreateTime" field.</summary> /// <summary>Field number for the "CreateTime" field.</summary>
public const int CreateTimeFieldNumber = 12; public const int CreateTimeFieldNumber = 8;
private long createTime_; private long createTime_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
@@ -788,7 +1128,7 @@ namespace BLWData.Entity {
} }
/// <summary>Field number for the "RoomNumber" field.</summary> /// <summary>Field number for the "RoomNumber" field.</summary>
public const int RoomNumberFieldNumber = 13; public const int RoomNumberFieldNumber = 9;
private string roomNumber_ = ""; private string roomNumber_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
@@ -800,7 +1140,7 @@ namespace BLWData.Entity {
} }
/// <summary>Field number for the "CarbonVIP" field.</summary> /// <summary>Field number for the "CarbonVIP" field.</summary>
public const int CarbonVIPFieldNumber = 14; public const int CarbonVIPFieldNumber = 10;
private int carbonVIP_; private int carbonVIP_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
@@ -812,7 +1152,7 @@ namespace BLWData.Entity {
} }
/// <summary>Field number for the "IdentityInfo" field.</summary> /// <summary>Field number for the "IdentityInfo" field.</summary>
public const int IdentityInfoFieldNumber = 15; public const int IdentityInfoFieldNumber = 11;
private int identityInfo_; private int identityInfo_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
@@ -824,9 +1164,9 @@ namespace BLWData.Entity {
} }
/// <summary>Field number for the "DeviceStatusList" field.</summary> /// <summary>Field number for the "DeviceStatusList" field.</summary>
public const int DeviceStatusListFieldNumber = 16; public const int DeviceStatusListFieldNumber = 12;
private static readonly pb::FieldCodec<global::BLWData.Entity.DeviceData> _repeated_deviceStatusList_codec private static readonly pb::FieldCodec<global::BLWData.Entity.DeviceData> _repeated_deviceStatusList_codec
= pb::FieldCodec.ForMessage(130, global::BLWData.Entity.DeviceData.Parser); = pb::FieldCodec.ForMessage(98, global::BLWData.Entity.DeviceData.Parser);
private readonly pbc::RepeatedField<global::BLWData.Entity.DeviceData> deviceStatusList_ = new pbc::RepeatedField<global::BLWData.Entity.DeviceData>(); private readonly pbc::RepeatedField<global::BLWData.Entity.DeviceData> deviceStatusList_ = new pbc::RepeatedField<global::BLWData.Entity.DeviceData>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
@@ -834,6 +1174,42 @@ namespace BLWData.Entity {
get { return deviceStatusList_; } get { return deviceStatusList_; }
} }
/// <summary>Field number for the "CardEvent" field.</summary>
public const int CardEventFieldNumber = 13;
private int cardEvent_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CardEvent {
get { return cardEvent_; }
set {
cardEvent_ = value;
}
}
/// <summary>Field number for the "IsInsertCard" field.</summary>
public const int IsInsertCardFieldNumber = 14;
private int isInsertCard_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int IsInsertCard {
get { return isInsertCard_; }
set {
isInsertCard_ = value;
}
}
/// <summary>Field number for the "PMS_Status" field.</summary>
public const int PMSStatusFieldNumber = 15;
private string pMSStatus_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string PMSStatus {
get { return pMSStatus_; }
set {
pMSStatus_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) { public override bool Equals(object other) {
@@ -855,16 +1231,15 @@ namespace BLWData.Entity {
if (EndPoint != other.EndPoint) return false; if (EndPoint != other.EndPoint) return false;
if (Version != other.Version) return false; if (Version != other.Version) return false;
if (IsTakeCard != other.IsTakeCard) return false; if (IsTakeCard != other.IsTakeCard) return false;
if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(V, other.V)) return false; if(!powerChannelList_.Equals(other.powerChannelList_)) return false;
if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(A, other.A)) return false;
if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(P, other.P)) return false;
if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(EnergyConsumption_, other.EnergyConsumption_)) return false;
if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(SumEnergyConsumption, other.SumEnergyConsumption)) return false;
if (CreateTime != other.CreateTime) return false; if (CreateTime != other.CreateTime) return false;
if (RoomNumber != other.RoomNumber) return false; if (RoomNumber != other.RoomNumber) return false;
if (CarbonVIP != other.CarbonVIP) return false; if (CarbonVIP != other.CarbonVIP) return false;
if (IdentityInfo != other.IdentityInfo) return false; if (IdentityInfo != other.IdentityInfo) return false;
if(!deviceStatusList_.Equals(other.deviceStatusList_)) return false; if(!deviceStatusList_.Equals(other.deviceStatusList_)) return false;
if (CardEvent != other.CardEvent) return false;
if (IsInsertCard != other.IsInsertCard) return false;
if (PMSStatus != other.PMSStatus) return false;
return Equals(_unknownFields, other._unknownFields); return Equals(_unknownFields, other._unknownFields);
} }
@@ -878,16 +1253,15 @@ namespace BLWData.Entity {
if (EndPoint.Length != 0) hash ^= EndPoint.GetHashCode(); if (EndPoint.Length != 0) hash ^= EndPoint.GetHashCode();
if (Version.Length != 0) hash ^= Version.GetHashCode(); if (Version.Length != 0) hash ^= Version.GetHashCode();
if (IsTakeCard != false) hash ^= IsTakeCard.GetHashCode(); if (IsTakeCard != false) hash ^= IsTakeCard.GetHashCode();
if (V != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(V); hash ^= powerChannelList_.GetHashCode();
if (A != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(A);
if (P != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(P);
if (EnergyConsumption_ != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(EnergyConsumption_);
if (SumEnergyConsumption != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(SumEnergyConsumption);
if (CreateTime != 0L) hash ^= CreateTime.GetHashCode(); if (CreateTime != 0L) hash ^= CreateTime.GetHashCode();
if (RoomNumber.Length != 0) hash ^= RoomNumber.GetHashCode(); if (RoomNumber.Length != 0) hash ^= RoomNumber.GetHashCode();
if (CarbonVIP != 0) hash ^= CarbonVIP.GetHashCode(); if (CarbonVIP != 0) hash ^= CarbonVIP.GetHashCode();
if (IdentityInfo != 0) hash ^= IdentityInfo.GetHashCode(); if (IdentityInfo != 0) hash ^= IdentityInfo.GetHashCode();
hash ^= deviceStatusList_.GetHashCode(); hash ^= deviceStatusList_.GetHashCode();
if (CardEvent != 0) hash ^= CardEvent.GetHashCode();
if (IsInsertCard != 0) hash ^= IsInsertCard.GetHashCode();
if (PMSStatus.Length != 0) hash ^= PMSStatus.GetHashCode();
if (_unknownFields != null) { if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode(); hash ^= _unknownFields.GetHashCode();
} }
@@ -930,43 +1304,36 @@ namespace BLWData.Entity {
output.WriteRawTag(48); output.WriteRawTag(48);
output.WriteBool(IsTakeCard); output.WriteBool(IsTakeCard);
} }
if (V != 0D) { powerChannelList_.WriteTo(output, _repeated_powerChannelList_codec);
output.WriteRawTag(57);
output.WriteDouble(V);
}
if (A != 0D) {
output.WriteRawTag(65);
output.WriteDouble(A);
}
if (P != 0D) {
output.WriteRawTag(73);
output.WriteDouble(P);
}
if (EnergyConsumption_ != 0D) {
output.WriteRawTag(81);
output.WriteDouble(EnergyConsumption_);
}
if (SumEnergyConsumption != 0D) {
output.WriteRawTag(89);
output.WriteDouble(SumEnergyConsumption);
}
if (CreateTime != 0L) { if (CreateTime != 0L) {
output.WriteRawTag(96); output.WriteRawTag(64);
output.WriteInt64(CreateTime); output.WriteInt64(CreateTime);
} }
if (RoomNumber.Length != 0) { if (RoomNumber.Length != 0) {
output.WriteRawTag(106); output.WriteRawTag(74);
output.WriteString(RoomNumber); output.WriteString(RoomNumber);
} }
if (CarbonVIP != 0) { if (CarbonVIP != 0) {
output.WriteRawTag(112); output.WriteRawTag(80);
output.WriteInt32(CarbonVIP); output.WriteInt32(CarbonVIP);
} }
if (IdentityInfo != 0) { if (IdentityInfo != 0) {
output.WriteRawTag(120); output.WriteRawTag(88);
output.WriteInt32(IdentityInfo); output.WriteInt32(IdentityInfo);
} }
deviceStatusList_.WriteTo(output, _repeated_deviceStatusList_codec); deviceStatusList_.WriteTo(output, _repeated_deviceStatusList_codec);
if (CardEvent != 0) {
output.WriteRawTag(104);
output.WriteInt32(CardEvent);
}
if (IsInsertCard != 0) {
output.WriteRawTag(112);
output.WriteInt32(IsInsertCard);
}
if (PMSStatus.Length != 0) {
output.WriteRawTag(122);
output.WriteString(PMSStatus);
}
if (_unknownFields != null) { if (_unknownFields != null) {
_unknownFields.WriteTo(output); _unknownFields.WriteTo(output);
} }
@@ -1001,43 +1368,36 @@ namespace BLWData.Entity {
output.WriteRawTag(48); output.WriteRawTag(48);
output.WriteBool(IsTakeCard); output.WriteBool(IsTakeCard);
} }
if (V != 0D) { powerChannelList_.WriteTo(ref output, _repeated_powerChannelList_codec);
output.WriteRawTag(57);
output.WriteDouble(V);
}
if (A != 0D) {
output.WriteRawTag(65);
output.WriteDouble(A);
}
if (P != 0D) {
output.WriteRawTag(73);
output.WriteDouble(P);
}
if (EnergyConsumption_ != 0D) {
output.WriteRawTag(81);
output.WriteDouble(EnergyConsumption_);
}
if (SumEnergyConsumption != 0D) {
output.WriteRawTag(89);
output.WriteDouble(SumEnergyConsumption);
}
if (CreateTime != 0L) { if (CreateTime != 0L) {
output.WriteRawTag(96); output.WriteRawTag(64);
output.WriteInt64(CreateTime); output.WriteInt64(CreateTime);
} }
if (RoomNumber.Length != 0) { if (RoomNumber.Length != 0) {
output.WriteRawTag(106); output.WriteRawTag(74);
output.WriteString(RoomNumber); output.WriteString(RoomNumber);
} }
if (CarbonVIP != 0) { if (CarbonVIP != 0) {
output.WriteRawTag(112); output.WriteRawTag(80);
output.WriteInt32(CarbonVIP); output.WriteInt32(CarbonVIP);
} }
if (IdentityInfo != 0) { if (IdentityInfo != 0) {
output.WriteRawTag(120); output.WriteRawTag(88);
output.WriteInt32(IdentityInfo); output.WriteInt32(IdentityInfo);
} }
deviceStatusList_.WriteTo(ref output, _repeated_deviceStatusList_codec); deviceStatusList_.WriteTo(ref output, _repeated_deviceStatusList_codec);
if (CardEvent != 0) {
output.WriteRawTag(104);
output.WriteInt32(CardEvent);
}
if (IsInsertCard != 0) {
output.WriteRawTag(112);
output.WriteInt32(IsInsertCard);
}
if (PMSStatus.Length != 0) {
output.WriteRawTag(122);
output.WriteString(PMSStatus);
}
if (_unknownFields != null) { if (_unknownFields != null) {
_unknownFields.WriteTo(ref output); _unknownFields.WriteTo(ref output);
} }
@@ -1066,21 +1426,7 @@ namespace BLWData.Entity {
if (IsTakeCard != false) { if (IsTakeCard != false) {
size += 1 + 1; size += 1 + 1;
} }
if (V != 0D) { size += powerChannelList_.CalculateSize(_repeated_powerChannelList_codec);
size += 1 + 8;
}
if (A != 0D) {
size += 1 + 8;
}
if (P != 0D) {
size += 1 + 8;
}
if (EnergyConsumption_ != 0D) {
size += 1 + 8;
}
if (SumEnergyConsumption != 0D) {
size += 1 + 8;
}
if (CreateTime != 0L) { if (CreateTime != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(CreateTime); size += 1 + pb::CodedOutputStream.ComputeInt64Size(CreateTime);
} }
@@ -1094,6 +1440,15 @@ namespace BLWData.Entity {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(IdentityInfo); size += 1 + pb::CodedOutputStream.ComputeInt32Size(IdentityInfo);
} }
size += deviceStatusList_.CalculateSize(_repeated_deviceStatusList_codec); size += deviceStatusList_.CalculateSize(_repeated_deviceStatusList_codec);
if (CardEvent != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(CardEvent);
}
if (IsInsertCard != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(IsInsertCard);
}
if (PMSStatus.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(PMSStatus);
}
if (_unknownFields != null) { if (_unknownFields != null) {
size += _unknownFields.CalculateSize(); size += _unknownFields.CalculateSize();
} }
@@ -1124,21 +1479,7 @@ namespace BLWData.Entity {
if (other.IsTakeCard != false) { if (other.IsTakeCard != false) {
IsTakeCard = other.IsTakeCard; IsTakeCard = other.IsTakeCard;
} }
if (other.V != 0D) { powerChannelList_.Add(other.powerChannelList_);
V = other.V;
}
if (other.A != 0D) {
A = other.A;
}
if (other.P != 0D) {
P = other.P;
}
if (other.EnergyConsumption_ != 0D) {
EnergyConsumption_ = other.EnergyConsumption_;
}
if (other.SumEnergyConsumption != 0D) {
SumEnergyConsumption = other.SumEnergyConsumption;
}
if (other.CreateTime != 0L) { if (other.CreateTime != 0L) {
CreateTime = other.CreateTime; CreateTime = other.CreateTime;
} }
@@ -1152,6 +1493,15 @@ namespace BLWData.Entity {
IdentityInfo = other.IdentityInfo; IdentityInfo = other.IdentityInfo;
} }
deviceStatusList_.Add(other.deviceStatusList_); deviceStatusList_.Add(other.deviceStatusList_);
if (other.CardEvent != 0) {
CardEvent = other.CardEvent;
}
if (other.IsInsertCard != 0) {
IsInsertCard = other.IsInsertCard;
}
if (other.PMSStatus.Length != 0) {
PMSStatus = other.PMSStatus;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
} }
@@ -1195,46 +1545,42 @@ namespace BLWData.Entity {
IsTakeCard = input.ReadBool(); IsTakeCard = input.ReadBool();
break; break;
} }
case 57: { case 58: {
V = input.ReadDouble(); powerChannelList_.AddEntriesFrom(input, _repeated_powerChannelList_codec);
break; break;
} }
case 65: { case 64: {
A = input.ReadDouble();
break;
}
case 73: {
P = input.ReadDouble();
break;
}
case 81: {
EnergyConsumption_ = input.ReadDouble();
break;
}
case 89: {
SumEnergyConsumption = input.ReadDouble();
break;
}
case 96: {
CreateTime = input.ReadInt64(); CreateTime = input.ReadInt64();
break; break;
} }
case 106: { case 74: {
RoomNumber = input.ReadString(); RoomNumber = input.ReadString();
break; break;
} }
case 112: { case 80: {
CarbonVIP = input.ReadInt32(); CarbonVIP = input.ReadInt32();
break; break;
} }
case 120: { case 88: {
IdentityInfo = input.ReadInt32(); IdentityInfo = input.ReadInt32();
break; break;
} }
case 130: { case 98: {
deviceStatusList_.AddEntriesFrom(input, _repeated_deviceStatusList_codec); deviceStatusList_.AddEntriesFrom(input, _repeated_deviceStatusList_codec);
break; break;
} }
case 104: {
CardEvent = input.ReadInt32();
break;
}
case 112: {
IsInsertCard = input.ReadInt32();
break;
}
case 122: {
PMSStatus = input.ReadString();
break;
}
} }
} }
#endif #endif
@@ -1278,46 +1624,42 @@ namespace BLWData.Entity {
IsTakeCard = input.ReadBool(); IsTakeCard = input.ReadBool();
break; break;
} }
case 57: { case 58: {
V = input.ReadDouble(); powerChannelList_.AddEntriesFrom(ref input, _repeated_powerChannelList_codec);
break; break;
} }
case 65: { case 64: {
A = input.ReadDouble();
break;
}
case 73: {
P = input.ReadDouble();
break;
}
case 81: {
EnergyConsumption_ = input.ReadDouble();
break;
}
case 89: {
SumEnergyConsumption = input.ReadDouble();
break;
}
case 96: {
CreateTime = input.ReadInt64(); CreateTime = input.ReadInt64();
break; break;
} }
case 106: { case 74: {
RoomNumber = input.ReadString(); RoomNumber = input.ReadString();
break; break;
} }
case 112: { case 80: {
CarbonVIP = input.ReadInt32(); CarbonVIP = input.ReadInt32();
break; break;
} }
case 120: { case 88: {
IdentityInfo = input.ReadInt32(); IdentityInfo = input.ReadInt32();
break; break;
} }
case 130: { case 98: {
deviceStatusList_.AddEntriesFrom(ref input, _repeated_deviceStatusList_codec); deviceStatusList_.AddEntriesFrom(ref input, _repeated_deviceStatusList_codec);
break; break;
} }
case 104: {
CardEvent = input.ReadInt32();
break;
}
case 112: {
IsInsertCard = input.ReadInt32();
break;
}
case 122: {
PMSStatus = input.ReadString();
break;
}
} }
} }
} }

View File

@@ -0,0 +1,43 @@
using CommonEntity;
using CSRedis;
using System.Text.Json;
namespace BLWLogProduce.Models
{
public class MyPublishRedis
{
public static CSRedisClient? redis4;
private const string ip = "127.0.0.1";
private const string port = "6379";
static MyPublishRedis()
{
var redisHostStr = string.Format("{0}:{1}", ip, port);
if (!string.IsNullOrEmpty(redisHostStr))
{
redis4 = new CSRedisClient(redisHostStr + ",password=,defaultDatabase=4");
string channel = "__keyevent@4__:expired";
var QQQ = new ValueTuple<string, Action<CSRedisClient.SubscribeMessageEventArgs>>(channel, (msg) =>
{
try
{
var o = JsonSerializer.Deserialize<OnOffLineData>(msg.Body);
o.CurrentStatus = "off";
string str = Newtonsoft.Json.JsonConvert.SerializeObject(o);
redis4.Publish("redis-on_off_line", str);
}
catch (Exception ex)
{
}
});
redis4.Subscribe(QQQ);
}
}
}
public class MyPublishRedis2
{
}
}

View File

@@ -0,0 +1,20 @@

namespace BLWLogProduce.Models
{
public class RCUAnyDataComming : Grain, CommonEntity.IRCUDataComing
{
public readonly IPersistentState<CommonEntity.OnOffLineData> _state;
public RCUAnyDataComming([PersistentState("anydata","redis-store")]IPersistentState<CommonEntity.OnOffLineData> state)
{
_state = state;
}
public ValueTask DataAccept()
{
throw new NotImplementedException();
}
}
}

View File

@@ -14,7 +14,23 @@ namespace BLWLogProduce
builder.Services.AddHostedService<KafkaProduce>(); builder.Services.AddHostedService<KafkaProduce>();
builder.Services.AddHostedService<MyTimer>(); builder.Services.AddHostedService<MyTimer>();
builder.Services.AddMemoryCache(); builder.Services.AddMemoryCache((option)=> { });
//builder.UseOrleans(ooo =>
//{
// ooo.UseLocalhostClustering();
// ooo.AddRedisGrainStorage("redis-store", options =>
// {
// options.ConfigurationOptions = new StackExchange.Redis.ConfigurationOptions
// {
// EndPoints = { "127.0.0.1:6379" },
// AbortOnConnectFail = true,
// ConnectRetry = 5,
// ConnectTimeout = 15000,
// SyncTimeout = 15000
// };
// });
//});
var app = builder.Build(); var app = builder.Build();
// Configure the HTTP request pipeline. // Configure the HTTP request pipeline.

View File

@@ -1,8 +1,4 @@
 
using System.Diagnostics.Metrics;
using System.Text;
using System.Text.Json;
using System.Threading.Channels;
using BLWData.Entity; using BLWData.Entity;
using BLWLogProduce.Models; using BLWLogProduce.Models;
using Common; using Common;
@@ -11,11 +7,17 @@ using CommonTools;
using Confluent.Kafka; using Confluent.Kafka;
using Google.Protobuf; using Google.Protobuf;
using MessagePack; using MessagePack;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.Caching.Memory;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using NLog; using NLog;
using RestSharp; using RestSharp;
using System.Diagnostics.Metrics;
using System.Runtime.Intrinsics.X86;
using System.Text;
using System.Text.Json;
using System.Threading.Channels;
using static CSRedis.CSRedisClient; using static CSRedis.CSRedisClient;
namespace BLWLogProduce.Services namespace BLWLogProduce.Services
@@ -363,6 +365,16 @@ namespace BLWLogProduce.Services
try try
{ {
NengHao? poo = System.Text.Json.JsonSerializer.Deserialize<NengHao>(body); NengHao? poo = System.Text.Json.JsonSerializer.Deserialize<NengHao>(body);
if (string.IsNullOrEmpty(poo.HostNumber))
{
return;
}
if (poo.NengHaoList == null || poo.NengHaoList.Count == 0)
{
return;
}
logger.Error("能耗:" + body);
//string str= Newtonsoft.Json.JsonConvert.SerializeObject(poo); //string str= Newtonsoft.Json.JsonConvert.SerializeObject(poo);
//Console.WriteLine("收到了"+str); //Console.WriteLine("收到了"+str);
byte[] qf = MyMessagePacker.FastSerialize(poo); byte[] qf = MyMessagePacker.FastSerialize(poo);
@@ -372,6 +384,7 @@ namespace BLWLogProduce.Services
await p.ProduceAsync(TopicKey, new Message<string, byte[]> { Key = DetailKey, Value = qf }); await p.ProduceAsync(TopicKey, new Message<string, byte[]> { Key = DetailKey, Value = qf });
#region 使
List<DeviceData> la = new List<DeviceData>(); List<DeviceData> la = new List<DeviceData>();
foreach (var item in poo.AllDeviceData) foreach (var item in poo.AllDeviceData)
{ {
@@ -389,31 +402,56 @@ namespace BLWLogProduce.Services
la.Add(dd); la.Add(dd);
} }
List<SinglePowerChannelData> nenghaolist = new List<SinglePowerChannelData>();
if (poo.NengHaoList != null && poo.NengHaoList.Count > 0)
{
foreach (var item in poo.NengHaoList)
{
SinglePowerChannelData gs1 = new SinglePowerChannelData();
gs1.Address = item.address;
gs1.Dianliu = item.dianliu;
gs1.Dianya = item.dianya;
gs1.Gonglv = item.gonglv;
gs1.Nenghao = item.nenghao;
gs1.Zongnenghao = item.zongnenghao;
nenghaolist.Add(gs1);
}
}
//宝镜系统使用 //宝镜系统使用
EnergyConsumption ese = new EnergyConsumption(); EnergyConsumption ese = new EnergyConsumption();
ese.HotelCode = poo.HotelCode; ese.HotelCode = poo.HotelCode;
ese.HostNumber = poo.HostNumber; ese.HostNumber = poo.HostNumber;
ese.Mac = poo.Mac; ese.Mac = poo.Mac;
ese.EndPoint = poo.EndPoint; ese.EndPoint = poo.EndPoint;
ese.V = poo.V; ese.PowerChannelList.AddRange(nenghaolist);
ese.A = poo.A; //ese.V = poo.V;
ese.P = poo.P; //ese.A = poo.A;
ese.EnergyConsumption_ = poo.Energy_Consumption; //ese.P = poo.P;
ese.SumEnergyConsumption = poo.Sum_Energy_Consumption; //ese.EnergyConsumption_ = poo.Energy_Consumption;
//ese.SumEnergyConsumption = poo.Sum_Energy_Consumption;
ese.CreateTime = poo.CreateTime; ese.CreateTime = poo.CreateTime;
ese.RoomNumber = poo.RoomNumber ?? ""; ese.RoomNumber = poo.RoomNumber ?? "";
ese.IsTakeCard = poo.IsTakeCard; ese.IsTakeCard = poo.IsTakeCard;
ese.IsInsertCard = poo.IsInsertCard;
ese.CarbonVIP = poo.CarbonVIP; ese.CarbonVIP = poo.CarbonVIP;
ese.DeviceStatusList.AddRange(la); ese.DeviceStatusList.AddRange(la);
ese.IdentityInfo = poo.IdentityInfo; ese.IdentityInfo = poo.IdentityInfo;
ese.CardEvent = poo.CardEvent;
ese.PMSStatus = poo.PMS_Status;
byte[] data = ese.ToByteArray(); byte[] data = ese.ToByteArray();
string TopicKey1 = KafkaKey.BLWLog4BaoJing_RCU_Topic; string TopicKey1 = KafkaKey.BLWLog4BaoJing_RCU_Topic;
string DetailKey1 = KafkaKey.UDPPackagePowerMonitor; string DetailKey1 = KafkaKey.UDPPackagePowerMonitor;
if (poo.HotelCode == 1085)
{
logger.Error("能耗数据:" + body);
}
await p.ProduceAsync(TopicKey1, new Message<string, byte[]> { Key = DetailKey1, Value = data }); await p.ProduceAsync(TopicKey1, new Message<string, byte[]> { Key = DetailKey1, Value = data });
#endregion
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -467,6 +505,30 @@ namespace BLWLogProduce.Services
})); }));
var TSLog_DingYue = ("redis-tslog", new Action<SubscribeMessageEventArgs>(async (args) =>
{
string body = args.Body;
try
{
NewVersionLog? poo = System.Text.Json.JsonSerializer.Deserialize<NewVersionLog>(body);
poo.ts_ms = Tools.GetUnixTime_MS();
string TopicKey1 = KafkaKey.BLWLog4NodeJs_RCU_Topic;
string DetailKey1 = poo.comm_seq.ToString();
var jsonstr = JsonConvert.SerializeObject(poo);
await p.ProduceAsync(TopicKey1, new Message<string, byte[]> { Key = DetailKey1, Value = Encoding.UTF8.GetBytes(jsonstr) });
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine(ex.StackTrace);
}
}));
#region #region
//var DingYue3_1 = ("redis-carbon_trigger", new Action<SubscribeMessageEventArgs>(async (args) => //var DingYue3_1 = ("redis-carbon_trigger", new Action<SubscribeMessageEventArgs>(async (args) =>
//{ //{
@@ -558,21 +620,41 @@ namespace BLWLogProduce.Services
})); }));
//在线离线状态 //在线离线状态
//这里只会是上线,离线在过期事件中处理
//宝镜系统使用的
var DingYue6 = ("redis-on_off_line", new Action<SubscribeMessageEventArgs>(async (args) => var DingYue6 = ("redis-on_off_line", new Action<SubscribeMessageEventArgs>(async (args) =>
{ {
try try
{ {
string body = args.Body; string body = args.Body;
OnOffLineData? usa = System.Text.Json.JsonSerializer.Deserialize<OnOffLineData>(body); CommonEntity.OnOffLineData? usa = System.Text.Json.JsonSerializer.Deserialize<CommonEntity.OnOffLineData>(body);
byte[] bytes = MyMessagePacker.FastSerialize(usa);
string TopicKey = KafkaKey.BLWLog_RCU_Topic; if (string.IsNullOrEmpty(usa.EndPoint))
string DetailKey = KafkaKey.RCUOnLineStatus; {
logger.Error("RCUOnOffLine:" + body);
return;
}
if (string.IsNullOrEmpty(usa.HostNumber))
{
logger.Error("RCUOnOffLine:" + body);
return;
}
BLWData.Entity.OnOffLineData ese = new BLWData.Entity.OnOffLineData();
ese.HotelCode = usa.HotelCode;
ese.HostNumber = usa.HostNumber;
ese.RoomNumber = usa.RoomNumber ?? "";
ese.CurrentStatus = usa.CurrentStatus;
ese.EndPoint = usa.EndPoint ?? "";
ese.Mac = usa.MAC ?? "";
ese.CurrentTime = usa.CurrentTime.ToString("yyyy-MM-dd HH:mm:ss.fff");
//var partition = new Partition(0); // 指定分区号
//var topicPartition = new TopicPartition(TopicKey, partition); byte[] data = ese.ToByteArray();
var dr = await p.ProduceAsync(TopicKey, new Message<string, byte[]> { Key = DetailKey, Value = bytes }); string TopicKey1 = KafkaKey.BLWLog4BaoJing_RCU_Topic;
string DetailKey1 = KafkaKey.RCUOnLineStatus;
//var dr = await p.ProduceAsync(TopicKey1, new Message<string, byte[]> { Key = DetailKey1, Value = data });
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -767,9 +849,9 @@ namespace BLWLogProduce.Services
//string ti = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); //string ti = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
DeviceActionChangeDataPush ese = new DeviceActionChangeDataPush(); DeviceActionChangeDataPush ese = new DeviceActionChangeDataPush();
ese.Code =long.Parse(poo.code); ese.Code = poo.code;
ese.RoomNumber = poo.roomNumber; ese.RoomNumber = poo.roomNumber;
ese.HostNumber =""; ese.HostNumber = "";
ese.Devicetype = poo.devicetype; ese.Devicetype = poo.devicetype;
ese.Address = poo.address; ese.Address = poo.address;
ese.Brightness = poo.brightness; ese.Brightness = poo.brightness;
@@ -828,6 +910,9 @@ namespace BLWLogProduce.Services
//CSRedisCacheHelper.redis3.Subscribe(DingYue3_1); //CSRedisCacheHelper.redis3.Subscribe(DingYue3_1);
CSRedisCacheHelper.redis3.Subscribe(DingYue20); CSRedisCacheHelper.redis3.Subscribe(DingYue20);
//新版本日志
CSRedisCacheHelper.redis3.Subscribe(TSLog_DingYue);
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@@ -5,8 +5,6 @@ VisualStudioVersion = 17.12.35527.113
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BLWLogServer", "BLWLogServer\BLWLogServer.csproj", "{D33FA88D-31DB-409A-95FA-214D15171F79}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BLWLogServer", "BLWLogServer\BLWLogServer.csproj", "{D33FA88D-31DB-409A-95FA-214D15171F79}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "发布", "ConsoleApp1\发布.csproj", "{80D28F4F-F594-4AE6-AFAF-F59B7D03394D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonEntity", "CommonEntity\CommonEntity.csproj", "{CB8D64BC-44CD-49AF-AABF-EDB9EA334B27}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonEntity", "CommonEntity\CommonEntity.csproj", "{CB8D64BC-44CD-49AF-AABF-EDB9EA334B27}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonTools", "CommonTools\CommonTools.csproj", "{A6767165-2F2D-49E9-9B6A-5067EDFBFF72}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonTools", "CommonTools\CommonTools.csproj", "{A6767165-2F2D-49E9-9B6A-5067EDFBFF72}"
@@ -27,6 +25,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "duoge", "duoge\duoge.csproj
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "消费", "消费\消费.csproj", "{9E50411B-77D4-4675-8F3A-F6245E51F9A8}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "消费", "消费\消费.csproj", "{9E50411B-77D4-4675-8F3A-F6245E51F9A8}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Redis定阅", "Redis定阅\Redis定阅.csproj", "{9FAA8EAA-D9B8-4EE8-8546-FC6F9D1D59B6}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@@ -37,10 +37,6 @@ Global
{D33FA88D-31DB-409A-95FA-214D15171F79}.Debug|Any CPU.Build.0 = Debug|Any CPU {D33FA88D-31DB-409A-95FA-214D15171F79}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D33FA88D-31DB-409A-95FA-214D15171F79}.Release|Any CPU.ActiveCfg = Release|Any CPU {D33FA88D-31DB-409A-95FA-214D15171F79}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D33FA88D-31DB-409A-95FA-214D15171F79}.Release|Any CPU.Build.0 = Release|Any CPU {D33FA88D-31DB-409A-95FA-214D15171F79}.Release|Any CPU.Build.0 = Release|Any CPU
{80D28F4F-F594-4AE6-AFAF-F59B7D03394D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{80D28F4F-F594-4AE6-AFAF-F59B7D03394D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80D28F4F-F594-4AE6-AFAF-F59B7D03394D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{80D28F4F-F594-4AE6-AFAF-F59B7D03394D}.Release|Any CPU.Build.0 = Release|Any CPU
{CB8D64BC-44CD-49AF-AABF-EDB9EA334B27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CB8D64BC-44CD-49AF-AABF-EDB9EA334B27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB8D64BC-44CD-49AF-AABF-EDB9EA334B27}.Debug|Any CPU.Build.0 = Debug|Any CPU {CB8D64BC-44CD-49AF-AABF-EDB9EA334B27}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB8D64BC-44CD-49AF-AABF-EDB9EA334B27}.Release|Any CPU.ActiveCfg = Release|Any CPU {CB8D64BC-44CD-49AF-AABF-EDB9EA334B27}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -81,6 +77,10 @@ Global
{9E50411B-77D4-4675-8F3A-F6245E51F9A8}.Debug|Any CPU.Build.0 = Debug|Any CPU {9E50411B-77D4-4675-8F3A-F6245E51F9A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9E50411B-77D4-4675-8F3A-F6245E51F9A8}.Release|Any CPU.ActiveCfg = Release|Any CPU {9E50411B-77D4-4675-8F3A-F6245E51F9A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9E50411B-77D4-4675-8F3A-F6245E51F9A8}.Release|Any CPU.Build.0 = Release|Any CPU {9E50411B-77D4-4675-8F3A-F6245E51F9A8}.Release|Any CPU.Build.0 = Release|Any CPU
{9FAA8EAA-D9B8-4EE8-8546-FC6F9D1D59B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9FAA8EAA-D9B8-4EE8-8546-FC6F9D1D59B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9FAA8EAA-D9B8-4EE8-8546-FC6F9D1D59B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9FAA8EAA-D9B8-4EE8-8546-FC6F9D1D59B6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@@ -244,7 +244,7 @@ namespace BLWLogServer.Services
else if (k.Equals(KafkaKey.RCUOnLineStatus)) else if (k.Equals(KafkaKey.RCUOnLineStatus))
{ {
var collection = client.GetDatabase("udppackage").GetCollection<OnOffLineData_db>("rcustatuslog"); var collection = client.GetDatabase("udppackage").GetCollection<OnOffLineData_db>("rcustatuslog");
OnOffLineData UDPPPP = MyMessagePacker.FastDeserialize<OnOffLineData>(v); CommonEntity.OnOffLineData UDPPPP = MyMessagePacker.FastDeserialize<CommonEntity.OnOffLineData>(v);
OnOffLineData_db us = new OnOffLineData_db(); OnOffLineData_db us = new OnOffLineData_db();
us.MAC = UDPPPP.MAC; us.MAC = UDPPPP.MAC;
us.HostNumber = UDPPPP.HostNumber; us.HostNumber = UDPPPP.HostNumber;

View File

@@ -9,6 +9,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.33.2" /> <PackageReference Include="Google.Protobuf" Version="3.33.2" />
<PackageReference Include="MessagePack" Version="3.1.4" /> <PackageReference Include="MessagePack" Version="3.1.4" />
<PackageReference Include="Microsoft.Orleans.Sdk" Version="8.2.0" />
<PackageReference Include="MongoDB.Bson" Version="3.4.1" /> <PackageReference Include="MongoDB.Bson" Version="3.4.1" />
</ItemGroup> </ItemGroup>

View File

@@ -26,7 +26,7 @@ namespace BLWData.Entity {
string.Concat( string.Concat(
"CiBEZXZpY2VBY3Rpb25DaGFuZ2VEYXRhUHVzaC5wcm90bxIOQkxXRGF0YS5F", "CiBEZXZpY2VBY3Rpb25DaGFuZ2VEYXRhUHVzaC5wcm90bxIOQkxXRGF0YS5F",
"bnRpdHkilgIKGkRldmljZUFjdGlvbkNoYW5nZURhdGFQdXNoEgwKBGNvZGUY", "bnRpdHkilgIKGkRldmljZUFjdGlvbkNoYW5nZURhdGFQdXNoEgwKBGNvZGUY",
"ASABKAMSEgoKcm9vbU51bWJlchgCIAEoCRISCgpob3N0TnVtYmVyGAMgASgJ", "ASABKAkSEgoKcm9vbU51bWJlchgCIAEoCRISCgpob3N0TnVtYmVyGAMgASgJ",
"EhIKCmRldmljZXR5cGUYBCABKAkSDwoHYWRkcmVzcxgFIAEoCRIMCgRuYW1l", "EhIKCmRldmljZXR5cGUYBCABKAkSDwoHYWRkcmVzcxgFIAEoCRIMCgRuYW1l",
"GAYgASgJEg4KBnN0YXR1cxgHIAEoBRISCgpicmlnaHRuZXNzGAggASgFEhMK", "GAYgASgJEg4KBnN0YXR1cxgHIAEoBRISCgpicmlnaHRuZXNzGAggASgFEhMK",
"C2N1cnJlbnRUZW1wGAkgASgFEhMKC3NldHRpbmdUZW1wGAogASgFEhAKCGZh", "C2N1cnJlbnRUZW1wGAkgASgFEhMKC3NldHRpbmdUZW1wGAogASgFEhAKCGZh",
@@ -105,13 +105,13 @@ namespace BLWData.Entity {
/// <summary>Field number for the "code" field.</summary> /// <summary>Field number for the "code" field.</summary>
public const int CodeFieldNumber = 1; public const int CodeFieldNumber = 1;
private long code_; private string code_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public long Code { public string Code {
get { return code_; } get { return code_; }
set { set {
code_ = value; code_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
} }
} }
@@ -307,7 +307,7 @@ namespace BLWData.Entity {
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode() { public override int GetHashCode() {
int hash = 1; int hash = 1;
if (Code != 0L) hash ^= Code.GetHashCode(); if (Code.Length != 0) hash ^= Code.GetHashCode();
if (RoomNumber.Length != 0) hash ^= RoomNumber.GetHashCode(); if (RoomNumber.Length != 0) hash ^= RoomNumber.GetHashCode();
if (HostNumber.Length != 0) hash ^= HostNumber.GetHashCode(); if (HostNumber.Length != 0) hash ^= HostNumber.GetHashCode();
if (Devicetype.Length != 0) hash ^= Devicetype.GetHashCode(); if (Devicetype.Length != 0) hash ^= Devicetype.GetHashCode();
@@ -339,9 +339,9 @@ namespace BLWData.Entity {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this); output.WriteRawMessage(this);
#else #else
if (Code != 0L) { if (Code.Length != 0) {
output.WriteRawTag(8); output.WriteRawTag(10);
output.WriteInt64(Code); output.WriteString(Code);
} }
if (RoomNumber.Length != 0) { if (RoomNumber.Length != 0) {
output.WriteRawTag(18); output.WriteRawTag(18);
@@ -405,9 +405,9 @@ namespace BLWData.Entity {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (Code != 0L) { if (Code.Length != 0) {
output.WriteRawTag(8); output.WriteRawTag(10);
output.WriteInt64(Code); output.WriteString(Code);
} }
if (RoomNumber.Length != 0) { if (RoomNumber.Length != 0) {
output.WriteRawTag(18); output.WriteRawTag(18);
@@ -471,8 +471,8 @@ namespace BLWData.Entity {
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (Code != 0L) { if (Code.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Code); size += 1 + pb::CodedOutputStream.ComputeStringSize(Code);
} }
if (RoomNumber.Length != 0) { if (RoomNumber.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(RoomNumber); size += 1 + pb::CodedOutputStream.ComputeStringSize(RoomNumber);
@@ -525,7 +525,7 @@ namespace BLWData.Entity {
if (other == null) { if (other == null) {
return; return;
} }
if (other.Code != 0L) { if (other.Code.Length != 0) {
Code = other.Code; Code = other.Code;
} }
if (other.RoomNumber.Length != 0) { if (other.RoomNumber.Length != 0) {
@@ -586,8 +586,8 @@ namespace BLWData.Entity {
default: default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break; break;
case 8: { case 10: {
Code = input.ReadInt64(); Code = input.ReadString();
break; break;
} }
case 18: { case 18: {
@@ -661,8 +661,8 @@ namespace BLWData.Entity {
default: default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break; break;
case 8: { case 10: {
Code = input.ReadInt64(); Code = input.ReadString();
break; break;
} }
case 18: { case 18: {

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CommonEntity
{
public interface IRCUDataComing:IGrainWithStringKey
{
ValueTask DataAccept();
}
}

View File

@@ -71,26 +71,38 @@ namespace CommonEntity
[Key(1)] [Key(1)]
public string? DeviceAddress { get; set; } public string? DeviceAddress { get; set; }
} }
[GenerateSerializer()]
[MessagePackObject()] [MessagePackObject()]
public class OnOffLineData public class OnOffLineData
{ {
[Id(0)]
[Key(0)] [Key(0)]
public string? HotelCode { get; set; } public string? HotelCode { get; set; }
[Id(1)]
[Key(1)] [Key(1)]
public string? MAC { get; set; } public string? MAC { get; set; }
[Id(2)]
[Key(2)] [Key(2)]
public string? HostNumber { get; set; } public string? HostNumber { get; set; }
[Id(3)]
[Key(3)] [Key(3)]
public string? EndPoint { get; set; } public string? EndPoint { get; set; }
[Id(4)]
[Key(4)] [Key(4)]
public string? CurrentStatus { get; set; } public string? CurrentStatus { get; set; }
[Id(5)]
[Key(5)] [Key(5)]
public DateTime CurrentTime { get; set; } public DateTime CurrentTime { get; set; }
[Id(6)]
[Key(6)]
public string? RoomNumber { get; set; }
} }

View File

@@ -0,0 +1,469 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: RCUOnOffLine.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021, 8981
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace BLWData.Entity {
/// <summary>Holder for reflection information generated from RCUOnOffLine.proto</summary>
public static partial class RCUOnOffLineReflection {
#region Descriptor
/// <summary>File descriptor for RCUOnOffLine.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static RCUOnOffLineReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"ChJSQ1VPbk9mZkxpbmUucHJvdG8SDkJMV0RhdGEuRW50aXR5IpUBCg1Pbk9m",
"ZkxpbmVEYXRhEhEKCUhvdGVsQ29kZRgBIAEoCRISCgpIb3N0TnVtYmVyGAIg",
"ASgJEgsKA01hYxgDIAEoCRISCgpSb29tTnVtYmVyGAQgASgJEhAKCEVuZFBv",
"aW50GAUgASgJEhUKDUN1cnJlbnRTdGF0dXMYBiABKAkSEwoLQ3VycmVudFRp",
"bWUYByABKAliBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::BLWData.Entity.OnOffLineData), global::BLWData.Entity.OnOffLineData.Parser, new[]{ "HotelCode", "HostNumber", "Mac", "RoomNumber", "EndPoint", "CurrentStatus", "CurrentTime" }, null, null, null, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// 定义一个Person消息类型
/// </summary>
[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
public sealed partial class OnOffLineData : pb::IMessage<OnOffLineData>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<OnOffLineData> _parser = new pb::MessageParser<OnOffLineData>(() => new OnOffLineData());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<OnOffLineData> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor {
get { return global::BLWData.Entity.RCUOnOffLineReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public OnOffLineData() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public OnOffLineData(OnOffLineData other) : this() {
hotelCode_ = other.hotelCode_;
hostNumber_ = other.hostNumber_;
mac_ = other.mac_;
roomNumber_ = other.roomNumber_;
endPoint_ = other.endPoint_;
currentStatus_ = other.currentStatus_;
currentTime_ = other.currentTime_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public OnOffLineData Clone() {
return new OnOffLineData(this);
}
/// <summary>Field number for the "HotelCode" field.</summary>
public const int HotelCodeFieldNumber = 1;
private string hotelCode_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string HotelCode {
get { return hotelCode_; }
set {
hotelCode_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "HostNumber" field.</summary>
public const int HostNumberFieldNumber = 2;
private string hostNumber_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string HostNumber {
get { return hostNumber_; }
set {
hostNumber_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "Mac" field.</summary>
public const int MacFieldNumber = 3;
private string mac_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string Mac {
get { return mac_; }
set {
mac_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "RoomNumber" field.</summary>
public const int RoomNumberFieldNumber = 4;
private string roomNumber_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string RoomNumber {
get { return roomNumber_; }
set {
roomNumber_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "EndPoint" field.</summary>
public const int EndPointFieldNumber = 5;
private string endPoint_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string EndPoint {
get { return endPoint_; }
set {
endPoint_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "CurrentStatus" field.</summary>
public const int CurrentStatusFieldNumber = 6;
private string currentStatus_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string CurrentStatus {
get { return currentStatus_; }
set {
currentStatus_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "CurrentTime" field.</summary>
public const int CurrentTimeFieldNumber = 7;
private string currentTime_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string CurrentTime {
get { return currentTime_; }
set {
currentTime_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
return Equals(other as OnOffLineData);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool Equals(OnOffLineData other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (HotelCode != other.HotelCode) return false;
if (HostNumber != other.HostNumber) return false;
if (Mac != other.Mac) return false;
if (RoomNumber != other.RoomNumber) return false;
if (EndPoint != other.EndPoint) return false;
if (CurrentStatus != other.CurrentStatus) return false;
if (CurrentTime != other.CurrentTime) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode() {
int hash = 1;
if (HotelCode.Length != 0) hash ^= HotelCode.GetHashCode();
if (HostNumber.Length != 0) hash ^= HostNumber.GetHashCode();
if (Mac.Length != 0) hash ^= Mac.GetHashCode();
if (RoomNumber.Length != 0) hash ^= RoomNumber.GetHashCode();
if (EndPoint.Length != 0) hash ^= EndPoint.GetHashCode();
if (CurrentStatus.Length != 0) hash ^= CurrentStatus.GetHashCode();
if (CurrentTime.Length != 0) hash ^= CurrentTime.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (HotelCode.Length != 0) {
output.WriteRawTag(10);
output.WriteString(HotelCode);
}
if (HostNumber.Length != 0) {
output.WriteRawTag(18);
output.WriteString(HostNumber);
}
if (Mac.Length != 0) {
output.WriteRawTag(26);
output.WriteString(Mac);
}
if (RoomNumber.Length != 0) {
output.WriteRawTag(34);
output.WriteString(RoomNumber);
}
if (EndPoint.Length != 0) {
output.WriteRawTag(42);
output.WriteString(EndPoint);
}
if (CurrentStatus.Length != 0) {
output.WriteRawTag(50);
output.WriteString(CurrentStatus);
}
if (CurrentTime.Length != 0) {
output.WriteRawTag(58);
output.WriteString(CurrentTime);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (HotelCode.Length != 0) {
output.WriteRawTag(10);
output.WriteString(HotelCode);
}
if (HostNumber.Length != 0) {
output.WriteRawTag(18);
output.WriteString(HostNumber);
}
if (Mac.Length != 0) {
output.WriteRawTag(26);
output.WriteString(Mac);
}
if (RoomNumber.Length != 0) {
output.WriteRawTag(34);
output.WriteString(RoomNumber);
}
if (EndPoint.Length != 0) {
output.WriteRawTag(42);
output.WriteString(EndPoint);
}
if (CurrentStatus.Length != 0) {
output.WriteRawTag(50);
output.WriteString(CurrentStatus);
}
if (CurrentTime.Length != 0) {
output.WriteRawTag(58);
output.WriteString(CurrentTime);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize() {
int size = 0;
if (HotelCode.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(HotelCode);
}
if (HostNumber.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(HostNumber);
}
if (Mac.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Mac);
}
if (RoomNumber.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(RoomNumber);
}
if (EndPoint.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(EndPoint);
}
if (CurrentStatus.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(CurrentStatus);
}
if (CurrentTime.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(CurrentTime);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(OnOffLineData other) {
if (other == null) {
return;
}
if (other.HotelCode.Length != 0) {
HotelCode = other.HotelCode;
}
if (other.HostNumber.Length != 0) {
HostNumber = other.HostNumber;
}
if (other.Mac.Length != 0) {
Mac = other.Mac;
}
if (other.RoomNumber.Length != 0) {
RoomNumber = other.RoomNumber;
}
if (other.EndPoint.Length != 0) {
EndPoint = other.EndPoint;
}
if (other.CurrentStatus.Length != 0) {
CurrentStatus = other.CurrentStatus;
}
if (other.CurrentTime.Length != 0) {
CurrentTime = other.CurrentTime;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag;
while ((tag = input.ReadTag()) != 0) {
if ((tag & 7) == 4) {
// Abort on any end group tag.
return;
}
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
HotelCode = input.ReadString();
break;
}
case 18: {
HostNumber = input.ReadString();
break;
}
case 26: {
Mac = input.ReadString();
break;
}
case 34: {
RoomNumber = input.ReadString();
break;
}
case 42: {
EndPoint = input.ReadString();
break;
}
case 50: {
CurrentStatus = input.ReadString();
break;
}
case 58: {
CurrentTime = input.ReadString();
break;
}
}
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
if ((tag & 7) == 4) {
// Abort on any end group tag.
return;
}
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
HotelCode = input.ReadString();
break;
}
case 18: {
HostNumber = input.ReadString();
break;
}
case 26: {
Mac = input.ReadString();
break;
}
case 34: {
RoomNumber = input.ReadString();
break;
}
case 42: {
EndPoint = input.ReadString();
break;
}
case 50: {
CurrentStatus = input.ReadString();
break;
}
case 58: {
CurrentTime = input.ReadString();
break;
}
}
}
}
#endif
}
#endregion
}
#endregion Designer generated code

40
CommonEntity/TSLog.cs Normal file
View File

@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CommonEntity
{
/// <summary>
/// ts 日志
/// </summary>
public class NewVersionLog
{
public string hotel_id { get; set; }
public string room_id { get; set; }
public string device_id { get; set; }
public string ip { get; set; }
public int power_state { get; set; }
public int guest_type { get; set; }
public int cardless_state { get; set; }
public ulong service_mask { get; set; }
public int pms_state { get; set; }
public int carbon_state { get; set; }
public int device_count { get; set; }
public int comm_seq { get; set; }
public long ts_ms { get; set; }
public extra_data extra { get; set; }
}
public class extra_data
{
public byte[] original_byte { get; set; }
public string source { get; set; }
public string ver { get; set; }
public object ac { get; set; }
public object meter { get; set; }
}
}

View File

@@ -26,7 +26,17 @@ namespace CommonEntity
/// <summary> /// <summary>
/// 宝镜系统使用的数据 /// 宝镜系统使用的数据
/// </summary> /// </summary>
public static string BLWLog4BaoJing_RCU_Topic = "blwlog4BaoJing-rcu-udppackage-topic"; //public static string BLWLog4BaoJing_RCU_Topic = "blwlog4BaoJing-rcu-udppackage-topic";
public static string BLWLog4BaoJing_RCU_Topic = "blwlog4BaoJing-rcu-heartbeat-topic";
#region
/// <summary>
/// 新的 TS写的日志系统
/// 心跳包
/// </summary>
public static string BLWLog4NodeJs_RCU_Topic = "blwlog4Nodejs-rcu-heartbeat-topic";
#endregion
/// <summary> /// <summary>
/// 选住使用kafka数据 /// 选住使用kafka数据
@@ -176,11 +186,38 @@ namespace CommonEntity
public int Valve { get; set; } public int Valve { get; set; }
} }
/// <summary>
/// 能耗实体类
/// </summary>
[MessagePackObject()]
public class NengHao_Repeat
{
[Key(0)]
public string? address { get; set; }
[Key(1)]
public double dianya { get; set; }
[Key(2)]
public double dianliu { get; set; }
[Key(3)]
public double gonglv { get; set; }
[Key(4)]
public double nenghao { get; set; }
[Key(5)]
public double zongnenghao { get; set; }
}
[MessagePackObject()] [MessagePackObject()]
public class NengHao public class NengHao
{ {
[Key(0)] [Key(0)]
public long HotelCode { get; set; } public long HotelCode { get; set; }
[Key(1)] [Key(1)]
public string? HostNumber { get; set; } public string? HostNumber { get; set; }
@@ -197,43 +234,66 @@ namespace CommonEntity
public bool IsTakeCard { get; set; } public bool IsTakeCard { get; set; }
[Key(6)] [Key(6)]
public double V { get; set; } public List<NengHao_Repeat> NengHaoList { get; set; }
#region
//[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; }
#endregion
[Key(7)] [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; } public long CreateTime { get; set; }
[Key(12)] [Key(8)]
public string? ReportTime { get; set; } public string? ReportTime { get; set; }
[Key(13)] [Key(9)]
public string? RoomNumber { get; set; } public string? RoomNumber { get; set; }
[Key(14)] [Key(10)]
public int CarbonVIP { get; set; } public int CarbonVIP { get; set; }
[Key(15)] [Key(11)]
public List<DingShiReportDate>? AllDeviceData { get; set; } public List<DingShiReportDate>? AllDeviceData { get; set; }
[Key(16)] [Key(12)]
public int IdentityInfo { get; set; } public int IdentityInfo { get; set; }
/// <summary>
///短离长离
///我们这里叫卡事件
/// </summary>
[Key(13)]
public ushort CardEvent { get; set; }
/// <summary>
/// PMS 状态
/// </summary>
[Key(14)]
public string? PMS_Status { get; set; }
[Key(15)]
public int IsInsertCard { get; set; }
} }
[MessagePackObject()] [MessagePackObject()]

View File

@@ -1,9 +1,10 @@
using System; using CommonTools;
using CSRedis;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Configuration;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Configuration;
using CSRedis;
namespace Common namespace Common
{ {
@@ -34,7 +35,38 @@ namespace Common
redis4 = new CSRedisClient(redisHostStr + ",password=,defaultDatabase=4"); redis4 = new CSRedisClient(redisHostStr + ",password=,defaultDatabase=4");
//准备存储取电数据 //准备存储取电数据
redis5 = new CSRedisClient(redisHostStr + ",password=,defaultDatabase=5"); redis5 = new CSRedisClient(redisHostStr + ",password=,defaultDatabase=5");
//Native subscribe
string channel = "__keyevent@4__:expired";
var QQQ = new ValueTuple<string, Action<CSRedisClient.SubscribeMessageEventArgs>>(channel, (msg) =>
{
//string Key = CacheKey.UPGradeProgressBar + "_" + id;
try
{
if (!msg.Body.StartsWith("hb#"))
{
bool containsHyphen = msg.Body.Contains("-");
bool isNumeric = msg.Body.All(char.IsDigit);
if (containsHyphen == false && isNumeric)
{
//string hotelcode = Tools.HostNumberToHotelCode(msg.Body).ToString();
//OnOffLineData o = new OnOffLineData();
//o.HotelCode = hotelcode;
//o.HostNumber = msg.Body;
//o.CurrentStatus = "off";
//o.CurrentTime = DateTime.Now;
////新来的数据
//string str = Newtonsoft.Json.JsonConvert.SerializeObject(o);
//CSRedisCacheHelper.redis3.Publish("redis-on_off_line", str);
//redis4.Set(HeartBeatPrefix + "_" + msg.Body, 1, 5 * 60);
}
}
}
catch (Exception ex)
{
}
});
redis.Subscribe(QQQ);
} }
} }
/// <summary> /// <summary>
@@ -62,7 +94,7 @@ namespace Common
redis.Del(key); redis.Del(key);
} }
public static void Del_Partition(string key,int SliceNo=2) public static void Del_Partition(string key, int SliceNo = 2)
{ {
CSRedisClient client = WhitchRedisSlice(SliceNo); CSRedisClient client = WhitchRedisSlice(SliceNo);
client.Del(key); client.Del(key);
@@ -160,5 +192,111 @@ namespace Common
{ {
return redis.Ttl(key); return redis.Ttl(key);
} }
/// <summary>
/// 添加Hash缓存
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="key"></param>
/// <param name="value"></param>
public static void HMSet(int SliceNo, string key, params object[] value)
{
CSRedisClient client = WhitchRedisSlice(SliceNo);
client.HMSet(key, value);
}
public static void HMSet(int SliceNo, int ExpireTime_M, string key, params object[] value)
{
CSRedisClient client = WhitchRedisSlice(SliceNo);
client.HMSet(key, value);
client.Expire(key, new TimeSpan(0, ExpireTime_M, 0));
}
/// <summary>
/// 获取Hash缓存
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="key"></param>
/// <returns></returns>
public static T[] HMGet<T>(int SliceNo, string key, string KeyV)
{
CSRedisClient client = WhitchRedisSlice(SliceNo);
return client.HMGet<T>(key, KeyV);
}
public static Dictionary<string, string> HMGetAll(int SliceNo, string key)
{
CSRedisClient client = WhitchRedisSlice(SliceNo);
return client.HGetAll(key);
}
/// <summary>
/// 获取 某个hash值的数量
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static int GetHMCount(string key)
{
return redis5.HGetAll(key).Count;
}
/// <summary>
/// 删除Hash缓存
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="key"></param>
/// <returns></returns>
public static long HDelAll<T>(int SliceNo, string key)
{
CSRedisClient client = WhitchRedisSlice(SliceNo);
return client.HDel(key);
}
public static long HDel(int SliceNo, string key, string key1)
{
CSRedisClient client = WhitchRedisSlice(SliceNo);
return client.HDel(key, key1);
}
public static void ListAdd(int SliceNo, string key, params object[] obj)
{
CSRedisClient client = WhitchRedisSlice(SliceNo);
client.LPush(key, obj);
}
public static int MaxLen = 500000;
public static void StreamAdd(int SliceNo, string key, string Value)
{
try
{
CSRedisClient client = WhitchRedisSlice(SliceNo);
// 添加简单消息
client.XAdd(key, MaxLen, "*", new ValueTuple<string, string>("__data", Value));
}
catch (Exception)
{
}
}
public static void StreamConsume(int SliceNo, string key, string group = "UDPData", string consumer = "Crics1")
{
CSRedisClient client = WhitchRedisSlice(SliceNo);
var data = redis.XReadGroup(group, consumer, 100, 10, new ValueTuple<string, string>(key, ">"));
if (data != null)
{
//检查pending表的长度
//消费确认前pending 应该等于2
var pending = redis.XPending(key, group);
foreach (var item in data)
{
var idarray = item.Item2;
foreach (var SerializeNo in idarray)
{
var id1 = SerializeNo.Item1;
redis.XAck(key, group, id1);
redis.XDel(key, id1);
}
}
}
}
} }
} }

View File

@@ -572,6 +572,14 @@ namespace CommonTools
long unixTimestampMillisecondsManual = (long)(DateTime.UtcNow - unixEpoch).TotalSeconds; long unixTimestampMillisecondsManual = (long)(DateTime.UtcNow - unixEpoch).TotalSeconds;
return unixTimestampMillisecondsManual; return unixTimestampMillisecondsManual;
} }
public static long GetUnixTime_MS()
{
//DateTime unixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
//double unixTimestampMillisecondsManual = (DateTime.UtcNow - unixEpoch).TotalMilliseconds;
//return unixTimestampMillisecondsManual;
return DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); // 返回 long
}
public static DateTime GetTimeFromUnixTime(long timestampSeconds) public static DateTime GetTimeFromUnixTime(long timestampSeconds)
{ {
// Unix 时间戳的起始时间1970-01-01 00:00:00 UTC // Unix 时间戳的起始时间1970-01-01 00:00:00 UTC

22
Redis定阅/Program.cs Normal file
View File

@@ -0,0 +1,22 @@
using Common;
using CommonEntity;
using static CSRedis.CSRedisClient;
namespace Redis定阅
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
var DingYue3 = ("redis-power", new Action<SubscribeMessageEventArgs>(async (args) =>
{
string body = args.Body;
NengHao? poo = System.Text.Json.JsonSerializer.Deserialize<NengHao>(body);
}));
CSRedisCacheHelper.redis.Subscribe(DingYue3);
}
}
}

View File

@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="csredis" Version="3.2.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CommonEntity\CommonEntity.csproj" />
<ProjectReference Include="..\CommonTools\CommonTools.csproj" />
</ItemGroup>
</Project>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,12 @@
{
"runtimeOptions": {
"tfm": "net8.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "8.0.0"
},
"configProperties": {
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More