修改一些BUG

BUG1,给天猫上传的设备名字如何为空,天猫就会报错。2 网页上显示的 门开门关,其实本质上是 门磁,现在直接 用门磁的值来表示门开门关
This commit is contained in:
2025-12-31 14:19:59 +08:00
parent f9fe3a36e6
commit 7be877418c
5 changed files with 35 additions and 12 deletions

View File

@@ -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