语音控制 调光的时候,只有开的灯才会调。

This commit is contained in:
2025-12-24 19:41:55 +08:00
parent 53cb2e9239
commit b575adb844
8 changed files with 68 additions and 12 deletions

Binary file not shown.

View File

@@ -33,6 +33,10 @@ namespace Common
//logger.Error("天猫精灵调用的JSON:"+QQQ);
string result = Common.HttpWebRequestHelper.PostWebRequest(apiURL + method, QQQ);
APIResultEntity apiResult = Newtonsoft.Json.JsonConvert.DeserializeObject<APIResultEntity>(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)));

View File

@@ -367,7 +367,7 @@ namespace CommonEntity
if (!string.IsNullOrEmpty(HOSTNUMBER))
{
string CleanTrigger = CacheKey.CleanFCS_TriggerCount + "_" + HOSTNUMBER;
CSRedisCacheHelper.Set_PartitionWithTime<int>(CleanTrigger, 1, 3);
CSRedisCacheHelper.Set_PartitionWithTime<int>(CleanTrigger, 1, 1);
}
}
}

View File

@@ -249,6 +249,8 @@ namespace ConsoleApplication2
}
static void Main(string[] args)
{
var qqqhj = CSRedisCacheHelper.Get_Partition<HostModal_Cache>("HostModalStatusReceiver_13_000000001");
var qq223= JsonConvert.DeserializeObject<HostModal_Cache>(File.ReadAllText("3.txt"));
RedisTest();
Data();
Console.ReadLine();

View File

@@ -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<string, string, string, string, string>(TianMaoCUID, WelcomeSpeech, hotelcode, roomnumber, WelcomeBGM);
var TTT = new Tuple<string, string, string, string, string, int>(TianMaoCUID, WelcomeSpeech, hotelcode, roomnumber, WelcomeBGM, HotelID);
Task.Factory.StartNew((state) =>
{
var hhh = state as Tuple<string, string, string, string, string>;
var hhh = state as Tuple<string, string, string, string, string, int>;
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);//通知天猫精灵播放欢迎词

View File

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

View File

@@ -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<HostModal_Cache>(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<HostModal_Cache>(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;

View File

@@ -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");