diff --git a/CRICS_V3_1124.suo b/CRICS_V3_1124.suo index a13dd33..923ba7d 100644 Binary files a/CRICS_V3_1124.suo and b/CRICS_V3_1124.suo differ diff --git a/Common/CSRedisCacheHelper.cs b/Common/CSRedisCacheHelper.cs index e411593..aa110c9 100644 --- a/Common/CSRedisCacheHelper.cs +++ b/Common/CSRedisCacheHelper.cs @@ -20,6 +20,7 @@ namespace Common public static CSRedisClient redis3; public static CSRedisClient redis4; public static CSRedisClient redis5; + public static CSRedisClient redis_webchat; //private static readonly string[] redisHosts = null; private static int SessionExpireMinutes = int.Parse(ConfigurationManager.AppSettings["session_expire_minutes"]); private static int MonitorLogExpireMinutes = int.Parse(ConfigurationManager.AppSettings["monitor_log_expire_minutes"]); @@ -40,6 +41,8 @@ namespace Common static CSRedisCacheHelper() { var redisHostStr = ConfigurationManager.AppSettings["redis_server_session"]; + var webchat_redisstr = ConfigurationManager.AppSettings["webchat_redisstr"]; + var webchat_redis_pwd = ConfigurationManager.AppSettings["webchat_redis_pwd"]; if (!string.IsNullOrEmpty(redisHostStr)) { redis = new CSRedisClient(redisHostStr);//+ ",password=,defaultDatabase=0,poolsize=500,ssl=false,writeBuffer=10240,prefix="); @@ -54,6 +57,8 @@ namespace Common redis4 = new CSRedisClient(redisHostStr + ",password=,defaultDatabase=4"); redis5 = new CSRedisClient(redisHostStr + ",password=,defaultDatabase=5"); + redis5 = new CSRedisClient(redisHostStr + ",password=,defaultDatabase=5"); + redis_webchat = new CSRedisClient(string.Format(webchat_redisstr + ",password={0},defaultDatabase=0",webchat_redis_pwd)); //Native subscribe string channel = "__keyevent@0__:expired"; diff --git a/CommonEntity/CacheKey.cs b/CommonEntity/CacheKey.cs index 02fc64c..18443fe 100644 --- a/CommonEntity/CacheKey.cs +++ b/CommonEntity/CacheKey.cs @@ -120,6 +120,8 @@ namespace CommonEntity public static string FCSRoom_Mapping_Order = "FCS_R_M_O"; public static string KongTiaoAlert = "KT#Alert"; + + public static string WebChatDeviceFault = "WXFault"; } public class ChangLiangValue { diff --git a/Domain/SysHotel.cs b/Domain/SysHotel.cs index fc547f7..153157f 100644 --- a/Domain/SysHotel.cs +++ b/Domain/SysHotel.cs @@ -183,6 +183,15 @@ namespace Domain get; set; } + + /// + /// 背景音乐 + /// + public virtual string WelcomeBGM + { + get; + set; + } /// /// 离房提示:拔卡结束提示语 /// diff --git a/Domain/SysHotel.hbm.xml b/Domain/SysHotel.hbm.xml index 3bec7e0..8c4f94a 100644 --- a/Domain/SysHotel.hbm.xml +++ b/Domain/SysHotel.hbm.xml @@ -25,6 +25,7 @@ + diff --git a/RCUHost/Implement/HostServer.cs b/RCUHost/Implement/HostServer.cs index 2de05c7..d7c67f3 100644 --- a/RCUHost/Implement/HostServer.cs +++ b/RCUHost/Implement/HostServer.cs @@ -887,6 +887,7 @@ namespace RCUHost.Implement //欢迎词 string WelcomeSpeech = host.SysHotel.WelcomeSpeech; + string WelcomeBGM = host.SysHotel.WelcomeBGM; //欢送词 string GoodbyeSpeech = host.SysHotel.GoodbyeSpeech; @@ -1023,21 +1024,31 @@ namespace RCUHost.Implement #region 天猫 if (flag == 1 && !string.IsNullOrEmpty(WelcomeSpeech))//取电打开时,播放欢迎词 { - var TTT = new Tuple(TianMaoCUID, WelcomeSpeech, hotelcode, roomnumber); + var TTT = new Tuple(TianMaoCUID, WelcomeSpeech, hotelcode, roomnumber, WelcomeBGM); 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; foreach (string cuid in a)//多个英文逗号隔开 { - TianMaoOperation.PostWebRequestToTianMao("PushWelcome", - 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("PushWelcome", + Newtonsoft.Json.JsonConvert.SerializeObject(new { HotelId = cuid.Split('&')[0], RoomNo = cuid.Split('&')[1], WelcomeText = b, MusicUrl = ffg }), c, d);//通知天猫精灵播放欢迎词 + } + else + { + 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; @@ -1395,7 +1406,7 @@ namespace RCUHost.Implement //sb.Clear(); //sb.Append(VVV1); //sb.Append(VVV2); - string sb = string.Concat(VVV1,VVV2); + string sb = string.Concat(VVV1, VVV2); string YiJingChuLiGuo = CacheKey.AllReadyDealWith0E_Prefix + "_" + HostNUMBER; object data = MemoryCacheHelper.Get(YiJingChuLiGuo); if (data != null) diff --git a/RCUHost/Implement/RoomStatusReceiver.cs b/RCUHost/Implement/RoomStatusReceiver.cs index 9f0aebe..8c3c06a 100644 --- a/RCUHost/Implement/RoomStatusReceiver.cs +++ b/RCUHost/Implement/RoomStatusReceiver.cs @@ -967,13 +967,26 @@ namespace RCUHost.Implement var a = hhh.TianMaoCUID.Split(','); var b = hhh.SysHotel.WelcomeSpeech; + string bb = hhh.SysHotel.WelcomeBGM; + if (!string.IsNullOrEmpty(bb)) + { + bb = "https://www.boonlive-rcu.com/welcomebgm/" + bb; + } var c = hhh.SysHotel.Code; var d = hhh.RoomNumber; foreach (string cuid in a)//多个英文逗号隔开 { - TianMaoOperation.PostWebRequestToTianMao("PushWelcome", - Newtonsoft.Json.JsonConvert.SerializeObject(new { HotelId = cuid.Split('&')[0], RoomNo = cuid.Split('&')[1], WelcomeText = b }), c, d);//通知天猫精灵播放欢迎词 + if (!string.IsNullOrEmpty(bb)) + { + TianMaoOperation.PostWebRequestToTianMao("PushWelcome", + Newtonsoft.Json.JsonConvert.SerializeObject(new { HotelId = cuid.Split('&')[0], RoomNo = cuid.Split('&')[1], WelcomeText = b, MusicUrl = bb }), c, d);//通知天猫精灵播放欢迎词 + } + else + { + 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/RoomStatusController.cs b/WebSite/Controllers/RoomStatusController.cs index 0f67d94..fadb139 100644 --- a/WebSite/Controllers/RoomStatusController.cs +++ b/WebSite/Controllers/RoomStatusController.cs @@ -374,7 +374,7 @@ namespace WebSite.Controllers { string DKey = string.Format("DKey_{0}_{1}_{2}_{3}", CurrentHotelID, roomnum, "054000001", "054000100"); var ddd = HttpContext.Cache.Get(DKey); - List takeOutdata = null; + List takeOutdata = new List(); if (ddd != null) { takeOutdata = ddd as List; diff --git a/WebSite/Controllers/SysHotelController.cs b/WebSite/Controllers/SysHotelController.cs index f536ea3..e346e87 100644 --- a/WebSite/Controllers/SysHotelController.cs +++ b/WebSite/Controllers/SysHotelController.cs @@ -171,6 +171,67 @@ namespace WebSite.Controllers SaveSystemLog(AuthorityID, action, entity.Name); return Json(new { IsSuccess = true, Message = HttpContext.InnerLanguage("SaveSuccess") }); } + + /// + /// 上传BGM + /// + /// + [Authorize()] + public ActionResult UploadWebcomeBGM() + { + try + { + var sysHotel = SysHotelManager.Get(CurrentHotelID); + + HttpFileCollection hfc = System.Web.HttpContext.Current.Request.Files; + + if (hfc.Count < 1 || hfc[0].ContentLength <= 0 || String.IsNullOrEmpty(hfc[0].FileName)) + { + return Json(new { IsSuccess = false, Message = HttpContext.InnerLanguage("PleaseSelectAuthorizationFile") }); + } + string start_timeddd = DateTime.Now.ToString("yyyyMMddHHmmss"); + string NewFileName = start_timeddd + hfc[0].FileName; + string file = string.Format(Tools.GetApplicationPath() + @"welcomebgm\{0}", NewFileName); + string path = Path.GetDirectoryName(file); + if (!Directory.Exists(path)) + { + Directory.CreateDirectory(path); + } + + hfc[0].SaveAs(file); + + var LLL = HostManager.LoadAll(CurrentHotelID); + foreach (Host item in LLL) + { + Host TakeOut = null; + string HostNumberOnly = item.HostNumber; + string Key = CacheKey.HostInfo_Key_HostNumber + "_" + HostNumberOnly; + object obj = MemoryCacheHelper.Get(Key); + if (obj != null) + { + TakeOut = obj as Host; + TakeOut.SysHotel.WelcomeBGM = NewFileName; + } + } + + sysHotel.WelcomeBGM = NewFileName; + SysHotelManager.Update(sysHotel); + return Json(new { IsSuccess = true, FileName = NewFileName }, JsonRequestBehavior.AllowGet); + } + catch (Exception ex) + { + if (logger.IsErrorEnabled) + { + logger.Error(ex); + } + + return Json(new { IsSuccess = false, Message = ex.Message }, JsonRequestBehavior.AllowGet); + } + + } + + + /// /// 保存第三方对接信息 /// @@ -499,7 +560,7 @@ namespace WebSite.Controllers var T = JsonConvert.DeserializeObject>(reqData); //T.ForEach(A => A.HotelCode = CurrentHotelCode); string GGG = CacheKey.KT_Timer_Controller + "_" + CurrentHotelCode; - CSRedisCacheHelper.Set_PartitionWithForever>(GGG,T,5); + CSRedisCacheHelper.Set_PartitionWithForever>(GGG, T, 5); var client1 = new RestClient(missionsys_address); foreach (var item in T) { diff --git a/WebSite/License/blw-t3s.lic b/WebSite/License/blw-t3s.lic index 5927002..3a5c14e 100644 --- a/WebSite/License/blw-t3s.lic +++ b/WebSite/License/blw-t3s.lic @@ -1 +1 @@ -HP6vcqAL58UjczRRQ7SpqppM9wczrgOic0weey1QcnOwxYcvTnrjb2iqkBsCPfbOxOYezdzkDroujE752nqi5UkychJq0szAj70/q3C0tG5fzXspn9ih9W67FbPxy50NTFAQd97KmH9k0bLIUdgv8rG3zicIc8yKZBkungptRjF8u7TWygG7BU/TuQqWd7xnzwjgIiqu/38AwpbY22XWlTLlsR89SrM682uO41AKBP2NqlUv16f/sfXpsLhJ9wec0dPGjspdpmpbWYIHhETbSzjiBIBI6+ik6fI563PT9HuwSloHJcH7eUan+SBArY4Nr7B+I/mRP+bdSTqBW9OuJgRPtxqDUkfngqkwORHmsA4GNBNDavZAQQ== +HP6vcqAL58UjczRRQ7SpqppM9wczrgOic0weey1QcnOwxYcvTnrjb2iqkBsCPfbOxOYezdzkDroujE752nqi5al/ZAfZmClht3PdyuLcoBy09L1PXHp8fnfXgbAEhvN+VrclVv2W1CCOwhuobej6tFAf4WUYOQf8xJNTJvpm71IXNzGeairfhWwbWVsfXq+9qMrJYNiAEkUaCACHP7jNWxyOjnUv5p1hdcoVfjGmAJdgGhzl3KUwGpuTDQ9s4QqYWF9sN+lae8Xd7E9ueRF0A/eTr2ksTqdqdCIr2TYOxPL+oG+TmYhorTEVuA6DKJSiMGGTSvUILfwjUka9Zva88HB7MxbhqUB3zlYu+uut/vNVjNdSBveYow== diff --git a/WebSite/Resource/en-US.Designer.cs b/WebSite/Resource/en-US.Designer.cs index 929ad18..0d42286 100644 --- a/WebSite/Resource/en-US.Designer.cs +++ b/WebSite/Resource/en-US.Designer.cs @@ -8125,6 +8125,15 @@ namespace WebSite.Resource { } } + /// + /// 查找类似 WelcomeBGM 的本地化字符串。 + /// + internal static string WelcomeBGM { + get { + return ResourceManager.GetString("WelcomeBGM", resourceCulture); + } + } + /// /// 查找类似 Time of Welcome Mode(M) 的本地化字符串。 /// diff --git a/WebSite/Resource/en-US.resx b/WebSite/Resource/en-US.resx index 89a0352..97a47ad 100644 --- a/WebSite/Resource/en-US.resx +++ b/WebSite/Resource/en-US.resx @@ -2896,4 +2896,7 @@ Single circuit status Timed ECO + + WelcomeBGM + \ No newline at end of file diff --git a/WebSite/Resource/zh-CN.Designer.cs b/WebSite/Resource/zh-CN.Designer.cs index 7980e4d..75e96e9 100644 --- a/WebSite/Resource/zh-CN.Designer.cs +++ b/WebSite/Resource/zh-CN.Designer.cs @@ -8133,6 +8133,15 @@ namespace WebSite.Resource { } } + /// + /// 查找类似 欢迎背景乐 的本地化字符串。 + /// + internal static string WelcomeBGM { + get { + return ResourceManager.GetString("WelcomeBGM", resourceCulture); + } + } + /// /// 查找类似 欢迎模式时间(分) 的本地化字符串。 /// diff --git a/WebSite/Resource/zh-CN.resx b/WebSite/Resource/zh-CN.resx index 075431b..c19a4b0 100644 --- a/WebSite/Resource/zh-CN.resx +++ b/WebSite/Resource/zh-CN.resx @@ -2898,4 +2898,7 @@ 定时调温 + + 欢迎背景乐 + \ No newline at end of file diff --git a/WebSite/Resource/zh-TW.Designer.cs b/WebSite/Resource/zh-TW.Designer.cs index 3d5019a..91a72cd 100644 --- a/WebSite/Resource/zh-TW.Designer.cs +++ b/WebSite/Resource/zh-TW.Designer.cs @@ -8135,6 +8135,15 @@ namespace WebSite.Resource { } } + /// + /// 查找类似 歡迎詞背景樂 的本地化字符串。 + /// + internal static string WelcomeBGM { + get { + return ResourceManager.GetString("WelcomeBGM", resourceCulture); + } + } + /// /// 查找类似 歡迎模式時間(分) 的本地化字符串。 /// diff --git a/WebSite/Resource/zh-TW.resx b/WebSite/Resource/zh-TW.resx index 0585757..e7748c0 100644 --- a/WebSite/Resource/zh-TW.resx +++ b/WebSite/Resource/zh-TW.resx @@ -2900,4 +2900,7 @@ 定時調溫 + + 歡迎詞背景樂 + \ No newline at end of file diff --git a/WebSite/Scripts/host-index.js b/WebSite/Scripts/host-index.js index 13dd625..3a6627d 100644 --- a/WebSite/Scripts/host-index.js +++ b/WebSite/Scripts/host-index.js @@ -712,6 +712,28 @@ function dockingInfo() { .dialog({ title: lang.DockingInformation, width: 600, height: 380 }) .dialog("open"); } + +function uploadmusic() +{ + var filename = $("#welcomebgm").val(); + if (filename == "") { + return; + } + $.ajaxFileUpload({ + url: "/SysHotel/UploadWebcomeBGM/", + type: "POST", + secureuri: false, + fileElementId: "welcomebgm", + dataType: "json", + success: function (data) { + + }, + error: function (data, status, e) { + $("#msg").html(e); + } + }); +} + //保存酒店第三方对接信息 function saveDockingInfo() { var form = $("#dialog").find("form"); diff --git a/WebSite/Views/SysHotel/EditDockingInfo.ascx b/WebSite/Views/SysHotel/EditDockingInfo.ascx index a47bd9a..48ea0cc 100644 --- a/WebSite/Views/SysHotel/EditDockingInfo.ascx +++ b/WebSite/Views/SysHotel/EditDockingInfo.ascx @@ -1,4 +1,5 @@ <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> +