Răsfoiți Sursa

Merge remote-tracking branch 'origin/master'

kk 1 lună în urmă
părinte
comite
ccf4a4f33b
23 a modificat fișierele cu 546 adăugiri și 91 ștergeri
  1. 33 6
      game-business/src/main/java/com/game/business/controller/AppAgentController.java
  2. 30 4
      game-business/src/main/java/com/game/business/controller/AppGameBettingController.java
  3. 20 8
      game-business/src/main/java/com/game/business/controller/AppGameController.java
  4. 18 0
      game-business/src/main/java/com/game/business/controller/AppUserController.java
  5. 19 3
      game-business/src/main/java/com/game/business/mapper/AppGameBettingMapper.java
  6. 4 0
      game-business/src/main/java/com/game/business/mapper/AppUserMapper.java
  7. 2 2
      game-business/src/main/java/com/game/business/service/IAppGameBettingService.java
  8. 3 0
      game-business/src/main/java/com/game/business/service/IAppUserService.java
  9. 4 4
      game-business/src/main/java/com/game/business/service/impl/AppGameBettingServiceImpl.java
  10. 7 0
      game-business/src/main/java/com/game/business/service/impl/AppUserServiceImpl.java
  11. 35 2
      game-business/src/main/java/com/game/business/task/AppUserCountTask.java
  12. 4 4
      game-business/src/main/java/com/game/business/util/other/PayOrderUtils.java
  13. 5 0
      game-business/src/main/java/com/game/business/vo/AppUserDetailVo.java
  14. 21 0
      game-business/src/main/java/com/game/business/vo/AppUserGameBettingStaticsVo.java
  15. 2 0
      game-business/src/main/java/com/game/business/vo/AppUserGameBettingWebCountVO.java
  16. 17 0
      game-business/src/main/java/com/game/business/vo/OffLineUserVo.java
  17. 28 1
      game-business/src/main/resources/mapper/business/AppGameBettingMapper.xml
  18. 5 0
      game-business/src/main/resources/mapper/business/AppUserMapper.xml
  19. 1 1
      game-business/src/main/resources/mapper/business/FinTranRecordMapper.xml
  20. 9 2
      game-framework/src/main/java/com/game/framework/web/exception/GlobalExceptionHandler.java
  21. 18 0
      game-ui/src/api/business/betting.js
  22. 138 27
      game-ui/src/views/business/betting/index.vue
  23. 123 27
      game-ui/src/views/business/user/index.vue

+ 33 - 6
game-business/src/main/java/com/game/business/controller/AppAgentController.java

@@ -11,6 +11,9 @@ import com.game.business.vo.AppUserDetailVo;
 import com.game.business.vo.AppUserTeamTranserRecordVo;
 import com.game.common.annotation.RepeatSubmit;
 import com.game.common.constant.CacheConstants;
+import com.game.common.constant.finance.FinTranType1;
+import com.game.common.constant.finance.FinTranType2;
+import com.game.common.constant.finance.FinTranType3;
 import com.game.common.core.controller.BaseController;
 import com.game.common.core.domain.HttpRet;
 import com.game.common.core.domain.HttpRetPageArr;
@@ -251,16 +254,16 @@ public class AppAgentController extends BaseController {
        if(null == appUserAgent){
            return HttpRet.fail("转账失败,受益人不是代理");
        }
-       if(appUserAgent.getPid().longValue() == 0 || isTwoLevel(appUserAgent.getPid())){
+//       if(appUserAgent.getPid().longValue() == 0 || isTwoLevel(appUserAgent.getPid())){
            List<AppUserAgent> appUserAgentList = appUserAgentService.selectAllAgentList(userId,transerDto.getToUserId(),null,null);
-           if(null == appUserAgentList || appUserAgentList.size() < 1){
+           if(null == appUserAgentList || appUserAgentList.size() < 2){
                return HttpRet.fail("转账失败,只能给团队成员转账");
            }
-       }else{
+      /* }else{
             if(!isTeam(userId,transerDto.getToUserId())){
                 return HttpRet.fail("转账失败,只能给下级成员转账");
             }
-       }
+       }*/
        return finTranRecordService.transfer(transerDto);
     }
 
@@ -387,9 +390,9 @@ public class AppAgentController extends BaseController {
                 DateUtil.format(endDate,"yyyy-MM-dd").concat(" 23:59:59"),
                 null,null,null,null);
         //用户总投注流水
-        appUserDetailVo.setTotalBetting(appGameBettingService.sumBettingAmount(userId,0));
+        appUserDetailVo.setTotalBetting(appGameBettingService.sumBettingAmount(userId,0,null,null,null));
         //用户金币总投注流水
-        appUserDetailVo.setTotalCoinBetting(appGameBettingService.sumBettingAmount(userId,1));
+        appUserDetailVo.setTotalCoinBetting(appGameBettingService.sumBettingAmount(userId,1,null,null,null));
 
         //当日游戏投注
         appUserDetailVo.setTodayBetting(gameBettingList.stream().filter(e->{
@@ -471,6 +474,30 @@ public class AppAgentController extends BaseController {
         //本周提现
         appUserDetailVo.setWeekWithdraw(appUsersCashrecords.stream().mapToDouble(e->{return e.getVotes().doubleValue();}).sum());
 
+
+        //礼物
+        Date giftBeginTime = DateUtil.offsetDay(DateUtil.date(),-30);
+        Date giftEndTime = DateUtil.date();
+        LambdaQueryWrapper<FinTranRecord> finTranWrapper = new LambdaQueryWrapper<>();
+        finTranWrapper.eq(FinTranRecord::getTranType1, FinTranType1.U_Income_Coin.getType());
+        finTranWrapper.eq(FinTranRecord::getTranType2, FinTranType2.REWARD_Income.getType());
+        finTranWrapper.eq(FinTranRecord::getTranType3, FinTranType3.RECOMMEND_ADD_AMOUNT.getType());
+        finTranWrapper.eq(FinTranRecord::getUid,userId);
+        finTranWrapper.between(FinTranRecord::getCreateTime,DateUtil.format(giftBeginTime,"yyyy-MM-dd").concat(" 00:00:00"),
+                DateUtil.format(giftEndTime,"yyyy-MM-dd").concat(" 23:59:59"));
+        List<FinTranRecord> giftList = finTranRecordService.selecListByWrapper(finTranWrapper);
+        if(null == giftList){
+            giftList = new ArrayList<>();
+        }
+        appUserDetailVo.setTotalGift(giftList.stream().mapToDouble(FinTranRecord::getCoinChange).sum());
+        appUserDetailVo.setTodayGift(giftList.stream().filter(e->DateUtil.format(DateUtil.date(),
+                "yyyy-MM-dd").equals(DateUtil.format(e.getCreateTime(),"yyyy-MM-dd"))).mapToDouble(FinTranRecord::getCoinChange).sum());
+        Date finalEndDate = endDate;
+        Date finalBeginDate = beginDate;
+        appUserDetailVo.setWeekGift(giftList.stream().filter(e->e.getCreateTime().getTime() >= finalBeginDate.getTime() &&
+                e.getCreateTime().getTime() <= finalEndDate.getTime()).mapToDouble(FinTranRecord::getCoinChange).sum());
+
+
        /* AppUser queryIpUser = new AppUser();
         queryIpUser.setIpaddr(appUser.getIpaddr());
         List<AppUser> ipUserList = appUserService.selectAppUserList(queryIpUser);

+ 30 - 4
game-business/src/main/java/com/game/business/controller/AppGameBettingController.java

@@ -1,5 +1,6 @@
 package com.game.business.controller;
 
+import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.IdUtil;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.dynamic.datasource.annotation.DSTransactional;
@@ -641,18 +642,43 @@ public class AppGameBettingController extends BaseController{
         return HttpRetPageArr.success("查询成功",getDataTable(list));
     }
 
+    /**
+     * 游戏投注记录(后台)
+     */
+    @PostMapping(value = "/staticsWeb")
+    @ApiOperation(value = "游戏投注记录统计", notes = "游戏投注记录统计")
+    public R<AppUserGameBettingStaticsVo> staticsWeb(@RequestParam(name = "gameId" , required = false) Long gameId ,
+                                                                      @RequestParam(name = "userId" , required = false) Long userId,
+                                                                      @RequestParam(name = "beginTime" , required = false) String beginTime,
+                                                                      @RequestParam(name = "endTime" , required = false) String endTime
+    )
+    {
+        AppUserGameBettingStaticsVo appUserGameBettingStaticsVo = new AppUserGameBettingStaticsVo();
+        String date = DateUtil.format(DateUtil.date(),"yyyy-MM-dd");
+        appUserGameBettingStaticsVo.setTotalAmount(appGameBettingService.sumBettingAmount(userId,0,beginTime,endTime,gameId));
+        appUserGameBettingStaticsVo.setTotalCoinAmount(appGameBettingService.sumBettingAmount(userId,1,beginTime,endTime,gameId));
+        appUserGameBettingStaticsVo.setToDayAmount(appGameBettingService.sumBettingAmount(userId,0,date.concat(" 00:00:00"),date.concat(" 23:59:59"),gameId));
+        appUserGameBettingStaticsVo.setToDayCoinAmount(appGameBettingService.sumBettingAmount(userId,1,date.concat(" 00:00:00"),date.concat(" 23:59:59"),gameId));
+        return R.ok(appUserGameBettingStaticsVo);
+    }
+
     /**
      * 游戏投注记录(后台)
      */
     @PostMapping(value = "/listHistoryWeb")
     @ApiOperation(value = "游戏投注记录", notes = "游戏投注记录")
-    public HttpRetPageArr<AppUserGameBettingWebCountVO> listHistoryWeb(@RequestParam(name = "gameId" , required = false) Long gameId ,
+    public TableDataInfo<AppUserGameBettingWebCountVO> listHistoryWeb(@RequestParam(name = "gameId" , required = false) Long gameId ,
                                                                        @RequestParam(name = "userId" , required = false) Long userId ,
-                                                                       @RequestParam(name = "bettingType", required = false) Integer bettingType)
+                                                                       @RequestParam(name = "bettingType", required = false) Integer bettingType,
+                                                                      @RequestParam(name = "beginTime" , required = false) String beginTime,
+                                                                      @RequestParam(name = "endTime" , required = false) String endTime
+    )
     {
 
         startPage();
-        List<AppUserGameBettingWebCountVO> list = appGameBettingService.getUserWebCount(gameId, userId, bettingType);
+        beginTime = StringUtils.isNotBlank(beginTime)?beginTime.concat(" 00:00:00"):beginTime;
+        endTime = StringUtils.isNotBlank(endTime)?endTime.concat(" 23:59:59"):endTime;
+        List<AppUserGameBettingWebCountVO> list = appGameBettingService.getUserWebCount(gameId, userId, bettingType,beginTime,endTime);
 
         if(list != null && !list.isEmpty()){
 
@@ -721,7 +747,7 @@ public class AppGameBettingController extends BaseController{
                 }
             }
         }
-        return HttpRetPageArr.success("查询成功",getDataTable(list));
+        return getDataTable(list);
     }
 
     private double getMultiple(int size){

+ 20 - 8
game-business/src/main/java/com/game/business/controller/AppGameController.java

@@ -4,16 +4,10 @@ import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
 import com.game.common.core.domain.R;
+import com.game.common.utils.SecurityUtils;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import com.game.common.annotation.Log;
 import com.game.common.core.controller.BaseController;
 import com.game.common.core.domain.AjaxResult;
@@ -128,4 +122,22 @@ public class AppGameController extends BaseController
     {
         return toAjax(appGameService.deleteAppGameByIds(ids));
     }
+
+
+    @GetMapping("/gameTime")
+    @ApiOperation(value = "记录游戏打开", notes = "记录游戏打开")
+    public R gameTime(@RequestParam(name = "type") Integer type, // 类型 0:打开  1:关闭
+                      @RequestParam(name = "osType") String osType, //系统类型 ios或安卓
+                      @RequestParam(name = "gameId") String gameId,
+                      @RequestParam(name = "gameName") String gameName,
+                      @RequestParam(name = "date") String date)
+    {
+        if(null != type && type.intValue() == 1){
+            logger.info("用户:{},关闭游戏{}({}),时间{},系统:{}", SecurityUtils.getUserId(), gameId, gameName, date);
+        }else{
+            logger.info("用户:{},打开游戏{}({}),时间{},系统:{}",SecurityUtils.getUserId(), gameId, gameName, date);
+        }
+
+        return R.ok("记录成功","记录成功");
+    }
 }

+ 18 - 0
game-business/src/main/java/com/game/business/controller/AppUserController.java

@@ -23,6 +23,7 @@ import com.game.common.annotation.RepeatSubmit;
 import com.game.common.constant.AppSceneType;
 import com.game.common.constant.finance.*;
 import com.game.common.core.domain.HttpRet;
+import com.game.common.core.domain.HttpRetArr;
 import com.game.common.core.domain.R;
 import com.game.common.core.redis.RedisCache;
 import com.game.common.exception.ServiceException;
@@ -144,6 +145,23 @@ public class AppUserController extends BaseController
         return getDataTable(list);
     }
 
+    /**
+     * 查询用户收到的礼物
+     */
+    @GetMapping("/getGiftApp")
+    @ApiOperation(value = "APP-查询用户收到的礼物", notes = "APP-查询用户收到的礼物")
+    public HttpRetArr getGiftApp(Long userId)
+    {
+        startPage();
+        FinTranRecord finTranRecord = new FinTranRecord();
+        finTranRecord.setTranType1(FinTranType1.U_Income_Coin.getType());
+        finTranRecord.setTranType2(FinTranType2.REWARD_Income.getType());
+        finTranRecord.setTranType3(FinTranType3.RECOMMEND_ADD_AMOUNT.getType());
+        finTranRecord.setToUid(userId);
+        List<FinTranRecord> list = finTranRecordService.selectFinTranRecordList(finTranRecord);
+        return HttpRetArr.success("查询成功",list);
+    }
+
     /**
      * 重置密码
      */

+ 19 - 3
game-business/src/main/java/com/game/business/mapper/AppGameBettingMapper.java

@@ -19,7 +19,7 @@ public interface AppGameBettingMapper extends BaseMapper<AppGameBetting> {
 
     List<AppGameBettingDetailsCountVO> getCount(@Param(value = "strDate") String strDate, @Param(value = "userId") Long userId,  @Param(value = "bettingType") Integer bettingType);
     List<AppUserGameBettingCountVO> getUserCount(@Param(value = "gameId") Long gameId, @Param(value = "userId") Long userId, @Param(value = "bettingType") Integer bettingType);
-    List<AppUserGameBettingWebCountVO> getUserWebCount(@Param(value = "gameId") Long gameId, @Param(value = "userId") Long userId, @Param(value = "bettingType") Integer bettingType);
+    List<AppUserGameBettingWebCountVO> getUserWebCount(@Param(value = "gameId") Long gameId, @Param(value = "userId") Long userId, @Param(value = "bettingType") Integer bettingType,@Param("beginTime") String beginTime,@Param("endTime") String endTime);
     List<AppUserGameBettingDetailsCountVO> getUserBettingItemCount(@Param(value = "gameId") Long gameId, @Param(value = "gameDate") String gameDate, @Param(value = "userId") Long userId, @Param(value = "bettingType") Integer bettingType);
     Map<String, BigDecimal> getBettingAmountSum(Long userId);
     Map<String, BigDecimal> getBettingAmountByDateSum(FinTranRecordDTO finTranRecordDTO);
@@ -76,7 +76,23 @@ public interface AppGameBettingMapper extends BaseMapper<AppGameBetting> {
      */
     public int deleteAppGameBettingByIds(Long[] ids);
 
-    @Select("select ifNull(sum(betting_amount),0) from app_game_betting where user_id = #{userId} and betting_type = #{bettingType}")
-    public Double sumBettingAmount(@Param("userId") Long userId, @Param("bettingType") Integer bettingType);
+    /*@Select(" <script>" +
+            " select ifNull(sum(betting_amount),0) from app_game_betting " +
+            "  <where>" +
+            "   <if test=\"userId != null \"> " +
+            "       user_id = #{userId} " +
+            "   </if> " +
+            "   <if test=\"bettingType != null \"> " +
+            "      and betting_type = #{bettingType} " +
+            "   </if>" +
+            "   <if test=\"beginTime != null and beginTime != '' \"> " +
+            "      and create_time >= #{beginTime} " +
+            "   </if>" +
+            "   <if test=\"endTime != null and endTime != '' \"> " +
+            "      and create_time <= #{endTime} " +
+            "   </if>" +
+            "  </where>" +
+            " </script>")*/
+    public Double sumBettingAmount(@Param("userId") Long userId, @Param("bettingType") Integer bettingType, @Param("beginTime") String beginTime, @Param("endTime") String endTime,@Param("gameId") Long gameId);
 
 }

+ 4 - 0
game-business/src/main/java/com/game/business/mapper/AppUserMapper.java

@@ -7,6 +7,7 @@ import java.util.Map;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.game.business.domain.AppUser;
 import com.game.business.vo.ApiUserInfoVo;
+import com.game.business.vo.OffLineUserVo;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.springframework.data.cache.CacheByNativeSql;
@@ -109,4 +110,7 @@ public interface AppUserMapper extends BaseMapper<AppUser> {
     ApiUserInfoVo getUserInfo(@Param("userId") long userId);
 
     Map<String, BigDecimal> getUserCount(Long userId);
+
+    List<OffLineUserVo> selectOffLineUser();
+
 }

+ 2 - 2
game-business/src/main/java/com/game/business/service/IAppGameBettingService.java

@@ -24,7 +24,7 @@ public interface IAppGameBettingService extends IService<AppGameBetting> {
 
     List<AppUserGameBettingCountVO> getUserCount(Long gameId, Long userId, Integer bettingType);
 
-    List<AppUserGameBettingWebCountVO> getUserWebCount(Long gameId, Long userId, Integer bettingType);
+    List<AppUserGameBettingWebCountVO> getUserWebCount(Long gameId, Long userId, Integer bettingType,String beginTime,String endTime);
 
     List<AppUserGameBettingDetailsCountVO> getUserBettingItemCount(Long gameId, String gameDate, Long userId, Integer bettingType);
 
@@ -104,5 +104,5 @@ public interface IAppGameBettingService extends IService<AppGameBetting> {
      */
     public int deleteAppGameBettingById(Long id);
 
-    public Double sumBettingAmount(Long userId,Integer bettingType);
+    public Double sumBettingAmount(Long userId,Integer bettingType,String beginTime,String endTime,Long gameId);
 }

+ 3 - 0
game-business/src/main/java/com/game/business/service/IAppUserService.java

@@ -8,6 +8,7 @@ import com.game.business.domain.AppUser;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.game.business.domain.FinTranRecord;
 import com.game.business.vo.ApiUserInfoVo;
+import com.game.business.vo.OffLineUserVo;
 
 /**
  * app用户Service接口
@@ -96,4 +97,6 @@ public interface IAppUserService extends IService<AppUser> {
     ApiUserInfoVo getUserInfo(Long userId);
 
     Map<String, BigDecimal> getUserCount(Long userId);
+
+    List<OffLineUserVo> selectOffLineUser();
 }

+ 4 - 4
game-business/src/main/java/com/game/business/service/impl/AppGameBettingServiceImpl.java

@@ -60,8 +60,8 @@ public class AppGameBettingServiceImpl extends ServiceImpl<AppGameBettingMapper,
     }
 
     @Override
-    public List<AppUserGameBettingWebCountVO> getUserWebCount(Long gameId, Long userId, Integer bettingType) {
-        return appGameBettingMapper.getUserWebCount(gameId, userId, bettingType);
+    public List<AppUserGameBettingWebCountVO> getUserWebCount(Long gameId, Long userId, Integer bettingType,String beginTime,String endTime) {
+        return appGameBettingMapper.getUserWebCount(gameId, userId, bettingType,beginTime,endTime);
     }
 
     @Override
@@ -255,8 +255,8 @@ public class AppGameBettingServiceImpl extends ServiceImpl<AppGameBettingMapper,
     }
 
     @Override
-    public Double sumBettingAmount(Long userId,Integer bettingType) {
-        return appGameBettingMapper.sumBettingAmount(userId,bettingType);
+    public Double sumBettingAmount(Long userId,Integer bettingType,String beginTime,String endTime,Long gameId) {
+        return appGameBettingMapper.sumBettingAmount(userId,bettingType,beginTime,endTime,gameId);
     }
 
 

+ 7 - 0
game-business/src/main/java/com/game/business/service/impl/AppUserServiceImpl.java

@@ -14,6 +14,7 @@ import java.util.concurrent.TimeUnit;
 import com.game.business.domain.FinTranRecord;
 import com.game.business.service.IFinTranRecordService;
 import com.game.business.vo.ApiUserInfoVo;
+import com.game.business.vo.OffLineUserVo;
 import com.game.common.annotation.DataSource;
 import com.game.common.constant.finance.FinTranType1;
 import com.game.common.constant.finance.FinTranType2;
@@ -250,6 +251,12 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> impl
         return appUserMapper.getUserCount(userId);
     }
 
+    @Override
+    @DataSource(DataSourceType.SLAVE)
+    public List<OffLineUserVo> selectOffLineUser() {
+        return appUserMapper.selectOffLineUser();
+    }
+
     @Override
     @DataSource(DataSourceType.SLAVE)
     public ApiUserInfoVo getUserInfo(Long userId) {

+ 35 - 2
game-business/src/main/java/com/game/business/task/AppUserCountTask.java

@@ -1,20 +1,24 @@
 package com.game.business.task;
 
 import cn.hutool.core.date.DateUtil;
-import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson2.JSONObject;
 import com.baomidou.dynamic.datasource.annotation.DSTransactional;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.game.business.domain.*;
 import com.game.business.service.*;
+import com.game.business.util.im.HttpClientUtils;
+import com.game.business.vo.OffLineUserVo;
 import com.game.common.constant.CacheConstants;
 import com.game.common.constant.finance.FinTranType1;
 import com.game.common.constant.finance.FinTranType2;
 import com.game.common.constant.finance.FinTranType3;
 import com.game.common.core.domain.HttpRet;
+import com.game.common.core.domain.R;
 import com.game.common.core.redis.RedisCache;
 import com.game.common.entity.KeyValue;
 import com.game.common.utils.DateUtils;
 import com.game.common.utils.StringUtils;
+import com.game.system.service.ISysConfigService;
 import lombok.extern.log4j.Log4j2;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -63,6 +67,9 @@ public class AppUserCountTask {
     @Autowired
     private IAppUserCountDividendService appUserCountDividendService;
 
+    @Autowired
+    private ISysConfigService sysConfigService;
+
     @Autowired
     private RedisCache redisCache;
 
@@ -688,10 +695,36 @@ public class AppUserCountTask {
                 updateUser.setUserid(uid);
                 updateUser.setWithdrawAble(withdrawAble);
                 appUserService.updateAppUser(updateUser);
-                log.info("用户{},可提现额度{}",userId,withdrawAble);
+                log.info("用户{},可提现额度{}",uid,withdrawAble);
                 //清除用户缓存
                 redisCache.deleteObject("U:UserInfo:".concat(String.valueOf(uid)));
             }
         }
     }
+
+    public void dealOffLive(){
+        List<OffLineUserVo> list = appUserService.selectOffLineUser();
+        if(null != list && list.size() > 0){
+            Date now = DateUtil.date();
+            list.forEach(e->{
+                if(now.getTime() - e.getOffTime().getTime() >= 1*60*1000){
+                    log.info("{}离线已超过1分钟,自动关播",e.getUserId());
+                    //离线超过一分钟 自动关播
+                    String url = sysConfigService.selectConfigByKey("sys_live_apiurl").concat("/api/live/httpOpenCloseLive");
+                    Map<String, String> map = new HashMap<>();
+                    map.put("roomId", String.valueOf(e.getRoomId()));
+                    map.put("liveType", "1");
+                    map.put("isLive", String.valueOf(e.getIsLive()));
+                    map.put("description", "关播");
+
+                    String res = HttpClientUtils.ajaxPost(url,map);
+                    if(org.apache.commons.lang3.StringUtils.isBlank(res) || !JSONObject.parseObject(res).getString("code").equals("1")){
+                        log.info("{}自动关播失败===============》》".concat(res),e.getUserId());
+                    }
+                }else{
+                    log.info("{}离线未超过1分钟,停止自动关播",e.getUserId());
+                }
+            });
+        }
+    }
 }

+ 4 - 4
game-business/src/main/java/com/game/business/util/other/PayOrderUtils.java

@@ -29,8 +29,8 @@ public class PayOrderUtils {
     private static final String key = "EKCAUP9FWRVGCCR2FVN3WZWVAXAQXINN45IGYD8QKVRYUYWHLRYZRKSOHY0ABEUHEW0SUVMIA1H7UCCKZ2UAC7YIPH5FZCMDPT1FTDUYFKHSU2DB3CJ24FDW97K2YPBP";
 /*    private static final String reqUrl = "http://samsunghook.xyz/api/pay/create_order";
     private static final String queryUrl = "http://samsunghook.xyz/api/pay/query_order";*/
-    private static final String reqUrl = "http://10.0.0.11:3021/api/pay/create_order";
-    private static final String queryUrl = "http://10.0.0.11:3021/api/pay/query_order";
+    private static final String reqUrl = "https://samsunghook.xyz/api/pay/create_order";
+    private static final String queryUrl = "https://samsunghook.xyz/api/pay/query_order";
     private static final String mchId = "20000380";
     private static final String wxCode = "8086";
     private static final String zfbCode = "8085";
@@ -38,7 +38,7 @@ public class PayOrderUtils {
 
     public static Map<String, Object> getPayUrl(String orderNo, String payType, Integer amount,String extra){
 
-        String url = "http://10.0.0.14:8080";
+        String url = "https://apifoxgame.samsunghook.com";
         Map<String, Object> resultMap = new HashMap<>();
         resultMap.put("code", 0);
         resultMap.put("mgs", "获取支付地址失败!");
@@ -112,7 +112,7 @@ public class PayOrderUtils {
             }
 
         }catch (Exception e){
-            e.printStackTrace();
+            logger.info("调起四方接口异常:{}",e);
         }
         return resultMap;
     }

+ 5 - 0
game-business/src/main/java/com/game/business/vo/AppUserDetailVo.java

@@ -64,4 +64,9 @@ public class AppUserDetailVo implements Serializable {
     private Double weekWithdraw;
     private Double totalWithdraw;
 
+    //礼物收益
+    private Double totalGift; //近30天收益
+    private Double todayGift; //今日礼物收益
+    private Double weekGift; //当前周期礼物收益
+
 }

+ 21 - 0
game-business/src/main/java/com/game/business/vo/AppUserGameBettingStaticsVo.java

@@ -0,0 +1,21 @@
+package com.game.business.vo;
+
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@ApiModel("后台-用户下注总统计")
+@Data
+public class AppUserGameBettingStaticsVo implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private Double totalAmount;
+
+    private Double toDayAmount;
+
+    private Double totalCoinAmount;
+
+    private Double toDayCoinAmount;
+
+}

+ 2 - 0
game-business/src/main/java/com/game/business/vo/AppUserGameBettingWebCountVO.java

@@ -1,5 +1,6 @@
 package com.game.business.vo;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -51,6 +52,7 @@ public class AppUserGameBettingWebCountVO {
     private Integer isLottery;
 
     @ApiModelProperty(value = "当前开奖时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date gameRecordDate;
 
     @ApiModelProperty(value = "投注选项统计")

+ 17 - 0
game-business/src/main/java/com/game/business/vo/OffLineUserVo.java

@@ -0,0 +1,17 @@
+package com.game.business.vo;
+
+import lombok.Data;
+import java.util.Date;
+
+@Data
+public class OffLineUserVo {
+
+    private Long userId;
+
+    private Integer isLive;
+
+    private Long roomId;
+
+    private Date offTime;
+
+}

+ 28 - 1
game-business/src/main/resources/mapper/business/AppGameBettingMapper.xml

@@ -81,10 +81,16 @@
                      <if test="bettingType != null">
                          and betting_type = #{bettingType}
                      </if>
+                     <if test="beginTime != null and beginTime != ''">
+                         and create_time &gt;= #{beginTime}
+                     </if>
+                     <if test="endTime != null and endTime != ''">
+                         and create_time &lt;= #{endTime}
+                     </if>
                  </where>
                  group by user_id, game_id, game_date, betting_game_type
              ) tmp
-            left join app_game ag on ag.id = tmp.gameId
+            left join mugozbg_live.app_game ag on ag.id = tmp.gameId
             left join app_game_lottery agl on agl.game_date = tmp.gameDate and agl.game_id = tmp.gameId
         order by tmp.bettingDate desc
     </select>
@@ -270,4 +276,25 @@
             #{id}
         </foreach>
     </delete>
+
+    <select id="sumBettingAmount" resultType="java.lang.Double">
+        select ifNull(sum(betting_amount),0) from app_game_betting
+        <where>
+            <if test="userId != null ">
+                and user_id = #{userId}
+            </if>
+            <if test="gameId != null ">
+                and game_id = #{gameId}
+            </if>
+            <if test="bettingType != null ">
+                and betting_type = #{bettingType}
+            </if>
+            <if test="beginTime != null and beginTime != '' ">
+                and create_time &gt;= #{beginTime}
+            </if>
+             <if test="endTime != null and endTime != '' ">
+                and create_time &lt;= #{endTime}
+             </if>
+        </where>
+    </select>
 </mapper>

+ 5 - 0
game-business/src/main/resources/mapper/business/AppUserMapper.xml

@@ -875,4 +875,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             </if>
         </where>
     </select>
+
+    <select id="selectOffLineUser" resultType="com.game.business.vo.OffLineUserVo">
+        select a.userid as userId,b.islive as isLive,b.id as roomId,a.last_off_line_time as offTime from app_user as a inner join live_live as b on a.userid = b.user_id
+        where b.islive = 1 and online_status = 0
+    </select>
 </mapper>

+ 1 - 1
game-business/src/main/resources/mapper/business/FinTranRecordMapper.xml

@@ -70,7 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="perc != null "> and perc = #{perc}</if>
             <if test="proCount != null "> and pro_count = #{proCount}</if>
             <if test="proId != null "> and pro_id = #{proId}</if>
-            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
+            <if test="remarks != null  and remarks != ''"> and remarks like concat('%', #{remarks}, '%')</if>
             <if test="sceneId1 != null "> and scene_id1 = #{sceneId1}</if>
             <if test="sceneId2 != null  and sceneId2 != ''"> and scene_id2 = #{sceneId2}</if>
             <if test="sceneType != null "> and scene_type = #{sceneType}</if>

+ 9 - 2
game-framework/src/main/java/com/game/framework/web/exception/GlobalExceptionHandler.java

@@ -22,7 +22,7 @@ import com.game.common.utils.StringUtils;
  * 
  * @author recruit
  */
-//@RestControllerAdvice
+@RestControllerAdvice
 public class GlobalExceptionHandler
 {
     private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class);
@@ -34,7 +34,7 @@ public class GlobalExceptionHandler
     public AjaxResult handleAccessDeniedException(AccessDeniedException e, HttpServletRequest request)
     {
         String requestURI = request.getRequestURI();
-        log.error("请求地址'{}',权限校验失败'{}'", requestURI, e.getMessage());
+        log.error("请求地址'{}',权限校验失败'{}'", requestURI, e);
         return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
     }
 
@@ -57,6 +57,7 @@ public class GlobalExceptionHandler
     public AjaxResult handleServiceException(ServiceException e, HttpServletRequest request)
     {
         log.error(e.getMessage(), e);
+        log.info("程序异常:{}", e);
         Integer code = e.getCode();
         return StringUtils.isNotNull(code) ? AjaxResult.error(code, e.getMessage()) : AjaxResult.error(e.getMessage());
     }
@@ -70,6 +71,7 @@ public class GlobalExceptionHandler
         String requestURI = request.getRequestURI();
         e.printStackTrace();
         log.error("请求路径中缺少必需的路径变量'{}',发生系统异常.", requestURI, e);
+        log.info("程序异常:{}", e);
         return AjaxResult.error(String.format("请求路径中缺少必需的路径变量[%s]", e.getVariableName()));
     }
 
@@ -81,6 +83,7 @@ public class GlobalExceptionHandler
     {
         String requestURI = request.getRequestURI();
         log.error("请求参数类型不匹配'{}',发生系统异常.", requestURI, e);
+        log.info("程序异常:{}", e);
         return AjaxResult.error(String.format("请求参数类型不匹配,参数[%s]要求类型为:'%s',但输入值为:'%s'", e.getName(), e.getRequiredType().getName(), e.getValue()));
     }
 
@@ -92,6 +95,7 @@ public class GlobalExceptionHandler
     {
         String requestURI = request.getRequestURI();
         log.error("请求地址'{}',发生未知异常.,{}", requestURI, e);
+        log.info("程序异常:{}", e);
         return AjaxResult.error(e.getMessage());
     }
 
@@ -103,6 +107,7 @@ public class GlobalExceptionHandler
     {
         String requestURI = request.getRequestURI();
         log.error("请求地址'{}',发生系统异常.", requestURI, e);
+        log.info("程序异常:{}", e);
         return AjaxResult.error(e.getMessage());
     }
 
@@ -113,6 +118,7 @@ public class GlobalExceptionHandler
     public AjaxResult handleBindException(BindException e)
     {
         log.error(e.getMessage(), e);
+        log.info("程序异常:{}", e);
         String message = e.getAllErrors().get(0).getDefaultMessage();
         return AjaxResult.error(message);
     }
@@ -124,6 +130,7 @@ public class GlobalExceptionHandler
     public Object handleMethodArgumentNotValidException(MethodArgumentNotValidException e)
     {
         log.error(e.getMessage(), e);
+        log.info("程序异常:{}", e);
         String message = e.getBindingResult().getFieldError().getDefaultMessage();
         return AjaxResult.error(message);
     }

+ 18 - 0
game-ui/src/api/business/betting.js

@@ -9,6 +9,24 @@ export function listBetting(query) {
   })
 }
 
+// 查询用户下注记录列表
+export function listHistoryWeb(query) {
+  return request({
+    url: '/business/betting/listHistoryWeb',
+    method: 'post',
+    params: query
+  })
+}
+
+// 查询用户下注记录列表
+export function staticsWeb(query) {
+  return request({
+    url: '/business/betting/staticsWeb',
+    method: 'post',
+    params: query
+  })
+}
+
 // 查询用户下注记录详细
 export function getBetting(id) {
   return request({

+ 138 - 27
game-ui/src/views/business/betting/index.vue

@@ -19,7 +19,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="游戏期号" prop="gameDate">
+<!--      <el-form-item label="游戏期号" prop="gameDate">
         <el-input
           v-model="queryParams.gameDate"
           placeholder="请输入游戏期号"
@@ -72,7 +72,7 @@
             :value="dict.value"
           />
         </el-select>
-      </el-form-item>
+      </el-form-item>-->
       <el-form-item label="投注时间" prop="daterange">
         <el-date-picker
           v-model="daterange"
@@ -90,8 +90,16 @@
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
+    <el-row :gutter="10" class="mb8" style="padding-left: 2rem;font-size: 15px">
+      <el-col :span="1.5">
+        <div>今日余额投注: {{staticsWeb.toDayAmount}}</div>
+        <div>今日金币投注: {{staticsWeb.toDayCoinAmount}}</div>
+        <div>余额总投注: {{staticsWeb.totalAmount}}</div>
+        <div>金币总投注: {{staticsWeb.totalCoinAmount}}</div>
+      </el-col>
+    </el-row>
 
-    <el-row :gutter="10" class="mb8">
+<!--    <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
         <el-button
           type="primary"
@@ -135,22 +143,57 @@
         >导出</el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>
+    </el-row>-->
 
-    <el-table v-loading="loading" :data="bettingList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="主键ID" align="center" prop="id" />
-      <el-table-column label="游戏" align="center" prop="gameId">
+<!--    <el-table v-loading="loading" :data="bettingList" @selection-change="handleSelectionChange">-->
+    <el-table v-loading="loading" :data="bettingList" >
+<!--      <el-table-column type="selection" width="55" align="center" />-->
+<!--      <el-table-column label="主键ID" align="center" prop="id" />-->
+      <el-table-column label="用户ID" align="center" prop="userId" width="100"/>
+      <el-table-column label="游戏" align="center" prop="gameName" width="100">
+<!--        <template slot-scope="scope">
+          <span>{{ getTypeName(scope.row.gameName) }}</span>
+        </template>-->
+      </el-table-column>
+      <el-table-column label="投注详情(选项:金额)" align="center"  width="200">
+        <template slot-scope="scope">
+            {{getBettingInfo(scope.row)}}
+        </template>
+      </el-table-column>
+      <el-table-column label="本期总投注金额" align="center"  width="120">
+        <template slot-scope="scope">
+            {{getBettingAmount(scope.row)}}
+        </template>
+      </el-table-column>
+      <el-table-column label="开奖获得" align="center"  width="120">
         <template slot-scope="scope">
-          <span>{{ getTypeName(scope.row.gameId) }}</span>
+            {{getBettingWinAmount(scope.row)}}
+        </template>
+      </el-table-column>
+      <el-table-column label="本局盈亏" align="center"  width="120">
+        <template slot-scope="scope">
+            {{getBettingWinLoseAmount(scope.row)}}
+        </template>
+      </el-table-column>
+      <el-table-column label="是否开奖" align="center"  width="120">
+        <template slot-scope="scope">
+            {{scope.row.isLottery==0?'否':'是'}}
         </template>
       </el-table-column>
-      <el-table-column label="用户ID" align="center" prop="userId" />
-      <el-table-column label="投注时间" align="center" prop="createTime" width="100"/>
       <el-table-column label="游戏期号" align="center" prop="gameDate" width="130"/>
-      <el-table-column label="主播ID" align="center" prop="liveUserId" />
-      <el-table-column label="直播房间号" align="center" prop="liveRoomId" />
-      <el-table-column label="是否直播间投注 " align="center" prop="isLive">
+      <el-table-column label="开奖项" align="center" prop="gameLotterySucc" width="130">
+        <template slot-scope="scope">
+          {{getItemName(scope.row)}}
+        </template>
+      </el-table-column>
+      <el-table-column label="投注类型" align="center" prop="bettingType">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.app_game_betting_type" :value="scope.row.bettingType"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="开奖时间" align="center" prop="gameRecordDate" width="130"/>
+      <el-table-column label="投注时间" align="center" prop="bettingDate" width="100"/>
+<!--      <el-table-column label="是否直播间投注 " align="center" prop="isLive">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.app_betting_is_live" :value="scope.row.isLive"/>
         </template>
@@ -172,8 +215,8 @@
         <template slot-scope="scope">
           <dict-tag :options="dict.type.app_game_betting_winning" :value="scope.row.isWinning"/>
         </template>
-      </el-table-column>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+      </el-table-column>-->
+<!--      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -190,7 +233,7 @@
             v-hasPermi="['business:betting:remove']"
           >删除</el-button>
         </template>
-      </el-table-column>
+      </el-table-column>-->
     </el-table>
 
     <pagination
@@ -274,9 +317,10 @@
 </template>
 
 <script>
-import { listBetting, getBetting, delBetting, addBetting, updateBetting } from "@/api/business/betting";
+import { listBetting, getBetting, delBetting, addBetting, updateBetting,staticsWeb } from "@/api/business/betting";
 import {allGameList } from "@/api/business/game_item";
 import {allList} from "@/api/business/lottery";
+import {listHistoryWeb} from "../../../api/business/betting";
 
 export default {
   name: "Betting",
@@ -297,6 +341,7 @@ export default {
       total: 0,
       // 用户下注记录表格数据
       bettingList: [],
+      staticsWeb:{},
       // 弹出层标题
       title: "",
       // 是否显示弹出层
@@ -376,6 +421,67 @@ export default {
     });
   },
   methods: {
+    getBettingInfo(row){
+      let detailsCountVOList = row.detailsCountVOList;
+      if(!detailsCountVOList){
+        return "-";
+      }
+      let res = "";
+      let map = {};
+      for(var i in detailsCountVOList){
+        let item = detailsCountVOList[i];
+        let amount = map[item.bettingTtem];
+        if(!amount){
+          amount = 0;
+        }
+        amount += item.orderAmount;
+        map[item.bettingTtem] = amount;
+      }
+      for(var i in map){
+        if(res.length > 0){
+          res += " | "
+        }
+        // res += this.gameItemMap[i+"_"+row.gameId] + ":" + map[i];
+        res += i + ":" + map[i];
+      }
+      return res;
+    },
+    getBettingAmount(row){
+      let detailsCountVOList = row.detailsCountVOList;
+      if(!detailsCountVOList){
+        return "-";
+      }
+      let amount = 0;
+      for(var i in detailsCountVOList){
+        let item = detailsCountVOList[i];
+        amount += parseInt(item.orderAmount);
+      }
+      return amount;
+    },
+    getBettingWinAmount(row){
+      let detailsCountVOList = row.detailsCountVOList;
+      if(!detailsCountVOList){
+        return "-";
+      }
+      let amount = 0;
+      for(var i in detailsCountVOList){
+        let item = detailsCountVOList[i];
+        amount += parseInt(item.winAmount);
+      }
+      return amount;
+    },
+    getBettingWinLoseAmount(row){
+      let detailsCountVOList = row.detailsCountVOList;
+      if(!detailsCountVOList){
+        return "-";
+      }
+      let amount = 0;
+      for(var i in detailsCountVOList){
+        let item = detailsCountVOList[i];
+        amount += (parseInt(item.winAmount) - (parseInt(item.orderAmount) - parseInt(item.loseAmount))) - parseInt(item.loseAmount);
+      }
+      return amount;
+    },
     dateChage(val){
       if(undefined != val && null != val && val.length > 1){
         this.queryParams.beginTime = val[0];
@@ -388,22 +494,24 @@ export default {
     getItemName(row){
       let that = this;
       let bettingGameType = row.bettingGameType;
-      let bettingItem = row.bettingItem;
+      let bettingItem = row.gameLotterySucc;
       let gameId = row.gameId;
-      if("0" == bettingGameType){
-        return that.gameItemMap[bettingItem+"_"+gameId];
-      }else{
+      /*if("0" == bettingGameType){
+        // return that.gameItemMap[bettingItem+"_"+gameId];
+        return bettingItem;
+      }else{*/
         let name = "";
-        let arr = JSON.parse(bettingItem);
+        let arr = bettingItem.split(",")
         for(var i in arr){
           let item = arr[i];
           if("" != name){
-            name = name + ",";
+            name = name + "|";
           }
-          name = name + that.gameItemMap[item["bettingItem"]+"_"+gameId];
+          // name = name + that.gameItemMap[item+"_"+gameId];
+          name = name + item;
         }
         return name;
-      }
+      // }
     },
     getTypeName(id) {
       return this.typeMap[id.toString()];
@@ -411,11 +519,14 @@ export default {
     /** 查询用户下注记录列表 */
     getList() {
       this.loading = true;
-      listBetting(this.queryParams).then(response => {
+      listHistoryWeb(this.queryParams).then(response => {
         this.bettingList = response.rows;
         this.total = response.total;
         this.loading = false;
       });
+      staticsWeb(this.queryParams).then(response => {
+        this.staticsWeb = response.data;
+      })
     },
     // 取消按钮
     cancel() {

+ 123 - 27
game-ui/src/views/business/user/index.vue

@@ -553,6 +553,9 @@
           <span style="margin-left: 1rem;">
             总投注(金币):{{userInfo.infoDetail.totalCoinBetting}}
           </span>
+          <span style="margin-left: 1rem;">
+            近30天礼物收益:{{userInfo.infoDetail.totalGift}}
+          </span>
         </el-form-item>
         <el-tabs v-model="activeName2" @tab-click="handleClick" style="width: 100%">
           <el-tab-pane label="今日" name="first">
@@ -562,6 +565,9 @@
             </span>
                 <span style="margin-left: 1rem;">
               提现:{{userInfo.infoDetail.todayWithdraw}}
+            </span>
+                <span style="margin-left: 1rem;">
+              礼物收益:{{userInfo.infoDetail.todayGift}}
             </span>
               </el-form-item>
               <el-form-item >
@@ -569,10 +575,13 @@
               游戏下注(余额):{{userInfo.infoDetail.todayBetting}}
             </span>
                 <span style="margin-left: 1rem;">
-              下注赢(余额):{{userInfo.infoDetail.todayWin}}
+              下注赢(余额):{{userInfo.infoDetail.todayWin - (userInfo.infoDetail.todayBetting - userInfo.infoDetail.todayLose)}}
             </span>
                 <span style="margin-left: 1rem;">
               下注输 (余额):{{userInfo.infoDetail.todayLose}}
+            </span>
+                <span style="margin-left: 1rem;">
+              盈亏 (余额):{{userInfo.infoDetail.todayWin - userInfo.infoDetail.todayLose}}
             </span>
               </el-form-item>
               <el-form-item>
@@ -584,6 +593,9 @@
             </span>
                 <span style="margin-left: 1rem;">
               下注输(金币):{{userInfo.infoDetail.todayCoinLose}}
+            </span>
+                <span style="margin-left: 1rem;">
+              盈亏 (金币):{{userInfo.infoDetail.todayCoinWin - userInfo.infoDetail.todayCoinLose}}
             </span>
             </el-form-item>
           </el-tab-pane>
@@ -594,6 +606,9 @@
           </span>
               <span style="margin-left: 1rem;">
             提现:{{userInfo.infoDetail.weekWithdraw}}
+          </span>
+              <span style="margin-left: 1rem;">
+            礼物收益:{{userInfo.infoDetail.weekGift}}
           </span>
             </el-form-item>
             <el-form-item>
@@ -605,6 +620,9 @@
           </span>
               <span style="margin-left: 1rem;">
             下注输(余额):{{userInfo.infoDetail.weekLose}}
+          </span>
+              <span style="margin-left: 1rem;">
+            盈亏(余额):{{userInfo.infoDetail.weekWin - userInfo.infoDetail.weekLose}}
           </span>
             </el-form-item>
             <el-form-item>
@@ -616,6 +634,9 @@
           </span>
               <span style="margin-left: 1rem;">
             下注输(金币):{{userInfo.infoDetail.weekCoinLose}}
+          </span>
+              <span style="margin-left: 1rem;">
+            盈亏(金币):{{userInfo.infoDetail.weekCoinWin - userInfo.infoDetail.weekCoinLose}}
           </span>
             </el-form-item>
           </el-tab-pane>
@@ -857,38 +878,50 @@
                 v-loading="bettingLoading"
                 stripe
                 style="width: 100%">
-                <el-table-column label="游戏" align="center" prop="gameId">
+                <el-table-column label="用户ID" align="center" prop="userId" width="100"/>
+                <el-table-column label="游戏" align="center" prop="gameName" width="100">
+<!--                  <template slot-scope="scope">
+                    <span>{{ getTypeName(scope.row.gameName) }}</span>
+                  </template>-->
+                </el-table-column>
+                <el-table-column label="投注详情(选项:金额)" align="center"  width="200">
                   <template slot-scope="scope">
-                    <span>{{ getTypeName(scope.row.gameId) }}</span>
+                    {{getBettingInfo(scope.row)}}
                   </template>
                 </el-table-column>
-                <el-table-column label="用户ID" align="center" prop="userId" />
-                <el-table-column label="游戏期号" align="center" prop="gameDate" />
-                <el-table-column label="主播ID" align="center" prop="liveUserId" />
-                <el-table-column label="直播房间号" align="center" prop="liveRoomId" />
-                <el-table-column label="是否直播间投注 " align="center" prop="isLive">
+                <el-table-column label="本期总投注金额" align="center"  width="120">
                   <template slot-scope="scope">
-                    <dict-tag :options="dict.type.app_betting_is_live" :value="scope.row.isLive"/>
+                    {{getBettingAmount(scope.row)}}
                   </template>
                 </el-table-column>
-                <el-table-column label="投注类型" align="center" prop="bettingType">
+                <el-table-column label="开奖获得" align="center"  width="120">
                   <template slot-scope="scope">
-                    <dict-tag :options="dict.type.app_game_betting_type" :value="scope.row.bettingType"/>
+                    {{getBettingWinAmount(scope.row)}}
+                  </template>
+                </el-table-column>
+                <el-table-column label="本局盈亏" align="center"  width="120">
+                  <template slot-scope="scope">
+                    {{getBettingWinLoseAmount(scope.row)}}
+                  </template>
+                </el-table-column>
+                <el-table-column label="是否开奖" align="center"  width="120">
+                  <template slot-scope="scope">
+                    {{scope.row.isLottery==0?'否':'是'}}
                   </template>
                 </el-table-column>
-                <el-table-column label="投注选项" align="center" prop="bettingItem">
+                <el-table-column label="游戏期号" align="center" prop="gameDate" width="130"/>
+                <el-table-column label="开奖项" align="center" prop="gameLotterySucc" width="130">
                   <template slot-scope="scope">
                     {{getItemName(scope.row)}}
                   </template>
                 </el-table-column>
-                <el-table-column label="投注选项倍数" align="center" prop="bettingMultiple" />
-                <el-table-column label="投注金额" align="center" prop="bettingAmount" />
-                <el-table-column label="投注佣金" align="center" prop="bettingCommission" />
-                <el-table-column label="是否中奖" align="center" prop="isWinning">
+                <el-table-column label="投注类型" align="center" prop="bettingType">
                   <template slot-scope="scope">
-                    <dict-tag :options="dict.type.app_game_betting_winning" :value="scope.row.isWinning"/>
+                    <dict-tag :options="dict.type.app_game_betting_type" :value="scope.row.bettingType"/>
                   </template>
                 </el-table-column>
+                <el-table-column label="开奖时间" align="center" prop="gameRecordDate" width="130"/>
+                <el-table-column label="投注时间" align="center" prop="bettingDate" width="100"/>
               </el-table>
               <pagination
                 v-show="bettingTotal>0"
@@ -914,7 +947,7 @@
 import { listUser, getUser, delUser, addUser, updateUser,resetUser,userCharge,channelList,withdraw,openLive,userDetail,liveCommission,getGift,updateUserAgent,updateGameCommissionAgent,restPayPwd  } from "@/api/business/user";
 import { listAccount} from "@/api/business/account";
 import { listOrder } from "@/api/business/order";
-import { listBetting} from "@/api/business/betting";
+import { listHistoryWeb} from "@/api/business/betting";
 import {allGameList } from "@/api/business/game_item";
 import {allList} from "@/api/business/lottery";
 
@@ -1150,25 +1183,88 @@ export default {
     },
   },
   methods: {
+    getBettingInfo(row){
+      let detailsCountVOList = row.detailsCountVOList;
+      if(!detailsCountVOList){
+        return "-";
+      }
+      let res = "";
+      let map = {};
+      for(var i in detailsCountVOList){
+        let item = detailsCountVOList[i];
+        let amount = map[item.bettingTtem];
+        if(!amount){
+          amount = 0;
+        }
+        amount += item.orderAmount;
+        map[item.bettingTtem] = amount;
+      }
+      for(var i in map){
+        if(res.length > 0){
+          res += " | "
+        }
+        // res += this.gameItemMap[i+"_"+row.gameId] + ":" + map[i];
+        res += i + ":" + map[i];
+      }
+      return res;
+    },
+    getBettingAmount(row){
+      let detailsCountVOList = row.detailsCountVOList;
+      if(!detailsCountVOList){
+        return "-";
+      }
+      let amount = 0;
+      for(var i in detailsCountVOList){
+        let item = detailsCountVOList[i];
+        amount += parseInt(item.orderAmount);
+      }
+      return amount;
+    },
+    getBettingWinAmount(row){
+      let detailsCountVOList = row.detailsCountVOList;
+      if(!detailsCountVOList){
+        return "-";
+      }
+      let amount = 0;
+      for(var i in detailsCountVOList){
+        let item = detailsCountVOList[i];
+        amount += parseInt(item.winAmount);
+      }
+      return amount;
+    },
+    getBettingWinLoseAmount(row){
+      let detailsCountVOList = row.detailsCountVOList;
+      if(!detailsCountVOList){
+        return "-";
+      }
+      let amount = 0;
+      for(var i in detailsCountVOList){
+        let item = detailsCountVOList[i];
+        amount += (parseInt(item.winAmount) - (parseInt(item.orderAmount) - parseInt(item.loseAmount))) - parseInt(item.loseAmount);
+      }
+      return amount;
+    },
     getItemName(row){
       let that = this;
       let bettingGameType = row.bettingGameType;
-      let bettingItem = row.bettingItem;
+      let bettingItem = row.gameLotterySucc;
       let gameId = row.gameId;
-      if("0" == bettingGameType){
-        return that.gameItemMap[bettingItem+"_"+gameId];
-      }else{
+      /*if("0" == bettingGameType){
+        // return that.gameItemMap[bettingItem+"_"+gameId];
+        return bettingItem;
+      }else{*/
         let name = "";
-        let arr = JSON.parse(bettingItem);
+        let arr = bettingItem.split(",")
         for(var i in arr){
           let item = arr[i];
           if("" != name){
-            name = name + ",";
+            name = name + "|";
           }
-          name = name + that.gameItemMap[item["bettingItem"]+"_"+gameId];
+          // name = name + that.gameItemMap[item+"_"+gameId];
+          name = name + item;
         }
         return name;
-      }
+      // }
     },
     getTypeName(id) {
       return this.typeMap[id.toString()];
@@ -1236,7 +1332,7 @@ export default {
     getBettingList() {
       this.bettingLoading = true;
       this.queryBettingParams.userId = this.userInfo.userid;
-      listBetting(this.queryBettingParams).then(response => {
+      listHistoryWeb(this.queryBettingParams).then(response => {
         this.bettingList = response.rows;
         this.bettingTotal = response.total;
         this.bettingLoading = false;