From 4992ccc68d7a0d71165e71f814b8352fae9c3948 Mon Sep 17 00:00:00 2001 From: yxj <1qaz@123> Date: 星期二, 01 十一月 2022 13:24:18 +0800 Subject: [PATCH] 新增根据组织获取系统参数调用方法 --- WebAPI/Controllers/POStockInBillController.cs | 89 +++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 87 insertions(+), 2 deletions(-) diff --git a/WebAPI/Controllers/POStockInBillController.cs b/WebAPI/Controllers/POStockInBillController.cs index 1e8517e..32d8105 100644 --- a/WebAPI/Controllers/POStockInBillController.cs +++ b/WebAPI/Controllers/POStockInBillController.cs @@ -411,6 +411,55 @@ } + + + + + [Route("Kf_QCStockInCheckBill_Fast/BarCode_Json")] + [HttpGet] + public object BarCode_Json(string HBarCode) + { + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + ds = oCN.RunProcReturn("select * from h_v_QCStockInCheckBill_Json where 鏉$爜缂栧彿 ='" + HBarCode.ToString() + "'" , "h_v_QCStockInCheckBill_Json"); + 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> @@ -1475,6 +1524,19 @@ var hinterID = list[0].HInterID; var FID = list[0].FID; + #region 鏍¢獙鏄惁鎵弿鏉$爜 + var HInterID = list[0].HInterID; + string jysql = string.Format(@"select * from KF_PonderationBillMain_Temp where HSourceInterID = {0}", HInterID); + DataTable jyDt =oCn.RunProcReturn(jysql, "jysql").Tables[0]; + if (jyDt.Rows.Count == 0 || jyDt == null) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "璇锋壂鎻忔潯鐮�"; + objJsonResult.data = null; + return objJsonResult; + } + #endregion #region 閲戣澏瀹℃牳鍚庝細閲嶆柊鍚屾鍗曟嵁鍒癿es 鏁呬笉闇�瑕佹洿鏂癿es鐨勬敹鏂欓�氱煡鍗� /* oCn.BeginTran(); @@ -1496,7 +1558,7 @@ //鏇存柊鎴愬姛鍚� 鍚屾鏇存柊閲戣澏 oCn.Commit(); **/ - #endregion + #endregion JObject jsonRoot = new JObject(); jsonRoot.Add("Creator", ""); @@ -1605,7 +1667,7 @@ { //var code = HBarcode.Split('#')[0]; //鏍¢獙鏉$爜鏄惁瀛樺湪 - string sql = $"select* from Gy_BarCodeBill where HSourceInterID ={HInterID} and HBarCode = '{HBarcode.Split('#')[0]}' and HQty = {HBarcode.Split('#')[1]}"; + string sql = $"select HItemID,HSourceBillNo from Gy_BarCodeBill where HSourceInterID ={HInterID} and HBarCode = '{HBarcode.Split('#')[0]}' and HQty = {HBarcode.Split('#')[1]}"; DataSet ds = oCn.RunProcReturn(sql, "H_v_SRM_POOrderBillList"); if (ds.Tables[0].Rows.Count == 0) { @@ -1615,6 +1677,29 @@ objJsonResult.data = ds.Tables[0]; return objJsonResult; } + else + { + //瀛樺叆鏉$爜涓存椂琛� + sql = $"delete from KF_PonderationBillMain_Temp Where HBillNo='{ds.Tables[0].Rows[0]["HSourceBillNo"]}' "; + oCn.RunProc(sql); + sql = string.Format(@"Insert into KF_PonderationBillMain_Temp + (HInterID,HBillNo,HBillType,HMaterID,HProcID,HWhID,HSCWHID + ,HStockPlaceID,HOutStockPlaceID,HGroupID,HQty,HQtyMust,HPieceQty + ,HAuxPropID,HBatchNo,HBarCode,HAddr,HMaker,HMakeDate + ,HSourceInterID,HSourceEntryID,HSourceBillType,HSourceBillNo,HMTONo + ,HSTOCKORGID,HOWNERID,HExpressNumber,HSubBillType + ,HRelationInterID,HRelationEntryID,HRelationBillNo,HRedBlueFlag + ,HCusID) + select HInterID,HSourceBillNo,HBillType,HMaterID,0,0,0 + ,0,0,0,HQty,HQty,0 + ,HAuxPropID,HBatchNo,'','','System',getdate() + ,HSourceInterID,HSourceEntryID,HSourceBillType,HSourceBillNo,HMTONo + ,HSTOCKORGID,HOWNERID,'',HBillType + ,0,0,'',0 + ,0 from Gy_BarCodeBill + where HItemID = {0}", ds.Tables[0].Rows[0]["HItemID"]); + oCn.RunProc(sql); + } objJsonResult.code = "1"; objJsonResult.count = 1; -- Gitblit v1.9.1