|
@@ -79,8 +79,12 @@ public class AppGameItemController extends BaseController
|
|
|
AppGameItem gameItem = list.get(i);
|
|
|
AppGameItemVO appGameItemVO = new AppGameItemVO();
|
|
|
BeanUtils.copyProperties(gameItem, appGameItemVO);
|
|
|
- BigDecimal lotteryCount = new BigDecimal(gameItem.getLotteryCount());
|
|
|
- appGameItemVO.setLotteryRate(lotteryCount.divide(lotteryCountSum).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
|
|
|
+ if(gameItem.getLotteryCount() == null || gameItem.getLotteryCount() == 0){
|
|
|
+ appGameItemVO.setLotteryRate(0.00);
|
|
|
+ }else{
|
|
|
+ BigDecimal lotteryCount = new BigDecimal(gameItem.getLotteryCount());
|
|
|
+ appGameItemVO.setLotteryRate(lotteryCount.divide(lotteryCountSum).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|