|
|
@ -12,29 +12,39 @@ namespace QualityAndOrder |
|
|
{ |
|
|
{ |
|
|
public static void Print(HurryRecord entity) |
|
|
public static void Print(HurryRecord entity) |
|
|
{ |
|
|
{ |
|
|
entity.LiveColonyHouse_Name = "B-12-1,B-12-2,B-12-3,B-12-4"; |
|
|
|
|
|
|
|
|
|
|
|
PrintAPI.B_GetUSBBufferLen(); |
|
|
PrintAPI.B_GetUSBBufferLen(); |
|
|
PrintAPI.B_EnumUSB(new byte[128]); |
|
|
PrintAPI.B_EnumUSB(new byte[128]); |
|
|
PrintAPI.B_CreateUSBPort(1); |
|
|
PrintAPI.B_CreateUSBPort(1); |
|
|
PrintAPI.B_Prn_Text_TrueType(255, 15, 38, "宋体", 1, 700, 0, 0, 0, "C1", "急宰单"); |
|
|
PrintAPI.B_Prn_Text_TrueType(255, 15, 38, "宋体", 1, 700, 0, 0, 0, "C1", "急宰单"); |
|
|
PrintAPI.B_Bar2d_QR(40, 75, 2, 12, 'M', 'A', 0, 0, 0, string.Format("s{0}e", entity.ID)); |
|
|
PrintAPI.B_Bar2d_QR(40, 75, 2, 12, 'M', 'A', 0, 0, 0, string.Format("s{0}e", entity.ID)); |
|
|
|
|
|
var y = 50; |
|
|
|
|
|
var cIdx = 1; |
|
|
|
|
|
PrintAPI.B_Prn_Text_TrueType(300, y += 40, 32, "宋体", 1, 600, 0, 0, 0, "C" + (++cIdx), string.Format("磅单号:{0}", entity.B3WeighBill_ID)); |
|
|
|
|
|
var supplierName = new List<string>(); |
|
|
|
|
|
if (entity.Supplier_Name.Length > 6) |
|
|
|
|
|
{ |
|
|
|
|
|
supplierName.Add(entity.Supplier_Name.Substring(0, 6)); |
|
|
|
|
|
supplierName.Add(entity.Supplier_Name.Substring(6)); |
|
|
|
|
|
if (supplierName[1].Length > 11) |
|
|
|
|
|
supplierName[1] = supplierName[1].Substring(0, 11); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
supplierName.Add(entity.Supplier_Name); |
|
|
|
|
|
|
|
|
|
|
|
PrintAPI.B_Prn_Text_TrueType(300, y += 40, 32, "宋体", 1, 600, 0, 0, 0, "C" + (++cIdx), string.Format("供应商:{0}", supplierName[0])); |
|
|
|
|
|
if (supplierName.Count == 2) |
|
|
|
|
|
PrintAPI.B_Prn_Text_TrueType(300, y += 40, 32, "宋体", 1, 600, 0, 0, 0, "C" + (++cIdx), supplierName[1]); |
|
|
|
|
|
|
|
|
|
|
|
PrintAPI.B_Prn_Text_TrueType(300, y += 40, 32, "宋体", 1, 600, 0, 0, 0, "C" + (++cIdx), string.Format("头 数:{0}", entity.HurryNumber)); |
|
|
|
|
|
|
|
|
PrintAPI.B_Prn_Text_TrueType(300, 90, 32, "宋体", 1, 600, 0, 0, 0, "C2", string.Format("磅单号:{0}", entity.B3WeighBill_ID)); |
|
|
|
|
|
PrintAPI.B_Prn_Text_TrueType(300, 135, 32, "宋体", 1, 600, 0, 0, 0, "C3", string.Format("供应商:{0}", entity.Supplier_Name)); |
|
|
|
|
|
PrintAPI.B_Prn_Text_TrueType(300, 180, 32, "宋体", 1, 600, 0, 0, 0, "C4", string.Format("头 数:{0}", entity.HurryNumber)); |
|
|
|
|
|
var names = GetHouseNames(entity.LiveColonyHouse_Name); |
|
|
var names = GetHouseNames(entity.LiveColonyHouse_Name); |
|
|
PrintAPI.B_Prn_Text_TrueType(300, 225, 32, "宋体", 1, 600, 0, 0, 0, "C5", string.Format("圈 舍:{0}", names.Any() ? names[0] : string.Empty)); |
|
|
|
|
|
|
|
|
PrintAPI.B_Prn_Text_TrueType(300, y += 40, 32, "宋体", 1, 600, 0, 0, 0, "C" + (++cIdx), string.Format("圈 舍:{0}", names.Any() ? names[0] : string.Empty)); |
|
|
names.RemoveAt(0); |
|
|
names.RemoveAt(0); |
|
|
var p = 6; |
|
|
|
|
|
var x = 270; |
|
|
|
|
|
|
|
|
|
|
|
foreach (var v in names) |
|
|
foreach (var v in names) |
|
|
{ |
|
|
|
|
|
PrintAPI.B_Prn_Text_TrueType(303, x, 32, "宋体", 1, 600, 0, 0, 0, "C" + p, string.Format(" {0}", names.Any() ? names[0] : string.Empty)); |
|
|
|
|
|
p += 1; |
|
|
|
|
|
x += 45; |
|
|
|
|
|
} |
|
|
|
|
|
PrintAPI.B_Prn_Text_TrueType(300, x, 32, "宋体", 1, 600, 0, 0, 0, "C" + p, string.Format("时 间:{0}", entity.Time.ToString("MM/dd HH:mm"))); |
|
|
|
|
|
|
|
|
PrintAPI.B_Prn_Text_TrueType(303, y += 40, 32, "宋体", 1, 600, 0, 0, 0, "C" + (++cIdx), string.Format(" {0}", names.Any() ? names[0] : string.Empty)); |
|
|
|
|
|
|
|
|
|
|
|
PrintAPI.B_Prn_Text_TrueType(300, y += 40, 32, "宋体", 1, 600, 0, 0, 0, "C" + (++cIdx), string.Format("时 间:{0}", entity.Time.ToString("MM/dd HH:mm"))); |
|
|
|
|
|
|
|
|
PrintAPI.B_Set_Direction('B'); |
|
|
PrintAPI.B_Set_Direction('B'); |
|
|
PrintAPI.B_Print_Out(1); |
|
|
PrintAPI.B_Print_Out(1); |
|
|
@ -50,7 +60,7 @@ namespace QualityAndOrder |
|
|
var temp = string.Empty; |
|
|
var temp = string.Empty; |
|
|
foreach (var item in arr) |
|
|
foreach (var item in arr) |
|
|
{ |
|
|
{ |
|
|
if(string.IsNullOrEmpty(temp)) |
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(temp)) |
|
|
temp = item; |
|
|
temp = item; |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
|