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/transfer/handler/HorizontalTransferLogicHandler.java | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/mes-processes/mes-plcSend/src/main/java/com/mes/interaction/workstation/transfer/handler/HorizontalTransferLogicHandler.java b/mes-processes/mes-plcSend/src/main/java/com/mes/interaction/workstation/transfer/handler/HorizontalTransferLogicHandler.java
index b5d7d50..e1e177d 100644
--- a/mes-processes/mes-plcSend/src/main/java/com/mes/interaction/workstation/transfer/handler/HorizontalTransferLogicHandler.java
+++ b/mes-processes/mes-plcSend/src/main/java/com/mes/interaction/workstation/transfer/handler/HorizontalTransferLogicHandler.java
@@ -261,12 +261,10 @@
// 浠庨厤缃腑鑾峰彇workLine锛岀敤浜庤繃婊わ紙閰嶇疆涓槸Integer绫诲瀷锛�
Integer workLine = getLogicParam(logicParams, "workLine", null);
- // 鏌ヨ鏈�杩�2鍒嗛挓鍐呯殑鐜荤拑璁板綍锛堟墿澶ф椂闂寸獥鍙o紝纭繚涓嶉仐婕忥級
- Date twoMinutesAgo = new Date(System.currentTimeMillis() - 120000);
-
+ // 鏌ヨstate=1鐨勭幓鐠冭褰曪紙宸叉壂鐮佷氦浜掑畬鎴愶紝绛夊緟鍗ц浆绔嬪鐞嗭級
LambdaQueryWrapper<GlassInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.in(GlassInfo::getStatus, GlassInfo.Status.PENDING, GlassInfo.Status.ACTIVE)
- .ge(GlassInfo::getCreatedTime, twoMinutesAgo)
+ .eq(GlassInfo::getState, 1) // 鍙煡璇tate=1鐨勭幓鐠冿紙宸叉壂鐮佸畬鎴愶級
.orderByDesc(GlassInfo::getCreatedTime)
.last("LIMIT 20"); // 闄愬埗鏌ヨ鏁伴噺锛岄伩鍏嶈繃澶�
@@ -419,19 +417,16 @@
// 鍐欏叆鐜荤拑鏁伴噺
payload.put("plcGlassCount", count);
- // 鍐欏叆鍗ц浆绔嬬紪鍙凤紙浼樺厛浠庝换鍔″弬鏁拌幏鍙栵紝鍏舵浠庤澶囬厤缃幏鍙栵級
- Integer inPosition = null;
+ // 鍐欏叆鍗ц浆绔嬬紪鍙凤紙浼樺厛浠庝换鍔″弬鏁拌幏鍙栵紝鍏舵浠庤澶囬厤缃幏鍙栵紝鐩存帴鍐欏叆缂栧彿锛屼笉杩涜浣嶇疆鏄犲皠锛�
+ Object inPosition = null;
if (params != null) {
try {
Object ctxObj = params.get("_taskContext");
if (ctxObj instanceof com.mes.task.model.TaskExecutionContext) {
com.mes.task.model.TaskExecutionContext ctx =
(com.mes.task.model.TaskExecutionContext) ctxObj;
- Object positionObj = ctx.getParameters().getExtra() != null
+ inPosition = ctx.getParameters().getExtra() != null
? ctx.getParameters().getExtra().get("inPosition") : null;
- if (positionObj instanceof Number) {
- inPosition = ((Number) positionObj).intValue();
- }
}
} catch (Exception e) {
log.debug("浠庝换鍔″弬鏁拌幏鍙栧崸杞珛缂栧彿澶辫触: deviceId={}", deviceConfig.getId(), e);
@@ -442,6 +437,7 @@
inPosition = getLogicParam(logicParams, "inPosition", null);
}
if (inPosition != null) {
+ // 鐩存帴鍐欏叆缂栧彿鏈韩锛屼笉杩涜浣嶇疆鏄犲皠杞崲
payload.put("inPosition", inPosition);
log.info("鍐欏叆鍗ц浆绔嬬紪鍙�: deviceId={}, inPosition={}", deviceConfig.getId(), inPosition);
} else {
--
Gitblit v1.8.0