diff --git a/CRICS_V3_1124.suo b/CRICS_V3_1124.suo index 1030c1f..4725f48 100644 Binary files a/CRICS_V3_1124.suo and b/CRICS_V3_1124.suo differ diff --git a/WebSite/Controllers/ApiController.cs b/WebSite/Controllers/ApiController.cs index f29592f..b0b6e62 100644 --- a/WebSite/Controllers/ApiController.cs +++ b/WebSite/Controllers/ApiController.cs @@ -890,13 +890,23 @@ namespace WebSite.Controllers else { scene = RoomTypeSceneManager.Get(int.Parse(sceneID)); - HttpContext.Cache.Insert(KKK, scene, null, Cache.NoAbsoluteExpiration, new TimeSpan(0, 30, 0)); + if (scene != null) + { + HttpContext.Cache.Insert(KKK, scene, null, Cache.NoAbsoluteExpiration, new TimeSpan(0, 30, 0)); + } } if (scene == null) { return Json(new { IsSuccess = false, Result = "房号[" + roomNumber + "]无效的场景" }, JsonRequestBehavior.AllowGet); } - LightControlManager.ApplyScene(host, scene); + //LightControlManager.ApplyScene(host, scene); + string repeat = Guid.NewGuid().ToString("N"); + for (int i = 0; i < 3; i++) + { + Thread.Sleep(200); + // LightControlManager.ApplyScene(host, scene); + LightControlManager.ApplyScene_Repeat(repeat, host, scene); + } SaveSystemLog(AuthorityID, HttpContext.InnerLanguage("SceneControl"), string.Format("打开客房{0}{1}场景", roomNumber, scene.Name), true, "api", hotelID); diff --git a/WebSite/Controllers/IoTController.cs b/WebSite/Controllers/IoTController.cs index cb9e801..7dbb2f5 100644 --- a/WebSite/Controllers/IoTController.cs +++ b/WebSite/Controllers/IoTController.cs @@ -4038,6 +4038,10 @@ namespace WebSite.Controllers devicesItem = new Domain.IoTAliGenieEntity.DevicesItem(); devicesItem.number = hostModal.Modal.ModalAddress; devicesItem.deviceName = hostModal.Modal.Name; + if (string.IsNullOrEmpty(hostModal.Modal.Name)) + { + continue; + } if (!string.IsNullOrEmpty(hostModal.Modal.AliasName)) { devicesItem.aliasList = new List(hostModal.Modal.AliasName.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries));//别名不为空才添加 diff --git a/WebSite/Controllers/RoomStatusController.cs b/WebSite/Controllers/RoomStatusController.cs index 9afe869..b251f38 100644 --- a/WebSite/Controllers/RoomStatusController.cs +++ b/WebSite/Controllers/RoomStatusController.cs @@ -423,8 +423,9 @@ namespace WebSite.Controllers roomModel.HostStatus = is_online; roomModel.RoomNumber = room.RoomNumber; - roomModel.RoomStatus = room.RoomStatus; roomModel.LockStatusName = (room.LockStatus == 1 ? HttpContext.InnerLanguage("LockOn") : HttpContext.InnerLanguage("LockOff")); + + roomModel.RoomStatus = room.RoomStatus; if (room.DoorLock)//房门开还是房门关 { roomModel.RoomStatus += "(" + HttpContext.InnerLanguage("DoorOpen") + ")";//"," + roomModel.LockStatusName + @@ -591,13 +592,29 @@ namespace WebSite.Controllers else { services = HostModalManager.Load(room.HostID, DeviceType.ServiceInfo).Where(r => r.Modal.ActiveIndicator).ToList(); - HttpContext.Cache.Insert(KKServiceInfo,services,null,DateTime.Now.AddMinutes(30),Cache.NoSlidingExpiration); + HttpContext.Cache.Insert(KKServiceInfo, services, null, DateTime.Now.AddMinutes(30), Cache.NoSlidingExpiration); } roomModel.Services = new List(); foreach (var service in services) { string ServiceKey = CacheKey.HostModalStatus_Prefix + "_" + hostID + "_" + service.Modal.ModalAddress; var service_cache_data = CSRedisCacheHelper.Get_Partition(ServiceKey); + if (service_cache_data != null) + { + //之前的门磁服务有的时候会错误判断,使用这个,会准确很高 + if (service.Modal.ModalAddress.Equals("004000013")) + { + roomModel.RoomStatus = room.RoomStatus; + if (service_cache_data.Status == 1)//房门开还是房门关 + { + roomModel.RoomStatus += "(" + HttpContext.InnerLanguage("DoorOpen") + ")";//"," + roomModel.LockStatusName + + } + else + { + roomModel.RoomStatus += "(" + HttpContext.InnerLanguage("DoorClose") + ")";//"," + roomModel.LockStatusName + + } + } + } if (service_cache_data != null && service_cache_data.Status == 1) { roomModel.Services.Add(new ServiceModel diff --git a/WebSite/Global.asax.cs b/WebSite/Global.asax.cs index 6e9e1fd..d961b9c 100644 --- a/WebSite/Global.asax.cs +++ b/WebSite/Global.asax.cs @@ -837,14 +837,6 @@ namespace WebSite Context.ApplicationInstance.CompleteRequest(); return; } - // 频率限制(可选) - if (IsMaliciousRequestRate(ip)) - { - Response.StatusCode = 429; // Too Many Requests - Context.ApplicationInstance.CompleteRequest(); - //Response.End(); - return; - } } catch (Exception ex) {