diff --git a/CRICS_V3_1124.suo b/CRICS_V3_1124.suo index 0bb6121..71b5e31 100644 Binary files a/CRICS_V3_1124.suo and b/CRICS_V3_1124.suo differ diff --git a/Common/TianMaoOperation.cs b/Common/TianMaoOperation.cs index 1f0eeca..94d9d3c 100644 --- a/Common/TianMaoOperation.cs +++ b/Common/TianMaoOperation.cs @@ -33,6 +33,10 @@ namespace Common //logger.Error("天猫精灵调用的JSON:"+QQQ); string result = Common.HttpWebRequestHelper.PostWebRequest(apiURL + method, QQQ); APIResultEntity apiResult = Newtonsoft.Json.JsonConvert.DeserializeObject(result); + if (method.Equals("AddOrUpdateWelcomeText")) + { + //logger.Error("天猫结果为:"+Newtonsoft.Json.JsonConvert.SerializeObject(apiResult)); + } if (!apiResult.result) { logger.Error(string.Format("酒店({0})客房({1})上报天猫精灵接口({2}),结果:{3},数据:{4}", hotelCode, roomNumber, method, result, Newtonsoft.Json.JsonConvert.SerializeObject(jsonData))); diff --git a/CommonEntity/FCS.cs b/CommonEntity/FCS.cs index 7e45ba1..5e809ab 100644 --- a/CommonEntity/FCS.cs +++ b/CommonEntity/FCS.cs @@ -367,7 +367,7 @@ namespace CommonEntity if (!string.IsNullOrEmpty(HOSTNUMBER)) { string CleanTrigger = CacheKey.CleanFCS_TriggerCount + "_" + HOSTNUMBER; - CSRedisCacheHelper.Set_PartitionWithTime(CleanTrigger, 1, 3); + CSRedisCacheHelper.Set_PartitionWithTime(CleanTrigger, 1, 1); } } } diff --git a/ConsoleApplication2/Program.cs b/ConsoleApplication2/Program.cs index 1c0c263..b9280bf 100644 --- a/ConsoleApplication2/Program.cs +++ b/ConsoleApplication2/Program.cs @@ -249,6 +249,8 @@ namespace ConsoleApplication2 } static void Main(string[] args) { + var qqqhj = CSRedisCacheHelper.Get_Partition("HostModalStatusReceiver_13_000000001"); + var qq223= JsonConvert.DeserializeObject(File.ReadAllText("3.txt")); RedisTest(); Data(); Console.ReadLine(); diff --git a/RCUHost/Implement/HostServer.cs b/RCUHost/Implement/HostServer.cs index 2ee0457..d996270 100644 --- a/RCUHost/Implement/HostServer.cs +++ b/RCUHost/Implement/HostServer.cs @@ -892,6 +892,8 @@ namespace RCUHost.Implement //欢送词 string GoodbyeSpeech = host.SysHotel.GoodbyeSpeech; + int HotelID = host.SysHotel.ID; + //断电重置 bool IsPowerOffResetXiaoDu = host.SysHotel.IsPowerOffResetXiaoDu; @@ -1024,17 +1026,18 @@ namespace RCUHost.Implement #region 天猫 if (flag == 1 && !string.IsNullOrEmpty(WelcomeSpeech))//取电打开时,播放欢迎词 { - var TTT = new Tuple(TianMaoCUID, WelcomeSpeech, hotelcode, roomnumber, WelcomeBGM); + var TTT = new Tuple(TianMaoCUID, WelcomeSpeech, hotelcode, roomnumber, WelcomeBGM, HotelID); Task.Factory.StartNew((state) => { - var hhh = state as Tuple; + var hhh = state as Tuple; var a = hhh.Item1.Split(','); var b = hhh.Item2; var c = hhh.Item3; var d = hhh.Item4; var e = hhh.Item5; + var f = hhh.Item6; foreach (string cuid in a)//多个英文逗号隔开 { @@ -1050,6 +1053,12 @@ namespace RCUHost.Implement // Newtonsoft.Json.JsonConvert.SerializeObject(new { HotelId = cuid.Split('&')[0], RoomNo = cuid.Split('&')[1], WelcomeText = b }), c, d);//通知天猫精灵播放欢迎词 //} + if (!string.IsNullOrEmpty(e)) + { + string ffg = "https://www.boonlive-rcu.com/welcomebgm/" + e; + TianMaoOperation.PostWebRequestToTianMao("AddOrUpdateWelcomeText", + Newtonsoft.Json.JsonConvert.SerializeObject(new { HotelId = cuid.Split('&')[0], MusicUrl = ffg, WelcomeText = b }), c, d);//通知天猫精灵播放欢迎词 + } TianMaoOperation.PostWebRequestToTianMao("PushWelcome", Newtonsoft.Json.JsonConvert.SerializeObject(new { HotelId = cuid.Split('&')[0], RoomNo = cuid.Split('&')[1], WelcomeText = b }), c, d);//通知天猫精灵播放欢迎词 diff --git a/RCUHost/Implement/RoomStatusReceiver.cs b/RCUHost/Implement/RoomStatusReceiver.cs index d183ccf..8b84ebc 100644 --- a/RCUHost/Implement/RoomStatusReceiver.cs +++ b/RCUHost/Implement/RoomStatusReceiver.cs @@ -974,6 +974,7 @@ namespace RCUHost.Implement //} var c = hhh.SysHotel.Code; var d = hhh.RoomNumber; + var hotelid = hhh.SysHotel.ID; foreach (string cuid in a)//多个英文逗号隔开 { @@ -987,9 +988,15 @@ namespace RCUHost.Implement // TianMaoOperation.PostWebRequestToTianMao("PushWelcome", // Newtonsoft.Json.JsonConvert.SerializeObject(new { HotelId = cuid.Split('&')[0], RoomNo = cuid.Split('&')[1], WelcomeText = b }), c, d);//通知天猫精灵播放欢迎词 //} + if (!string.IsNullOrEmpty(bb)) + { + string ffg = "https://www.boonlive-rcu.com/welcomebgm/" + bb; + TianMaoOperation.PostWebRequestToTianMao("AddOrUpdateWelcomeText", + Newtonsoft.Json.JsonConvert.SerializeObject(new { HotelId = cuid.Split('&')[0], MusicUrl = ffg, WelcomeText = b }), c, d);//通知天猫精灵播放欢迎词 + } - TianMaoOperation.PostWebRequestToTianMao("PushWelcome", - Newtonsoft.Json.JsonConvert.SerializeObject(new { HotelId = cuid.Split('&')[0], RoomNo = cuid.Split('&')[1], WelcomeText = b }), c, d);//通知天猫精灵播放欢迎词 + TianMaoOperation.PostWebRequestToTianMao("PushWelcome", + Newtonsoft.Json.JsonConvert.SerializeObject(new { HotelId = cuid.Split('&')[0], RoomNo = cuid.Split('&')[1], WelcomeText = b }), c, d);//通知天猫精灵播放欢迎词 Interface3Log w1 = new Interface3Log(); w1.HotelCode = c; diff --git a/WebSite/Controllers/IoTController.cs b/WebSite/Controllers/IoTController.cs index 07dd5ca..9bc18b5 100644 --- a/WebSite/Controllers/IoTController.cs +++ b/WebSite/Controllers/IoTController.cs @@ -666,6 +666,8 @@ namespace WebSite.Controllers device.AddressType = RCUHost.Protocols.AddressType.DeviceAddress; device.Type = hostModal.Modal.Type; + string KKey = CacheKey.HostModalStatus_Prefix + "_" + host.ID.ToString() + "_" + device.Address; + var hostModal_T = CSRedisCacheHelper.Get_Partition(KKey); switch (request.header.name) { case "TurnOnRequest"://打开 @@ -683,6 +685,11 @@ namespace WebSite.Controllers payload.previousState = previousState; break; case "SetBrightnessPercentageRequest"://设置亮度 + if (hotel_code == 1085 || hotel_code == 1001 || hotel_code == 1003 || hotel_code > 2000) + { + //logger.Error("查询的Key值:"+KKey); + if (hostModal_T != null && hostModal_T.Status == 2) { continue; } + } confirmationName = "SetBrightnessPercentageConfirmation"; status = 1; brightness = Convert.ToInt16(request.payload.brightness.value); @@ -690,6 +697,10 @@ namespace WebSite.Controllers payload.previousState = previousState; break; case "IncrementBrightnessPercentageRequest"://调亮 + if (hotel_code == 1085 || hotel_code == 1001 || hotel_code == 1003 || hotel_code > 2000) + { + if (hostModal_T != null && hostModal_T.Status == 2) { continue; } + } confirmationName = "IncrementBrightnessPercentageConfirmation"; status = 1; brightness += Convert.ToInt16(request.payload.deltaPercentage.value); @@ -701,7 +712,10 @@ namespace WebSite.Controllers payload.previousState = previousState; break; case "DecrementBrightnessPercentageRequest"://调暗 - if (hostModal.Status == 2) { continue; } + if (hotel_code == 1085 || hotel_code == 1001 || hotel_code == 1003 || hotel_code > 2000) + { + if (hostModal_T != null && hostModal_T.Status == 2) { continue; } + } confirmationName = "DecrementBrightnessPercentageConfirmation"; status = 1; brightness -= Convert.ToInt16(request.payload.deltaPercentage.value); @@ -4329,6 +4343,14 @@ namespace WebSite.Controllers } break; case "DimmingLight"://调光 + string KKey = CacheKey.HostModalStatus_Prefix + "_" + host.ID.ToString() + "_" + device.Address; + var hostModal_T = CSRedisCacheHelper.Get_Partition(KKey); + + if (co == 1085 || co == 1001 || co == 1003 || co > 2000) + { + //logger.Error("查询的Key值:"+KKey); + if (hostModal_T != null && hostModal_T.Status == 2) { continue; } + } if (devicesItem.value.HasValue) { switch (devicesItem.value) @@ -4345,6 +4367,7 @@ namespace WebSite.Controllers break; } } + if (devicesItem.value_up.HasValue) { status = 1; diff --git a/WebSite/Controllers/SysHotelController.cs b/WebSite/Controllers/SysHotelController.cs index a9c9c5d..c54d6dd 100644 --- a/WebSite/Controllers/SysHotelController.cs +++ b/WebSite/Controllers/SysHotelController.cs @@ -240,7 +240,16 @@ namespace WebSite.Controllers try { var sysHotel = SysHotelManager.Get(CurrentHotelID); + string vvv = sysHotel.WelcomeBGM; sysHotel.WelcomeBGM = ""; + + string file = string.Format(Tools.GetApplicationPath() + @"welcomebgm\{0}", vvv); + string path = Path.GetDirectoryName(file); + if (Directory.Exists(path)) + { + System.IO.File.Delete(path); + } + SysHotelManager.Update(sysHotel); return Json(new { IsSuccess = true }, JsonRequestBehavior.AllowGet); } @@ -300,12 +309,14 @@ namespace WebSite.Controllers //sysHotel.TCLAppSecret = entity.TCLAppSecret; SysHotelManager.Update(sysHotel); - if (!string.IsNullOrEmpty(entity.WelcomeBGM)) - { - string ffg = "https://www.boonlive-rcu.com/welcomebgm/" + entity.WelcomeBGM; - TianMaoOperation.PostWebRequestToTianMao("AddOrUpdateWelcomeText", - Newtonsoft.Json.JsonConvert.SerializeObject(new { HotelId = CurrentHotelID, MusicUrl = ffg, WelcomeText = entity.WelcomeSpeech }), CurrentHotelCode, "");//通知天猫精灵播放欢迎词 - } + //if (!string.IsNullOrEmpty(entity.WelcomeBGM)) + //{ + // //string hotelid111=entity. .Split('&')[0], + // //string RoomNo = cuid.Split('&')[1]; + // string ffg = "https://www.boonlive-rcu.com/welcomebgm/" + entity.WelcomeBGM; + // TianMaoOperation.PostWebRequestToTianMao("AddOrUpdateWelcomeText", + // Newtonsoft.Json.JsonConvert.SerializeObject(new { HotelId = CurrentHotelID, MusicUrl = ffg, WelcomeText = entity.WelcomeSpeech }), CurrentHotelCode, "");//通知天猫精灵播放欢迎词 + //} if (sysHotel.IsUseQianLiMa) { QianLiMa_PMS.QiYong(sysHotel.Code, "add");