From 278c9cfdb2aef8ac079e04b94719c6125b747d4b Mon Sep 17 00:00:00 2001 From: duhe <226547893@qq.com> Date: 星期四, 18 一月 2024 09:11:41 +0800 Subject: [PATCH] 特批申请单:审核时对于单据状态为0的单据无法审核,提示单据不为“创建”状态 --- WebAPI/Controllers/XSGL/Xs_SeOrderChangeBillController.cs | 52 ++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 36 insertions(+), 16 deletions(-) diff --git a/WebAPI/Controllers/XSGL/Xs_SeOrderChangeBillController.cs b/WebAPI/Controllers/XSGL/Xs_SeOrderChangeBillController.cs index 2d87c4e..1d424a4 100644 --- a/WebAPI/Controllers/XSGL/Xs_SeOrderChangeBillController.cs +++ b/WebAPI/Controllers/XSGL/Xs_SeOrderChangeBillController.cs @@ -37,14 +37,14 @@ { List<object> columnNameList = new List<object>(); //鏌ョ湅鏉冮檺 - //if (!DBUtility.ClsPub.Security_Log("Gy_ProjectStage_Query", 1, false, user)) - //{ - // objJsonResult.code = "0"; - // objJsonResult.count = 0; - // objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒"; - // objJsonResult.data = null; - // return objJsonResult; - //} + if (!DBUtility.ClsPub.Security_Log("Xs_SeOrderChangeBill_Query", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } if (sWhere == null || sWhere.Equals("")) { @@ -473,15 +473,28 @@ DateTime today = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")); //褰撴棩鏃ユ湡 foreach (Model.ClsXs_SeOrderChangeBillSub oSub in oBill.DetailColl) { - //鍒ゆ柇鏂版暟閲忔槸鍚﹀皬浜庡崟鎹叧鑱旀暟閲� - if(oSub.HQty_New < oSub.HRelationQty) + string sqlCheck = "select * from Xs_SeOrderBillSub where HInterID = " + oSub.HSourceInterID + " and HEntryID = " + oSub.HSourceEntryID; + ds = oCN.RunProcReturn(sqlCheck, "Xs_SeOrderBillSub"); + if (ds.Tables[0].Rows.Count == 0) { - errorMessage += "绗�" + oSub.HEntryID + "琛岀墿鏂欐柊鏁伴噺灏忎簬鍗曟嵁琚叧鑱旀暟閲�!"; - } - //鍒ゆ柇鏂颁氦璐ф棩鏈熸槸鍚︽棭浜庡綋鏃� - if ( oSub.HDate_New.CompareTo(today) < 0 ) + errorMessage += "绗�" + oSub.HEntryID + "琛岀墿鏂欏湪婧愬崟-閿�鍞鍗曚腑涓嶅瓨鍦�!"; + } + else { - errorMessage += "绗�" + oSub.HEntryID + "琛屾柊浜よ揣鏃ユ湡鏃╀簬褰撴棩!"; + double HRelationQty = 0; + //鑾峰彇閿�鍞鍗曞彉鏇村崟涓搴旂墿鏂欏湪婧愬崟-閿�鍞鍗曚腑鐨勫叧鑱旀暟閲� + HRelationQty = double.Parse(ds.Tables[0].Rows[0]["HRelationQty"].ToString()); + + //鍒ゆ柇鐗╂枡鏂版暟閲忔槸鍚﹀皬浜庢簮鍗曞崟鎹腑瀵瑰簲鐗╂枡鐨勫叧鑱旀暟閲� + if (oSub.HQty_New < HRelationQty) + { + errorMessage += "绗�" + oSub.HEntryID + "琛岀墿鏂欐柊鏁伴噺灏忎簬婧愬崟-閿�鍞鍗曡鍏宠仈鏁伴噺!"; + } + //鍒ゆ柇鏂颁氦璐ф棩鏈熸槸鍚︽棭浜庡綋鏃� + if (oSub.HDate_New.CompareTo(today) < 0) + { + errorMessage += "绗�" + oSub.HEntryID + "琛屾柊浜よ揣鏃ユ湡鏃╀簬褰撴棩!"; + } } } if(errorMessage != "") @@ -505,6 +518,13 @@ 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(); @@ -512,7 +532,7 @@ 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; + sql = "exec h_p_Kf_CheckSeOrderChangeBill_CrediControl " + oBill.omodel.HMainSourceInterID; ds = oCN.RunProcReturn(sql, "h_p_Kf_CheckSeOrderBill_CrediControl"); if (ds.Tables[0].Rows[0]["HBack"].ToString() == "1") { -- Gitblit v1.9.1