ソースを参照

修改代码生成

kk 8 ヶ月 前
コミット
47526774c5

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

@@ -1,5 +1,6 @@
 package com.game.business.controller;
 package com.game.business.controller;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.game.business.domain.*;
 import com.game.business.domain.*;
 import com.game.business.service.*;
 import com.game.business.service.*;
 import com.game.common.core.controller.BaseController;
 import com.game.common.core.controller.BaseController;
@@ -34,6 +35,9 @@ public class AppGameBettingController extends BaseController{
     @Autowired
     @Autowired
     private IFinTranRecordService finTranRecordService;
     private IFinTranRecordService finTranRecordService;
 
 
+    @Autowired
+    private IAppGameLotteryService appGameLotteryService;
+
     /**
     /**
      * 下注
      * 下注
      */
      */
@@ -74,10 +78,20 @@ public class AppGameBettingController extends BaseController{
         String[] timeArry = appGame.getGameTime().substring(0, 4).split(":");
         String[] timeArry = appGame.getGameTime().substring(0, 4).split(":");
         int m = Integer.parseInt(timeArry[1]);
         int m = Integer.parseInt(timeArry[1]);
 
 
-        if(m <= 3){
+        if(m <= 10){
             return error("游戏已封盘,无法下单。");
             return error("游戏已封盘,无法下单。");
         }
         }
 
 
+        LambdaQueryWrapper<AppGameLottery> queryLotteryWrapper = new LambdaQueryWrapper<>();
+        queryLotteryWrapper.eq(AppGameLottery::getClassId, appGame.getClassifyId());
+        queryLotteryWrapper.eq(AppGameLottery::getGameId, appGame.getId());
+        queryLotteryWrapper.eq(AppGameLottery::getGameDate, appGame.getGameDate());
+        long count = appGameLotteryService.count(queryLotteryWrapper);
+
+        if(count > 0){
+            return error("游戏已开奖,无法下单。");
+        }
+
         synchronized (this){
         synchronized (this){
 
 
             AppUser appUser = appUserService.getById(gameBetting.getUserId());
             AppUser appUser = appUserService.getById(gameBetting.getUserId());

+ 6 - 0
game-business/src/main/java/com/game/business/domain/AppGameLottery.java

@@ -19,6 +19,12 @@ public class AppGameLottery {
     @Excel(name = "游戏开奖Id", cellType = Excel.ColumnType.NUMERIC, prompt = "游戏开奖Id")
     @Excel(name = "游戏开奖Id", cellType = Excel.ColumnType.NUMERIC, prompt = "游戏开奖Id")
     private Long id;
     private Long id;
 
 
+
+    @Excel(name = "游戏类型Id")
+    @TableField(value = "class_id")
+    @ApiModelProperty(value = "游戏类型Id")
+    private Long classId;
+
     @Excel(name = "游戏Id")
     @Excel(name = "游戏Id")
     @TableField(value = "game_id")
     @TableField(value = "game_id")
     @ApiModelProperty(value = "游戏Id")
     @ApiModelProperty(value = "游戏Id")

+ 18 - 7
game-business/src/main/java/com/game/business/websocket/client/GameOneClient.java

@@ -113,13 +113,6 @@ public class GameOneClient {
                     return;
                     return;
                 }
                 }
 
 
-                LambdaQueryWrapper<AppGameClassify> queryWrapper = new LambdaQueryWrapper<>();
-                queryWrapper.eq(AppGameClassify::getCode, classCode);
-                AppGameClassify appGameClassify = appGameClassifyService.getOne(queryWrapper);
-                if(appGameClassify == null){
-                    System.out.println("开奖游戏平台不存在:" + classCode);
-                }
-
                 if(gameDataArry == null){
                 if(gameDataArry == null){
                     System.out.println("游戏socket推送倒计时,data对象为空。");
                     System.out.println("游戏socket推送倒计时,data对象为空。");
                     return;
                     return;
@@ -130,6 +123,13 @@ public class GameOneClient {
                     return;
                     return;
                 }
                 }
 
 
+                LambdaQueryWrapper<AppGameClassify> queryWrapper = new LambdaQueryWrapper<>();
+                queryWrapper.eq(AppGameClassify::getCode, classCode);
+                AppGameClassify appGameClassify = appGameClassifyService.getOne(queryWrapper);
+                if(appGameClassify == null){
+                    System.out.println("开奖游戏平台不存在:" + classCode);
+                }
+
                 for (int i = 0; i < gameDataArry.size(); i++) {
                 for (int i = 0; i < gameDataArry.size(); i++) {
                     JSONObject jsonObject = gameDataArry.getJSONObject(i);
                     JSONObject jsonObject = gameDataArry.getJSONObject(i);
                     String gameCode = jsonObject.getString("id");
                     String gameCode = jsonObject.getString("id");
@@ -214,6 +214,17 @@ public class GameOneClient {
                     continue;
                     continue;
                 }
                 }
 
 
+                LambdaQueryWrapper<AppGameLottery> queryLotteryWrapper = new LambdaQueryWrapper<>();
+                queryLotteryWrapper.eq(AppGameLottery::getClassId, appGame.getClassifyId());
+                queryLotteryWrapper.eq(AppGameLottery::getGameId, appGame.getId());
+                queryLotteryWrapper.eq(AppGameLottery::getGameDate, gameDate);
+                long count = appGameLotteryService.count(queryLotteryWrapper);
+
+                if(count > 0){
+                    System.out.println("游戏socket推送开奖,当前期已开过将,游戏编码:" + gameCode + ",期号:" + gameDate);
+                    continue;
+                }
+
                 Integer isLottery = gameLotteryObject.getInteger("isLottery");
                 Integer isLottery = gameLotteryObject.getInteger("isLottery");
                 String gameLotterySucc = gameLotteryObject.getString("gameLotterySucc");
                 String gameLotterySucc = gameLotteryObject.getString("gameLotterySucc");