puzhibing
2024-02-05 640ff18d2d7f4be02ddb7f8f75e899f05545eb98
cloud-server-other/src/main/java/com/dsh/other/controller/BallController.java
@@ -5,6 +5,7 @@
import com.dsh.other.feignclient.model.AdvertisementChangeStateDTO;
import com.dsh.other.feignclient.model.AdvertisementQuery;
import com.dsh.other.model.BannerVo;
import com.dsh.other.model.dto.siteDto.GameDataQuery;
import com.dsh.other.service.*;
import com.dsh.other.util.ResultUtil;
import io.swagger.annotations.ApiImplicitParam;
@@ -32,6 +33,36 @@
    private GameService gameService;
    @Autowired
    private TGameRecordService gameRecordService;
    // 数据统计
    @ResponseBody
    @PostMapping("/student/getData")
    public List<TGameRecord> getData(@RequestBody GameDataQuery query){
        if (query.getStoreId()==null){
            // 获取到游戏ids
            List<Integer> gameIds = gameService.list(new QueryWrapper<Game>().eq("operationId", query.getObjectId()))
                    .stream().map(Game::getId).collect(Collectors.toList());
            // 根据游戏ids查询智慧球场支付记录
            QueryWrapper<TGameRecord> wrapper = new QueryWrapper<TGameRecord>().eq("status", 1)
                    .ne("payType", 3)
                    .ne("payType", 4);
            if(gameIds.size() > 0){
                wrapper.in("gameId", gameIds);
            }
            List<TGameRecord> list = gameRecordService.list(wrapper);
            return list;
        }else{
            List<Integer> gameIds = gameService.list(new QueryWrapper<Game>().eq("storeId", query.getStoreId()))
                    .stream().map(Game::getId).collect(Collectors.toList());
            QueryWrapper wrapper = new QueryWrapper<TGameRecord>().eq("status", 1).eq("payType", 1).eq("payType", 2);
            if(gameIds.size() > 0){
                wrapper.in("gameId", gameIds);
            }
            List<TGameRecord> list = gameRecordService.list(wrapper);
            return list;
        }
    }
    @ResponseBody
    @PostMapping("/student/webStudentList")
@@ -107,7 +138,6 @@
    public List<Map<String, Object>> listorder(@RequestBody BookingQuery bookingQuery) {
        System.out.println("===bookingQuery====" + bookingQuery);
        return gameService.orderlist(bookingQuery);
//        return  game.getId();
    }