|
@@ -563,9 +563,6 @@ public class AppGameBettingController extends BaseController{
|
|
|
public HttpRetPageArr<AppUserGameBettingCountVO> listHistory(@RequestParam(name = "gameId") Long gameId , @RequestParam(name = "bettingType", required = false) Integer bettingType
|
|
|
, @RequestParam(name = "bettingGameType", required = false) Integer bettingGameType)
|
|
|
{
|
|
|
- startPage();
|
|
|
- Long userId = SecurityUtils.getUserId();
|
|
|
- List<AppUserGameBettingCountVO> list = appGameBettingService.getUserCount(gameId, userId, bettingType);
|
|
|
|
|
|
if(bettingGameType == null){
|
|
|
bettingGameType = 0;
|
|
@@ -574,6 +571,10 @@ public class AppGameBettingController extends BaseController{
|
|
|
bettingType = 0;
|
|
|
}
|
|
|
|
|
|
+ startPage();
|
|
|
+ Long userId = SecurityUtils.getUserId();
|
|
|
+ List<AppUserGameBettingCountVO> list = appGameBettingService.getUserCount(gameId, userId, bettingType);
|
|
|
+
|
|
|
if(list != null && !list.isEmpty()){
|
|
|
|
|
|
if(bettingGameType == 0){
|
|
@@ -640,6 +641,89 @@ public class AppGameBettingController extends BaseController{
|
|
|
return HttpRetPageArr.success("查询成功",getDataTable(list));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 游戏投注记录(后台)
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/listHistoryWeb")
|
|
|
+ @ApiOperation(value = "游戏投注记录", notes = "游戏投注记录")
|
|
|
+ public HttpRetPageArr<AppUserGameBettingWebCountVO> listHistoryWeb(@RequestParam(name = "gameId" , required = false) Long gameId ,
|
|
|
+ @RequestParam(name = "userId" , required = false) Long userId ,
|
|
|
+ @RequestParam(name = "bettingType", required = false) Integer bettingType)
|
|
|
+ {
|
|
|
+
|
|
|
+ startPage();
|
|
|
+ List<AppUserGameBettingWebCountVO> list = appGameBettingService.getUserWebCount(gameId, userId, bettingType);
|
|
|
+
|
|
|
+ if(list != null && !list.isEmpty()){
|
|
|
+
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
+
|
|
|
+ AppUserGameBettingWebCountVO appUserGameBettingWebCountVO = list.get(i);
|
|
|
+
|
|
|
+ // 单选
|
|
|
+ if(appUserGameBettingWebCountVO.getBettingGameType() == 0){
|
|
|
+ List<AppUserGameBettingDetailsCountVO> detailsCountVOList = appGameBettingService.getUserBettingItemCount(appUserGameBettingWebCountVO.getGameId(),
|
|
|
+ appUserGameBettingWebCountVO.getGameDate(), appUserGameBettingWebCountVO.getUserId(), appUserGameBettingWebCountVO.getBettingType());
|
|
|
+ if(detailsCountVOList == null){
|
|
|
+ detailsCountVOList = new ArrayList<>();
|
|
|
+ }
|
|
|
+
|
|
|
+ appUserGameBettingWebCountVO.setDetailsCountVOList(detailsCountVOList);
|
|
|
+ // 写死多选
|
|
|
+ }else if(appUserGameBettingWebCountVO.getBettingGameType() == 1){
|
|
|
+
|
|
|
+ List<AppGameBetting> bettingList = appGameBettingService.getUserBettingItem(appUserGameBettingWebCountVO.getGameId(),
|
|
|
+ appUserGameBettingWebCountVO.getGameDate(), appUserGameBettingWebCountVO.getUserId(), appUserGameBettingWebCountVO.getBettingType());
|
|
|
+ if(bettingList == null){
|
|
|
+ bettingList = new ArrayList<>();
|
|
|
+ }
|
|
|
+ Map<String, AppUserGameBettingDetailsCountVO> itemMap = new HashMap<>();
|
|
|
+ for (int j = 0; j < bettingList.size(); j++) {
|
|
|
+ AppGameBetting appGameBetting = bettingList.get(j);
|
|
|
+
|
|
|
+ List<AppGameItemBettingVO> itemList = JSON.parseArray(appGameBetting.getBettingItem(), AppGameItemBettingVO.class);
|
|
|
+
|
|
|
+ for(AppGameItemBettingVO item : itemList){
|
|
|
+ if(itemMap.containsKey(item.getBettingItem())){
|
|
|
+ AppUserGameBettingDetailsCountVO appUserGameBettingDetailsCountVO = itemMap.get(item.getBettingItem());
|
|
|
+ appUserGameBettingDetailsCountVO.setOrderAmount(appUserGameBettingDetailsCountVO.getOrderAmount() + item.getBettingAmount());
|
|
|
+ if(appGameBetting.getIsWinning() == 1){
|
|
|
+ if(item.getBettingItem().equals(appUserGameBettingWebCountVO.getGameLotterySucc())) {
|
|
|
+ appUserGameBettingDetailsCountVO.setWinAmount(appUserGameBettingDetailsCountVO.getWinAmount() + (appGameBetting.getBettingAmount() * appGameBetting.getBettingMultiple()));
|
|
|
+ }
|
|
|
+ }else if(appGameBetting.getIsWinning() == 2){
|
|
|
+ appUserGameBettingDetailsCountVO.setLoseAmount(appUserGameBettingDetailsCountVO.getLoseAmount() + item.getBettingAmount());
|
|
|
+ }
|
|
|
+ itemMap.put(item.getBettingItem(), appUserGameBettingDetailsCountVO);
|
|
|
+ }else{
|
|
|
+ AppUserGameBettingDetailsCountVO appUserGameBettingDetailsCountVO = new AppUserGameBettingDetailsCountVO();
|
|
|
+ appUserGameBettingDetailsCountVO.setBettingTtem(item.getBettingItem());
|
|
|
+ appUserGameBettingDetailsCountVO.setOrderAmount(item.getBettingAmount());
|
|
|
+ if(appGameBetting.getIsWinning() == 1){
|
|
|
+ if(item.getBettingItem().equals(appUserGameBettingWebCountVO.getGameLotterySucc())){
|
|
|
+ appUserGameBettingDetailsCountVO.setWinAmount(appGameBetting.getBettingAmount() * appGameBetting.getBettingMultiple());
|
|
|
+ }
|
|
|
+ }else if(appGameBetting.getIsWinning() == 2){
|
|
|
+ appUserGameBettingDetailsCountVO.setLoseAmount(item.getBettingAmount());
|
|
|
+ }
|
|
|
+ itemMap.put(item.getBettingItem(), appUserGameBettingDetailsCountVO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<AppUserGameBettingDetailsCountVO> detailsCountVOList = new ArrayList<>();
|
|
|
+ Set<String> set = itemMap.keySet();
|
|
|
+ Iterator<String> iterator = set.iterator();
|
|
|
+ while (iterator.hasNext()){
|
|
|
+ AppUserGameBettingDetailsCountVO appUserGameBettingDetailsCountVO = itemMap.get(iterator.next());
|
|
|
+ detailsCountVOList.add(appUserGameBettingDetailsCountVO);
|
|
|
+ }
|
|
|
+ appUserGameBettingWebCountVO.setDetailsCountVOList(detailsCountVOList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return HttpRetPageArr.success("查询成功",getDataTable(list));
|
|
|
+ }
|
|
|
+
|
|
|
private double getMultiple(int size){
|
|
|
double itemMultiple;
|
|
|
switch (size){
|