diff --git a/WarehouseMgr/Tnb.WarehouseMgr/BaseWareHouseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/BaseWareHouseService.cs index e889fa27..71aef205 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/BaseWareHouseService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/BaseWareHouseService.cs @@ -222,7 +222,7 @@ namespace Tnb.WarehouseMgr /// 打印份数 /// [NonAction] - protected void BarCodePrint(List barCodes,int copies) + protected void BarCodePrint(List barCodes,int copies,string ip) { TaskCompletionSource tcs = new(); // open port. @@ -281,28 +281,28 @@ namespace Tnb.WarehouseMgr } else { - //ret = PPLBUtility.B_CreatePrn(13, "192.168.1.233"); - _ = System.IO.Directory.CreateDirectory(PPLBUtility.szSavePath); - ret = PPLBUtility.B_CreatePrn(0, PPLBUtility.szSaveFile);// open file. - strmsg += "Open "; - strmsg += PPLBUtility.szSaveFile; - if (0 != ret) - { - strmsg += " file fail!"; - } - else - { - strmsg += " file succeed!"; - } + ret = PPLBUtility.B_CreatePrn(13, ip); } + /* else + { + + _ = System.IO.Directory.CreateDirectory(PPLBUtility.szSavePath); + ret = PPLBUtility.B_CreatePrn(0, PPLBUtility.szSaveFile);// open file. + strmsg += "Open "; + strmsg += PPLBUtility.szSaveFile; + if (0 != ret) + { + strmsg += " file fail!"; + } + else + { + strmsg += " file succeed!"; + } + }*/ if (0 != ret) { return; } - - - - // sample setting. _ = PPLBUtility.B_Set_Originpoint(0, 0); _ = PPLBUtility.B_Select_Option(2); @@ -321,13 +321,15 @@ namespace Tnb.WarehouseMgr { for (int i = 0; i < copies; i++) { - //print text, true type text. - _ = PPLBUtility.B_Prn_Text(150, 50, 0, 2, 2, 2, 'N', code); - //barcode. - _ = PPLBUtility.B_Prn_Barcode(50, 100, 0, "1", 3, 5, 70, 'N', code);//have a counter - // output. - _ = PPLBUtility.B_Print_Out(1);// copy 2. - } + // _ = PPLBUtility.B_Prn_Text(50, 90, 0, 2, 2, 2, 'N', code); + // _ = PPLBUtility.B_Prn_Barcode(50, 270, 0, "1", 3, 5, 70, 'N', code); + _ = PPLBUtility.B_Prn_Text(50, 100, 0, 2, 2, 2, 'N', code); + _ = PPLBUtility.B_Prn_Barcode(50, 150, 0, "1", 3, 5, 100, 'N', code); + _ = PPLBUtility.B_Prn_Text(50, 305, 0, 2, 2, 2, 'N', code); + + _ = PPLBUtility.B_Print_Out(1); + + } } } catch (Exception ex) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPurchaseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPurchaseService.cs index cdb28f8e..18b4eab8 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPurchaseService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPurchaseService.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Net.Sockets; using System.Text; using System.Threading.Tasks; using JNPF.Common.Core.Manager; @@ -16,6 +17,7 @@ using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using NPOI.OpenXmlFormats; using NPOI.OpenXmlFormats.Dml.Diagram; +using Org.BouncyCastle.Utilities.Net; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.Common.Utils; @@ -152,19 +154,11 @@ namespace Tnb.WarehouseMgr [HttpPost] public async Task BarCodePrint(BarCodeInput input) { - ; - if (input == null) { throw new AppFriendlyException(nameof(input), 500); } List barcodes = new(); - barcodes.Add("2300100051901001211210002"); - barcodes.Add("2300100051901001211210008"); - barcodes.Add("2300100051901001211210009"); - - - base.BarCodePrint(barcodes, 1); try { await _db.Ado.BeginTranAsync(); @@ -213,7 +207,8 @@ namespace Tnb.WarehouseMgr barcodes.AddRange(wmsTempCodes.Select(p => p.barcode).ToList()); if (barcodes?.Count > 0) { - base.BarCodePrint(barcodes, 1); + var ip= _db.Queryable().Where(p=>p.key== "printerip").FirstAsync().Result.value; + base.BarCodePrint(barcodes, 1, ip); } }