From 095c43c4838b67fb904b6e853256c07680a11aea Mon Sep 17 00:00:00 2001 From: yusijie <ysj@hz-kingdee.com> Date: 星期三, 14 六月 2023 17:19:26 +0800 Subject: [PATCH] 拍照上传,盘点,退料模块里在同一个单号里面相同信息的物料只能扫一次 --- WebAPI/Controllers/条码管理/WEBSController.cs | 148 +++++++++++++++++++++++++++++-------------------- 1 files changed, 88 insertions(+), 60 deletions(-) diff --git "a/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs" "b/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs" index a62a3b9..1ee4400 100644 --- "a/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs" +++ "b/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs" @@ -720,10 +720,10 @@ - #region 鐢熶骇鍏ュ簱 鎵弿婧愬崟鏉$爜 + #region 閲囪喘鍏ュ簱 鎵弿婧愬崟鏉$爜 /// <summary> - /// 鐢熶骇鍏ュ簱 鎵弿婧愬崟鏉$爜 + /// 閲囪喘鍏ュ簱 鎵弿婧愬崟鏉$爜 /// </summary> /// <returns></returns> [Route("WEBSController/Get_SourceBarCode_PoStockIn_Json")] @@ -732,7 +732,7 @@ { try { - WebSoBar = oWebs.get_SourceBill_MaterBarCode(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HStockOrgID, HAccessFlag, oSystemParameterMain, ref DBUtility.ClsPub.sErrInfo); + WebSoBar = oWebs.get_SourceBill_MaterBarCode(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HStockOrgID, HAccessFlag, oSystemParameterMain,ref DBUtility.ClsPub.sErrInfo); if (WebSoBar == null) { objJsonResult.code = "0"; @@ -932,7 +932,7 @@ if (oSystemParameter.omodel.WMS_CampanyName == "瀹夌憺") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤 { sJXCode = POStockInBillController.JX_Json(sBarCode, HInterID, HBillType, HStockOrgID, HBillNo, HMaker); - SourceFlag = true; + SourceFlag = true; } else { @@ -940,7 +940,34 @@ } try { + oCn.BeginTran();//寮�濮嬩簨鐗� + WebSoBar = oWebs.get_BarCode(sJXCode, HInterID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HStockOrgID, HScanStyle, HCustom1, HCustom2, ref DBUtility.ClsPub.sErrInfo); + + if (oSystemParameter.omodel.WMS_CampanyName == "瀹夌憺" && int.Parse(HBillType) == 1244) + { + ds = oCn.RunProcReturn("select HMaterID,HQty,HBatchNo from KF_PonderationBillMain_Temp where HInterID = " + HInterID + "and HBillNo = '" + HBillNo + "'", "KF_PonderationBillMain_Temp"); + if (ds.Tables[0].Rows.Count > 0) + { + for (var i = 0; i < ds.Tables[0].Rows.Count; i++) + { + for (var j = i + 1; j < ds.Tables[0].Rows.Count; j++) + { + if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HMaterID"]) == DBUtility.ClsPub.isLong(ds.Tables[0].Rows[j]["HMaterID"]) && DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HQty"]) == DBUtility.ClsPub.isLong(ds.Tables[0].Rows[j]["HQty"]) && DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HBatchNo"]) == DBUtility.ClsPub.isLong(ds.Tables[0].Rows[j]["HBatchNo"])) + { + oCn.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍚屼竴鍗曟嵁鍙蜂腑宸叉壂杩囦俊鎭浉鍚岀殑鏉$爜"; + objJsonResult.data = null; + return objJsonResult; + } + } + } + } + } + oCn.Commit();//鎻愪氦浜嬬墿 + if (WebSoBar == null) { objJsonResult.code = "0"; @@ -956,10 +983,11 @@ objJsonResult.Message = "鎴愬姛"; objJsonResult.data = WebSoBar; return objJsonResult; - } + } } catch (Exception e) { + oCn.RollBack();//鍥炴粴浜嬬墿 objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "鎵弿鏉$爜澶辫触锛�" + e.ToString(); @@ -1084,61 +1112,61 @@ /// 鐗╂枡鏉$爜鏂囨湰妗� 鎵爜璋冪敤 /// </summary> /// <returns></returns> - //[Route("WEBSController/get_BarCode_MoveStock_PD")] - //[HttpGet] - //public Object get_BarCode_MoveStock_PD(string sBarCode, Int64 HInterID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Int64 HSCWHID, Int64 HSCSPID, Double HQty, bool SourceFlag, string HSourceBillNo, string HSourceBillType, Int64 HStockInOrgID, Int64 HStockOutOrgID, string HScanStyle) - //{ - // string sErrMsg = ""; - // string sJXCode = ""; - // if (oSystemParameter.ShowBill(ref sErrMsg) == true) - // { - // if (oSystemParameter.omodel.WMS_CampanyName == "瀹夌憺") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤 - // { - // sJXCode = POStockInBillController.JX_Json(sBarCode, HInterID, HBillType, HStockOutOrgID, HBillNo, HMaker); - // SourceFlag = true; - // } - // else - // { - // sJXCode = sBarCode; - // } - // try - // { - // WebSoBar = oWebs.get_BarCode_MoveStock_PD(sJXCode, HInterID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, HQty, SourceFlag, HSourceBillNo, HSourceBillType, HStockInOrgID, HStockOutOrgID, HScanStyle, 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 = "鎴愬姛"; - // objJsonResult.data = WebSoBar; - // return objJsonResult; - // } - // } - // catch (Exception e) - // { - // objJsonResult.code = "0"; - // objJsonResult.count = 0; - // objJsonResult.Message = "鎵弿鏉$爜澶辫触锛�" + e.ToString(); - // objJsonResult.data = null; - // return objJsonResult; - // } - // } - // else - // { - // objJsonResult.code = "0"; - // objJsonResult.count = 0; - // objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg; - // objJsonResult.data = null; - // return objJsonResult; - // } - //} + [Route("WEBSController/get_BarCode_MoveStock_PD")] + [HttpGet] + public Object get_BarCode_MoveStock_PD(string sBarCode, Int64 HInterID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Int64 HSCWHID, Int64 HSCSPID, Double HQty, bool SourceFlag, string HSourceBillNo, string HSourceBillType, Int64 HStockInOrgID, Int64 HStockOutOrgID, string HScanStyle) + { + string sErrMsg = ""; + string sJXCode = ""; + if (oSystemParameter.ShowBill(ref sErrMsg) == true) + { + if (oSystemParameter.omodel.WMS_CampanyName == "瀹夌憺") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤 + { + sJXCode = POStockInBillController.JX_Json(sBarCode, HInterID, HBillType, HStockOutOrgID, HBillNo, HMaker); + SourceFlag = true; + } + else + { + sJXCode = sBarCode; + } + try + { + WebSoBar = oWebs.get_BarCode_MoveStock_PD(sJXCode, HInterID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, HQty, SourceFlag, HSourceBillNo, HSourceBillType, HStockInOrgID, HStockOutOrgID, HScanStyle, 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 = "鎴愬姛"; + objJsonResult.data = WebSoBar; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎵弿鏉$爜澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg; + objJsonResult.data = null; + return objJsonResult; + } + } #endregion -- Gitblit v1.9.1