提交
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user