[後端] 處理字串
This commit is contained in:
parent
65230a579c
commit
81996a1ada
@ -162,7 +162,7 @@ namespace BackendWorkerService.Quartz.Jobs
|
||||
{
|
||||
device_number = deviceNumberPoint.FullDeviceNumberPoint;
|
||||
var station = buildingStation.Where(x => x.system_key == deviceNumberPoint.DeviceNumber.Split("_")[1]).Select(x => x.system_value).FirstOrDefault();
|
||||
archiveRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{deviceNumberPoint.FullDeviceNumberPoint}/~historyRollup/");
|
||||
archiveRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{deviceNumberPoint.FullDeviceNumberPoint.Replace("$3", "")}/~historyRollup/");
|
||||
//HttpWebRequest archiveDayRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/H_E1_B1F_MVCB_MVCBH_V1/~historyRollup/");
|
||||
archiveRequest.Method = "POST";
|
||||
archiveRequest.Headers.Add("Authorization", "Basic " + encoded);
|
||||
@ -220,7 +220,7 @@ namespace BackendWorkerService.Quartz.Jobs
|
||||
{
|
||||
device_number = deviceNumberPoint.FullDeviceNumberPoint;
|
||||
var station = buildingStation.Where(x => x.system_key == deviceNumberPoint.DeviceNumber.Split("_")[1]).Select(x => x.system_value).FirstOrDefault();
|
||||
archiveRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{deviceNumberPoint.FullDeviceNumberPoint}/~historyRollup/");
|
||||
archiveRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{deviceNumberPoint.FullDeviceNumberPoint.Replace("$3", "")}/~historyRollup/");
|
||||
//HttpWebRequest archiveDayRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/H_E1_B1F_MVCB_MVCBH_V1/~historyRollup/");
|
||||
archiveRequest.Method = "POST";
|
||||
archiveRequest.Headers.Add("Authorization", "Basic " + encoded);
|
||||
@ -633,7 +633,7 @@ namespace BackendWorkerService.Quartz.Jobs
|
||||
{
|
||||
device_number = deviceNumberPoint.FullDeviceNumberPoint;
|
||||
var station = buildingStation.Where(x => x.system_key == deviceNumberPoint.DeviceNumber.Split("_")[1]).Select(x => x.system_value).FirstOrDefault();
|
||||
archiveRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{deviceNumberPoint.FullDeviceNumberPoint}/~historyRollup/");
|
||||
archiveRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{deviceNumberPoint.FullDeviceNumberPoint.Replace("$3", "")}/~historyRollup/");
|
||||
//HttpWebRequest archiveWeekRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/H_E1_B1F_MVCB_MVCBH_V1/~historyRollup/");
|
||||
archiveRequest.Method = "POST";
|
||||
archiveRequest.Headers.Add("Authorization", "Basic " + encoded);
|
||||
@ -692,7 +692,7 @@ namespace BackendWorkerService.Quartz.Jobs
|
||||
{
|
||||
device_number = deviceNumberPoint.FullDeviceNumberPoint;
|
||||
var station = buildingStation.Where(x => x.system_key == deviceNumberPoint.DeviceNumber.Split("_")[1]).Select(x => x.system_value).FirstOrDefault();
|
||||
archiveRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{deviceNumberPoint.FullDeviceNumberPoint}/~historyRollup/");
|
||||
archiveRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{deviceNumberPoint.FullDeviceNumberPoint.Replace("$3", "")}/~historyRollup/");
|
||||
//HttpWebRequest archiveWeekRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/H_E1_B1F_MVCB_MVCBH_V1/~historyRollup/");
|
||||
archiveRequest.Method = "POST";
|
||||
archiveRequest.Headers.Add("Authorization", "Basic " + encoded);
|
||||
@ -1002,7 +1002,7 @@ namespace BackendWorkerService.Quartz.Jobs
|
||||
{
|
||||
device_number = deviceNumberPoint.FullDeviceNumberPoint;
|
||||
var station = buildingStation.Where(x => x.system_key == deviceNumberPoint.DeviceNumber.Split("_")[1]).Select(x => x.system_value).FirstOrDefault();
|
||||
archiveRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{deviceNumberPoint.FullDeviceNumberPoint}/~historyRollup/");
|
||||
archiveRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{deviceNumberPoint.FullDeviceNumberPoint.Replace("$3", "")}/~historyRollup/");
|
||||
//HttpWebRequest archiveMonthRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/H_E1_B1F_MVCB_MVCBH_V1/~historyRollup/");
|
||||
archiveRequest.Method = "POST";
|
||||
archiveRequest.Headers.Add("Authorization", "Basic " + encoded);
|
||||
@ -1060,7 +1060,7 @@ namespace BackendWorkerService.Quartz.Jobs
|
||||
{
|
||||
device_number = deviceNumberPoint.FullDeviceNumberPoint;
|
||||
var station = buildingStation.Where(x => x.system_key == deviceNumberPoint.DeviceNumber.Split("_")[1]).Select(x => x.system_value).FirstOrDefault();
|
||||
archiveRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{deviceNumberPoint.FullDeviceNumberPoint}/~historyRollup/");
|
||||
archiveRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{deviceNumberPoint.FullDeviceNumberPoint.Replace("$3", "")}/~historyRollup/");
|
||||
//HttpWebRequest archiveMonthRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/H_E1_B1F_MVCB_MVCBH_V1/~historyRollup/");
|
||||
archiveRequest.Method = "POST";
|
||||
archiveRequest.Headers.Add("Authorization", "Basic " + encoded);
|
||||
|
@ -189,7 +189,7 @@ namespace BackendWorkerService.Services.Implement
|
||||
// <reltime name='interval' val = 'PT1H' />
|
||||
// </obj>";
|
||||
|
||||
// HttpWebRequest archiveHourRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{deviceNumberPoint.FullDeviceNumberPoint}/~historyRollup/");
|
||||
// HttpWebRequest archiveHourRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{deviceNumberPoint.FullDeviceNumberPoint.Replace("$3", "")}/~historyRollup/");
|
||||
// //HttpWebRequest archiveHourRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/H_E1_B1F_MVCB_MVCBH_V1/~historyRollup/");
|
||||
// archiveHourRequest.Method = "POST";
|
||||
// archiveHourRequest.Headers.Add("Authorization", "Basic " + encoded);
|
||||
@ -281,7 +281,7 @@ namespace BackendWorkerService.Services.Implement
|
||||
</obj>";
|
||||
|
||||
var station = buildingStation.Where(x => x.system_key == deviceNumberPoint.DeviceNumber.Split("_")[1]).Select(x => x.system_value).FirstOrDefault();
|
||||
HttpWebRequest archiveDayRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{deviceNumberPoint.FullDeviceNumberPoint}/~historyRollup/");
|
||||
HttpWebRequest archiveDayRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{deviceNumberPoint.FullDeviceNumberPoint.Replace("$3", "")}/~historyRollup/");
|
||||
//HttpWebRequest archiveDayRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/H_E1_B1F_MVCB_MVCBH_V1/~historyRollup/");
|
||||
archiveDayRequest.Method = "POST";
|
||||
archiveDayRequest.Headers.Add("Authorization", "Basic " + encoded);
|
||||
@ -372,7 +372,7 @@ namespace BackendWorkerService.Services.Implement
|
||||
</obj>";
|
||||
|
||||
var station = buildingStation.Where(x => x.system_key == deviceNumberPoint.DeviceNumber.Split("_")[1]).Select(x => x.system_value).FirstOrDefault();
|
||||
HttpWebRequest archiveDayRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{deviceNumberPoint.FullDeviceNumberPoint}/~historyRollup/");
|
||||
HttpWebRequest archiveDayRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{deviceNumberPoint.FullDeviceNumberPoint.Replace("$3", "")}/~historyRollup/");
|
||||
//HttpWebRequest archiveDayRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/H_E1_B1F_MVCB_MVCBH_V1/~historyRollup/");
|
||||
archiveDayRequest.Method = "POST";
|
||||
archiveDayRequest.Headers.Add("Authorization", "Basic " + encoded);
|
||||
@ -461,7 +461,7 @@ namespace BackendWorkerService.Services.Implement
|
||||
</obj>";
|
||||
|
||||
var station = buildingStation.Where(x => x.system_key == deviceNumberPoint.DeviceNumber.Split("_")[1]).Select(x => x.system_value).FirstOrDefault();
|
||||
HttpWebRequest archiveWeekRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{deviceNumberPoint.FullDeviceNumberPoint}/~historyRollup/");
|
||||
HttpWebRequest archiveWeekRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{deviceNumberPoint.FullDeviceNumberPoint.Replace("$3", "")}/~historyRollup/");
|
||||
//HttpWebRequest archiveWeekRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/H_E1_B1F_MVCB_MVCBH_V1/~historyRollup/");
|
||||
archiveWeekRequest.Method = "POST";
|
||||
archiveWeekRequest.Headers.Add("Authorization", "Basic " + encoded);
|
||||
@ -546,7 +546,7 @@ namespace BackendWorkerService.Services.Implement
|
||||
</obj>";
|
||||
|
||||
var station = buildingStation.Where(x => x.system_key == deviceNumberPoint.DeviceNumber.Split("_")[1]).Select(x => x.system_value).FirstOrDefault();
|
||||
HttpWebRequest archiveWeekRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{deviceNumberPoint.FullDeviceNumberPoint}/~historyRollup/");
|
||||
HttpWebRequest archiveWeekRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{deviceNumberPoint.FullDeviceNumberPoint.Replace("$3", "")}/~historyRollup/");
|
||||
//HttpWebRequest archiveWeekRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/H_E1_B1F_MVCB_MVCBH_V1/~historyRollup/");
|
||||
archiveWeekRequest.Method = "POST";
|
||||
archiveWeekRequest.Headers.Add("Authorization", "Basic " + encoded);
|
||||
@ -637,7 +637,7 @@ namespace BackendWorkerService.Services.Implement
|
||||
</obj>";
|
||||
|
||||
var station = buildingStation.Where(x => x.system_key == deviceNumberPoint.DeviceNumber.Split("_")[1]).Select(x => x.system_value).FirstOrDefault();
|
||||
HttpWebRequest archiveMonthRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{deviceNumberPoint.FullDeviceNumberPoint}/~historyRollup/");
|
||||
HttpWebRequest archiveMonthRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{deviceNumberPoint.FullDeviceNumberPoint.Replace("$3", "")}/~historyRollup/");
|
||||
//HttpWebRequest archiveMonthRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/H_E1_B1F_MVCB_MVCBH_V1/~historyRollup/");
|
||||
archiveMonthRequest.Method = "POST";
|
||||
archiveMonthRequest.Headers.Add("Authorization", "Basic " + encoded);
|
||||
@ -725,7 +725,7 @@ namespace BackendWorkerService.Services.Implement
|
||||
</obj>";
|
||||
|
||||
var station = buildingStation.Where(x => x.system_key == deviceNumberPoint.DeviceNumber.Split("_")[1]).Select(x => x.system_value).FirstOrDefault();
|
||||
HttpWebRequest archiveMonthRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{deviceNumberPoint.FullDeviceNumberPoint}/~historyRollup/");
|
||||
HttpWebRequest archiveMonthRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{deviceNumberPoint.FullDeviceNumberPoint.Replace("$3", "")}/~historyRollup/");
|
||||
//HttpWebRequest archiveMonthRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/H_E1_B1F_MVCB_MVCBH_V1/~historyRollup/");
|
||||
archiveMonthRequest.Method = "POST";
|
||||
archiveMonthRequest.Headers.Add("Authorization", "Basic " + encoded);
|
||||
|
@ -118,7 +118,7 @@ namespace FrontendWebApi.ApiControllers
|
||||
{
|
||||
string buildingTag = d.DeviceNumber.Split("_")[1];
|
||||
var station = buildStation.Where(x => x.system_key == buildingTag).Select(x => x.system_value).FirstOrDefault();
|
||||
var archiveRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{d.FullDeviceNumberPoint}/~historyRollup/");
|
||||
var archiveRequest = (HttpWebRequest)WebRequest.Create($"{obixApiConfig.ApiBase}obix/histories/{station}/{d.FullDeviceNumberPoint.Replace("$3", "")}/~historyRollup/");
|
||||
archiveRequest.Method = "POST";
|
||||
archiveRequest.Headers.Add("Authorization", "Basic " + encoded);
|
||||
archiveRequest.PreAuthenticate = true;
|
||||
|
Loading…
Reference in New Issue
Block a user