Prechádzať zdrojové kódy

Revert "修改权限-布谷数据使用"

This reverts commit e37a09090f4c80815d8f1195b52d070663a7b81d.
Letianhua 1 rok pred
rodič
commit
7d2304f1cd

+ 0 - 6
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/AdsOrderDetailListDTO.java

@@ -222,10 +222,4 @@ public class AdsOrderDetailListDTO extends BasePage {
     @ApiModelProperty(notes = "广告ID")
     private String projectId;
 
-    /**
-     * 订单渠道类型
-     */
-    @ApiModelProperty(notes = "订单渠道类型:买量 -> buy ; 自然量 -> nature")
-    private String orderAgentType;
-
 }

+ 0 - 6
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/AdsOrderDetailTotalDTO.java

@@ -209,10 +209,4 @@ public class AdsOrderDetailTotalDTO {
     @ApiModelProperty(notes = "广告ID")
     private String projectId;
 
-    /**
-     * 订单渠道类型
-     */
-    @ApiModelProperty(notes = "订单渠道类型:买量 -> buy ; 自然量 -> nature")
-    private String orderAgentType;
-
 }

+ 32 - 67
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/AccountAgentDayServiceImpl.java

@@ -51,22 +51,13 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
 
     @Override
     public Page<GamePromoteDayVO> accountAgentDay(GamePromoteDayDTO dto) {
+        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        List<Long> userIds = dto.getSysUserId() == null ? poerInfo.first : Collections.singletonList(dto.getSysUserId());
+        List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
 
-        //默认查询‘ZX_ONE’数据
-        if (StringUtils.isBlank(dto.getSourceSystem())) {
-            dto.setSourceSystem("ZX_ONE");
-        }
-        List<Long> userIds;
-        List<Long> gameIds;
-        if ("ZX_ONE".equals(dto.getSourceSystem())) {
-            Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
-            userIds = dto.getSysUserId() == null ? poerInfo.first : Collections.singletonList(dto.getSysUserId());
-            gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
-        } else {
-            userIds = dto.getSysUserId() == null ? Collections.emptyList() : Collections.singletonList(dto.getSysUserId());
-            gameIds = dto.getGameId() == null ? Collections.emptyList() : Collections.singletonList(dto.getGameId());
-        }
-
+        /*Long sysUserId = SecurityUtil.isAdmin() ? null : SecurityUtil.getUserId();
+        sysUserId = null == dto.getSysUserId() ? sysUserId : dto.getSysUserId();
+        dto.setSysUserId(sysUserId);*/
         if (null == dto.getBeginDay() || null == dto.getEndDay()) {
             dto.setBeginDay(LocalDate.now());
             dto.setEndDay(LocalDate.now());
@@ -75,7 +66,7 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
         // 创建一个 Criteria 接口实例
         SimpleCriteria cri = Cnd.cri();
         // 组装条件
-        if (!CollectionUtils.isEmpty(userIds)) {
+        if (userIds != null) {
             cri.where().andInList("pitcher_id", userIds);
         }
         if (StringUtils.isNotBlank(dto.getAccountId())) {
@@ -93,7 +84,7 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
         if (StringUtils.isNotBlank(dto.getGameName())) {
             cri.where().andLike("game_name", dto.getGameName());
         }
-        if (!CollectionUtils.isEmpty(gameIds)) {
+        if (gameIds != null) {
             cri.where().andInList("game_id", gameIds);
         }
         if (StringUtils.isNotBlank(dto.getGameType())) {
@@ -255,21 +246,13 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
 
     @Override
     public GamePromoteDayTotalVO accountAgentDayTotal(GamePromoteDayTotalDTO dto) {
-        //默认查询‘ZX_ONE’数据
-        if (StringUtils.isBlank(dto.getSourceSystem())) {
-            dto.setSourceSystem("ZX_ONE");
-        }
-        List<Long> userIds;
-        List<Long> gameIds;
-        if ("ZX_ONE".equals(dto.getSourceSystem())) {
-            Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
-            userIds = dto.getSysUserId() == null ? poerInfo.first : Collections.singletonList(dto.getSysUserId());
-            gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
-        } else {
-            userIds = dto.getSysUserId() == null ? Collections.emptyList() : Collections.singletonList(dto.getSysUserId());
-            gameIds = dto.getGameId() == null ? Collections.emptyList() : Collections.singletonList(dto.getGameId());
-        }
+        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        List<Long> userIds = dto.getSysUserId() == null ? poerInfo.first : Collections.singletonList(dto.getSysUserId());
+        List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
 
+        /*Long sysUserId = SecurityUtil.isAdmin() ? null : SecurityUtil.getUserId();
+        sysUserId = null == dto.getSysUserId() ? sysUserId : dto.getSysUserId();
+        dto.setSysUserId(sysUserId);*/
         if (null == dto.getBeginDay() || null == dto.getEndDay()) {
             dto.setBeginDay(LocalDate.now());
             dto.setEndDay(LocalDate.now());
@@ -277,7 +260,7 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
         // 创建一个 Criteria 接口实例
         SimpleCriteria cri = Cnd.cri();
         // 组装条件
-        if (!CollectionUtils.isEmpty(userIds)) {
+        if (null != userIds) {
             cri.where().andInList("pitcher_id", userIds);
         }
         if (StringUtils.isNotBlank(dto.getAccountId())) {
@@ -298,7 +281,7 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
         if (StringUtils.isNotBlank(dto.getGameType())) {
             cri.where().andEquals("game_type", dto.getGameType());
         }
-        if (!CollectionUtils.isEmpty(gameIds)) {
+        if (gameIds != null) {
             cri.where().andInList("game_id", gameIds);
         }
         if (null != dto.getBeginDay()) {
@@ -471,21 +454,12 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
 
     @Override
     public Page<GamePromoteTotalVO> accountAgentTotal(GamePromoteTotalDTO dto) {
-        //默认查询‘ZX_ONE’数据
-        if (StringUtils.isBlank(dto.getSourceSystem())) {
-            dto.setSourceSystem("ZX_ONE");
-        }
-        List<Long> userIds;
-        List<Long> gameIds;
-        if ("ZX_ONE".equals(dto.getSourceSystem())) {
-            Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
-            userIds = dto.getSysUserId() == null ? poerInfo.first : Collections.singletonList(dto.getSysUserId());
-            gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
-        } else {
-            userIds = dto.getSysUserId() == null ? Collections.emptyList() : Collections.singletonList(dto.getSysUserId());
-            gameIds = dto.getGameId() == null ? Collections.emptyList() : Collections.singletonList(dto.getGameId());
-        }
-
+        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        List<Long> userIds = dto.getSysUserId() == null ? poerInfo.first : Collections.singletonList(dto.getSysUserId());
+        List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
+        /*Long sysUserId = SecurityUtil.isAdmin() ? null : SecurityUtil.getUserId();
+        sysUserId = null == dto.getSysUserId() ? sysUserId : dto.getSysUserId();
+        dto.setSysUserId(sysUserId);*/
         if (StringUtils.isBlank(dto.getSortFiled())) {
             dto.setSortFiled("cost");
         }
@@ -504,7 +478,7 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
         // 创建一个 Criteria 接口实例
         SimpleCriteria cri = Cnd.cri();
         // 组装条件
-        if (!CollectionUtils.isEmpty(userIds)) {
+        if (userIds != null) {
             cri.where().andInList("a.pitcher_id", userIds);
         }
         if (StringUtils.isNotBlank(dto.getAccountId())) {
@@ -531,7 +505,7 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
         if (null != dto.getCostEndDay()) {
             cri.where().and("a.dt", "<=", dto.getCostEndDay());
         }
-        if (!CollectionUtils.isEmpty(gameIds)) {
+        if (null != gameIds) {
             cri.where().andInList("a.game_id", gameIds);
         }
         if (StringUtils.isNotBlank(dto.getSourceSystem())) {
@@ -880,21 +854,12 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
 
     @Override
     public GamePromoteTotalSumVO accountAgentTotalSum(GamePromoteTotalSumDTO dto) {
-        //默认查询‘ZX_ONE’数据
-        if (StringUtils.isBlank(dto.getSourceSystem())) {
-            dto.setSourceSystem("ZX_ONE");
-        }
-        List<Long> userIds;
-        List<Long> gameIds;
-        if ("ZX_ONE".equals(dto.getSourceSystem())) {
-            Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
-            userIds = dto.getSysUserId() == null ? poerInfo.first : Collections.singletonList(dto.getSysUserId());
-            gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
-        } else {
-            userIds = dto.getSysUserId() == null ? Collections.emptyList() : Collections.singletonList(dto.getSysUserId());
-            gameIds = dto.getGameId() == null ? Collections.emptyList() : Collections.singletonList(dto.getGameId());
-        }
-
+        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        List<Long> userIds = dto.getSysUserId() == null ? poerInfo.first : Collections.singletonList(dto.getSysUserId());
+        List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
+        /*Long sysUserId = SecurityUtil.isAdmin() ? null : SecurityUtil.getUserId();
+        sysUserId = null == dto.getSysUserId() ? sysUserId : dto.getSysUserId();
+        dto.setSysUserId(sysUserId);*/
         if (null == dto.getCostEndDay() || null == dto.getCostBeginDay()) {
             dto.setCostBeginDay(LocalDate.now());
             dto.setCostEndDay(LocalDate.now());
@@ -1175,7 +1140,7 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
     private SimpleCriteria getSimpleCriteria(List<Long> userIds, List<Long> gameIds, GamePromoteTotalSumDTO dto) {
         SimpleCriteria cri = Cnd.cri();
         // 组装条件
-        if (!CollectionUtils.isEmpty(userIds)) {
+        if (null != userIds) {
             cri.where().andInList("a.pitcher_id", userIds);
         }
         if (StringUtils.isNotBlank(dto.getAccountId())) {
@@ -1196,7 +1161,7 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
         if (StringUtils.isNotBlank(dto.getGameType())) {
             cri.where().andEquals("a.game_type", dto.getGameType());
         }
-        if (!CollectionUtils.isEmpty(gameIds)) {
+        if (null != gameIds) {
             cri.where().andInList("a.game_id", gameIds);
         }
         if (StringUtils.isNotBlank(dto.getSourceSystem())) {

+ 12 - 50
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/AdsOrderDetailService.java

@@ -43,24 +43,14 @@ public class AdsOrderDetailService implements IAdsOrderDetailService {
 
     @Override
     public Page<AdsOrderDetailVO> listOfPage(AdsOrderDetailListDTO dto) {
-        if (StringUtils.isBlank(dto.getSourceSystem())) {
-            dto.setSourceSystem("ZX_ONE");
-        }
-        List<Long> userIds;
-        List<Long> gameIds;
-        if ("ZX_ONE".equals(dto.getSourceSystem())) {
-            Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
-            userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(Long.parseLong(dto.getPitcherId()));
-            gameIds = CollectionUtils.isEmpty(dto.getGameId()) ? poerInfo.second : dto.getGameId();
-        } else {
-            userIds = dto.getPitcherId() == null ? Collections.emptyList() : Collections.singletonList(Long.parseLong(dto.getPitcherId()));
-            gameIds = CollectionUtils.isEmpty(dto.getGameId()) ? Collections.emptyList() : dto.getGameId();
-        }
+        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        List<Long> userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(Long.parseLong(dto.getPitcherId()));
+        List<Long> gameIds = CollectionUtils.isEmpty(dto.getGameId()) ? poerInfo.second : dto.getGameId();
 
-        /*if (StringUtils.isBlank(dto.getPitcherId()) && !SecurityUtil.isManager()) {
+        if (StringUtils.isBlank(dto.getPitcherId()) && !SecurityUtil.isManager()) {
             // 只有管理员才能查看全部数据
             dto.setPitcherId(SecurityUtil.getUserId().toString());
-        }*/
+        }
         Criteria cri = Cnd.cri();
         if (StringUtils.isNotBlank(dto.getSourceSystem())) {
             cri.where().andEquals("source_system", dto.getSourceSystem());
@@ -86,7 +76,7 @@ public class AdsOrderDetailService implements IAdsOrderDetailService {
         if (StringUtils.isNotBlank(dto.getSourceServerName())) {
             cri.where().andLike("source_server_name", dto.getSourceServerName());
         }
-        if (CollectionUtils.isNotEmpty(gameIds)) {
+        if (gameIds != null) {
             cri.where().andInList("order_game_id", gameIds);
         }
         if (CollectionUtils.isNotEmpty(dto.getChannelId())) {
@@ -95,7 +85,7 @@ public class AdsOrderDetailService implements IAdsOrderDetailService {
         if (StringUtils.isNotBlank(dto.getAccountId())) {
             cri.where().andEquals("account_id", dto.getAccountId());
         }
-        if (CollectionUtils.isNotEmpty(userIds)) {
+        if (userIds != null) {
             cri.where().andInList("zx_pitcher_id", userIds);
         }
         if (StringUtils.isNotBlank(dto.getDeviceSystem())) {
@@ -148,15 +138,6 @@ public class AdsOrderDetailService implements IAdsOrderDetailService {
             //广告ID
             cri.where().andEquals("project_id", dto.getProjectId());
         }
-        if (StringUtils.isNotBlank(dto.getOrderAgentType())) {
-            if ("buy".equals(dto.getOrderAgentType())) {
-                //查询买量渠道订单
-                cri.where().andNotEquals("agent", 0);
-            } else if ("nature".equals(dto.getOrderAgentType())) {
-                //查询自然量订单
-                cri.where().andEquals("agent", 0);
-            }
-        }
         //添加判断,除去BG的数据 BG的数据在我们这找不到用户以及渠道
         cri.where().andNotIsNull("agent_name");
         cri.where().andNotIsNull("username");
@@ -199,19 +180,9 @@ public class AdsOrderDetailService implements IAdsOrderDetailService {
 
     @Override
     public AdsOrderDetailTotalVO orderTotal(AdsOrderDetailTotalDTO dto) {
-        if (StringUtils.isBlank(dto.getSourceSystem())) {
-            dto.setSourceSystem("ZX_ONE");
-        }
-        List<Long> userIds;
-        List<Long> gameIds;
-        if ("ZX_ONE".equals(dto.getSourceSystem())) {
-            Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
-            userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(Long.parseLong(dto.getPitcherId()));
-            gameIds = CollectionUtils.isEmpty(dto.getGameId()) ? poerInfo.second : dto.getGameId();
-        } else {
-            userIds = dto.getPitcherId() == null ? Collections.emptyList() : Collections.singletonList(Long.parseLong(dto.getPitcherId()));
-            gameIds = CollectionUtils.isEmpty(dto.getGameId()) ? Collections.emptyList() : dto.getGameId();
-        }
+        Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        List<Long> userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(Long.parseLong(dto.getPitcherId()));
+        List<Long> gameIds = CollectionUtils.isEmpty(dto.getGameId()) ? poerInfo.second : dto.getGameId();
         Criteria cri = Cnd.cri();
         if (StringUtils.isNotBlank(dto.getSourceSystem())) {
             cri.where().andEquals("source_system", dto.getSourceSystem());
@@ -237,7 +208,7 @@ public class AdsOrderDetailService implements IAdsOrderDetailService {
         if (StringUtils.isNotBlank(dto.getSourceServerName())) {
             cri.where().andLike("source_server_name", dto.getSourceServerName());
         }
-        if (CollectionUtils.isNotEmpty(gameIds)) {
+        if (gameIds != null) {
             cri.where().andInList("order_game_id", gameIds);
         }
         if (CollectionUtils.isNotEmpty(dto.getChannelId())) {
@@ -246,7 +217,7 @@ public class AdsOrderDetailService implements IAdsOrderDetailService {
         if (StringUtils.isNotBlank(dto.getAccountId())) {
             cri.where().andEquals("account_id", dto.getAccountId());
         }
-        if (CollectionUtils.isNotEmpty(userIds)) {
+        if (userIds != null) {
             cri.where().andInList("zx_pitcher_id", userIds);
         }
         if (StringUtils.isNotBlank(dto.getDeviceSystem())) {
@@ -299,15 +270,6 @@ public class AdsOrderDetailService implements IAdsOrderDetailService {
             //广告ID
             cri.where().andEquals("project_id", dto.getProjectId());
         }
-        if (StringUtils.isNotBlank(dto.getOrderAgentType())) {
-            if ("buy".equals(dto.getOrderAgentType())) {
-                //查询买量渠道订单
-                cri.where().andNotEquals("agent_id", 0);
-            } else if ("nature".equals(dto.getOrderAgentType())) {
-                //查询自然量订单
-                cri.where().andEquals("agent_id", 0);
-            }
-        }
         //添加判断,除去BG的数据 BG的数据在我们这找不到用户以及渠道
         cri.where().andNotIsNull("agent_name");
         cri.where().andNotIsNull("username");

+ 13 - 47
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/GameDataServiceImpl.java

@@ -195,16 +195,8 @@ public class GameDataServiceImpl implements IGameDataService {
      */
     @Override
     public Page<GameDataDayVO> getGameDataDay(GameDataDayDTO dto) {
-        if (StringUtils.isBlank(dto.getSourceSystem())) {
-            dto.setSourceSystem("ZX_ONE");
-        }
-        List<Long> gameIds;
-        if ("ZX_ONE".equals(dto.getSourceSystem())) {
-            com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
-            gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
-        } else {
-            gameIds = dto.getGameId() == null ? Collections.emptyList() : Collections.singletonList(dto.getGameId());
-        }
+        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
 
         //默认查询 total 总量数据
         if (StringUtils.isBlank(dto.getTableTypes())) {
@@ -216,7 +208,7 @@ public class GameDataServiceImpl implements IGameDataService {
             //拼接游戏名称查询条件
             cri.where().andEquals("game_name", dto.getGameName());
         }
-        if (!CollectionUtils.isEmpty(gameIds)) {
+        if (gameIds != null) {
             //拼接游戏id查询条件
             cri.where().andInList("game_id", gameIds);
         }
@@ -272,16 +264,8 @@ public class GameDataServiceImpl implements IGameDataService {
      * @return 返回给前端的总计数据实体
      */
     public GameDataDayTotalVO getGameDataDayTotal(GameDataDayTotalDTO dto) {
-        if (StringUtils.isBlank(dto.getSourceSystem())) {
-            dto.setSourceSystem("ZX_ONE");
-        }
-        List<Long> gameIds;
-        if ("ZX_ONE".equals(dto.getSourceSystem())) {
-            com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
-            gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
-        } else {
-            gameIds = dto.getGameId() == null ? Collections.emptyList() : Collections.singletonList(dto.getGameId());
-        }
+        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
 
         //默认查询 total 总量数据
         if (StringUtils.isBlank(dto.getTableTypes())) {
@@ -289,7 +273,7 @@ public class GameDataServiceImpl implements IGameDataService {
         }
         //新增查询条件
         Criteria cri = Cnd.cri();
-        if (!CollectionUtils.isEmpty(gameIds)) {
+        if (gameIds != null) {
             //拼接游戏id
             cri.where().andInList("game_id", gameIds);
         }
@@ -332,17 +316,8 @@ public class GameDataServiceImpl implements IGameDataService {
      */
     @Override
     public Page<GameDataTotalVO> getGameDataTotal(GameDataTotalDTO dto) {
-        if (StringUtils.isBlank(dto.getSourceSystem())) {
-            dto.setSourceSystem("ZX_ONE");
-        }
-        List<Long> gameIds;
-        if ("ZX_ONE".equals(dto.getSourceSystem())) {
-            com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
-            gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
-        } else {
-            gameIds = dto.getGameId() == null ? Collections.emptyList() : Collections.singletonList(dto.getGameId());
-        }
-
+        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
         //如果注册时间参数为空,默认设置查询当天数据
         if (dto.getRegisteredBeginDate() == null || dto.getRegisteredEndDate() == null) {
             dto.setRegisteredBeginDate(LocalDate.now());
@@ -463,17 +438,8 @@ public class GameDataServiceImpl implements IGameDataService {
      * @return 返回给前端额数据
      */
     public GameDataTotalTotalVO getGameDataTotalTotal(GameDataTotalTotalDTO dto) {
-        if (StringUtils.isBlank(dto.getSourceSystem())) {
-            dto.setSourceSystem("ZX_ONE");
-        }
-        List<Long> gameIds;
-        if ("ZX_ONE".equals(dto.getSourceSystem())) {
-            com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
-            gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
-        } else {
-            gameIds = dto.getGameId() == null ? Collections.emptyList() : Collections.singletonList(dto.getGameId());
-        }
-
+        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
         //如果注册时间参数为空,默认设置查询当天数据
         if (dto.getRegisteredBeginDate() == null || dto.getRegisteredEndDate() == null) {
             dto.setRegisteredBeginDate(LocalDate.now());
@@ -1074,7 +1040,7 @@ public class GameDataServiceImpl implements IGameDataService {
             //拼接游戏名称查询条件
             cri.where().andEquals("game_name", dto.getGameName());
         }
-        if (!CollectionUtils.isEmpty(gameIds)) {
+        if (gameIds != null) {
             //拼接游戏id查询条件
             cri.where().andInList("game_id", gameIds);
         }
@@ -1116,7 +1082,7 @@ public class GameDataServiceImpl implements IGameDataService {
     private Criteria myCriRecharge(List<Long> gameIds, GameDataTotalDTO dto, Boolean needRegTime) {
         //根据传入的dto拼接查询参数
         Criteria cri = Cnd.cri();
-        if (!CollectionUtils.isEmpty(gameIds)) {
+        if (gameIds != null) {
             //拼接游戏id查询条件
             cri.where().andInList("game_id", gameIds);
         }
@@ -1150,7 +1116,7 @@ public class GameDataServiceImpl implements IGameDataService {
     private Criteria myCriRole(List<Long> gameIds, GameDataTotalDTO dto) {
         //根据传入的dto拼接查询参数
         Criteria cri = Cnd.cri();
-        if (!CollectionUtils.isEmpty(gameIds)) {
+        if (gameIds != null) {
             //拼接游戏id查询条件
             cri.where().andInList("user_game_id", gameIds);
         }

+ 12 - 29
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/OverallSummaryServiceImpl.java

@@ -9,7 +9,6 @@ import com.zanxiang.game.data.serve.pojo.vo.OverallSummaryUserLineDataVO;
 import com.zanxiang.game.data.serve.pojo.vo.OverallSummaryVO;
 import com.zanxiang.game.data.serve.service.IOverallSummaryService;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.nutz.dao.Cnd;
 import org.nutz.dao.Condition;
@@ -48,23 +47,18 @@ public class OverallSummaryServiceImpl implements IOverallSummaryService {
      */
     @Override
     public OverallSummaryVO getOverallSummaryTotalData(OverallSummaryDTO dto) {
+        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());
+
+        //创建返回给前端的对象
+        OverallSummaryVO overallSummaryVO = new OverallSummaryVO();
+
         //默认查询‘ZX_ONE’数据
         if (StringUtils.isBlank(dto.getSourceSystem())) {
             dto.setSourceSystem("ZX_ONE");
         }
-        List<Long> userIds;
-        List<Long> gameIds;
-        if ("ZX_ONE".equals(dto.getSourceSystem())) {
-            Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
-            userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
-            gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
-        } else {
-            userIds = dto.getPitcherId() == null ? Collections.emptyList() : Collections.singletonList(dto.getPitcherId());
-            gameIds = dto.getGameId() == null ? Collections.emptyList() : Collections.singletonList(dto.getGameId());
-        }
 
-        //创建返回给前端的对象
-        OverallSummaryVO overallSummaryVO = new OverallSummaryVO();
         //计算总计条件
         Condition totalCri = myCondition(userIds, gameIds, dto, true, false, -1);
         //计算今日数据条件
@@ -195,20 +189,9 @@ public class OverallSummaryServiceImpl implements IOverallSummaryService {
      */
     @Override
     public Map<String, List> getOverallSummaryLineData(OverallSummaryDTO dto) {
-        //默认查询‘ZX_ONE’数据
-        if (StringUtils.isBlank(dto.getSourceSystem())) {
-            dto.setSourceSystem("ZX_ONE");
-        }
-        List<Long> userIds;
-        List<Long> gameIds;
-        if ("ZX_ONE".equals(dto.getSourceSystem())) {
-            Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
-            userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
-            gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(dto.getGameId());
-        } else {
-            userIds = dto.getPitcherId() == null ? Collections.emptyList() : Collections.singletonList(dto.getPitcherId());
-            gameIds = dto.getGameId() == null ? Collections.emptyList() : 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());
 
         //根据条件获取数据
         Condition lineCon = myCondition(userIds, gameIds, dto, true, true, -1);
@@ -275,7 +258,7 @@ public class OverallSummaryServiceImpl implements IOverallSummaryService {
 
         Criteria cri = Cnd.cri();
         //默认查询条件
-        if (CollectionUtils.isNotEmpty(gameIds) && needGameId) {
+        if (gameIds != null && needGameId) {
             //拼接游戏查询条件
             cri.where().andInList("game_id", gameIds);
         }
@@ -292,7 +275,7 @@ public class OverallSummaryServiceImpl implements IOverallSummaryService {
             cri.where().andEquals("source_system", dto.getSourceSystem());
         }
         //前端传递 pitcherId 根据 pitcherId 查询
-        if (CollectionUtils.isNotEmpty(userIds)) {
+        if (userIds != null) {
             //拼接投手查询条件
             cri.where().andInList("pitcher_id", userIds);
         }

+ 31 - 107
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/PitcherDataServiceImpl.java

@@ -202,17 +202,8 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
      */
     @Override
     public Page<PitcherDataDayVO> getPitcherDataDay(PitcherDataDayDTO dto) {
-        if (StringUtils.isBlank(dto.getSourceSystem())) {
-            dto.setSourceSystem("ZX_ONE");
-        }
-        List<Long> userIds;
-        if (StringUtils.isNotBlank(dto.getSourceSystem())) {
-            com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
-            userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
-        } else {
-            userIds = dto.getPitcherId() == null ? Collections.emptyList() : Collections.singletonList(dto.getPitcherId());
-        }
-
+        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        List<Long> userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
         //不传递时间,默认查询当天
         if (dto.getBeginDate() == null || dto.getEndDate() == null) {
             dto.setBeginDate(LocalDate.now());
@@ -220,7 +211,7 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
         }
         //创建查询条件
         Criteria cri = Cnd.cri();
-        if (CollectionUtils.isNotEmpty(userIds)) {
+        if (userIds != null) {
             cri.where().andInList("pitcher_id", userIds);
         }
         if (StringUtils.isNotBlank(dto.getSourceSystem())) {
@@ -270,17 +261,8 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
      */
     @Override
     public PitcherDataDayTotalVO getPitcherDataDayTotal(PitcherDataDayTotalDTO dto) {
-        if (StringUtils.isBlank(dto.getSourceSystem())) {
-            dto.setSourceSystem("ZX_ONE");
-        }
-        List<Long> userIds;
-        if (StringUtils.isNotBlank(dto.getSourceSystem())) {
-            com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
-            userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
-        } else {
-            userIds = dto.getPitcherId() == null ? Collections.emptyList() : Collections.singletonList(dto.getPitcherId());
-        }
-
+        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        List<Long> userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
         //不传递时间,默认查询当天
         if (dto.getBeginDate() == null || dto.getEndDate() == null) {
             dto.setBeginDate(LocalDate.now());
@@ -288,7 +270,7 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
         }
         //创建查询条件
         Criteria cri = Cnd.cri();
-        if (CollectionUtils.isNotEmpty(userIds)) {
+        if (userIds != null) {
             cri.where().andInList("pitcher_id", userIds);
         }
         if (StringUtils.isNotBlank(dto.getSourceSystem())) {
@@ -321,16 +303,8 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
      */
     @Override
     public Page<PitcherDataTotalVO> getPitcherDataTotal(PitcherDataTotalDTO dto) {
-        if (StringUtils.isBlank(dto.getSourceSystem())) {
-            dto.setSourceSystem("ZX_ONE");
-        }
-        List<Long> userIds;
-        if (StringUtils.isNotBlank(dto.getSourceSystem())) {
-            com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
-            userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
-        } else {
-            userIds = dto.getPitcherId() == null ? Collections.emptyList() : Collections.singletonList(dto.getPitcherId());
-        }
+        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        List<Long> userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
         //如果注册时间参数为空,默认设置查询当天数据
         if (dto.getBeginDate() == null || dto.getEndDate() == null) {
             dto.setBeginDate(LocalDate.now());
@@ -421,17 +395,8 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
      */
     @Override
     public PitcherDataTotalSumVO getPitcherDataTotalSum(PitcherDataTotalSumDTO dto) {
-        if (StringUtils.isBlank(dto.getSourceSystem())) {
-            dto.setSourceSystem("ZX_ONE");
-        }
-        List<Long> userIds;
-        if (StringUtils.isNotBlank(dto.getSourceSystem())) {
-            com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
-            userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
-        } else {
-            userIds = dto.getPitcherId() == null ? Collections.emptyList() : Collections.singletonList(dto.getPitcherId());
-        }
-        
+        com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
+        List<Long> userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
         //如果注册时间参数为空,默认设置查询当天数据
         if (dto.getBeginDate() == null || dto.getEndDate() == null) {
             dto.setBeginDate(LocalDate.now());
@@ -521,19 +486,9 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
      */
     @Override
     public Page<PitcherGameDataDayVO> getPitcherGameDataDay(PitcherGameDataDayDTO dto) {
-        if (StringUtils.isBlank(dto.getSourceSystem())) {
-            dto.setSourceSystem("ZX_ONE");
-        }
-        List<Long> userIds;
-        List<Long> gameIds;
-        if (StringUtils.isNotBlank(dto.getSourceSystem())) {
-            com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
-            userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
-            gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(Long.parseLong(dto.getGameId()));
-        } else {
-            userIds = dto.getPitcherId() == null ? Collections.emptyList() : Collections.singletonList(dto.getPitcherId());
-            gameIds = dto.getGameId() == null ? Collections.emptyList() : 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());
@@ -541,10 +496,10 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
         }
         //创建查询条件
         Criteria cri = Cnd.cri();
-        if (CollectionUtils.isNotEmpty(userIds)) {
+        if (userIds != null) {
             cri.where().andInList("pitcher_id", userIds);
         }
-        if (CollectionUtils.isNotEmpty(gameIds)) {
+        if (gameIds != null) {
             cri.where().andInList("game_id", gameIds);
         }
         if (StringUtils.isNotBlank(dto.getSourceSystem())) {
@@ -601,20 +556,9 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
      */
     @Override
     public PitcherGameDataDayTotalVO getPitcherGameDataDayTotal(PitcherGameDataDayTotalDTO dto) {
-        if (StringUtils.isBlank(dto.getSourceSystem())) {
-            dto.setSourceSystem("ZX_ONE");
-        }
-        List<Long> userIds;
-        List<Long> gameIds;
-        if (StringUtils.isNotBlank(dto.getSourceSystem())) {
-            com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
-            userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
-            gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(Long.parseLong(dto.getGameId()));
-        } else {
-            userIds = dto.getPitcherId() == null ? Collections.emptyList() : Collections.singletonList(dto.getPitcherId());
-            gameIds = dto.getGameId() == null ? Collections.emptyList() : 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());
@@ -622,10 +566,10 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
         }
         //创建查询条件
         Criteria cri = Cnd.cri();
-        if (CollectionUtils.isNotEmpty(userIds)) {
+        if (userIds != null) {
             cri.where().andInList("pitcher_id", userIds);
         }
-        if (CollectionUtils.isNotEmpty(gameIds)) {
+        if (gameIds != null) {
             cri.where().andInList("game_id", gameIds);
         }
         if (StringUtils.isNotBlank(dto.getSourceSystem())) {
@@ -664,19 +608,9 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
      */
     @Override
     public Page<PitcherGameDataTotalVO> getPitcherGameDataTotal(PitcherGameDataTotalDTO dto) {
-        if (StringUtils.isBlank(dto.getSourceSystem())) {
-            dto.setSourceSystem("ZX_ONE");
-        }
-        List<Long> userIds;
-        List<Long> gameIds;
-        if (StringUtils.isNotBlank(dto.getSourceSystem())) {
-            com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
-            userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
-            gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(Long.parseLong(dto.getGameId()));
-        } else {
-            userIds = dto.getPitcherId() == null ? Collections.emptyList() : Collections.singletonList(dto.getPitcherId());
-            gameIds = dto.getGameId() == null ? Collections.emptyList() : 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());
@@ -773,19 +707,9 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
      */
     @Override
     public PitcherGameDataTotalSumVO getPitcherGameDataTotalSum(PitcherGameDataTotalSumDTO dto) {
-        if (StringUtils.isBlank(dto.getSourceSystem())) {
-            dto.setSourceSystem("ZX_ONE");
-        }
-        List<Long> userIds;
-        List<Long> gameIds;
-        if (StringUtils.isNotBlank(dto.getSourceSystem())) {
-            com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
-            userIds = dto.getPitcherId() == null ? poerInfo.first : Collections.singletonList(dto.getPitcherId());
-            gameIds = dto.getGameId() == null ? poerInfo.second : Collections.singletonList(Long.parseLong(dto.getGameId()));
-        } else {
-            userIds = dto.getPitcherId() == null ? Collections.emptyList() : Collections.singletonList(dto.getPitcherId());
-            gameIds = dto.getGameId() == null ? Collections.emptyList() : 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());
@@ -1118,7 +1042,7 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
     private Criteria myCri(List<Long> userIds, List<Long> gameIds, PitcherGameDataTotalDTO dto, String type, Boolean needGroupBy) {
         //根据传入的dto拼接查询参数
         Criteria cri = Cnd.cri();
-        if (CollectionUtils.isNotEmpty(gameIds)) {
+        if (gameIds != null) {
             //拼接游戏id查询条件
             cri.where().andInList("game_id", gameIds);
         }
@@ -1134,7 +1058,7 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
             //拼接SDK来源
             cri.where().andEquals("source_system", dto.getSourceSystem());
         }
-        if (CollectionUtils.isNotEmpty(userIds)) {
+        if (userIds != null) {
             //拼接投手ID
             cri.where().andInList("pitcher_id", userIds);
         }
@@ -1257,7 +1181,7 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
             //拼接SDK来源
             cri.where().andEquals("source_system", dto.getSourceSystem());
         }
-        if (CollectionUtils.isNotEmpty(userIds)) {
+        if (userIds != null) {
             //拼接投手ID
             cri.where().andInList("pitcher_id", userIds);
         }
@@ -1295,7 +1219,7 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
             //拼接SDK来源
             cri.where().andEquals("source_system", dto.getSourceSystem());
         }
-        if (CollectionUtils.isNotEmpty(userIds)) {
+        if (userIds != null) {
             //拼接投手ID
             cri.where().andInList("pitcher_id", userIds);
         }
@@ -1325,7 +1249,7 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
             //拼接SDK来源
             cri.where().andEquals("source_system", dto.getSourceSystem());
         }
-        if (CollectionUtils.isNotEmpty(userIds)) {
+        if (userIds != null) {
             //拼接投手ID
             cri.where().andInList("user_zx_pitcher_id", userIds);
         }