[WebAPI] GeHistoryRawData 更改布林值判斷抓取 Device_item is_bool

This commit is contained in:
dev01 2024-02-01 15:29:28 +08:00
parent acebd8aedb
commit 41df64845b
4 changed files with 17 additions and 10 deletions

View File

@ -1119,7 +1119,8 @@ namespace FrontendWebApi.ApiControllers
temp.device_name, temp.device_name,
temp.full_name as item_name, temp.full_name as item_name,
temp.points, temp.points,
temp.unit temp.unit,
temp.is_bool
from ( from (
select select
di.*, di.*,
@ -1240,7 +1241,7 @@ namespace FrontendWebApi.ApiControllers
var abstime = obj["abstime"]["@val"].ToString(); var abstime = obj["abstime"]["@val"].ToString();
historyRawData.Timestamp = Convert.ToDateTime(abstime).ToString("yyyy-MM-dd HH:mm:ss"); historyRawData.Timestamp = Convert.ToDateTime(abstime).ToString("yyyy-MM-dd HH:mm:ss");
//取得資料 //取得資料
string tag = device_item_info.Points.Equals("st") || device_item_info.Points.Equals("ST") ? "bool" : "real"; string tag = device_item_info.Is_bool == "1" ? "bool" : "real";
historyRawData.Value = obj[tag]["@val"].ToString(); historyRawData.Value = obj[tag]["@val"].ToString();
historyRawDatas.Add(historyRawData); historyRawDatas.Add(historyRawData);

View File

@ -279,6 +279,8 @@ namespace FrontendWebApi.Models
public string Item_name { get; set; } public string Item_name { get; set; }
public string Points { get; set; } public string Points { get; set; }
public string Unit { get; set; } public string Unit { get; set; }
public string Is_bool { get; set; }
} }
public class HistoryRawData : DeviceItemInfo public class HistoryRawData : DeviceItemInfo

View File

@ -19,12 +19,14 @@
}, },
"DBConfig": { "DBConfig": {
"MySqlDBConfig": { "MySqlDBConfig": {
"Server": "FYlY+w0XDIz+jmF2rlZWJw==", //0.201 "Server": "CYGthbCeGtAXT4s1NOSJHQ==", //0.132
"Port": "js2LutKe+rdjzdxMPQUrvQ==", "Port": "mkF51jVbg40V5K5eTh2Ckw==",
//"Server": "FYlY+w0XDIz+jmF2rlZWJw==", //0.201
//"Port": "js2LutKe+rdjzdxMPQUrvQ==",
//"Database": "VJB2XC+lAtzuHObDGMVOAA==", //30 //"Database": "VJB2XC+lAtzuHObDGMVOAA==", //30
//"Database": "IgYBsgG2VLKKxFb64j7LOA==", //wsp //"Database": "IgYBsgG2VLKKxFb64j7LOA==", //wsp
//"Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome "Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome
"Database": "+5RAiFLJVU+LRyDxF1K/pcLZaoZa4k/thZqF6xKoCag=", //dome_online_0821 //"Database": "+5RAiFLJVU+LRyDxF1K/pcLZaoZa4k/thZqF6xKoCag=", //dome_online_0821
//"Database": "siTUcDaC/g2yGTMFWD72Kg==", //tpe_dome_hotel //"Database": "siTUcDaC/g2yGTMFWD72Kg==", //tpe_dome_hotel
//"Database": "iuaY0h0+TWkir44/eZLDqw==", //tpe_dome_office //"Database": "iuaY0h0+TWkir44/eZLDqw==", //tpe_dome_office
//"Database": "Rq7Gn4x6LwBvVtl7GY8LbA==", //MCUT //"Database": "Rq7Gn4x6LwBvVtl7GY8LbA==", //MCUT

View File

@ -25,15 +25,17 @@
// "Password": "2gi7rOmGha2VdXC5vtHxhg==" // "Password": "2gi7rOmGha2VdXC5vtHxhg=="
//}, //},
"MySqlDBConfig": { "MySqlDBConfig": {
"Server": "FYlY+w0XDIz+jmF2rlZWJw==", //0.201 "Server": "CYGthbCeGtAXT4s1NOSJHQ==", //0.132
"Port": "js2LutKe+rdjzdxMPQUrvQ==", "Port": "mkF51jVbg40V5K5eTh2Ckw==",
//"Server": "FYlY+w0XDIz+jmF2rlZWJw==", //0.201
//"Port": "js2LutKe+rdjzdxMPQUrvQ==",
//"Database": "VJB2XC+lAtzuHObDGMVOAA==", // //"Database": "VJB2XC+lAtzuHObDGMVOAA==", //
//"Database": "IgYBsgG2VLKKxFb64j7LOA==", //wsp //"Database": "IgYBsgG2VLKKxFb64j7LOA==", //wsp
//"Database": "Rq7Gn4x6LwBvVtl7GY8LbA==", //MCUT //"Database": "Rq7Gn4x6LwBvVtl7GY8LbA==", //MCUT
//"Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome "Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome
//"Database": "siTUcDaC/g2yGTMFWD72Kg==", //tpe_dome_hotel //"Database": "siTUcDaC/g2yGTMFWD72Kg==", //tpe_dome_hotel
//"Database": "iuaY0h0+TWkir44/eZLDqw==", //tpe_dome_office //"Database": "iuaY0h0+TWkir44/eZLDqw==", //tpe_dome_office
"Database": "+5RAiFLJVU+LRyDxF1K/pcLZaoZa4k/thZqF6xKoCag=", //dome_online_0821 //"Database": "+5RAiFLJVU+LRyDxF1K/pcLZaoZa4k/thZqF6xKoCag=", //dome_online_0821
"Root": "SzdxEgaJJ7tcTCrUl2zKsA==", "Root": "SzdxEgaJJ7tcTCrUl2zKsA==",
"Password": "FVAPxztxpY4gJJKQ/se4bQ==" "Password": "FVAPxztxpY4gJJKQ/se4bQ=="
}, },