From 29861afeb7708546e38e18b129880c0807def565 Mon Sep 17 00:00:00 2001 From: Rodney Chen <rodney.chen@hotmail.com> Date: 星期三, 04 十二月 2024 16:16:19 +0800 Subject: [PATCH] 优化了一些已知问题 --- Tiger.Business.MES/iERP/U9C_MES.cs | 17 +++++++---------- 1 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Tiger.Business.MES/iERP/U9C_MES.cs b/Tiger.Business.MES/iERP/U9C_MES.cs index b2a47eb..48b6654 100644 --- a/Tiger.Business.MES/iERP/U9C_MES.cs +++ b/Tiger.Business.MES/iERP/U9C_MES.cs @@ -78,6 +78,7 @@ Accuracy = (di["Accuracy"] ?? "").ToString(), Remark = (di["Remark"] ?? "").ToString(), Packaging = (di["Packaging"] ?? "").ToString(), + SapCode = (di["Code1"] ?? "").ToString(), }; itemExts.Add(extInfo); } @@ -118,7 +119,7 @@ .WhereColumns(t => new { t.ITEM_ID, t.GHOST_ROW }) .ToStorage(); y.AsInsertable.ExecuteCommand(); - y.AsUpdateable.ExecuteCommand(); + y.AsUpdateable.IgnoreColumns(x => x.ID).ExecuteCommand(); }); } else @@ -207,15 +208,15 @@ db.Storageable(LastRun, "U9C_MES_GetWo").ExecuteCommand(); if (items.Any()) { - if (items.Count > 150) + if (items.Count > 100) { - db.Utilities.PageEach(items, 1000, pageList => + db.Utilities.PageEach(items, 100, pageList => { var y = db.Storageable(pageList, "U9C") .WhereColumns(t => new { t.ORDER_NO, t.GHOST_ROW }) .ToStorage(); - y.BulkCopy(); - y.BulkUpdate(); + y.AsInsertable.ExecuteCommand(); + y.AsUpdateable.IgnoreColumns(x => x.ID).ExecuteCommand(); }); } else @@ -284,11 +285,7 @@ { if (woList.Any()) { - var s = _db.Storageable(woList, "U9C") - .WhereColumns(t => new { t.ORDER_NO, t.GHOST_ROW }) - .ToStorage(); - s.AsInsertable.ExecuteCommand(); - s.AsUpdateable.IgnoreColumns(x => x.ID).UpdateColumns(x => new { x.ROUTE_STATUS}).ExecuteCommand(); + _db.Updateable(woList, "U9C").UpdateColumns(x => new { x.ROUTE_STATUS }).ExecuteCommand(); } }); -- Gitblit v1.9.3