From 00d963405d2d5161052934f2cb67a2b6ea0947dd Mon Sep 17 00:00:00 2001 From: zrg <z18737863051@163.com> Date: 星期二, 23 四月 2024 17:14:30 +0800 Subject: [PATCH] 1.销售出库单 增加 反写源单 销售订单和发货通知单 超出 关联数量 关闭源单 2.应收单 增加 反写源单 销售出库单 和 销售订单 超出关联数量 关闭源单 3.动态获取源单增加参数 Num 0蓝单 1红单 2全部 4.销售流程的测试并完善功能; 销售订单-》发货通知单-》销售出库单-》应收单 (注意: 源单类型的下拉框 需要 根据数据库 表动态加载, 关联数量 要准确 , 审核 且 未关闭 未行关闭的行 才能下推 ,关联数量超额后,要 反写 关闭 源单 ) --- WebAPI/Controllers/CGGL/Kf_POStockInBackBillController.cs | 85 ++++++++---------------------------------- 1 files changed, 17 insertions(+), 68 deletions(-) diff --git a/WebAPI/Controllers/CGGL/Kf_POStockInBackBillController.cs b/WebAPI/Controllers/CGGL/Kf_POStockInBackBillController.cs index f3a19ca..bd97c5b 100644 --- a/WebAPI/Controllers/CGGL/Kf_POStockInBackBillController.cs +++ b/WebAPI/Controllers/CGGL/Kf_POStockInBackBillController.cs @@ -176,7 +176,7 @@ ds = oCN.RunProcReturn("select * from h_v_Kf_POStockInBackBillList where hmainid=" + HInterID + " and 鍗曟嵁鍙�='" + HBillNo + "'", "h_v_Kf_POStockInBackBillList"); - if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//鏂板 + if ((OperationType == 1 || OperationType == 2 || OperationType == 4) && ds.Tables[0].Rows.Count == 0)//鏂板 { //淇濆瓨鍓嶆帶鍒�========================================= ds = oCN.RunProcReturn("exec h_p_Kf_POStockInBackBill_BeforeSaveCtrl " + HInterID, "h_p_Kf_POStockInBackBill_BeforeSaveCtrl"); @@ -225,6 +225,9 @@ } //淇濆瓨瀛愯〃 objJsonResult = AddBillSub(msg3, HInterID, OperationType, user); + + //閲囪喘閫�鏂欏崟鏂板鍥炲~閫�鏂欓�氱煡鍗曞叧鑱旀暟閲� + oCN.RunProc("exec h_p_Kf_UpDateRelation_POStockInBackToPOInStockBack_Add " + HInterID); if (objJsonResult.code == "0") { @@ -384,58 +387,13 @@ /// <returns></returns> [Route("Kf_POStockInBackBill/DeltetKf_POStockInBackBill")] [HttpGet] - public object DeleteKf_POStockInBackBill(string Hmainid, string HsupId,string user) + public object DeltetKf_POStockInBackBill(string HInterID, string user) { - DataSet ds; - DataSet dss; - //string ModRightNameCheck = "Sc_ProcessReport_check"; try { - //鍒犻櫎鏉冮檺 - if (!DBUtility.ClsPub.Security_Log("Kf_POStockInBackBill_Delete", 1, false, user)) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒"; - objJsonResult.data = null; - return objJsonResult; - } - - SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - if (string.IsNullOrWhiteSpace(Hmainid)) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "Hmainid涓虹┖锛�"; - 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 '" + user + " '", "h_p_Cg_POInStockBillMain"); - var sReturn = ""; string HBillNo = ""; - if (DBUtility.ClsPub.isLong(dss.Tables[0].Rows[0]["HBack"]) != 0) - { - sReturn = DBUtility.ClsPub.isStrNull(dss.Tables[0].Rows[0]["HBackRemark"]).ToString(); - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = sReturn; - 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; ; - } - //鍒犻櫎鍓嶆帶鍒�========================================= - string sql1 = "exec h_p_Kf_POStockInBackBill_BeforeDelCtrl " + Hmainid + ",'" + HBillNo + "','" + user + "'"; + string sql1 = "exec h_p_Kf_POStockInBackBill_BeforeDelCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'"; ds = oCN.RunProcReturn(sql1, "h_p_Kf_POStockInBackBill_BeforeDelCtrl"); if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) { @@ -456,21 +414,14 @@ } //================================================================================== - - if (ds.Tables[0].Rows.Count == 1) - { - oCN.RunProc("delete Kf_ICStockBillSub where HInterID=" + Hmainid); - oCN.RunProc("delete Kf_ICStockBillMain where HInterID=" + Hmainid); - } - else - { - oCN.RunProc($"delete Kf_ICStockBillSub where HInterID={ Hmainid}and HEntryID={HsupId}"); - } - oCN.Commit();//鎻愪氦浜嬪姟 - + string sReturn = ""; + oCN.BeginTran(); + oCN.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID); + oCN.RunProc("Delete From Kf_ICStockBillSub where HInterID = " + HInterID); + oCN.Commit(); //鍒犻櫎鍚庢帶鍒�================================================================================== - string sql2 = "exec h_p_Kf_POStockInBackBill_AfterDelCtrl " + Hmainid + ",'" + HBillNo + "','" + user + "'"; + string sql2 = "exec h_p_Kf_POStockInBackBill_AfterDelCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'"; ds = oCN.RunProcReturn(sql2, "h_p_Kf_POStockInBackBill_AfterDelCtrl"); if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) { @@ -494,24 +445,22 @@ } //============================================================================================== - - objJsonResult.code = "0"; + objJsonResult.code = "1"; objJsonResult.count = 1; - objJsonResult.Message = "鏁版嵁鍒犻櫎鎴愬姛锛�"; + objJsonResult.Message = "鍒犻櫎鎴愬姛锛�"; objJsonResult.data = null; - return objJsonResult; ; - + return objJsonResult; } catch (Exception e) { + oCN.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString(); + objJsonResult.Message = "Exception锛�" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } - /// <summary> /// 鏍规嵁鍩虹璧勬枡ID 鏌ユ壘璁板綍 -- Gitblit v1.9.1