From 1ce0de5fe9438f3f237bdce8e261be94eee64a2b Mon Sep 17 00:00:00 2001 From: yusijie <ysj@hz-kingdee.com> Date: 星期三, 21 二月 2024 17:32:42 +0800 Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API --- WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs | 130 +++++++++++++++++++++++++++++++++++++----- 1 files changed, 113 insertions(+), 17 deletions(-) diff --git a/WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs b/WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs index acb4b83..3f7426b 100644 --- a/WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs +++ b/WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs @@ -410,6 +410,44 @@ objJsonResult.data = null; return objJsonResult; } + + string HBillNo = ""; + ds = oCN.RunProcReturn("select * from Kf_ICStockBillMain where HInterID=" + Hmainid, "Kf_ICStockBillMain "); + 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_Kf_POStockInBill_BeforeDelCtrl " + Hmainid + ",'" + HBillNo + "','" + user + "'"; + ds = oCN.RunProcReturn(sql1, "h_p_Kf_POStockInBill_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; + } + //================================================================================== + oCN.BeginTran();//寮�濮嬩簨鍔� ds = oCN.RunProcReturn("select * from Kf_ICStockBillMain a inner join Kf_ICStockBillSub b on a.HInterID=b.HInterID where a.HInterID= '"+ Hmainid+"'", "Kf_ICStockBillMain"); dss = oCN.RunProcReturn("exec h_p_Cg_POInStockBillMain " + HQty + ", '" + HSourceInterID + "', '" + HSourceEntryID + "','" + user + " '", "h_p_Cg_POInStockBillMain"); @@ -423,15 +461,7 @@ objJsonResult.data = null; return objJsonResult; } - - if (ds == null || ds.Tables[0].Rows.Count == 0) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒"; - objJsonResult.data = null; - return objJsonResult; ; - } + if (ds.Tables[0].Rows.Count == 1) { oCN.RunProc("delete Kf_ICStockBillSub where HInterID=" + Hmainid); @@ -441,7 +471,36 @@ { oCN.RunProc($"delete Kf_ICStockBillSub where HInterID={ Hmainid}and HEntryID={HsupId}"); } + + + oCN.Commit();//鎻愪氦浜嬪姟 + + //鍒犻櫎鍚庢帶鍒�================================================================================== + string sql2 = "exec h_p_Kf_POStockInBill_AfterDelCtrl " + Hmainid + ",'" + HBillNo + "','" + user + "'"; + ds = oCN.RunProcReturn(sql2, "h_p_Kf_POStockInBill_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 = "0"; objJsonResult.count = 1; objJsonResult.Message = "鏁版嵁鍒犻櫎鎴愬姛锛�"; @@ -724,14 +783,14 @@ objJsonResult.data = null; return objJsonResult; } - //if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "") - //{ - // objJsonResult.code = "0"; - // objJsonResult.count = 0; - // objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶈兘杩涜鍏抽棴!"; - // objJsonResult.data = null; - // return objJsonResult; - //} + if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶈兘杩涜鍏抽棴!"; + objJsonResult.data = null; + return objJsonResult; + } if (ds.Tables[0].Rows[0]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "") { @@ -948,6 +1007,43 @@ #endregion + #region 閲囪喘鍏ュ簱鍗� 鏍规嵁涓诲唴鐮佷笌瀛愬唴鐮佽幏鍙栭噰璐叆搴撳崟鏁版嵁 + [Route("Kf_POStockInBill/loadKf_POStockInBill_Push")] + [HttpGet] + public object loadKf_POStockInBill_Push(long HInterID, long HSubID) + { + try + { + + ds = oCN.RunProcReturn("select * from h_v_IF_POStockInBillList_EditInit where hmainid =" + HInterID + " and hsubid = " + HSubID, "h_v_IF_POStockInBillList_EditInit"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏈煡璇㈠埌婧愬崟淇℃伅锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + } } #endregion \ No newline at end of file -- Gitblit v1.9.1