From 3ad2a9ea53d9b647ec10c9ece51f40d7f078653a Mon Sep 17 00:00:00 2001
From: yxj <yxj@hz-kingdee.com>
Date: 星期三, 27 十二月 2023 13:36:53 +0800
Subject: [PATCH] 生产入库、委外入库、其他入库、生产领料、委外领料、其他出库、直接调拨扫码上传方法增加递入保管人、验收人、金蝶WISE制单人等

---
 WebAPI/Controllers/SCGL/Sc_ICMOChangeBillController.cs |   23 ++++++++++++++++++-----
 1 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/WebAPI/Controllers/SCGL/Sc_ICMOChangeBillController.cs b/WebAPI/Controllers/SCGL/Sc_ICMOChangeBillController.cs
index 5d28711..e78e6ca 100644
--- a/WebAPI/Controllers/SCGL/Sc_ICMOChangeBillController.cs
+++ b/WebAPI/Controllers/SCGL/Sc_ICMOChangeBillController.cs
@@ -498,14 +498,23 @@
                         objJsonResult.data = null;
                         return objJsonResult;
                     }
-                    
+                    else if (ds.Tables[0].Rows[0]["HBillStatus"].ToString() != "2")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:婧愬崟鏈浜庡鏍哥姸鎬�!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+
+                    oCN.BeginTran();
+                    //鍙嶅啓婧愬崟鏁版嵁
+                    sql = "exec h_p_Sc_ICMOBill_ReWriteByICMOChangeBill " + oBill.omodel.HInterID;
+                    oCN.RunProc(sql);
+
                     //瀹℃牳鎻愪氦
                     if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                     {
-                        //鍙嶅啓婧愬崟鏁版嵁
-                        oCN.BeginTran();
-                        sql = "exec h_p_Sc_ICMOBill_ReWriteByICMOChangeBill " + oBill.omodel.HInterID;
-                        oCN.RunProc(sql);
                         oCN.Commit();
 
                         objJsonResult.code = "1";
@@ -516,6 +525,8 @@
                     }
                     else
                     {
+                        oCN.RollBack();
+
                         objJsonResult.code = "0";
                         objJsonResult.count = 0;
                         objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
@@ -547,6 +558,8 @@
             }
             catch (Exception e)
             {
+                oCN.RollBack();
+
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
                 objJsonResult.Message = "瀹℃牳澶辫触鎴栬�呭弽瀹℃牳澶辫触锛�" + e.ToString();

--
Gitblit v1.9.1