|
@@ -1,20 +1,24 @@
|
|
|
package com.game.business.service.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
|
-import java.util.Collections;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
import com.game.business.domain.AppUser;
|
|
|
import com.game.business.domain.CfgCommon;
|
|
|
import com.game.business.dto.AppUserTeamTranserDto;
|
|
|
import com.game.business.dto.AppUserTeamTranserRecordDto;
|
|
|
+import com.game.business.dto.FinTranRecordDTO;
|
|
|
+import com.game.business.service.IAppGameBettingService;
|
|
|
import com.game.business.service.IAppUserService;
|
|
|
import com.game.business.service.ICfgCommonService;
|
|
|
import com.game.business.util.Md5Utils;
|
|
|
-import com.game.business.vo.AppUserTeamTranserRecordVo;
|
|
|
import com.game.common.annotation.DataSource;
|
|
|
import com.game.common.constant.AppSceneType;
|
|
|
import com.game.common.constant.finance.FinTranAddedInfo;
|
|
@@ -22,6 +26,7 @@ import com.game.common.constant.finance.FinTranType1;
|
|
|
import com.game.common.constant.finance.FinTranType3;
|
|
|
import com.game.common.constant.finance.TranCurrencyType;
|
|
|
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.enums.DataSourceType;
|
|
|
import com.game.common.utils.DateUtils;
|
|
@@ -32,7 +37,6 @@ import org.springframework.stereotype.Service;
|
|
|
import com.game.business.mapper.FinTranRecordMapper;
|
|
|
import com.game.business.domain.FinTranRecord;
|
|
|
import com.game.business.service.IFinTranRecordService;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
* 消费记录Service业务层处理
|
|
@@ -58,6 +62,9 @@ public class FinTranRecordServiceImpl extends ServiceImpl<FinTranRecordMapper, F
|
|
|
@Autowired
|
|
|
private ICfgCommonService cfgCommonService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IAppGameBettingService appGameBettingService;
|
|
|
+
|
|
|
|
|
|
* 查询消费记录
|
|
|
*
|
|
@@ -261,4 +268,50 @@ public class FinTranRecordServiceImpl extends ServiceImpl<FinTranRecordMapper, F
|
|
|
List<FinTranRecord> list = finTranRecordMapper.selectList(queryWrapper);
|
|
|
return list;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public R selecFinTranRecordCount(FinTranRecordDTO finTranRecordDTO) {
|
|
|
+
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+
|
|
|
+
|
|
|
+ Map<String, BigDecimal> userCount = appUserService.getUserCount(finTranRecordDTO.getUserId());
|
|
|
+ jsonObject.put("userCount", userCount);
|
|
|
+
|
|
|
+
|
|
|
+ Map<String, BigDecimal> bettingAmountSum = appGameBettingService.getBettingAmountSum(finTranRecordDTO.getUserId());
|
|
|
+ jsonObject.put("bettingAmountSum", bettingAmountSum);
|
|
|
+
|
|
|
+
|
|
|
+ Map<String, BigDecimal> rechargeCount = finTranRecordMapper.getRechargeSum(finTranRecordDTO.getUserId());
|
|
|
+ jsonObject.put("rechargeCount", rechargeCount);
|
|
|
+
|
|
|
+
|
|
|
+ Map<String, BigDecimal> exchangeCount = finTranRecordMapper.getExchangeSum(finTranRecordDTO.getUserId());
|
|
|
+ jsonObject.put("exchangeCount", exchangeCount);
|
|
|
+
|
|
|
+
|
|
|
+ BigDecimal withdraw = finTranRecordMapper.getWithdrawSum(finTranRecordDTO.getUserId());
|
|
|
+ jsonObject.put("withdraw", withdraw);
|
|
|
+
|
|
|
+
|
|
|
+ Map<String, BigDecimal> bettingAmountDateSum = appGameBettingService.getBettingAmountByDateSum(finTranRecordDTO);
|
|
|
+ jsonObject.put("bettingAmountDateSum", bettingAmountDateSum);
|
|
|
+
|
|
|
+
|
|
|
+ List<Map<String, Object>> rechargeByDateSum = finTranRecordMapper.getRechargeByDateSum(finTranRecordDTO);
|
|
|
+ if(rechargeByDateSum == null){
|
|
|
+ rechargeByDateSum = new ArrayList<>();
|
|
|
+ }
|
|
|
+ jsonObject.put("rechargeByDateSum", rechargeByDateSum);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ List<Map<String, Object>> withdrawByDateSum = finTranRecordMapper.getWithdrawByDateSum(finTranRecordDTO);
|
|
|
+ if(withdrawByDateSum == null){
|
|
|
+ withdrawByDateSum = new ArrayList<>();
|
|
|
+ }
|
|
|
+ jsonObject.put("withdrawByDateSum", withdrawByDateSum);
|
|
|
+ return R.ok(jsonObject);
|
|
|
+ }
|
|
|
}
|