From 1e448c1981068d2242d327a362408938e8302b42 Mon Sep 17 00:00:00 2001
From: 南骏 池 <chiffly@163.com>
Date: 星期一, 07 七月 2025 08:53:34 +0800
Subject: [PATCH] 1.其他入库优化

---
 service/Warehouse/MesXkyShdManager.cs |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/service/Warehouse/MesXkyShdManager.cs b/service/Warehouse/MesXkyShdManager.cs
index f86518d..4a6c7e4 100644
--- a/service/Warehouse/MesXkyShdManager.cs
+++ b/service/Warehouse/MesXkyShdManager.cs
@@ -23,7 +23,13 @@
         if (shdh.Count < 1)
             throw new Exception($"閫佽揣鍗曞彿銆恵unity.shdh}銆戜笉瀛樺湪鎴栨湭鍚屾!");
 
+       // var sql3 = @"SELECT ISNULL((SELECT SUM(delivery_qty) FROM DELIVERY_NOTICE_DETAIL WHERE delivery_no = @shdh), 0) -
+       //ISNULL((SELECT SUM(include_qty) FROM TBL_BARCODE_INFORMATION WHERE delivery_no = @shdh), 0) AS Diffnum ";
 
+       // var diffNum = Db.Ado.SqlQuery<dynamic>(sql3, sqlParams).First();
+
+       // if (diffNum.Diffnum != 0)
+       //     throw new Exception($"閫佽揣鍗曞彿銆恵unity.shdh}銆戞潯鐮佹湭鍏ㄩ儴鎵撳嵃鎴栨湭鍚屾锛屾棤娉曟敹璐э紒");
 
         var sql2 = @"select D.item_no,
        D.item_name,
@@ -38,7 +44,7 @@
          LEFT JOIN dbo.MES_INV_ITEM_ARN B on B.paper_bill_no = A.delivery_no
          LEFT JOIN MES_ROH_IN_DATA C ON A.po_line_no = C.EBELN_K3ID
          LEFT JOIN MES_ITEMS D ON C.ITEM_ID = D.item_id
-         LEFT JOIN dbo.MES_INV_ITEM_ARN_DETAIL E on E.parent_Guid = B.guid AND E.line_k3id = A.po_line_no
+         RIGHT JOIN dbo.MES_INV_ITEM_ARN_DETAIL E on E.parent_Guid = B.guid AND E.line_k3id = A.po_line_no
 WHERE A.delivery_no = @shdh";
 
         var XcslItem = Db.Ado.SqlQuery<dynamic>(sql2, sqlParams);

--
Gitblit v1.9.3