|
@@ -2,7 +2,12 @@ package com.game.business.websocket.client;
|
|
|
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.game.business.config.GameOneConfig;
|
|
|
+import com.game.business.domain.AppGame;
|
|
|
+import com.game.business.domain.AppGameLottery;
|
|
|
+import com.game.business.service.IAppGameLotteryService;
|
|
|
+import com.game.business.service.IAppGameService;
|
|
|
import com.game.business.util.Common;
|
|
|
+import com.game.common.utils.DateUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -13,6 +18,12 @@ import javax.websocket.*;
|
|
|
@ClientEndpoint
|
|
|
public class GameOneClient {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IAppGameLotteryService appGameLotteryService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IAppGameService appGameService;
|
|
|
+
|
|
|
@OnOpen
|
|
|
public void onOpen(Session session) throws Exception{
|
|
|
System.out.printf("game one 游戏已连接 server");
|
|
@@ -60,33 +71,29 @@ public class GameOneClient {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+ Integer isLottery = jsonObject.getInteger("isLottery");
|
|
|
+ if(isLottery == 0){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ AppGame appGame = appGameService.selectAppGameById(0L);
|
|
|
+
|
|
|
+ String gameDate = jsonObject.getString("gameDate");
|
|
|
+ String gameRecordDate = jsonObject.getString("gameRecordDate");
|
|
|
+ String gameLotterySucc = jsonObject.getString("gameLotterySucc");
|
|
|
+
|
|
|
+ AppGameLottery appGameLottery = new AppGameLottery();
|
|
|
+ appGameLottery.setGameId(appGame.getId());
|
|
|
+ appGameLottery.setGameDate(gameDate);
|
|
|
+ appGameLottery.setIsLottery(isLottery);
|
|
|
+ appGameLottery.setGameRecordDate(DateUtils.parseDate(gameRecordDate));
|
|
|
+ appGameLottery.setGameLotterySucc(gameLotterySucc);
|
|
|
+
|
|
|
+ appGameLotteryService.save(appGameLottery);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
System.out.printf("game one 接收数据异常[" + e.getMessage() + "]");
|