From 1a586fff23913ff9ac8b5e9b62839ab5b767cb61 Mon Sep 17 00:00:00 2001 From: 啊鑫 <t2856754968@163.com> Date: 星期二, 08 十月 2024 08:44:00 +0800 Subject: [PATCH] 1 --- MES.Service/service/QC/RKJService.cs | 30 ++++++++++++++++++++++++++---- 1 files changed, 26 insertions(+), 4 deletions(-) diff --git a/MES.Service/service/QC/RKJService.cs b/MES.Service/service/QC/RKJService.cs index ccbfbe3..a72684a 100644 --- a/MES.Service/service/QC/RKJService.cs +++ b/MES.Service/service/QC/RKJService.cs @@ -483,6 +483,10 @@ var barCodes = mesInvItemInsList.Select(s => s.ItemBarcode).ToList(); + var count = db.Queryable<MesInvItemBarcodes>() + .Where(s => barCodes.Contains(s.ItemBarcode) && s.WorkFlg == 0) + .Count(); + var gxId = mesInvItemInsList.Select(s => s.MesScgdGxId).ToList(); var sumQty = mesInvItemInsList.Sum(s => s.Quantity); @@ -494,6 +498,23 @@ .SetColumns(s => s.CheckFlag == "鈭�") .Where(s => gxId.Contains(s.Id)) .ExecuteCommand(); + + if (count <= 0) return; + + //鍙栨秷mes_inv_item_barcodes 鐨勬姤宸ユ爣璇� WORK_FLG 浣跨敤鏉$爜 + var executeCommand = db.Updateable<MesInvItemBarcodes>() + .SetColumns(a => a.WorkFlg == 1) + .Where(a => barCodes.Contains(a.ItemBarcode)) + .ExecuteCommand(); + + if (executeCommand > 0) + { + //womdaa 宸茬敓浜ч噺 DAA011鍔犲洖鏉$爜鎶ュ伐鏁伴噺 + db.Updateable<Womdaa>() + .SetColumns(b => b.Daa011 == b.Daa011 + sumQty) + .Where(b => b.Daa001 == qsItemOqcReq.Daa001) + .ExecuteCommand(); + } } else if ("涓嶅悎鏍�".Equals(FcheckResu)) { @@ -825,12 +846,13 @@ private bool isRk(int? gid) { var db = SqlSugarHelper.GetInstance(); - return db.Queryable<QsItemOqcReq, MesInvItemIns, MesInvItemInCDetails>( - (a, b, c) => new JoinQueryInfos( + return db.Queryable<QsItemOqcReq, MesInvItemIns, MesInvItemInCDetails2,MesInvItemStocks>( + (a, b, c,d) => new JoinQueryInfos( JoinType.Inner, a.BillNo == b.BillNo, - JoinType.Inner, b.Id == c.ItemInId + JoinType.Inner, b.Id == c.ItemInId, + JoinType.Inner,c.ItemBarcode == d.ItemBarcode )) - .Where((a, b, c) => a.Id == gid) + .Where((a, b, c,d) => a.Id == gid) .Count() > 0; } } \ No newline at end of file -- Gitblit v1.9.3