| | |
| | | { |
| | | public partial class Form1 : Form |
| | | { |
| | | public static string prePrintSuccessPackage = "";//上一个打印成功的包号 |
| | | //自动打印线程 |
| | | Thread AutoPrint, Colors; |
| | | |
| | |
| | | |
| | | //调用打印接口 |
| | | bool isSuccess = false; |
| | | if (prePrintSuccessPackage == item.PackageCode) |
| | | {//如果是连续打印,则不调用打印服务,解决重复打印的问题 【Editby shaocx,2025-08-13】 |
| | | isSuccess = true;//强制认为打印成功! |
| | | } |
| | | else |
| | | { |
| | | using (iWarePrintService.PrintBaseService.PrintWcfServiceClient client = new iWarePrintService.PrintBaseService.PrintWcfServiceClient()) |
| | | { |
| | | //isSuccess = client.Print3(data, 1, @"D:\打印程序\跟踪码打印模板\跟踪码打印模板_一维码.btw", "ZDesigner ZD888-203dpi ZPL", out errMsg); |
| | | //isSuccess = client.Print3(data, 1, @"D:\打印程序\跟踪码打印模板\跟踪码打印模板_二维码.btw", "ZDesigner ZD888-203dpi ZPL", out errMsg); |
| | | isSuccess = client.Print3(data, item.PrintSheetNum, printConfig.PrintTemplateAddr, _PrinterName, out errMsg); |
| | | } |
| | | } |
| | | |
| | | if (isSuccess) |
| | | { |
| | | prePrintSuccessPackage = item.PackageCode; |
| | | |
| | | item.PrintStatus = 1;//打印状态(0:未打印 1:已打印) |
| | | item.PrintNum = (item.PrintNum) + 1; |
| | | |