修改一些BUG
BUG1,给天猫上传的设备名字如何为空,天猫就会报错。2 网页上显示的 门开门关,其实本质上是 门磁,现在直接 用门磁的值来表示门开门关
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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<string>(hostModal.Modal.AliasName.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries));//别名不为空才添加
|
||||
|
||||
@@ -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<ServiceModel>();
|
||||
foreach (var service in services)
|
||||
{
|
||||
string ServiceKey = CacheKey.HostModalStatus_Prefix + "_" + hostID + "_" + service.Modal.ModalAddress;
|
||||
var service_cache_data = CSRedisCacheHelper.Get_Partition<HostModal_Cache>(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
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user