From f9a5863dd719d6036e28391b0d4f39b2d349f3e9 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期一, 24 四月 2023 08:30:19 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/BaseSet/Gy_MaterialController.cs |   36 +++++++++++++++++++++++++++++++++++-
 1 files changed, 35 insertions(+), 1 deletions(-)

diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
index 44a29f5..53f1366 100644
--- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -607,6 +607,8 @@
             string HInter = sArray[0].ToString();
             string HInterID = HInter.Replace("\"", "");
             string user = sArray[1].ToString();
+            string HBarCode = sArray[2].ToString().Replace("\"","");
+            string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О
 
             //缂栬緫鏉冮檺
             if (!DBUtility.ClsPub.Security_Log("Gy_BarCodeBillList_Edit", 1, false, user))
@@ -620,6 +622,32 @@
 
             try
             {
+                DataSet Ds;
+
+                string[] NewBarCode;
+                NewBarCode = HBarCode.Split(Convert.ToChar(","));
+
+                //鍒犻櫎鏉$爜鍓嶈繘琛屽垽鏂�
+                Ds = oCN.RunProcReturn("exec h_p_Gy_BarCodeBill_MulDelete_Before '" + HInterID + "','" + HBarCode + "'", "h_p_Gy_BarCodeBill_MulDelete_Before", ref DBUtility.ClsPub.sExeReturnInfo);
+                if (Ds == null || Ds.Tables[0].Rows.Count <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍒犻櫎鏉$爜鍓嶅垽鏂彂鐢熼敊璇紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0][0]) == "1")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;                       
+                    }
+                }
                 //Int64 lngBillKey = 0;
                 //lngBillKey = DBUtility.ClsPub.isLong(HInterID);
                 if (HInterID == "")
@@ -630,13 +658,19 @@
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
-                DataSet Ds;
+                
                 Ds = oCN.RunProcReturn("Select * from h_v_IF_BarCodeBillList Where HItemID in (" + HInterID + ")", "h_v_IF_BarCodeBillList");
                 if (Ds.Tables[0].Rows.Count != 0)
                 {
                     oCN.BeginTran();
                     oCN.RunProc("Delete from Gy_BarCodeBill Where HItemID in (" + HInterID + ")");
 
+                    //鍐欏叆绯荤粺鏃ュ織
+                    for (int i = 0; i <= NewBarCode.Length - 1; i++)
+                    {
+                        oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "缃戦〉鐗堝垹闄ゆ潯鐮侊細" + NewBarCode[i] + "','WMS绯荤粺-鏉$爜妗f鍒楄〃妯″潡','" + DBUtility.ClsPub.IPAddress + "','鍒犻櫎鏉$爜'", ref DBUtility.ClsPub.sExeReturnInfo);                     
+                    }
+
                     oCN.Commit();
                     objJsonResult.code = "1";
                     objJsonResult.count = 1;

--
Gitblit v1.9.1