From 720e0926fa1c94b952c26e111206c5d6e1ed5ba2 Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期二, 21 四月 2026 15:59:49 +0800
Subject: [PATCH] Merge branch 'master' of http://47.97.1.152:5880/r/zy-wcs-master
---
src/main/java/com/zy/core/plugin/store/StoreInTaskGenerationService.java | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/zy/core/plugin/store/StoreInTaskGenerationService.java b/src/main/java/com/zy/core/plugin/store/StoreInTaskGenerationService.java
index ab90be5..5eb4023 100644
--- a/src/main/java/com/zy/core/plugin/store/StoreInTaskGenerationService.java
+++ b/src/main/java/com/zy/core/plugin/store/StoreInTaskGenerationService.java
@@ -33,6 +33,7 @@
import org.springframework.stereotype.Service;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
@Service
@@ -69,7 +70,7 @@
}
StoreInTaskContext earlyContext = buildContext(basDevp, stationObjModel);
- if (earlyContext == null || !handleErrorStationBack(earlyContext)) {
+ if (earlyContext == null || !handleErrorStationBack(policy, earlyContext)) {
return;
}
@@ -188,7 +189,7 @@
}
}
- private boolean handleErrorStationBack(StoreInTaskContext context) {
+ private boolean handleErrorStationBack(StoreInTaskPolicy policy, StoreInTaskContext context) {
StationProtocol stationProtocol = context.getStationProtocol();
if (stationProtocol == null) {
return false;
@@ -255,6 +256,12 @@
return false;
}
stationCommandDispatcher.dispatch(context.getBasDevp().getDevpNo(), command, "store-in-task", "station-back");
+ String errorMsg = Cools.isEmpty(stationProtocol.getErrorMsg()) ? "鏈煡寮傚父" : stationProtocol.getErrorMsg();
+ String warning = "鏉$爜绔欏紓甯搁��鍥烇紝鎶ヨ淇℃伅锛�" + errorMsg;
+ if (!Cools.isEmpty(stationProtocol.getSystemWarning())) {
+ warning = stationProtocol.getSystemWarning() + ";" + warning;
+ }
+ policy.setSystemWarning(context, warning);
News.info("{}鎵爜绔欏紓甯革紝宸查��鍥炶嚦{},鏉$爜绔欑姸鎬侊細{}", stationProtocol.getTaskNo(),
backStation.getStationId(), JSON.toJSONString(stationProtocol));
redisUtil.set(RedisKeyType.GENERATE_STATION_BACK_LIMIT.key + stationProtocol.getStationId(),
@@ -329,13 +336,13 @@
request.getBarcode(), request.getSourceStaNo(), result.getResponse(), result.getMessage());
redisUtil.set(policy.getGenerateLockKey(context), "lock", policy.getRetryLockSeconds(context));
policy.onApplyFailed(context, result);
- triggerStationBackOnApplyFailed(context, request, result);
+ triggerStationBackOnApplyFailed(policy, context, request, result);
}
/**
* WMS 鐢宠鍏ュ簱澶辫触鍚庯紝璐х墿浠嶅仠鐣欏湪鎵爜绔欙紝姝ゆ椂琛ュ彂閫�鍥炲埌鍏ュ簱绔欑殑杈撻�佸懡浠わ紝閬垮厤璐х墿闀挎湡婊炵暀銆�
*/
- private void triggerStationBackOnApplyFailed(StoreInTaskContext context,
+ private void triggerStationBackOnApplyFailed(StoreInTaskPolicy policy, StoreInTaskContext context,
InTaskApplyRequest request,
InTaskApplyResult result) {
if (context == null || context.getStationThread() == null || context.getStationObjModel() == null) {
@@ -406,6 +413,12 @@
}
redisUtil.set(lockKey, "lock", APPLY_FAIL_STATION_BACK_LOCK_SECONDS);
+ String currentWarning = stationProtocol.getSystemWarning();
+ String backWarning = "WMS鍏ュ簱澶辫触锛屽凡閫�鍥炲叆搴撶珯";
+ if (!Cools.isEmpty(currentWarning)) {
+ backWarning = currentWarning + ";" + backWarning;
+ }
+ policy.setSystemWarning(context, backWarning);
News.warn("WMS鍏ュ簱澶辫触锛屽凡瑙﹀彂璐х墿閫�鍥炲叆搴撶珯銆俠arcode={}锛宻tationId={}锛宐ackStationId={}锛寃arning={}",
request == null ? null : request.getBarcode(),
currentStationId,
--
Gitblit v1.9.1