This commit is contained in:
2026-04-28 14:08:15 +08:00
parent ba32423fcf
commit 8a48e474a1

View File

@@ -56,8 +56,14 @@ public class TtRollJackpotOrnamentsServiceImpl extends ServiceImpl<TtRollJackpot
.list();
BigDecimal total = BigDecimal.ZERO;
for (TtRollJackpotOrnaments item : list){
if (item.getPrice() == null) continue;
total = total.add(item.getPrice().multiply(new BigDecimal(item.getOrnamentsNum())));
BigDecimal price = item.getPrice();
if (price == null) {
// price 为 null 时,关联查询 tt_ornament 表用 use_price 兼容旧数据
TtOrnament ornament = ttOrnamentMapper.selectById(item.getOrnamentsId());
price = (ornament != null && ornament.getUsePrice() != null)
? ornament.getUsePrice() : BigDecimal.ZERO;
}
total = total.add(price.multiply(new BigDecimal(item.getOrnamentsNum())));
}
new LambdaUpdateChainWrapper<>(ttRollJackpotMapper)
.eq(TtRollJackpot::getJackpotId,rollJOEdit.getJackpotId())