fix(okxNewPrice): 修复买入数量判断逻辑
- 增加对买入数量大于零的校验条件
- 避免买入数量为零或负数时的异常情况
- 确保只有在买入数量有效时才使用该值
- 保持原有逻辑结构不变,仅增强健壮性
| | |
| | | } 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"); |