From f02c7cbe27d7da079f057b464e2b179f1dc17b08 Mon Sep 17 00:00:00 2001 From: yxj <yxj@hz-kingdee.com> Date: 星期二, 18 三月 2025 09:26:16 +0800 Subject: [PATCH] 新增提料运算(根据欠料单进行计算)调用方法 --- WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs | 138 +++++++++++++++++++++++---------------------- 1 files changed, 71 insertions(+), 67 deletions(-) diff --git a/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs b/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs index 025a372..2ec71e3 100644 --- a/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs +++ b/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs @@ -241,6 +241,21 @@ return objJsonResult; } } + else if (oSystemParameter.omodel.WMS_CampanyName == "娣诲悍绉戞妧") + { + DataSet dss; + dss = oCN.RunProcReturn("select COUNT(*) as number from Sc_ProcessExchangeBillMain where HRoutingBillID = " + HInterID, "Gy_RoutingBillMain"); + //鍒ゆ柇鏄惁鍙紪杈� + if (dss.Tables[0].Rows[0]["number"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝ゅ崟鎹凡缁忚寮曠敤锛屼笉鍏佽淇敼锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + } + if (OperationType == 2) { ds = oCN.RunProcReturn("select * from h_v_Gy_RoutingBillList where 鍗曟嵁鍙�='" + HBillNo + "'", "h_v_Gy_RoutingBillList"); @@ -297,26 +312,26 @@ //=========================淇濆瓨鍚庢帶鍒� 娣诲姞瀹℃壒娴� - DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_RoutingBill_AfterSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "',1 ", "h_p_Gy_RoutingBill_AfterSaveCtrl"); - if (ds2 == null) - { - oCN.RollBack(); - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "淇濆瓨鍚庢帶鍒跺垽鏂け璐ワ紒"; - objJsonResult.data = null; - return objJsonResult; + //DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_RoutingBill_AfterSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "',1 ", "h_p_Gy_RoutingBill_AfterSaveCtrl"); + //if (ds2 == null) + //{ + // oCN.RollBack(); + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "淇濆瓨鍚庢帶鍒跺垽鏂け璐ワ紒"; + // objJsonResult.data = null; + // return objJsonResult; - } - if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") - { - oCN.RollBack(); - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "淇濆瓨澶辫触2锛�" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); - objJsonResult.data = null; - return objJsonResult; - } + //} + //if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") + //{ + // oCN.RollBack(); + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "淇濆瓨澶辫触2锛�" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); + // objJsonResult.data = null; + // return objJsonResult; + //} //============================ LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",鏂板宸ヨ壓璺嚎鍗曟嵁:" + HBillNo); @@ -340,17 +355,6 @@ objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "姝ゅ崟鎹姸鎬佹湭鍦ㄥ垱寤猴紝涓嶅厑璁镐慨鏀癸紒"; - objJsonResult.data = 1; - return objJsonResult; - } - - dss = oCN.RunProcReturn("select COUNT(*) as number from Sc_ProcessExchangeBillMain where HRoutingBillID = " + HInterID, "Gy_RoutingBillMain"); - //鍒ゆ柇鏄惁鍙紪杈� - if (dss.Tables[0].Rows[0]["number"].ToString() != "0") - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "姝ゅ崟鎹凡缁忚寮曠敤锛屼笉鍏佽淇敼锛�"; objJsonResult.data = 1; return objJsonResult; } @@ -393,26 +397,26 @@ oCN.RunProc("delete from Gy_RoutingBillSub where HInterID='" + HInterID + "'"); //=========================淇濆瓨鍚庢帶鍒� 娣诲姞瀹℃壒娴� - DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_RoutingBill_AfterSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "',2 ", "h_p_Gy_RoutingBill_AfterSaveCtrl"); - if (ds2 == null) - { - oCN.RollBack(); - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "淇濆瓨鍚庢帶鍒跺垽鏂け璐ワ紒"; - objJsonResult.data = null; - return objJsonResult; + //DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_RoutingBill_AfterSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "',2 ", "h_p_Gy_RoutingBill_AfterSaveCtrl"); + //if (ds2 == null) + //{ + // oCN.RollBack(); + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "淇濆瓨鍚庢帶鍒跺垽鏂け璐ワ紒"; + // objJsonResult.data = null; + // return objJsonResult; - } - if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") - { - oCN.RollBack(); - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "淇濆瓨澶辫触2锛�" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); - objJsonResult.data = null; - return objJsonResult; - } + //} + //if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") + //{ + // oCN.RollBack(); + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "淇濆瓨澶辫触2锛�" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); + // objJsonResult.data = null; + // return objJsonResult; + //} //============================ LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",淇敼宸ヨ壓璺嚎鍗曟嵁:" + HBillNo); @@ -632,24 +636,24 @@ } ////淇濆瓨鍚庢帶鍒�========================================= 娣诲姞瀹℃壒娴� - //ds = oCN.RunProcReturn("exec h_p_Gy_RoutingBill_AfterSaveCtrl " + HInterID, "h_p_Gy_RoutingBill_AfterSaveCtrl"); + ds = oCN.RunProcReturn("exec h_p_Gy_RoutingBill_AfterSaveCtrl " + HInterID + ",'',"+ OperationType, "h_p_Gy_RoutingBill_AfterSaveCtrl"); - //if (ds == null || ds.Tables[0].Rows.Count == 0) - //{ - // objJsonResult.code = "0"; - // objJsonResult.count = 0; - // objJsonResult.Message = "淇濆瓨鍚庡垽鏂け璐ワ紒"; - // objJsonResult.data = null; - // return objJsonResult; - //} - //if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") - //{ - // objJsonResult.code = "0"; - // objJsonResult.count = 0; - // objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); - // 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 (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); + objJsonResult.data = null; + return objJsonResult; + } ////========================================================= } @@ -853,7 +857,7 @@ try { - ds = oCN.RunProcReturn("select a.*,m.HProcPriceType,m.HBeginDate,m.HEndDate,s.HQCProc,s.HQCFst,s.HQCPatrol,s.HMaterToSourceCtrl from h_v_Gy_RoutingBillList as a,Gy_RoutingBillMain as m,Gy_RoutingBillSub as s where m.HInterID = hmainid and s.HInterID = hmainid and s.HEntryID = hsubid and hmainid =" + HInterID, "h_v_Gy_RoutingBillList"); + ds = oCN.RunProcReturn("select a.*,m.HProcPriceType,m.HBeginDate,m.HEndDate,s.HQCProc,s.HQCFst,s.HQCPatrol,s.HMaterToSourceCtrl from h_v_Gy_RoutingBill_Edit as a,Gy_RoutingBillMain as m,Gy_RoutingBillSub as s where m.HInterID = hmainid and s.HInterID = hmainid and s.HEntryID = hsubid and hmainid =" + HInterID, "h_v_Gy_RoutingBillList"); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; -- Gitblit v1.9.1