From ade73bb3949d5634fd6e34f2dc416b15096bcbc5 Mon Sep 17 00:00:00 2001 From: zrg <z18737863051@163.com> Date: 星期二, 09 一月 2024 15:29:51 +0800 Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API --- WebAPI/Controllers/条码管理/WEBSController.cs | 2456 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 2,401 insertions(+), 55 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 ebaeb6c..d1fe44e 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" @@ -12,6 +12,7 @@ using System.Net; using System.Net.Http; using System.Web.Http; +using System.Windows.Forms; using WebAPI; using WebAPI.Models; using WebAPI.Service; @@ -35,6 +36,78 @@ #region 鍏敤鏂规硶 + + #region 璐﹀彿鐧诲叆 + + /// <summary> + /// 璐﹀彿鐧诲叆鏃堕獙璇佽处鍙枫�佸瘑鐮佷俊鎭� + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetUser_Json")] + [HttpGet] + public object GetUser_Json(string HUserNumber, string HPassWord, Int64 HStockOrgID, string HStockOrgName) + { + try + { + HPassWord = DBUtility.ClsPub.StrToPsd(HPassWord.Trim()); + ds = oCn.RunProcReturn("exec h_p_Gy_User '" + HUserNumber + "','" + HPassWord + "'," + HStockOrgID.ToString(), "h_p_Gy_User"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "杈撳叆鐨勭敤鎴峰悕鎴栧瘑鐮侀敊璇紒"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + //鍒ゆ柇鐢ㄦ埛瀵瑰簲缁勭粐鏉冮檺锛屽緱鍒扮櫥鍏ョ粍缁囦俊鎭紙ID銆佷唬鐮併�佸悕绉帮級 + DataSet ds2 = oWebs.get_ORGANIZATIONS_UserByOrgRelation(HUserNumber, HStockOrgName); + if (ds2 == null || ds2.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒ゆ柇鐢ㄦ埛瀵瑰簲缁勭粐鏉冮檺閿欒锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else if (DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HBack"])==1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + + //鍒ゆ柇鐢ㄦ埛璐﹀彿瀵嗙爜锛圵ISE銆丆LOUD锛夋槸鍚︽纭� + if (!oWebs.CheckUser(DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["Czymc"]), ref DBUtility.ClsPub.sErrInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //澶辫触锛� + objJsonResult.data = null; + return objJsonResult; + } + + 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 鑾峰彇鏈�澶у崟鎹甀D銆佸崟鎹彿 @@ -94,6 +167,56 @@ #endregion + #region 鏍规嵁鏉$爜锛岃繑鍥炴潯鐮佹。妗堜腑鏉$爜淇℃伅 + + /// <summary> + /// 鏍规嵁鏉$爜锛岃繑鍥炴潯鐮佹。妗堜腑鏉$爜淇℃伅 + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetBarCode_Json")] + [HttpGet] + public object GetBarCode_Json(string HBarCode) + { + try + { + ds = oCn.RunProcReturn("select * from h_v_Gy_BarCodeBill where HBarCode='" + HBarCode + "' order by HStopflag", "h_v_Gy_BarCodeBill"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏉$爜妗f涓笉瀛樺湪璇ユ潯鐮侊紝璇风‘璁ゆ潯鐮佹槸鍚︽纭垨鏄惁宸茶鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else if (DBUtility.ClsPub.isBool(ds.Tables[0].Rows[0]["HStopflag"])) + { + 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 + #endregion @@ -115,17 +238,465 @@ } } + /// <summary> + /// 鎵爜杩斿洖浠撳簱淇℃伅 + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetWarehouse_Json")] + [HttpGet] + public object GetWarehouse_Json(string HBarCode, Int64 HStockOrgID) + { + try + { + Int64 HWhID = 0; + HWhID = DBUtility.ClsPub.isLong(HBarCode.Replace("HWH", "")); + ds = oCn.RunProcReturn("select HItemID,HNumber,HName,HSPFlag from Gy_Warehouse with(nolock) where HStopflag=0 and HItemID=" + HWhID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "Gy_Warehouse"); + 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/GetStockPlace_Json")] + [HttpGet] + public object GetStockPlace_Json(string HBarCode, Int64 HWhID, Int64 HStockOrgID) + { + try + { + Int64 sHSPID = 0; + Int64 sHWhID = 0; + if (HBarCode.Contains(";")) + { + string[] sArray = HBarCode.Replace("HSP", "").Split(';'); + sHSPID = DBUtility.ClsPub.isLong(sArray[1]); + sHWhID = DBUtility.ClsPub.isLong(sArray[0]); + } + + if(HWhID==0) + { + ds = oCn.RunProcReturn("select HItemID,HNumber,HName,HWHID,HWhNumber,HWhName from h_v_IF_StockPlace where HStopflag=0 and HItemID=" + sHSPID.ToString() + " and HWHID=" + sHWhID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "h_v_IF_StockPlace"); + 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; + } + } + else + { + ds = oCn.RunProcReturn("select HItemID,HNumber,HName,HWHID,HWhNumber,HWhName from h_v_IF_StockPlace where HStopflag=0 and HItemID=" + sHSPID.ToString() + " and HWHID=" + HWhID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "h_v_IF_StockPlace"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + DataSet ds2 = oCn.RunProcReturn("select HItemID,HNumber,HName,HWHID,HWhNumber,HWhName from h_v_IF_StockPlace where HStopflag=0 and HItemID=" + sHSPID.ToString() + " and HWHID=" + sHWhID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "h_v_IF_StockPlace"); + if (ds2 == null || ds2.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 = ds2.Tables[0]; + 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; + } + } + + /// <summary> + /// 鑾峰彇浠撲綅鍒楄〃淇℃伅 + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetStockPlaceList_Json")] + [HttpGet] + public object GetStockPlaceList_Json(string StockPlace, Int64 HWhID, Int64 HStockOrgID) + { + try + { + //鐣岄潰涓婃湭閫夋嫨浠撳簱 鎴� 浠撲綅閫夋嫨鍒楄〃鐣岄潰杈撳叆杩囨护鏉′欢 + if (HWhID == 0) + { + ds = oCn.RunProcReturn("select HItemID,HNumber,HName,HWHID,HWhNumber,HWhName from h_v_IF_StockPlace where HStopflag=0 and HUSEORGID=" + HStockOrgID.ToString() + " and (HNumber like '%" + StockPlace + "%' or HName like '%" + StockPlace + "%')", "h_v_IF_StockPlace"); + 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; + } + } + //鐣岄潰涓婂凡閫変粨搴� + else + { + ds = oCn.RunProcReturn("select HItemID,HNumber,HName,HWHID,HWhNumber,HWhName from h_v_IF_StockPlace where HStopflag=0 and HUSEORGID=" + HStockOrgID.ToString() + " and HWHID=" + HWhID.ToString() + " and (HNumber like '%" + StockPlace + "%' or HName like '%" + StockPlace + "%')", "h_v_IF_StockPlace"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + DataSet ds2 = oCn.RunProcReturn("select HItemID,HNumber,HName,HWHID,HWhNumber,HWhName from h_v_IF_StockPlace where HStopflag=0 and HUSEORGID = " + HStockOrgID.ToString() + " and (HNumber like '%" + StockPlace + "%' or HName like '%" + StockPlace + "%')", "h_v_IF_StockPlace"); + if (ds2 == null || ds2.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 = ds2.Tables[0]; + 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/GetEmployee_Json")] + [HttpGet] + public object GetEmployee_Json(string HBarCode) + { + try + { + Int64 HEmpID = 0; + HEmpID = DBUtility.ClsPub.isLong(HBarCode); + ds = oCn.RunProcReturn("select HItemID,HNumber,HName from Gy_Employee with(nolock) where HStopflag=0 and HItemID=" + HEmpID.ToString(), "Gy_Employee"); + 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/GetDepartment_Json")] + [HttpGet] + public object GetDepartment_Json(string HBarCode) + { + try + { + Int64 HDepID = 0; + HDepID = DBUtility.ClsPub.isLong(HBarCode.Replace("HDE", "")); + ds = oCn.RunProcReturn("select HItemID,HNumber,HName from Gy_Department with(nolock) where HStopflag=0 and HItemID=" + HDepID.ToString(), "Gy_Department"); + 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/GetSupplier_Json")] + [HttpGet] + public object GetSupplier_Json(string HBarCode, Int64 HStockOrgID) + { + try + { + Int64 HSupID = 0; + HSupID = DBUtility.ClsPub.isLong(HBarCode); + ds = oCn.RunProcReturn("select HItemID,HNumber,HName from Gy_Supplier with(nolock) where HStopflag=0 and HItemID=" + HSupID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "Gy_Supplier"); + 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; + } + } + + /// <summary> + /// 鑾峰彇渚涘簲鍟嗗垪琛ㄤ俊鎭� + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetSupplierList_Json")] + [HttpGet] + public object GetSupplierList_Json(string Supplier, Int64 HStockOrgID) + { + try + { + ds = oCn.RunProcReturn("select HItemID,HNumber,HName from Gy_Supplier with(nolock) where HStopflag=0 and HUSEORGID=" + HStockOrgID.ToString() + " and (HNumber like '%" + Supplier + "%' or HName like '%" + Supplier + "%')", "Gy_Supplier"); + 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/GetCustomer_Json")] + [HttpGet] + public object GetCustomer_Json(string HBarCode, Int64 HStockOrgID) + { + try + { + Int64 HCusID = 0; + HCusID = DBUtility.ClsPub.isLong(HBarCode); + ds = oCn.RunProcReturn("select HItemID,HNumber,HName from Gy_Customer with(nolock) where HStopflag=0 and HItemID=" + HCusID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "Gy_Customer"); + 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; + } + } + + /// <summary> + /// 鑾峰彇瀹㈡埛鍒楄〃淇℃伅 + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetCustomerList_Json")] + [HttpGet] + public object GetCustomerList_Json(string Customer, Int64 HStockOrgID) + { + try + { + ds = oCn.RunProcReturn("select HItemID,HNumber,HName from Gy_Customer with(nolock) where HStopflag=0 and HUSEORGID=" + HStockOrgID.ToString() + " and (HNumber like '%" + Customer + "%' or HName like '%" + Customer + "%')", "Gy_Customer"); + 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 #endregion - #region 鐣岄潰鎺т欢鍔熻兘璋冪敤鏂规硶 + #region 鎵爜妯″潡璋冪敤鏂规硶 #region 鏍规嵁鍗曟嵁绫诲瀷鑾峰彇鍗曟嵁瀛愮被鍨� @@ -140,7 +711,7 @@ try { ds = oWebs.get_BillSubType(HBillType, HStockOrgID); - if (ds == null) + if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; @@ -169,7 +740,253 @@ #endregion + + #region 鎵爜妯″潡 鏍规嵁鏉$爜鍒犻櫎缂撳瓨鍒楄〃涓搴旀潯鐮佽褰� + + /// <summary> + /// 鏍规嵁鏉$爜鍒犻櫎鏉$爜鍑哄叆搴撶紦瀛樿〃涓褰� + /// </summary> + /// <returns></returns> + [Route("WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json")] + [HttpGet] + public object set_DelPonderationBillMain_Temp_BarCode_Json(long HInterID, string HBillType, string HBarCode) + { + try + { + 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; + 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 鎵爜妯″潡 鏍规嵁HItemID鍒犻櫎缂撳瓨鍒楄〃涓搴旀潯鐮佽褰� + + /// <summary> + /// 鏍规嵁HItemID鍒犻櫎鏉$爜鍑哄叆搴撶紦瀛樿〃涓褰� + /// </summary> + /// <returns></returns> + [Route("WEBSController/set_DelPonderationBillMain_Temp_HItemID_Json")] + [HttpGet] + public object set_DelPonderationBillMain_Temp_HItemID_Json(long HInterID, string HBillType, long HItemID) + { + try + { + oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "' and HItemID=" + HItemID.ToString(), 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> + /// 鎵爜妯″潡锛屽垹闄ら�変腑琛屾潯鐮佸嚭鍏ュ簱涓存椂琛ㄨ褰� + /// </summary> + /// <returns></returns> + [Route("WEBSController/set_DelPonderationBillMain_Temp_InterIDAndSource_Json")] + [HttpGet] + public object set_DelPonderationBillMain_Temp_InterIDAndSource_Json(long HInterID, long HMaterID, long HAuxPropID, string HMTONo, long HSourceInterID, long HSourceEntryID, string HBillType) + { + 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; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎鎵�閫夎鏉$爜鍑哄叆搴撲复鏃惰〃璁板綍澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + + #endregion + + + #region 鎵弿妯″潡 閫�鍑哄姛鑳芥寜閽皟鐢� 鍒犻櫎鍏堣繘鍏堝嚭涓存椂琛紙鏇存柊 HlineStatus =1锛� + + /// <summary> + /// 鍒犻櫎鍏堣繘鍏堝嚭涓存椂琛紙鏇存柊 HlineStatus =1锛� + /// </summary> + /// <returns></returns> + [Route("WEBSController/set_DelPonderationBillMain_Temp_FIFO_Json")] + [HttpGet] + public object set_DelPonderationBillMain_Temp_FIFO_Json(long HInterID, string HBillType) + { + try + { + if (oWebs.set_DelPonderationBillMain_Temp_FIFO(HInterID, 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; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏇存柊鍏堣繘鍏堝嚭涓存椂琛℉lineStatus鍊煎け璐ワ紒" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + #endregion + + #endregion + + + #region 缂撳瓨鍒楄〃妯″潡璋冪敤 + + #region 缂撳瓨鍒楄〃鐣岄潰锛岃繑鍥炵紦瀛樺垪琛ㄤ俊鎭� + + /// <summary> + /// 缂撳瓨鍒楄〃鐣岄潰锛岃繑鍥炵紦瀛樺垪琛ㄤ俊鎭� + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetKf_PonderationBillMain_TempList_New_Json")] + [HttpGet] + public object GetKf_PonderationBillMain_TempList_New_Json(string HBillType, string HMaker, Int64 HStockOrgID) + { + 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; + } + } + + #endregion + + + #region 缂撳瓨鍒楄〃 缂栬緫鍔熻兘璋冪敤 + + /// <summary> + /// 缂撳瓨鍒楄〃閫夋嫨缂栬緫鏃讹紝鍒ゆ柇鎵�閫夊崟鎹槸鍚﹀凡瀛樺湪涓婁紶璁板綍锛屽惎鐢ㄥ厛杩涘厛鍑哄姛鑳界殑锛屽洖濉厛杩涘厛鍑轰复鏃惰〃鐘舵�侊紙鏇存柊 HlineStatus =0锛� + /// </summary> + /// <returns></returns> + [Route("WEBSController/TempList_Modify_Json")] + [HttpGet] + public object TempList_Modify_Json(long HInterID, string HBillNo, string HBillType) + { + try + { + if (oWebs.TempList_Modify(HInterID, HBillNo, HBillType, ref DBUtility.ClsPub.sErrInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //澶辫触锛� + objJsonResult.data = null; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "缂撳瓨鍒楄〃缂栬緫鍓嶅垽鏂け璐ワ紒" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + #endregion + #region 宸蹭笂浼犳煡璇㈢晫闈紝鏍规嵁鍗曟嵁鍙枫�佹簮鍗曞彿鏌ヨ宸蹭笂浼犲崟鎹俊鎭� @@ -184,7 +1001,7 @@ try { ds = oWebs.GetKf_ICStockBillQueryList(HBillType, HBillNo, HSourceBillNo); - if (ds == null) + if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; @@ -265,47 +1082,37 @@ #endregion - #region 鍒犻櫎鏉$爜鍑哄叆搴撲复鏃惰〃璁板綍 + #region 鏉$爜鍑哄叆搴撶紦瀛樺垪琛ㄦā鍧� 鍒犻櫎缂撳瓨鍒楄〃鍗曟嵁 /// <summary> - /// 鎵爜妯″潡锛屽垹闄ら�変腑琛屾潯鐮佸嚭鍏ュ簱涓存椂琛ㄨ褰� + /// 鍒犻櫎缂撳瓨鍒楄〃鍗曟嵁 /// </summary> /// <returns></returns> - [Route("WEBSController/set_DelPonderationBillMain_Temp_InterIDAndSource_Json")] + [Route("WEBSController/set_DelPonderationBillMain_Temp_Json")] [HttpGet] - public object set_DelPonderationBillMain_Temp_InterIDAndSource_Json(long HInterID, long HMaterID, long HAuxPropID, string HMTONo, long HSourceInterID, long HSourceEntryID, string HBillType) + public object set_DelPonderationBillMain_Temp_Json(long HInterID, string HBillType) { 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 HBillType='" + HBillType + "'", 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.Message = "鍒犻櫎鏉$爜鍑哄叆搴撶紦瀛樺垪琛ㄥ崟鎹け璐ワ紒" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } /// <summary> - /// 鏍规嵁鍗曟嵁ID,鍒犻櫎鏉$爜鍑哄叆搴撲复鏃惰〃璁板綍 + /// 鏍规嵁鍗曟嵁ID,鍒犻櫎鏉$爜鍑哄叆搴撲复鏃惰〃璁板綍 锛堝姛鑳藉悓涓婇潰鏍规嵁ID鍒犻櫎缂撳瓨璁板綍鏂规硶锛� /// </summary> /// <returns></returns> [Route("WEBSController/DeleteBillList_Json")] @@ -343,20 +1150,74 @@ #endregion + #endregion - #region 鍒犻櫎鍏堣繘鍏堝嚭涓存椂琛紙鏇存柊 HlineStatus =1锛� + + #region 鎻愪氦鐢熷崟澶勭悊鏂规硶 + + #region 鐢熶骇鍏ュ簱 涓婁紶鐢熷崟 + + + #endregion + + #region 閲囪喘鍏ュ簱 涓婁紶鐢熷崟 + + + #endregion + + #region 鍏朵粬鍏ュ簱 涓婁紶鐢熷崟 + + #region 鍏朵粬鍏ュ簱 鏂板妯″紡 /// <summary> - /// 鍒犻櫎鍏堣繘鍏堝嚭涓存椂琛紙鏇存柊 HlineStatus =1锛� + /// 鍏朵粬鍏ュ簱鏂板涓婁紶 /// </summary> /// <returns></returns> - [Route("WEBSController/set_DelPonderationBillMain_Temp_FIFO_Json")] - [HttpGet] - public object set_DelPonderationBillMain_Temp_FIFO_Json(long HInterID, string HBillType) + [Route("WEBSController/set_SaveOtherInBill_Json")] + [HttpPost] + public object set_SaveOtherInBill_Json([FromBody] JObject oMain) { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); try { - if (oWebs.set_DelPonderationBillMain_Temp_FIFO(HInterID, HBillType, ref DBUtility.ClsPub.sErrInfo)) + List<Model.ClsKf_OtherInBillMain> lsmain = new List<Model.ClsKf_OtherInBillMain>(); + ListModels oListModels = new ListModels(); + lsmain = oListModels.getOtherInBillMainByJson(msg1); + WebS.ClsKf_OtherInBillMain websLsmain = new WebS.ClsKf_OtherInBillMain(); + 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.HStockStyle = lsmain[0].HStockStyle; + websLsmain.HBillSubType = lsmain[0].HBillSubType; + if(lsmain[0].HMainSourceBillType== "1241") + { + 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_SaveOtherInBill_New(websLsmain, sSourceType, ref DBUtility.ClsPub.sErrInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; @@ -377,7 +1238,7 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "鏇存柊鍏堣繘鍏堝嚭涓存椂琛℉lineStatus鍊煎け璐ワ紒" + e.ToString(); + objJsonResult.Message = "鍏朵粬鍏ュ簱鍗曚笂浼犲け璐ワ紒" + e.ToString(); objJsonResult.data = null; return objJsonResult; } @@ -385,11 +1246,92 @@ #endregion - - #region 鎻愪氦鐢熷崟澶勭悊鏂规硶 + #endregion #region 閿�鍞嚭搴� 涓婁紶鐢熷崟 + + #region 閿�鍞嚭搴� 鏂板妯″紡 + + /// <summary> + /// 閿�鍞嚭搴撴柊澧炰笂浼� + /// </summary> + /// <returns></returns> + [Route("WEBSController/set_SaveSellOutBill_Json")] + [HttpPost] + public object set_SaveSellOutBill_Json([FromBody] JObject oMain) + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + try + { + List<Model.ClsKf_SellOutBillMain> lsmain = new List<Model.ClsKf_SellOutBillMain>(); + ListModels oListModels = new ListModels(); + lsmain = oListModels.getSellOutBillMainByJson(msg1); + WebS.ClsKf_SellOutBillMain websLsmain = new WebS.ClsKf_SellOutBillMain(); + 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 == "1402") + { + 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_SaveSellOutBill_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 #region 閿�鍞嚭搴� 鏍¢獙妯″紡 @@ -806,11 +1748,90 @@ #endregion + #region 鍏朵粬鍏ュ簱 鎵弿婧愬崟鏉$爜 + + /// <summary> + /// 鍏朵粬鍏ュ簱 鎵弿婧愬崟鏉$爜 + /// </summary> + /// <returns></returns> + [Route("WEBSController/Get_SourceBarCode_OtherIn_Json")] + [HttpGet] + public object get_SourceBarCode_OtherIn_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HStockOrgID) + { + try + { + WebSoBar = oWebs.get_SourceBarCode_OtherIn(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 + #region 鐢熶骇棰嗘枡 鎵弿婧愬崟鏉$爜 + /// <summary> + /// 棰嗘枡鍑哄簱 鎵弿婧愬崟鏉$爜 + /// </summary> + /// <returns></returns> + [Route("WEBSController/Get_SourceBarCode_MateOut_Json")] + [HttpGet] + public object get_SourceBarCode_MateOut_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Double HPTQty, Int64 HPlanMode, Int64 HFIFOWhID, Int64 HStockOrgID) + { + try + { + WebSoBar = oWebs.get_SourceBarCode_MateOut(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HPTQty, HPlanMode, HFIFOWhID, 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 @@ -858,6 +1879,43 @@ #region 濮斿鍑哄簱 鎵弿婧愬崟鏉$爜 + /// <summary> + /// 濮斿鍑哄簱 鎵弿婧愬崟鏉$爜 + /// </summary> + /// <returns></returns> + [Route("WEBSController/Get_SourceBarCode_EntrustOut_Json")] + [HttpGet] + public object get_SourceBarCode_EntrustOut_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HFIFOWhID, Int64 HStockOrgID) + { + try + { + WebSoBar = oWebs.get_SourceBarCode_EntrustOut(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HFIFOWhID, 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 @@ -947,18 +2005,92 @@ #region 鍒嗘寮忚皟鍑� 鎵弿婧愬崟鏉$爜 + /// <summary> + /// 鍒嗘寮忚皟鍑� 鎵弿婧愬崟鏉$爜 + /// </summary> + /// <returns></returns> + [Route("WEBSController/Get_SourceBarCode_MoveStockStepOut_Json")] + [HttpGet] + public object get_SourceBarCode_MoveStockStepOut_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HFIFOWhID, Int64 HStockInOrgID, Int64 HStockOutOrgID) + { + try + { + WebSoBar = oWebs.get_SourceBarCode_MoveStockStepOut(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HFIFOWhID, HStockInOrgID, HStockOutOrgID, 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 鍒嗘寮忚皟鍏� 鎵弿婧愬崟鏉$爜 + /// <summary> + /// 鍒嗘寮忚皟鍏� 鎵弿婧愬崟鏉$爜 + /// </summary> + /// <returns></returns> + [Route("WEBSController/Get_SourceBarCode_MoveStockStepIn_Json")] + [HttpGet] + public object get_SourceBarCode_MoveStockStepIn_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HStockInOrgID, Int64 HStockOutOrgID) + { + try + { + WebSoBar = oWebs.get_SourceBarCode_MoveStockStepIn(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HStockInOrgID, HStockOutOrgID, 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 - #region 鐗╂枡鏉$爜澶勭悊鏂规硶 鍏朵粬鍑哄簱搴撴ā鍧� + #region 鐗╂枡鏉$爜澶勭悊鏂规硶 鍑哄叆搴撴ā鍧� /// <summary> /// 鐗╂枡鏉$爜鏂囨湰妗� 鎵爜璋冪敤 @@ -1187,6 +2319,59 @@ #endregion + #region 鎵爜妯″潡璋冪敤鏂规硶 + + #region 浠庣紦瀛樺垪琛ㄩ〉闈㈣繑鍥炰俊鎭� + + /// <summary> + /// 浠庣紦瀛樺垪琛ㄩ〉闈㈣繑鍥炰俊鎭� + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetSourceBill_Temp_Json")] + [HttpGet] + public object GetSourceBill_Temp_Json(Int64 HInterID, string HBillType) + { + try + { + ds = oCn.RunProcReturn("exec h_p_WMS_SourceBill_Temp " + HInterID.ToString() + ",'" + HBillType + "'", "h_p_WMS_SourceBill_Temp"); + 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> @@ -1202,7 +2387,7 @@ string sMouldManagerCtl = "N"; //鏄惁鍚敤鍣ㄥ叿绠$悊 string sFIFOCtl = "N"; //鏄惁鍚敤鍏堣繘鍏堝嚭绠$悊 ds = oWebs.GetBillEntryTmpList(HInterID, HBillNo, HBillType, HStockOrgID, ref sMouldManagerCtl, ref sFIFOCtl, ref DBUtility.ClsPub.sErrInfo); - if (ds == null) + if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; @@ -1223,7 +2408,6 @@ objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; - objJsonResult.data = ds.Tables[0]; objJsonResult.data = new { Materlist = ds.Tables[0], //杩斿洖鐗╂枡鏄庣粏鍒楄〃淇℃伅锛�0锛� @@ -1246,6 +2430,59 @@ return objJsonResult; } } + + #endregion + + #region 鏍规嵁鍗曟嵁ID銆佺墿鏂橧D杩斿洖鏉$爜涓存椂琛ㄤ腑鏉$爜淇℃伅 + + /// <summary> + /// 鏍规嵁鍗曟嵁ID銆佺墿鏂橧D杩斿洖鏉$爜涓存椂琛ㄤ腑鏉$爜淇℃伅 + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetBarCodeByMaterID_Temp_Json")] + [HttpGet] + public object GetBarCodeByMaterID_Temp_Json(Int64 HInterID, string HBillType, Int64 HMaterID) + { + try + { + ds = oCn.RunProcReturn("exec h_p_WMS_BarCodeByMaterID_Temp " + HInterID.ToString() + ",'" + HBillType + "'," + HMaterID.ToString(), "h_p_WMS_BarCodeByMaterID_Temp"); + 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 @@ -1351,6 +2588,13 @@ string sJXCode = ""; if (oSystemParameter.ShowBill(ref sErrMsg) == true) { + string sSourceBarCodeCtl = "N"; //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 + if (HBillType == "1205" && oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl == "Y") + { + //閿�鍞嚭搴撳崟 + sSourceBarCodeCtl = "Y"; + } + if (oSystemParameter.omodel.WMS_CampanyName == "瀹夌憺") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤 { sJXCode = POStockInBillController.JX_Json(sBarCode, HBillID, HBillType, HStockOrgID, HBillNo, HMaker); @@ -1361,22 +2605,47 @@ } try { - WebSoBar = oWebs.get_CheckTypeByBarCode_BillCheck(sJXCode, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HStockOrgID, ref DBUtility.ClsPub.sErrInfo); - if (WebSoBar == null) + //鍘熷崟鎹负鎵爜鐢熸垚锛屾牎楠屾椂涓嶇敓鎴愭潯鐮佽褰曪紝鍙鍘熸壂鎻忕殑鏉$爜杩涜鏍稿 + if (sSourceBarCodeCtl == "Y") { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = DBUtility.ClsPub.sErrInfo; - objJsonResult.data = null; - return objJsonResult; + WebSoBar = oWebs.get_BillBarCode_Verify(HBillID, HBillNo, HBillType, sJXCode, HQty, 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; + } } + //鍘熷崟鎹潪鎵爜鐢熸垚锛屾牎楠屾椂鐢熸垚鏉$爜璁板綍 else { - objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = "鎴愬姛"; - objJsonResult.data = WebSoBar; - return objJsonResult; + WebSoBar = oWebs.get_CheckTypeByBarCode_BillCheck(sJXCode, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, 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) @@ -1413,7 +2682,7 @@ try { ds = oWebs.GetKf_PonderationBillMain_Temp_BillCheck(HInterID, HBillType, sWhere); - if (ds == null) + if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; @@ -1451,7 +2720,71 @@ #endregion - #region 杩斿洖缂撳瓨鍒楄〃淇℃伅 + #region 鎵爜妯″潡锛屽垹闄ら�変腑琛屾潯鐮佸嚭鍏ュ簱涓存椂琛ㄨ褰� + + /// <summary> + /// 鎵爜妯″潡锛屽垹闄ら�変腑琛屾潯鐮佸嚭鍏ュ簱涓存椂琛ㄨ褰� + /// </summary> + /// <returns></returns> + [Route("WEBSController/set_DeleteBarCodeByEntryID_BillCheck_Json")] + [HttpGet] + public object set_DeleteBarCodeByEntryID_BillCheck_Json(long HInterID, string HBillType, long HMaterID, long HAuxPropID, string HMTONo, long HSourceInterID, long HSourceEntryID, Int64 HStockOrgID) + { + //鑾峰彇绯荤粺鍙傛暟 + string sErrMsg = ""; + if (oSystemParameter.ShowBillByOrgID(HStockOrgID,ref sErrMsg) == true) + { + string sSourceBarCodeCtl = "N"; //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 + if (HBillType == "1205" && oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl == "Y") + { + //閿�鍞嚭搴撳崟 + sSourceBarCodeCtl = "Y"; + } + + //鍘熷崟鎹负鎵爜鐢熸垚锛屽鍘熸壂鎻忕殑鏉$爜杩涜鏍稿 + if (sSourceBarCodeCtl == "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 HMaterID=" + HMaterID.ToString() + " and HAuxPropID=" + HAuxPropID.ToString() + " and HMTONo='" + HMTONo + "' 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; + } + } + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg; + objJsonResult.data = null; + return objJsonResult; + } + } + + #endregion + + #region 缂撳瓨妯″潡 杩斿洖缂撳瓨鍒楄〃淇℃伅 /// <summary> /// 杩斿洖缂撳瓨鍒楄〃淇℃伅 鏍¢獙妯″紡 @@ -1464,7 +2797,7 @@ try { ds = oWebs.GetKf_PonderationBillMain_TempList_BillCheck(HBillType, HMaker, HStockOrgID); - if (ds == null) + if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; @@ -1499,6 +2832,156 @@ return objJsonResult; } } + + #endregion + + #region 缂撳瓨妯″潡 鏍规嵁鍗曟嵁ID,鍒犻櫎涓存椂琛ㄨ褰� + + /// <summary> + /// 鏍规嵁鍗曟嵁ID,鍒犻櫎涓存椂琛ㄨ褰� + /// </summary> + /// <returns></returns> + [Route("WEBSController/DeleteBillList_BillCheck_Json")] + [HttpGet] + public object DeleteBillList_BillCheck_Json(long HInterID, string HBillType, Int64 HStockOrgID) + { + //鑾峰彇绯荤粺鍙傛暟 + string sErrMsg = ""; + if (oSystemParameter.ShowBillByOrgID(HStockOrgID, ref sErrMsg) == true) + { + string sSourceBarCodeCtl = "N"; //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 + if (HBillType == "1205" && oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl == "Y") + { + //閿�鍞嚭搴撳崟 + sSourceBarCodeCtl = "Y"; + } + + //鍘熷崟鎹负鎵爜鐢熸垚锛屽鍘熸壂鎻忕殑鏉$爜杩涜鏍稿锛屽垹闄ゆ潯鐮佸嚭鍏ュ簱鏍¢獙缂撳瓨璁板綍 + if (sSourceBarCodeCtl == "Y") + { + try + { + oCn.RunProc("Delete from KF_PonderationBillMain_Temp_Verify where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "'", 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; + } + } + //鍘熷崟鎹潪鎵爜鐢熸垚锛屽垹闄ゆ潯鐮佸嚭鍏ュ簱缂撳瓨鍒楄〃璁板綍 + else + { + try + { + oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "'", 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; + } + } + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg; + objJsonResult.data = null; + return objJsonResult; + } + } + + #endregion + + #region 缂撳瓨妯″潡 宸蹭笂浼犲垪琛ㄧ晫闈紝鎾ら攢鍔熻兘 + + /// <summary> + /// 宸蹭笂浼犲垪琛ㄧ晫闈紝鎾ら攢鍔熻兘锛屽垹闄MS琛ㄥ拰鏈湴鍑哄叆搴撳崟璁板綍锛屽苟鏇存柊TEMP琛ㄤ腑鐨勪笂浼犲瓧娈� HRelationInterID=0 + /// </summary> + /// <returns></returns> + [Route("WEBSController/DeleteICStockBillAndWMS_BillCheck_Json")] + [HttpGet] + public object DeleteICStockBillAndWMS_BillCheck_Json(Int64 HInterID, string HBillNo, string HBillType, Int64 HStockOrgID) + { + //鑾峰彇绯荤粺鍙傛暟 + string sErrMsg = ""; + if (oSystemParameter.ShowBillByOrgID(HStockOrgID, ref sErrMsg) == true) + { + string sSourceBarCodeCtl = "N"; //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 + if (HBillType == "1205" && oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl == "Y") + { + //閿�鍞嚭搴撳崟 + sSourceBarCodeCtl = "Y"; + } + + //鍘熷崟鎹负鎵爜鐢熸垚锛屽鍘熸壂鎻忕殑鏉$爜杩涜鏍稿 + if (sSourceBarCodeCtl == "Y") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏍¢獙鏉$爜锛屾挙閿�鍔熻兘涓嶅彲鐢紒 "; + objJsonResult.data = null; + return objJsonResult; + } + //鍘熷崟鎹潪鎵爜鐢熸垚 + else + { + try + { + if (oWebs.DeleteICStockBillAndWMS(HInterID, HBillNo, 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; + } + } + 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 @@ -1604,7 +3087,7 @@ try { ds = oWebs.GetBillEntry_Tmp_Pack(HInterID, HBillNo, HBillType, ref DBUtility.ClsPub.sErrInfo); - if (ds == null) + if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; @@ -1699,7 +3182,7 @@ try { ds = oWebs.GetSc_PackUnionBill_TempList(HBillType, HMaker, HStockOrgID); - if (ds == null) + if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; @@ -1777,6 +3260,144 @@ } #endregion + + #endregion + + #endregion + + + #region 鍒犳墭妯″潡璋冪敤鏂规硶 + + #region 鍒犳墭妯″潡 鎵弿鎵樻潯鐮� + + /// <summary> + /// 鍒犳墭妯″潡 鎵弿鎵樻潯鐮� + /// </summary> + /// <returns></returns> + [Route("WEBSController/Get_PackBarCode_DeletePackUnionBill_Json")] + [HttpGet] + public object Get_PackBarCode_DeletePackUnionBill_Json(string HBarCode_Pack, string HMaker, Int64 HStockOrgID) + { + try + { + ds = oCn.RunProcReturn("exec h_p_WMS_AddPackBarCode_DeletePackUnionBill '" + HBarCode_Pack + "','" + HMaker + "'," + HStockOrgID.ToString(), "h_p_WMS_AddPackBarCode_DeletePackUnionBill"); + 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][0]) == 0) + { + 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; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎵弿鎵樻潯鐮佸け璐ワ紒" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); + 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> + /// 涓婁紶 鍒犻櫎缁勬墭鍗曚俊鎭� + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetDeletePackUnionBill_Json")] + [HttpGet] + public object GetDeletePackUnionBill_Json(long HInterID, string HBillNo, string HBarCode_Pack, string HMaker) + { + try + { + string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О + string HIPAddress = ""; //IP + string HModCaption = "PDA鐢熶骇鍒犳墭鍗�"; //妯″潡鍚� + if (oWebs.set_DeletePackUnionBill(HInterID, HBillNo, HBarCode_Pack, HMaker, HComputerName, HIPAddress, HModCaption, ref DBUtility.ClsPub.sErrInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犳墭鎴愬姛"; //鎴愬姛锛� + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //澶辫触锛� + objJsonResult.data = null; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犳墭澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + ///// <summary> + ///// 涓婁紶 鍒犻櫎缁勬墭鍗曚俊鎭� 20231027浣滃簾 + ///// </summary> + ///// <returns></returns> + //[Route("WEBSController/GetDeletePackUnionBill_Json")] + //[HttpGet] + //public object GetDeletePackUnionBill_Json(long HInterID, string HBillType, string HMaker) + //{ + // try + // { + // oCn.RunProc("exec h_p_WMS_PackUnionBill_Delete " + HInterID.ToString() + ",'" + HBillType + "','" + HMaker + "'", 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 @@ -1881,7 +3502,7 @@ try { ds = oWebs.GetBillEntry_Temp_MoveStockBill_HuanTuo(HInterID, HBillNo, HBillType, HStockOrgID, ref DBUtility.ClsPub.sErrInfo); - if (ds == null) + if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; @@ -1960,6 +3581,108 @@ #endregion + #region 鎹㈡墭璋冩嫧鍗曟ā鍧� 浠庣紦瀛樺垪琛ㄩ〉闈㈣繑鍥炰俊鎭� + + /// <summary> + /// 浠庣紦瀛樺垪琛ㄩ〉闈㈣繑鍥炰俊鎭� + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetKF_MoveStockBill_TempList_HuanTuo_Json")] + [HttpGet] + public object GetKF_MoveStockBill_TempList_HuanTuo_Json(Int64 HInterID, string HBillType) + { + try + { + ds = oCn.RunProcReturn("exec h_p_KF_MoveStockBill_TempList_HuanTuo " + HInterID.ToString() + ",'" + HBillType + "'", "h_p_KF_MoveStockBill_TempList_HuanTuo"); + 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/GetPonderationBillMain_TempList_HuanTuo_Json")] + [HttpGet] + public object GetPonderationBillMain_TempList_HuanTuo_Json(string HBillType, string HMaker, long HStockOrgID) + { + try + { + ds = oCn.RunProcReturn("exec h_p_KF_PonderationBillMain_TempList_HuanTuo '" + HBillType + "','" + HMaker + "'," + HStockOrgID.ToString(), "h_p_KF_PonderationBillMain_TempList_HuanTuo"); + 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 @@ -1969,5 +3692,628 @@ #endregion + #region 鐗╂枡鏉$爜鏌ヨ璋冪敤鏂规硶 + /// <summary> + /// 鑾峰彇鏉$爜淇℃伅 + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetGy_BarCodeBill_QiaoYi_PDA_Json")] + [HttpGet] + public object GetGy_BarCodeBill_QiaoYi_PDA_Json(string sWhere) + { + try + { + ds = oCn.RunProcReturn("exec h_p_Gy_BarCodeBillList_QiaoYi '" + sWhere+ "'", "h_p_Gy_BarCodeBillList_QiaoYi"); + 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/GetMES_StationOutBillList_PDA_QiaoYi_Json")] + [HttpGet] + public object GetMES_StationOutBillList_PDA_QiaoYi_Json(string HProcExchBillNo, string HBillNo, string HNumber, string HName, string HICMOBillNo, string user) + { + try + { + ds = oCn.RunProcReturn("exec h_p_MES_StationOutBillList_PDA_QiaoYi '" + HProcExchBillNo + "','" + HBillNo + "','" + HNumber + "','" + HName + "','" + HICMOBillNo + "'", "h_p_MES_StationOutBillList_PDA_QiaoYi"); + 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/GetMES_StationInBillList_PDA_QiaoYi_Json")] + [HttpGet] + public object GetMES_StationInBillList_PDA_QiaoYi_Json(string HProcExchBillNo, string HBillNo, string HNumber, string HName, string HICMOBillNo, string user) + { + try + { + ds = oCn.RunProcReturn("exec h_p_MES_StationInBillList_PDA_QiaoYi '" + HProcExchBillNo + "','" + HBillNo + "','" + HNumber + "','" + HName + "','" + HICMOBillNo + "'", "h_p_MES_StationInBillList_PDA_QiaoYi"); + 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 宸ュ簭娴佽浆鍗″垪琛ㄦ煡璇㈣皟鐢ㄦ柟娉� + + #region 鍗曟嵁鍒楄〃璋冪敤鏂规硶 + + /// <summary> + /// 鑾峰彇鏉$爜淇℃伅 + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetMES_ProcessExchangeBillList_PDA_QiaoYi_Json")] + [HttpGet] + public object GetMES_ProcessExchangeBillList_PDA_QiaoYi_Json(string HBillNo, string HNumber, string HName, string HICMOBillNo, string user) + { + try + { + ds = oCn.RunProcReturn("exec h_p_MES_ProcessExchangeBillList_PDA_QiaoYi '" + HBillNo + "','" + HNumber + "','" + HName + "','" + HICMOBillNo + "'", "h_p_MES_ProcessExchangeBillList_PDA_QiaoYi"); + 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/GetMES_ProcessExchangeSubBillList_PDA_QiaoYi_Json")] + [HttpGet] + public object GetMES_ProcessExchangeSubBillList_PDA_QiaoYi_Json(string HInterID, string user) + { + try + { + ds = oCn.RunProcReturn("exec h_p_MES_ProcessExchangeSubBillList_PDA_QiaoYi '" + HInterID+ "'", "h_p_MES_ProcessExchangeSubBillList_PDA_QiaoYi"); + 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 鐢熶骇璁㈠崟鍒楄〃鏌ヨ璋冪敤鏂规硶 + + #region 鍗曟嵁鍒楄〃璋冪敤鏂规硶 + + /// <summary> + /// 鑾峰彇鏉$爜淇℃伅 + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetMES_Sc_ICMOBillList_PDA_QiaoYi_Json")] + [HttpGet] + public object GetMES_Sc_ICMOBillList_PDA_QiaoYi_Json(string HBillNo, string HNumber, string HMaterName, string HDeptName, string user) + { + try + { + ds = oCn.RunProcReturn("exec h_p_MES_Sc_ICMOBillList_PDA_QiaoYi '" + HBillNo + "','" + HNumber + "','" + HMaterName + "','" + HDeptName + "'", "h_p_MES_Sc_ICMOBillList_PDA_QiaoYi"); + 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/GetMES_Sc_ICMOSubBillList_PDA_QiaoYi_Json")] + [HttpGet] + public object GetMES_Sc_ICMOSubBillList_PDA_QiaoYi_Json(string HInterID, string HDATA, string user) + { + try + { + ds = oCn.RunProcReturn("exec h_p_MES_Sc_ICMOSubBillList_PDA_QiaoYi '" + HInterID + "'", "h_p_MES_Sc_ICMOSubBillList_PDA_QiaoYi"); + 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鍒楀璞$殑鍒楀悕 + } + if (HDATA=="HSPE") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + else if (HDATA == "HICM") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鎴愬姛锛�"; + objJsonResult.data = ds.Tables[1]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鎴愬姛锛�"; + objJsonResult.data = ds.Tables[2]; + 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 鎶ヨ〃鏁版嵁鑾峰彇鏂规硶 + + #region 鏉$爜鍑哄叆搴撹褰曟姤琛� + + #region 鑾峰彇鍗曟嵁绫诲瀷淇℃伅 + /// <summary> + /// 鑾峰彇鍗曟嵁绫诲瀷淇℃伅 + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetBarCodeReport_BillType_Json")] + [HttpGet] + public object GetBarCodeReport_BillType_Json() + { + try + { + ds = oCn.RunProcReturn("exec h_p_WMS_BarCodeReport_BillType ", "h_p_WMS_BarCodeReport_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_BarCodeOutInReport_Json")] + [HttpGet] + public object GetKf_BarCodeOutInReport_Json(string sWhere) + { + try + { + ds = oCn.RunProcReturn("exec h_p_Kf_BarCodeOutInReport_New " + sWhere, "h_p_Kf_BarCodeOutInReport_New"); + 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 鏉$爜搴撳瓨鏌ヨ鎶ヨ〃 + + #region 鑾峰彇鏉$爜搴撳瓨淇℃伅 + /// <summary> + /// 鑾峰彇鏉$爜搴撳瓨淇℃伅 + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetKf_BarCodeICInventoryReport_Json")] + [HttpGet] + public object GetKf_BarCodeICInventoryReport_Json(string sWhere) + { + try + { + ds = oCn.RunProcReturn("exec h_p_WMS_BarCodeICInventoryReport " + sWhere, "h_p_WMS_BarCodeICInventoryReport"); + 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 WMS鐗╂枡鍑哄叆搴撹褰曟姤琛� + + #region 鑾峰彇WMS鐗╂枡鍑哄叆搴撹褰� + /// <summary> + /// 鑾峰彇WMS鐗╂枡鍑哄叆搴撹褰� + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetKf_MaterOutInReport_Json")] + [HttpGet] + public object GetKf_MaterOutInReport_Json(string sWhere) + { + try + { + ds = oCn.RunProcReturn("exec h_p_WMS_MaterOutInReport " + sWhere, "h_p_WMS_MaterOutInReport"); + 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 = "鏌ヨWMS鐗╂枡鍑哄叆搴撹褰曚俊鎭け璐ワ紒" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #endregion + + #region WMS鐗╂枡搴撳瓨鏌ヨ鎶ヨ〃 + + #region 鑾峰彇WMS鐗╂枡搴撳瓨淇℃伅 + /// <summary> + /// 鑾峰彇WMS鐗╂枡搴撳瓨淇℃伅 + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetKf_MaterICInventoryReport_Json")] + [HttpGet] + public object GetKf_MaterICInventoryReport_Json(string sWhere) + { + try + { + ds = oCn.RunProcReturn("exec h_p_WMS_MaterICInventoryReport " + sWhere, "h_p_WMS_MaterICInventoryReport"); + 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 = "鏌ヨWMS鐗╂枡搴撳瓨淇℃伅澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #endregion + + + #endregion + + } } -- Gitblit v1.9.1