-
+
@*
@@ -85,9 +85,9 @@
$(function () {
ds = null;
- building = "B1";
document.getElementById("Building_B").checked = true;
+ projectName();
rawDataImportTable = $("#niagara_data_table").DataTable({
"columns": [
{
@@ -133,7 +133,7 @@
document.getElementById('loadDataText').innerText = "Loading...";
buildingId = document.querySelector('input[name="Building"]:checked').value;
if (buildingId == "B") {
- building = "B1";
+ //building = "B1";
rawDataImportTable.ajax.reload();
}
}
@@ -180,10 +180,16 @@
//比對資料,有差異的話,再同步到device等資料表
var url_synchronize_data = "/NiagaraDataSynchronize/RawDataDevItemList/";
var url_synchronize_data_device_item = "/NiagaraDataSynchronize/DevIteComData/";
-
+ let object = {};
+ object.building = building;
$.ajax({
method: "POST",
url: url_synchronize_data,
+ cache: false,
+ async: false,
+ contentType: "application/json; charset=UTF-8",
+ data: JSON.stringify(object),
+ dataType: 'json',
success: function (rel) {
if (rel.code != "0000") {
toast_error(rel.msg);
@@ -218,5 +224,25 @@
},
});
}
+
+ function projectName()
+ {
+ $.post("/Variable/ProjectName", null, function (rel) {
+ building = "B1";
+ if (rel.code != "0000") {
+ toast_error(rel.msg);
+ return;
+ }
+
+ if (rel.data != null) {
+ building = rel.data.system_value.split('/')[1];
+ $(`label[for='Building_B']`).html(rel.data.system_key + building);
+ }
+ else
+ {
+ $(`label[for='Building_B']`).html('三菱B1');
+ }
+ }, 'json');
+ }
}
\ No newline at end of file
diff --git a/Backend/appsettings.Development.json b/Backend/appsettings.Development.json
index 380f7c4..d9b4695 100644
--- a/Backend/appsettings.Development.json
+++ b/Backend/appsettings.Development.json
@@ -56,13 +56,17 @@
//"ObixQuery": "7C/j7U8PmDqMxpb7f6gMpHFicuOA83OZeuWHBFdi/xpfEIklxyQ/wP75bEKwrdh+fXXgjmpc9cLX9GqbBC7eGw==", //三菱
//"ObixHisBqlQuery": "7C/j7U8PmDqMxpb7f6gMpHFicuOA83OZeuWHBFdi/xpfEIklxyQ/wP75bEKwrdh+fXXgjmpc9cLX9GqbBC7eGw==", //三菱
//"ObixHisUrlQuery": "7C/j7U8PmDqMxpb7f6gMpD06cJcRzpVx0+IAssROlE4MlzSDPojSI17+XkQIL9Eu" //三菱
+ //"Account": "UnUq+XFB1pEDdz8OId/kaA==", //三菱
+ //"Password": "CQC+JFF11YW+axvka4WOKQ==", //三菱
"UrlSlot": "e1dUH6340WkFoHPJYq7IYQ==", // 巨蛋棟 D2
//"UrlSlot": "f9cDBTw5PCfbDTOt4Kwbew==", // 旅館棟 slot:/Arena/H|
"ObixQuery": "7C/j7U8PmDqMxpb7f6gMpIDkLYyNwmXoqhx+N1G+fqQxEETrRbFLZfC7Sud5yX24CphfLlSUbfjft7gcP6v+gw==", //巨蛋 http://192.168.0.136:8082/obix/config/Program/ObixQuery/query/
"ObixHisBqlQuery": "7C/j7U8PmDqMxpb7f6gMpIDkLYyNwmXoqhx+N1G+fqQxEETrRbFLZfC7Sud5yX24CphfLlSUbfjft7gcP6v+gw==", // 巨蛋 http://192.168.0.136:8082/obix/config/Program/ObixQuery/query/
"ObixHisUrlQuery": "7C/j7U8PmDqMxpb7f6gMpEVUZrrjJT0WiTUBn0FzipXfBFsxYAX3plIWBcJ+oZzW", //巨蛋 http://192.168.0.136:8081/obix/histories
- "tag_quantity": "AeqCvTnIRIpvQcjBfwi+qg=="
+ "tag_quantity": "AeqCvTnIRIpvQcjBfwi+qg==",
+ "Account": "FMiVG4sIeDFmAUc/8Hn/kw==", //巨蛋
+ "Password": "4+ussQ8rHohjPWpNvoujJQ==" //巨蛋
}
}
}
diff --git a/Backend/appsettings.json b/Backend/appsettings.json
index 0c7670b..c0ce7a5 100644
--- a/Backend/appsettings.json
+++ b/Backend/appsettings.json
@@ -44,12 +44,16 @@
//"ObixHisBqlQuery": "7C/j7U8PmDqMxpb7f6gMpHFicuOA83OZeuWHBFdi/xpfEIklxyQ/wP75bEKwrdh+fXXgjmpc9cLX9GqbBC7eGw==", //三菱
//"ObixHisUrlQuery": "7C/j7U8PmDqMxpb7f6gMpD06cJcRzpVx0+IAssROlE4MlzSDPojSI17+XkQIL9Eu" //三菱
//"tag_quantity": "fFA0lNwg5d/4ZNzWrPbVzw==" 8段
+ //"Account": "UnUq+XFB1pEDdz8OId/kaA==", //三菱
+ //"Password": "CQC+JFF11YW+axvka4WOKQ==", //三菱
"UrlSlot": "e1dUH6340WkFoHPJYq7IYQ==", // 巨蛋棟 D2
"ObixQuery": "7C/j7U8PmDqMxpb7f6gMpIDkLYyNwmXoqhx+N1G+fqQxEETrRbFLZfC7Sud5yX24CphfLlSUbfjft7gcP6v+gw==", //巨蛋 http://192.168.0.136:8082/obix/config/Program/ObixQuery/query/
"ObixHisBqlQuery": "7C/j7U8PmDqMxpb7f6gMpIDkLYyNwmXoqhx+N1G+fqQxEETrRbFLZfC7Sud5yX24CphfLlSUbfjft7gcP6v+gw==", // 巨蛋 http://192.168.0.136:8082/obix/config/Program/ObixQuery/query/
"ObixHisUrlQuery": "7C/j7U8PmDqMxpb7f6gMpEVUZrrjJT0WiTUBn0FzipXfBFsxYAX3plIWBcJ+oZzW", //巨蛋 http://192.168.0.136:8081/obix/histories
- "tag_quantity": "AeqCvTnIRIpvQcjBfwi+qg==" // 5段
+ "tag_quantity": "AeqCvTnIRIpvQcjBfwi+qg==", // 5段
+ "Account": "FMiVG4sIeDFmAUc/8Hn/kw==", //巨蛋
+ "Password": "4+ussQ8rHohjPWpNvoujJQ==" //巨蛋
}
}
}
diff --git a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs
index 8429f7f..7019331 100644
--- a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs
+++ b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs
@@ -212,9 +212,17 @@ namespace Repository.BackendRepository.Implement
row.full_name + "'" +
");");
}
-
+
+ var isDome = await GetOneAsync("select system_value from variable where deleted = 0 and system_type = 'project_name';");
if (sb.Length > 0)
{
+ if (isDome == "ibms_dome_dome/D2")
+ {
+ sb.Append($@" update import_niagara_item a join dic_system b
+ on a.device_name_tag COLLATE utf8mb4_general_ci = b.s2_code
+ set device_system_tag = b.s1_code
+ where device_system_tag <> 'S'");
+ }
await conn.ExecuteAsync(sb.ToString());
sb.Clear();
}
@@ -439,8 +447,8 @@ namespace Repository.BackendRepository.Implement
isControll + "," +
isBool + ", 1, 1, '" +
data.device_system_tag + "', '" +
- data.device_name_tag + "', " +
- data.full_name + "', " +
+ data.device_name_tag + "', '" +
+ data.full_name + "', '" +
data.parent_path + "', " +
"now(), now());");
}
diff --git a/Repository/Helper/BackEndConfigHelper.cs b/Repository/Helper/BackEndConfigHelper.cs
index cd65f2e..e64fb8b 100644
--- a/Repository/Helper/BackEndConfigHelper.cs
+++ b/Repository/Helper/BackEndConfigHelper.cs
@@ -26,6 +26,8 @@ namespace Repository.Helper
///
///
string Getobixtag_quantity();
+ string Getobixtag_acc();
+ string Getobixtag_pass();
}
@@ -60,7 +62,14 @@ namespace Repository.Helper
{
return ed.AESDecrypt(_NiagaraDataSyncConfig.tag_quantity);
}
-
+ public string Getobixtag_acc()
+ {
+ return ed.AESDecrypt(_NiagaraDataSyncConfig.Account);
+ }
+ public string Getobixtag_pass()
+ {
+ return ed.AESDecrypt(_NiagaraDataSyncConfig.Password);
+ }
}
}
diff --git a/Repository/Models/BackEndConfig.cs b/Repository/Models/BackEndConfig.cs
index b579342..19ee9f1 100644
--- a/Repository/Models/BackEndConfig.cs
+++ b/Repository/Models/BackEndConfig.cs
@@ -16,6 +16,8 @@
/// tag 段數
///
public string tag_quantity { get; set; }
+ public string Account { get; set; }
+ public string Password { get; set; }
}