Administrator
2025-12-13 8f69c8ca01f4be5de360f53a95837a97e7ba7e91
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/TradeOrderWs.java
@@ -48,7 +48,9 @@
            buyCnt = InstrumentsWs.INSTRUMENTSWSMAP.get(CoinEnums.BUY_CNT.name());
        }else if (OrderParamEnums.BUY.getValue().equals(side)){
            log.info("当前状态为加仓");
            buyCnt = InstrumentsWs.INSTRUMENTSWSMAP.get(CoinEnums.BUY_CNT.name());
            String buyCntTime = TRADEORDERWSMAP.get("buyCntTime");
            String buyCntStr = InstrumentsWs.INSTRUMENTSWSMAP.get(CoinEnums.BUY_CNT.name());
            buyCnt = String.valueOf(new BigDecimal(buyCntTime).multiply(new BigDecimal(buyCntStr)));
        }else if (OrderParamEnums.SELL.getValue().equals(side)){
            log.info("当前状态为减仓");
            buyCnt = String.valueOf(PositionsWs.POSITIONSWSMAP.get("pos"));
@@ -80,10 +82,18 @@
            webSocketClient.send(jsonObject.toJSONString());
            log.info("发送下单频道:{},数量:{}", side, buyCnt);
            WsMapBuild.saveStringToMap(TRADEORDERWSMAP, "clOrdId", connId);
            WsMapBuild.saveStringToMap(TRADEORDERWSMAP, "buyCntTime",String.valueOf(BigDecimal.ONE));
            WsMapBuild.saveStringToMap(TRADEORDERWSMAP, "clOrdId", clOrdId);
            WsMapBuild.saveStringToMap(TRADEORDERWSMAP, "state", CoinEnums.ORDER_FILLED.getCode());
            WsMapBuild.saveStringToMap(InstrumentsWs.INSTRUMENTSWSMAP, CoinEnums.STATE.name(), OrderParamEnums.STATE_4.getValue());
            if (OrderParamEnums.SELL.getValue().equals(side)){
                WsMapBuild.saveBigDecimalToMap(PositionsWs.POSITIONSWSMAP, "pos", BigDecimal.ZERO);
            }
            if (OrderParamEnums.BUY.getValue().equals(side)){
                WsMapBuild.saveBigDecimalToMap(PositionsWs.POSITIONSWSMAP, "pos", new BigDecimal(buyCnt));
            }
        } catch (Exception e) {
            log.error("下单构建失败", e);