bug
This commit is contained in:
@@ -222,7 +222,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
/// <param name="copies">打印份数</param>
|
/// <param name="copies">打印份数</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[NonAction]
|
[NonAction]
|
||||||
protected void BarCodePrint(List<string> barCodes,int copies)
|
protected void BarCodePrint(List<string> barCodes,int copies,string ip)
|
||||||
{
|
{
|
||||||
TaskCompletionSource tcs = new();
|
TaskCompletionSource tcs = new();
|
||||||
// open port.
|
// open port.
|
||||||
@@ -281,28 +281,28 @@ namespace Tnb.WarehouseMgr
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//ret = PPLBUtility.B_CreatePrn(13, "192.168.1.233");
|
ret = PPLBUtility.B_CreatePrn(13, ip);
|
||||||
_ = 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!";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
/* 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)
|
if (0 != ret)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// sample setting.
|
// sample setting.
|
||||||
_ = PPLBUtility.B_Set_Originpoint(0, 0);
|
_ = PPLBUtility.B_Set_Originpoint(0, 0);
|
||||||
_ = PPLBUtility.B_Select_Option(2);
|
_ = PPLBUtility.B_Select_Option(2);
|
||||||
@@ -321,13 +321,15 @@ namespace Tnb.WarehouseMgr
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < copies; i++)
|
for (int i = 0; i < copies; i++)
|
||||||
{
|
{
|
||||||
//print text, true type text.
|
// _ = PPLBUtility.B_Prn_Text(50, 90, 0, 2, 2, 2, 'N', code);
|
||||||
_ = PPLBUtility.B_Prn_Text(150, 50, 0, 2, 2, 2, 'N', code);
|
// _ = PPLBUtility.B_Prn_Barcode(50, 270, 0, "1", 3, 5, 70, 'N', code);
|
||||||
//barcode.
|
_ = PPLBUtility.B_Prn_Text(50, 100, 0, 2, 2, 2, 'N', code);
|
||||||
_ = PPLBUtility.B_Prn_Barcode(50, 100, 0, "1", 3, 5, 70, 'N', code);//have a counter
|
_ = PPLBUtility.B_Prn_Barcode(50, 150, 0, "1", 3, 5, 100, 'N', code);
|
||||||
// output.
|
_ = PPLBUtility.B_Prn_Text(50, 305, 0, 2, 2, 2, 'N', code);
|
||||||
_ = PPLBUtility.B_Print_Out(1);// copy 2.
|
|
||||||
}
|
_ = PPLBUtility.B_Print_Out(1);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Net.Sockets;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using JNPF.Common.Core.Manager;
|
using JNPF.Common.Core.Manager;
|
||||||
@@ -16,6 +17,7 @@ using Microsoft.AspNetCore.Mvc;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using NPOI.OpenXmlFormats;
|
using NPOI.OpenXmlFormats;
|
||||||
using NPOI.OpenXmlFormats.Dml.Diagram;
|
using NPOI.OpenXmlFormats.Dml.Diagram;
|
||||||
|
using Org.BouncyCastle.Utilities.Net;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.BasicData.Entities;
|
using Tnb.BasicData.Entities;
|
||||||
using Tnb.Common.Utils;
|
using Tnb.Common.Utils;
|
||||||
@@ -152,19 +154,11 @@ namespace Tnb.WarehouseMgr
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task BarCodePrint(BarCodeInput input)
|
public async Task BarCodePrint(BarCodeInput input)
|
||||||
{
|
{
|
||||||
;
|
|
||||||
|
|
||||||
if (input == null)
|
if (input == null)
|
||||||
{
|
{
|
||||||
throw new AppFriendlyException(nameof(input), 500);
|
throw new AppFriendlyException(nameof(input), 500);
|
||||||
}
|
}
|
||||||
List<string> barcodes = new();
|
List<string> barcodes = new();
|
||||||
barcodes.Add("2300100051901001211210002");
|
|
||||||
barcodes.Add("2300100051901001211210008");
|
|
||||||
barcodes.Add("2300100051901001211210009");
|
|
||||||
|
|
||||||
|
|
||||||
base.BarCodePrint(barcodes, 1);
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await _db.Ado.BeginTranAsync();
|
await _db.Ado.BeginTranAsync();
|
||||||
@@ -213,7 +207,8 @@ namespace Tnb.WarehouseMgr
|
|||||||
barcodes.AddRange(wmsTempCodes.Select(p => p.barcode).ToList());
|
barcodes.AddRange(wmsTempCodes.Select(p => p.barcode).ToList());
|
||||||
if (barcodes?.Count > 0)
|
if (barcodes?.Count > 0)
|
||||||
{
|
{
|
||||||
base.BarCodePrint(barcodes, 1);
|
var ip= _db.Queryable<BasFactoryConfig>().Where(p=>p.key== "printerip").FirstAsync().Result.value;
|
||||||
|
base.BarCodePrint(barcodes, 1, ip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user