From b10daf49726aed6a5ded7b7736ee2a1e72e685b5 Mon Sep 17 00:00:00 2001 From: fajiao <1519100073@qq.com> Date: Wed, 24 Aug 2022 12:59:42 +0800 Subject: [PATCH] fix PrintPosBill --- AutoWeightServer/Center/DeviceCenter.cs | 13 +++++++------ AutoWeightServer/UI/FrmBill.cs | 2 +- AutoWeightServer/UI/UC/UCCarOut.cs | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/AutoWeightServer/Center/DeviceCenter.cs b/AutoWeightServer/Center/DeviceCenter.cs index 5346785..1cd1af2 100644 --- a/AutoWeightServer/Center/DeviceCenter.cs +++ b/AutoWeightServer/Center/DeviceCenter.cs @@ -5,6 +5,7 @@ using EC.AutoWeightServer.IfManager.Pos; using EC.AutoWeightServer.IfManager.Scales; using EC.AutoWeightServer.IfManager.YkPos; using EC.AutoWeightServer.Model.Config; +using EC.AutoWeightServer.Model.State; using EC.AutoWeightServer.UI; using EC.AutoWeightServer.UI.UC; using EC.Entity.Transport; @@ -321,7 +322,7 @@ namespace EC.AutoWeightServer.Center /// 打印运单 /// /// - public void PrintBill(TransportBillEntity billEntity) + public void PrintYkPosBill(TransportBillEntity billEntity) { if (billEntity == null) return; @@ -377,7 +378,7 @@ namespace EC.AutoWeightServer.Center content.Append($"达标率:\t{billEntity.StandardRate}%\n"); content.Append($"入场时间:\t{billEntity.InStartTime:yyyy/MM/dd HH:mm:ss}\n"); content.Append($"出场时间:\t{billEntity.OutFinishTime:yyyy/MM/dd HH:mm:ss}\n"); - //content.Append($"运单状态:\t{BillStateExt.GetBillStateDesc(billEntity.State)}\n"); + content.Append($"运单状态:\t{BillStateExt.GetBillStateDesc(billEntity.State)}\n"); YkPosManager.PrintStr(content);//打印内容 YkPosManager.InitPrinter();//重置 @@ -409,11 +410,11 @@ namespace EC.AutoWeightServer.Center PosManager = null; } - public void PrintBIll(TransportBillEntity billEntity) + public void PrintPosBill(TransportBillEntity billEntity) { - if (PosManager == null || billEntity == null) + if (PosManager == null || billEntity == null || !PosManager.IsConnected()) return; - if (!PosManager.IsConnected() || PosManager.IsPaperExhaust()) + if (PosManager.IsPaperExhaust()) { var msg = "打印接口纸尽,请联系管理人员"; _mainServer?.SetScrollLabelText(msg); @@ -469,7 +470,7 @@ namespace EC.AutoWeightServer.Center content.Append($"达标率:\t{billEntity.StandardRate}%\n"); content.Append($"入场时间:\t{billEntity.InStartTime:yyyy/MM/dd HH:mm:ss}\n"); content.Append($"出场时间:\t{billEntity.OutFinishTime:yyyy/MM/dd HH:mm:ss}\n"); - //content.Append($"运单状态:\t{BillStateExt.GetBillStateDesc(billEntity.State)}\n"); + content.Append($"运单状态:\t{BillStateExt.GetBillStateDesc(billEntity.State)}\n"); PosManager.PrintStr(0, 0, 0, 0, 0, content.ToString()); //打印分隔符 PosManager.SetAlign(1); diff --git a/AutoWeightServer/UI/FrmBill.cs b/AutoWeightServer/UI/FrmBill.cs index 1970eea..af3e40d 100644 --- a/AutoWeightServer/UI/FrmBill.cs +++ b/AutoWeightServer/UI/FrmBill.cs @@ -62,7 +62,7 @@ namespace EC.AutoWeightServer.UI if (_mainServer == null) return; var cell = dataGridView.CurrentRow.Cells; var billEntity = ServiceCenter.BillService.GetBillBySerialNumber(cell[0].Value.ToString()); - _mainServer.DeviceCenter.PrintBill(billEntity); + _mainServer.DeviceCenter.PrintPosBill(billEntity); } } } diff --git a/AutoWeightServer/UI/UC/UCCarOut.cs b/AutoWeightServer/UI/UC/UCCarOut.cs index 72ec537..178f0f0 100644 --- a/AutoWeightServer/UI/UC/UCCarOut.cs +++ b/AutoWeightServer/UI/UC/UCCarOut.cs @@ -392,7 +392,7 @@ namespace EC.AutoWeightServer.UI.UC } btnConfirm.Enabled = false; - _mainServer.DeviceCenter.PrintBill(billEntity);//打印运输小票 + _mainServer.DeviceCenter.PrintPosBill(billEntity);//打印运输小票 //_mainServer.DeviceCenter.PrintBill(billEntity);//打印存根小票 _mainServer.SetOutFinishState(plate);//离开出场界面 }