|
|
@@ -1941,15 +1941,7 @@ public class MesClient extends JFrame {
|
|
|
JSONObject retObj = DataUtil.qmResultData(pendingTestParam);
|
|
|
if (retObj != null && retObj.get("result") != null && retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
|
// MES提交成功后打印标签
|
|
|
- if (MesClient.configParam.getPrintLabel().equals("是")) {
|
|
|
- String testDate = pendingTestParam.getCreateTime();
|
|
|
- PrintUtil.printLabel(
|
|
|
- pendingTestParam.getSn(),
|
|
|
- pendingTestParam.getParam1() + pendingTestParam.getParam2(),
|
|
|
- pendingTestParam.getParam3() + pendingTestParam.getParam4(),
|
|
|
- testDate
|
|
|
- );
|
|
|
- }
|
|
|
+ printLabelIfEnabled();
|
|
|
resetScanA();
|
|
|
setMenuStatus("测试结果上传成功,请扫下一件", 0);
|
|
|
} else {
|
|
|
@@ -2052,26 +2044,39 @@ public class MesClient extends JFrame {
|
|
|
pendingTestParam.getUcode()
|
|
|
);
|
|
|
|
|
|
- if (leakRet != null && leakRet.get("result") != null && leakRet.get("result").toString().equalsIgnoreCase("true")) {
|
|
|
- // 3. MES提交成功后打印标签(根据配置决定是否打印NG标签)
|
|
|
- if (MesClient.configParam.getPrintLabel().equals("是")) {
|
|
|
- String testDate = pendingTestParam.getCreateTime();
|
|
|
- PrintUtil.printLabel(
|
|
|
- pendingTestParam.getSn(),
|
|
|
- pendingTestParam.getParam1() + pendingTestParam.getParam2(),
|
|
|
- pendingTestParam.getParam3() + pendingTestParam.getParam4(),
|
|
|
- testDate
|
|
|
- );
|
|
|
- }
|
|
|
- resetScanA();
|
|
|
+ boolean leakOk = leakRet != null && leakRet.get("result") != null
|
|
|
+ && leakRet.get("result").toString().equalsIgnoreCase("true");
|
|
|
+
|
|
|
+ // 3. 测试结果已提交成功即打印标签,不受漏点记录结果影响
|
|
|
+ printLabelIfEnabled();
|
|
|
+ resetScanA();
|
|
|
+
|
|
|
+ if (leakOk) {
|
|
|
setMenuStatus("结果上传成功(含漏点记录),请扫下一件", 0);
|
|
|
} else {
|
|
|
- log.warn("漏点记录提交失败,但测试结果已提交");
|
|
|
- resetScanA();
|
|
|
+ log.warn("漏点记录提交失败,但测试结果已提交,标签已打印");
|
|
|
setMenuStatus("测试结果已提交,漏点记录失败", 1);
|
|
|
}
|
|
|
} else {
|
|
|
setMenuStatus("测试结果上传失败,请重试", -1);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 按配置打印标签,需在 resetScanA() 之前调用(依赖 pendingTestParam)
|
|
|
+ */
|
|
|
+ private static void printLabelIfEnabled() {
|
|
|
+ if (pendingTestParam == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!"是".equals(MesClient.configParam.getPrintLabel())) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ PrintUtil.printLabel(
|
|
|
+ pendingTestParam.getSn(),
|
|
|
+ pendingTestParam.getParam1() + pendingTestParam.getParam2(),
|
|
|
+ pendingTestParam.getParam3() + pendingTestParam.getParam4(),
|
|
|
+ pendingTestParam.getCreateTime()
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|