增加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>
<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="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="NLog" 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>

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",
"bmVzcxgFIAEoBRITCgtDdXJyZW50VGVtcBgGIAEoBRITCgtTZXR0aW5nVGVt",
"cBgHIAEoBRIQCghGYW5TcGVlZBgIIAEoBRIMCgRNb2RlGAkgASgFEg0KBVZh",
"bHZlGAogASgFIuICChFFbmVyZ3lDb25zdW1wdGlvbhIRCglIb3RlbENvZGUY",
"ASABKAMSEgoKSG9zdE51bWJlchgCIAEoCRILCgNNYWMYAyABKAkSEAoIRW5k",
"UG9pbnQYBCABKAkSDwoHVmVyc2lvbhgFIAEoCRISCgpJc1Rha2VDYXJkGAYg",
"ASgIEgkKAVYYByABKAESCQoBQRgIIAEoARIJCgFQGAkgASgBEhoKEkVuZXJn",
"eV9Db25zdW1wdGlvbhgKIAEoARIeChZTdW1fRW5lcmd5X0NvbnN1bXB0aW9u",
"GAsgASgBEhIKCkNyZWF0ZVRpbWUYDCABKAMSEgoKUm9vbU51bWJlchgNIAEo",
"CRIRCglDYXJib25WSVAYDiABKAUSFAoMSWRlbnRpdHlJbmZvGA8gASgFEjQK",
"EERldmljZVN0YXR1c0xpc3QYECADKAsyGi5CTFdEYXRhLkVudGl0eS5EZXZp",
"Y2VEYXRhYgZwcm90bzM="));
"bHZlGAogASgFIoABChZTaW5nbGVQb3dlckNoYW5uZWxEYXRhEg8KB2FkZHJl",
"c3MYASABKAkSDgoGZGlhbnlhGAIgASgBEg8KB2RpYW5saXUYAyABKAESDgoG",
"Z29uZ2x2GAQgASgBEg8KB25lbmdoYW8YBSABKAESEwoLem9uZ25lbmdoYW8Y",
"BiABKAEihAMKEUVuZXJneUNvbnN1bXB0aW9uEhEKCUhvdGVsQ29kZRgBIAEo",
"AxISCgpIb3N0TnVtYmVyGAIgASgJEgsKA01hYxgDIAEoCRIQCghFbmRQb2lu",
"dBgEIAEoCRIPCgdWZXJzaW9uGAUgASgJEhIKCklzVGFrZUNhcmQYBiABKAgS",
"QAoQUG93ZXJDaGFubmVsTGlzdBgHIAMoCzImLkJMV0RhdGEuRW50aXR5LlNp",
"bmdsZVBvd2VyQ2hhbm5lbERhdGESEgoKQ3JlYXRlVGltZRgIIAEoAxISCgpS",
"b29tTnVtYmVyGAkgASgJEhEKCUNhcmJvblZJUBgKIAEoBRIUCgxJZGVudGl0",
"eUluZm8YCyABKAUSNAoQRGV2aWNlU3RhdHVzTGlzdBgMIAMoCzIaLkJMV0Rh",
"dGEuRW50aXR5LkRldmljZURhdGESEQoJQ2FyZEV2ZW50GA0gASgFEhQKDElz",
"SW5zZXJ0Q2FyZBgOIAEoBRISCgpQTVNfU3RhdHVzGA8gASgJYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
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.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
@@ -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>
/// 定义一个Person消息类型
/// </summary>
@@ -598,7 +988,7 @@ namespace BLWData.Entity {
[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]; }
get { return global::BLWData.Entity.EnergyConsumptionReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -624,16 +1014,15 @@ namespace BLWData.Entity {
endPoint_ = other.endPoint_;
version_ = other.version_;
isTakeCard_ = other.isTakeCard_;
v_ = other.v_;
a_ = other.a_;
p_ = other.p_;
energyConsumption_ = other.energyConsumption_;
sumEnergyConsumption_ = other.sumEnergyConsumption_;
powerChannelList_ = other.powerChannelList_.Clone();
createTime_ = other.createTime_;
roomNumber_ = other.roomNumber_;
carbonVIP_ = other.carbonVIP_;
identityInfo_ = other.identityInfo_;
deviceStatusList_ = other.deviceStatusList_.Clone();
cardEvent_ = other.cardEvent_;
isInsertCard_ = other.isInsertCard_;
pMSStatus_ = other.pMSStatus_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
@@ -715,68 +1104,19 @@ namespace BLWData.Entity {
}
}
/// <summary>Field number for the "V" field.</summary>
public const int VFieldNumber = 7;
private double v_;
/// <summary>Field number for the "PowerChannelList" field.</summary>
public const int PowerChannelListFieldNumber = 7;
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.CodeDom.Compiler.GeneratedCode("protoc", null)]
public double V {
get { return v_; }
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;
}
public pbc::RepeatedField<global::BLWData.Entity.SinglePowerChannelData> PowerChannelList {
get { return powerChannelList_; }
}
/// <summary>Field number for the "CreateTime" field.</summary>
public const int CreateTimeFieldNumber = 12;
public const int CreateTimeFieldNumber = 8;
private long createTime_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
@@ -788,7 +1128,7 @@ namespace BLWData.Entity {
}
/// <summary>Field number for the "RoomNumber" field.</summary>
public const int RoomNumberFieldNumber = 13;
public const int RoomNumberFieldNumber = 9;
private string roomNumber_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
@@ -800,7 +1140,7 @@ namespace BLWData.Entity {
}
/// <summary>Field number for the "CarbonVIP" field.</summary>
public const int CarbonVIPFieldNumber = 14;
public const int CarbonVIPFieldNumber = 10;
private int carbonVIP_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
@@ -812,7 +1152,7 @@ namespace BLWData.Entity {
}
/// <summary>Field number for the "IdentityInfo" field.</summary>
public const int IdentityInfoFieldNumber = 15;
public const int IdentityInfoFieldNumber = 11;
private int identityInfo_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
@@ -824,9 +1164,9 @@ namespace BLWData.Entity {
}
/// <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
= 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>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
@@ -834,6 +1174,42 @@ namespace BLWData.Entity {
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.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
@@ -855,16 +1231,15 @@ namespace BLWData.Entity {
if (EndPoint != other.EndPoint) return false;
if (Version != other.Version) return false;
if (IsTakeCard != other.IsTakeCard) return false;
if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(V, other.V)) 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(!powerChannelList_.Equals(other.powerChannelList_)) return false;
if (CreateTime != other.CreateTime) return false;
if (RoomNumber != other.RoomNumber) return false;
if (CarbonVIP != other.CarbonVIP) return false;
if (IdentityInfo != other.IdentityInfo) 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);
}
@@ -878,16 +1253,15 @@ namespace BLWData.Entity {
if (EndPoint.Length != 0) hash ^= EndPoint.GetHashCode();
if (Version.Length != 0) hash ^= Version.GetHashCode();
if (IsTakeCard != false) hash ^= IsTakeCard.GetHashCode();
if (V != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(V);
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);
hash ^= powerChannelList_.GetHashCode();
if (CreateTime != 0L) hash ^= CreateTime.GetHashCode();
if (RoomNumber.Length != 0) hash ^= RoomNumber.GetHashCode();
if (CarbonVIP != 0) hash ^= CarbonVIP.GetHashCode();
if (IdentityInfo != 0) hash ^= IdentityInfo.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) {
hash ^= _unknownFields.GetHashCode();
}
@@ -930,43 +1304,36 @@ namespace BLWData.Entity {
output.WriteRawTag(48);
output.WriteBool(IsTakeCard);
}
if (V != 0D) {
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);
}
powerChannelList_.WriteTo(output, _repeated_powerChannelList_codec);
if (CreateTime != 0L) {
output.WriteRawTag(96);
output.WriteRawTag(64);
output.WriteInt64(CreateTime);
}
if (RoomNumber.Length != 0) {
output.WriteRawTag(106);
output.WriteRawTag(74);
output.WriteString(RoomNumber);
}
if (CarbonVIP != 0) {
output.WriteRawTag(112);
output.WriteRawTag(80);
output.WriteInt32(CarbonVIP);
}
if (IdentityInfo != 0) {
output.WriteRawTag(120);
output.WriteRawTag(88);
output.WriteInt32(IdentityInfo);
}
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) {
_unknownFields.WriteTo(output);
}
@@ -1001,43 +1368,36 @@ namespace BLWData.Entity {
output.WriteRawTag(48);
output.WriteBool(IsTakeCard);
}
if (V != 0D) {
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);
}
powerChannelList_.WriteTo(ref output, _repeated_powerChannelList_codec);
if (CreateTime != 0L) {
output.WriteRawTag(96);
output.WriteRawTag(64);
output.WriteInt64(CreateTime);
}
if (RoomNumber.Length != 0) {
output.WriteRawTag(106);
output.WriteRawTag(74);
output.WriteString(RoomNumber);
}
if (CarbonVIP != 0) {
output.WriteRawTag(112);
output.WriteRawTag(80);
output.WriteInt32(CarbonVIP);
}
if (IdentityInfo != 0) {
output.WriteRawTag(120);
output.WriteRawTag(88);
output.WriteInt32(IdentityInfo);
}
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) {
_unknownFields.WriteTo(ref output);
}
@@ -1066,21 +1426,7 @@ namespace BLWData.Entity {
if (IsTakeCard != false) {
size += 1 + 1;
}
if (V != 0D) {
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;
}
size += powerChannelList_.CalculateSize(_repeated_powerChannelList_codec);
if (CreateTime != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(CreateTime);
}
@@ -1094,6 +1440,15 @@ namespace BLWData.Entity {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(IdentityInfo);
}
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) {
size += _unknownFields.CalculateSize();
}
@@ -1124,21 +1479,7 @@ namespace BLWData.Entity {
if (other.IsTakeCard != false) {
IsTakeCard = other.IsTakeCard;
}
if (other.V != 0D) {
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;
}
powerChannelList_.Add(other.powerChannelList_);
if (other.CreateTime != 0L) {
CreateTime = other.CreateTime;
}
@@ -1152,6 +1493,15 @@ namespace BLWData.Entity {
IdentityInfo = other.IdentityInfo;
}
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);
}
@@ -1195,46 +1545,42 @@ namespace BLWData.Entity {
IsTakeCard = input.ReadBool();
break;
}
case 57: {
V = input.ReadDouble();
case 58: {
powerChannelList_.AddEntriesFrom(input, _repeated_powerChannelList_codec);
break;
}
case 65: {
A = input.ReadDouble();
break;
}
case 73: {
P = input.ReadDouble();
break;
}
case 81: {
EnergyConsumption_ = input.ReadDouble();
break;
}
case 89: {
SumEnergyConsumption = input.ReadDouble();
break;
}
case 96: {
case 64: {
CreateTime = input.ReadInt64();
break;
}
case 106: {
case 74: {
RoomNumber = input.ReadString();
break;
}
case 112: {
case 80: {
CarbonVIP = input.ReadInt32();
break;
}
case 120: {
case 88: {
IdentityInfo = input.ReadInt32();
break;
}
case 130: {
case 98: {
deviceStatusList_.AddEntriesFrom(input, _repeated_deviceStatusList_codec);
break;
}
case 104: {
CardEvent = input.ReadInt32();
break;
}
case 112: {
IsInsertCard = input.ReadInt32();
break;
}
case 122: {
PMSStatus = input.ReadString();
break;
}
}
}
#endif
@@ -1278,46 +1624,42 @@ namespace BLWData.Entity {
IsTakeCard = input.ReadBool();
break;
}
case 57: {
V = input.ReadDouble();
case 58: {
powerChannelList_.AddEntriesFrom(ref input, _repeated_powerChannelList_codec);
break;
}
case 65: {
A = input.ReadDouble();
break;
}
case 73: {
P = input.ReadDouble();
break;
}
case 81: {
EnergyConsumption_ = input.ReadDouble();
break;
}
case 89: {
SumEnergyConsumption = input.ReadDouble();
break;
}
case 96: {
case 64: {
CreateTime = input.ReadInt64();
break;
}
case 106: {
case 74: {
RoomNumber = input.ReadString();
break;
}
case 112: {
case 80: {
CarbonVIP = input.ReadInt32();
break;
}
case 120: {
case 88: {
IdentityInfo = input.ReadInt32();
break;
}
case 130: {
case 98: {
deviceStatusList_.AddEntriesFrom(ref input, _repeated_deviceStatusList_codec);
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<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();
// 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 BLWLogProduce.Models;
using Common;
@@ -11,11 +7,17 @@ using CommonTools;
using Confluent.Kafka;
using Google.Protobuf;
using MessagePack;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.Extensions.Caching.Memory;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using NLog;
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;
namespace BLWLogProduce.Services
@@ -363,6 +365,16 @@ namespace BLWLogProduce.Services
try
{
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);
//Console.WriteLine("收到了"+str);
byte[] qf = MyMessagePacker.FastSerialize(poo);
@@ -372,6 +384,7 @@ namespace BLWLogProduce.Services
await p.ProduceAsync(TopicKey, new Message<string, byte[]> { Key = DetailKey, Value = qf });
#region 使
List<DeviceData> la = new List<DeviceData>();
foreach (var item in poo.AllDeviceData)
{
@@ -389,31 +402,56 @@ namespace BLWLogProduce.Services
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();
ese.HotelCode = poo.HotelCode;
ese.HostNumber = poo.HostNumber;
ese.Mac = poo.Mac;
ese.EndPoint = poo.EndPoint;
ese.V = poo.V;
ese.A = poo.A;
ese.P = poo.P;
ese.EnergyConsumption_ = poo.Energy_Consumption;
ese.SumEnergyConsumption = poo.Sum_Energy_Consumption;
ese.PowerChannelList.AddRange(nenghaolist);
//ese.V = poo.V;
//ese.A = poo.A;
//ese.P = poo.P;
//ese.EnergyConsumption_ = poo.Energy_Consumption;
//ese.SumEnergyConsumption = poo.Sum_Energy_Consumption;
ese.CreateTime = poo.CreateTime;
ese.RoomNumber = poo.RoomNumber ?? "";
ese.IsTakeCard = poo.IsTakeCard;
ese.IsInsertCard = poo.IsInsertCard;
ese.CarbonVIP = poo.CarbonVIP;
ese.DeviceStatusList.AddRange(la);
ese.IdentityInfo = poo.IdentityInfo;
ese.CardEvent = poo.CardEvent;
ese.PMSStatus = poo.PMS_Status;
byte[] data = ese.ToByteArray();
string TopicKey1 = KafkaKey.BLWLog4BaoJing_RCU_Topic;
string DetailKey1 = KafkaKey.UDPPackagePowerMonitor;
if (poo.HotelCode == 1085)
{
logger.Error("能耗数据:" + body);
}
await p.ProduceAsync(TopicKey1, new Message<string, byte[]> { Key = DetailKey1, Value = data });
#endregion
}
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
//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) =>
{
try
{
string body = args.Body;
OnOffLineData? usa = System.Text.Json.JsonSerializer.Deserialize<OnOffLineData>(body);
byte[] bytes = MyMessagePacker.FastSerialize(usa);
CommonEntity.OnOffLineData? usa = System.Text.Json.JsonSerializer.Deserialize<CommonEntity.OnOffLineData>(body);
string TopicKey = KafkaKey.BLWLog_RCU_Topic;
string DetailKey = KafkaKey.RCUOnLineStatus;
if (string.IsNullOrEmpty(usa.EndPoint))
{
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);
var dr = await p.ProduceAsync(TopicKey, new Message<string, byte[]> { Key = DetailKey, Value = bytes });
byte[] data = ese.ToByteArray();
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)
{
@@ -767,9 +849,9 @@ namespace BLWLogProduce.Services
//string ti = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
DeviceActionChangeDataPush ese = new DeviceActionChangeDataPush();
ese.Code =long.Parse(poo.code);
ese.Code = poo.code;
ese.RoomNumber = poo.roomNumber;
ese.HostNumber ="";
ese.HostNumber = "";
ese.Devicetype = poo.devicetype;
ese.Address = poo.address;
ese.Brightness = poo.brightness;
@@ -828,6 +910,9 @@ namespace BLWLogProduce.Services
//CSRedisCacheHelper.redis3.Subscribe(DingYue3_1);
CSRedisCacheHelper.redis3.Subscribe(DingYue20);
//新版本日志
CSRedisCacheHelper.redis3.Subscribe(TSLog_DingYue);
}
catch (Exception ex)
{