|
@@ -158,15 +158,52 @@ public class AppGameBettingController extends BaseController{
|
|
// 每期可投注多少个选项:比如设置为3 则只能投3个不同的选项,不能超过3个
|
|
// 每期可投注多少个选项:比如设置为3 则只能投3个不同的选项,不能超过3个
|
|
Integer bettingCount = appGameBettingService.getBettingCount(gameBetting.getUserId(), gameBetting.getGameId(), appGame.getGameDate(), gameBetting.getBettingItem());
|
|
Integer bettingCount = appGameBettingService.getBettingCount(gameBetting.getUserId(), gameBetting.getGameId(), appGame.getGameDate(), gameBetting.getBettingItem());
|
|
if(bettingCount != null && bettingCount > 0 ){
|
|
if(bettingCount != null && bettingCount > 0 ){
|
|
- if(bettingCount.intValue() >= appGame.getBettingCount().intValue()){
|
|
|
|
|
|
+ if(appGame.getBettingCount().intValue() >= 0 && bettingCount.intValue() >= appGame.getBettingCount().intValue()){
|
|
return HttpRet.fail("当前期投注选项已超过限额,无法下单。");
|
|
return HttpRet.fail("当前期投注选项已超过限额,无法下单。");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 游戏特殊固定下注判断
|
|
|
|
+ if(appGame.getCode().equals(Common.GAME_FOUR_CODE) ||
|
|
|
|
+ appGame.getCode().equals(Common.GAME_SIX_CODE) ||
|
|
|
|
+ appGame.getCode().equals(Common.GAME_SEVEN_CODE)){
|
|
|
|
+
|
|
|
|
+ List<String> itemList = Arrays.asList(Common.GAME_BETTING_ITEM_LIMIT);
|
|
|
|
+
|
|
|
|
+ // 当前投注的是否属于特殊固定选项
|
|
|
|
+ if(itemList.contains(gameBetting.getBettingItem())) {
|
|
|
|
+
|
|
|
|
+ List<String> bettingItemList = appGameBettingService.getBettingItem(gameBetting.getUserId(), gameBetting.getGameId(), appGame.getGameDate());
|
|
|
|
+ if (bettingItemList != null && !bettingItemList.isEmpty()) {
|
|
|
|
+
|
|
|
|
+ List<String> checkItemList = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < itemList.size(); i++) {
|
|
|
|
+ String itemStr = itemList.get(i);
|
|
|
|
+ if (bettingItemList.contains(itemStr)) {
|
|
|
|
+ checkItemList.add(itemStr);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(checkItemList.size() == 4){
|
|
|
|
+ return HttpRet.fail("当前期投注选项已超过限额,无法下单!");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 当前投注是否已经满足3个投注选项了
|
|
|
|
+ if (checkItemList.size() == 3) {
|
|
|
|
+ // 当前投注的是否属于特殊选项重复投注
|
|
|
|
+ if (!checkItemList.contains(gameBetting.getBettingItem())) {
|
|
|
|
+ return HttpRet.fail("当前期投注选项已超过限额,无法下单!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
BigDecimal gameBettingAmountCheck = new BigDecimal(appGame.getBettingMaxMoney() + "");
|
|
BigDecimal gameBettingAmountCheck = new BigDecimal(appGame.getBettingMaxMoney() + "");
|
|
BigDecimal gameBettingAmountSum = appGameBettingService.getBettingAmount(gameBetting.getUserId(), gameBetting.getGameId(), appGame.getGameDate(), null);
|
|
BigDecimal gameBettingAmountSum = appGameBettingService.getBettingAmount(gameBetting.getUserId(), gameBetting.getGameId(), appGame.getGameDate(), null);
|
|
BigDecimal gameBettingAmountAdd = gameBettingAmountSum.add(new BigDecimal(gameBetting.getBettingAmount() + ""));
|
|
BigDecimal gameBettingAmountAdd = gameBettingAmountSum.add(new BigDecimal(gameBetting.getBettingAmount() + ""));
|
|
- if(gameBettingAmountAdd.compareTo(gameBettingAmountCheck) == 1){
|
|
|
|
|
|
+ if(appGame.getBettingMaxMoney() >= 0 && gameBettingAmountAdd.compareTo(gameBettingAmountCheck) == 1){
|
|
return HttpRet.fail("当前期投注金额已超过限额,无法下单。");
|
|
return HttpRet.fail("当前期投注金额已超过限额,无法下单。");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -188,7 +225,7 @@ public class AppGameBettingController extends BaseController{
|
|
|
|
|
|
Integer bettingItemCount = appGameBettingService.getBettingItemCount(gameBetting.getUserId(), gameBetting.getGameId(), appGame.getGameDate(), gameBetting.getBettingItem());
|
|
Integer bettingItemCount = appGameBettingService.getBettingItemCount(gameBetting.getUserId(), gameBetting.getGameId(), appGame.getGameDate(), gameBetting.getBettingItem());
|
|
if(bettingItemCount != null && bettingItemCount > 0 ){
|
|
if(bettingItemCount != null && bettingItemCount > 0 ){
|
|
- if(bettingItemCount.intValue() >= appGameItem.getBettingCount().intValue()){
|
|
|
|
|
|
+ if(appGameItem.getBettingCount().intValue() >= 0 && bettingItemCount.intValue() >= appGameItem.getBettingCount().intValue()){
|
|
return HttpRet.fail("当前期投注选项数量已超过限额,无法下单。");
|
|
return HttpRet.fail("当前期投注选项数量已超过限额,无法下单。");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -196,7 +233,7 @@ public class AppGameBettingController extends BaseController{
|
|
BigDecimal bettingAmountCheck = new BigDecimal(appGameItem.getBettingMoney() + "");
|
|
BigDecimal bettingAmountCheck = new BigDecimal(appGameItem.getBettingMoney() + "");
|
|
BigDecimal bettingAmountSum = appGameBettingService.getBettingAmount(gameBetting.getUserId(), gameBetting.getGameId(), appGame.getGameDate(), gameBetting.getBettingItem());
|
|
BigDecimal bettingAmountSum = appGameBettingService.getBettingAmount(gameBetting.getUserId(), gameBetting.getGameId(), appGame.getGameDate(), gameBetting.getBettingItem());
|
|
BigDecimal bettingAmountAdd = bettingAmountSum.add(new BigDecimal(gameBetting.getBettingAmount() + ""));
|
|
BigDecimal bettingAmountAdd = bettingAmountSum.add(new BigDecimal(gameBetting.getBettingAmount() + ""));
|
|
- if(bettingAmountAdd.compareTo(bettingAmountCheck) == 1){
|
|
|
|
|
|
+ if(appGameItem.getBettingMoney() >= 0 && bettingAmountAdd.compareTo(bettingAmountCheck) == 1){
|
|
return HttpRet.fail("当前期选项投注金额已超过限额,无法下单。");
|
|
return HttpRet.fail("当前期选项投注金额已超过限额,无法下单。");
|
|
}
|
|
}
|
|
|
|
|