Administrator
2026-07-16 dfa31292ebcb1831f833660af6fd38d4b52cfa65
fix(gateApi): 修复网格交易中遗留订单取消逻辑

- 移除向上遍历时对网格ID小于0的限制条件
- 移除向下遍历时对网格ID大于0的限制条件
- 确保所有遗留的多单和空单都能被正确取消
- 修复因ID判断导致的部分订单无法取消的问题
1 files modified
4 ■■■■ changed files
src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java 4 ●●●● patch | view | raw | blame | history
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;