|
@@ -62,13 +62,15 @@ public class AppGameBettingTask {
|
|
|
|
|
|
if(type == 1){
|
|
|
|
|
|
- JSONArray gameDataArry = null;
|
|
|
+
|
|
|
+ String gameCode = null;
|
|
|
String time = null;
|
|
|
String classCode = null;
|
|
|
for (int i = 0; i < dataArry.size(); i++) {
|
|
|
JSONObject jsonObject = dataArry.getJSONObject(i);
|
|
|
if(jsonObject.containsKey("data")){
|
|
|
- gameDataArry = jsonObject.getJSONArray("data");
|
|
|
+
|
|
|
+ gameCode = jsonObject.getString("id");
|
|
|
}
|
|
|
if(jsonObject.containsKey("time")){
|
|
|
time = jsonObject.getString("time");
|
|
@@ -83,7 +85,7 @@ public class AppGameBettingTask {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if(gameDataArry == null){
|
|
|
+ if(gameCode == null){
|
|
|
|
|
|
return;
|
|
|
}
|
|
@@ -106,24 +108,16 @@ public class AppGameBettingTask {
|
|
|
}
|
|
|
Map<String, List<AppGame>> codeGameMap = appGameList.stream().collect(Collectors.groupingBy(AppGame::getCode));
|
|
|
|
|
|
- for (int i = 0; i < gameDataArry.size(); i++) {
|
|
|
- JSONObject jsonObject = gameDataArry.getJSONObject(i);
|
|
|
- String gameCode = jsonObject.getString("id");
|
|
|
- if(gameCode == null){
|
|
|
-
|
|
|
- continue;
|
|
|
- }
|
|
|
- if(!gameCodeFinal.equals(gameCode)){
|
|
|
- continue;
|
|
|
- }
|
|
|
- if(!codeGameMap.containsKey(gameCode)){
|
|
|
+ if(!gameCodeFinal.equals(gameCode)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(!codeGameMap.containsKey(gameCode)){
|
|
|
|
|
|
- continue;
|
|
|
- }
|
|
|
- AppGame appGame = codeGameMap.get(gameCode).get(0);
|
|
|
- appGame.setGameTime(time);
|
|
|
- appGameService.updateAppGame(appGame);
|
|
|
+ return;
|
|
|
}
|
|
|
+ AppGame appGame = codeGameMap.get(gameCode).get(0);
|
|
|
+ appGame.setGameTime(time);
|
|
|
+ appGameService.updateAppGame(appGame);
|
|
|
return;
|
|
|
}
|
|
|
|