fix(mall): 修复 V3 数值计算逻辑
- 增加对 V1 和 V2 数值大小的判断,确保随机生成的 V3 数值在合理范围内
- 当 V1 <=V2 时,调整随机数生成的上界为 V2+1,避免潜在的无限循环问题
| | |
| | | BigDecimal V3 = BigDecimal.ZERO; |
| | | if (flag) { |
| | | V2 = V1.divide(new BigDecimal("2"), 0, RoundingMode.DOWN); |
| | | V3 = new BigDecimal(RandomUtil.randomInt(V2.intValue(),V1.intValue())).setScale(0,RoundingMode.DOWN); |
| | | if(V1.intValue() <= V2.intValue()){ |
| | | V3 = new BigDecimal(RandomUtil.randomInt(V1.intValue(),V2.intValue()+1)).setScale(0,RoundingMode.DOWN); |
| | | }else{ |
| | | V3 = new BigDecimal(RandomUtil.randomInt(V2.intValue(),V1.intValue())).setScale(0,RoundingMode.DOWN); |
| | | } |
| | | }else{ |
| | | List<MallMoneyFlow> mallMoneyFlows = mallMoneyFlowMapper.selectList( |
| | | new LambdaQueryWrapper<MallMoneyFlow>() |