|
@@ -41,6 +41,9 @@ public class AppAgentGameBettingTask {
|
|
|
@Async("asyncExecutor")
|
|
|
public void agentGameBettingTask(AppGameBetting appGameBetting) {
|
|
|
|
|
|
+
|
|
|
+ liveCommissionHandler(appGameBetting);
|
|
|
+
|
|
|
AppUserAgent userIdObject = new AppUserAgent();
|
|
|
userIdObject.setUserId(appGameBetting.getUserId());
|
|
|
List<AppUserAgent> userAgents = appUserAgentService.selectAppUserAgentList(userIdObject);
|
|
@@ -181,7 +184,7 @@ public class AppAgentGameBettingTask {
|
|
|
finTranRecord.setSceneId2(null);
|
|
|
finTranRecord.setSceneType(0L);
|
|
|
|
|
|
- finTranRecord.setTranGroupId(appGameCommission.getId());
|
|
|
+ finTranRecord.setTranGroupId(appGameBetting.getId());
|
|
|
finTranRecord.setTranType1(FinTranType1.U_Income_Coin.getType());
|
|
|
finTranRecord.setTranType2(FinTranType2.REWARD_Income.getType());
|
|
|
finTranRecord.setTranType3(FinTranType3.RECOMMEND_ADD_AMOUNT.getType());
|
|
@@ -210,4 +213,94 @@ public class AppAgentGameBettingTask {
|
|
|
finTranRecordService.insertFinTranRecord(finTranRecord);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private void liveCommissionHandler(AppGameBetting appGameBetting){
|
|
|
+
|
|
|
+ if(appGameBetting.getIsLive() == 0){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ AppUser appUser = appUserService.selectAppUserByUserid(appGameBetting.getLiveUserId());
|
|
|
+ if(appUser == null){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ double gameRateAmount = appGameBetting.getBettingAmount() * 0.0003;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if(appGameBetting.getBettingType() == 0){
|
|
|
+ appUser.setDiamondCoin(appUser.getDiamondCoin() + gameRateAmount);
|
|
|
+ appUser.setDiamondCoinTotal(appUser.getDiamondCoinTotal() + gameRateAmount);
|
|
|
+ appUserService.updateAppUser(appUser);
|
|
|
+
|
|
|
+ }else{
|
|
|
+ appUser.setCoin(appUser.getCoin() + gameRateAmount);
|
|
|
+ appUserService.updateAppUser(appUser);
|
|
|
+ }
|
|
|
+
|
|
|
+ redisCache.deleteObject("U:UserInfo:" + appUser.getUserid());
|
|
|
+
|
|
|
+ FinTranRecord finTranRecord = new FinTranRecord();
|
|
|
+
|
|
|
+ if(appGameBetting.getBettingType() == 0){
|
|
|
+ finTranRecord.setCurrencyType(4L);
|
|
|
+ finTranRecord.setAfterDiamondCoin(appUser.getDiamondCoin());
|
|
|
+ finTranRecord.setDiamondCoinChange(gameRateAmount);
|
|
|
+
|
|
|
+ finTranRecord.setAfterCoin(appUser.getCoin());
|
|
|
+ finTranRecord.setCoinChange(0.00);
|
|
|
+ }else{
|
|
|
+ finTranRecord.setCurrencyType(2L);
|
|
|
+ finTranRecord.setAfterCoin(appUser.getCoin());
|
|
|
+ finTranRecord.setCoinChange(gameRateAmount);
|
|
|
+
|
|
|
+ finTranRecord.setAfterDiamondCoin(appUser.getDiamondCoin());
|
|
|
+ finTranRecord.setDiamondCoinChange(0.00);
|
|
|
+ }
|
|
|
+
|
|
|
+ finTranRecord.setAfterMoney(0.00);
|
|
|
+ finTranRecord.setMoneyChange(0.00);
|
|
|
+
|
|
|
+ finTranRecord.setAfterTicket(0.00);
|
|
|
+ finTranRecord.setTicketChange(0.00);
|
|
|
+
|
|
|
+ finTranRecord.setToUid(appUser.getUserid());
|
|
|
+ finTranRecord.setUid(appUser.getUserid());
|
|
|
+ finTranRecord.setFromUid(appGameBetting.getUserId());
|
|
|
+
|
|
|
+ finTranRecord.setSceneId1(0L);
|
|
|
+ finTranRecord.setSceneId2(null);
|
|
|
+ finTranRecord.setSceneType(0L);
|
|
|
+
|
|
|
+ finTranRecord.setTranGroupId(appGameBetting.getId());
|
|
|
+ finTranRecord.setTranType1(FinTranType1.U_Income_Coin.getType());
|
|
|
+ finTranRecord.setTranType2(FinTranType2.REWARD_Income.getType());
|
|
|
+ finTranRecord.setTranType3(FinTranType3.RECOMMEND_ADD_AMOUNT.getType());
|
|
|
+
|
|
|
+ finTranRecord.setRemarks("游戏分佣");
|
|
|
+
|
|
|
+ finTranRecord.setConsumptionCoin(0.00);
|
|
|
+ finTranRecord.setConsumptionMoney(0.00);
|
|
|
+ finTranRecord.setCommissionRelatedUid(0L);
|
|
|
+ finTranRecord.setAgentId(appUser.getAgentId());
|
|
|
+
|
|
|
+ finTranRecord.setCreateTime(new Date());
|
|
|
+
|
|
|
+ finTranRecord.setFromUid(0L);
|
|
|
+ finTranRecord.setGoodsId(0L);
|
|
|
+ finTranRecord.setGuildId(0L);
|
|
|
+ finTranRecord.setManagerCoId(0L);
|
|
|
+ finTranRecord.setManagerId(0L);
|
|
|
+
|
|
|
+ finTranRecord.setPerc(0.00);
|
|
|
+ finTranRecord.setProId(0L);
|
|
|
+ finTranRecord.setProCount(0L);
|
|
|
+
|
|
|
+ finTranRecord.setOrderId(appGameBetting.getId());
|
|
|
+ finTranRecord.setId(IdUtil.getSnowflakeNextId());
|
|
|
+ finTranRecordService.insertFinTranRecord(finTranRecord);
|
|
|
+
|
|
|
+ }
|
|
|
}
|