Jelajahi Sumber

Merge remote-tracking branch 'origin/package' into package

bilingfeng 1 tahun lalu
induk
melakukan
3d85ae307f

+ 4 - 2
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/AdsAccountRechargeRankingServiceImpl.java

@@ -1,5 +1,6 @@
 package com.zanxiang.game.data.serve.service.impl;
 
+import com.github.sd4324530.jtuple.Tuple2;
 import com.google.common.base.CaseFormat;
 import com.zanxiang.game.data.serve.component.DataPowerComponent;
 import com.zanxiang.game.data.serve.pojo.dto.AdsAccountRechargeRankingListDTO;
@@ -37,8 +38,9 @@ public class AdsAccountRechargeRankingServiceImpl implements IAdsAccountRecharge
 
     @Override
     public Page<AdsAccountRechargeRankingVO> listOfPage(AdsAccountRechargeRankingListDTO dto) {
-        List<Long> userIds = dto.getPitcherId() == null ? dataPowerComponent.getSubUserIdList() : Collections.singletonList(dto.getPitcherId());
-        List<Long> gameIds = dto.getGameId() == null ? dataPowerComponent.getSubGameIdList() : Collections.singletonList(dto.getGameId());
+        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        List<Long> userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
+        List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
         if (StringUtils.isBlank(dto.getSortFiled())) {
             dto.setSortFiled("cost");
         }

+ 3 - 1
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/AdsAgentRechargeRankingServiceImpl.java

@@ -1,5 +1,6 @@
 package com.zanxiang.game.data.serve.service.impl;
 
+import com.github.sd4324530.jtuple.Tuple2;
 import com.google.common.base.CaseFormat;
 import com.zanxiang.game.data.serve.component.DataPowerComponent;
 import com.zanxiang.game.data.serve.pojo.dto.AdsAgentRechargeRankingListDTO;
@@ -36,7 +37,8 @@ public class AdsAgentRechargeRankingServiceImpl implements IAdsAgentRechargeRank
     private DataPowerComponent dataPowerComponent;
 
     public Page<AdsAgentRechargeRankingVO> listOfPage(AdsAgentRechargeRankingListDTO dto) {
-        List<Long> userIds = dto.getPitcherId() == null ? dataPowerComponent.getSubUserIdList() : Collections.singletonList(dto.getPitcherId());
+        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        List<Long> userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
         if (StringUtils.isBlank(dto.getSortFiled())) {
             dto.setSortFiled("today_amount");
         }

+ 9 - 6
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/PitcherDataServiceImpl.java

@@ -556,8 +556,9 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
      */
     @Override
     public PitcherGameDataDayTotalVO getPitcherGameDataDayTotal(PitcherGameDataDayTotalDTO dto) {
-        List<Long> userIds = dto.getPitcherId() == null ? dataPowerComponent.getSubUserIdList() : Collections.singletonList(dto.getPitcherId());
-        List<Long> gameIds = dto.getGameId() == null ? dataPowerComponent.getSubGameIdList() : Collections.singletonList(Long.parseLong(dto.getGameId()));
+        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        List<Long> userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
+        List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(Long.parseLong(dto.getGameId()));
         //不传递时间,默认查询当天
         if (dto.getBeginDate() == null || dto.getEndDate() == null) {
             dto.setBeginDate(LocalDate.now());
@@ -607,8 +608,9 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
      */
     @Override
     public Page<PitcherGameDataTotalVO> getPitcherGameDataTotal(PitcherGameDataTotalDTO dto) {
-        List<Long> userIds = dto.getPitcherId() == null ? dataPowerComponent.getSubUserIdList() : Collections.singletonList(dto.getPitcherId());
-        List<Long> gameIds = dto.getGameId() == null ? dataPowerComponent.getSubGameIdList() : Collections.singletonList(Long.parseLong(dto.getGameId()));
+        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        List<Long> userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
+        List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(Long.parseLong(dto.getGameId()));
         //如果注册时间参数为空,默认设置查询当天数据
         if (dto.getBeginDate() == null || dto.getEndDate() == null) {
             dto.setBeginDate(LocalDate.now());
@@ -705,8 +707,9 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
      */
     @Override
     public PitcherGameDataTotalSumVO getPitcherGameDataTotalSum(PitcherGameDataTotalSumDTO dto) {
-        List<Long> userIds = dto.getPitcherId() == null ? dataPowerComponent.getSubUserIdList() : Collections.singletonList(dto.getPitcherId());
-        List<Long> gameIds = dto.getGameId() == null ? dataPowerComponent.getSubGameIdList() : Collections.singletonList(Long.parseLong(dto.getGameId()));
+        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        List<Long> userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
+        List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(Long.parseLong(dto.getGameId()));
         //如果注册时间参数为空,默认设置查询当天数据
         if (dto.getBeginDate() == null || dto.getEndDate() == null) {
             dto.setBeginDate(LocalDate.now());

+ 29 - 14
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/PlayerDataServiceImpl.java

@@ -1,5 +1,6 @@
 package com.zanxiang.game.data.serve.service.impl;
 
+import com.github.sd4324530.jtuple.Tuple2;
 import com.zanxiang.game.data.serve.component.DataPowerComponent;
 import com.zanxiang.game.data.serve.pojo.dto.PlayerBannedListDTO;
 import com.zanxiang.game.data.serve.pojo.dto.PlayerDataListDTO;
@@ -53,8 +54,9 @@ public class PlayerDataServiceImpl implements IPlayerDataService {
      */
     @Override
     public Page<PlayerDataVO> getPlayerDataList(PlayerDataListDTO dto) {
-        List<Long> gameIds = dto.getGameId() == null ? dataPowerComponent.getSubGameIdList() : Collections.singletonList(dto.getGameId());
-        List<Long> pitcherIds = StringUtils.isBlank(dto.getPitcherId()) ? dataPowerComponent.getSubUserIdList() : Collections.singletonList(Long.valueOf(dto.getPitcherId()));
+        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        List<Long> pitcherIds = StringUtils.isBlank(dto.getPitcherId()) ? poerInfo.first : Collections.singletonList(Long.valueOf(dto.getPitcherId()));
+        List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
 
         //创建查询条件
         Criteria cri = Cnd.cri();
@@ -208,6 +210,9 @@ public class PlayerDataServiceImpl implements IPlayerDataService {
      */
     @Override
     public Page<PlayerRoleDataVO> getPlayerRoleDataList(PlayerRoleDataListDTO dto) {
+        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        List<Long> pitcherIds = StringUtils.isBlank(dto.getPitcherId()) ? poerInfo.first : Collections.singletonList(Long.valueOf(dto.getPitcherId()));
+        List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
         //查询条件
         Criteria cri = Cnd.cri();
         if (dto.getUserId() != null) {
@@ -238,9 +243,6 @@ public class PlayerDataServiceImpl implements IPlayerDataService {
         if (dto.getCpId() != null) {
             cri.where().andEquals("cp_id", dto.getCpId());
         }
-        if (dto.getGameId() != null) {
-            cri.where().andEquals("game_id", dto.getGameId());
-        }
         if (dto.getGameCategoryId() != null) {
             //游戏应用类型
             cri.where().andEquals("game_category_id", dto.getGameCategoryId());
@@ -253,8 +255,11 @@ public class PlayerDataServiceImpl implements IPlayerDataService {
             //渠道ID
             cri.where().andIn("agent_id", dto.getChannelId().toArray(String[]::new));
         }
-        if (StringUtils.isNotBlank(dto.getPitcherId())) {
-            cri.where().andEquals("pitcher_id", dto.getPitcherId());
+        if (pitcherIds != null) {
+            cri.where().andInList("pitcher_id", pitcherIds);
+        }
+        if (gameIds != null) {
+            cri.where().andInList("game_id", gameIds);
         }
         if (StringUtils.isNotBlank(dto.getOs())) {
             cri.where().andEquals("os", dto.getOs());
@@ -338,8 +343,16 @@ public class PlayerDataServiceImpl implements IPlayerDataService {
         return new Page<>(list, pager);
     }
 
+    /**
+     * 玩家角色列表总计一栏
+     * @param dto PlayerRoleDataListDTO
+     * @return PlayerRoleDataVO
+     */
     @Override
     public PlayerRoleDataVO getPlayerRoleTotalData(PlayerRoleDataListDTO dto) {
+        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        List<Long> pitcherIds = StringUtils.isBlank(dto.getPitcherId()) ? poerInfo.first : Collections.singletonList(Long.valueOf(dto.getPitcherId()));
+        List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
         //查询条件
         Criteria cri = Cnd.cri();
         if (dto.getUserId() != null) {
@@ -370,9 +383,6 @@ public class PlayerDataServiceImpl implements IPlayerDataService {
         if (dto.getCpId() != null) {
             cri.where().andEquals("cp_id", dto.getCpId());
         }
-        if (dto.getGameId() != null) {
-            cri.where().andEquals("game_id", dto.getGameId());
-        }
         if (dto.getGameCategoryId() != null) {
             //游戏应用类型
             cri.where().andEquals("game_category_id", dto.getGameCategoryId());
@@ -385,8 +395,11 @@ public class PlayerDataServiceImpl implements IPlayerDataService {
             //渠道ID
             cri.where().andIn("agent_id", dto.getChannelId().toArray(String[]::new));
         }
-        if (StringUtils.isNotBlank(dto.getPitcherId())) {
-            cri.where().andEquals("pitcher_id", dto.getPitcherId());
+        if (pitcherIds != null) {
+            cri.where().andInList("pitcher_id", pitcherIds);
+        }
+        if (gameIds != null) {
+            cri.where().andInList("game_id", gameIds);
         }
         if (StringUtils.isNotBlank(dto.getOs())) {
             cri.where().andEquals("os", dto.getOs());
@@ -451,6 +464,8 @@ public class PlayerDataServiceImpl implements IPlayerDataService {
      */
     @Override
     public Page<Map> getPlayerLoginLogDataList(PlayerLoginLogDataListDTO dto) {
+        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
         //查询条件
         Criteria cri = Cnd.cri();
         if (StringUtils.isNotBlank(dto.getSourceSystem())) {
@@ -466,8 +481,8 @@ public class PlayerDataServiceImpl implements IPlayerDataService {
         if (dto.getUserId() != null) {
             cri.where().andEquals("user_id", dto.getUserId());
         }
-        if (dto.getGameId() != null) {
-            cri.where().andEquals("game_id", dto.getGameId());
+        if (gameIds != null) {
+            cri.where().andInList("game_id", gameIds);
         }
         if (dto.getGameClassify() != null) {
             cri.where().andEquals("classify", dto.getGameClassify());

+ 5 - 2
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/RankingServiceImpl.java

@@ -1,5 +1,6 @@
 package com.zanxiang.game.data.serve.service.impl;
 
+import com.github.sd4324530.jtuple.Tuple2;
 import com.google.common.base.CaseFormat;
 import com.zanxiang.game.data.serve.component.DataPowerComponent;
 import com.zanxiang.game.data.serve.pojo.dto.RechargeRankingDTO;
@@ -34,7 +35,8 @@ public class RankingServiceImpl implements IRankingService {
 
     @Override
     public Page<GameRechargeRankingVO> gameRanking(RechargeRankingDTO dto) {
-        List<Long> gameIds = dto.getGameId() == null ? dataPowerComponent.getSubGameIdList() : Collections.singletonList(dto.getGameId());
+        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
         if (StringUtils.isBlank(dto.getSortFiled())){
             dto.setSortFiled("totalAmount");
         }
@@ -94,7 +96,8 @@ public class RankingServiceImpl implements IRankingService {
 
     @Override
     public Page<PlayerRechargeRankingVO> playerRanking(RechargeRankingDTO dto) {
-        List<Long> gameIds = dto.getGameId() == null ? dataPowerComponent.getSubGameIdList() : Collections.singletonList(dto.getGameId());
+        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
         if (StringUtils.isBlank(dto.getSortFiled())){
             dto.setSortFiled("totalAmount");
         }