|
@@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -117,8 +118,12 @@ public class AppGameBettingController extends BaseController{
|
|
|
return HttpRet.fail("游戏已封盘,无法下单。");
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ Integer bettingCount = appGameBettingService.getBettingCount(gameBetting.getUserId(), gameBetting.getGameId(), gameBetting.getGameDate());
|
|
|
+
|
|
|
// 单选
|
|
|
if(gameBetting.getBettingGameType() == 0){
|
|
|
+
|
|
|
AppGameItem appGameItem = appGameItemService.selectAppGameItemByGameIdAndItemLocation(appGame.getId(), gameBetting.getBettingItem());
|
|
|
if(appGameItem == null){
|
|
|
return HttpRet.fail("游戏选项不存在,无法下单。");
|
|
@@ -132,6 +137,13 @@ public class AppGameBettingController extends BaseController{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ BigDecimal bettingAmountCheck = new BigDecimal("0");
|
|
|
+ BigDecimal bettingAmountSum = appGameBettingService.getBettingAmount(gameBetting.getUserId(), gameBetting.getGameId(), gameBetting.getGameDate(), gameBetting.getBettingItem());
|
|
|
+ BigDecimal bettingAmountAdd = bettingAmountSum.add(new BigDecimal(gameBetting.getBettingAmount() + ""));
|
|
|
+ if(bettingAmountAdd.compareTo(bettingAmountCheck) == 1){
|
|
|
+ return HttpRet.fail("游戏选项当前期投注金额已超过限额,无法下单。");
|
|
|
+ }
|
|
|
+
|
|
|
gameBetting.setBettingMultiple(appGameItem.getItemMultiple());
|
|
|
// 多选
|
|
|
}else if(gameBetting.getBettingGameType() == 1 || gameBetting.getBettingGameType() == 2){
|