Procházet zdrojové kódy

Merge remote-tracking branch 'origin/master'

kk před 1 měsícem
rodič
revize
7bbedadb47

+ 2 - 1
game-business/src/main/java/com/game/business/controller/AppUserController.java

@@ -134,7 +134,8 @@ public class AppUserController extends BaseController
         startPage();
         FinTranRecord finTranRecord = new FinTranRecord();
         finTranRecord.setTranType1(FinTranType1.U_Income_Coin.getType());
-        finTranRecord.setTranType2(FinTranType2.CONSUM_SEND_GIFT.getType());
+        finTranRecord.setTranType2(FinTranType2.REWARD_Income.getType());
+        finTranRecord.setTranType3(FinTranType3.RECOMMEND_ADD_AMOUNT.getType());
         finTranRecord.setToUid(userId);
         List<FinTranRecord> list = finTranRecordService.selectFinTranRecordList(finTranRecord);
         return getDataTable(list);

+ 3 - 5
game-business/src/main/java/com/game/business/service/impl/FinTranRecordServiceImpl.java

@@ -23,10 +23,7 @@ import com.game.business.util.Md5Utils;
 import com.game.business.vo.FinTranVo;
 import com.game.common.annotation.DataSource;
 import com.game.common.constant.AppSceneType;
-import com.game.common.constant.finance.FinTranAddedInfo;
-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.constant.finance.*;
 import com.game.common.core.domain.HttpRet;
 import com.game.common.core.domain.R;
 import com.game.common.core.redis.RedisCache;
@@ -337,7 +334,8 @@ public class FinTranRecordServiceImpl extends ServiceImpl<FinTranRecordMapper, F
         if(0 == finTranDto.getTranType().intValue()){
             //直播收益
             finTranDto.setTranType1(FinTranType1.U_Income_Coin.getType());
-            finTranDto.setTranType3(FinTranType3.CONSUM_LIVE_ROOM_REWARD.getType());
+            finTranDto.setTranType2(FinTranType2.REWARD_Income.getType());
+            finTranDto.setTranType3(FinTranType3.RECOMMEND_ADD_AMOUNT.getType());
         }else{
             finTranDto.setTranType3(FinTranType3.CHARGE_IN_INVITE.getType());
         }

+ 7 - 4
game-business/src/main/java/com/game/business/task/AppUserCountTask.java

@@ -8,6 +8,7 @@ import com.game.business.domain.*;
 import com.game.business.service.*;
 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.redis.RedisCache;
@@ -165,12 +166,13 @@ public class AppUserCountTask {
                     ).mapToDouble(FinTranRecord::getCoinChange).sum());
                     //直播收益
                     List<Integer> profitTypeList = Arrays.asList(
-                            FinTranType3.CONSUM_LIVE_ROOM_REWARD.getType()
+                            FinTranType3.RECOMMEND_ADD_AMOUNT.getType()
                     );
                     appUserCount.setLiveProfit(finTranRecordList.stream().filter(e->
                             e.getUid().equals(appUser.getUserid()) &&
                                     profitTypeList.contains(e.getTranType3()) &&
-                                    FinTranType1.U_Income_Coin.getType() == e.getTranType1().intValue()
+                                    FinTranType1.U_Income_Coin.getType() == e.getTranType1().intValue()&&
+                                    FinTranType2.REWARD_Income.getType() == e.getTranType2().intValue()
                     ).mapToDouble(FinTranRecord::getCoinChange).sum());
                     appUserCountService.createAppUserCount(appUserCount);
                 });
@@ -289,12 +291,13 @@ public class AppUserCountTask {
                     ).mapToDouble(FinTranRecord::getCoinChange).sum());
                     //直播收益
                     List<Integer> profitTypeList = Arrays.asList(
-                            FinTranType3.CONSUM_LIVE_ROOM_REWARD.getType()
+                            FinTranType3.RECOMMEND_ADD_AMOUNT.getType()
                     );
                     appUserCount.setLiveProfit(finTranRecordList.stream().filter(e->
                             e.getUid().equals(appUser.getUserid()) &&
                                     profitTypeList.contains(e.getTranType3()) &&
-                                    FinTranType1.U_Income_Coin.getType() == e.getTranType1().intValue()
+                                    FinTranType1.U_Income_Coin.getType() == e.getTranType1().intValue()&&
+                                    FinTranType2.REWARD_Income.getType() == e.getTranType2().intValue()
                     ).mapToDouble(FinTranRecord::getCoinChange).sum());
                     appUserCount.setUpdate(true);
                     appUserCountService.createAppUserCount(appUserCount);

+ 11 - 4
game-business/src/main/java/com/game/business/task/AppUserLiveDividedTask.java

@@ -92,10 +92,10 @@ public class AppUserLiveDividedTask {
         }
         liveRateList.add(userAgent);
 
-        // 只需要获取直属上级
+        /*// 只需要获取直属上级
         if(num == 1){
             return;
-        }
+        }*/
         num ++;
         getLiveRate(userAgent.getPid(), liveRateList, num);
 
@@ -114,6 +114,7 @@ public class AppUserLiveDividedTask {
         BigDecimal liveCommission = item.getMoney().multiply(liveRate).setScale(4, RoundingMode.DOWN);
 
         double indexCommission = 0;
+        FinTranRecord superTran = finTranRecordService.selectFinTranRecordById(item.getOtherId());
 
         for (int i = 0; i < liveRateList.size(); i++) {
 
@@ -183,7 +184,13 @@ public class AppUserLiveDividedTask {
 
             finTranRecord.setToUid(appUser.getUserid());
             finTranRecord.setUid(appUser.getUserid());
-            finTranRecord.setFromUid(item.getUserId());
+            //主播记录礼物来源为刷礼物的人
+            if(null != superTran && item.getUserId().equals(appUser.getUserid())){
+                finTranRecord.setFromUid(superTran.getUid());
+            }else{
+                finTranRecord.setFromUid(item.getUserId());
+            }
+
 
             finTranRecord.setSceneId1(0L);
             finTranRecord.setSceneId2(null);
@@ -201,7 +208,7 @@ public class AppUserLiveDividedTask {
             finTranRecord.setTranType3(FinTranType3.RECOMMEND_ADD_AMOUNT.getType());
 
 
-            finTranRecord.setRemarks("直播分佣");
+            finTranRecord.setRemarks(null==superTran?"直播分佣":superTran.getRemarks());
 
             finTranRecord.setConsumptionCoin(0.00);
             finTranRecord.setConsumptionMoney(0.00);