From 58787157e2609916c06d3ed7d19b6403e9cd5d31 Mon Sep 17 00:00:00 2001
From: 啊鑫 <t2856754968@163.com>
Date: 星期四, 26 九月 2024 20:29:35 +0800
Subject: [PATCH] 入库检增加检验结果清除

---
 MES.Service/service/QC/RKJService.cs |   28 +++++++++++++++++++++++++++-
 1 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/MES.Service/service/QC/RKJService.cs b/MES.Service/service/QC/RKJService.cs
index 5ca88ff..ccbfbe3 100644
--- a/MES.Service/service/QC/RKJService.cs
+++ b/MES.Service/service/QC/RKJService.cs
@@ -623,7 +623,8 @@
                 ItemInId = m.ItemInId,
                 Daa015 = da.Daa015,
                 LineNo = c.LineNo,
-                Quantity = m.Quantity
+                Quantity = m.Quantity,
+                Bgr = c.Bgr
             })
             .OrderBy(a => a.CreateDate, OrderByType.Desc)
             .ToPageList(queryObj.PageIndex, queryObj.Limit, ref totalCount);
@@ -807,4 +808,29 @@
 
         return Convert.ToInt32(rkjDto.gid);
     }
+
+    public int cleanReqResult(RKJDto dto)
+    {
+        if (isRk(dto.gid)) throw new Exception("宸叉湁鏉$爜鍏ュ簱锛屼笉鍏佽娓呴櫎妫�楠岀粨鏋�");
+
+
+        return SqlSugarHelper.UseTransactionWithOracle(db =>
+        {
+            return db.Updateable<QsItemOqcReq>()
+                .SetColumns(s => s.FcheckResu == null)
+                .Where(s => s.Id == dto.gid).ExecuteCommand();
+        });
+    }
+
+    private bool isRk(int? gid)
+    {
+        var db = SqlSugarHelper.GetInstance();
+        return db.Queryable<QsItemOqcReq, MesInvItemIns, MesInvItemInCDetails>(
+                (a, b, c) => new JoinQueryInfos(
+                    JoinType.Inner, a.BillNo == b.BillNo,
+                    JoinType.Inner, b.Id == c.ItemInId
+                ))
+            .Where((a, b, c) => a.Id == gid)
+            .Count() > 0;
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3