From 438e9cf23ce53d875ba180f16ca3f5513a769910 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期六, 11 五月 2024 15:39:41 +0800
Subject: [PATCH] 销售出库单:下查功能

---
 WebAPI/Controllers/CGGL/YF_PayMentBackBillController.cs |   66 ++++++++++++++++++++++++++++++++
 1 files changed, 65 insertions(+), 1 deletions(-)

diff --git a/WebAPI/Controllers/CGGL/YF_PayMentBackBillController.cs b/WebAPI/Controllers/CGGL/YF_PayMentBackBillController.cs
index 12a9eef..1a8faae 100644
--- a/WebAPI/Controllers/CGGL/YF_PayMentBackBillController.cs
+++ b/WebAPI/Controllers/CGGL/YF_PayMentBackBillController.cs
@@ -373,6 +373,43 @@
                     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_PayMentBackBill_BeforeDelCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'";
+                ds = oCN.RunProcReturn(sql1, "h_p_YF_PayMentBackBill_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)
                 {
                     objJsonResult.code = "0";
@@ -391,13 +428,40 @@
                     return objJsonResult;
                 }
 
+                string sReturn = "";
                 oCN.BeginTran();
 
                 oCN.RunProc("delete from YF_PayMentBillMain where HInterID = " + HInterID);
-                oCN.RunProc("delete from YF_PayMentBillSub where HInterID= " + HInterID);
+                oCN.RunProc("delete from YF_PayMentBillMain where HInterID= " + HInterID);
 
                 oCN.Commit();
 
+                //鍒犻櫎鍚庢帶鍒�==================================================================================      
+                string sql2 = "exec h_p_YF_PayMentBackBill_AfterDelCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'";
+                ds = oCN.RunProcReturn(sql2, "h_p_YF_PayMentBackBill_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