Browse Source

游戏修复

kk 1 month ago
parent
commit
2465fa710b

+ 62 - 3
game-business/src/main/java/com/game/business/controller/AppGameBettingController.java

@@ -159,8 +159,9 @@ public class AppGameBettingController extends BaseController{
             }
             }
 
 
             String[] timeArry = appGame.getGameTime().substring(0, 5).split(":");
             String[] timeArry = appGame.getGameTime().substring(0, 5).split(":");
+            int f = Integer.parseInt(timeArry[0]);
             int m = Integer.parseInt(timeArry[1]);
             int m = Integer.parseInt(timeArry[1]);
-            if(m <= 2){
+            if(f == 0 && m <= 2){
                 return HttpRet.fail("游戏已封盘,无法下单。");
                 return HttpRet.fail("游戏已封盘,无法下单。");
             }
             }
 
 
@@ -181,9 +182,9 @@ public class AppGameBettingController extends BaseController{
                 appGame.getCode().equals(Common.GAME_SIX_CODE) ||
                 appGame.getCode().equals(Common.GAME_SIX_CODE) ||
                 appGame.getCode().equals(Common.GAME_SEVEN_CODE)){
                 appGame.getCode().equals(Common.GAME_SEVEN_CODE)){
 
 
-                List<String> itemList = Arrays.asList(Common.GAME_BETTING_ITEM_LIMIT);
+                List<String> itemList = Arrays.asList(Common.GAME_BETTING_ITEM_SMALL_LIMIT);
 
 
-                // 当前投注的是否属于特殊固定选项
+                //  当前投注是否属于小倍
                 if(itemList.contains(gameBetting.getBettingItem())) {
                 if(itemList.contains(gameBetting.getBettingItem())) {
 
 
                     List<String> bettingItemList = appGameBettingService.getBettingItem(gameBetting.getUserId(), gameBetting.getGameId(), appGame.getGameDate());
                     List<String> bettingItemList = appGameBettingService.getBettingItem(gameBetting.getUserId(), gameBetting.getGameId(), appGame.getGameDate());
@@ -211,6 +212,64 @@ public class AppGameBettingController extends BaseController{
                         }
                         }
                     }
                     }
                 }
                 }
+            }else if(appGame.getCode().equals(Common.GAME_EIGHT_CODE)){
+
+                List<String> itemSmallList = Arrays.asList(Common.GAME_BETTING_ITEM_SMALL_LIMIT);
+
+                List<String> itemBigList = Arrays.asList(Common.GAME_BETTING_ITEM_SMALL_LIMIT);
+
+                List<String> bettingItemList = appGameBettingService.getBettingItem(gameBetting.getUserId(), gameBetting.getGameId(), appGame.getGameDate());
+
+                if (bettingItemList != null && !bettingItemList.isEmpty()) {
+
+                    // 当前投注是否属于小倍
+                    if(itemSmallList.contains(gameBetting.getBettingItem())) {
+
+                        List<String> checkItemList = new ArrayList<>();
+
+                        for (int i = 0; i < itemSmallList.size(); i++) {
+                            String itemStr = itemSmallList.get(i);
+                            if (bettingItemList.contains(itemStr)) {
+                                checkItemList.add(itemStr);
+                            }
+                        }
+
+                        if(checkItemList.size() >= 3){
+                            return HttpRet.fail("当前期投注选项已超过限额,无法下单!");
+                        }
+
+                        // 当前投注是否已经满足3个投注选项了
+                        if (checkItemList.size() == 2) {
+                            // 当前投注的是否属于特殊选项重复投注
+                            if (!checkItemList.contains(gameBetting.getBettingItem())) {
+                                return HttpRet.fail("当前期投注选项已超过限额,无法下单!");
+                            }
+                        }
+                    // 当前投注是否属于大倍
+                    }else if(itemBigList.contains(gameBetting.getBettingItem())) {
+
+                        List<String> checkItemList = new ArrayList<>();
+
+                        for (int i = 0; i < itemSmallList.size(); i++) {
+                            String itemStr = itemSmallList.get(i);
+                            if (bettingItemList.contains(itemStr)) {
+                                checkItemList.add(itemStr);
+                            }
+                        }
+
+                        if(checkItemList.size() >= 3){
+                            return HttpRet.fail("当前期投注选项已超过限额,无法下单!");
+                        }
+
+                        // 当前投注是否已经满足3个投注选项了
+                        if (checkItemList.size() == 2) {
+                            // 当前投注的是否属于特殊选项重复投注
+                            if (!checkItemList.contains(gameBetting.getBettingItem())) {
+                                return HttpRet.fail("当前期投注选项已超过限额,无法下单!");
+                            }
+                        }
+                    }
+                }
             }
             }
 
 
             BigDecimal gameBettingAmountCheck = new BigDecimal(appGame.getBettingMaxMoney() + "");
             BigDecimal gameBettingAmountCheck = new BigDecimal(appGame.getBettingMaxMoney() + "");

+ 1 - 1
game-business/src/main/java/com/game/business/controller/AppGameLotteryController.java

@@ -72,7 +72,7 @@ public class AppGameLotteryController extends BaseController{
             queryLotteryWrapper.between(AppGameLottery::getGameRecordDate, strDate + " 00:00:00", strDate + " 23:59:59");
             queryLotteryWrapper.between(AppGameLottery::getGameRecordDate, strDate + " 00:00:00", strDate + " 23:59:59");
         }
         }
         queryLotteryWrapper.eq(AppGameLottery::getIsLottery, 1);
         queryLotteryWrapper.eq(AppGameLottery::getIsLottery, 1);
-        queryLotteryWrapper.orderByDesc(AppGameLottery::getGameRecordDate);
+        queryLotteryWrapper.orderByDesc(AppGameLottery::getGameDate);
         List<AppGameLottery> list = appGameLotteryService.list(queryLotteryWrapper);
         List<AppGameLottery> list = appGameLotteryService.list(queryLotteryWrapper);
         List<AppGameLotteryVO> resultList = new ArrayList<>();
         List<AppGameLotteryVO> resultList = new ArrayList<>();
 
 

+ 3 - 1
game-business/src/main/java/com/game/business/util/Common.java

@@ -27,7 +27,9 @@ public class Common {
     public static final String GAME_EIGHT_CODE = "8";
     public static final String GAME_EIGHT_CODE = "8";
 
 
 
 
-    public static final String [] GAME_BETTING_ITEM_LIMIT = {"0","1","6","7"};
+    public static final String [] GAME_BETTING_ITEM_SMALL_LIMIT = {"0","1","6","7"};
+
+    public static final String [] GAME_BETTING_ITEM_BIG_LIMIT = {"2","3","4","5"};
 
 
 //    public static final String WS_GAME_ONE_URL = "ws://47.115.59.17:8000/ws";
 //    public static final String WS_GAME_ONE_URL = "ws://47.115.59.17:8000/ws";
 //    public static final String WS_GAME_ONE_REMARK_URL = "ws://47.115.59.17:8000/ws";
 //    public static final String WS_GAME_ONE_REMARK_URL = "ws://47.115.59.17:8000/ws";