From 8a418b4192bff10d005940210681bb406a4c2f6a Mon Sep 17 00:00:00 2001 From: cwjbxqmz <1134865194@qq.com> Date: 星期五, 17 十一月 2023 10:34:16 +0800 Subject: [PATCH] 1 --- WebAPI/Controllers/XSGL/Xs_SeOrderChangeBillController.cs | 34 +++++++++++++++++++++++++++++----- 1 files changed, 29 insertions(+), 5 deletions(-) diff --git a/WebAPI/Controllers/XSGL/Xs_SeOrderChangeBillController.cs b/WebAPI/Controllers/XSGL/Xs_SeOrderChangeBillController.cs index d8c9740..f36f922 100644 --- a/WebAPI/Controllers/XSGL/Xs_SeOrderChangeBillController.cs +++ b/WebAPI/Controllers/XSGL/Xs_SeOrderChangeBillController.cs @@ -505,17 +505,37 @@ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:婧愬崟涓嶅瓨鍦�!"; objJsonResult.data = null; return objJsonResult; + }else if(ds.Tables[0].Rows[0]["HBillStatus"].ToString() != "2") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:婧愬崟鏈浜庡鏍哥姸鎬�!"; + objJsonResult.data = null; + return objJsonResult; + } + + oCN.BeginTran(); + //鍙嶅啓閿�鍞鍗曟暟鎹� + sql = "exec h_p_IF_SeOrderBill_ReWriteBySeOrderChangeBill " + oBill.omodel.HInterID; + oCN.RunProcReturn(sql, "h_p_IF_SeOrderBill_ReWriteBySeOrderChangeBill"); + //淇$敤鎺у埗 + sql = "exec h_p_Kf_CheckSeOrderBill_CrediControl " + oBill.omodel.HMainSourceInterID; + ds = oCN.RunProcReturn(sql, "h_p_Kf_CheckSeOrderBill_CrediControl"); + if (ds.Tables[0].Rows[0]["HBack"].ToString() == "1") + { + oCN.RollBack(); + + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); + objJsonResult.data = null; + return objJsonResult; } //瀹℃牳鎻愪氦 if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) { - oCN.BeginTran(); - //鍙嶅啓閿�鍞鍗曟暟鎹� - sql = "exec h_p_IF_SeOrderBill_ReWriteBySeOrderChangeBill " + oBill.omodel.HInterID; - oCN.RunProcReturn(sql, "h_p_IF_SeOrderBill_ReWriteBySeOrderChangeBill"); oCN.Commit(); - objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "瀹℃牳鎴愬姛"; @@ -524,6 +544,8 @@ } else { + oCN.RollBack(); + objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo; @@ -555,6 +577,8 @@ } catch (Exception e) { + oCN.RollBack(); + objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "瀹℃牳澶辫触鎴栬�呭弽瀹℃牳澶辫触锛�" + e.ToString(); -- Gitblit v1.9.1