|
@@ -47,8 +47,10 @@ public class AppAgentGameBettingTask {
|
|
|
@Async("asyncExecutor")
|
|
|
public void agentGameBettingTask(AppGameBetting appGameBetting) {
|
|
|
|
|
|
+ List<AppUserGameRecordCount> recordCountList = new ArrayList<>();
|
|
|
+
|
|
|
// 主播分佣
|
|
|
- liveCommissionHandler(appGameBetting);
|
|
|
+ liveCommissionHandler(appGameBetting, recordCountList);
|
|
|
|
|
|
AppUserAgent userIdObject = new AppUserAgent();
|
|
|
userIdObject.setUserId(appGameBetting.getUserId());
|
|
@@ -63,7 +65,6 @@ public class AppAgentGameBettingTask {
|
|
|
|
|
|
getGameRate(appGameBetting.getGameId(), userAgent.getPid(), userAgent.getUserId(), gameRateList);
|
|
|
if(gameRateList.isEmpty()){
|
|
|
- List<AppUserGameRecordCount> recordCountList = new ArrayList<>();
|
|
|
AppUserGameRecordCount recordCount = new AppUserGameRecordCount();
|
|
|
recordCount.setGameId(appGameBetting.getGameId());
|
|
|
recordCount.setUserId(appGameBetting.getUserId());
|
|
@@ -71,11 +72,11 @@ public class AppAgentGameBettingTask {
|
|
|
recordCount.setCommission(0.00);
|
|
|
recordCount.setGameRate(0.00);
|
|
|
recordCountList.add(recordCount);
|
|
|
- appUserCountService.staticsUserBetting(appGameBetting,recordCountList);
|
|
|
+ appUserCountService.staticsUserBetting(appGameBetting, recordCountList);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- List<AppUserGameRecordCount> recordCountList = commissionHandler(gameRateList, appGameBetting);
|
|
|
+ commissionHandler(gameRateList, appGameBetting, recordCountList);
|
|
|
|
|
|
//统计游戏下注、返佣情况
|
|
|
appUserCountService.staticsUserBetting(appGameBetting,recordCountList);
|
|
@@ -116,9 +117,7 @@ public class AppAgentGameBettingTask {
|
|
|
}
|
|
|
|
|
|
@Transactional
|
|
|
- public List<AppUserGameRecordCount> commissionHandler(List<AppGameCommission> gameRateList, AppGameBetting appGameBetting){
|
|
|
-
|
|
|
- List<AppUserGameRecordCount> recordCountList = new ArrayList<>();
|
|
|
+ public void commissionHandler(List<AppGameCommission> gameRateList, AppGameBetting appGameBetting, List<AppUserGameRecordCount> recordCountList){
|
|
|
|
|
|
// 升序排序
|
|
|
Collections.sort(gameRateList, Comparator.comparing(AppGameCommission::getGameRate));
|
|
@@ -248,12 +247,10 @@ public class AppAgentGameBettingTask {
|
|
|
finTranRecord.setOrderId(appGameBetting.getId());
|
|
|
finTranRecordService.insertFinTranRecord(finTranRecord);
|
|
|
}
|
|
|
-
|
|
|
- return recordCountList;
|
|
|
}
|
|
|
|
|
|
@Transactional
|
|
|
- public void liveCommissionHandler(AppGameBetting appGameBetting){
|
|
|
+ public void liveCommissionHandler(AppGameBetting appGameBetting, List<AppUserGameRecordCount> recordCountList){
|
|
|
|
|
|
if(appGameBetting.getIsLive() == 0){
|
|
|
return;
|
|
@@ -293,6 +290,7 @@ public class AppAgentGameBettingTask {
|
|
|
appUserGameRecordCount.setCommission(gameRateAmount);
|
|
|
|
|
|
appUserGameRecordCountService.save(appUserGameRecordCount);
|
|
|
+ recordCountList.add(appUserGameRecordCount);
|
|
|
|
|
|
FinTranRecord finTranRecord = new FinTranRecord();
|
|
|
|