From dfa31292ebcb1831f833660af6fd38d4b52cfa65 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Thu, 16 Jul 2026 17:35:10 +0800
Subject: [PATCH] fix(gateApi): 修复网格交易中遗留订单取消逻辑
---
src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java b/src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java
index 3b800f9..0dd3508 100644
--- a/src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java
+++ b/src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java
@@ -1206,7 +1206,7 @@
String quantity = String.valueOf((accumulatedLongLossCount + 1) * Integer.parseInt(config.getQuantity()));
// 向上遍历取消所有遗留多单(跳过基础入场网格0)
GridElement cancelCursor = GridElement.findById(newEntryGrid.getUpId());
- while (cancelCursor != null && cancelCursor.getId() < 0) {
+ while (cancelCursor != null) {
if (cancelCursor.isHasLongOrder()) {
for (String longOrderId : new ArrayList<>(cancelCursor.getLongOrderIds())) {
GridElement finalCancelCursor = cancelCursor;
@@ -1260,7 +1260,7 @@
String quantity = String.valueOf((accumulatedShortLossCount + 1) * Integer.parseInt(config.getQuantity()));
// 向下遍历取消所有遗留空单(跳过基础入场网格0)
GridElement cancelCursor = GridElement.findById(newEntryGrid.getDownId());
- while (cancelCursor != null && cancelCursor.getId() > 0) {
+ while (cancelCursor != null) {
if (cancelCursor.isHasShortOrder()) {
for (String shortOrderId : new ArrayList<>(cancelCursor.getShortOrderIds())) {
GridElement finalCancelCursor = cancelCursor;
--
Gitblit v1.9.1