From 1818a97f14836d85b4f3fa651f77de0394cd4371 Mon Sep 17 00:00:00 2001 From: Rodney Chen <rodney.chen@hotmail.com> Date: 星期二, 27 八月 2024 14:24:36 +0800 Subject: [PATCH] 增加步骤基类,工序信息增加公布信息列表 --- Tiger.Business/MES/Biz.Route.cs | 22 ++++++++++++++-------- 1 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Tiger.Business/MES/Biz.Route.cs b/Tiger.Business/MES/Biz.Route.cs index 6f8873b..38f5200 100644 --- a/Tiger.Business/MES/Biz.Route.cs +++ b/Tiger.Business/MES/Biz.Route.cs @@ -379,8 +379,11 @@ y.AsInsertable.ExecuteCommand(); y.AsUpdateable.IgnoreColumns(x => x.ID).ExecuteCommand(); } - db.Deleteable<MES_PROD_OPER>().Where(x => x.PROD_CODE == routeData.route.PROD_CODE && !SqlFunc.ContainsArray(nodeIds, x.NODE_ID)).ExecuteCommand(); - db.Deleteable<MES_PROD_ACTION>().Where(x => x.PROD_CODE == routeData.route.PROD_CODE && !SqlFunc.ContainsArray(actIds, x.ACT_ID)).ExecuteCommand(); + if (!routeData.route.PROD_CODE.IsNullOrEmpty()) + { + db.Deleteable<MES_PROD_OPER>().Where(x => x.PROD_CODE == routeData.route.PROD_CODE && !SqlFunc.ContainsArray(nodeIds, x.NODE_ID)).ExecuteCommand(); + db.Deleteable<MES_PROD_ACTION>().Where(x => x.PROD_CODE == routeData.route.PROD_CODE && !SqlFunc.ContainsArray(actIds, x.ACT_ID)).ExecuteCommand(); + } db.Deleteable<MES_ROUTE_NODE>(false).Where(x => x.ROT_ID == routeData.route.ID).ExecuteCommand(); db.Deleteable<MES_ROUTE_EDGE>(false).Where(x => x.ROT_ID == routeData.route.ID).ExecuteCommand(); db.Deleteable<MES_ROUTE_NODE_ACT>(false).Where(x => x.ROT_ID == routeData.route.ID).ExecuteCommand(); @@ -396,13 +399,16 @@ { db.Insertable(routeData.acts).ExecuteCommand(); } - if (operList.Count > 0) + if (!routeData.route.PROD_CODE.IsNullOrEmpty()) { - db.Insertable(operList).ExecuteCommand(); - } - if (actList.Count > 0) - { - db.Insertable(actList).ExecuteCommand(); + if (operList.Count > 0) + { + db.Insertable(operList).ExecuteCommand(); + } + if (actList.Count > 0) + { + db.Insertable(actList).ExecuteCommand(); + } } }); if (!dbTran.IsSuccess) -- Gitblit v1.9.3