From 54c10168f9082762cb3ff02cde879a6c2d73f9b5 Mon Sep 17 00:00:00 2001 From: yusijie <ysj@hz-kingdee.com> Date: 星期三, 07 十二月 2022 16:33:05 +0800 Subject: [PATCH] 收料通知单子表插入语句去除 HGIVEAWAY 字段 --- WebAPI/Controllers/BaseSet/Gy_MaterialController.cs | 84 ++++++++++++++++++++++++++++++------------ 1 files changed, 60 insertions(+), 24 deletions(-) diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs index b0e262b..b638e39 100644 --- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs +++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs @@ -194,32 +194,22 @@ objJsonResult.data = 1; return objJsonResult; } - if (!DBUtility.ClsPub.AllowNumber(oItem.HNumber.Trim())) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷腑涓嶈兘鍑虹幇杩炵画鈥�.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; - objJsonResult.data = 1; - return objJsonResult; - } + //if (!DBUtility.ClsPub.AllowNumber(oItem.HNumber.Trim())) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷腑涓嶈兘鍑虹幇杩炵画鈥�.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; + // objJsonResult.data = 1; + // return objJsonResult; + //} //鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮� ds = oCN.RunProcReturn("select * from Gy_Material where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_Material"); - if (oItem.HNumber.Trim() == "") - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷负绌猴紒"; - objJsonResult.data = 1; - return objJsonResult; - } //鏂板鏃跺垽鏂� + #region 鐖剁骇鏍¢獙鏂规硶锛坅pi璋冪敤鍏堟敞閲婃帀锛岋級 + /* if (oItem.HItemID == 0) { - if (ds == null || ds.Tables[0].Rows.Count == 0) - { - - } - else + if (ds == null || ds.Tables[0].Rows.Count > 0) { objJsonResult.code = "0"; objJsonResult.count = 0; @@ -275,6 +265,8 @@ } } } + */ + #endregion //寰楀埌鐭唬鐮� string sShortNumber; sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim()); @@ -292,13 +284,12 @@ oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //绛夌骇 oBill.oModel = oItem; } - //淇濆瓨 //淇濆瓨瀹屾瘯鍚庡鐞� bool bResult; if (oBill.oModel.HItemID == 0) { - // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); + //bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddNew(); } else @@ -333,7 +324,52 @@ } } - + [Route("Gy_Material/SaveGy_MaterialListApi")] + [HttpPost] + public object SaveGy_MaterialListApi([FromBody] JObject msg) + { + var _value = msg["model"].ToString(); + string msg3 = _value.ToString(); + string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg1 = sArray[0].ToString(); + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + ListModels oListModels = new ListModels(); + try + { + DLL.ClsGy_Material_Ctl oBill = new DLL.ClsGy_Material_Ctl(); + List<Models.ClsGy_Material_Model> lsmain = new List<Models.ClsGy_Material_Model>(); + msg1 = msg1.Replace("\\", ""); + msg1 = msg1.Replace("\n", ""); //\n + lsmain = oListModels.getObjectByJson_Gy_Material(msg1); + oBill.oModel = lsmain[0]; + //淇濆瓨 + bool bResult = oBill.AddNewApi(); + if (bResult) + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = 1; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString(); + objJsonResult.data = 1; + return objJsonResult; + } + } /// <summary> /// 鐗╂枡璁剧疆鍒犻櫎鍔熻兘 -- Gitblit v1.9.1