From 696e2c6b5e43bc2f379eda5f4abae6d82fdd42f5 Mon Sep 17 00:00:00 2001 From: wtt <1985833171@qq.com> Date: 星期五, 30 五月 2025 16:58:13 +0800 Subject: [PATCH] 1 --- WebAPI/Controllers/条码管理/WEBSController.cs | 2540 +++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 2,288 insertions(+), 252 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 7ffc703..74778b0 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" @@ -32,10 +32,8 @@ public WebS.WebService1 oWebs = new WebS.WebService1(); public WebS.ClsKf_ICStockBill_WMS WebSoBar = new WebS.ClsKf_ICStockBill_WMS(); Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); + DBUtility.ClsXt_BaseBill oBaseBill = new DBUtility.ClsXt_BaseBill(); string ComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О - - - WebS.ClsXt_SystemParameterMain oSystemParameterMain = new WebS.ClsXt_SystemParameterMain(); #region 鍏敤鏂规硶 @@ -954,11 +952,18 @@ /// <returns></returns> [Route("WEBSController/GetEquipList_Json")] [HttpGet] - public object GetEquipList_Json(string Equip) + public object GetEquipList_Json(string Equip,int HCenterID) { try { - ds = oCn.RunProcReturn("select HInterID,HEquipFileNumber,HName,HSourceID,HSourceName from h_v_Gy_EquipFileBill where HEquipFileNumber like '%" + Equip + "%' or HName like '%" + Equip + "%'", "h_v_Gy_EquipFileBill"); + if (HCenterID !=0) + { + ds = oCn.RunProcReturn("select HInterID,HEquipFileNumber,HName,HSourceID,HSourceName,HCenterID from h_v_Gy_EquipFileBill where HCenterID='"+HCenterID+"' and ( HEquipFileNumber like '%" + Equip + "%' or HName like '%" + Equip + "%')", "h_v_Gy_EquipFileBill"); + } + else + { + ds = oCn.RunProcReturn("select HInterID,HEquipFileNumber,HName,HSourceID,HSourceName from h_v_Gy_EquipFileBill where HEquipFileNumber like '%" + Equip + "%' or HName like '%" + Equip + "%'", "h_v_Gy_EquipFileBill"); + } if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; @@ -1074,6 +1079,90 @@ #region 鎵爜妯″潡璋冪敤鏂规硶 + + #region 鍏朵粬鍏ュ簱 鑾峰彇鍏ュ簱绫诲瀷 + + /// <summary> + /// 鑾峰彇鍏ュ簱绫诲瀷 + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetStockInStyle_Json")] + [HttpGet] + public Object GetStockInStyle_Json() + { + try + { + ds = oWebs.get_StockInStyle(); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏌ヨ涓嶅埌鍏ュ簱绫诲瀷淇℃伅锛�"; + objJsonResult.data = null; + return objJsonResult; + } + 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; + } + } + + #endregion + + #region 鍏朵粬鍑哄簱 鑾峰彇鍑哄簱绫诲瀷 + + /// <summary> + /// 鑾峰彇鍑哄簱绫诲瀷 + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetStockOutStyle_Json")] + [HttpGet] + public Object GetStockOutStyle_Json() + { + try + { + ds = oWebs.get_StockOutStyle(); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏌ヨ涓嶅埌鍑哄簱绫诲瀷淇℃伅锛�"; + objJsonResult.data = null; + return objJsonResult; + } + 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; + } + } + + #endregion #region 鐩存帴璋冩嫧 鑾峰彇璋冩嫧鍑鸿揣绫诲瀷 @@ -1264,6 +1353,9 @@ { try { + //鏍规嵁鎵樻潯鐮佸瓧娈靛垹闄ゆ湰鍗曟潯鐮佸嚭鍏ュ簱缂撳瓨琛ㄦ暟鎹� + oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HBarCode_Pack<>'' and HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "' and HBarCode_Pack='" + HBarCode + "'", ref DBUtility.ClsPub.sExeReturnInfo); + //鏍规嵁鏉$爜瀛楁鍒犻櫎鏈崟鏉$爜鍑哄叆搴撶紦瀛樿〃鏁版嵁 oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HBarCode<>'' and HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "' and HBarCode='" + HBarCode + "'", ref DBUtility.ClsPub.sExeReturnInfo); objJsonResult.code = "0"; objJsonResult.count = 1; @@ -1328,22 +1420,12 @@ { try { - if (oWebs.set_DelPonderationBillMain_Temp_InterIDAndSource(HInterID, HMaterID, HAuxPropID, HMTONo, HSourceInterID, HSourceEntryID, HBillType, 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; - } + oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID=" + HInterID.ToString() + " and HMaterID= " + HMaterID.ToString() + " and HAuxPropID= " + HAuxPropID.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) { @@ -1400,6 +1482,50 @@ #endregion + + #region 鎵爜妯″潡 瀹㈡埛銆佷紶绁ㄣ�佹潯鐮侀獙璇佽皟鐢� + + /// <summary> + /// 鎵爜妯″潡 瀹㈡埛銆佷紶绁ㄣ�佹潯鐮侀獙璇佽皟鐢� + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetCheakBarCodeAndCP_Json")] + [HttpGet] + public object GetCheakBarCodeAndCP_Json(long HCusID, string HCP, string HBarCode) + { + try + { + HBarCode = HBarCode.Trim(); + if (oWebs.Get_CheakBarCodeAndCP(HCusID, HCP, HBarCode, 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 @@ -1418,6 +1544,53 @@ try { ds = oWebs.GetKf_PonderationBillMain_TempList_New(HBillType, HMaker, HStockOrgID); + 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 = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鑾峰彇鍗曟嵁缂撳瓨鍒楄〃淇℃伅澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + /// <summary> + /// 缂撳瓨鍒楄〃鐣岄潰锛岃繑鍥炵紦瀛樺垪琛ㄤ俊鎭� 20250513 + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetKf_PonderationBillMain_TempList_Other_Json")] + [HttpGet] + public object GetKf_PonderationBillMain_TempList_Other_Json(string HBillType, string HMaker, Int64 HStockOrgID, string HSubBillType) + { + try + { + ds = oCn.RunProcReturn("exec h_p_KF_GetPonderationBillMain_TempList_Other '" + HBillType + "','" + HMaker + "'," + HStockOrgID.ToString() + ",'" + HSubBillType + "'", "h_p_KF_GetPonderationBillMain_TempList_Other"); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; @@ -2015,6 +2188,61 @@ #endregion + #region 鐢熶骇鍏ュ簱 鏍¢獙妯″紡 + + /// <summary> + /// 鐢熶骇鍏ュ簱鏍¢獙涓婁紶 + /// </summary> + /// <returns></returns> + [Route("WEBSController/set_SaveProductInBill_BillCheck_Json")] + [HttpPost] + public object set_SaveProductInBill_BillCheck_Json([FromBody] JObject oMain) + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + + try + { + List<Model.ClsKf_ProductInBillMain> lsmain = new List<Model.ClsKf_ProductInBillMain>(); + ListModels oListModels = new ListModels(); + lsmain = oListModels.getProductInBillMainByJson(msg1); + + WebAPI.WebS.ClsKf_ProductInBillMain websLsmain = new WebS.ClsKf_ProductInBillMain(); + + websLsmain.HInterID = lsmain[0].HInterID; + websLsmain.HBillNo = lsmain[0].HBillNo; + websLsmain.HBillType = "1202"; + websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID; + + if (oWebs.set_SaveProductInBill_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 閲囪喘鍏ュ簱 涓婁紶鐢熷崟 @@ -2101,6 +2329,60 @@ #endregion + #region 閲囪喘鍏ュ簱 鏍¢獙妯″紡 + + /// <summary> + /// 閲囪喘鍏ュ簱鏍¢獙涓婁紶 + /// </summary> + /// <returns></returns> + [Route("WEBSController/set_SavePOStockInBill_BillCheck_Json")] + [HttpPost] + public object set_SavePOStockInBill_BillCheck_Json([FromBody] JObject oMain) + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + + try + { + List<Model.ClsKf_POStockInBillMain> lsmain = new List<Model.ClsKf_POStockInBillMain>(); + ListModels oListModels = new ListModels(); + lsmain = oListModels.getPOStockInBillMainByJson(msg1); + + WebAPI.WebS.ClsKf_POStockInBillMain websLsmain = new WebS.ClsKf_POStockInBillMain(); + + websLsmain.HInterID = lsmain[0].HInterID; + websLsmain.HBillNo = lsmain[0].HBillNo; + websLsmain.HBillType = "1201"; + websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID; + + if (oWebs.set_SavePOStockInBill_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 @@ -2272,6 +2554,61 @@ #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(); + + try + { + List<Model.ClsKf_OtherInBillMain> lsmain = new List<Model.ClsKf_OtherInBillMain>(); + ListModels oListModels = new ListModels(); + lsmain = oListModels.getOtherInBillMainByJson(msg1); + + 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 (oWebs.set_SaveOtherInBill_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 棰嗘枡鍑哄簱 涓婁紶鐢熷崟 @@ -2364,6 +2701,61 @@ objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "棰嗘枡鍑哄簱鍗曚笂浼犲け璐ワ紒" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + #endregion + + #region 棰嗘枡鍑哄簱 鏍¢獙妯″紡 + + /// <summary> + /// 棰嗘枡鍑哄簱鏍¢獙涓婁紶 + /// </summary> + /// <returns></returns> + [Route("WEBSController/set_SaveMateOutBill_BillCheck_Json")] + [HttpPost] + public object set_SaveMateOutBill_BillCheck_Json([FromBody] JObject oMain) + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + + try + { + List<Model.ClsKf_MateOutBillMain> lsmain = new List<Model.ClsKf_MateOutBillMain>(); + ListModels oListModels = new ListModels(); + lsmain = oListModels.getMateOutBillMainByJson(msg1); + + WebAPI.WebS.ClsKf_MateOutBillMain websLsmain = new WebS.ClsKf_MateOutBillMain(); + + websLsmain.HInterID = lsmain[0].HInterID; + websLsmain.HBillNo = lsmain[0].HBillNo; + websLsmain.HBillType = "1204"; + websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID; + + if (oWebs.set_SaveMateOutBill_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; } @@ -2732,6 +3124,61 @@ #endregion + #region 鍏朵粬鍑哄簱 鏍¢獙妯″紡 + + /// <summary> + /// 鍏朵粬鍑哄簱鏍¢獙涓婁紶 + /// </summary> + /// <returns></returns> + [Route("WEBSController/set_SaveOtherOutBill_BillCheck_Json")] + [HttpPost] + public object set_SaveOtherOutBill_BillCheck_Json([FromBody] JObject oMain) + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + + try + { + List<Model.ClsKf_OtherOutBillMain> lsmain = new List<Model.ClsKf_OtherOutBillMain>(); + ListModels oListModels = new ListModels(); + lsmain = oListModels.getOtherOutBillMainByJson(msg1); + + WebAPI.WebS.ClsKf_OtherOutBillMain websLsmain = new WebS.ClsKf_OtherOutBillMain(); + + websLsmain.HInterID = lsmain[0].HInterID; + websLsmain.HBillNo = lsmain[0].HBillNo; + websLsmain.HBillType = "1206"; + websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID; + + if (oWebs.set_SaveOtherOutBill_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 鐢熶骇琛ユ枡 涓婁紶鐢熷崟 @@ -3032,6 +3479,61 @@ objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "鐩存帴璋冩嫧鍗曚笂浼犲け璐ワ紒" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + #endregion + + #region 鐩存帴璋冩嫧 鏍¢獙妯″紡 + + /// <summary> + /// 鐩存帴璋冩嫧鏍¢獙涓婁紶 + /// </summary> + /// <returns></returns> + [Route("WEBSController/set_SaveMoveStockBill_BillCheck_Json")] + [HttpPost] + public object set_SaveMoveStockBill_BillCheck_Json([FromBody] JObject oMain) + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + + try + { + List<Model.ClsKf_MoveStockBillMain> lsmain = new List<Model.ClsKf_MoveStockBillMain>(); + ListModels oListModels = new ListModels(); + lsmain = oListModels.getMoveStockBillMainByJson(msg1); + + WebAPI.WebS.ClsKf_MoveStockBillMain websLsmain = new WebS.ClsKf_MoveStockBillMain(); + + websLsmain.HInterID = lsmain[0].HInterID; + websLsmain.HBillNo = lsmain[0].HBillNo; + websLsmain.HBillType = "1207"; + websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID; + + if (oWebs.set_SaveMoveStockBill_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; } @@ -3424,6 +3926,92 @@ #endregion + #region 閿�鍞��璐� 涓婁紶鐢熷崟 + + #region 閿�鍞��璐� 鏂板妯″紡 + + /// <summary> + /// 閿�鍞��璐ф柊澧炰笂浼� + /// </summary> + /// <returns></returns> + [Route("WEBSController/set_SaveSellOutBackBill_Json")] + [HttpPost] + public object set_SaveSellOutBackBill_Json([FromBody] JObject oMain) + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + try + { + List<Model.ClsKf_ICStockBillMain> lsmain = new List<Model.ClsKf_ICStockBillMain>(); + ListModels oListModels = new ListModels(); + lsmain = oListModels.getICStockBillMainByJson(msg1); + WebS.ClsKf_ICStockBillMain websLsmain = new WebS.ClsKf_ICStockBillMain(); + string sSourceType = lsmain[0].HMainSourceBillType; + websLsmain.HInterID = lsmain[0].HInterID; + websLsmain.HBillNo = lsmain[0].HBillNo; + websLsmain.HBillType = lsmain[0].HBillType; + websLsmain.HDate = lsmain[0].HDate; + websLsmain.HDeptID = lsmain[0].HDeptID; + websLsmain.HWHID = lsmain[0].HWHID; + websLsmain.HSCWHID = lsmain[0].HSCWHID; + websLsmain.HSupID = lsmain[0].HSupID; + websLsmain.HKeeperID = lsmain[0].HKeeperID; + websLsmain.HSecManagerID = lsmain[0].HSecManagerID; + websLsmain.HEmpID = lsmain[0].HEmpID; + websLsmain.HManagerID = lsmain[0].HManagerID; + websLsmain.HRemark = lsmain[0].HRemark; + websLsmain.HExplanation = lsmain[0].HExplanation; + websLsmain.HInnerBillNo = lsmain[0].HInnerBillNo; + websLsmain.HRedBlueFlag = lsmain[0].HRedBlueFlag; + websLsmain.HBillSubType = lsmain[0].HBillSubType; + if (lsmain[0].HMainSourceBillType == "1403") + { + websLsmain.HMainSourceBillType = "閫�璐ч�氱煡鍗�"; + } + else if (lsmain[0].HMainSourceBillType == "1401") + { + websLsmain.HMainSourceBillType = "閿�鍞鍗�"; + } + else + { + websLsmain.HMainSourceBillType = "鎵嬪伐褰曞叆"; + } + websLsmain.HMaker = lsmain[0].HMaker; + websLsmain.HBillerID = lsmain[0].HBillerID; + websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID; + websLsmain.HOWNERID = lsmain[0].HSTOCKORGID; + + if (oWebs.set_SaveSellOutBackBill_New(websLsmain, sSourceType, 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 鐢熶骇缁勬墭鍗� 涓婁紶鐢熷崟 /// <summary> @@ -3606,6 +4194,208 @@ objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "涓婃枡闃查敊鍗曚笂浼犲け璐ワ紒" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + + #endregion + + #region 杞﹂棿涓婃灦鍗� 涓婁紶鐢熷崟 + + /// <summary> + /// 杞﹂棿涓婃灦鍗曟柊澧炰笂浼� + /// </summary> + /// <returns></returns> + [Route("WEBSController/set_SaveMaterialUpperBill_Json")] + [HttpPost] + public object set_SaveMaterialUpperBill_Json([FromBody] JObject oMain) + { + BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew; + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + try + { + string sMainStr = "[" + msg1.ToString() + "]"; + List<Model.ClsKf_WorkShopICStockBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsKf_WorkShopICStockBillMain>>(sMainStr); + + //鍗曟嵁鍙锋槸鍚﹂噸澶� + if (oBaseBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, mainList[0].HBillNo, BillStatus, mainList[0].HInterID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒涓嶅厑璁镐繚瀛橈紒"; + objJsonResult.data = null; + return objJsonResult; + } + //鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞� + string s = ""; + int sYear = 0; + int sPeriod = 0; + if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(mainList[0].HDate, ref sYear, ref sPeriod, ref s) == false) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = s; + objJsonResult.data = null; + return objJsonResult; + } + oCn.BeginTran(); + //鐢熸垚鍗曟嵁 + //鎻掑叆涓昏〃 + oCn.RunProc("Insert Into Kf_WorkShopICStockBillMain " + + "(HInterID,HBillNo,HBillType,HBillSubType,HDate,HRemark" + + ",HYear,HPeriod,HMaker,HMakeDate,HStockOrgID" + + ",HMainSourceBillType,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo" + + ",HMangerID,HSecManagerID,HKeeperID,HDeptID" + + ") " + + " values(" + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillNo + "','" + mainList[0].HBillType + "','" + mainList[0].HBillSubType + "','" + mainList[0].HDate.ToShortDateString() + "','" + mainList[0].HRemark + "'" + + ", " + sYear.ToString() + "," + sPeriod.ToString() + ",'" + mainList[0].HMaker + "',getdate()," + mainList[0].HSTOCKORGID.ToString() + + ",'" + mainList[0].HMainSourceBillType + "'," + mainList[0].HMainSourceInterID.ToString() + "," + mainList[0].HMainSourceEntryID.ToString() + ",'" + mainList[0].HMainSourceBillNo + "'" + + ", " + mainList[0].HMangerID.ToString() + "," + mainList[0].HSecManagerID.ToString() + "," + mainList[0].HKeeperID.ToString() + "," + mainList[0].HDeptID.ToString() + + ") "); + //鎻掑叆瀛愯〃 + ds = oCn.RunProcReturn("exec h_p_Kf_MaterialUpperBillSub_Insert " + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillNo + "'", "h_p_Kf_MaterialUpperBillSub_Insert"); + + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + oCn.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁淇濆瓨澶辫触锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["s"]) != "OK") + { + oCn.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["s"]); + objJsonResult.data = null; + return objJsonResult; + } + else + { + //鏇存柊杞﹂棿鐗╂枡搴撳瓨 + oCn.RunProc("EXEC h_p_WMS_UPDateICinventory_WorkShop " + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillType + "'"); + //鏇存柊杞﹂棿鏉$爜搴撳瓨 + oCn.RunProc("EXEC h_p_WMS_UPDateBarCodeICinventory_WorkShop " + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillType + "',1"); + oCn.Commit(); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍗曟嵁鍙凤細" + mainList[0].HBillNo + " 鏂板鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; + } + } + catch (Exception e) + { + oCn.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "杞﹂棿涓婃灦鍗曚笂浼犲け璐ワ紒" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + #endregion + + #region 杞﹂棿涓嬫灦鍗� 涓婁紶鐢熷崟 + + /// <summary> + /// 杞﹂棿涓嬫灦鍗曟柊澧炰笂浼� + /// </summary> + /// <returns></returns> + [Route("WEBSController/set_SaveMaterialLowerBill_Json")] + [HttpPost] + public object set_SaveMaterialLowerBill_Json([FromBody] JObject oMain) + { + BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew; + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + try + { + string sMainStr = "[" + msg1.ToString() + "]"; + List<Model.ClsKf_WorkShopICStockBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsKf_WorkShopICStockBillMain>>(sMainStr); + + //鍗曟嵁鍙锋槸鍚﹂噸澶� + if (oBaseBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, mainList[0].HBillNo, BillStatus, mainList[0].HInterID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒涓嶅厑璁镐繚瀛橈紒"; + objJsonResult.data = null; + return objJsonResult; + } + //鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞� + string s = ""; + int sYear = 0; + int sPeriod = 0; + if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(mainList[0].HDate, ref sYear, ref sPeriod, ref s) == false) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = s; + objJsonResult.data = null; + return objJsonResult; + } + oCn.BeginTran(); + //鐢熸垚鍗曟嵁 + //鎻掑叆涓昏〃 + oCn.RunProc("Insert Into Kf_WorkShopICStockBillMain " + + "(HInterID,HBillNo,HBillType,HBillSubType,HDate,HRemark" + + ",HYear,HPeriod,HMaker,HMakeDate,HStockOrgID" + + ",HMainSourceBillType,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo" + + ",HMangerID,HSecManagerID,HKeeperID,HDeptID" + + ") " + + " values(" + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillNo + "','" + mainList[0].HBillType + "','" + mainList[0].HBillSubType + "','" + mainList[0].HDate.ToShortDateString() + "','" + mainList[0].HRemark + "'" + + ", " + sYear.ToString() + "," + sPeriod.ToString() + ",'" + mainList[0].HMaker + "',getdate()," + mainList[0].HSTOCKORGID.ToString() + + ",'" + mainList[0].HMainSourceBillType + "'," + mainList[0].HMainSourceInterID.ToString() + "," + mainList[0].HMainSourceEntryID.ToString() + ",'" + mainList[0].HMainSourceBillNo + "'" + + ", " + mainList[0].HMangerID.ToString() + "," + mainList[0].HSecManagerID.ToString() + "," + mainList[0].HKeeperID.ToString() + "," + mainList[0].HDeptID.ToString() + + ") "); + //鎻掑叆瀛愯〃 + ds = oCn.RunProcReturn("exec h_p_Kf_MaterialLowerBillSub_Insert " + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillNo + "'", "h_p_Kf_MaterialLowerBillSub_Insert"); + + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + oCn.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁淇濆瓨澶辫触锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["s"]) != "OK") + { + oCn.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["s"]); + objJsonResult.data = null; + return objJsonResult; + } + else + { + //鏇存柊杞﹂棿鐗╂枡搴撳瓨 + oCn.RunProc("EXEC h_p_WMS_UPDateICinventory_WorkShop " + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillType + "'"); + //鏇存柊杞﹂棿鏉$爜搴撳瓨 + oCn.RunProc("EXEC h_p_WMS_UPDateBarCodeICinventory_WorkShop " + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillType + "',-1"); + oCn.Commit(); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍗曟嵁鍙凤細" + mainList[0].HBillNo + " 鏂板鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; + } + } + catch (Exception e) + { + oCn.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "杞﹂棿涓嬫灦鍗曚笂浼犲け璐ワ紒" + e.ToString(); objJsonResult.data = null; return objJsonResult; } @@ -4102,6 +4892,44 @@ } } + /// <summary> + /// 澶忓疂涓撶敤璋冩嫧 鎵弿婧愬崟鏉$爜 20250513 + /// </summary> + /// <returns></returns> + [Route("WEBSController/get_SourceBarCode_MoveStock_XiaBao_Json")] + [HttpGet] + public object get_SourceBarCode_MoveStock_XiaBao_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HFIFOWhID, Int64 HOWNERID) + { + try + { + WebSoBar = oWebs.get_SourceBarCode_MoveStock_XiaBao(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HFIFOWhID, HOWNERID, 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; + } + } + #endregion #region 鍒嗘寮忚皟鍑� 鎵弿婧愬崟鏉$爜 @@ -4272,6 +5100,48 @@ #endregion + #region 閿�鍞��璐� 鎵弿婧愬崟鏉$爜 + + /// <summary> + /// 閿�鍞��璐� 鎵弿婧愬崟鏉$爜 + /// </summary> + /// <returns></returns> + [Route("WEBSController/Get_SourceBarCode_SellOutBack_Json")] + [HttpGet] + public object Get_SourceBarCode_SellOutBack_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HStockOrgID) + { + try + { + WebSoBar = oWebs.get_SourceBarCode_SellOutBack(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HStockOrgID, 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; + } + } + + #endregion + #endregion @@ -4295,237 +5165,18 @@ sJXCode = POStockInBillController.JX_Json(sBarCode, HInterID, HBillType, HStockOrgID, HBillNo, HMaker); SourceFlag = true; } - else if(oSystemParameter.omodel.WMS_CampanyName == "娣诲悍" && HSourceBillType == "1241") + else if(oSystemParameter.omodel.WMS_CampanyName == "妫シ" && HSourceBillType == "1241") { - DataSet ds; - string sql = "select HBarCode,HSourceInterID,HSourceEntryID,HSourceBillNo from Gy_BarCodeBill with(nolock) where HBarCode = '" + sBarCode + "'"; - string HDataBaseName = Util.GetConfigKey(AppDomain.CurrentDomain.BaseDirectory + "/Config/kdapi.config", "DataBaseName");//鑾峰彇閲戣澏鏁版嵁搴撳悕绉� - string HSourceBillNo_TB = ""; - Int64 HSourceInterID = 0; - - ds = oCn.RunProcReturn(sql, "Gy_BarCodeBill"); - //鍒ゆ柇鏉$爜淇℃伅鏄惁鍦ㄦ潯鐮佹。妗堜腑 - if (ds == null || ds.Tables[0].Rows.Count < 1) + //鑷姩鍖呰绾垮悓姝ラ噾铦剁敓浜у叆搴撶敵璇峰崟 + sJXCode = Kf_OtherInBill_SK(sBarCode, HCustom1); + //鍚屾杩囩▼涓彂鐢熷紓甯革紝鐩存帴杩斿洖鎶ラ敊淇℃伅 + if (sJXCode.Contains("鍙戠敓寮傚父")) { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "鏉$爜妗f涓笉瀛樺湪姝ゆ潯鐮佺紪鍙凤細" + sBarCode; + objJsonResult.Message = sJXCode; objJsonResult.data = null; return objJsonResult; - } - else - { - //鑾峰彇鍏ュ簱鐢宠鍗曞崟鍙�/涓籌D - HSourceBillNo_TB = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HSourceBillNo"]); - HSourceInterID = DBUtility.ClsPub.isInt(ds.Tables[0].Rows[0]["HSourceInterID"]); - //鏍规嵁鍏ュ簱鐢宠鍗曞崟鍙峰垽鏂崟鎹俊鎭槸鍚﹀凡缁忓悓姝ュ埌閲戣澏 - sql = string.Format(@"select * from FROM {0}..TFKO_t_Cust100009 with(nolock) where FBILLNO = '" + HSourceBillNo_TB + "'", HDataBaseName); - - LogService.Write("鍏朵粬鍏ュ簱鏌ヨ鍏ュ簱鐢宠鍗曟槸鍚﹀瓨鍦細" + sql); - - ds = oCn.RunProcReturn(sql, "TFKO_t_Cust100009"); - //鍏ュ簱鐢宠鍗曟病鏈夊悓姝ュ埌閲戣澏鍒欒繘琛屽悓姝� - if (ds == null || ds.Tables[0].Rows.Count < 1) - { - sql = "exec h_p_Kf_StockInRequestBillToErp '" + HSourceInterID + "','" + HSourceBillNo_TB + "'"; - ds = oCn.RunProcReturn(sql, "h_p_Kf_StockInRequestBillToErp"); - - if (ds == null || ds.Tables[0].Rows.Count == 0) - { - oCn.RollBack(); - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "webapi鍏ュ簱鐢宠鍗曞悓姝ワ紝鑾峰彇淇℃伅澶辫触"; - objJsonResult.data = null; - return objJsonResult; - } - else - { - JObject model = new JObject(); - //model.Add("FBillType", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["FBillType"]) }); //鍗曟嵁绫诲瀷 - model.Add("FDate", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏃ユ湡"])); //鍗曟嵁鏃ユ湡 - model.Add("FStockOrgId", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["搴撳瓨缁勭粐浠g爜"]) }); //搴撳瓨缁勭粐浠g爜 - model.Add("FBillNo", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鍗曟嵁鍙�"])); //鍗曟嵁鍙� - model.Add("FStockDirect", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["搴撳瓨鏂瑰悜"])); //搴撳瓨鏂瑰悜 - model.Add("FDEPTID", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["閮ㄩ棬浠g爜"]) }); //鐢熶骇杞﹂棿 - model.Add("F_paez_Text", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鍏ュ簱鐮佸崟"])); //鍏ュ簱鐮佸崟 - model.Add("F_paez_Integer2", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绛掑瓙鏁�"])); //绛掑瓙鏁� - model.Add("F_paez_Integer1", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绛掔鍙暟"])); //绛掔鍙暟 - model.Add("F_paez_Integer3", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["瀹氶暱"])); //瀹氶暱 - //model.Add("F_paez_BaseProperty4", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绛掗噸"])); //绛掗噸 - model.Add("F_paez_Base", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["宸ュ彿"])); //宸ュ彿 - model.Add("F_paez_Combo", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鐝浠g爜"])); //鐝 - //model.Add("F_paez_BaseProperty1", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鎵瑰彿"])); //鎵瑰彿 - model.Add("F_paez_Integer", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绠辨暟"])); //绠辨暟 - model.Add("F_paez_Decimal2", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鎬婚噸"])); //鎬婚噸 - //model.Add("F_paez_BaseProperty2", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鎴愬搧缂栫爜"])); //鎴愬搧缂栫爜 - //model.Add("F_paez_BaseProperty5", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鍝佸悕"])); //鍝佸悕 - model.Add("F_paez_Base1", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绾垮彿"])); //绾垮彿 - - //model.Add("F_paez_BaseProperty", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏈哄彴"])); //鏈哄彴 - model.Add("F_paez_Decimal", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绠遍噸"])); //绠遍噸 - //model.Add("F_WJUK_Text", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏉ユ簮"])); //鏉ユ簮 - model.Add("FDEPTID1", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["閮ㄩ棬浠g爜"]) });//閮ㄩ棬 - //model.Add("F_paez_BaseProperty6", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鎹诲悜"])); //鎹诲悜 - //model.Add("F_paez_BaseProperty7", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绠¤壊"])); //绠¤壊 - model.Add("F_paez_Assistant", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绛夌骇"])); //绛夌骇 - model.Add("F_paez_Text11", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏈�灏忕鍙�"])); //鏈�灏忕鍙� - //model.Add("F_paez_Text3", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏂囨湰"])); //鏂囨湰 - model.Add("F_paez_Text4", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏈�澶х鍙�"])); //鏈�澶х鍙� - //model.Add("F_paez_PrintTimes", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鎵撳嵃娆℃暟"])); //鎵撳嵃娆℃暟 - //model.Add("F_paez_Text5", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绾垮彿"])); //鏉$爜鎵撳嵃 - //model.Add("F_paez_BaseProperty10", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["閮ㄩ棬浠g爜"]) }); //鐢熶骇閮ㄩ棬 - model.Add("F_paez_Combo1", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏄惁鍐呭璐�"])); //鏄惁鍐呭璐� - model.Add("F_paez_Combo2", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["浜у搧绫诲瀷"])); //浜у搧绫诲瀷 - model.Add("F_paez_Combo3", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["婊$増鐘舵��"])); //婊$増鐘舵�� - //model.Add("F_paez_BaseProperty11", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["瑙勬牸鍨嬪彿"])); //瑙勬牸鍨嬪彿 - //model.Add("F_paez_BaseProperty12", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["缃戝埆"])); //缃戝埆 - //model.Add("F_TFKO_Text4", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绠卞彿鍓嶇紑"])); //绠卞彿鍓嶇紑 - model.Add("F_paez_WB", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["缃戝埆"])); //缃戝埆1 - - - JArray Fentity = new JArray(); - foreach (DataRow item in ds.Tables[0].Rows) - { - JObject FentityModel = new JObject(); - FentityModel.Add("FMATERIALID", new JObject() { ["FNumber"] = item["鐗╂枡浠g爜"].ToString() }); // 鐗╂枡浠g爜 - FentityModel.Add("FUnitID", new JObject() { ["FNumber"] = item["璁¢噺鍗曚綅浠g爜"].ToString() }); // 鍗曚綅浠g爜 - FentityModel.Add("FQty", item["鍑�閲�"].ToString()); //鍑�閲� - FentityModel.Add("FBASEUNITID", new JObject() { ["FNumber"] = item["鍩烘湰璁¢噺鍗曚綅浠g爜"].ToString() }); // 鍩烘湰鍗曚綅浠g爜 - FentityModel.Add("FBASEQTY", item["瀹炴敹鏁伴噺"].ToString()); //瀹炴敹鏁伴噺 - FentityModel.Add("FSecUNITID", new JObject() { ["FNumber"] = item["搴撳瓨杈呰閲忓崟浣嶄唬鐮�"].ToString() }); // 搴撳瓨杈呰閲忓崟浣嶄唬鐮� - FentityModel.Add("FSecQTY", item["搴撳瓨杈呭崟浣嶅疄鏀舵暟閲�"].ToString()); //瀹炴敹鏁伴噺锛堝簱瀛樿緟鍗曚綅锛� - FentityModel.Add("FOWNERTYPEID", item["璐т富绫诲瀷"].ToString()); //璐т富绫诲瀷 - FentityModel.Add("FOWNERID", new JObject() { ["FNumber"] = item["璐т富浠g爜"].ToString() }); // 璐т富浠g爜 - FentityModel.Add("FKEEPERTYPEID", item["淇濈鑰呯被鍨�"].ToString()); //淇濈鑰呯被鍨� - FentityModel.Add("FKEEPERID", new JObject() { ["FNumber"] = item["淇濈鑰呬唬鐮�"].ToString() }); // 淇濈鑰呬唬鐮� - FentityModel.Add("FAuxPropId", new JObject() { ["FAUXPROPID__FF100003"] = new JObject() { ["FNumber"] = item["杈呭姪灞炴�т唬鐮�"].ToString() } }); // 杈呭姪灞炴�� - FentityModel.Add("FExtAuxUnitId", new JObject() { ["FNumber"] = item["杈呰閲忓崟浣嶄唬鐮�"].ToString() }); // 杈呰閲忓崟浣嶄唬鐮� - FentityModel.Add("FExtAuxUnitQty", item["绠辨暟"].ToString()); //绠辨暟 - FentityModel.Add("F_TFKO_Assistant", new JObject() { ["FNumber"] = item["缃戝埆浠g爜"].ToString() }); // 缃戝埆 - FentityModel.Add("F_TFKO_Assistant1", new JObject() { ["FNumber"] = item["瀛斿瀷浠g爜"].ToString() }); // 瀛斿瀷 - FentityModel.Add("F_TFKO_Assistant2", new JObject() { ["FNumber"] = item["鑹叉辰浠g爜"].ToString() }); // 鑹叉辰 - FentityModel.Add("F_TFKO_Assistant3", new JObject() { ["FNumber"] = item["绾ゅ害浠g爜"].ToString() }); // 绾ゅ害 - FentityModel.Add("F_paez_Qty", item["姣涢噸"].ToString()); //姣涢噸 - FentityModel.Add("F_TFKO_Text1", item["绠¤壊"].ToString()); //绠¤壊 - FentityModel.Add("F_TFKO_Text2", item["鎹诲悜"].ToString()); //鎹诲悜 - FentityModel.Add("FBoxcode", item["绠卞彿"].ToString()); //绠卞彿 - FentityModel.Add("F_PAEZ_SQSL", item["鐢宠鍗曟暟閲�"].ToString()); //鐢宠鍗曟暟閲� - FentityModel.Add("F_paez_Integer4", item["绛掑瓙鏁�"].ToString()); //绛掑瓙鏁� - FentityModel.Add("F_paez_BaseQty", item["瀹炲彂鏁伴噺"].ToString()); //瀹炲彂鏁伴噺 - FentityModel.Add("F_paez_Qty1", item["瀹炴敹鏁伴噺"].ToString()); //瀹炴敹鏁伴噺 - FentityModel.Add("F_paez_Text2", item["绠卞彿"].ToString()); //绠卞彿 - - - //JArray Fentity2 = new JArray(); - //JObject FentityModel2 = new JObject(); - //FentityModel2.Add("FEntity_Link_FFlowId", item["FEntity_Link_FFlowId"].ToString()); - //FentityModel2.Add("FEntity_Link_FFlowLineId", item["FEntity_Link_FFlowLineId"].ToString()); - //FentityModel2.Add("FEntity_Link_FRuleId", item["FEntity_Link_FRuleId"].ToString()); - //FentityModel2.Add("FEntity_Link_FSTableName", item["FEntity_Link_FSTableName"].ToString()); - //FentityModel2.Add("FEntity_Link_FSBillId", item["FEntity_Link_FSBillId"].ToString()); - //FentityModel2.Add("FEntity_Link_FSId", item["FEntity_Link_FSId"].ToString()); - //Fentity2.Add(FentityModel2); - //FentityModel.Add("FEntity_Link", Fentity2); - //FentityModel.Add("FBFLowId", new JObject() { ["FID"] = item["FBFLOWID"].ToString() }); - Fentity.Add(FentityModel); - } - model.Add("FEntity", Fentity); //鏄庣粏淇℃伅 - JObject jsonRoot = new JObject() - { - ["Creator"] = "", - ["NeedUpDateFields"] = new JArray(), - ["NeedReturnFields"] = new JArray(), - //["IsDeleteEntry"] = "true", - //["SubSystemId"] = "", - //["IsVerifyBaseDataField"] = "false", - ["IsDeleteEntry"] = "true", - ["SubSystemId"] = "", - ["IsVerifyBaseDataField"] = "true", - ["IsEntryBatchFill"] = "false", - ["ValidateFlag"] = "true", - ["NumberSearch"] = "true", - ["IsAutoAdjustField"] = "false", - ["InterationFlags"] = "", - ["IgnoreInterationFlag"] = "", - //["IsAutoSubmitAndAudit"] = true,//鑷姩璋冪敤鎻愪氦鍜屽鏍稿姛鑳� - ["Model"] = model - }; - - //浠庨厤缃枃浠惰幏鍙� CLOUD缃戝潃銆佽处濂椾俊鎭�佺櫥褰曠敤鎴枫�佺櫥褰曞瘑鐮� - if (!Pub_Class.ClsPub.GetCLOUDLoginInfo(ref Pub_Class.ClsPub.sExeReturnInfo)) - { - oCn.RollBack(); - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍏ュ簱鐢宠鍗曞悓姝ヨ幏鍙栫櫥褰曡处鍙峰瘑鐮佸け璐ワ紒"; - objJsonResult.data = null; - return objJsonResult; - } - - var loginRet = InvokeHelper.Login(); - var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>(); - if (isSuccess == 0) - { - oCn.RollBack(); - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鐧诲綍閲戣澏澶辫触锛�"; - objJsonResult.data = null; - return objJsonResult; - } - else - { - string result = InvokeHelper.Save("k18d2ab4f14034c569576ec8e0835a80c", JsonConvert.SerializeObject(jsonRoot));//淇濆瓨 - - if (JObject.Parse(result)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") - { - LogService.Write(JsonConvert.SerializeObject(jsonRoot)); - oCn.RollBack(); - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍏ュ簱鐢宠鍗曞悓姝ラ噾铦朵簯澶辫触锛佸崟鍙�:" + HSourceBillNo_TB + result + jsonRoot; - objJsonResult.data = null; - return objJsonResult; - } - - //鎻愪氦瀹℃牳 - string result1 = string.Empty; - string result2 = string.Empty; - var fID = JObject.Parse(result)["Result"]["Id"].ToString(); - var fBillNo = JObject.Parse(result)["Result"]["Number"].ToString(); - var json = new - { - Ids = fID, - }; - if (oSystemParameter.omodel.Kf_StockInRequestBill_AutoCheck == "Y") //绯荤粺鍙傛暟 鑷姩瀹℃牳 - { - result1 = InvokeHelper.Submit("k18d2ab4f14034c569576ec8e0835a80c", JsonConvert.SerializeObject(json));//鎻愪氦 - result2 = InvokeHelper.Audit("k18d2ab4f14034c569576ec8e0835a80c", JsonConvert.SerializeObject(json));//瀹℃牳 - - if (JObject.Parse(result1)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") - { - oCn.RollBack(); - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍏ュ簱鐢宠鍗曞崟鍙�:" + ",鎻愪氦澶辫触" + result1; - objJsonResult.data = null; - return objJsonResult; - } - - if (JObject.Parse(result2)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") - { - oCn.RollBack(); - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍏ュ簱鐢宠鍗曞崟鍙�:" + ",瀹℃牳澶辫触" + result2; - objJsonResult.data = null; - return objJsonResult; - } - } - } - } - } } } else @@ -4728,6 +5379,44 @@ //} } + /// <summary> + /// 鐗╂枡鏉$爜鏂囨湰妗� 璋冩嫧鎵爜璋冪敤 澶忓疂 鎵弿鐗╂枡鏉$爜鑷姩甯﹀嚭婧愬崟淇℃伅 20250506 + /// </summary> + /// <returns></returns> + [Route("WEBSController/get_BarCode_MoveStock_AddSource_Json")] + [HttpGet] + public Object get_BarCode_MoveStock_AddSource_Json(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 HCustom1, string HCustom2) + { + try + { + WebSoBar = oWebs.get_BarCode_MoveStock_AddSource(sBarCode, HInterID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, HQty, SourceFlag, HSourceBillNo, HSourceBillType, HStockInOrgID, HStockOutOrgID, HScanStyle, ref DBUtility.ClsPub.sErrInfo, HCustom1, HCustom2); + 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; + } + } + #endregion @@ -4870,7 +5559,15 @@ objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�"; - objJsonResult.data = null; + objJsonResult.data = new + { + Materlist = ds.Tables[0], //杩斿洖鐗╂枡鏄庣粏鍒楄〃淇℃伅锛�0锛� + Mouldlist = ds.Tables[1], //杩斿洖妯℃不鍏峰垪琛ㄤ俊鎭紙1锛� + FIFOlist = ds.Tables[2], //杩斿洖鍏堣繘鍏堝嚭鍒楄〃淇℃伅锛�2锛� + BarCodelist = ds.Tables[3], //杩斿洖鏉$爜鏄庣粏鍒楄〃淇℃伅锛�3锛� + ICMOReportlist = ds.Tables[4], //杩斿洖婧愬崟鐢熶骇姹囨姤鍗曟潯鐮佹槑缁嗗垪琛ㄤ俊鎭紙4锛� + BarCodeDetailslist = ds.Tables[5] //杩斿洖褰撳墠鎵�鎵弿鏉$爜鏄庣粏淇℃伅锛�5锛� + }; return objJsonResult; } else @@ -5051,6 +5748,48 @@ #endregion + #region 鎵弿鍗曟嵁鏉$爜 宸插瓨鍦ㄦ壂鐮佽褰曚笖鍗曟嵁鍙戠敓鍙樻洿鍚庝袱杈规暟鎹笉涓�鑷存椂锛屾竻绌哄師鎵爜鏁版嵁 20241216 + + /// <summary> + /// 宸插瓨鍦ㄦ壂鐮佽褰曚笖鍗曟嵁鍙戠敓鍙樻洿鍚庝袱杈规暟鎹笉涓�鑷存椂锛屾竻绌哄師鎵爜鏁版嵁 + /// </summary> + /// <returns></returns> + [Route("WEBSController/get_ClearBarCode_BillCheck_Json")] + [HttpGet] + public object get_ClearBarCode_BillCheck_Json(Int64 HInterID, string HBillType, string HMaker, Int64 HStockOrgID) + { + try + { + ds = oCn.RunProcReturn("exec h_p_WMS_ClearBarCode_BillCheck " + HInterID.ToString() + ",'" + HBillType + "','" + HMaker + "'," + HStockOrgID.ToString(), "h_p_WMS_ClearBarCode_BillCheck"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娓呯┖鍘熸壂鐮佹暟鎹彂鐢熼敊璇紒"; + objJsonResult.data = null; + return objJsonResult; + } + 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; + } + } + + #endregion + #region 鎵弿鐗╂枡鏉$爜 鍑哄叆搴撴ā鍧� /// <summary> @@ -5064,14 +5803,102 @@ //鑾峰彇绯荤粺鍙傛暟 string sErrMsg = ""; string sJXCode = ""; - if (oSystemParameter.ShowBill(ref sErrMsg) == true) + if (oSystemParameter.ShowBillByOrgID(HStockOrgID, 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 == "瀹夌憺") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤 { @@ -5147,6 +5974,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> @@ -5193,6 +6085,50 @@ objJsonResult.Message = "鑾峰彇鍒楄〃淇℃伅澶辫触锛�" + e.ToString(); objJsonResult.data = null; return objJsonResult; + } + } + + #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; + } } } @@ -5262,7 +6198,7 @@ #endregion - #region 缂撳瓨妯″潡 杩斿洖缂撳瓨鍒楄〃淇℃伅 + #region 鏍¢獙缂撳瓨妯″潡 杩斿洖缂撳瓨鍒楄〃淇℃伅 /// <summary> /// 杩斿洖缂撳瓨鍒楄〃淇℃伅 鏍¢獙妯″紡 @@ -5306,6 +6242,186 @@ objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "鑾峰彇缂撳瓨鍒楄〃淇℃伅澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + #endregion + + #region 鏍¢獙缂撳瓨妯″潡 鏍规嵁鍗曟嵁ID,鍒犻櫎涓存椂琛ㄨ褰� 20241216 + + /// <summary> + /// 鏍规嵁鍗曟嵁ID,鍒犻櫎涓存椂琛ㄨ褰� + /// </summary> + /// <returns></returns> + [Route("WEBSController/DeleteTempBillList_BillCheck_Json")] + [HttpGet] + public object DeleteTempBillList_BillCheck_Json(long HInterID, string HBillNo, string HBillType, string HMaker, string MvarReportTitle, Int64 HStockOrgID) + { + string WorkList = "鍒犻櫎鏍¢獙缂撳瓨鍗曟嵁锛屽崟鎹彿锛�" + HBillNo; + string SystemName = "WMS-" + MvarReportTitle + "妯″潡"; + //鑾峰彇绯荤粺鍙傛暟 + string sErrMsg = ""; + if (oSystemParameter.ShowBillByOrgID(HStockOrgID, ref sErrMsg) == true) + { + string sSourceBarCodeCtl = "N"; //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 + + #region 绯荤粺鍙傛暟鑾峰彇 + //閲囪喘鍏ュ簱鍗� + if (HBillType == "1201") + { + //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'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 (sSourceBarCodeCtl == "Y") + { + try + { + oCn.BeginTran(); + oCn.RunProc("Delete from KF_PonderationBillMain_Temp_Verify where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "'", ref DBUtility.ClsPub.sExeReturnInfo); + //鍐欏叆鏃ュ織 + oCn.RunProc("Insert into System_Log(GeginDate,userid,WorkstationName,WorkList,SystemName,NetUserName,State) values " + + "(getdate(),'" + HMaker + "','" + ComputerName + "','" + WorkList + "','" + SystemName + "','','鍒犻櫎')" + ); + oCn.Commit(); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍗曟嵁鍙凤細" + HBillNo + " 鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCn.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎鎵�閫夊崟鎹潯鐮佸嚭鍏ュ簱涓存椂琛ㄨ褰曞け璐ワ紒" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + //鍘熷崟鎹潪鎵爜鐢熸垚锛屽垹闄ゆ潯鐮佸嚭鍏ュ簱缂撳瓨鍒楄〃璁板綍 + else + { + try + { + oCn.BeginTran(); + oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "' and HSubBillType=1", ref DBUtility.ClsPub.sExeReturnInfo); + //鍐欏叆鏃ュ織 + oCn.RunProc("Insert into System_Log(GeginDate,userid,WorkstationName,WorkList,SystemName,NetUserName,State) values " + + "(getdate(),'" + HMaker + "','" + ComputerName + "','" + WorkList + "','" + SystemName + "','','鍒犻櫎')" + ); + oCn.Commit(); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍗曟嵁鍙凤細" + HBillNo + " 鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCn.RollBack(); + 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; } @@ -5375,6 +6491,227 @@ objJsonResult.data = null; return objJsonResult; } + } + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg; + objJsonResult.data = null; + return objJsonResult; + } + } + + #endregion + + #region 鏍¢獙缂撳瓨妯″潡 宸蹭笂浼犳煡璇㈢晫闈㈠埛鏂� 20241216 + + /// <summary> + /// 宸蹭笂浼犳煡璇㈢晫闈紝鏍规嵁鍗曟嵁绫诲瀷銆佸崟鎹彿銆佺敤鎴锋煡璇㈠凡涓婁紶鍗曟嵁淇℃伅 + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetKf_ICStockBillQueryList_User_BillCheck_Json")] + [HttpGet] + public object GetKf_ICStockBillQueryList_User_BillCheck_Json(string HBillType, string HBillNo, string HMaker, Int64 HStockOrgID) + { + try + { + ds = oCn.RunProcReturn("exec h_p_Kf_ICStockBillQueryByUserList_BillCheck '" + HBillType + "','" + HBillNo + "','" + HMaker + "'," + HStockOrgID.ToString(), "h_p_Kf_ICStockBillQueryByUserList_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 = ds.Tables[0]; + 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 鏍¢獙缂撳瓨妯″潡 宸蹭笂浼犲垪琛ㄧ晫闈紝鎾ら攢鍔熻兘锛屽垹闄MS琛ㄨ褰曪紝骞舵洿鏂癟EMP琛ㄤ腑鐨勪笂浼犲瓧娈� HRelationInterID=0 20241216 + + /// <summary> + /// 宸蹭笂浼犲垪琛ㄧ晫闈紝鎾ら攢鍔熻兘锛屽垹闄MS琛ㄨ褰曪紝骞舵洿鏂癟EMP琛ㄤ腑鐨勪笂浼犲瓧娈� HRelationInterID=0 + /// </summary> + /// <returns></returns> + [Route("WEBSController/set_DeleteICStockBillAndWMS_BillCheck_Json")] + [HttpGet] + public object set_DeleteICStockBillAndWMS_BillCheck_Json(Int64 HInterID, string HBillNo, string HBillType, string HMaker, string MvarReportTitle, Int64 HStockOrgID) + { + string WorkList = "鎾ら攢鏍¢獙宸蹭笂浼犲崟鎹紝鍗曟嵁鍙凤細" + HBillNo; + string SystemName = "WMS-" + MvarReportTitle + "妯″潡"; + //鑾峰彇绯荤粺鍙傛暟 + string sErrMsg = ""; + if (oSystemParameter.ShowBillByOrgID(HStockOrgID, ref sErrMsg) == true) + { + string sERPMode = oSystemParameter.omodel.WMS_WMSStockCtl_ERPMode; //搴撳瓨鎺у埗-WMS搴撳瓨鎺у埗ERP妯″紡 (WISE銆丆LOUD銆丮ES) + string sSourceBarCodeCtl = "N"; //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 + + #region 绯荤粺鍙傛暟鑾峰彇 + //閲囪喘鍏ュ簱鍗� + if (HBillType == "1201") + { + //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'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 + + try + { + oCn.BeginTran(); + ds = oCn.RunProcReturn("exec h_p_WMS_ICStockBillAndWMS_Delete_BillCheck " + HInterID + ",'" + HBillNo + "','" + HBillType + "','" + sSourceBarCodeCtl + "','" + sERPMode + "'", "h_p_WMS_ICStockBillAndWMS_Delete_BillCheck"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + oCn.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎾ら攢鍗曟嵁宸蹭笂浼犺褰曞け璐ワ紝鎾ら攢鍗曟嵁鍒ゆ柇閿欒锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) == 1) + { + oCn.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; //澶辫触锛� + objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + else + { + //鍐欏叆鏃ュ織 + oCn.RunProc("Insert into System_Log(GeginDate,userid,WorkstationName,WorkList,SystemName,NetUserName,State) values " + + "(getdate(),'" + HMaker + "','" + ComputerName + "','" + WorkList + "','" + SystemName + "','','鎾ら攢')" + ); + oCn.Commit(); + objJsonResult.code = "0"; + objJsonResult.count = 1; //鎴愬姛锛� + objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + } + catch (Exception e) + { + oCn.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎾ら攢鍗曟嵁宸蹭笂浼犺褰曞け璐ワ紒" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; } } else @@ -7125,6 +8462,207 @@ #endregion + #region 涓婃灦銆佷笅鏋跺崟妯″潡璋冪敤鏂规硶 20250520 + + #region 涓嬫灦鍗曟壂鐮佹ā鍧� 鎵弿婧愬崟鏉$爜璋冪敤鏂规硶 + /// <summary> + /// 鎵弿婧愬崟鏉$爜 + /// </summary> + /// <returns></returns> + [Route("WEBSController/Get_SourceBarCode_MaterialLower_Json")] + [HttpGet] + public object get_SourceBarCode_MaterialLower_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HStockOrgID) + { + try + { + ds = oCn.RunProcReturn("exec h_p_WMS_AddSourceBarCode_MaterialLower " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "','" + HMaker + "'," + HStockOrgID.ToString(), "h_p_WMS_AddSourceBarCode_MaterialLower"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎵弿婧愬崟鏉$爜锛屽啓鍏ユ簮鍗曚复鏃惰〃澶辫触锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) == 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); + 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 = ds.Tables[0]; + 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> + /// 鎵弿鐗╂枡鏉$爜 + /// </summary> + /// <returns></returns> + [Route("WEBSController/Get_BarCode_WorkShop_Json")] + [HttpGet] + public object Get_BarCode_WorkShop_Json(string HBarCode, Int64 HInterID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Double HQty, bool SourceFlag, string HSourceBillType, string HCarBarCode, Int64 HStockOrgID) + { + //鑾峰彇绯荤粺鍙傛暟 + string sErrMsg = ""; + if (oSystemParameter.ShowBillByOrgID(HStockOrgID, ref sErrMsg) == true) + { + string sBatchNoCtl = "N"; //鏄惁杩涜鎵瑰彿鏍稿锛�'Y'涓烘牳瀵规壒鍙凤級 + string sMustQtyCtl = "灏忎簬绛変簬搴旀敹"; //搴旀敹鏁伴噺鎺у埗锛堝皬浜庣瓑浜庡簲鏀躲�佸畬鍏ㄧ瓑浜庡簲鏀躲�佷笉鎺у埗锛� + + //涓嬫灦鍗� + if (HBillType == "1252") + { + //鏄惁杩涜鎵瑰彿鏍稿锛�'Y'涓烘牳瀵规壒鍙凤級 + if (oSystemParameter.omodel.Kf_MaterialLowerBill_BatchNoCtl.ToUpper() == "Y") + { + sBatchNoCtl = "Y"; + } + //鎵爜鏁伴噺鑳藉惁鍙秴鍗曟嵁鏁伴噺鎺у埗锛堝皬浜庣瓑浜庡簲鏀躲�佸畬鍏ㄧ瓑浜庡簲鏀躲�佷笉鎺у埗锛� + if (oSystemParameter.omodel.Kf_MaterialLowerBill_MustQtyCtl == "灏忎簬绛変簬搴旀敹") + { + sMustQtyCtl = "灏忎簬绛変簬搴旀敹"; + } + else if (oSystemParameter.omodel.Kf_MaterialLowerBill_MustQtyCtl == "瀹屽叏绛変簬搴旀敹") + { + sMustQtyCtl = "瀹屽叏绛変簬搴旀敹"; + } + else + { + sMustQtyCtl = "涓嶆帶鍒�"; + } + } + + try + { + ds = oCn.RunProcReturn("exec h_p_WMS_AddBarCode_WorkShop " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HBarCode + "'," + HQty.ToString() + ",'" + HSourceBillType + "'," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HCarBarCode + "'," + HStockOrgID.ToString() + ",'" + HMaker + "'," + DBUtility.ClsPub.BoolToString(SourceFlag) + ",'" + sBatchNoCtl + "','" + sMustQtyCtl + "'", "h_p_WMS_AddBarCode_WorkShop"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎵弿鐗╂枡鏉$爜锛屽啓鍏ヤ复鏃惰〃澶辫触锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) == 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + 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; + } + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg; + objJsonResult.data = null; + return objJsonResult; + } + } + + #endregion + + #region 杞﹂棿鐗╂枡搴撳瓨鏌ヨ璋冪敤鏂规硶 + /// <summary> + /// 鑾峰彇杞﹂棿鐗╂枡鎵�鍦ㄤ綅缃� + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetICInventory_WorkShop_Json")] + [HttpGet] + public object GetICInventory_WorkShop_Json(string HBillType, Int64 HMaterID, Int64 HAuxPropID, string HBatchNo, Int64 HProcessExchangeInterID) + { + try + { + ds = oCn.RunProcReturn("exec h_p_KF_ICInventory_WorkShop '" + HBillType + "'," + HMaterID.ToString() + "," + HAuxPropID.ToString() + ",'" + HBatchNo + "'," + HProcessExchangeInterID.ToString(), "h_p_KF_ICInventory_WorkShop"); + 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 = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏌ヨ杞﹂棿鐗╂枡搴撳瓨澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #endregion + + + #region 鐗╂枡鏉$爜鏌ヨ璋冪敤鏂规硶 /// <summary> /// 鑾峰彇鏉$爜淇℃伅 @@ -8021,6 +9559,179 @@ } } #endregion + + #region 閿�鍞嚭搴撹拷婧褰曟姤琛� + /// <summary> + /// 鑾峰彇閿�鍞嚭搴撹拷婧褰� + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetKf_SellOutBarTraceReport_Json")] + [HttpGet] + public object GetKf_SellOutBarTraceReport_Json(DateTime HBeginDate, DateTime HEndDate, string HBarCode, Int64 HStockOrgID, string HWhere) + { + try + { + ds = oCn.RunProcReturn("exec h_p_Kf_SellOutBarTraceReport '" + HBeginDate.ToShortDateString() + "','" + HEndDate.ToShortDateString() + "','" + HBarCode + "'," + HStockOrgID.ToString() + ",'" + HWhere + "'", "h_p_Kf_SellOutBarTraceReport"); + + 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 = ds.Tables[0]; + 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 浠撳簱鍑哄叆搴撴姤琛� + + + #region 鑾峰彇鍗曟嵁绫诲瀷淇℃伅 + /// <summary> + /// 鑾峰彇鍗曟嵁绫诲瀷淇℃伅 + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetICStockBill_BillType_Json")] + [HttpGet] + public object GetICStockBill_BillType_Json() + { + try + { + ds = oCn.RunProcReturn("exec h_p_KF_StockInOutReport_BillType ", "h_p_KF_StockInOutReport_BillType"); + 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; + } + } + #endregion + + #region 浠撳簱鍑哄叆搴撴槑缁嗘姤琛� + /// <summary> + /// 浠撳簱鍑哄叆搴撴槑缁嗘姤琛� + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetKF_StockInOutEntryReport_Json")] + [HttpGet] + public object GetKF_StockInOutEntryReport_Json(string sWhere) + { + try + { + ds = oCn.RunProcReturn("exec h_p_KF_StockInOutEntryReport " + sWhere, "h_p_KF_StockInOutEntryReport"); + 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 = ds.Tables[0]; + 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> + /// 浠撳簱鍑哄叆搴撹褰曟姤琛� + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetKF_StockInOutRecordReport_Json")] + [HttpGet] + public object GetKF_StockInOutRecordReport_Json(string sWhere) + { + try + { + ds = oCn.RunProcReturn("exec h_p_KF_StockInOutRecordReport " + sWhere, "h_p_KF_StockInOutRecordReport"); + 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 = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏌ヨ浠撳簱鍑哄叆搴撹褰曚俊鎭け璐ワ紒" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #endregion + + #endregion #region 瀹㈡埛鏉$爜鎵弿璁板綍鍗� @@ -9280,5 +10991,330 @@ #endregion #endregion + + + #region 妫シ鍏朵粬鍏ュ簱鎵爜 + public string Kf_OtherInBill_SK(string sBarCode,string HCustom1) + { + string HReturnResult; + SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); + Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); + + try + { + DataSet ds; + string sql = "select HBarCode,HSourceInterID,HSourceEntryID,HSourceBillNo from Gy_BarCodeBill with(nolock) where HBarCode = '" + sBarCode + "'"; + string HDataBaseName = Util.GetConfigKey(AppDomain.CurrentDomain.BaseDirectory + "/Config/kdapi.config", "DataBaseName");//鑾峰彇閲戣澏鏁版嵁搴撳悕绉� + string HSourceBillNo_TB = ""; + Int64 HSourceInterID = 0; + + ds = oCn.RunProcReturn(sql, "Gy_BarCodeBill"); + //鍒ゆ柇鏉$爜淇℃伅鏄惁鍦ㄦ潯鐮佹。妗堜腑 + if (ds == null || ds.Tables[0].Rows.Count < 1) + { + LogService.Write("鍏朵粬鍏ュ簱锛屾潯鐮佹。妗堜腑涓嶅瓨鍦ㄦ鏉$爜缂栧彿锛�" + sBarCode); + + return "鍙戠敓寮傚父锛屾潯鐮佹。妗堜腑涓嶅瓨鍦ㄦ鏉$爜缂栧彿锛�" + sBarCode; + } + else + { + //鑾峰彇鍏ュ簱鐢宠鍗曞崟鍙�/涓籌D + HSourceBillNo_TB = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HSourceBillNo"]); + HSourceInterID = DBUtility.ClsPub.isInt(ds.Tables[0].Rows[0]["HSourceInterID"]); + //鏍规嵁鍏ュ簱鐢宠鍗曞崟鍙峰垽鏂崟鎹俊鎭槸鍚﹀凡缁忓悓姝ュ埌閲戣澏 + sql = string.Format(@"select FID,FBILLNO,FDOCUMENTSTATUS from {0}..TFKO_t_Cust100009 with(nolock) where FBILLNO = '" + HSourceBillNo_TB + "'", HDataBaseName); + + ds = oCn.RunProcReturn(sql, "TFKO_t_Cust100009"); + //鍏ュ簱鐢宠鍗曟病鏈夊悓姝ュ埌閲戣澏鍒欒繘琛屽悓姝� + if (ds == null || ds.Tables[0].Rows.Count < 1) + { + sql = "exec h_p_Kf_StockInRequestBillToErp '" + HSourceInterID + "','" + HSourceBillNo_TB + "'"; + + LogService.Write("鍏朵粬鍏ュ簱鑾峰彇婧愬崟淇℃伅锛�" + sql); + + ds = oCn.RunProcReturn(sql, "h_p_Kf_StockInRequestBillToErp"); + + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + LogService.Write("鍙戠敓寮傚父锛寃ebapi鍏ュ簱鐢宠鍗曞悓姝ワ紝鑾峰彇淇℃伅澶辫触锛�" + sBarCode + "," + HSourceBillNo_TB + "," + HSourceInterID); + return "鍙戠敓寮傚父锛寃ebapi鍏ュ簱鐢宠鍗曞悓姝ワ紝鑾峰彇淇℃伅澶辫触"; + } + else + { + JObject model = new JObject(); + if (HCustom1 == "1") + { + //鐢熶骇杩斾慨鐢宠 + model.Add("FBillTypeID", new JObject() { ["FNumber"] = "SCRKSQ004" }); //鍗曟嵁绫诲瀷 + } + else { + //鏍囧噯鐢熶骇鍏ュ簱鐢宠鍗� + model.Add("FBillTypeID", new JObject() { ["FNumber"] = "SCRUSQD" }); //鍗曟嵁绫诲瀷 + } + + //model.Add("FBillType", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["FBillType"]) }); //鍗曟嵁绫诲瀷 + model.Add("FDate", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏃ユ湡"])); //鍗曟嵁鏃ユ湡 + model.Add("FStockOrgId", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["搴撳瓨缁勭粐浠g爜"]) }); //搴撳瓨缁勭粐浠g爜 ??? + model.Add("FBillNo", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鍗曟嵁鍙�"])); //鍗曟嵁鍙� + model.Add("FStockDirect", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["搴撳瓨鏂瑰悜"])); //搴撳瓨鏂瑰悜 + model.Add("FDEPTID", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["閮ㄩ棬浠g爜"]) }); //鐢熶骇杞﹂棿 + model.Add("F_paez_Text", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鍏ュ簱鐮佸崟"])); //鍏ュ簱鐮佸崟 + model.Add("F_paez_Integer2", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绛掑瓙鏁�"])); //绛掑瓙鏁� + model.Add("F_paez_Integer1", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绛掔鍙暟"])); //绛掔鍙暟 + model.Add("F_paez_Integer3", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["瀹氶暱"])); //瀹氶暱 ??? + //model.Add("F_paez_BaseProperty4", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绛掗噸"])); //绛掗噸 + model.Add("F_paez_Base", new JObject() { ["FSTAFFNUMBER"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["宸ュ彿"]) }); //宸ュ彿 ???蹇呭~ FSTAFFNUMBER + model.Add("F_paez_Combo", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鐝浠g爜"])); //鐝 ???蹇呭~ + //model.Add("F_paez_BaseProperty1", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鎵瑰彿"])); //鎵瑰彿 + model.Add("F_paez_Integer", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绠辨暟"])); //绠辨暟 ??? + model.Add("F_paez_Decimal2", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鎬婚噸"])); //鎬婚噸 + //model.Add("F_paez_BaseProperty2", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鎴愬搧缂栫爜"])); //鎴愬搧缂栫爜 + //model.Add("F_paez_BaseProperty5", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鍝佸悕"])); //鍝佸悕 + model.Add("F_paez_Base1", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绾垮彿"]) }); //绾垮彿 ???蹇呭~ + + //model.Add("F_paez_BaseProperty", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏈哄彴"])); //鏈哄彴 + model.Add("F_paez_Decimal", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绠遍噸"])); //绠遍噸 + //model.Add("F_WJUK_Text", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏉ユ簮"])); //鏉ユ簮 + model.Add("FDEPTID1", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["閮ㄩ棬浠g爜"]) });//閮ㄩ棬 + //model.Add("F_paez_BaseProperty6", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鎹诲悜"])); //鎹诲悜 + //model.Add("F_paez_BaseProperty7", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绠¤壊"])); //绠¤壊 + model.Add("F_paez_Assistant", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绛夌骇"]) });//绛夌骇 ???蹇呭~ + model.Add("F_paez_Text11", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏈�灏忕鍙�"])); //鏈�灏忕鍙� + //model.Add("F_paez_Text3", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏂囨湰"])); //鏂囨湰 + model.Add("F_paez_Text4", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏈�澶х鍙�"])); //鏈�澶х鍙� + //model.Add("F_paez_PrintTimes", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鎵撳嵃娆℃暟"])); //鎵撳嵃娆℃暟 + //model.Add("F_paez_Text5", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绾垮彿"])); //鏉$爜鎵撳嵃 + //model.Add("F_paez_BaseProperty10", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["閮ㄩ棬浠g爜"]) }); //鐢熶骇閮ㄩ棬 + model.Add("F_paez_Combo1", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏄惁鍐呭璐�"])); //鏄惁鍐呭璐� + model.Add("F_paez_Combo2", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["浜у搧绫诲瀷"])); //浜у搧绫诲瀷 + model.Add("F_paez_Combo3", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["婊$増鐘舵��"])); //婊$増鐘舵�� + //model.Add("F_paez_BaseProperty11", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["瑙勬牸鍨嬪彿"])); //瑙勬牸鍨嬪彿 + //model.Add("F_paez_BaseProperty12", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["缃戝埆"])); //缃戝埆 + //model.Add("F_TFKO_Text4", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绠卞彿鍓嶇紑"])); //绠卞彿鍓嶇紑 + model.Add("F_paez_WB", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["缃戝埆"]) }); //缃戝埆1 ??? + + JArray Fentity = new JArray(); + foreach (DataRow item in ds.Tables[0].Rows) + { + JObject FentityModel = new JObject(); + FentityModel.Add("FMATERIALID", new JObject() { ["FNumber"] = item["鐗╂枡浠g爜"].ToString() }); // 鐗╂枡浠g爜 + FentityModel.Add("FUnitID", new JObject() { ["FNumber"] = item["璁¢噺鍗曚綅浠g爜"].ToString() }); // 鍗曚綅浠g爜 ??? + FentityModel.Add("FQty", item["鍑�閲�"].ToString()); //鍑�閲� + FentityModel.Add("FBASEUNITID", new JObject() { ["FNumber"] = item["鍩烘湰璁¢噺鍗曚綅浠g爜"].ToString() }); // 鍩烘湰鍗曚綅浠g爜 + FentityModel.Add("FBASEQTY", item["瀹炴敹鏁伴噺"].ToString()); //瀹炴敹鏁伴噺 + FentityModel.Add("FSecUNITID", new JObject() { ["FNumber"] = item["搴撳瓨杈呰閲忓崟浣嶄唬鐮�"].ToString() }); // 搴撳瓨杈呭崟浣� + FentityModel.Add("FSecQTY", item["搴撳瓨杈呭崟浣嶅疄鏀舵暟閲�"].ToString()); //瀹炴敹鏁伴噺锛堝簱瀛樿緟鍗曚綅锛� + FentityModel.Add("FOWNERTYPEID", item["璐т富绫诲瀷"].ToString()); //璐т富绫诲瀷 ???鏁板�� + FentityModel.Add("FOWNERID", new JObject() { ["FNumber"] = item["璐т富浠g爜"].ToString() }); // 璐т富浠g爜 + FentityModel.Add("FKEEPERTYPEID", item["淇濈鑰呯被鍨�"].ToString()); //淇濈鑰呯被鍨� ???鏁板�� + FentityModel.Add("FKEEPERID", new JObject() { ["FNumber"] = item["淇濈鑰呬唬鐮�"].ToString() }); // 淇濈鑰呬唬鐮� + FentityModel.Add("FAuxPropId", new JObject() { ["FAUXPROPID__FF100003"] = new JObject() { ["FNumber"] = item["杈呭姪灞炴�т唬鐮�"].ToString() } }); // 杈呭姪灞炴�� + FentityModel.Add("FExtAuxUnitId", new JObject() { ["FNumber"] = item["杈呰閲忓崟浣嶄唬鐮�"].ToString() }); // 杈呭崟浣� + FentityModel.Add("FExtAuxUnitQty", item["鏄庣粏绠辨暟"].ToString()); //绠辨暟 + FentityModel.Add("F_TFKO_Assistant", new JObject() { ["FNumber"] = item["缃戝埆浠g爜"].ToString() }); // 缃戝埆 ???蹇呭~ + FentityModel.Add("F_TFKO_Assistant1", new JObject() { ["FNumber"] = item["瀛斿瀷浠g爜"].ToString() }); // 瀛斿瀷 + FentityModel.Add("F_TFKO_Assistant2", new JObject() { ["FNumber"] = item["鑹叉辰浠g爜"].ToString() }); // 鑹叉辰 ???蹇呭~ + FentityModel.Add("F_TFKO_Assistant3", new JObject() { ["FNumber"] = item["绾ゅ害浠g爜"].ToString() }); // 绾ゅ害 + FentityModel.Add("F_paez_Qty", item["姣涢噸"].ToString()); //姣涢噸 ???涓嶈兘灏忎簬绛変簬0 + FentityModel.Add("F_TFKO_Text1", item["绠¤壊"].ToString()); //绠¤壊 + FentityModel.Add("F_TFKO_Text2", item["鎹诲悜"].ToString()); //鎹诲悜 + FentityModel.Add("FBoxcode", item["绠卞彿"].ToString()); //绠卞彿 + FentityModel.Add("F_PAEZ_SQSL", item["鐢宠鍗曟暟閲�"].ToString()); //鐢宠鍗曟暟閲� + FentityModel.Add("F_paez_Integer4", item["绛掑瓙鏁�"].ToString()); //绛掑瓙鏁� + 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(); + //JObject FentityModel2 = new JObject(); + //FentityModel2.Add("FEntity_Link_FFlowId", item["FEntity_Link_FFlowId"].ToString()); + //FentityModel2.Add("FEntity_Link_FFlowLineId", item["FEntity_Link_FFlowLineId"].ToString()); + //FentityModel2.Add("FEntity_Link_FRuleId", item["FEntity_Link_FRuleId"].ToString()); + //FentityModel2.Add("FEntity_Link_FSTableName", item["FEntity_Link_FSTableName"].ToString()); + //FentityModel2.Add("FEntity_Link_FSBillId", item["FEntity_Link_FSBillId"].ToString()); + //FentityModel2.Add("FEntity_Link_FSId", item["FEntity_Link_FSId"].ToString()); + //Fentity2.Add(FentityModel2); + //FentityModel.Add("FEntity_Link", Fentity2); + //FentityModel.Add("FBFLowId", new JObject() { ["FID"] = item["FBFLOWID"].ToString() }); + Fentity.Add(FentityModel); + } + model.Add("FEntity", Fentity); //鏄庣粏淇℃伅 + JObject jsonRoot = new JObject() + { + ["Creator"] = "", + ["NeedUpDateFields"] = new JArray(), + ["NeedReturnFields"] = new JArray(), + //["IsDeleteEntry"] = "true", + //["SubSystemId"] = "", + //["IsVerifyBaseDataField"] = "false", + ["IsDeleteEntry"] = "true", + ["SubSystemId"] = "", + ["IsVerifyBaseDataField"] = "true", + ["IsEntryBatchFill"] = "false", + ["ValidateFlag"] = "true", + ["NumberSearch"] = "true", + ["IsAutoAdjustField"] = "false", + ["InterationFlags"] = "", + ["IgnoreInterationFlag"] = "", + //["IsAutoSubmitAndAudit"] = true,//鑷姩璋冪敤鎻愪氦鍜屽鏍稿姛鑳� + ["Model"] = model + }; + + //浠庨厤缃枃浠惰幏鍙� CLOUD缃戝潃銆佽处濂椾俊鎭�佺櫥褰曠敤鎴枫�佺櫥褰曞瘑鐮� + if (!Pub_Class.ClsPub.GetCLOUDLoginInfo(ref Pub_Class.ClsPub.sExeReturnInfo)) + { + LogService.Write("鍙戠敓寮傚父锛屽叆搴撶敵璇峰崟鍚屾鑾峰彇鐧诲綍璐﹀彿瀵嗙爜澶辫触锛侊細" + sBarCode + "," + HSourceBillNo_TB + "," + HSourceInterID); + return "鍙戠敓寮傚父锛屽叆搴撶敵璇峰崟鍚屾鑾峰彇鐧诲綍璐﹀彿瀵嗙爜澶辫触锛�"; + } + var loginRet = InvokeHelper.Login(); + + var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>(); + if (isSuccess == 0) + { + LogService.Write("鍏朵粬鍏ュ簱,鐧诲綍閲戣澏澶辫触锛�" + sBarCode + "," + HSourceBillNo_TB + "," + HSourceInterID); + return "鍙戠敓寮傚父锛岀櫥褰曢噾铦跺け璐ワ紒"; + } + else + { + string result = InvokeHelper.Save("k18d2ab4f14034c569576ec8e0835a80c", JsonConvert.SerializeObject(jsonRoot));//淇濆瓨 + + if (JObject.Parse(result)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") + { + LogService.Write("鍏ュ簱鐢宠鍗曞悓姝ラ噾铦朵簯澶辫触锛�" + JsonConvert.SerializeObject(jsonRoot)); + return "鍙戠敓寮傚父锛屽叆搴撶敵璇峰崟鍚屾閲戣澏浜戝け璐ワ紒鍗曞彿:" + HSourceBillNo_TB + result + jsonRoot; + } + LogService.Write("鍏ュ簱鐢宠鍗曞悓姝ラ噾铦朵簯鎴愬姛锛�" + JsonConvert.SerializeObject(jsonRoot)); + //鎻愪氦瀹℃牳 + string result1 = string.Empty; + string result2 = string.Empty; + var fID = JObject.Parse(result)["Result"]["Id"].ToString(); + var fBillNo = JObject.Parse(result)["Result"]["Number"].ToString(); + var json = new + { + Ids = fID, + }; + + string sErrMsg = ""; + string sJXCode = ""; + if (oSystemParameter.ShowBill(ref sErrMsg) == true) + { + if (oSystemParameter.omodel.Kf_StockInRequestBill_AutoCheck == "Y") //绯荤粺鍙傛暟 鑷姩瀹℃牳 + { + result1 = InvokeHelper.Submit("k18d2ab4f14034c569576ec8e0835a80c", JsonConvert.SerializeObject(json));//鎻愪氦 + result2 = InvokeHelper.Audit("k18d2ab4f14034c569576ec8e0835a80c", JsonConvert.SerializeObject(json));//瀹℃牳 + + if (JObject.Parse(result1)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") + { + LogService.Write("鍏ュ簱鐢宠鍗曞崟鍙�:" + ",鎻愪氦澶辫触" + result1); + return "鍙戠敓寮傚父锛屽叆搴撶敵璇峰崟鍗曞彿:" + ",鎻愪氦澶辫触" + result1; + } + + if (JObject.Parse(result2)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") + { + LogService.Write("鍏ュ簱鐢宠鍗曞崟鍙�:" + ",瀹℃牳澶辫触" + result2); + return "鍙戠敓寮傚父锛屽叆搴撶敵璇峰崟鍗曞彿:" + ",瀹℃牳澶辫触" + result2; + } + } + } + } + } + + //鏇存柊鏉$爜婧愬崟id淇℃伅 + sql = string.Format($@"update a set HSourceInterID = isnull(b.FID,0),HSourceEntryID = isnull(c.FEntryID,0) from Gy_BarCodeBill a with(nolock) left join AIS20220609121235..TFKO_t_Cust100009 b with(nolock) on a.HSourceBillNo = b.FBillNo left join AIS20220609121235..TFKO_t_Cust_Entry100065 c with(nolock) on b.FID = C.FID and a.HBarcodeNo = c.FSEQ where HSourceBillNo = '{HSourceBillNo_TB}'"); + //鎵ц鏇存柊璇彞 + oCn.RunProc(sql); + + } + //鍒ゆ柇鐢熶骇鍏ュ簱鐢宠鍗曟槸鍚︽槸瀹℃牳鐘舵�侊紝鑻ユ湭瀹℃牳鍒欐墽琛屾彁浜ゅ鏍告柟娉� + else + { + //--Z 鏆傚瓨锛孉 鍒涘缓锛孊 瀹℃牳涓紝C 宸插鏍革紝D 閲嶆柊瀹℃牳 + + //鑾峰彇鍏ュ簱鐢宠鍗曞崟鎹彿 + string HBillNo = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["FBILLNO"]); + //鍖呰绾跨敓鎴愮殑鐢熶骇鍏ュ簱鐢宠鍗曞弬涓庤嚜鍔ㄥ鏍� + if (HBillNo.Substring(0,2) == "RK" ) + { + //鑾峰彇鍏ュ簱鐢宠鍗曞崟鎹姸鎬� + string HBillStatus = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["FDOCUMENTSTATUS"]); + //鑾峰彇鍏ュ簱鐢宠鍗旾D + var json = new + { + Ids = ds.Tables[0].Rows[0]["FID"].ToString(), + }; + LogService.Write("鎻愪氦瀹℃牳ID锛�" + DBUtility.ClsPub.isInt(ds.Tables[0].Rows[0]["FID"])); + + //浠庨厤缃枃浠惰幏鍙� CLOUD缃戝潃銆佽处濂椾俊鎭�佺櫥褰曠敤鎴枫�佺櫥褰曞瘑鐮� + if (!Pub_Class.ClsPub.GetCLOUDLoginInfo(ref Pub_Class.ClsPub.sExeReturnInfo)) + { + LogService.Write("鍙戠敓寮傚父锛屽叆搴撶敵璇峰崟鍚屾鑾峰彇鐧诲綍璐﹀彿瀵嗙爜澶辫触锛侊細" + sBarCode + "," + HSourceBillNo_TB + "," + HSourceInterID); + return "鍙戠敓寮傚父锛屽叆搴撶敵璇峰崟鍚屾鑾峰彇鐧诲綍璐﹀彿瀵嗙爜澶辫触锛�"; + } + + //鐧诲綍閲戣澏 + var loginRet = InvokeHelper.Login(); + //鍒ゆ柇鏄惁鐧诲綍鎴愬姛 + var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>(); + if (isSuccess == 0) + { + LogService.Write("鍏朵粬鍏ュ簱,鐧诲綍閲戣澏澶辫触锛�" + sBarCode + "," + HSourceBillNo_TB + "," + HSourceInterID); + return "鍙戠敓寮傚父锛岀櫥褰曢噾铦跺け璐ワ紒"; + } + + //鎻愪氦瀹℃牳 + string result1 = string.Empty; + string result2 = string.Empty; + //鍒涘缓锛岄噸鏂板鏍哥姸鎬佽皟鐢ㄦ彁浜わ紝瀹℃牳鎸夐挳 + if (HBillStatus == "A" || HBillStatus == "D") + { + LogService.Write("鐢熶骇鍏ュ簱鐢宠鍗曞彿锛�" + HBillNo + ",閲嶆柊杩涜鎻愪氦瀹℃牳"); + result1 = InvokeHelper.Submit("k18d2ab4f14034c569576ec8e0835a80c", JsonConvert.SerializeObject(json));//鎻愪氦 + result2 = InvokeHelper.Audit("k18d2ab4f14034c569576ec8e0835a80c", JsonConvert.SerializeObject(json));//瀹℃牳 + + if (JObject.Parse(result1)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") + { + LogService.Write("鍏ュ簱鐢宠鍗曞崟鍙�:" + ",鎻愪氦澶辫触" + result1); + return "鍙戠敓寮傚父锛屽叆搴撶敵璇峰崟鍗曞彿:" + ",鎻愪氦澶辫触" + result1; + } + + if (JObject.Parse(result2)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") + { + LogService.Write("鍏ュ簱鐢宠鍗曞崟鍙�:" + ",瀹℃牳澶辫触" + result2); + return "鍙戠敓寮傚父锛屽叆搴撶敵璇峰崟鍗曞彿:" + ",瀹℃牳澶辫触" + result2; + } + } + //瀹℃牳涓姸鎬佽皟鐢ㄥ鏍告寜閽� + else if (HBillStatus == "B") + { + LogService.Write("鐢熶骇鍏ュ簱鐢宠鍗曞彿锛�" + HBillNo + ",閲嶆柊杩涜瀹℃牳"); + result2 = InvokeHelper.Audit("k18d2ab4f14034c569576ec8e0835a80c", JsonConvert.SerializeObject(json));//瀹℃牳 + if (JObject.Parse(result2)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") + { + LogService.Write("鍏ュ簱鐢宠鍗曞崟鍙�:" + ",瀹℃牳澶辫触" + result2); + return "鍙戠敓寮傚父锛屽叆搴撶敵璇峰崟鍗曞彿:" + ",瀹℃牳澶辫触" + result2; + } + } + + //鏇存柊鏉$爜婧愬崟id淇℃伅 + sql = string.Format($@"update a set HSourceInterID = isnull(b.FID,0),HSourceEntryID = isnull(c.FEntryID,0) from Gy_BarCodeBill a with(nolock) left join AIS20220609121235..TFKO_t_Cust100009 b with(nolock) on a.HSourceBillNo = b.FBillNo left join AIS20220609121235..TFKO_t_Cust_Entry100065 c with(nolock) on b.FID = C.FID and a.HBarcodeNo = c.FSEQ where HSourceBillNo = '{HSourceBillNo_TB}'"); + //鎵ц鏇存柊璇彞 + oCn.RunProc(sql); + } + + } + } + + HReturnResult = sBarCode; + } + catch (Exception ex) + { + LogService.Write(sBarCode + ",绋嬪簭鍙戠敓寮傚父锛�" + ex.Message + ";" + ex.StackTrace); + HReturnResult = "鍙戠敓寮傚父锛�" + ex.Message + ";" + ex.StackTrace; + } + return HReturnResult; + } + #endregion } } -- Gitblit v1.9.1