From 17be11c6c4be17c9944004a99551ebe6159a12ba Mon Sep 17 00:00:00 2001
From: cwjbxqmz <1134865194@qq.com>
Date: 星期一, 26 二月 2024 09:59:51 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/CGGL/YF_PayMentBillController.cs |   63 +++++++++++++++++++++++++++++++
 1 files changed, 62 insertions(+), 1 deletions(-)

diff --git a/WebAPI/Controllers/CGGL/YF_PayMentBillController.cs b/WebAPI/Controllers/CGGL/YF_PayMentBillController.cs
index 1280d07..afdbebb 100644
--- a/WebAPI/Controllers/CGGL/YF_PayMentBillController.cs
+++ b/WebAPI/Controllers/CGGL/YF_PayMentBillController.cs
@@ -372,6 +372,42 @@
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
+                string HBillNo = "";
+                ds = oCN.RunProcReturn("select * from YF_PayMentBillMain where HInterID=" + HInterID, "YF_PayMentBillMain");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult; ;
+                }
+                else
+                {
+                    HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
+                }
+
+                //鍒犻櫎鍓嶆帶鍒�=========================================      
+                string sql1 = "exec h_p_YF_PayMentBill_BeforeDelCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'";
+                ds = oCN.RunProcReturn(sql1, "h_p_YF_PayMentBill_BeforeDelCtrl");
+                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]["HRemark"].ToString(); ;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //==================================================================================  
 
                 if (BillOld.ShowBill(long.Parse(HInterID), ref s) == false)
                 {
@@ -390,7 +426,7 @@
                     objJsonResult.data = 1;
                     return objJsonResult;
                 }
-
+                string sReturn = "";
                 oCN.BeginTran();
 
                 oCN.RunProc("delete from YF_PayMentBillMain where HInterID = " + HInterID);
@@ -398,6 +434,31 @@
 
                 oCN.Commit();
 
+                //鍒犻櫎鍚庢帶鍒�==================================================================================      
+                string sql2 = "exec h_p_YF_PayMentBill_AfterDelCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'";
+                ds = oCN.RunProcReturn(sql2, "h_p_YF_PayMentBill_AfterDelCtrl");
+                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+                {
+                    sReturn = "鍒犻櫎鍚庡垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + sReturn;
+                    objJsonResult.data = null;
+                    oCN.RollBack();
+                    return objJsonResult;
+                }
+                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+                {
+                    sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString();
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + sReturn;
+                    objJsonResult.data = null;
+                    oCN.RollBack();
+                    return objJsonResult;
+                }
+                //==============================================================================================
+
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "Sucess锛�";

--
Gitblit v1.9.1