From 0fef2791c12451bb858c0ba2199fb4a6d10d5549 Mon Sep 17 00:00:00 2001 From: dev01 Date: Tue, 3 Jan 2023 18:30:34 +0800 Subject: [PATCH 1/5] =?UTF-8?q?[Frontend][=E5=9C=96=E8=B3=87=E7=AE=A1?= =?UTF-8?q?=E7=90=86]=20=E9=BA=B5=E5=8C=85=E5=B1=91=E6=96=87=E5=AD=97?= =?UTF-8?q?=E9=A1=AF=E7=A4=BA=20|=20=E5=88=97=E8=A1=A8=E6=AC=84=E4=BD=8D?= =?UTF-8?q?=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Frontend/_graphManagement.html | 130 ++++++++++++++++----------------- 1 file changed, 64 insertions(+), 66 deletions(-) diff --git a/Frontend/_graphManagement.html b/Frontend/_graphManagement.html index 7e7897a..55749cb 100644 --- a/Frontend/_graphManagement.html +++ b/Frontend/_graphManagement.html @@ -7,16 +7,20 @@
+
+ 按右鍵即可展開選單 +
-
+ @@ -42,7 +46,7 @@ + \ No newline at end of file From ba03adc2b505ae1e0fa2c232e739440bb9688ce4 Mon Sep 17 00:00:00 2001 From: wanli Date: Tue, 3 Jan 2023 22:28:06 +0800 Subject: [PATCH 2/5] =?UTF-8?q?[Backend]=20=E9=87=9D=E5=B0=8D=E7=87=88?= =?UTF-8?q?=E5=85=B7=EF=BC=8C=E6=B8=85=E7=A9=BA=E8=B3=87=E6=96=99=E8=A1=A8?= =?UTF-8?q?=E3=80=81=E6=96=B0=E5=A2=9E=E8=87=B3device=5Fnode=E8=B3=87?= =?UTF-8?q?=E6=96=99=E8=A1=A8=EF=BC=8C=E6=9A=AB=E6=99=82=E8=A8=BB=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Backend/Controllers/DeviceImportController.cs | 37 +++++++++++++++++-- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/Backend/Controllers/DeviceImportController.cs b/Backend/Controllers/DeviceImportController.cs index 1f2218b..fb0beb2 100644 --- a/Backend/Controllers/DeviceImportController.cs +++ b/Backend/Controllers/DeviceImportController.cs @@ -761,13 +761,42 @@ namespace Backend.Controllers { if (post.Count > 0) { + //清空device_node資料表 + //await backendRepository.TruncateTable("device_node"); + + //int node_priority = 1; foreach(var idfc in post) { - Dictionary device = new Dictionary(); - device.Add("@device_coordinate_3d", idfc.device_coordinate_3d); - device.Add("@forge_dbid", idfc.forge_dbid); + //if(idfc.device_number.IndexOf("_LT_L1") > -1) + //{ + // //取得device_guid + // var sWhere = $@"where deleted = 0 and device_number = " + idfc.device_number; + // var device_guid = await backendRepository.GetOneAsync("device_node", sWhere, "device_guid"); - await backendRepository.UpdateOneByCustomTable(device, "device", $@" device_number = '{idfc.device_number}'"); + // //燈具 + // Dictionary device = new Dictionary(); + // device.Add("@device_node_guid", Guid.NewGuid()); + // device.Add("@deleted", 0); + // device.Add("@device_guid", device_guid); + // device.Add("@device_node_coordinate_3d", idfc.device_coordinate_3d); + // device.Add("@forge_dbid", idfc.forge_dbid); + // device.Add("@priority", node_priority); + // device.Add("@created_by", myUserInfo.Userinfo_guid); + // device.Add("@created_at", DateTime.Now); + + // node_priority++; + // await backendRepository.AddOneByCustomTableReturnId(device, "device_node", false); + //} + //else + //{ + Dictionary device = new Dictionary(); + device.Add("@device_coordinate_3d", idfc.device_coordinate_3d); + device.Add("@forge_dbid", idfc.forge_dbid); + await backendRepository.UpdateOneByCustomTable(device, "device", $@" device_number = '{idfc.device_number}'"); + //} + + + } } apiResult.Code = "0000"; From 560ec58908f80486c43dcb794d3d3762b9858419 Mon Sep 17 00:00:00 2001 From: wanli Date: Tue, 3 Jan 2023 22:29:29 +0800 Subject: [PATCH 3/5] =?UTF-8?q?[Repository]=20=E5=A2=9E=E5=8A=A0=E6=B8=85?= =?UTF-8?q?=E7=A9=BA=E8=B3=87=E6=96=99=E8=A1=A8=20=E5=87=BD=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implement/BaseRepository.cs | 36 +++++++++++++++++++ .../Interface/IBaseRepository.cs | 7 ++++ 2 files changed, 43 insertions(+) diff --git a/Repository/BaseRepository/Implement/BaseRepository.cs b/Repository/BaseRepository/Implement/BaseRepository.cs index e0b50cd..0de7f78 100644 --- a/Repository/BaseRepository/Implement/BaseRepository.cs +++ b/Repository/BaseRepository/Implement/BaseRepository.cs @@ -888,5 +888,41 @@ namespace Repository.BaseRepository.Implement } #endregion AddOneReturnId + + #region TruncateTable (清空資料表) + /// + /// 清空資料表資料 + /// TRUNCATE TABLE {tableName} + /// + /// + /// + public virtual async Task TruncateTable(string table_name) + { + using (IDbConnection conn = GetDbConnection()) + { + conn.Open(); + using (var trans = conn.BeginTransaction()) + { + try + { + var sql = $"TRUNCATE TABLE {table_name}"; + await conn.ExecuteAsync(sql, null, trans); + + trans.Commit(); + } + catch (Exception exception) + { + trans.Rollback(); + throw exception; + } + finally + { + conn.Close(); + } + } + } + } + #endregion TruncateTable + } } diff --git a/Repository/BaseRepository/Interface/IBaseRepository.cs b/Repository/BaseRepository/Interface/IBaseRepository.cs index c4ad4df..1c041a0 100644 --- a/Repository/BaseRepository/Interface/IBaseRepository.cs +++ b/Repository/BaseRepository/Interface/IBaseRepository.cs @@ -181,5 +181,12 @@ namespace Repository.BaseRepository.Interface /// /// Task AddOneByCustomTableReturnId(Dictionary dict, string Table_name, bool returnId = true); + /// + /// 清空table資料 + /// + /// 資料表名稱 + /// + /// + Task TruncateTable(string table_name); } } From 124cf5df5b1b2a9ee1e5b1540718ed322f01d2a2 Mon Sep 17 00:00:00 2001 From: wanli Date: Tue, 3 Jan 2023 22:30:16 +0800 Subject: [PATCH 4/5] =?UTF-8?q?[Backend]=20=E5=88=AA=E9=99=A4=20=E7=84=A1?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E6=AA=94=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Backend/Views/Forge/index.html | 93 ---------------------------------- 1 file changed, 93 deletions(-) delete mode 100644 Backend/Views/Forge/index.html diff --git a/Backend/Views/Forge/index.html b/Backend/Views/Forge/index.html deleted file mode 100644 index 6671224..0000000 --- a/Backend/Views/Forge/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Autodesk Forge Tutorial - - - - - - - - - - - - - - - - - - - @{ - ViewData["MainNum"] = "1"; - ViewData["SubNum"] = "4"; - ViewData["Title"] = "forge管理"; - } - - - -
-
-
-
-
- Buckets & Objects - - -
-
- tree here -
-
-
-
-
-
-
-
- - - - - - - - \ No newline at end of file From c48a62c473b948e3074379f4d7b60f23ee3fbbf0 Mon Sep 17 00:00:00 2001 From: wanli Date: Wed, 4 Jan 2023 01:18:46 +0800 Subject: [PATCH 5/5] =?UTF-8?q?[Frontend]=20=E7=86=B1=E9=BB=9E=E8=BC=89?= =?UTF-8?q?=E5=85=A5=E6=99=82=EF=BC=8C=E5=8A=A0=E5=85=A5=E7=87=88=E5=85=89?= =?UTF-8?q?=EF=BC=9B=E6=96=B0=E5=A2=9E=E6=8E=A7=E5=88=B6=E7=87=88=E5=85=89?= =?UTF-8?q?=E5=8F=83=E6=95=B8=E7=9A=84=E5=87=BD=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Frontend/forgetTest2.html | 216 ++++++++++++++++++-------------- Frontend/js/forge/forgemodel.js | 211 ++++++++++--------------------- Frontend/js/forge/modeltest.js | 164 +++++++++++++++--------- 3 files changed, 292 insertions(+), 299 deletions(-) diff --git a/Frontend/forgetTest2.html b/Frontend/forgetTest2.html index fe40614..b3d8d5e 100644 --- a/Frontend/forgetTest2.html +++ b/Frontend/forgetTest2.html @@ -17,20 +17,27 @@

Robot Controls

Selected_ID:

All_ID:

- - - + + + + + + + + @@ -184,6 +191,7 @@