[WebApi]修改燈控排程BUG

This commit is contained in:
張家睿 2024-04-16 15:17:25 +08:00
parent bdb9ffe9de
commit b0a242a431

View File

@ -328,8 +328,7 @@ namespace FrontendWebApi.ApiControllers
} }
var deviceNumList = await backendRepository.GetAllAsync<string>(@$"select d.device_number from schedule_device sd left join device d on sd.device_guid = d.device_guid var deviceNumList = await backendRepository.GetAllAsync<string>(@$"select d.device_number from schedule_device sd left join device d on sd.device_guid = d.device_guid
where light_schedule_guid = ' where light_schedule_guid = '{guid}'");
{guid}'");
var variableObix = await backendRepository.GetAllAsync<KeyValue>("SELECT system_value as Value, system_key as Name FROM variable WHERE deleted = 0 AND system_type = 'obixConfig'"); var variableObix = await backendRepository.GetAllAsync<KeyValue>("SELECT system_value as Value, system_key as Name FROM variable WHERE deleted = 0 AND system_type = 'obixConfig'");
string url = variableObix.Where(x => x.Name == "ApiBase").Select(x => x.Value).FirstOrDefault(); string url = variableObix.Where(x => x.Name == "ApiBase").Select(x => x.Value).FirstOrDefault();
@ -338,7 +337,7 @@ namespace FrontendWebApi.ApiControllers
foreach (var deviceNum in deviceNumList) foreach (var deviceNum in deviceNumList)
{ {
var d = deviceNum.Split("_"); var d = deviceNum.Split("_");
var html = $"{url}/obix/config/Arena/" + $"{d[0]}/{d[1]}/{d[2]}/{d[3]}/{deviceNum}/SSC/set"; var html = $"{url}obix/config/Arena/" + $"{d[0]}/{d[1]}/{d[2]}/{d[3]}/{deviceNum}/SSC/set";
string authInfo = account + ":" + pass; string authInfo = account + ":" + pass;
authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo)); authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo));
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(html); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(html);