From 2d33e01ccb5085171653876daf630f8c09909d76 Mon Sep 17 00:00:00 2001 From: zgq <519541279@qq.com> Date: 星期四, 22 四月 2021 17:15:02 +0800 Subject: [PATCH] 新增工序出站、进站模块-合并 --- WebAPI/Controllers/WebAPIController.cs | 173 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 173 insertions(+), 0 deletions(-) diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs index a50a8aa..84bae22 100644 --- a/WebAPI/Controllers/WebAPIController.cs +++ b/WebAPI/Controllers/WebAPIController.cs @@ -855,6 +855,55 @@ } /// <summary> + /// 鑾峰彇宸ュ簭鍒楄〃 + /// <summary> + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Web/GetProcList_Json")] + [HttpGet] + public object GetProcList_Json(string sWhere) + { + DataSet ds; + //sWhere = " Where HStopFlag=0 and HEndFlag=1"; + //sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString(); + if (sWhere != "") + { + sWhere = sWhere + " and ( HNumber like '%" + sWhere + "%' or HName like '%" + sWhere + "%' ) "; + } + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + ds = oCN.RunProcReturn("Select HItemID,HNumber 宸ュ簭浠g爜,HName 宸ュ簭 from Gy_Process where HStopflag=0 " + sWhere + " Order by HItemID ", "Gy_Process"); + if (ds == null || ds.Tables[0].Rows.Count <= 0) + { + objjson.code = "0"; + objjson.count = 0; + objjson.Message = "鑾峰彇澶辫触"; + objjson.data = null; + return objjson; + } + else + { + objjson.code = "0"; + objjson.count = 1; + objjson.Message = "鑾峰彇鎴愬姛!"; + objjson.data = ds.Tables[0]; + return objjson; + } + } + catch (Exception e) + { + + objjson.code = "0"; + objjson.count = 0; + objjson.Message = "鑾峰彇澶辫触" + e.ToString(); + objjson.data = null; + return objjson; + } + } + + /// <summary> /// 鑾峰彇褰撳墠鏁版嵁搴撳悕 /// </summary> /// <returns></returns> @@ -884,6 +933,130 @@ return objjson; ; } } + + /// <summary> + /// 鑾峰彇涓嶈壇鍘熷洜鍒楄〃 + /// </summary> + /// <returns></returns> + [Route("Web/GetBadReasonList_Json")] + [HttpGet] + public object GetBadReasonList_Json(string BadReason) + { + //sWhere = " Where HStopFlag=0 and HEndFlag=1"; + //sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString(); + if (BadReason != "") + { + sWhere = sWhere + " and ( HNumber like '%" + BadReason + "%' or HName like '%" + BadReason + "%' ) "; + } + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (sWhere == null || sWhere.Equals("")) + + { + ds = oCN.RunProcReturn("Select HItemID,HNumber ,HName from Gy_BadReason where HStopflag=0 Order by HItemID ", "Gy_BadReason"); + } + else + { + string sql1 = "Select HItemID,HNumber ,HName from Gy_BadReason where HStopflag=0 and HEndFlag=1 "; + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "Gy_BadReason"); + } + + //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; + } + } + + + /// <summary> + /// 鑾峰彇宸ュ簭璁″垝鍗曞垪琛� + /// </summary> + /// <returns></returns> + [Route("Web/GetPlanList_Json")] + [HttpGet] + public object GetPlanList_Json(string Billno) + { + //sWhere = " Where HStopFlag=0 and HEndFlag=1"; + //sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString(); + if (Billno != "") + { + sWhere = sWhere + " and ( 鍗曟嵁鍙� like '%" + Billno + "%' ) "; + } + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (sWhere == null || sWhere.Equals("")) + + { + ds = oCN.RunProcReturn("select hmainid,hsubid,鍗曟嵁鍙�,HMaterID,鐗╂枡浠g爜,鐗╂枡鍚嶇О,HCenterID,宸ヤ綔涓績,瑙勬牸鍨嬪彿,璁″垝鏁伴噺 from h_v_Sc_ProcessPlanList", "h_v_Sc_ProcessPlanList"); + } + else + { + string sql1 = "select hmainid,hsubid,鍗曟嵁鍙�,HMaterID,鐗╂枡浠g爜,鐗╂枡鍚嶇О,HCenterID,宸ヤ綔涓績,瑙勬牸鍨嬪彿,璁″垝鏁伴噺 from h_v_Sc_ProcessPlanList where 1=1 "; + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcessPlanList"); + } + + //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; + } + } + + + #endregion } -- Gitblit v1.9.1