| src/main/java/com/zy/core/trace/StationTaskTraceRegistry.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/zy/core/utils/StationOperateProcessUtils.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/webapp/views/watch/stationTrace.html | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/zy/core/trace/StationTaskTraceRegistry.java
@@ -642,7 +642,7 @@ && !loopAlertText.trim().isEmpty(); String nextType = active ? loopAlertType : null; String nextText = active ? loopAlertText.trim() : null; Integer nextCount = active ? loopAlertCount : null; Integer nextCount = loopAlertCount != null && loopAlertCount > 0 ? loopAlertCount : null; boolean changed = !Objects.equals(this.loopAlertActive, active) || !Objects.equals(this.loopAlertType, nextType) || !Objects.equals(this.loopAlertText, nextText) @@ -810,13 +810,15 @@ } private void appendLoopHintDetails(Map<String, Object> details) { if (details == null || !Boolean.TRUE.equals(this.loopAlertActive) || this.loopAlertCount == null || this.loopAlertCount <= 2) { if (details == null || this.loopAlertCount == null || this.loopAlertCount <= 0) { return; } details.put("loopAlertActive", Boolean.TRUE); details.put("loopAlertType", this.loopAlertType); details.put("loopAlertText", this.loopAlertText); details.put("loopAlertCount", this.loopAlertCount); if (Boolean.TRUE.equals(this.loopAlertActive)) { details.put("loopAlertActive", Boolean.TRUE); details.put("loopAlertType", this.loopAlertType); details.put("loopAlertText", this.loopAlertText); } } private boolean acceptTraceVersion(Integer incomingTraceVersion) { src/main/java/com/zy/core/utils/StationOperateProcessUtils.java
@@ -834,7 +834,7 @@ Integer circleTarget = resolveNextCircleOrderTarget( currentStationId, outOrderStationIds, loopEvaluation.isLargeLoopTriggered() loopEvaluation.getExpectedLoopIssueCount() ); if (circleTarget == null) { News.taskInfo(wrkMast.getWrkNo(), "目标站当前不可进,且未找到可执行的下一排序检测点,当前站点={}", currentStationId); @@ -851,7 +851,7 @@ Integer circleTarget = resolveNextCircleOrderTarget( currentStationId, outOrderStationIds, loopEvaluation.isLargeLoopTriggered() loopEvaluation.getExpectedLoopIssueCount() ); if (circleTarget == null) { News.taskInfo(wrkMast.getWrkNo(), "未找到可执行的下一排序检测点,当前站点={}", currentStationId); @@ -1018,16 +1018,14 @@ private Integer resolveNextCircleOrderTarget(Integer currentStationId, List<Integer> orderedOutStationList, boolean preferLargeCircle) { Integer expectedLoopIssueCount) { if (currentStationId == null || orderedOutStationList == null || orderedOutStationList.size() <= 1) { return null; } int startIndex = orderedOutStationList.indexOf(currentStationId); int total = orderedOutStationList.size(); Integer bestStationId = null; int bestPathLength = -1; int bestOffset = -1; List<Integer> reachableStationIdList = new ArrayList<>(); for (int offset = 1; offset < total; offset++) { int candidateIndex = (startIndex + offset + total) % total; Integer candidateStationId = orderedOutStationList.get(candidateIndex); @@ -1037,19 +1035,29 @@ try { List<NavigateNode> path = navigateUtils.calcByStationId(currentStationId, candidateStationId); if (path != null && !path.isEmpty()) { if (!preferLargeCircle) { return candidateStationId; } int pathLength = path.size(); if (pathLength > bestPathLength || (pathLength == bestPathLength && offset > bestOffset)) { bestStationId = candidateStationId; bestPathLength = pathLength; bestOffset = offset; } reachableStationIdList.add(candidateStationId); } } catch (Exception ignore) {} } return bestStationId; if (reachableStationIdList.isEmpty()) { return null; } int gradualIndex = resolveGradualCircleTargetIndex(expectedLoopIssueCount, reachableStationIdList.size()); return reachableStationIdList.get(gradualIndex); } private int resolveGradualCircleTargetIndex(Integer expectedLoopIssueCount, int candidateCount) { if (candidateCount <= 1) { return 0; } if (expectedLoopIssueCount == null || expectedLoopIssueCount <= 2) { return 0; } int gradualIndex = expectedLoopIssueCount - 2; if (gradualIndex < 1) { gradualIndex = 1; } return Math.min(gradualIndex, candidateCount - 1); } private boolean tryAcquireOutOrderDispatchLock(Integer wrkNo, Integer stationId) { src/main/webapp/views/watch/stationTrace.html
@@ -429,6 +429,9 @@ 当前站: {{ orDash(item.currentStationId) }}<br> 目标站: {{ orDash(item.finalTargetStationId) }}<br> 分段: {{ orDash(item.issuedSegmentCount) }} / {{ orDash(item.totalSegmentCount) }}<br> <template v-if="item.loopAlertCount"> 绕圈累计: {{ item.loopAlertCount }}<br> </template> <template v-if="item.loopAlertActive && item.loopAlertText"> 提示: {{ item.loopAlertText }}<br> </template> @@ -498,7 +501,7 @@ </div> <div class="trace-summary-item"> <div class="trace-summary-label">绕圈累计</div> <div class="trace-summary-value">{{ selectedTrace.loopAlertActive ? orDash(selectedTrace.loopAlertCount) : '--' }}</div> <div class="trace-summary-value">{{ selectedTrace.loopAlertCount != null ? selectedTrace.loopAlertCount : '--' }}</div> </div> </div>