Browse Source

Merge remote-tracking branch 'origin/master'

dos 1 month ago
parent
commit
7e4be79eb1

+ 2 - 2
game-business/src/main/java/com/game/business/config/GameEightConfig.java

@@ -16,7 +16,7 @@ public class GameEightConfig implements CommandLineRunner {
     @Override
     @Async
     public void run(String... args) throws Exception {
-//        webSocketConnent = new WebSocketConnent(Common.WS_GAME_EIGHT_URL, Common.WS_GAME_EIGHT_REMARK_URL, Common.GAME_EIGHT_NAME);
-//        webSocketConnent.connect();
+        webSocketConnent = new WebSocketConnent(Common.WS_GAME_EIGHT_URL, Common.WS_GAME_EIGHT_REMARK_URL, Common.GAME_EIGHT_NAME);
+        webSocketConnent.connect();
     }
 }

+ 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(":");
+            int f = Integer.parseInt(timeArry[0]);
             int m = Integer.parseInt(timeArry[1]);
-            if(m <= 2){
+            if(f == 0 && m <= 2){
                 return HttpRet.fail("游戏已封盘,无法下单。");
             }
 
@@ -181,9 +182,9 @@ public class AppGameBettingController extends BaseController{
                 appGame.getCode().equals(Common.GAME_SIX_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())) {
 
                     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() + "");

+ 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.eq(AppGameLottery::getIsLottery, 1);
-        queryLotteryWrapper.orderByDesc(AppGameLottery::getGameRecordDate);
+        queryLotteryWrapper.orderByDesc(AppGameLottery::getGameDate);
         List<AppGameLottery> list = appGameLotteryService.list(queryLotteryWrapper);
         List<AppGameLotteryVO> resultList = new ArrayList<>();
 

+ 5 - 3
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_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_REMARK_URL = "ws://47.115.59.17:8000/ws";
@@ -62,8 +64,8 @@ public class Common {
     public static final String WS_GAME_SEVEN_URL = "ws://123.207.100.229:8000/ws";
     public static final String WS_GAME_SEVEN_REMARK_URL = "ws://43.138.141.230:8000/ws";
 
-    public static final String WS_GAME_EIGHT_URL = "ws://120.79.41.13:8000/ws";
-    public static final String WS_GAME_EIGHT_REMARK_URL = "ws://120.79.41.13:8000/ws";
+    public static final String WS_GAME_EIGHT_URL = "ws://42.194.224.92:8000/ws";
+    public static final String WS_GAME_EIGHT_REMARK_URL = "ws://159.75.162.156:8000/ws";
 
     public static Map<String, Session> sessionMap = new HashMap<>();
 }

+ 0 - 1
game-business/src/main/resources/mapper/business/AppGameBettingMapper.xml

@@ -49,7 +49,6 @@
           group by game_date
         ) tmp
         left join app_game_lottery agl on agl.game_date = tmp.gameDate and agl.game_id = #{gameId}
-        where agl.is_lottery = 1
         order by tmp.gameDate desc
     </select>