Parcourir la source

游戏选项排序

kk il y a 2 mois
Parent
commit
11179f41c6

+ 14 - 11
game-business/src/main/java/com/game/business/task/AppGameBettingTask.java

@@ -314,17 +314,20 @@ public class AppGameBettingTask {
 
                 try {
 
-                    appGame.setGameDate(gameDate);
-                    appGameService.updateAppGame(appGame);
-
-                    AppGameLottery appGameLottery = new AppGameLottery();
-                    appGameLottery.setGameId(appGame.getId());
-                    appGameLottery.setClassId(appGame.getClassifyId());
-                    appGameLottery.setGameDate(gameDate);
-                    appGameLottery.setIsLottery(0);
-                    appGameLottery.setGameRecordDate(new Date());
-                    appGameLotteryService.save(appGameLottery);
-
+                    AppGameLottery appGameLottery = appGameLotteryService.selectLottery(appGame.getClassifyId(), appGame.getId(), gameDate);
+
+                    if(appGameLottery == null){
+                        appGame.setGameDate(gameDate);
+                        appGameService.updateAppGame(appGame);
+
+                        appGameLottery = new AppGameLottery();
+                        appGameLottery.setGameId(appGame.getId());
+                        appGameLottery.setClassId(appGame.getClassifyId());
+                        appGameLottery.setGameDate(gameDate);
+                        appGameLottery.setIsLottery(0);
+                        appGameLottery.setGameRecordDate(new Date());
+                        appGameLotteryService.save(appGameLottery);
+                    }
                 }catch (Exception e){
                     e.printStackTrace();
                 }finally {