From 59f31f0caeef6fb37f397646efbcd19738299122 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期一, 25 十一月 2024 16:16:12 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/SBGL/Gy_EquipFileMainController.cs |   52 ++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 48 insertions(+), 4 deletions(-)

diff --git a/WebAPI/Controllers/SBGL/Gy_EquipFileMainController.cs b/WebAPI/Controllers/SBGL/Gy_EquipFileMainController.cs
index bd0d21b..9fe6dab 100644
--- a/WebAPI/Controllers/SBGL/Gy_EquipFileMainController.cs
+++ b/WebAPI/Controllers/SBGL/Gy_EquipFileMainController.cs
@@ -323,6 +323,27 @@
                 }
                 //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
                 oCN.BeginTran();
+                //淇濆瓨鍓嶆帶鍒�=========================================
+                string HBillNote = "";
+                ds = oCN.RunProcReturn("Exec h_p_Gy_EquipFileBillMain_BeforeSaveCtrl " + HInterID.ToString() + ", '" + hbillno + "','" + HBillNote + "',1 ", "h_p_Gy_EquipFileBillMain_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_EquipFileBillMain " +
                    " (HInterID,hbillno,HEquipFileNumber,HEquipFileNo,HName,HModel,HModel2,HMaterID,HUnitID,HOutComDate" +
@@ -334,6 +355,29 @@
                    "','" + HBarCode + "','" + HWorkArea + "','" + HLogo + "'," + HSellSupID + "," + HMakeSupID + ",'3308','" + HDate + "','" + HYear + "','" + HMaker + "','" + HMakeDate + "','" + HEquipMaintainRuleInterID + "','" + HEquipDotCheckRuleInterID +"'," + HSourceID + ",'" + HMainSourceFlag + "','" + HMacAddress + "','" + HMainSourceID + "')", ref DBUtility.ClsPub.sExeReturnInfo);
                 //淇敼涓婄骇涓洪潪鏈骇浠g爜
                 objJsonResult = AddBillSub(msg3, msg4, HInterID, hbillno, 1);
+
+                //淇濆瓨鍚庢帶鍒�=========================================
+                ds = oCN.RunProcReturn("Exec h_p_Gy_EquipFileBillMain_AfterSaveCtrl " + HInterID.ToString() + ", '" + hbillno + "','" + HBillNote + "',1 ", "h_p_Gy_EquipFileBillMain_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;                    
+                }
+                //=========================================================
+
                 oCN.Commit();
                 //objJsonResult.data = null;
                 return objJsonResult;
@@ -513,7 +557,7 @@
                     oCN.RunProc("delete from Gy_EquipFileBillSub_DotCheckRule where HInterID = " + HInterID );
                 }
                 int i = 0;
-                //淇濆瓨淇濆吇瑙勬牸
+                //淇濆瓨淇濆吇瑙勭▼
                 foreach (ClsGy_EquipFileBillSub_MaintainRule oSub in MaintainRuleColl)
                 {
                     i++;
@@ -521,9 +565,9 @@
                     {
                         objJsonResult.code = "0";
                         objJsonResult.count = 0;
-                        objJsonResult.Message = "绗�" + i + "琛�,淇濆吇瑙勬牸涓嶈兘涓虹┖";
+                        objJsonResult.Message = "绗�" + i + "琛�,淇濆吇瑙勭▼涓嶈兘涓虹┖";
                         objJsonResult.data = null;
-                        throw new Exception("淇濆吇瑙勬牸涓嶈兘涓虹┖");
+                        throw new Exception("淇濆吇瑙勭▼涓嶈兘涓虹┖");
                 }
                     DataSet Cs;
                     Int64 NewHEntryID = 1;
@@ -589,7 +633,7 @@
                 //淇敼涓婄骇涓洪潪鏈骇浠g爜
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
-                objJsonResult.Message = "淇濆瓨瀛愯〃鎴愬姛锛�";
+                objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
                 //objJsonResult.data = null;
                 return objJsonResult;
         }

--
Gitblit v1.9.1