diff --git a/FrontendWebApi/ApiControllers/HistoryController.cs b/FrontendWebApi/ApiControllers/HistoryController.cs index f3a5740..8591f8a 100644 --- a/FrontendWebApi/ApiControllers/HistoryController.cs +++ b/FrontendWebApi/ApiControllers/HistoryController.cs @@ -1119,7 +1119,8 @@ namespace FrontendWebApi.ApiControllers temp.device_name, temp.full_name as item_name, temp.points, - temp.unit + temp.unit, + temp.is_bool from ( select di.*, @@ -1240,7 +1241,7 @@ namespace FrontendWebApi.ApiControllers var abstime = obj["abstime"]["@val"].ToString(); 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(); historyRawDatas.Add(historyRawData); diff --git a/FrontendWebApi/Models/HistoryClass.cs b/FrontendWebApi/Models/HistoryClass.cs index b062150..9fdeb41 100644 --- a/FrontendWebApi/Models/HistoryClass.cs +++ b/FrontendWebApi/Models/HistoryClass.cs @@ -279,6 +279,8 @@ namespace FrontendWebApi.Models public string Item_name { get; set; } public string Points { get; set; } public string Unit { get; set; } + + public string Is_bool { get; set; } } public class HistoryRawData : DeviceItemInfo diff --git a/FrontendWebApi/appsettings.Development.json b/FrontendWebApi/appsettings.Development.json index 84e653e..d3bc4e5 100644 --- a/FrontendWebApi/appsettings.Development.json +++ b/FrontendWebApi/appsettings.Development.json @@ -19,12 +19,14 @@ }, "DBConfig": { "MySqlDBConfig": { - "Server": "FYlY+w0XDIz+jmF2rlZWJw==", //0.201 - "Port": "js2LutKe+rdjzdxMPQUrvQ==", + "Server": "CYGthbCeGtAXT4s1NOSJHQ==", //0.132 + "Port": "mkF51jVbg40V5K5eTh2Ckw==", + //"Server": "FYlY+w0XDIz+jmF2rlZWJw==", //0.201 + //"Port": "js2LutKe+rdjzdxMPQUrvQ==", //"Database": "VJB2XC+lAtzuHObDGMVOAA==", //30 //"Database": "IgYBsgG2VLKKxFb64j7LOA==", //wsp - //"Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome - "Database": "+5RAiFLJVU+LRyDxF1K/pcLZaoZa4k/thZqF6xKoCag=", //dome_online_0821 + "Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome + //"Database": "+5RAiFLJVU+LRyDxF1K/pcLZaoZa4k/thZqF6xKoCag=", //dome_online_0821 //"Database": "siTUcDaC/g2yGTMFWD72Kg==", //tpe_dome_hotel //"Database": "iuaY0h0+TWkir44/eZLDqw==", //tpe_dome_office //"Database": "Rq7Gn4x6LwBvVtl7GY8LbA==", //MCUT diff --git a/FrontendWebApi/appsettings.json b/FrontendWebApi/appsettings.json index 81a3162..96b02f2 100644 --- a/FrontendWebApi/appsettings.json +++ b/FrontendWebApi/appsettings.json @@ -25,15 +25,17 @@ // "Password": "2gi7rOmGha2VdXC5vtHxhg==" //}, "MySqlDBConfig": { - "Server": "FYlY+w0XDIz+jmF2rlZWJw==", //0.201 - "Port": "js2LutKe+rdjzdxMPQUrvQ==", + "Server": "CYGthbCeGtAXT4s1NOSJHQ==", //0.132 + "Port": "mkF51jVbg40V5K5eTh2Ckw==", + //"Server": "FYlY+w0XDIz+jmF2rlZWJw==", //0.201 + //"Port": "js2LutKe+rdjzdxMPQUrvQ==", //"Database": "VJB2XC+lAtzuHObDGMVOAA==", //三菱 //"Database": "IgYBsgG2VLKKxFb64j7LOA==", //wsp //"Database": "Rq7Gn4x6LwBvVtl7GY8LbA==", //MCUT - //"Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome + "Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome //"Database": "siTUcDaC/g2yGTMFWD72Kg==", //tpe_dome_hotel //"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==", "Password": "FVAPxztxpY4gJJKQ/se4bQ==" },