From 16d84d880985e42d94af25fbc27292ace494f8de Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期三, 25 九月 2024 17:20:12 +0800
Subject: [PATCH] -11.模具/设备档案:条形码必录项(写在存储过程中)增加保存前保存后

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

diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
index f729bb2..cd2fed4 100644
--- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -2037,6 +2037,29 @@
                 int HNowWHID = mainList[0].HNowWHID;
                 int HNowSPID = mainList[0].HNowSPID;
 
+                //淇濆瓨鍓嶆帶鍒�=========================================
+                string HBillNote = "";
+                ds = oCN.RunProcReturn("Exec h_p_Gy_MouldFileMain_BeforeSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "','" + HBillNote + "',1 ", "h_p_Gy_MouldFileMain_BeforeSaveCtrl");
+                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "淇濆瓨澶辫触!鍘熷洜:淇濆瓨鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "淇濆瓨澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HBackRemark"].ToString(); ;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //=========================================================
+
+
                 //涓昏〃
                 oCN.RunProc("Insert Into Gy_MouldFileMain   " +
                 "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
@@ -2071,6 +2094,29 @@
 
                 objJsonResult = AddBillSub(msg5,msg6,msg7,HInterID, HBillNo);
 
+                //淇濆瓨鍚庢帶鍒�=========================================
+                ds = oCN.RunProcReturn("Exec h_p_Gy_MouldFileMain_AfterSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "','" + HBillNote + "',1 ", "h_p_Gy_MouldFileMain_AfterSaveCtrl");
+                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "淇濆瓨澶辫触!鍘熷洜:淇濆瓨鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "淇濆瓨澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HBackRemark"].ToString(); ;
+                    objJsonResult.data = null;
+                    oCN.RollBack();
+                    return objJsonResult;
+                }
+                //=========================================================
+
+
                 if (objJsonResult.code == "0")
                 {
                     objJsonResult.code = "0";

--
Gitblit v1.9.1