增加一系列功能

屏蔽 下位机 故障上报上报正常的数据。增加 日志系统的功能
This commit is contained in:
2026-03-19 08:56:39 +08:00
parent a93c11fbfe
commit e46b19016b
11 changed files with 72 additions and 44 deletions

View File

@@ -265,7 +265,7 @@ namespace RCUHost.Implement
}
d1.control_list = lll3;
d1.report_count = lll3.Count;
d1.ip = ipAndPort;
string sss = Newtonsoft.Json.JsonConvert.SerializeObject(d1);
CSRedisCacheHelper.Publish("redis-0X36-0X0F", sss);

View File

@@ -1281,6 +1281,7 @@ namespace RCUHost.Implement
string hotelid = CODE;
string roomid = RoomNUMBER;
Kafka_XinTiao k = new Kafka_XinTiao();
k.ip = EndPoint;
k.hotel_id = CODE;
k.device_id = HostNNN;
k.room_id = RoomNUMBER;
@@ -1444,6 +1445,7 @@ namespace RCUHost.Implement
d1.cmd_word = "0F";
d1.udp_raw = OriginalByte;
d1.direction = "上报";
d1.ip = EndPoint;
string sss = Newtonsoft.Json.JsonConvert.SerializeObject(d1);
CSRedisCacheHelper.Publish("redis-0X36-0X0F", sss);
@@ -1960,6 +1962,7 @@ namespace RCUHost.Implement
d1.cmd_word = "36";
d1.udp_raw = OriginalByte;
d1.direction = "上报";
d1.ip = EndPoint;
List<ts_deviceitem> lll1 = new List<ts_deviceitem>();
List<ts_faultitem> lll2 = new List<ts_faultitem>();

View File

@@ -123,7 +123,7 @@ namespace RCUHost.Implement
if (status.Devices != null && status.Devices.Count > 0)
{
//来一个数据,把所有的地址拼接起来
ProcessModal_NEW_NEW(host, status.Devices, isTriggerWelcomeMsg, context.MessageID, context.IsMonitor);//更新灯光及其他回路状态
ProcessModal_NEW_NEW(host, status.Devices, isTriggerWelcomeMsg, context.MessageID, context.IsMonitor,context.RemoteEndPoint.ToString());//更新灯光及其他回路状态
}
if (status.Faults != null && status.Faults.Count > 0)
@@ -183,7 +183,7 @@ namespace RCUHost.Implement
public static string Missionsys_Address = ConfigurationManager.AppSettings["missionsys_address"];
public static string MQTTInfo_report_url = ConfigurationManager.AppSettings["debug_log_report_url"].ToString();
private void ProcessModal_NEW_NEW(Host host, ConcurrentDictionary<string, Device> devices, bool IsTriggerWelcomeMsg, string ContextMessageId, bool ismonitor)
private void ProcessModal_NEW_NEW(Host host, ConcurrentDictionary<string, Device> devices, bool IsTriggerWelcomeMsg, string ContextMessageId, bool ismonitor,string EEndPoint)
{
string UUID = "9dc6a0ee-dcf1-4385-b05f-09cb463838cd";
UUID = host.FCS_locationUUID;
@@ -1646,7 +1646,10 @@ namespace RCUHost.Implement
case 1://状态1离线,0在线
record.AbnormalStatus = fault.Value.Data;
record.StatusDate = now;
RR.FCS_PushData(FCS_RCU_Device_Offline, host.FCS_locationUUID, PropertyUUID, FCSLoginUrl, FCSLoginUserName, FCSLoginPassWord, host.SysHotel.Code, host.RoomNumber, devicename + "###" + deviceaddress);
if (fault.Value.Data == 1)
{
RR.FCS_PushData(FCS_RCU_Device_Offline, host.FCS_locationUUID, PropertyUUID, FCSLoginUrl, FCSLoginUserName, FCSLoginPassWord, host.SysHotel.Code, host.RoomNumber, devicename + "###" + deviceaddress);
}
//sbSQL.Append("AbnormalStatus=" + record.AbnormalStatus + ",StatusDate=GETDATE()");
break;
case 2://电量

View File

@@ -157,7 +157,7 @@ namespace RCUHost.Implement
//来一个数据,把所有的地址拼接起来
string YiJingChuLiGuo = CacheKey.AllReadyDealWith0E_Prefix + "_" + HostNumberOnly;
MemoryCacheHelper.Delete(YiJingChuLiGuo);
ProcessModal_NEW_NEW(host, status.Devices, isTriggerWelcomeMsg, context.MessageID, context.IsMonitor, context.Data, status);//更新灯光及其他回路状态
ProcessModal_NEW_NEW(host, status.Devices, isTriggerWelcomeMsg, context.MessageID, context.IsMonitor, context.Data, status,context.RemoteEndPoint.ToString());//更新灯光及其他回路状态
string nnn = VVV1 + VVV2;
if (!string.IsNullOrEmpty(nnn))
{
@@ -224,7 +224,7 @@ namespace RCUHost.Implement
public static string Missionsys_Address = ConfigurationManager.AppSettings["missionsys_address"];
public static string MQTTInfo_report_url = ConfigurationManager.AppSettings["debug_log_report_url"].ToString();
private void ProcessModal_NEW_NEW(Host host, ConcurrentDictionary<string, Device> devices, bool IsTriggerWelcomeMsg, string ContextMessageId, bool ismonitor, byte[] OriginalByteList, Status yuanshidata)
private void ProcessModal_NEW_NEW(Host host, ConcurrentDictionary<string, Device> devices, bool IsTriggerWelcomeMsg, string ContextMessageId, bool ismonitor, byte[] OriginalByteList, Status yuanshidata,string EEndPoint)
{
string UUID = "9dc6a0ee-dcf1-4385-b05f-09cb463838cd";
UUID = host.FCS_locationUUID;
@@ -639,8 +639,8 @@ namespace RCUHost.Implement
// }
//}
string ebell_rtsp = host.EBell_RSTP;
int du = host.EBell_TV_duration;
string ebell_rtsp = host.EBell_RSTP;
int du = host.EBell_TV_duration;
if (hostModal.Modal.ModalAddress.Equals("004000021"))
{
Dictionary<string, string> ddd = new Dictionary<string, string>();
@@ -2025,6 +2025,7 @@ namespace RCUHost.Implement
d1.fault_list = exception_list;
d1.report_count = shebei_changeaction_list.Count;
d1.fault_count = exception_list.Count;
d1.ip = EEndPoint;
string sss111 = Newtonsoft.Json.JsonConvert.SerializeObject(d1);
CSRedisCacheHelper.Publish("redis-0X36-0X0F", sss111);
@@ -2212,7 +2213,10 @@ namespace RCUHost.Implement
case 1://状态1离线,0在线
record.AbnormalStatus = fault.Value.Data;
record.StatusDate = now;
RR.FCS_PushData(FCS_RCU_Device_Offline, host.FCS_locationUUID, PropertyUUID, FCSLoginUrl, FCSLoginUserName, FCSLoginPassWord, host.SysHotel.Code, host.RoomNumber);
if (record.AbnormalStatus == 1)
{
RR.FCS_PushData(FCS_RCU_Device_Offline, host.FCS_locationUUID, PropertyUUID, FCSLoginUrl, FCSLoginUserName, FCSLoginPassWord, host.SysHotel.Code, host.RoomNumber);
}
//sbSQL.Append("AbnormalStatus=" + record.AbnormalStatus + ",StatusDate=GETDATE()");
break;
case 2://电量

View File

@@ -69,23 +69,6 @@ namespace RCUHost.Implement
break;
}
var host = updateHostWorker.Host;
ShengJi_Log s1 = new ShengJi_Log();
s1.hotel_id = host.SysHotel.Code;
s1.room_id = host.RoomNumber;
s1.device_id = host.HostNumber;
s1.is_send = 0;
s1.udp_raw = context.Data;
s1.remote_endpoint = endpoint;
s1.md5 = "";
s1.partition = 0;
s1.file_type = 0;
s1.file_path = "";
s1.upgrade_state = reply.Value.Status;
s1.app_version = reply.Value.Version;
CSRedisCacheHelper.Publish("redis-up", Newtonsoft.Json.JsonConvert.SerializeObject(s1));
BarData bbb = new BarData();
@@ -120,21 +103,6 @@ namespace RCUHost.Implement
}
ShengJi_Log s1 = new ShengJi_Log();
s1.hotel_id = host.SysHotel.Code;
s1.room_id = host.RoomNumber;
s1.device_id = host.HostNumber;
s1.is_send = 0;
s1.udp_raw = context.Data;
s1.remote_endpoint = endpoint;
s1.md5 = "";
s1.partition = 0;
s1.file_type = 0;
s1.file_path = "";
s1.upgrade_state = reply.Value.Status;
s1.app_version = reply.Value.Version;
CSRedisCacheHelper.Publish("redis-up", Newtonsoft.Json.JsonConvert.SerializeObject(s1));
BarData bbb = new BarData();
bbb.HostID = host.ID;

View File

@@ -24,6 +24,12 @@ namespace RCUHost.Implement
private IList<UpdateHostWorker> updateHostList = new List<UpdateHostWorker>();
/// <summary>
/// 升级
///
///
///
/// 升级 成功 或者失败会在这里上报,
///
/// 唯 一的在这里上报,别的地方不会
/// </summary>
/// <param name="hostUpdate"></param>
/// <param name="fileType"></param>
@@ -147,6 +153,27 @@ namespace RCUHost.Implement
bbb.Upgrade_status = "升级失败";
break;
}
string endpoint = context.RemoteEndPoint.ToString();
var host = updateHostWorker.Host;
ShengJi_Log s1 = new ShengJi_Log();
s1.hotel_id = host.SysHotel.Code;
s1.room_id = host.RoomNumber;
s1.device_id = host.HostNumber;
s1.is_send = 0;
s1.udp_raw = context.Data;
s1.remote_endpoint = endpoint;
s1.md5 = "";
s1.partition = 0;
s1.file_type = 0;
s1.file_path = "";
s1.upgrade_state = reply.Value.Status;
s1.app_version = reply.Value.Version;
CSRedisCacheHelper.Publish("redis-up", Newtonsoft.Json.JsonConvert.SerializeObject(s1));
UploadCurrentVersionReceiver.UP_Grade_Json(updateHostWorker.Host, bbb);
}
else
@@ -196,6 +223,27 @@ namespace RCUHost.Implement
updateHostList.Remove(updateHostWorker);
break;
}
var host = hostUpdateStatus.Host;
string endpoint = context.RemoteEndPoint.ToString();
ShengJi_Log s1 = new ShengJi_Log();
s1.hotel_id = host.SysHotel.Code;
s1.room_id = host.RoomNumber;
s1.device_id = host.HostNumber;
s1.is_send = 0;
s1.udp_raw = context.Data;
s1.remote_endpoint = endpoint;
s1.md5 = "";
s1.partition = 0;
s1.file_type = 0;
s1.file_path = "";
s1.upgrade_state = reply.Value.Status;
s1.app_version = reply.Value.Version;
CSRedisCacheHelper.Publish("redis-up", Newtonsoft.Json.JsonConvert.SerializeObject(s1));
bbb.Upgrade_DateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
UploadCurrentVersionReceiver.UP_Grade_Json(updateHostWorker.Host, bbb);
hostUpdateStatus.UpdatedTime = DateTime.Now;