From 2fa163b23ae0a4e669931ac5bd5fbeff6f878bb0 Mon Sep 17 00:00:00 2001 From: zzr99 <1940172413@qq.com> Date: 星期四, 20 一月 2022 13:48:13 +0800 Subject: [PATCH] 11 --- WebAPI/Controllers/POStockInBillController.cs | 182 +++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 164 insertions(+), 18 deletions(-) diff --git a/WebAPI/Controllers/POStockInBillController.cs b/WebAPI/Controllers/POStockInBillController.cs index 31c4efd..36659de 100644 --- a/WebAPI/Controllers/POStockInBillController.cs +++ b/WebAPI/Controllers/POStockInBillController.cs @@ -76,31 +76,43 @@ [HttpGet] public Object get_CheckTypeByBarCode_Json(string sCode, Int64 sInterID, string sBillNo, string sBillType, string sMaker, Int64 WhID, Int64 SPID, Double sQty, bool sRedBlue, bool SourceFlag, string sSourceBillNo, string sSourceType, Int64 HOWNERID) { - //if (sRedBlue == true) - //{ - // HBillType = "1239"; - //} - //oBar = webserver.get_CheckTypeByBarCode(sCode, sInterID, sBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, ref DBUtility.ClsPub.sErrInfo); - WebS.WebService1 oWebs = new WebS.WebService1(); - WebS.ClsKf_ICStockBill_WMS WebSoBar = new WebS.ClsKf_ICStockBill_WMS(); - string sExpressNumber = ""; - WebSoBar = oWebs.get_CheckTypeByBarCode_All(sCode, sInterID, HBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, sExpressNumber, ref DBUtility.ClsPub.sErrInfo); - if (WebSoBar == null) + try { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = DBUtility.ClsPub.sErrInfo; - objJsonResult.data = null; - return objJsonResult; + //if (sRedBlue == true) + //{ + // HBillType = "1239"; + //} + //oBar = webserver.get_CheckTypeByBarCode(sCode, sInterID, sBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, ref DBUtility.ClsPub.sErrInfo); + WebS.WebService1 oWebs = new WebS.WebService1(); + WebS.ClsKf_ICStockBill_WMS WebSoBar = new WebS.ClsKf_ICStockBill_WMS(); + string sExpressNumber = ""; + WebSoBar = oWebs.get_CheckTypeByBarCode_All(sCode, sInterID, HBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, sExpressNumber, ref DBUtility.ClsPub.sErrInfo); + if (WebSoBar == null) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = DBUtility.ClsPub.sErrInfo; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = DBUtility.ClsPub.sErrInfo; + objJsonResult.data = WebSoBar; + return objJsonResult; + } } - else + catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 1; - objJsonResult.Message = DBUtility.ClsPub.sErrInfo; - objJsonResult.data = WebSoBar; + objJsonResult.Message = e.Message+";"+e.StackTrace; + objJsonResult.data = null; return objJsonResult; } + } /// <summary> /// 涓�閿壂鐮佺孩瀛� @@ -268,6 +280,80 @@ return objJsonResult; } } + + + + /// <summary> + /// 鍐欏叆涓存椂琛� 鎵簮鍗曠殑鏂规硶 + /// </summary> + /// <param name="HSourceBillNo"></param> + /// <returns></returns> + [Route("ICMOReportBill/set_SaveICMOReportBill")] + [HttpGet] + public object set_SaveICMOReportBill(string HSourceBillType, string HSourceBillNo, Int64 sInterID, string sBillNo) + { + try + { + // DataSet ds = new DataSet(); + // WebServer webserver = new WebServer(); + string sWhere = " Where 鍗曟嵁鍙� like '%" + HSourceBillNo.Trim() + "'"; + //鏍规嵁婧愬崟绫诲瀷鏉ヨ皟鐢ㄤ笉鍚岀殑WEBS鏂规硶 new + if (HSourceBillType == "3710") + { + ds = webserver.GetSc_ICMOBillList(sWhere + " "); + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍,婧愬崟绫诲瀷鏈夐敊璇紒"; + objJsonResult.data = null; + return objJsonResult; ; + } + // + if (ds == null || ds.Tables[0].Rows.Count <= 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + HSourceBillType; + objJsonResult.data = null; + return objJsonResult; + //DBUtility.ClsPub.MessageBeep((int)DBUtility.ClsPub.BeepType.Warning); + } + else + { + HDeptID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HDeptID"]); + HDeptName = Convert.ToString(ds.Tables[0].Rows[0]["HDeptName"]); + if (webserver.set_SavePonderationBillMain_Temp_Source_Fast(sInterID, sBillNo, HBillType, HSourceBillNo, HSourceBillType, "钃濆瓧", ref DBUtility.ClsPub.sErrInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍐欏叆涓存椂琛ㄥけ璐ワ紒" + DBUtility.ClsPub.sErrInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + } + catch (Exception ex) + { + + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + /// <summary> /// 杩斿洖鍑哄叆搴撴潯鐮佷复鏃惰〃 /// </summary> @@ -606,6 +692,66 @@ } } + + /// <summary> + /// 鐢熶骇姹囨姤鍗�/鎻愪氦/鐩存帴璋僿ebservice + /// </summary> + /// <returns></returns> + [Route("ICMOReportBill/set_SaveICMOReportBill_Json")] + [HttpPost] + public object set_SaveICMOReportBill_Json([FromBody] JObject oMain) + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + try + { + List<Model.ClsSc_ICMOReportBillMain> lsmain = new List<Model.ClsSc_ICMOReportBillMain>(); + ListModels oListModels = new ListModels(); + lsmain = oListModels.getICMOReportBillMainByJson(msg1); + lsmain[0].HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + lsmain[0].HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); + string sSourceBillType = lsmain[0].HBillType; + + WebAPI.WebS.ClsSc_ICMOReportBillMain websLsmain = new WebS.ClsSc_ICMOReportBillMain(); + + websLsmain.HInterID = lsmain[0].HInterID; + websLsmain.HBillNo = lsmain[0].HBillNo; + websLsmain.HBillType = "1201";//鍥哄畾鍊� + websLsmain.HDate = lsmain[0].HDate; + websLsmain.HDeptID = lsmain[0].HDeptID; + websLsmain.HEmpID = 0; + websLsmain.HBillerID = lsmain[0].HBillerID; + websLsmain.HRemark = ""; + websLsmain.HMainSourceBillType = lsmain[0].HBillType; + + + if (webserver.set_SaveICMOReportBill_Json(websLsmain, sSourceBillType, ref DBUtility.ClsPub.sErrInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鎴愬姛锛佸崟鎹彿涓猴細"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "涓婁紶澶辫触锛�" + DBUtility.ClsPub.sErrInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "涓婁紶澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + [Route("POStockInBill/GetSpName_Json")] [HttpGet] public object GetSpName_Json(long HSpID, long HWHID, long HStockOrgID, ref string sErrMsg) -- Gitblit v1.9.1