From 9571229a2013472dc701ecf5767f2873b36d8f90 Mon Sep 17 00:00:00 2001
From: huang <1532065656@qq.com>
Date: 星期四, 11 十二月 2025 17:07:19 +0800
Subject: [PATCH] 修复导入Excel功能工程号自增; 添加选择工程号自动填写玻璃id列表
---
mes-processes/mes-plcSend/src/main/java/com/mes/interaction/workstation/scanner/handler/HorizontalScannerLogicHandler.java | 47 ++++++++++++++++++++++++-----------------------
1 files changed, 24 insertions(+), 23 deletions(-)
diff --git a/mes-processes/mes-plcSend/src/main/java/com/mes/interaction/workstation/scanner/handler/HorizontalScannerLogicHandler.java b/mes-processes/mes-plcSend/src/main/java/com/mes/interaction/workstation/scanner/handler/HorizontalScannerLogicHandler.java
index 7e25e57..5dd8525 100644
--- a/mes-processes/mes-plcSend/src/main/java/com/mes/interaction/workstation/scanner/handler/HorizontalScannerLogicHandler.java
+++ b/mes-processes/mes-plcSend/src/main/java/com/mes/interaction/workstation/scanner/handler/HorizontalScannerLogicHandler.java
@@ -133,28 +133,29 @@
// 4. 娓呯┖plcRequest鍜宲lcGlassId锛堝彧娓呴櫎PLC瀛楁锛�
clearPlcRequestFields(deviceConfig, serializer);
+ // 5. 鏇存柊鐜荤拑淇℃伅鐘舵�侊細灏唖tate浠�0鏀逛负1锛堝凡鎵爜浜や簰锛�
+ boolean updated = glassInfoService.updateGlassStateAfterScan(glassId, rawWidth, rawHeight, workLine);
+ if (!updated) {
+ log.warn("鏇存柊鐜荤拑淇℃伅鐘舵�佸け璐ワ紝鐜荤拑鍙兘涓嶅瓨鍦�: glassId={}", glassId);
+ // 涓嶈繑鍥為敊璇紝缁х画鎵ц锛屽洜涓哄彲鑳芥槸鏂扮幓鐠冭繕鏈鍏�
+ }
+
+ // 6. 灏嗘壂鎻忓埌鐨勭幓鐠僆D淇濆瓨鍒板叡浜暟鎹腑锛堜緵澶ц溅璁惧瀹氭椂鍣ㄨ鍙栵級
+ saveScannedGlassId(params, glassId);
- // 5. 淇濆瓨鐜荤拑淇℃伅鍒版暟鎹簱
- GlassInfo glassInfo = buildGlassInfo(glassId, rawWidth, rawHeight, workLine);
- boolean saved = glassInfoService.saveOrUpdateGlassInfo(glassInfo);
- if (!saved) {
- return buildResult(deviceConfig, "scanOnce", false, "淇濆瓨鐜荤拑淇℃伅澶辫触: " + glassId, null);
- }
-
- // 6. 灏嗘壂鎻忓埌鐨勭幓鐠僆D淇濆瓨鍒板叡浜暟鎹腑锛堜緵澶ц溅璁惧瀹氭椂鍣ㄨ鍙栵級
- saveScannedGlassId(params, glassId);
-
- String msg = String.format("鐜荤拑[%s] 灏哄[琛ㄥ:%s x 闀�:%s] 宸叉帴鏀跺苟鍏ュ簱锛寃orkLine=%s",
- glassId,
- rawWidth != null ? rawWidth + "mm" : "-",
- rawHeight != null ? rawHeight + "mm" : "-",
- workLine != null ? workLine : "-");
- Map<String, Object> resultData = new HashMap<>();
- resultData.put("glassIds", Collections.singletonList(glassId));
- if (workLine != null) {
- resultData.put("workLine", workLine);
- }
- return buildResult(deviceConfig, "scanOnce", true, msg, resultData);
+ Integer intervalMs = config != null ? config.getScanIntervalMs() : null;
+ String msg = String.format("鐜荤拑[%s] 灏哄[琛ㄥ:%s x 闀�:%s] 宸叉帴鏀讹紝workLine=%s锛屾壂鎻忛棿闅�=%s",
+ glassId,
+ rawWidth != null ? rawWidth + "mm" : "-",
+ rawHeight != null ? rawHeight + "mm" : "-",
+ workLine != null ? workLine : "-",
+ intervalMs != null ? intervalMs + "ms" : "-");
+ Map<String, Object> resultData = new HashMap<>();
+ resultData.put("glassIds", Collections.singletonList(glassId));
+ if (workLine != null) {
+ resultData.put("workLine", workLine);
+ }
+ return buildResult(deviceConfig, "scanOnce", true, msg, resultData);
}
/**
@@ -273,10 +274,10 @@
glassInfo.setGlassId(glassId.trim());
// mesWidth=琛ㄥ -> glassWidth, mesHeight=闀� -> glassLength
if (width != null) {
- glassInfo.setGlassWidth(width); // 琛ㄥ
+ glassInfo.setGlassWidth(width);
}
if (height != null) {
- glassInfo.setGlassLength(height); // 闀�
+ glassInfo.setGlassLength(height);
}
glassInfo.setStatus(GlassInfo.Status.PENDING);
if (workLine != null) {
--
Gitblit v1.8.0