From 77abe5670324b0583a6d78e25b14ad524ff2a261 Mon Sep 17 00:00:00 2001
From: cwjbxqmz <1134865194@qq.com>
Date: 星期五, 02 二月 2024 10:14:00 +0800
Subject: [PATCH] 采购退料单、退料通知单、付款单、应付退款但审核前后控制方法的添加

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

diff --git a/WebAPI/Controllers/CGGL/YF_PayMentBackBillController.cs b/WebAPI/Controllers/CGGL/YF_PayMentBackBillController.cs
index 31a303d..12a9eef 100644
--- a/WebAPI/Controllers/CGGL/YF_PayMentBackBillController.cs
+++ b/WebAPI/Controllers/CGGL/YF_PayMentBackBillController.cs
@@ -123,6 +123,26 @@
                 {
                     if (refSav == "Add")
                     {
+                        //淇濆瓨鍓嶆帶鍒�=========================================              
+                        ds = oCN.RunProcReturn("exec h_p_YF_PayMentBackBill_BeforeSaveCtrl  " + BillOld.omodel.HInterID, "h_p_YF_PayMentBackBill_BeforeSaveCtrl ");
+
+                        if (ds == null || ds.Tables[0].Rows.Count == 0)
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                        if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                        //=========================================================
                         //鍗曟嵁鍙锋槸鍚﹂噸澶�
                         if (BillNew0.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld.omodel.HInterID))
                         {
@@ -225,6 +245,26 @@
                 bool bResult;
                 if (refSav == "Add")
                 {
+                    //淇濆瓨鍚庢帶鍒�=========================================              
+                    ds = oCN.RunProcReturn("exec h_p_YF_PayMentBackBill_AfterSaveCtrl " + BillOld.omodel.HInterID, "h_p_YF_PayMentBackBill_AfterSaveCtrl");
+
+                    if (ds == null || ds.Tables[0].Rows.Count == 0)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨鍚庡垽鏂け璐ワ紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //=========================================================
                     // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                     bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                 }
@@ -388,6 +428,7 @@
         {
             string ModRightNameCheck = "YF_PayMentBackBill_Check";
             DBUtility.ClsPub.CurUserName = CurUserName;
+            string sql = "";
             try
             {
                 //瀹℃牳鏉冮檺
@@ -413,10 +454,40 @@
                 Int64 lngBillKey = 0;
                 lngBillKey = DBUtility.ClsPub.isLong(HInterID);                                         //瀵笻InterID杩涜绫诲瀷鐨勮浆鎹�
                 DAL.ClsYF_PayMentBackBill oBill = new DAL.ClsYF_PayMentBackBill();                              //瀹炰緥鍖栧崟鎹搷浣滅被锛岀敤浜庤繘琛岀浉鍏虫搷浣�
+                string HBillNo = "";
 
                 //閽堝闇�瑕佽繘琛岀殑鎿嶄綔锛屾楠屽綋鍓嶅崟鎹殑鐘舵�佹槸鍚︽敮鎸侀渶瑕佽繘琛岀殑鎿嶄綔
                 if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //鏍规嵁HInterID鑾峰彇璇ュ崟鎹殑鏁版嵁
                 {
+                    //瀹℃牳鍓嶆帶鍒�
+                    sql = "exec h_p_YF_PayMentBackBill_BeforeCheckCtrl " + HInterID + ",'" + HBillNo + "','" + CurUserName + "'";
+                    ds = oCN.RunProcReturn(sql, "h_p_YF_PayMentBackBill_BeforeCheckCtrl");
+                    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.CheckBill(HInterID, HBillNo, "h_p_YF_PayMentBackBill_AfterCheckCtrl", CurUserName, ref ClsPub.sExeReturnInfo))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                     if (oBill.omodel.HCloseMan.Trim() != "")
                     {
                         objJsonResult.code = "0";
@@ -444,8 +515,43 @@
                             return objJsonResult;
                         }
                     }
+
                     if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
                     {
+                        //鍙嶅鏍稿墠鎺у埗
+                        sql = "exec h_p_YF_PayMentBackBill_BeforeUnCheckCtrl " + HInterID + ",'" + HBillNo + "','" + CurUserName + "'";
+                        ds = oCN.RunProcReturn(sql, "h_p_YF_PayMentBackBill_BeforeUnCheckCtrl");
+                        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.AbandonCheck(HInterID, HBillNo, "h_p_YF_PayMentBackBill_AfterUnCheckCtrl", CurUserName, ref ClsPub.sExeReturnInfo))
+                        {
+                            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+                           
+                        }
+                        else
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 1;
+                            objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
                         if (oBill.omodel.HChecker.Trim() == "")
                         {
                             objJsonResult.code = "0";

--
Gitblit v1.9.1