From ae9bfd2d66f68a553786ac78b12f4390e65e4e09 Mon Sep 17 00:00:00 2001
From: 44323 <443237572@qq.com>
Date: 星期五, 24 十一月 2023 18:30:18 +0800
Subject: [PATCH] 后台bug修改

---
 cloud-server-other/src/main/java/com/dsh/other/controller/BallController.java |   76 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 74 insertions(+), 2 deletions(-)

diff --git a/cloud-server-other/src/main/java/com/dsh/other/controller/BallController.java b/cloud-server-other/src/main/java/com/dsh/other/controller/BallController.java
index b11550b..979aa00 100644
--- a/cloud-server-other/src/main/java/com/dsh/other/controller/BallController.java
+++ b/cloud-server-other/src/main/java/com/dsh/other/controller/BallController.java
@@ -5,12 +5,12 @@
 import com.dsh.other.feignclient.model.AdvertisementChangeStateDTO;
 import com.dsh.other.feignclient.model.AdvertisementQuery;
 import com.dsh.other.model.BannerVo;
-import com.dsh.other.service.GameService;
-import com.dsh.other.service.IBannerService;
+import com.dsh.other.service.*;
 import com.dsh.other.util.ResultUtil;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
+import io.swagger.models.auth.In;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -18,6 +18,8 @@
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * @author zhibing.pu
@@ -28,6 +30,8 @@
 public class BallController {
     @Autowired
     private GameService gameService;
+    @Autowired
+    private TGameRecordService gameRecordService;
 
     @ResponseBody
     @PostMapping("/student/webStudentList")
@@ -35,6 +39,74 @@
         List<Game> games =   gameService.queryAll(ballQueryDto);
         return games;
     }
+    // 根据门店ids 获取游戏记录
+    @ResponseBody
+    @PostMapping("/game/getGameByStoreIds")
+    public List<Integer> getGameByStoreIds(@RequestBody List<Integer> storeIds){
+        // 游戏id
+        List<Integer> gamesId = gameService.list(new QueryWrapper<Game>().in("storeId", storeIds))
+                .stream().map(Game::getId).collect(Collectors.toList());
+        if (gamesId.size() == 0){
+            return new ArrayList<>();
+        }else{
+            // 根据游戏id获取游戏记录 获取用户Ids
+            List<Integer> userId = gameRecordService.list(new QueryWrapper<TGameRecord>().in("gameId", gamesId))
+                    .stream().map(TGameRecord::getUserId).collect(Collectors.toList());
+            return userId;
+        }
+
+
+    }
+
+    @Autowired
+    private IRegionService regionService;
+
+    @ResponseBody
+    @PostMapping("/save")
+    public Integer save(@RequestBody Game game){
+
+
+        if (game.getCityCode()!=null) {
+            Region city = regionService.getOne(new QueryWrapper<Region>().eq("code", game.getCityCode()));
+            game.setCity(city.getName());
+
+
+            Region province = regionService.getOne(new QueryWrapper<Region>().eq("code", game.getProvinceCode()));
+            game.setProvince(province.getName());
+
+        }
+
+
+        gameService.saveOrUpdate(game);
+         System.out.println("==========="+game);
+         return  game.getId();
+    }
+    @Autowired
+    private TGameConfigService config;
+
+
+    @ResponseBody
+    @PostMapping("/saveConfig")
+    public void saveConfig(@RequestBody List<TGameConfig> gameConfigList){
+        System.out.println("=======gameConfigList===="+gameConfigList);
+        config.saveOrUpdateBatch(gameConfigList);
+//        return  game.getId();
+    }
+
+    @ResponseBody
+    @PostMapping("/queryGame")
+    public Game queryGame(@RequestParam Integer id){
+       return gameService.getById(id);
+//        return  game.getId();
+    }
+
+    @ResponseBody
+    @PostMapping("/listorder")
+    public List<Map<String, Object>>  listorder(@RequestBody BookingQuery bookingQuery){
+        System.out.println("===bookingQuery===="+bookingQuery);
+        return gameService.orderlist(bookingQuery);
+//        return  game.getId();
+    }
 
 
 

--
Gitblit v1.7.1