From f9c66dcfca26da4eeba5c87df4ca3916461e37f8 Mon Sep 17 00:00:00 2001 From: yangle <admin@YINMOU> Date: 星期四, 28 十一月 2024 14:27:32 +0800 Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API --- WebAPI/Controllers/条码管理/WEBSController.cs | 299 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 288 insertions(+), 11 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 2d8bc14..f1dd4d5 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" @@ -35,9 +35,6 @@ string ComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О - WebS.ClsXt_SystemParameterMain oSystemParameterMain = new WebS.ClsXt_SystemParameterMain(); - - #region 鍏敤鏂规硶 #region 璐﹀彿鐧诲叆 @@ -2272,6 +2269,88 @@ #endregion + #region 鍏朵粬鍏ュ簱 鏍¢獙妯″紡 + + /// <summary> + /// 鍏朵粬鍏ュ簱鏍¢獙涓婁紶 + /// </summary> + /// <returns></returns> + [Route("WEBSController/set_SaveOtherInBill_BillCheck_Json")] + [HttpPost] + public object set_SaveOtherInBill_BillCheck_Json([FromBody] JObject oMain) + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string sMainStr = sArray[0].ToString(); //鍗曟嵁鏁版嵁 + string HSourceBarCodeCtl = sArray[1].ToString(); //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 + + try + { + List<Model.ClsKf_OtherInBillMain> lsmain = new List<Model.ClsKf_OtherInBillMain>(); + ListModels oListModels = new ListModels(); + lsmain = oListModels.getOtherInBillMainByJson(sMainStr); + + WebAPI.WebS.ClsKf_OtherInBillMain websLsmain = new WebS.ClsKf_OtherInBillMain(); + + websLsmain.HInterID = lsmain[0].HInterID; + websLsmain.HBillNo = lsmain[0].HBillNo; + websLsmain.HBillType = "1203"; + websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID; + + //鍘熷崟鎹负鎵爜鐢熸垚锛屽鍘熸壂鎻忕殑鏉$爜杩涜鏍稿 + if (HSourceBarCodeCtl == "Y") + { + if (oWebs.set_SaveOtherInBill_CLD_BillCheck_Verify(websLsmain, ref DBUtility.ClsPub.sErrInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //鎴愬姛锛� + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //澶辫触锛� + objJsonResult.data = null; + return objJsonResult; + } + } + //鍘熷崟鎹潪鎵爜鐢熸垚 + else + { + if (oWebs.set_SaveOtherInBill_CLD_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //鎴愬姛锛� + 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; + } + } + + #endregion + #endregion #region 棰嗘枡鍑哄簱 涓婁紶鐢熷崟 @@ -4417,6 +4496,7 @@ FentityModel.Add("F_paez_BaseQty", item["瀹炲彂鏁伴噺"].ToString()); //瀹炲彂鏁伴噺 FentityModel.Add("F_paez_Qty1", item["瀹炴敹鏁伴噺"].ToString()); //瀹炴敹鏁伴噺 FentityModel.Add("F_paez_Text2", item["绠卞彿"].ToString()); //绠卞彿 ???涓嶈兘涓烘暟瀛� + FentityModel.Add("FLOT", new JObject() { ["FNumber"] = item["鎵瑰彿"].ToString() }); // 杈呰閲忓崟浣嶄唬鐮� //JArray Fentity2 = new JArray(); @@ -4457,7 +4537,7 @@ //浠庨厤缃枃浠惰幏鍙� CLOUD缃戝潃銆佽处濂椾俊鎭�佺櫥褰曠敤鎴枫�佺櫥褰曞瘑鐮� if (!Pub_Class.ClsPub.GetCLOUDLoginInfo(ref Pub_Class.ClsPub.sExeReturnInfo)) { - oCn.RollBack(); + //oCn.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "鍏ュ簱鐢宠鍗曞悓姝ヨ幏鍙栫櫥褰曡处鍙峰瘑鐮佸け璐ワ紒"; @@ -4473,7 +4553,7 @@ if (isSuccess == 0) { LogService.Write("鍏朵粬鍏ュ簱,鐧诲綍閲戣澏澶辫触锛�"); - oCn.RollBack(); + //oCn.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "鐧诲綍閲戣澏澶辫触锛�"; @@ -4487,7 +4567,7 @@ if (JObject.Parse(result)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") { LogService.Write("鍏ュ簱鐢宠鍗曞悓姝ラ噾铦朵簯澶辫触锛�" + JsonConvert.SerializeObject(jsonRoot)); - oCn.RollBack(); + //oCn.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "鍏ュ簱鐢宠鍗曞悓姝ラ噾铦朵簯澶辫触锛佸崟鍙�:" + HSourceBillNo_TB + result + jsonRoot; @@ -4511,7 +4591,7 @@ if (JObject.Parse(result1)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") { - oCn.RollBack(); + //oCn.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "鍏ュ簱鐢宠鍗曞崟鍙�:" + ",鎻愪氦澶辫触" + result1; @@ -4521,7 +4601,7 @@ if (JObject.Parse(result2)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") { - oCn.RollBack(); + //oCn.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "鍏ュ簱鐢宠鍗曞崟鍙�:" + ",瀹℃牳澶辫触" + result2; @@ -5073,11 +5153,99 @@ if (oSystemParameter.ShowBill(ref sErrMsg) == true) { string sSourceBarCodeCtl = "N"; //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (HBillType == "1205" && oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl == "Y") + + #region 绯荤粺鍙傛暟鑾峰彇 + //閲囪喘鍏ュ簱鍗� + if (HBillType == "1201") { - //閿�鍞嚭搴撳崟 - sSourceBarCodeCtl = "Y"; + //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 + if (oSystemParameter.omodel.Kf_POStockInBillCheck_SourceBarCodeCtl == "Y") + { + sSourceBarCodeCtl = "Y"; + } } + //鐢熶骇鍏ュ簱鍗� + if (HBillType == "1202") + { + //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 + if (oSystemParameter.omodel.Kf_ProductInBillCheck_SourceBarCodeCtl == "Y") + { + sSourceBarCodeCtl = "Y"; + } + } + //鍏朵粬鍏ュ簱鍗� + if (HBillType == "1203") + { + //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 + if (oSystemParameter.omodel.Kf_OtherInBillCheck_SourceBarCodeCtl == "Y") + { + sSourceBarCodeCtl = "Y"; + } + } + //棰嗘枡鍑哄簱鍗� + else if (HBillType == "1204") + { + //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 + if (oSystemParameter.omodel.Kf_MateOutBillCheck_SourceBarCodeCtl == "Y") + { + sSourceBarCodeCtl = "Y"; + } + } + //閿�鍞嚭搴撳崟 + else if (HBillType == "1205") + { + //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 + if (oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl == "Y") + { + sSourceBarCodeCtl = "Y"; + } + } + //鍏朵粬鍑哄簱鍗� + else if (HBillType == "1206") + { + //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 + if (oSystemParameter.omodel.Kf_OtherOutBillCheck_SourceBarCodeCtl == "Y") + { + sSourceBarCodeCtl = "Y"; + } + } + //濮斿棰嗘枡鍗� + else if (HBillType == "1211") + { + //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 + if (oSystemParameter.omodel.Kf_EntrustOutBillCheck_SourceBarCodeCtl == "Y") + { + sSourceBarCodeCtl = "Y"; + } + } + //鐢熶骇琛ユ枡鍗� + else if (HBillType == "1254") + { + //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 + if (oSystemParameter.omodel.Kf_MateReplenishOutBillCheck_SourceBarCodeCtl == "Y") + { + sSourceBarCodeCtl = "Y"; + } + } + //濮斿琛ユ枡鍗� + else if (HBillType == "1255") + { + //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 + if (oSystemParameter.omodel.Kf_EntrustReplenishOutBillCheck_SourceBarCodeCtl == "Y") + { + sSourceBarCodeCtl = "Y"; + } + } + //鐩存帴璋冩嫧鍗� + else if (HBillType == "1207") + { + //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 + if (oSystemParameter.omodel.Kf_MoveStockBillCheck_SourceBarCodeCtl == "Y") + { + sSourceBarCodeCtl = "Y"; + } + } + #endregion if (oSystemParameter.omodel.WMS_CampanyName == "瀹夌憺") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤 { @@ -5153,6 +5321,71 @@ #endregion + #region 杩斿洖鍗曟嵁鍒楄〃淇℃伅 20241114 + + /// <summary> + /// 杩斿洖鍗曟嵁鍒楄〃淇℃伅 鏍¢獙妯″紡 + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetKf_PonderationBillMain_Temp_BillCheck_New_Json")] + [HttpGet] + public object GetKf_PonderationBillMain_Temp_BillCheck_New_Json(long HInterID, string HBillType, string sWhere, string HSourceBarCodeCtl) + { + try + { + //鍘熷崟鎹负鎵爜鐢熸垚锛屽鍘熸壂鎻忕殑鏉$爜杩涜鏍稿 + if (HSourceBarCodeCtl == "Y") + { + ds = oCn.RunProcReturn("exec h_p_KF_PonderationBillMain_TempList_Verify " + HInterID.ToString() + ",'" + HBillType + "','" + sWhere + "'", "h_p_KF_PonderationBillMain_TempList_Verify"); + } + //鍘熷崟鎹潪鎵爜鐢熸垚 + else + { + ds = oCn.RunProcReturn("exec h_p_KF_PonderationBillMain_TempList_BillCheck " + HInterID.ToString() + ",'" + HBillType + "','" + sWhere + "'", "h_p_KF_PonderationBillMain_TempList_BillCheck"); + } + + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + List<object> columnNameList = new List<object>(); + //娣诲姞鍒楀悕 + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + columnNameList.Add(JsonConvert.DeserializeObject(ColmString)); //鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = new + { + Materlist = ds.Tables[0], //杩斿洖鐗╂枡鏄庣粏鍒楄〃淇℃伅锛�0锛� + BarCodeDetailslist = ds.Tables[1], //杩斿洖褰撳墠鎵�鎵弿鏉$爜鏄庣粏淇℃伅锛�5锛� + }; + objJsonResult.list = columnNameList; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鑾峰彇鍒楄〃淇℃伅澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + #endregion + #region 杩斿洖鍗曟嵁鍒楄〃淇℃伅 /// <summary> @@ -5204,6 +5437,50 @@ #endregion + #region 鏍¢獙鎵爜妯″潡锛屽垹闄ら�変腑琛屾潯鐮佸嚭鍏ュ簱涓存椂琛ㄨ褰� 20241114 + + /// <summary> + /// 鎵爜妯″潡锛屽垹闄ら�変腑琛屾潯鐮佸嚭鍏ュ簱涓存椂琛ㄨ褰� + /// </summary> + /// <returns></returns> + [Route("WEBSController/set_DeleteBarCodeByEntryID_BillCheck_New_Json")] + [HttpGet] + public object set_DeleteBarCodeByEntryID_BillCheck_New_Json(long HInterID, string HBillType, long HSourceInterID, long HSourceEntryID, string HSourceBarCodeCtl) + { + //鍘熷崟鎹负鎵爜鐢熸垚锛屽鍘熸壂鎻忕殑鏉$爜杩涜鏍稿 + if (HSourceBarCodeCtl == "Y") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏍¢獙鏉$爜锛屾棤闇�鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + //鍘熷崟鎹潪鎵爜鐢熸垚 + else + { + try + { + oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "' and HSourceInterID=" + HSourceInterID.ToString() + " and HSourceEntryID=" + HSourceEntryID.ToString() + " and HQty<>0 ", ref DBUtility.ClsPub.sExeReturnInfo); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎鎵�閫夎鏉$爜鍑哄叆搴撲复鏃惰〃璁板綍澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + } + + #endregion + #region 鎵爜妯″潡锛屽垹闄ら�変腑琛屾潯鐮佸嚭鍏ュ簱涓存椂琛ㄨ褰� /// <summary> -- Gitblit v1.9.1