提交
This commit is contained in:
@@ -56,8 +56,14 @@ public class TtRollJackpotOrnamentsServiceImpl extends ServiceImpl<TtRollJackpot
|
|||||||
.list();
|
.list();
|
||||||
BigDecimal total = BigDecimal.ZERO;
|
BigDecimal total = BigDecimal.ZERO;
|
||||||
for (TtRollJackpotOrnaments item : list){
|
for (TtRollJackpotOrnaments item : list){
|
||||||
if (item.getPrice() == null) continue;
|
BigDecimal price = item.getPrice();
|
||||||
total = total.add(item.getPrice().multiply(new BigDecimal(item.getOrnamentsNum())));
|
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)
|
new LambdaUpdateChainWrapper<>(ttRollJackpotMapper)
|
||||||
.eq(TtRollJackpot::getJackpotId,rollJOEdit.getJackpotId())
|
.eq(TtRollJackpot::getJackpotId,rollJOEdit.getJackpotId())
|
||||||
|
|||||||
Reference in New Issue
Block a user