From 7c266b6861f6330158a6f913c3b384db957d5fe7 Mon Sep 17 00:00:00 2001 From: zrg <z18737863051@163.com> Date: 星期二, 12 三月 2024 16:18:39 +0800 Subject: [PATCH] 子表备注 --- WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs | 62 ++++++++++++------------------- 1 files changed, 24 insertions(+), 38 deletions(-) diff --git a/WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs b/WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs index 5df7cf7..cfffd2c 100644 --- a/WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs +++ b/WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs @@ -1167,7 +1167,7 @@ } UserName = oItem.HMaker; //鍒跺崟浜� oItem.HBillType = "1401"; - oItem.HBillSubType = "1401"; + //oItem.HBillSubType = "1401"; oItem.HSALEORGID = oItem.HOrgID; oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); @@ -1737,22 +1737,18 @@ } if (IsAudit == 1) //鍙嶅叧闂彁浜� { - oBill.oCn.BeginTran(); + ds = oCN.RunProcReturn("exec h_p_Kf_CheckSeOrderBill_CrediControl " + oBill.omodel.HInterID, "h_p_Kf_CheckSeOrderBill_CrediControl"); + if (ds.Tables[0].Rows[0]["HBack"].ToString() == "1") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); + objJsonResult.data = null; + return objJsonResult; + } //鍙嶅叧闂彁浜� if (oBill.CancelClose(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) { - ds = oCN.RunProcReturn("exec h_p_Kf_CheckSeOrderBill_CrediControl " + oBill.omodel.HInterID, "h_p_Kf_CheckSeOrderBill_CrediControl"); - if (ds.Tables[0].Rows[0]["HBack"].ToString() == "1") - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); - objJsonResult.data = null; - oBill.oCn.RollBack(); - return objJsonResult; - } - - oBill.oCn.Commit(); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "鍙嶅叧闂垚鍔�"; @@ -1765,7 +1761,6 @@ objJsonResult.count = 0; objJsonResult.Message = "鍙嶅叧闂け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; - oBill.oCn.RollBack(); return objJsonResult; } } @@ -1927,13 +1922,25 @@ } if (IsAudit == 1) //琛屽弽鍏抽棴鎻愪氦 { + //oBill.oCn.BeginTran(); //琛屽弽鍏抽棴鎻愪氦 if (oBill.CancelRow(lngBillKey, HEntryID, oBill.omodel.HBillNo, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) { + //ds = oCN.RunProcReturn("exec h_p_Kf_CheckSeOrderBill_CrediControl " + oBill.omodel.HInterID, "h_p_Kf_CheckSeOrderBill_CrediControl"); + //if (ds.Tables[0].Rows[0]["HBack"].ToString() == "1") + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); + // objJsonResult.data = null; + // oBill.oCn.RollBack(); + // return objJsonResult; + //} objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "鍙嶅叧闂垚鍔�"; objJsonResult.data = null; + //oBill.oCn.Commit(); return objJsonResult; } else @@ -1942,6 +1949,7 @@ objJsonResult.count = 0; objJsonResult.Message = "鍙嶅叧闂け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; + //oBill.oCn.RollBack(); return objJsonResult; } } @@ -2218,29 +2226,7 @@ } else { - string sql = "select * from Gy_UserCustomerRelation where HUserID = '" + CurUserID + "'"; - ds = oCN.RunProcReturn(sql, "Gy_UserCustomerRelation"); - if (ds == null || ds.Tables[0].Rows.Count == 0) - { - sWhere = " and 1 = 0"; - } - else - { - sWhere = " and HCusID in ("; - for (var i = 0; i < ds.Tables[0].Rows.Count; i++) - { - if (i < ds.Tables[0].Rows.Count - 1) - { - sWhere += ds.Tables[0].Rows[i]["HCusID"].ToString() + ","; - } - else - { - sWhere += ds.Tables[0].Rows[i]["HCusID"].ToString() + ")"; - } - } - } - - //sWhere = " and 1=1 "; + sWhere = " and HCusID in (select hcusid from Gy_UserCustomerRelation Where HUserID = '" + CurUserID + "') "; } objJsonResult.code = "1"; -- Gitblit v1.9.1