|
@@ -5,9 +5,6 @@ import com.mes.print.PrinterException;
|
|
|
import com.mes.print.model.FlowCardData;
|
|
import com.mes.print.model.FlowCardData;
|
|
|
import com.mes.print.model.LabelData;
|
|
import com.mes.print.model.LabelData;
|
|
|
|
|
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
|
|
-import java.util.Date;
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 打印辅助类:封装 mes-print 模块调用
|
|
* 打印辅助类:封装 mes-print 模块调用
|
|
|
*
|
|
*
|
|
@@ -21,14 +18,11 @@ public class PrintHelper {
|
|
|
/**
|
|
/**
|
|
|
* 打印流转卡(用于 HP 激光打印机)
|
|
* 打印流转卡(用于 HP 激光打印机)
|
|
|
*
|
|
*
|
|
|
- * @param sn 产品序列号
|
|
|
|
|
- * @param opNo 工位号(如 OP040A)
|
|
|
|
|
- * @param batch 批次号
|
|
|
|
|
- * @param operator 操作员
|
|
|
|
|
- * @param remark 备注
|
|
|
|
|
|
|
+ * @param customerSn 客户码(序列号)
|
|
|
|
|
+ * @param steelSn 钢印码
|
|
|
* @return 是否打印成功
|
|
* @return 是否打印成功
|
|
|
*/
|
|
*/
|
|
|
- public static boolean printFlowCard(String sn, String opNo, String batch, String operator, String remark) {
|
|
|
|
|
|
|
+ public static boolean printFlowCard(String customerSn, String steelSn) {
|
|
|
try {
|
|
try {
|
|
|
String type = Printer.getCurrentType();
|
|
String type = Printer.getCurrentType();
|
|
|
if ("none".equals(type)) {
|
|
if ("none".equals(type)) {
|
|
@@ -42,16 +36,11 @@ public class PrintHelper {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
FlowCardData data = new FlowCardData();
|
|
FlowCardData data = new FlowCardData();
|
|
|
- data.setSn(sn);
|
|
|
|
|
- data.setProduct("+KB24"); // 产品型号,根据实际业务调整
|
|
|
|
|
- data.setOpNo(opNo);
|
|
|
|
|
- data.setBatch(batch != null ? batch : "");
|
|
|
|
|
- data.setDate(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()));
|
|
|
|
|
- data.setOperator(operator != null ? operator : "");
|
|
|
|
|
- data.setRemark(remark != null ? remark : "");
|
|
|
|
|
|
|
+ data.setSn(customerSn);
|
|
|
|
|
+ data.setSteelSn(steelSn != null ? steelSn : "");
|
|
|
|
|
|
|
|
Printer.printFlowCard(data);
|
|
Printer.printFlowCard(data);
|
|
|
- System.out.println("[打印] 流转卡打印成功: " + sn);
|
|
|
|
|
|
|
+ System.out.println("[打印] 流转卡打印成功: " + customerSn);
|
|
|
return true;
|
|
return true;
|
|
|
|
|
|
|
|
} catch (PrinterException e) {
|
|
} catch (PrinterException e) {
|
|
@@ -114,11 +103,10 @@ public class PrintHelper {
|
|
|
* 根据当前配置的打印机类型自动打印
|
|
* 根据当前配置的打印机类型自动打印
|
|
|
*
|
|
*
|
|
|
* @param sn 产品序列号
|
|
* @param sn 产品序列号
|
|
|
- * @param opNo 工位号
|
|
|
|
|
- * @param operator 操作员
|
|
|
|
|
|
|
+ * @param steelSn 钢印码
|
|
|
* @return 是否打印成功
|
|
* @return 是否打印成功
|
|
|
*/
|
|
*/
|
|
|
- public static boolean autoPrint(String sn, String opNo, String operator) {
|
|
|
|
|
|
|
+ public static boolean autoPrint(String sn, String steelSn) {
|
|
|
try {
|
|
try {
|
|
|
String type = Printer.getCurrentType();
|
|
String type = Printer.getCurrentType();
|
|
|
|
|
|
|
@@ -126,7 +114,7 @@ public class PrintHelper {
|
|
|
System.out.println("[打印] 当前配置为不打印,跳过");
|
|
System.out.println("[打印] 当前配置为不打印,跳过");
|
|
|
return true;
|
|
return true;
|
|
|
} else if ("hp".equals(type)) {
|
|
} else if ("hp".equals(type)) {
|
|
|
- return printFlowCard(sn, opNo, "", operator, "");
|
|
|
|
|
|
|
+ return printFlowCard(sn, steelSn);
|
|
|
} else if ("tsc".equals(type)) {
|
|
} else if ("tsc".equals(type)) {
|
|
|
return printLabel(sn, sn, sn, "产品标签", 1);
|
|
return printLabel(sn, sn, sn, "产品标签", 1);
|
|
|
} else {
|
|
} else {
|