|
@@ -2,8 +2,8 @@ package com.game.business.controller;
|
|
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
import com.game.business.domain.*;
|
|
|
-import com.game.business.dto.AppGameBettingCountDTO;
|
|
|
-import com.game.business.dto.AppGameBettingDetailsCountDTO;
|
|
|
+import com.game.business.vo.AppGameBettingCountVO;
|
|
|
+import com.game.business.vo.AppGameBettingDetailsCountVO;
|
|
|
import com.game.business.service.*;
|
|
|
import com.game.common.annotation.Anonymous;
|
|
|
import com.game.common.core.controller.BaseController;
|
|
@@ -189,34 +189,34 @@ public class AppGameBettingController extends BaseController{
|
|
|
@Anonymous
|
|
|
@PostMapping(value = "/count")
|
|
|
@ApiOperation(value = "游戏输赢统计(首页)", notes = "游戏输赢统计(首页)")
|
|
|
- public HttpRet<AppGameBettingCountDTO> getCount(@RequestParam(name = "strDate") String strDate, @RequestParam(name = "userId") Long userId)
|
|
|
+ public HttpRet<AppGameBettingCountVO> getCount(@RequestParam(name = "strDate") String strDate, @RequestParam(name = "userId") Long userId)
|
|
|
{
|
|
|
- AppGameBettingCountDTO appGameBettingCountDTO = new AppGameBettingCountDTO();
|
|
|
+ AppGameBettingCountVO appGameBettingCountDTO = new AppGameBettingCountVO();
|
|
|
List<AppGame> gameList = appGameService.selectAppGameList(new AppGame());
|
|
|
|
|
|
if(gameList == null || gameList.isEmpty()){
|
|
|
return HttpRet.success("查询成功",appGameBettingCountDTO);
|
|
|
}
|
|
|
|
|
|
- List<AppGameBettingDetailsCountDTO> countList = appGameBettingService.getCount(strDate, userId);
|
|
|
+ List<AppGameBettingDetailsCountVO> countList = appGameBettingService.getCount(strDate, userId);
|
|
|
if(countList == null){
|
|
|
countList = new ArrayList<>();
|
|
|
}
|
|
|
- Map<Long, List<AppGameBettingDetailsCountDTO>> idGameMap = countList.stream().collect(Collectors.groupingBy(AppGameBettingDetailsCountDTO::getGameId));
|
|
|
+ Map<Long, List<AppGameBettingDetailsCountVO>> idGameMap = countList.stream().collect(Collectors.groupingBy(AppGameBettingDetailsCountVO::getGameId));
|
|
|
|
|
|
- List<AppGameBettingDetailsCountDTO> newList = new ArrayList<>();
|
|
|
+ List<AppGameBettingDetailsCountVO> newList = new ArrayList<>();
|
|
|
double orderAmount = 0.00;
|
|
|
double winAmount = 0.00;
|
|
|
double loseAmount = 0.00;
|
|
|
for (int i = 0; i < gameList.size(); i++) {
|
|
|
AppGame appGame = gameList.get(i);
|
|
|
- AppGameBettingDetailsCountDTO appGameBettingDetailsCountDTO = new AppGameBettingDetailsCountDTO();
|
|
|
+ AppGameBettingDetailsCountVO appGameBettingDetailsCountDTO = new AppGameBettingDetailsCountVO();
|
|
|
appGameBettingDetailsCountDTO.setGameId(appGame.getId());
|
|
|
appGameBettingDetailsCountDTO.setGameName(appGame.getName());
|
|
|
appGameBettingDetailsCountDTO.setLogoUrl(appGame.getLogoUrl());
|
|
|
appGameBettingDetailsCountDTO.setGamePath(appGame.getGamePath());
|
|
|
if(idGameMap.containsKey(appGame.getId())){
|
|
|
- AppGameBettingDetailsCountDTO dbAppGameBettingDetailsCount = idGameMap.get(appGame.getId()).get(0);
|
|
|
+ AppGameBettingDetailsCountVO dbAppGameBettingDetailsCount = idGameMap.get(appGame.getId()).get(0);
|
|
|
appGameBettingDetailsCountDTO.setBettingCount(dbAppGameBettingDetailsCount.getBettingCount());
|
|
|
appGameBettingDetailsCountDTO.setOrderAmount(dbAppGameBettingDetailsCount.getOrderAmount());
|
|
|
appGameBettingDetailsCountDTO.setWinAmount(dbAppGameBettingDetailsCount.getWinAmount());
|