|
|
@ -1,7 +1,5 @@
|
|
|
|
package com.hy.print.hy_printer;
|
|
|
|
package com.hy.print.hy_printer;
|
|
|
|
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cpcl.PrinterHelper;
|
|
|
|
import cpcl.PrinterHelper;
|
|
|
|
|
|
|
|
|
|
|
|
public class PrintAsOrder {
|
|
|
|
public class PrintAsOrder {
|
|
|
@ -21,19 +19,18 @@ public class PrintAsOrder {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static int print(String code, String fbaCode, String country, String channel, String count) {
|
|
|
|
public static int print(String code, String fbaCode, String country, String channel, String count, Boolean hasPlan) {
|
|
|
|
int re = 0;
|
|
|
|
int re = 0;
|
|
|
|
if (fbaCode.isEmpty()) {
|
|
|
|
if (!hasPlan) {
|
|
|
|
re = printNoFba(code, count);
|
|
|
|
re = printNoPlan(code, count);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
re = printFba(code, fbaCode, country, channel, count);
|
|
|
|
re = printHasPlan(code, fbaCode, country, channel, count);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return re;
|
|
|
|
return re;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static int printNoFba(String code, String count) {
|
|
|
|
public static int printNoPlan(String code, String count) {
|
|
|
|
int reusult = 0;
|
|
|
|
int reusult = 0;
|
|
|
|
System.out.println("print start");
|
|
|
|
System.out.println("print start");
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -47,14 +44,14 @@ public class PrintAsOrder {
|
|
|
|
|
|
|
|
|
|
|
|
PrinterHelper.Line("42", "228", "550", "228", "2");
|
|
|
|
PrinterHelper.Line("42", "228", "550", "228", "2");
|
|
|
|
setBold();
|
|
|
|
setBold();
|
|
|
|
PrinterHelper.SetMag("2","2");
|
|
|
|
PrinterHelper.SetMag("2", "2");
|
|
|
|
PrinterHelper.Text(PrinterHelper.TEXT, "20", "0", "45", "254", "未建计划");
|
|
|
|
PrinterHelper.Text(PrinterHelper.TEXT, "20", "0", "45", "254", "未建计划");
|
|
|
|
|
|
|
|
|
|
|
|
PrinterHelper.Align(PrinterHelper.RIGHT);
|
|
|
|
PrinterHelper.Align(PrinterHelper.RIGHT);
|
|
|
|
PrinterHelper.Text(PrinterHelper.TEXT, "20", "0", "42", "254", "件数");
|
|
|
|
PrinterHelper.Text(PrinterHelper.TEXT, "20", "0", "42", "254", "件数");
|
|
|
|
|
|
|
|
|
|
|
|
PrinterHelper.Text(PrinterHelper.TEXT, "20", "0", "42", "300", count);
|
|
|
|
PrinterHelper.Text(PrinterHelper.TEXT, "20", "0", "42", "300", count);
|
|
|
|
PrinterHelper.SetMag("1","1");
|
|
|
|
PrinterHelper.SetMag("1", "1");
|
|
|
|
closeBold();
|
|
|
|
closeBold();
|
|
|
|
PrinterHelper.Align(PrinterHelper.LEFT);
|
|
|
|
PrinterHelper.Align(PrinterHelper.LEFT);
|
|
|
|
PrinterHelper.Form();
|
|
|
|
PrinterHelper.Form();
|
|
|
@ -67,7 +64,7 @@ public class PrintAsOrder {
|
|
|
|
return reusult;
|
|
|
|
return reusult;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static int printFba(String code, String fbaCode, String country, String channel, String count) {
|
|
|
|
public static int printHasPlan(String code, String fbaCode, String country, String channel, String count) {
|
|
|
|
int reusult = 0;
|
|
|
|
int reusult = 0;
|
|
|
|
System.out.println("print start");
|
|
|
|
System.out.println("print start");
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -78,7 +75,11 @@ public class PrintAsOrder {
|
|
|
|
PrinterHelper.SetBold("3");
|
|
|
|
PrinterHelper.SetBold("3");
|
|
|
|
PrinterHelper.AutCenter(PrinterHelper.TEXT, "45", "170", 500, 4, code);
|
|
|
|
PrinterHelper.AutCenter(PrinterHelper.TEXT, "45", "170", 500, 4, code);
|
|
|
|
closeBold();
|
|
|
|
closeBold();
|
|
|
|
|
|
|
|
if (fbaCode.isEmpty()) {
|
|
|
|
|
|
|
|
fbaCode = "非BFA订单";
|
|
|
|
|
|
|
|
} else {
|
|
|
|
fbaCode = "FBA号:" + fbaCode;
|
|
|
|
fbaCode = "FBA号:" + fbaCode;
|
|
|
|
|
|
|
|
}
|
|
|
|
PrinterHelper.AutCenter(PrinterHelper.TEXT, "45", "222", 500, 8, fbaCode);
|
|
|
|
PrinterHelper.AutCenter(PrinterHelper.TEXT, "45", "222", 500, 8, fbaCode);
|
|
|
|
PrinterHelper.Line("42", "269", "550", "269", "2");
|
|
|
|
PrinterHelper.Line("42", "269", "550", "269", "2");
|
|
|
|
setBold();
|
|
|
|
setBold();
|
|
|
|