From f726c27d2a5afdfd7153bb3a0521ddcf6b1eac15 Mon Sep 17 00:00:00 2001
From: YL <YL@LAPTOP-SE03PLUR>
Date: 星期五, 31 十二月 2021 14:08:16 +0800
Subject: [PATCH] nothing

---
 WebAPI/Controllers/博日自动扫码线/ScanlineAPIController.cs |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diff --git "a/WebAPI/Controllers/\345\215\232\346\227\245\350\207\252\345\212\250\346\211\253\347\240\201\347\272\277/ScanlineAPIController.cs" "b/WebAPI/Controllers/\345\215\232\346\227\245\350\207\252\345\212\250\346\211\253\347\240\201\347\272\277/ScanlineAPIController.cs"
index 0e1a8c2..94f0f7a 100644
--- "a/WebAPI/Controllers/\345\215\232\346\227\245\350\207\252\345\212\250\346\211\253\347\240\201\347\272\277/ScanlineAPIController.cs"
+++ "b/WebAPI/Controllers/\345\215\232\346\227\245\350\207\252\345\212\250\346\211\253\347\240\201\347\272\277/ScanlineAPIController.cs"
@@ -78,7 +78,7 @@
                 ScanLineCode list = js.Deserialize<ScanLineCode>(msg.ToString());    //灏唈son鏁版嵁杞寲涓哄璞$被鍨嬪苟璧嬪�肩粰list
                 if (list.billno != "" && list.billno != null)  //浠诲姟鍗曞彿锛岄潪蹇呴』锛岄潪绌哄垯鏍¢獙barcodes閲宐arcode鏄惁鐢辨浠诲姟鍗曞埗浣滅敓鎴愮殑
                 {
-                    ds = oCN.RunProcReturn("Select HBarCode barcode from Gy_BarCodeBill where HSourceBillNo='" + list.billno.ToString().Trim()+"'  Order by HItemID ", "Gy_BarCodeBill");
+                    ds = oCN.RunProcReturn("Select HBarCode barcode,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType from Gy_BarCodeBill where HSourceBillNo='" + list.billno.ToString().Trim()+"'  Order by HItemID ", "Gy_BarCodeBill");
                     if (ds == null || ds.Tables[0].Rows.Count == 0)
                     {
                         objJsonResult.status = -1;
@@ -227,7 +227,17 @@
         {
             try
             {
-                ds = oCN.RunProcReturn("Select * from Gy_BarCodeBill where HBarCode='" + packagebarcode.ToString().Trim() + "'", "Gy_BarCodeBill");
+                //鍒ゆ柇鏄惁鍏ュ簱 
+                ds = oCN.RunProcReturn("select * from Sc_ScanLineInStock where HBarCode_Pack='" + packagebarcode + "'", "Sc_ScanLineInStock");
+                if (ds!= null && ds.Tables[0].Rows.Count>0)
+                {
+                    objJsonResult.status = -1;
+                    objJsonResult.msg = "璇ョ鏉$爜宸插叆搴撲笉鍏佽鍙栨秷!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                ds = oCN.RunProcReturn("Select 1 from Gy_BarCodeBill where HBarCode='" + packagebarcode.ToString().Trim() + "'", "Gy_BarCodeBill");
                 if (ds == null && ds.Tables[0].Rows.Count == 0)
                 {
                     objJsonResult.status = -1;
@@ -235,7 +245,7 @@
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
-                ds = oCN.RunProcReturn("Select * from Gy_BarCodeBill where HBarCode='" + packagebarcode.ToString().Trim() + "' and HStopflag='1'", "Gy_BarCodeBill");
+                ds = oCN.RunProcReturn("Select 1 from Gy_BarCodeBill where HBarCode='" + packagebarcode.ToString().Trim() + "' and HStopflag='1'", "Gy_BarCodeBill");
                 if (ds != null && ds.Tables[0].Rows.Count>0)
                 {
                     objJsonResult.status = -1;
@@ -246,12 +256,14 @@
 
                 //
                 oCN.BeginTran();
+                //鍒犻櫎SUM涓昏〃
+                oCN.RunProc("Delete From Sc_PackUnionBillSub_Sum  where HBarCode_Pack='" + packagebarcode.ToString() + "'");
                 //鍒犻櫎瀛愯〃
                 oCN.RunProc("Delete From Sc_PackUnionBillSub  where HBarCode_Pack='"+ packagebarcode.ToString() + "'");
                 //鍒犻櫎涓昏〃
                 oCN.RunProc("Delete From Sc_PackUnionBillMain  where HBarCode_Pack='" + packagebarcode.ToString() + "'");
                 //浣滃簾鏉$爜妗f琛�
-                oCN.RunProc("Update  Gy_BarCodeBill set HStopflag='1'  where HBarCode='"+ packagebarcode .ToString()+ "'");
+                oCN.RunProc("Update  Gy_BarCodeBill set HStopflag='1'  where HBarCode='"+ packagebarcode.ToString()+ "'");
 
                 oCN.Commit();
 

--
Gitblit v1.9.1