From 7745bf2d9391bcbf3da946dfcb3ca1843f0dedf6 Mon Sep 17 00:00:00 2001 From: zzr99 <1940172413@qq.com> Date: 星期一, 10 一月 2022 18:13:40 +0800 Subject: [PATCH] 盘点分析 --- WebAPI/Controllers/WebAPIController.cs | 207 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 204 insertions(+), 3 deletions(-) diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs index 886d1da..e54049f 100644 --- a/WebAPI/Controllers/WebAPIController.cs +++ b/WebAPI/Controllers/WebAPIController.cs @@ -122,12 +122,12 @@ return objjson; } - catch (Exception) + catch (Exception e) { objjson.code = "0"; objjson.count = 0; - objjson.Message = "鐧诲綍寮傚父锛�"; + objjson.Message = "鐧诲綍寮傚父锛�"+e.Message; objjson.data = null; return objjson; ; } @@ -456,6 +456,53 @@ } } + /// <summary> + /// 鑾峰彇浠撳簱鍒楄〃 + /// </summary> + /// <returns></returns> + [Route("Web/GetWarehouseList_Json_New")] + [HttpGet] + public object GetWarehouseList_Json_New(string Warehouse, Int64 HOrgID) + { + sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID =" + HOrgID + ""; + //sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString(); + if (Warehouse != "") + { + sWhere = sWhere + " and ( HNumber like '%" + Warehouse + "%' or HName like '%" + Warehouse + "%' or HUSEORGID like '%" + Warehouse + "%' ) "; + } + + try + { + WebS.WebService1 oWeb = new WebS.WebService1(); + ds = oWeb.GetWarehouseList(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> @@ -493,6 +540,72 @@ try { ds = webserver.GetStockPlaceList(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/GetStockPlaceList_Json_NEW")] + [HttpGet] + public object GetStockPlaceList_Json_NEW(string StockPlace, Int64 HWhID,Int64 HOrgID) + { + WebS.WebService1 oWeb = new WebS.WebService1(); + sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + HOrgID + ""; + //sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString(); + if (HWhID == 0) + { + if (StockPlace != "") + { + sWhere = " Where HStopFlag=0 and ( HNumber like '%" + StockPlace + "%' or HName like '%" + StockPlace + "%' ) "; + } + else + { + sWhere = " Where HStopFlag=0 "; + } + } + else + { + if (StockPlace != "") + { + sWhere = " Where HStopFlag=0 and HWHID=" + HWhID.ToString() + " and HWHID=" + HWhID.ToString() + " and ( HNumber like '%" + StockPlace + "%' or HName like '%" + StockPlace + "%' ) "; + } + else + { + sWhere = " Where HStopFlag=0 and HWHID=" + HWhID.ToString(); + } + } + try + { + //ds = webserver.GetStockPlaceList(sWhere, ref DBUtility.ClsPub.sErrInfo); + ds = oWeb.GetStockPlaceList(sWhere, ref DBUtility.ClsPub.sErrInfo); if (ds == null || ds.Tables[0].Rows.Count <= 0) { objjson.code = "0"; @@ -731,6 +844,53 @@ try { ds = webserver.GetDepartmentList(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/GetOrganizationList_Json")] + [HttpGet] + public object GetOrganizationList_Json() + { + WebS.WebService1 oWebs1 = new WebS.WebService1(); + //sWhere = " Where HStopFlag=0 and HEndFlag=1"; + ////sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString(); + //if (Organization != "") + //{ + // sWhere = sWhere + " and ( HNumber like '%" + Organization + "%' or HName like '%" + Organization + "%' ) "; + //} + try + { + ds = oWebs1.get_ORGANIZATIONSList(); if (ds == null || ds.Tables[0].Rows.Count <= 0) { objjson.code = "0"; @@ -2657,6 +2817,46 @@ #endregion + ///// <summary> + ///// 浜у搧鍏ュ簱缂撳瓨鍒楄〃鍒锋柊淇℃伅 + ///// </summary> + ///// <returns></returns> + //[Route("Web/chanpinruk")] + //[HttpGet] + //public object chanpinruk(string HBillType, string sHMaker, Int64 HOrgID) + //{ + // try + // { + // ds = webserver.GetKf_PonderationBillMain_TempList_New(HBillType, sHMaker, HOrgID); + // 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; + // } + //} + + /// <summary> /// 浜у搧鍏ュ簱缂撳瓨鍒楄〃鍒锋柊淇℃伅 /// </summary> @@ -2665,9 +2865,10 @@ [HttpGet] public object chanpinruk(string HBillType, string sHMaker, Int64 HOrgID) { + WebS.WebService1 oWebs = new WebS.WebService1(); try { - ds = webserver.GetKf_PonderationBillMain_TempList_New(HBillType, sHMaker, HOrgID); + ds = oWebs.GetKf_PonderationBillMain_TempList_New (HBillType, sHMaker, HOrgID); if (ds == null || ds.Tables[0].Rows.Count <= 0) { objJsonResult.code = "0"; -- Gitblit v1.9.1