From 8ce40171005bcb2af9bf98017128e30530552cc3 Mon Sep 17 00:00:00 2001 From: TianMaiCheng <746290578@qq.com> Date: Fri, 13 Mar 2026 19:28:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=96=B0=E7=9A=84=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CRICS_V3_1124.suo | Bin 12780544 -> 12780544 bytes CommonEntity/LMRegisterInfo.cs | 6 +++--- RCUHost/Implement/HostRegisterReceiver.cs | 12 ++++++++---- RCUHost/Implement/HostServer.cs | 17 +++++++++++++---- Service/Implement/HostModalManager.cs | 17 +++++++++-------- WebSite/Controllers/ApiController.cs | 21 ++++++++++++++++++--- WebSite/Controllers/IoTController.cs | 14 +++++++------- 7 files changed, 58 insertions(+), 29 deletions(-) diff --git a/CRICS_V3_1124.suo b/CRICS_V3_1124.suo index c2e1977d1fa2f8803dea48dc462d72404184a610..4ad139be0f3392e68ac19c654f8475dbe5c1d66a 100644 GIT binary patch delta 1777 zcmYk)dr(wW90%~1TxVCX3<`LG zH}48I%#Jsn4J3Mi^B*{4vkhS6vDs=?mEh*f&Zv`Ol#+SB#i%Ual^Mu?{#RWn$;;*c z6J_@MYL6?;6wmB^YK~Ybvma%7B-i`Y0<-M!tm1af)Dvx_Y7EqR2AMtCRKR*=Ifm=W zCTk)4t}P~kl{c8Cva|*S)Ei7zNvL@gk=YwfIffP3Tj$x&^+pp540Y@Z=$+arR@Kr1sBvHvkl7k!CZ2Lxlo9NP9r|5)FX+c-tp>yiFZZcj4*Ao!Ih#Z^{cu4tz7^zhehW zPyJ;{?EAw%vU%O<(9O)t7F0UiW)tWfDxOp%P$I5;HA&2rWAI!do-43sP8dhY-*tXUa}XeKt%5E95{f zbSQ+^;B}Y*Z@`;S1aHCHFcXSl7R-hcm;>*?T$l&%!h9%&1+Wkn!Fx~! zi(v`ap&Tk;DOAETSP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2NU?aF-6TAy`uo`9DD`sa30)nL1-JlzFYYp?xL3^ diff --git a/CommonEntity/LMRegisterInfo.cs b/CommonEntity/LMRegisterInfo.cs index 6f082a2..79700e4 100644 --- a/CommonEntity/LMRegisterInfo.cs +++ b/CommonEntity/LMRegisterInfo.cs @@ -48,7 +48,7 @@ namespace CommonEntity public string subnet_mask { get; set; } public string gateway { get; set; } public string dns { get; set; } - public string version { get; set; } + public string app_version { get; set; } /// /// RCU 时间,年月日 那种 /// @@ -68,8 +68,8 @@ namespace CommonEntity /// /// 授权时间 /// - public long authorization_time { get; set; } - public long authorization_days { get; set; } + public string authorization_time { get; set; } + public string authorization_days { get; set; } public string room_num_remark { get; set; } public string room_type_remark { get; set; } public string room_remark { get; set; } diff --git a/RCUHost/Implement/HostRegisterReceiver.cs b/RCUHost/Implement/HostRegisterReceiver.cs index 70b21c3..e8ff2dd 100644 --- a/RCUHost/Implement/HostRegisterReceiver.cs +++ b/RCUHost/Implement/HostRegisterReceiver.cs @@ -263,7 +263,7 @@ namespace RCUHost.Implement RegisterInfo rsg = new RegisterInfo() { - ts_ms=Tools.GetUnixTime_MS(), + ts_ms = Tools.GetUnixTime_MS(), hotel_id = hotel_code, room_id = host.RoomNumber, device_id = HostNumberOnly, @@ -276,7 +276,7 @@ namespace RCUHost.Implement subnet_mask = subnet_mask, gateway = gateway, dns = dns, - version = software_version, + app_version = software_version, rcu_time = rcuTime, launcher_version = launcher_version, mac = mac, @@ -285,8 +285,12 @@ namespace RCUHost.Implement room_status = room_status_id, season = hostRCU.Season, sys_lock_status = hostRCU.LockStatus, - authorization_time = set_expiration_time, - authorization_days = expiration_time, + + //hostRCU.ExpireTime = TimeHelper.ToDateTime(expiration_time); + // hostRCU.SetExpireTime = TimeHelper.ToDateTime(set_expiration_time) + //string ti = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); + authorization_time = set_expiration_time.ToString(), + authorization_days = expiration_time.ToString(), room_num_remark = roomnumber, room_type_remark = roomtype, room_remark = room_remark, diff --git a/RCUHost/Implement/HostServer.cs b/RCUHost/Implement/HostServer.cs index 3e0879d..8a3c95a 100644 --- a/RCUHost/Implement/HostServer.cs +++ b/RCUHost/Implement/HostServer.cs @@ -2562,7 +2562,7 @@ namespace RCUHost.Implement { if (fanspeed == 2 || fanspeed == 3) { - string KKKSpec = HostNNN + "_" + address; + string KKKSpec = HostNNN + "_" + address+"_"+HostID; if (status == 1) { string ReportTime111 = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); @@ -2593,6 +2593,18 @@ namespace RCUHost.Implement { string KKey = CacheKey.HostModalStatus_Prefix + "_" + HostID + "_" + address; var HHostModalData = CSRedisCacheHelper.Get_Partition(KKey); + + if (HHostModalData==null) + { + HHostModalData = new HostModal_Cache(); + HHostModalData.HostID = int.Parse(HostID); + HHostModalData.ModalType = DeviceType.AirConditioner; + HHostModalData.AirConditionData = new AirConditionData(); + HHostModalData.Modal = new RoomTypeModalCache() + { + ModalAddress = address + }; + } if (HHostModalData != null) { HHostModalData.AirConditionData.AirStatus = status; @@ -2629,11 +2641,8 @@ namespace RCUHost.Implement } CSRedisCacheHelper.Set_Partition(KKey, HHostModalData); } - - } } - } #endregion } diff --git a/Service/Implement/HostModalManager.cs b/Service/Implement/HostModalManager.cs index af2f21b..07d86aa 100644 --- a/Service/Implement/HostModalManager.cs +++ b/Service/Implement/HostModalManager.cs @@ -126,14 +126,15 @@ namespace Service.Implement device.MusicExecMode = status + (brightness << 12) + (mode << 8);//背景音乐执行方式和内容 //device.ColorTempExecMode = status + (brightness << 12) + (temperature << 8);//色温执行方式和内容 - var t = new Tuple(host, device); - System.Threading.Tasks.Task.Factory.StartNew((state) => - { - var t1 = state as Tuple; - var host1 = t1.Item1; - var device1 = t1.Item2; - DeviceControlReceiver.Send(host1, device1);//发送命令 - }, t, System.Threading.CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default); + DeviceControlReceiver.Send(host, device);//发送命令 + //var t = new Tuple(host, device); + //System.Threading.Tasks.Task.Factory.StartNew((state) => + //{ + // var t1 = state as Tuple; + // var host1 = t1.Item1; + // var device1 = t1.Item2; + // DeviceControlReceiver.Send(host1, device1);//发送命令 + //}, t, System.Threading.CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default); } diff --git a/WebSite/Controllers/ApiController.cs b/WebSite/Controllers/ApiController.cs index e018b46..390c89a 100644 --- a/WebSite/Controllers/ApiController.cs +++ b/WebSite/Controllers/ApiController.cs @@ -6385,6 +6385,9 @@ namespace WebSite.Controllers { try { + //Host hostua = new Host() { HostNumber = "096008126073", MAC = "" }; + //HostModal hostModal1 = new HostModal() { Modal = new RoomTypeModal() { ModalAddress = "007001000", Type = DeviceType.AirConditioner } }; + //HostModalManager.SetDevice(hostua, hostModal1, 0, 0, 25, 0, 1, 0); var dic = CSRedisCacheHelper.HMGetAll(5, CacheKey.JiNan_TongPai_Spec); foreach (var item in dic) @@ -6398,9 +6401,20 @@ namespace WebSite.Controllers if (span.TotalSeconds >= 60 && span.TotalMinutes <= 75) { string[] h_a = k.Split('_'); - Host host = new Host() { HostNumber = h_a[0], MAC = "" }; - HostModal hostModal = new HostModal() { Modal = new RoomTypeModal() { ModalAddress = h_a[1], Type = DeviceType.AirConditioner } }; - HostModalManager.SetDevice(host, hostModal, 0, 0, 0, 0); + + var hostnumber = h_a[0]; + var address = h_a[1]; + var hostid = h_a[2]; + Host host = new Host() { HostNumber = hostnumber, MAC = "" }; + HostModal hostModal = new HostModal() { Modal = new RoomTypeModal() { ModalAddress = address, Type = DeviceType.AirConditioner } }; + + + string KKey = CacheKey.HostModalStatus_Prefix + "_" + hostid + "_" + address; + var HHostModalData = CSRedisCacheHelper.Get_Partition(KKey); + + var temp = HHostModalData.AirConditionData.SettingTemp; + var mode = HHostModalData.AirConditionData.Mode; + HostModalManager.SetDevice(host, hostModal, 0, 0, temp, 0, mode, 0); } } } @@ -6408,6 +6422,7 @@ namespace WebSite.Controllers } catch (Exception ex) { + logger.Error("同派出错:"+ex.Message); return Json(new { IsSuccess = false, Message = HttpContext.InnerLanguage("SaveFailedBecause") + ex.Message }); } } diff --git a/WebSite/Controllers/IoTController.cs b/WebSite/Controllers/IoTController.cs index 3c4a29f..a12f134 100644 --- a/WebSite/Controllers/IoTController.cs +++ b/WebSite/Controllers/IoTController.cs @@ -1576,6 +1576,13 @@ namespace WebSite.Controllers bool wendu1 = KongTiaoControlName.Equals("IncrementTemperatureRequest") || KongTiaoControlName.Equals("IncrementTemperatureRequest") || KongTiaoControlName.Equals("SetTemperatureRequest"); bool fengsu1 = KongTiaoControlName.Equals("SetFanSpeedRequest") || KongTiaoControlName.Equals("IncrementFanSpeedRequest") || KongTiaoControlName.Equals("DecrementFanSpeedRequest"); bool moshi1 = KongTiaoControlName.Equals("SetModeRequest"); + + string tiaowen = request.header.name; + if (tiaowen.Equals("IncrementTemperatureRequest") || tiaowen.Equals("DecrementTemperatureRequest")) + { + HostModalManager.SetDevice(host, hostModal, 1, 0, temperature, 0, 0, 0); + Thread.Sleep(50); + } //特殊酒店 if (AssertFault(hotel_code)) { @@ -1626,13 +1633,6 @@ namespace WebSite.Controllers } else { - - string tiaowen = request.header.name; - if (tiaowen.Equals("IncrementTemperatureRequest") || tiaowen.Equals("DecrementTemperatureRequest")) - { - HostModalManager.SetDevice(host, hostModal, 1, 0); - Thread.Sleep(50); - } //对房间设备进行操作 HostModalManager.SetDevice(host, hostModal, status, brightness, temperature, fanSpeed, mode, valve); }