修改歷史資料程序
This commit is contained in:
parent
93c12bbbde
commit
e14be83897
@ -260,19 +260,7 @@
|
||||
$('#devPointsList').html(strHtml);
|
||||
|
||||
if (!hisFirst) {
|
||||
let start = new Date($('#his_startdate').val());
|
||||
let end = new Date(new Date().setDate(new Date($('#his_enddate input').val()).getDate() + 1));
|
||||
|
||||
if (pageAct.dateType == "today" || pageAct.dateType == "day" || pageAct.dateType == "ytd")
|
||||
end = new Date(new Date(start.valueOf()).setDate(start.getDate() + 1));
|
||||
else if (pageAct.dateType == "month") {
|
||||
start = new Date($('#getmonth').val());
|
||||
end = new Date(new Date(start.valueOf()).setDate(start.getDate() + 30));
|
||||
}
|
||||
else if (pageAct.dateType != "range")
|
||||
return;
|
||||
|
||||
getData(formatDate(start, "date", true), formatDate(end, "date", true));
|
||||
searchDate();
|
||||
}
|
||||
}
|
||||
ytAjax = new YourTeam.Ajax(url, objSendData, success, null, "POST").send();
|
||||
@ -283,8 +271,8 @@
|
||||
$(loadEle).Loading("start");
|
||||
var sdt = new Date();
|
||||
var edt = new Date(new Date().setDate(sdt.getDate() + 1));
|
||||
start = start ?? sdt.toLocaleDateString();
|
||||
end = end ?? edt.toLocaleDateString();
|
||||
start = start + " 00:00:00" ?? sdt.toLocaleDateString();
|
||||
end = end + " 23:59:59"?? edt.toLocaleDateString();
|
||||
// callBackFromHistory();
|
||||
getHistoryDataByBaja(pageAct.deviceNumber + "_" + pageAct.deviceItem,
|
||||
new Date(start).getTime(),
|
||||
@ -318,19 +306,7 @@
|
||||
pageAct.devicePoiName = $(elem).text();
|
||||
pageAct.deviceItem = deviceItem;
|
||||
|
||||
let start = new Date($('#his_startdate').val());
|
||||
let end = new Date(new Date().setDate(new Date($('#his_enddate input').val()).getDate() + 1));
|
||||
|
||||
if (pageAct.dateType == "today" || pageAct.dateType == "day" || pageAct.dateType == "ytd")
|
||||
end = new Date(new Date(start.valueOf()).setDate(start.getDate() + 1));
|
||||
else if (pageAct.dateType == "month") {
|
||||
start = new Date($('#getmonth').val());
|
||||
end = new Date(new Date(start.valueOf()).setDate(start.getDate() + 30));
|
||||
}
|
||||
else if (pageAct.dateType != "range")
|
||||
return;
|
||||
|
||||
getData(formatDate(start, "date", true), formatDate(end, "date", true));
|
||||
searchDate();
|
||||
}
|
||||
}
|
||||
|
||||
@ -389,13 +365,14 @@
|
||||
|
||||
function searchDate() {
|
||||
let start = new Date($('#his_startdate').val());
|
||||
let end = new Date(new Date().setDate(new Date($('#his_enddate input').val()).getDate() + 1));
|
||||
let end = new Date($('#his_enddate input').val());
|
||||
|
||||
if (pageAct.dateType == "today" || pageAct.dateType == "day" || pageAct.dateType == "ytd")
|
||||
end = new Date(new Date(start.valueOf()).setDate(start.getDate() + 1));
|
||||
end = start;
|
||||
else if (pageAct.dateType == "month") {
|
||||
start = new Date($('#getmonth').val());
|
||||
end = new Date(new Date(start.valueOf()).setDate(start.getDate() + 30));
|
||||
end = new Date(start.valueOf()).setMonth(start.getMonth() + 1);
|
||||
end = new Date(new Date(end).setDate(new Date(end).getDate() - 1));
|
||||
}
|
||||
else if (pageAct.dateType != "range")
|
||||
return;
|
||||
@ -474,6 +451,9 @@
|
||||
v.endtime = pageAct.hisEndDate;
|
||||
v.dateType = pageAct.dateType;
|
||||
v.device_number = pageAct.deviceNumber;
|
||||
v.device_item = pageAct.deviceItem;
|
||||
v.deviceComName = pageAct.deviceComName;
|
||||
v.building_tag = pageAct.buiTag;
|
||||
objSendData.Data = v;
|
||||
|
||||
$.ajax({
|
||||
|
@ -74,10 +74,9 @@ namespace FrontendWebApi.ApiControllers
|
||||
#endregion 取得obix 設定
|
||||
#region get device and device_item(point)
|
||||
var device = backendRepository.GetAllAsync<Device>($"select * from device where deleted = 0 and is_link = 1 and device_number = '{lhe.device_number}'").Result;
|
||||
var devicePoint = backendRepository.GetAllAsync<Device_item>($"select * from device_item where deleted = 0 and is_link = 1 and is_show_history = 1 and device_building_tag = '{lhe.building_tag}' and points = '{lhe.device_item}'").Result;
|
||||
var devicePoint = backendRepository.GetAllAsync<Device_item>($"select * from device_item where deleted = 0 and is_link = 1 and is_show_history = 1 and device_building_tag = '{lhe.building_tag}'").Result;
|
||||
#endregion
|
||||
#region get data from niagara
|
||||
lhe.endtime = lhe.dateType == "today" ? lhe.starttime : lhe.dateType == "month" ? lhe.starttime.AddMonths(1) : lhe.endtime;
|
||||
var startTimestamp = string.Format("{0}T00:00:00.000+08:00", lhe.starttime.ToString("yyyy-MM-dd"));
|
||||
var endTimestamp = string.Format("{0}T23:59:59.000+08:00", lhe.endtime?.ToString("yyyy-MM-dd"));
|
||||
var historyQueryFilter = $@"<obj is='obix: HistoryFilter'>
|
||||
|
Loading…
Reference in New Issue
Block a user