diff --git a/CRICS_V3_1124.suo b/CRICS_V3_1124.suo index f5de050..4d330e2 100644 Binary files a/CRICS_V3_1124.suo and b/CRICS_V3_1124.suo differ diff --git a/CommonEntity/HostModal_Cache.cs b/CommonEntity/HostModal_Cache.cs index 52beba0..b295427 100644 --- a/CommonEntity/HostModal_Cache.cs +++ b/CommonEntity/HostModal_Cache.cs @@ -84,6 +84,18 @@ namespace CommonEntity public int Time { get; set; } public DateTime? UpdateTime { get; set; } + public AirConditionData() + { + this.AirStatus=2; + this.FanSpeed=0; + this.Mode=0; + this.Valve=0; + this.CurrentTemp = 25; + this.SettingTemp = 25; + this.Valve = 0; + this.Time = 0; + this.UpdateTime=DateTime.Now; + } } public class RoomTypeModalCache diff --git a/RCUHost/Implement/HostServer.cs b/RCUHost/Implement/HostServer.cs index 01f7a24..bd7f0dd 100644 --- a/RCUHost/Implement/HostServer.cs +++ b/RCUHost/Implement/HostServer.cs @@ -1250,11 +1250,11 @@ namespace RCUHost.Implement o.EndPoint = EndPointStr; //新来的数据 var n = Newtonsoft.Json.JsonConvert.SerializeObject(o); - CSRedisCacheHelper.Set_PartitionWithTime(EndPointStr, n, 5, 4); //上线 - string EEE = CSRedisCacheHelper.Get(EndPointStr); + //string EEE = CSRedisCacheHelper.Get(EndPointStr); + var EEE = CSRedisCacheHelper.Get_Partition(EndPointStr, 4); var dtstart = CSRedisCacheHelper.ForeverGet(CacheKey.ServerStartTime); DateTime SSS = DateTime.Now; DateTime.TryParse(dtstart, out SSS); @@ -1263,6 +1263,7 @@ namespace RCUHost.Implement { CSRedisCacheHelper.Publish("redis-on_off_line", n); } + CSRedisCacheHelper.Set_PartitionWithTime(EndPointStr, n, 5, 4); @@ -1963,6 +1964,10 @@ namespace RCUHost.Implement 是否取电 = false; } } + else + { + + } } } @@ -1982,10 +1987,10 @@ namespace RCUHost.Implement //0x07:短暂人离事件 //0x08:长时间人离事件 var NOCardInfo = reader.ReadByte(); - + var NOCardInfo_NoFilter = NOCardInfo; if (!nocard_enum.Contains(NOCardInfo)) { - NOCardInfo = 0x00; + NOCardInfo = 0x00; } #region BUG处理 //只有同派酒店做这个处理 @@ -2004,13 +2009,15 @@ namespace RCUHost.Implement BitArray bitlist = new BitArray(N); #region 服务信息 + int iii = 0; for (int i = 0; i < bitlist.Length; i++) { - if (i == 1) - { - continue; - } - string SerNo = i.ToString("000"); + iii = i + 1; + //if (i == 1) + //{ + // continue; + //} + string SerNo = iii.ToString("000"); //界面上显示,为了 兼容老版的 界面 显示逻辑,所以这样写 if (!string.IsNullOrEmpty(HostID)) @@ -2028,6 +2035,24 @@ namespace RCUHost.Implement OldHostModal.Status = 2; } } + else + { + HostModal_Cache ccc = new HostModal_Cache(); + ccc.HostID = int.Parse(HostID); + ccc.ModalType = DeviceType.ServiceInfo; + if (bitlist[i]) + { + ccc.Status = 1; + } + else + { + ccc.Status = 2; + } + ccc.UpdateTime = DateTime.Now; + ccc.Modal = new RoomTypeModalCache() { }; + ccc.AirConditionData = new AirConditionData(); + CSRedisCacheHelper.Set_Partition(KKey,ccc); + } } //var hostModal1 = CSRedisCacheHelper.HMGet(1, QUDIANKey, "004000" + SerNo); @@ -2095,6 +2120,7 @@ namespace RCUHost.Implement //碳达人 var CarbonVIP = reader.ReadByte(); + var CarbonVIP_NoFilter = CarbonVIP; byte[] carbon_enum = new byte[] { 0x01, 0x02 }; if (!carbon_enum.Contains(CarbonVIP)) { @@ -2291,6 +2317,7 @@ namespace RCUHost.Implement #endregion } + #region 给宝镜推送的数据 long tf0 = Tools.GetUnixTime(); NengHao4BaoJing ns2 = new NengHao4BaoJing() { @@ -2320,6 +2347,7 @@ namespace RCUHost.Implement string mns = Newtonsoft.Json.JsonConvert.SerializeObject(ns2); CSRedisCacheHelper.Publish("redis-power", mns); + #endregion #region TSlog @@ -2330,15 +2358,15 @@ namespace RCUHost.Implement device_id = HostNNN, ip = EndPoint, power_state = 是否取电_Int, - cardless_state = Convert.ToUInt16(NOCardInfo), + cardless_state = Convert.ToUInt16(NOCardInfo_NoFilter), guest_type = Convert.ToUInt16(IdentityInfo), service_mask = BitConverter.ToUInt64(N, 0), pms_state = Convert.ToUInt16(PMS), - carbon_state = Convert.ToUInt16(CarbonVIP), + carbon_state = Convert.ToUInt16(CarbonVIP_NoFilter), device_count = DeviceCount_I, comm_seq = MyFrameNO, - electricity=nenghaoList1, - air_conditioner=kongtiaoList, + electricity = nenghaoList1, + air_conditioner = kongtiaoList, extra = new extra_data() { original_byte = OriginalByte diff --git a/RCUHost/Implement/New_RoomStatusReceiver.cs b/RCUHost/Implement/New_RoomStatusReceiver.cs index 9a4368c..0adefdb 100644 --- a/RCUHost/Implement/New_RoomStatusReceiver.cs +++ b/RCUHost/Implement/New_RoomStatusReceiver.cs @@ -399,7 +399,14 @@ namespace RCUHost.Implement var hostModal = CSRedisCacheHelper.Get_Partition(KKey); if (hostModal != null) { - + if (hostModal.AirConditionData==null) + { + hostModal.AirConditionData = new AirConditionData(); + } + if (hostModal.Modal==null) + { + hostModal.Modal = new RoomTypeModalCache() { ModalAddress=device.Value.Address}; + } } else { diff --git a/WebSite/Controllers/ApiController.cs b/WebSite/Controllers/ApiController.cs index 3463010..07201fb 100644 --- a/WebSite/Controllers/ApiController.cs +++ b/WebSite/Controllers/ApiController.cs @@ -3833,29 +3833,31 @@ namespace WebSite.Controllers { try { - string b = Request.Form["roomTypeID"].ToString(); - if (string.IsNullOrEmpty(b)) - { - return Json(new { IsSuccess = false, Data = "roomTypeID不能为空" }); - } + //1412 + //固件:BLV-V9 || Launcher_C1F_V04 || C1F_A_L4_31_240723_NM.bin + //100331-YHF_T + //YHF_T - string host_list_str = Request.Form["hostid_lists"].ToString(); - string fileName = Request.Form["upgradefileName"].ToString(); + //2438 + //研发测试房型_1 + //固件:BLV-C5 || Launcher_C1F_V04 || C1F_A_L4_41_250605_NM.bin + string roomTypeID = "1412"; + string host_list_str = "[24540]"; + //string fileName = "C1F_A_L4_41_250704_NM.bin"; + string fileName = "C1F_A_L4_31_240723_NM.bin"; - if (string.IsNullOrEmpty(host_list_str)) - { - return Json(new { IsSuccess = false, Data = "hostid_lists不能为空" }); - } - ReallyUpgrade(b, host_list_str, fileName); + ReallyUpgrade(roomTypeID, host_list_str, fileName); return Json(new { IsSuccess = true, Data = "正在升级,请等待……" }); } catch (Exception ex) { + logger.Error("定时升级出错:"+ex.Message); return Json(new { IsSuccess = false, Data = ex.Message }); } } + private void ReallyUpgrade(string 房型ID, string host_list_str, string fileName) { int roomTypeID = 0; @@ -3871,7 +3873,7 @@ namespace WebSite.Controllers HostUpdateController hh = new HostUpdateController(); logger.Error("开始升级: " + fileName + " host_list: " + lll); //升级 - hh.ShengJI_NEW(host_list, fileName, HostManager); + hh.ShengJI_NEW(host_list, fileName, HostManager,roomTypeID); } [HttpPost()] diff --git a/WebSite/Controllers/HostUpdateController.cs b/WebSite/Controllers/HostUpdateController.cs index cd18846..00e04b3 100644 --- a/WebSite/Controllers/HostUpdateController.cs +++ b/WebSite/Controllers/HostUpdateController.cs @@ -384,7 +384,7 @@ namespace WebSite.Controllers } - public ActionResult ShengJI_NEW(IList idList, string fileName, IHostManager HostManager1) + public ActionResult ShengJI_NEW(IList idList, string fileName, IHostManager HostManager1,int RoomTypeID) { try { @@ -410,7 +410,8 @@ namespace WebSite.Controllers default: return Json(new { IsSuccess = false, Message = "升级文件不合法!" }); } - string fileHref = "Uploads/room_type/" + hosts[hosts.Count - 1].RoomType.ID + "/" + fileName;//升级文件相对路径 + //string fileHref = "Uploads/room_type/" + hosts[hosts.Count - 1].RoomType.ID + "/" + fileName;//升级文件相对路径 + string fileHref = "Uploads/room_type/" + RoomTypeID + "/" + fileName;//升级文件相对路径 string fileMd5 = ""; using (Stream stream = System.IO.File.Open(Tools.GetApplicationPath() + fileHref, FileMode.Open)) { diff --git a/WebSite/HTMLPage1.htm b/WebSite/HTMLPage1.htm new file mode 100644 index 0000000..57b8a55 --- /dev/null +++ b/WebSite/HTMLPage1.htm @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/WebSite/WebSite.csproj b/WebSite/WebSite.csproj index 15557f6..d4426fe 100644 --- a/WebSite/WebSite.csproj +++ b/WebSite/WebSite.csproj @@ -841,6 +841,7 @@ +