Administrator
2025-12-09 c09fdd652e87ec4a067f7b8ca855de5229c8a9ed
fix(okxNewPrice): 修复买入数量判断逻辑

- 增加对买入数量大于零的校验条件
- 避免买入数量为零或负数时的异常情况
- 确保只有在买入数量有效时才使用该值
- 保持原有逻辑结构不变,仅增强健壮性
1 files modified
2 ■■■ changed files
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/TradeOrderWs.java 2 ●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/TradeOrderWs.java
@@ -32,7 +32,7 @@
        } else if (OrderParamEnums.INIT.getValue().equals(side)) {
            side = OrderParamEnums.BUY.getValue();
            String buyCntNormal = getRedisValue(redisUtils, PositionsWs.POSITIONSWS_CHANNEL, ":buyCnt");
            if (StrUtil.isNotBlank(buyCntNormal)) {
            if (StrUtil.isNotBlank(buyCntNormal) && new BigDecimal(buyCntNormal).compareTo(BigDecimal.ZERO) > 0) {
                buyCnt = buyCntNormal;
            }else{
                buyCnt = getRedisValue(redisUtils, InstrumentsWs.INSTRUMENTSWS_CHANNEL, ":ctVal");