From 9486766c806fe1d9e082b2fd02ea1cc558f1b443 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期四, 08 五月 2025 09:21:57 +0800
Subject: [PATCH] bug修改

---
 cloud-server-other/src/main/java/com/dsh/other/controller/BallController.java |   39 +++++++++++++++++++++++++++++++++++++--
 1 files changed, 37 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 5a5c359..84b2775 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
@@ -1,5 +1,6 @@
 package com.dsh.other.controller;
 
+import com.alibaba.nacos.api.config.filter.IFilterConfig;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.dsh.other.entity.*;
 import com.dsh.other.feignclient.model.AdvertisementChangeStateDTO;
@@ -12,10 +13,12 @@
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.models.auth.In;
+import org.omg.CORBA.PUBLIC_MEMBER;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.print.DocFlavor;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -33,6 +36,8 @@
     private GameService gameService;
     @Autowired
     private TGameRecordService gameRecordService;
+    @Autowired
+    private ISiteService siteService;
 
     // 数据统计
     @ResponseBody
@@ -82,7 +87,8 @@
             return new ArrayList<>();
         } else {
             // 根据游戏id获取游戏记录 获取用户Ids
-            List<Integer> userId = gameRecordService.list(new QueryWrapper<TGameRecord>().in("gameId", gamesId))
+            List<Integer> userId = gameRecordService.list(new QueryWrapper<TGameRecord>().in("gameId", gamesId)
+                            .eq("status",1))
                     .stream().map(TGameRecord::getUserId).collect(Collectors.toList());
             return userId;
         }
@@ -132,7 +138,36 @@
         return gameService.getById(id);
 //        return  game.getId();
     }
-
+    @ResponseBody
+    @PostMapping("/getSiteList")
+    // 查询未配置智慧球场的场地 智慧球场添加使用
+    public List<Site> getSiteList(@RequestParam("storeId") Integer storeId){
+        List<Integer> collect = gameService.list().stream().map(Game::getSiteId).collect(Collectors.toList());
+        if (collect.size() == 0 ){
+            collect.add(-1);
+        }
+        List<Site> list = siteService.list(new QueryWrapper<Site>().select("id","name")
+                .eq("storeId", storeId)
+                .eq("state", 1)
+                .notIn("id",collect)
+        );
+        return list;
+    }
+    // 查询未配置智慧球场的场地 包含当前配置的场地 智慧球场编辑使用
+    @ResponseBody
+    @PostMapping("/getSiteList1")
+    public List<Site> getSiteList1(@RequestParam Integer id) {
+        Game game = gameService.getById(id);
+        List<Integer> collect = gameService.list().stream().map(Game::getSiteId).collect(Collectors.toList());
+        Site byId = siteService.getById(game.getSiteId());
+        List<Site> list = siteService.list(new QueryWrapper<Site>().select("id","name")
+                .eq("state", 1)
+                .eq("storeId",game.getStoreId())
+                .notIn("id",collect)
+        );
+        list.add(byId);
+        return list;
+    }
     @ResponseBody
     @PostMapping("/listorder")
     public List<Map<String, Object>> listorder(@RequestBody BookingQuery bookingQuery) {

--
Gitblit v1.7.1