From e7dcdcd81ad0a11d36084ca124f031f42d61bdd2 Mon Sep 17 00:00:00 2001 From: duhe <226547893@qq.com> Date: 星期四, 19 六月 2025 10:29:02 +0800 Subject: [PATCH] 华远接口:优化 --- WebAPI/DLL/ClsSc_MouldLifeChangeBill.cs | 63 +++++++++++++++++++++++++++++++ 1 files changed, 62 insertions(+), 1 deletions(-) diff --git a/WebAPI/DLL/ClsSc_MouldLifeChangeBill.cs b/WebAPI/DLL/ClsSc_MouldLifeChangeBill.cs index 5ffd1b2..db890ff 100644 --- a/WebAPI/DLL/ClsSc_MouldLifeChangeBill.cs +++ b/WebAPI/DLL/ClsSc_MouldLifeChangeBill.cs @@ -36,7 +36,21 @@ { try { - // + //淇濆瓨鍓嶆帶鍒�========================================= + string HBillNote = ""; + DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_MouldLifeChangeBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Sc_MouldLifeChangeBill_BeforeSaveCtrl"); + if (ds == null) + { + sReturn = "淇濆瓨鍓嶅垽鏂け璐ワ紒"; + return false; + } + if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") + { + sReturn = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); + return false; + } + //========================================================= + oCn.BeginTran(); //鏇存柊涓昏〃 oCn.RunProc("UpDate Sc_MouldLifeChangeBillMain set " + @@ -90,6 +104,22 @@ // return false; // } //} + + //=========================淇濆瓨鍚庢帶鍒� + DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sc_MouldLifeChangeBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Sc_MouldLifeChangeBill_AfterSaveCtrl"); + if (ds2 == null) + { + sReturn = "淇濆瓨鍚庢帶鍒跺垽鏂け璐ワ紒"; + oCn.RollBack(); + return false; + } + if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") + { + sReturn = "淇濆瓨澶辫触2锛�" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); + oCn.RollBack(); + return false; + } + //============================ sReturn = "淇敼鍗曟嵁鎴愬姛锛�"; oCn.Commit(); return true; @@ -106,6 +136,21 @@ { try { + //淇濆瓨鍓嶆帶鍒�========================================= + string HBillNote = ""; + DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_MouldLifeChangeBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Sc_MouldLifeChangeBill_BeforeSaveCtrl"); + if (ds == null) + { + sReturn = "淇濆瓨鍓嶅垽鏂け璐ワ紒"; + return false; + } + if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") + { + sReturn = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); + return false; + } + //========================================================= + //寰楀埌mainid omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� @@ -150,6 +195,22 @@ // } //} // + + //=========================淇濆瓨鍚庢帶鍒� + DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sc_MouldLifeChangeBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Sc_MouldLifeChangeBill_AfterSaveCtrl"); + if (ds2 == null) + { + sReturn = "淇濆瓨鍚庢帶鍒跺垽鏂け璐ワ紒"; + oCn.RollBack(); + return false; + } + if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") + { + sReturn = "淇濆瓨澶辫触2锛�" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); + oCn.RollBack(); + return false; + } + //============================ sReturn = "鏂板鍗曟嵁鎴愬姛锛�"; oCn.Commit(); return true; -- Gitblit v1.9.1