From 84f084b5b5a4593d4e4e30d2c95b91ca0e0e3384 Mon Sep 17 00:00:00 2001 From: yangle <admin@YINMOU> Date: 星期二, 29 三月 2022 13:23:18 +0800 Subject: [PATCH] 查询过滤 仓库发料 拣料配送列表上查 页面优化 --- WebAPI/Controllers/WebAPIController.cs | 264 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 258 insertions(+), 6 deletions(-) diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs index cdb2ac3..95a5aeb 100644 --- a/WebAPI/Controllers/WebAPIController.cs +++ b/WebAPI/Controllers/WebAPIController.cs @@ -345,6 +345,159 @@ } + + //鏍规嵁鎷栨潯鐮佽繑鍥炴潯鐮佹。妗堣〃鍞竴鐮佷俊鎭� + [Route("GroupOrder/GetBillEntry_TmpListGroupOrder")] + [HttpGet] + public object GetBillEntry_TmpListGroupOrder(string HBarCode) + { + try + { + ds = webserver.GetBarCode(HBarCode); + if (ds == null || ds.Tables[0].Rows.Count <= 0) + { + + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�"; + objJsonResult.data = null; + return objJsonResult; + //DBUtility.ClsPub.MessageBeep((int)DBUtility.ClsPub.BeepType.Warning); + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + + + //鏍规嵁缃戞牸閫変腑璁板綍鍘讳慨鏀规潯鐮佹。妗堛�佺粍鎵樺崟瀛愯〃璁板綍骞堕噸鏂扮敓鎴愮粍鎵樺崟sum琛� + [Route("GroupOrderBill/Edit")] + [HttpGet] + public object Edit(string HBarCode1, Int64 HQty) + { + + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + try + { + oCN.RunProc("update Gy_BarCodeBill set HQty = " + HQty.ToString() + " where HBarCode = '" + HBarCode1 + "'"); + oCN.RunProc("update Sc_PackUnionBillSub set HQty = " + HQty.ToString() + " where HBarCode = '" + HBarCode1 + "'"); + DataSet ds = oCN.RunProcReturn("exec h_p_DisPlayBarCode '" + HBarCode1 + "'", "h_p_DisPlayBarCode"); + + long HInterIDTTM = 0; + long HInterID = 0; + string HBarCode_Pack = ""; + string HBarCode = ""; + string HUser = ""; + HInterIDTTM = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HInterID_TTM"]); + HBarCode_Pack = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBarCode_Pack"]); + HUser = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HMaker"]); + HInterID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HInterID"]); + oCN.RunProc("exec h_p_WMS_PackUnionBill_SumSubBill " + HInterIDTTM.ToString() + ",'" + HBarCode_Pack + "','3783','" + HUser + "'," + HInterID.ToString()); //鏍规嵁绠辨潯鐮侊紝鍐欏叆 SUM琛紝SUM鏉$爜妗f + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "淇敼鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; + } + //DataSet DS1 = webserver.GetBarCode(HBarCode); //HSPID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HSPID"]); + + //ds = webserver.GetUnitList(sWhere, ref DBUtility.ClsPub.sErrInfo); + + + //if (DS1 == null || DS1.Tables[0].Rows.Count <= 0) + // { + // objjson.code = "0"; + // objjson.count = 0; + // objjson.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo; + // objjson.data = null; + // return objjson; + // } + // else + // { + // objjson.code = "0"; + // objjson.count = 1; + // objjson.Message = "鑾峰彇鎴愬姛!"; + // objjson.data = DS1.Tables[0]; + // return objjson; + // } + //} + catch (Exception ex) + { + + objjson.code = "0"; + objjson.count = 0; + objjson.Message = "鑾峰彇澶辫触" + ex.ToString(); + objjson.data = null; + return objjson; + } + } + + //鏍规嵁缃戞牸閫変腑璁板綍鐨勫敮涓�鐮� 鍘诲垹闄ゆ潯鐮佹。妗� 缁勬墭鍗曞瓙琛� 缁勬墭鍗晄um琛ㄧ殑鍞竴鐮佹暟鎹� + [Route("GroupOrderBill/Delete")] + [HttpGet] + public object Delete(string HBarCode1) + { + + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + try + { + oCN.RunProc("delete from Gy_BarCodeBill where HBarCode = '" + HBarCode1 + "'"); + oCN.RunProc("delete from Sc_PackUnionBillSub where HBarCode = '" + HBarCode1 + "'"); + oCN.RunProc("delete from Sc_PackUnionBillSub_Sum where HBarCode = '" + HBarCode1 + "'"); //HSPID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HSPID"]); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; + } + //ds = webserver.GetUnitList(sWhere, ref DBUtility.ClsPub.sErrInfo); + + + //if (DS1 == null || DS1.Tables[0].Rows.Count <= 0) + // { + // objjson.code = "0"; + // objjson.count = 0; + // objjson.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo; + // objjson.data = null; + // return objjson; + // } + // else + // { + // objjson.code = "0"; + // objjson.count = 1; + // objjson.Message = "鑾峰彇鎴愬姛!"; + // objjson.data = DS1.Tables[0]; + // return objjson; + // } + //} + catch (Exception ex) + { + + objjson.code = "0"; + objjson.count = 0; + objjson.Message = "鍒犻櫎澶辫触" + ex.ToString(); + objjson.data = null; + return objjson; + } + } + + //鏍规嵁榛戠偣/鐧界偣杩斿洖涓嶈壇浠g爜銆佷笉鑹唴鐮� [Route("Web/GetHWBDot")] [HttpGet] @@ -1940,18 +2093,117 @@ return objjson; } } + + [Route("Web/GetClassTimePrjGroupBillList_Json")] + [HttpGet] + public object GetClassTimePrjGroupBillList_Json(string sWhere,string user) + { + if (!DBUtility.ClsPub.Security_Log("Gy_ClassTimePrj", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鏌ョ湅鏉冮檺"; + objJsonResult.data = null; + return objJsonResult; + } + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + string sql = "Select a.HItemID ,HNumber 鏍哥畻鏂瑰紡缁勪唬鐮�,HName 鏍哥畻鏂瑰紡缁勫悕绉�,HDeptID,b.閮ㄩ棬鍚嶇О 閮ㄩ棬 from Gy_ClassTimePrjGroup a left join h_v_Gy_Department b on a.HDeptID=b.HItemID"; + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn(sql, "Gy_ClassTimePrjGroup"); + } + else + { + sql = sql + sWhere; + ds = oCN.RunProcReturn(sql, "Gy_ClassTimePrjGroup"); + } + + //ds = webserver.GetUnitList(sWhere, ref DBUtility.ClsPub.sErrInfo); + + + if (ds == null || ds.Tables[0].Rows.Count <= 0) + { + objjson.code = "0"; + objjson.count = 0; + objjson.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo; + objjson.data = null; + return objjson; + } + else + { + objjson.code = "0"; + objjson.count = 1; + objjson.Message = "鑾峰彇鎴愬姛!"; + objjson.data = ds.Tables[0]; + return objjson; + } + } + catch (Exception ex) + { + + objjson.code = "0"; + objjson.count = 0; + objjson.Message = "鑾峰彇澶辫触" + ex.ToString(); + objjson.data = null; + return objjson; + } + } + #region 鍒犻櫎鏍哥畻鏂瑰紡缁� + /// <summary> + /// 鏍哥畻鏂瑰紡鍒楄〃鍒犻櫎鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Web/DeleteClassTimePrjGroupBillList")] + [HttpGet] + public object DeleteClassTimePrjGroupBillList(long HItemID, string User) + { + try + { + if (!DBUtility.ClsPub.Security_Log("Gy_ClassTimePrj_Delete", 1, false, User)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鍒犻櫎鏉冮檺"; + objJsonResult.data = null; + return objJsonResult; + } + oCN.BeginTran(); + string sql = "delete from Gy_ClassTimePrjGroup where HItemID =" + HItemID; + oCN.RunProc(sql); + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion /// <summary> /// 淇濆瓨鑾峰彇鏍哥畻鏂瑰紡缁� /// </summary> /// <param name="msg"></param> /// <returns></returns> [Route("Web/SaveGetClassTimePrjGroupList")] - [HttpPost] - public object SaveGetClassTimePrjGroupList(string HNumber,string HName,int HDeptID,string refSav,string user,int HItem) + [HttpGet] + public object SaveGetClassTimePrjGroupList(string HNumber,string HName,string HDeptID,string refSav,string user,string HItem) { try { + int HItemID = int.Parse(HItem); //缂栬緫鏉冮檺 if (!DBUtility.ClsPub.Security_Log_second("Gy_ClassTimePrj", 1, false, user)) { @@ -1965,14 +2217,14 @@ if (refSav== "Add") { sql = "Insert Into Gy_ClassTimePrjGroup " + - "(HNumber,HName,HStpoflag,HParentID,HLevel" + - ",HEndFlag,HHelpCode,HDeptID,HGroupID,HUserFlag" + + "(HNumber,HName,HStopflag,HRemark,HShortNumber,HParentID,HLevel" + + ",HEndFlag,HHelpCode,HDeptID,HGroupID,HUseFlag" + ") " + - " values('" + HNumber + "','" + HName + "',0,0,0,0,''," + HDeptID + ",'鏈娇鐢�'" + ") "; + " values('" + HNumber + "','" + HName + "','','',0,0,0,0,''," + HDeptID + ",0,'鏈娇鐢�'" + ") "; } else { - sql = "UpDate Gy_ClassTimePrjGroup set HNumber='" + HNumber + "',HName='" + HName + "',HDeptID=" + HDeptID; + sql = "UpDate Gy_ClassTimePrjGroup set HNumber='" + HNumber + "',HName='" + HName + "',HDeptID=" + HDeptID+ " where HItemID="+ HItemID; } oCN.RunProc(sql); objJsonResult.code = "1"; -- Gitblit v1.9.1