fix(mall): 修复会员权益收益计算逻辑
- 修复了 V1 和 V2 相等时随机数生成的问题
-增加了 V1 大于 V2 时的处理逻辑
- 优化了随机数生成的逻辑,确保在所有情况下都能正确计算收益
| | |
| | | }else{ |
| | | V2 = V1.multiply(new BigDecimal("2")).setScale(0,RoundingMode.DOWN); |
| | | } |
| | | V3 = new BigDecimal(RandomUtil.randomInt(V1.intValue(),V2.intValue())).setScale(0,RoundingMode.DOWN); |
| | | if(V1.intValue() < V2.intValue()){ |
| | | V3 = new BigDecimal(RandomUtil.randomInt(V1.intValue(),V2.intValue())).setScale(0,RoundingMode.DOWN); |
| | | }else 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); |
| | | } |
| | | } |
| | | //会员权益的收益 |
| | | RunVipGrow runVipGrow = runVipGrowMapper.selectList( |