Administrator
2026-06-04 4c8236f229ed903c861373ec3d8678062300ea6d
src/main/java/com/xcong/excoin/modules/gateApi/GateTradeExecutor.java
@@ -262,7 +262,7 @@
     *
     * @param orderId 订单 ID,为 null 时跳过
     */
    public void cancelOrder(String orderId) {
    public void cancelOrder(String orderId,Consumer<String> onSuccess) {
        if (orderId == null) {
            return;
        }
@@ -270,6 +270,9 @@
            try {
                FuturesOrder cancelled = futuresApi.cancelFuturesOrder(SETTLE, orderId, null);
                log.info("[TradeExec] 订单已取消, id:{}, status:{}", orderId, cancelled.getStatus());
                if (onSuccess != null) {
                    onSuccess.accept(orderId);
                }
            } catch (Exception e) {
                log.warn("[TradeExec] 取消订单失败(可能已成交), id:{}", orderId);
            }
@@ -335,7 +338,7 @@
     *
     * @param orderId 条件单 ID,为 null 时跳过
     */
    public void cancelConditionalOrder(String orderId) {
    public void cancelConditionalOrder(String orderId,Consumer<String> onSuccess) {
        if (orderId == null) {
            return;
        }
@@ -343,6 +346,9 @@
            try {
                futuresApi.cancelPriceTriggeredOrder(SETTLE, Long.parseLong(orderId));
                log.info("[TradeExec] 条件单已取消, id:{}", orderId);
                if (onSuccess != null) {
                    onSuccess.accept(orderId);
                }
            } catch (Exception e) {
                log.warn("[TradeExec] 取消条件单失败(可能已触发), id:{}", orderId);
            }