From eec6715d29b03492c0e42843d5f03ea30d6ef3d7 Mon Sep 17 00:00:00 2001 From: Yang <903110162@qq.com> Date: Wed, 24 Jan 2024 23:55:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=A9=E6=96=99=E5=88=86?= =?UTF-8?q?=E7=B1=BB=3D=E3=80=8B=E4=BF=A1=E6=81=AF=E8=A1=A5=E5=85=A8?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FactorySystemBll/MaterialBll.cs | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/FactorySystemBll/MaterialBll.cs b/FactorySystemBll/MaterialBll.cs index 6cd9ce1..90bfb38 100644 --- a/FactorySystemBll/MaterialBll.cs +++ b/FactorySystemBll/MaterialBll.cs @@ -462,6 +462,7 @@ namespace FactorySystemBll update.Remove("FTypeName2"); update.Add("FEditUser", userId); update.Add("FEditDate", DateTime.Now); + updateList.Add(update); infoList[i] = childMater; } @@ -475,11 +476,24 @@ namespace FactorySystemBll if (updateList.Count > 0) { db.BeginTran(); - result += db.Updateable(updateList).AS("TFS_Material").WhereColumns("FID").IgnoreColumns(true).ExecuteCommand(); + + + foreach (var item in updateList) + { + result += db.Updateable(item).AS("TFS_Material").WhereColumns("FID").IgnoreColumns(true).ExecuteCommand(); + } + List temps = infoList.Where(s => s != null && s.FID > 0).ToList(); - if (temps.Count > 0) db.Updateable(temps).WhereColumns("FID").IgnoreColumns(true).ExecuteCommand(); + foreach (var item in temps) + { + db.Updateable(item).WhereColumns("FID").IgnoreColumns(true).ExecuteCommand(); + + } temps = infoList.Where(s => s != null && s.FID <= 0).ToList(); - if (temps.Count > 0) db.Insertable(temps).IgnoreColumns(true).ExecuteCommand(); + foreach (var item in temps) + { + db.Insertable(item).IgnoreColumns(true).ExecuteCommand(); + } db.CommitTran(); } ExceptionHelper.AddSystemJournal(null, mainList, new { updateList, infoList }, userId, "InsertBatchInfoMaterialData");