Administrator
2026-06-10 c0d48978e8dceeb15c5dedc5109b36a9a064d038
src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java
@@ -543,12 +543,14 @@
        }
        GridElement longStopLossElem = GridElement.findByLongStopLossOrderId(orderId);
        if (longStopLossElem != null && longPositionSize.compareTo(BigDecimal.ZERO) > 0 && StrUtil.isNotEmpty(tradeId) && !tradeId.equals("0")) {
//        if (longStopLossElem != null && longPositionSize.compareTo(BigDecimal.ZERO) > 0 && StrUtil.isNotEmpty(tradeId) && !tradeId.equals("0")) {
        if (longStopLossElem != null && StrUtil.isNotEmpty(tradeId) && !tradeId.equals("0")) {
            handleLongStopLossTriggered(longStopLossElem);
            return;
        }
        GridElement shortStopLossElem = GridElement.findByShortStopLossOrderId(orderId);
        if (shortStopLossElem != null && shortPositionSize.compareTo(BigDecimal.ZERO) > 0 && StrUtil.isNotEmpty(tradeId) && !tradeId.equals("0")) {
//        if (shortStopLossElem != null && shortPositionSize.compareTo(BigDecimal.ZERO) > 0 && StrUtil.isNotEmpty(tradeId) && !tradeId.equals("0")) {
        if (shortStopLossElem != null && StrUtil.isNotEmpty(tradeId) && !tradeId.equals("0")) {
            handleShortStopLossTriggered(shortStopLossElem);
            return;
        }
@@ -856,6 +858,7 @@
            GridElement matchedUpGridElement = GridElement.findByPrice(matched);
            if (matchedUpGridElement != null){
                if (!matchedUpGridElement.isHasLongOrder()){
                Integer upId = matchedUpGridElement.getUpId();
                GridElement newEntryGrid = GridElement.findById(upId);
@@ -881,6 +884,7 @@
                }
            }
        }
        }
    }
@@ -902,6 +906,7 @@
            GridElement matchedUpGridElement = GridElement.findByPrice(matched);
            if (matchedUpGridElement != null){
                if(!matchedUpGridElement.isHasShortOrder()){
                Integer downId = matchedUpGridElement.getDownId();
                GridElement newEntryGrid = GridElement.findById(downId);
@@ -932,6 +937,7 @@
            }
        }
    }
    }
    private void handleLongStopLossTriggered(GridElement gridElement) {
        gridElement.setLongStopLossOrderId(null);