Administrator
2026-05-19 39a09ebc6400040134f9ed71ec0967e55d579f38
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);
            }