Selaa lähdekoodia

查询广告账号接口、所有游戏接口、所有渠道、所有投手

Letianhua 1 vuosi sitten
vanhempi
commit
7dc3329999
17 muutettua tiedostoa jossa 540 lisäystä ja 87 poistoa
  1. 1 1
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/AdsGameServerController.java
  2. 74 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/ChoiceListController.java
  3. 0 36
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/GameListController.java
  4. 27 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/ChoiceListDTO.java
  5. 39 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/AccountListVO.java
  6. 39 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/AgentListVO.java
  7. 39 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/PitcherListVO.java
  8. 12 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/IAccountListService.java
  9. 12 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/IAgentListService.java
  10. 2 1
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/IGameListService.java
  11. 12 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/IPitcherListService.java
  12. 62 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/AccountListServiceImpl.java
  13. 64 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/AgentListServiceImpl.java
  14. 61 38
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/GameDataServiceImpl.java
  15. 30 4
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/GameListServiceImpl.java
  16. 3 7
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/GameServerServiceImpl.java
  17. 63 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/PitcherListServiceImpl.java

+ 1 - 1
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/AdsGameServerController.java

@@ -50,7 +50,7 @@ public class AdsGameServerController {
     }
 
     @ApiOperation(value = "游戏区服每日数据")
-    //@PreAuthorize(permissionKey = "gameServer:GameServerSumDay:day")
+    @PreAuthorize(permissionKey = "gameServer:GameServerSumDay:day")
     @PostMapping("sum/day")
     public ResultVO<Page<GameServerSumDayVO>> getGameServerDataSumDay(@RequestBody GameServerSumDayDTO dto) {
         return ResultVO.ok(gameServerService.getGameServerDataSumDay(dto));

+ 74 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/ChoiceListController.java

@@ -0,0 +1,74 @@
+package com.zanxiang.game.data.serve.controller;
+
+import com.zanxiang.erp.security.annotation.PreAuthorize;
+import com.zanxiang.game.data.serve.pojo.dto.ChoiceListDTO;
+import com.zanxiang.game.data.serve.pojo.vo.AccountListVO;
+import com.zanxiang.game.data.serve.pojo.vo.AgentListVO;
+import com.zanxiang.game.data.serve.pojo.vo.GameListVO;
+import com.zanxiang.game.data.serve.pojo.vo.PitcherListVO;
+import com.zanxiang.game.data.serve.service.IAccountListService;
+import com.zanxiang.game.data.serve.service.IAgentListService;
+import com.zanxiang.game.data.serve.service.IGameListService;
+import com.zanxiang.game.data.serve.service.IPitcherListService;
+import com.zanxiang.module.util.pojo.ResultVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * @author tianhua
+ * @version 1.0
+ * @description:  下拉选择列表
+ * @date 2023/11/3 15:33
+ */
+@Api(tags = {"下拉选择列表"})
+@RestController
+@RequestMapping("/gameData/choice")
+@Slf4j
+public class ChoiceListController {
+
+    @Autowired
+    private IGameListService gameListService;
+
+    @Autowired
+    private IAccountListService accountListService;
+
+    @Autowired
+    private IAgentListService agentListService;
+
+    @Autowired
+    private IPitcherListService pitcherListService;
+
+    @ApiOperation(value = "所有游戏列表")
+    @PreAuthorize(permissionKey = "gameData:choice:gameList")
+    @PostMapping("/game/list")
+    public ResultVO<GameListVO> getGameDataDay(@RequestBody ChoiceListDTO dto) {
+        return ResultVO.ok(gameListService.getGameList(dto));
+    }
+
+    @ApiOperation(value = "所有广告账号列表")
+    @PreAuthorize(permissionKey = "gameData:choice:accountList")
+    @PostMapping("/account/list")
+    public ResultVO<List<AccountListVO>> getAccountList(@RequestBody ChoiceListDTO dto) {
+        return ResultVO.ok(accountListService.getAccountList(dto));
+    }
+
+    @ApiOperation(value = "所有渠道列表")
+    @PreAuthorize(permissionKey = "gameData:choice:agentList")
+    @PostMapping("/agent/list")
+    public ResultVO<List<AgentListVO>> getAgentList(@RequestBody ChoiceListDTO dto) {
+        return ResultVO.ok(agentListService.getAgentList(dto));
+    }
+
+    @ApiOperation(value = "所有投手列表")
+    @PreAuthorize(permissionKey = "gameData:choice:pitcherList")
+    @PostMapping("/pitcher/list")
+    public ResultVO<List<PitcherListVO>> getPitcherList(@RequestBody ChoiceListDTO dto) {
+        return ResultVO.ok(pitcherListService.getPitcherList(dto));
+    }
+
+}

+ 0 - 36
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/GameListController.java

@@ -1,36 +0,0 @@
-package com.zanxiang.game.data.serve.controller;
-
-import com.zanxiang.erp.security.annotation.PreAuthorize;
-import com.zanxiang.game.data.serve.pojo.vo.GameListVO;
-import com.zanxiang.game.data.serve.service.IGameListService;
-import com.zanxiang.module.util.pojo.ResultVO;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * @author tianhua
- * @time 2023/9/25
- * @Description 游戏列表接口 查看所有游戏、父游戏、超父游戏列表(ZX_ONE)
- **/
-@Api(tags = {"游戏展示列表"})
-@RestController
-@RequestMapping("/gameList")
-@Slf4j
-public class GameListController {
-
-    @Autowired
-    private IGameListService gameListService;
-
-    @ApiOperation(value = "所有游戏列表")
-    @PreAuthorize(permissionKey = "gameData:gameList:game")
-    @GetMapping("/list")
-    public ResultVO<GameListVO> getGameDataDay() {
-        return ResultVO.ok(gameListService.getGameList());
-    }
-
-}

+ 27 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/ChoiceListDTO.java

@@ -0,0 +1,27 @@
+package com.zanxiang.game.data.serve.pojo.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author tianhua
+ * @version 1.0
+ * @description: 专门给下拉列表的筛选条件实体类
+ * @date 2023/11/3 16:24
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class ChoiceListDTO {
+
+    /**
+     * SDK来源
+     */
+    @ApiModelProperty(value = "SDK来源")
+    private String sourceSystem;
+
+}

+ 39 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/AccountListVO.java

@@ -0,0 +1,39 @@
+package com.zanxiang.game.data.serve.pojo.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author tianhua
+ * @version 1.0
+ * @description: 广告账号实体类
+ * @date 2023/11/3 16:27
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class AccountListVO {
+
+    /**
+     * SDK来源
+     */
+    @ApiModelProperty(notes = "SDK来源")
+    private String sourceSystem;
+
+    /**
+     * 广告账号ID
+     */
+    @ApiModelProperty(notes = "广告账号ID")
+    private Long accountId;
+
+    /**
+     * 广告账号类型
+     */
+    @ApiModelProperty(notes = "广告账号类型")
+    private String accountType;
+
+}

+ 39 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/AgentListVO.java

@@ -0,0 +1,39 @@
+package com.zanxiang.game.data.serve.pojo.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author tianhua
+ * @version 1.0
+ * @description: 渠道信息实体类
+ * @date 2023/11/3 16:27
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class AgentListVO {
+
+    /**
+     * SDK来源
+     */
+    @ApiModelProperty(notes = "SDK来源")
+    private String sourceSystem;
+
+    /**
+     * 渠道id
+     */
+    @ApiModelProperty(notes = "渠道ID")
+    private Long agentId;
+
+    /**
+     * 渠道名
+     */
+    @ApiModelProperty(notes = "渠道名")
+    private String agentName;
+
+}

+ 39 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/PitcherListVO.java

@@ -0,0 +1,39 @@
+package com.zanxiang.game.data.serve.pojo.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author tianhua
+ * @version 1.0
+ * @description: 投手信息实体类
+ * @date 2023/11/3 16:27
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class PitcherListVO {
+
+    /**
+     * SDK来源
+     */
+    @ApiModelProperty(notes = "SDK来源")
+    private String sourceSystem;
+
+    /**
+     * 投手ID
+     */
+    @ApiModelProperty(notes = "投手ID")
+    private Long pitcherId;
+
+    /**
+     * 投手名
+     */
+    @ApiModelProperty(notes = "投手名")
+    private String pitcherName;
+
+}

+ 12 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/IAccountListService.java

@@ -0,0 +1,12 @@
+package com.zanxiang.game.data.serve.service;
+
+import com.zanxiang.game.data.serve.pojo.dto.ChoiceListDTO;
+import com.zanxiang.game.data.serve.pojo.vo.AccountListVO;
+
+import java.util.List;
+
+public interface IAccountListService {
+
+    List<AccountListVO> getAccountList(ChoiceListDTO dto);
+
+}

+ 12 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/IAgentListService.java

@@ -0,0 +1,12 @@
+package com.zanxiang.game.data.serve.service;
+
+import com.zanxiang.game.data.serve.pojo.dto.ChoiceListDTO;
+import com.zanxiang.game.data.serve.pojo.vo.AgentListVO;
+
+import java.util.List;
+
+public interface IAgentListService {
+
+    List<AgentListVO> getAgentList(ChoiceListDTO dto);
+
+}

+ 2 - 1
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/IGameListService.java

@@ -1,9 +1,10 @@
 package com.zanxiang.game.data.serve.service;
 
+import com.zanxiang.game.data.serve.pojo.dto.ChoiceListDTO;
 import com.zanxiang.game.data.serve.pojo.vo.GameListVO;
 
 public interface IGameListService {
 
-    GameListVO getGameList();
+    GameListVO getGameList(ChoiceListDTO dto);
 
 }

+ 12 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/IPitcherListService.java

@@ -0,0 +1,12 @@
+package com.zanxiang.game.data.serve.service;
+
+import com.zanxiang.game.data.serve.pojo.dto.ChoiceListDTO;
+import com.zanxiang.game.data.serve.pojo.vo.PitcherListVO;
+
+import java.util.List;
+
+public interface IPitcherListService {
+
+    List<PitcherListVO> getPitcherList(ChoiceListDTO dto);
+
+}

+ 62 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/AccountListServiceImpl.java

@@ -0,0 +1,62 @@
+package com.zanxiang.game.data.serve.service.impl;
+
+import com.zanxiang.game.data.serve.pojo.dto.ChoiceListDTO;
+import com.zanxiang.game.data.serve.pojo.vo.AccountListVO;
+import com.zanxiang.game.data.serve.pojo.vo.AgentListVO;
+import com.zanxiang.game.data.serve.service.IAccountListService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.nutz.dao.Dao;
+import org.nutz.dao.Sqls;
+import org.nutz.dao.sql.Sql;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @author tianhua
+ * @version 1.0
+ * @description: 查询所有广告账号的方法逻辑层
+ * @date 2023/11/3 15:10
+ */
+@Service
+@Slf4j
+public class AccountListServiceImpl implements IAccountListService {
+
+    @Autowired
+    private Dao dao;
+
+    /**
+     * 获得所有广告账号
+     * @param dto ChoiceListDTO
+     * @return list
+     */
+    @Override
+    public List<AccountListVO> getAccountList(ChoiceListDTO dto) {
+
+        if (StringUtils.isBlank(dto.getSourceSystem())) {
+            //默认查询“ZX_ONE”数据
+            dto.setSourceSystem("ZX_ONE");
+        }
+
+        Sql sql = Sqls.create("""
+                SELECT
+                	source_system ,
+                	account_id ,
+                	MAX(account_type) as account_type
+                from dm_game_order.t_pitcher_agent
+                where ((account_type in('MP','GDT') and LENGTH(account_id)<= 10) or
+                (account_type = 'BYTE' and LENGTH(account_id)<= 17))
+                AND source_system = @source_system AND agent_name is not NULL
+                GROUP BY account_id ,source_system 
+                """);
+        sql.setParam("source_system", dto.getSourceSystem());
+        sql.setCallback(Sqls.callback.entities());
+        sql.setEntity(dao.getEntity(AccountListVO.class));
+        dao.execute(sql);
+
+        return sql.getList(AccountListVO.class);
+    }
+
+}

+ 64 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/AgentListServiceImpl.java

@@ -0,0 +1,64 @@
+package com.zanxiang.game.data.serve.service.impl;
+
+import com.zanxiang.game.data.serve.pojo.dto.ChoiceListDTO;
+import com.zanxiang.game.data.serve.pojo.vo.AgentListVO;
+import com.zanxiang.game.data.serve.service.IAgentListService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.nutz.dao.Cnd;
+import org.nutz.dao.Dao;
+import org.nutz.dao.Sqls;
+import org.nutz.dao.sql.Criteria;
+import org.nutz.dao.sql.Sql;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @author tianhua
+ * @version 1.0
+ * @description: TODO
+ * @date 2023/11/3 16:50
+ */
+@Service
+@Slf4j
+public class AgentListServiceImpl implements IAgentListService {
+
+    @Autowired
+    private Dao dao;
+
+    /**
+     * 所有渠道列表
+     * @param dto ChoiceListDTO
+     * @return list
+     */
+    @Override
+    public List<AgentListVO> getAgentList(ChoiceListDTO dto) {
+
+        if (StringUtils.isBlank(dto.getSourceSystem())) {
+            //默认查询“ZX_ONE”数据
+            dto.setSourceSystem("ZX_ONE");
+        }
+
+        Sql sql = Sqls.create("""
+                SELECT
+                	source_system ,
+                	id as agent_id,
+                	MAX(agent_name) as agent_name
+                from dm_game_order.t_pitcher_agent
+                where ((account_type in('MP','GDT') and LENGTH(account_id)<= 10) or
+                (account_type = 'BYTE' and LENGTH(account_id)<= 17))
+                AND source_system = @source_system AND agent_name is not NULL
+                GROUP BY id, source_system
+                """);
+        sql.setParam("source_system", dto.getSourceSystem());
+        sql.setCallback(Sqls.callback.entities());
+        sql.setEntity(dao.getEntity(AgentListVO.class));
+        dao.execute(sql);
+
+        return sql.getList(AgentListVO.class);
+    }
+
+
+}

+ 61 - 38
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/GameDataServiceImpl.java

@@ -1066,7 +1066,7 @@ public class GameDataServiceImpl implements IGameDataService {
         }
         if (needGroupBy) {
             //拼接分组条件
-            cri.getGroupBy().groupBy("game_name", "game_id", "game_classify");
+            cri.getGroupBy().groupBy("game_id", "game_classify", "source_system");
         }
 
         return cri;
@@ -2264,8 +2264,9 @@ public class GameDataServiceImpl implements IGameDataService {
                         IFNULL(role_num, 0) role_num
                     FROM(
                         SELECT
+                            source_system,
                             game_id,
-                            game_name,
+                            MAX(game_name) as game_name,
                             game_classify,
                             sum(buy_reg_num) reg_num,
                             sum(cost) cost,
@@ -2303,8 +2304,9 @@ public class GameDataServiceImpl implements IGameDataService {
                          ) a
                     LEFT JOIN (
                         SELECT
+                            source_system as b_source_system,
                             game_id as b_game_id,
-                            game_name as b_game_name,
+                            MAX(game_name) as b_game_name,
                             IFNULL(sum(buy_amount_count), 0) amount_count,
                             IFNULL(sum(buy_amount), 0) amount,
                             round(if(sum(buy_amount_count) > 0, sum(buy_amount) / sum(buy_amount_count), 0), 2) avg_amount
@@ -2313,9 +2315,10 @@ public class GameDataServiceImpl implements IGameDataService {
                     """ + criB +
                     """
                         ) b
-                    ON a.game_id = b.b_game_id and a.game_name = b.b_game_name
+                    ON a.game_id = b.b_game_id and a.game_name = b.b_game_name and a.source_system = b.b_source_system
                     LEFT JOIN(
                         SELECT
+                            source_system as d_source_system,
                             game_id as d_game_id,
                             IFNULL(COUNT(DISTINCT user_id), 0) amount_num
                         FROM
@@ -2323,10 +2326,11 @@ public class GameDataServiceImpl implements IGameDataService {
                     """ + criAmount +
                     """
                             AND NOT agent_id = 0
-                        GROUP BY game_id) d
-                    ON a.game_id = d.d_game_id
+                        GROUP BY game_id, source_system) d
+                    ON a.game_id = d.d_game_id and a.source_system = d.d_source_system
                     LEFT JOIN (
                         SELECT
+                            source_system as f_source_system,
                             game_id as f_game_id,
                             COUNT(DISTINCT user_id) new_user_amount_num
                         FROM
@@ -2334,14 +2338,16 @@ public class GameDataServiceImpl implements IGameDataService {
                     """ + criNewUser +
                     """
                             AND NOT agent_id = 0
-                        GROUP BY game_id) f
-                    ON a.game_id = f.f_game_id
+                        GROUP BY game_id, source_system) f
+                    ON a.game_id = f.f_game_id and a.source_system = f.f_source_system
                     LEFT JOIN(
                         SELECT
+                            source_system as g_source_system,
                             game_id as g_game_id,
                             COUNT(tempA.num) as new_user_again_num
                         FROM (
                                 SELECT
+                                    source_system,
                                     game_id,
                                     COUNT(user_id) num
                                 FROM
@@ -2351,13 +2357,15 @@ public class GameDataServiceImpl implements IGameDataService {
                                     AND NOT agent_id = 0
                                 GROUP BY
                                     user_id,
-                                    game_id
+                                    game_id,
+                                    source_system
                                 HAVING
                                     COUNT(user_id) > 1 ) tempA
-                        GROUP BY tempA.game_id) g
-                    ON a.game_id = g.g_game_id
+                        GROUP BY tempA.game_id, tempA.source_system) g
+                    ON a.game_id = g.g_game_id and a.source_system = g.g_source_system
                     LEFT JOIN (
                         SELECT
+                            source_system as n_source_system,
                             user_game_id ,
                             COUNT(DISTINCT role_user_id) as role_num
                         FROM
@@ -2365,9 +2373,9 @@ public class GameDataServiceImpl implements IGameDataService {
                     """ + criRoleNum +
                     """
                             AND NOT user_agent_id = 0
-                        GROUP BY user_game_id
+                        GROUP BY user_game_id,source_system
                     ) n
-                    ON a.game_id = n.user_game_id
+                    ON a.game_id = n.user_game_id and a.source_system = n.n_source_system
                     """;
         } else if ("nature".equals(tableType)) {
             return """
@@ -2382,8 +2390,9 @@ public class GameDataServiceImpl implements IGameDataService {
                         IFNULL(role_num, 0) role_num
                     FROM(
                         SELECT
+                            source_system,
                             game_id,
-                            game_name,
+                            MAX(game_name) as game_name,
                             game_classify,
                             sum(nature_reg_num) reg_num,
                             sum(cost) cost,
@@ -2421,8 +2430,9 @@ public class GameDataServiceImpl implements IGameDataService {
                          ) a
                     LEFT JOIN (
                         SELECT
+                            source_system as b_source_system,
                             game_id as b_game_id,
-                            game_name as b_game_name,
+                            MAX(game_name) as b_game_name,
                             IFNULL(sum(nature_amount_count), 0) amount_count,
                             IFNULL(sum(nature_amount), 0) amount,
                             round(if(sum(nature_amount_count) > 0, sum(nature_amount) / sum(nature_amount_count), 0), 2) avg_amount
@@ -2431,9 +2441,10 @@ public class GameDataServiceImpl implements IGameDataService {
                     """ + criB +
                     """
                         ) b
-                    ON a.game_id = b.b_game_id and a.game_name = b.b_game_name
+                    ON a.game_id = b.b_game_id and a.game_name = b.b_game_name and a.source_system = b.b_source_system
                     LEFT JOIN (
                         SELECT
+                            source_system as e_source_system,
                             game_id as e_game_id,
                             IFNULL(COUNT(DISTINCT user_id), 0) amount_num
                         FROM
@@ -2441,10 +2452,11 @@ public class GameDataServiceImpl implements IGameDataService {
                     """ + criAmount +
                     """
                             AND agent_id = 0
-                        GROUP BY game_id ) e
-                    ON a.game_id = e.e_game_id
+                        GROUP BY game_id, source_system ) e
+                    ON a.game_id = e.e_game_id and a.source_system = e.e_source_system
                     LEFT JOIN(
                         SELECT
+                            source_system as h_source_system,
                             game_id as h_game_id,
                             COUNT(DISTINCT user_id) as new_user_amount_num
                         FROM
@@ -2452,14 +2464,16 @@ public class GameDataServiceImpl implements IGameDataService {
                     """ + criNewUser +
                     """
                             AND agent_id = 0
-                        GROUP BY game_id) h
-                    ON a.game_id = h.h_game_id
+                        GROUP BY game_id, source_system) h
+                    ON a.game_id = h.h_game_id and a.source_system = h.h_source_system
                     LEFT JOIN (
                         SELECT
+                            source_system as i_source_system,
                             game_id as i_game_id,
                             COUNT(tempB.num) as new_user_again_num
                         FROM (
                                 SELECT
+                                    source_system,
                                     game_id,
                                     COUNT(user_id) num
                                 FROM
@@ -2469,13 +2483,15 @@ public class GameDataServiceImpl implements IGameDataService {
                                     AND agent_id = 0
                                 GROUP BY
                                     user_id,
-                                    game_id
+                                    game_id,
+                                    source_system
                                 HAVING
                                     COUNT(user_id) > 1 ) tempB
-                            GROUP BY tempB.game_id ) i
-                    ON a.game_id = i.i_game_id
+                            GROUP BY tempB.game_id, tempB.source_system ) i
+                    ON a.game_id = i.i_game_id and a.source_system = i.i_source_system
                     LEFT JOIN (
                         SELECT
+                            source_system as m_source_system,
                             user_game_id ,
                             COUNT(DISTINCT role_user_id) as role_num
                         FROM
@@ -2483,9 +2499,9 @@ public class GameDataServiceImpl implements IGameDataService {
                     """ + criRoleNum +
                     """
                             AND user_agent_id = 0
-                        GROUP BY user_game_id
+                        GROUP BY user_game_id, source_system
                     ) m
-                    ON a.game_id = m.user_game_id
+                    ON a.game_id = m.user_game_id and a.source_system = m.m_source_system
                     """;
         }
         //总量
@@ -2501,8 +2517,9 @@ public class GameDataServiceImpl implements IGameDataService {
                   	IFNULL(role_num, 0) role_num
                 FROM(
                 	SELECT
+                	    source_system,
                 		game_id,
-                		game_name,
+                		MAX(game_name) as game_name,
                 		game_classify,
                 		sum(reg_num) reg_num,
                 		sum(cost) cost,
@@ -2540,8 +2557,9 @@ public class GameDataServiceImpl implements IGameDataService {
                      ) a
                 LEFT JOIN (
                     SELECT
+                        source_system as b_source_system,
                         game_id as b_game_id,
-                        game_name as b_game_name,
+                        MAX(game_name) as b_game_name,
                         IFNULL(sum(amount_count), 0) amount_count,
                         IFNULL(sum(amount), 0) amount,
                         round(if(sum(amount_count) > 0, sum(amount) / sum(amount_count), 0), 2) avg_amount
@@ -2550,20 +2568,21 @@ public class GameDataServiceImpl implements IGameDataService {
                 """ + criB +
                 """
                     ) b
-                ON a.game_id = b.b_game_id and a.game_name = b.b_game_name
+                ON a.game_id = b.b_game_id and a.game_name = b.b_game_name and a.source_system = b.b_source_system
                 LEFT JOIN (
                     SELECT
+                        source_system as c_source_system,
                         game_id as c_game_id,
                         IFNULL(COUNT(DISTINCT user_id), 0) amount_num
                     FROM
                         game_ads.ads_information
                 """ + criAmount +
                 """
-                    GROUP BY
-                        game_id) c
-                ON a.game_id = c.c_game_id
+                    GROUP BY game_id, source_system) c
+                ON a.game_id = c.c_game_id and a.source_system = c.c_source_system
                 LEFT JOIN (
                     SELECT
+                        source_system as j_source_system,
                         game_id as j_game_id,
                         COUNT(DISTINCT user_id) new_user_amount_num
                     FROM
@@ -2571,14 +2590,16 @@ public class GameDataServiceImpl implements IGameDataService {
                 """
                 + criNewUser +
                 """
-                    GROUP BY game_id) j
-                ON a.game_id = j.j_game_id
+                    GROUP BY game_id, source_system) j
+                ON a.game_id = j.j_game_id and a.source_system = j.j_source_system
                 LEFT JOIN (
                     SELECT
+                        source_system as k_source_system,
                         game_id as k_game_id,
                         COUNT(tempC.num) as new_user_again_num
                     FROM (
                             SELECT
+                                source_system,
                                 game_id,
                                 COUNT(user_id) num
                             FROM
@@ -2587,22 +2608,24 @@ public class GameDataServiceImpl implements IGameDataService {
                 """
                             GROUP BY
                                 user_id,
-                                game_id
+                                game_id,
+                                source_system
                             HAVING
                                 COUNT(user_id) > 1 ) tempC
-                        GROUP BY tempC.game_id ) k
-                ON a.game_id = k.k_game_id
+                        GROUP BY tempC.game_id, tempC.source_system ) k
+                ON a.game_id = k.k_game_id and a.source_system = k.k_source_system
                 LEFT JOIN (
                     SELECT
+                        source_system as l_source_system,
                         user_game_id ,
                         COUNT(DISTINCT role_user_id) as role_num
                     FROM
                         dw_create_role_detail
                 """ + criRoleNum +
                 """
-                    GROUP BY user_game_id
+                    GROUP BY user_game_id, source_system
                 ) l
-                ON a.game_id = l.user_game_id
+                ON a.game_id = l.user_game_id and a.source_system = l.l_source_system
                 """;
     }
 

+ 30 - 4
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/GameListServiceImpl.java

@@ -1,10 +1,14 @@
 package com.zanxiang.game.data.serve.service.impl;
 
+import com.zanxiang.game.data.serve.pojo.dto.ChoiceListDTO;
 import com.zanxiang.game.data.serve.pojo.vo.GameListVO;
 import com.zanxiang.game.data.serve.service.IGameListService;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.nutz.dao.Cnd;
 import org.nutz.dao.Dao;
 import org.nutz.dao.Sqls;
+import org.nutz.dao.sql.Criteria;
 import org.nutz.dao.sql.Sql;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -23,11 +27,28 @@ public class GameListServiceImpl implements IGameListService {
     @Autowired
     private Dao dao;
 
+    /**
+     * 游戏列表接口 查看所有游戏、父游戏、超父游戏列表
+     * @param dto
+     * @return
+     */
     @Override
-    public GameListVO getGameList() {
+    public GameListVO getGameList(ChoiceListDTO dto) {
+
+        Criteria cri = Cnd.cri();
+        if (StringUtils.isBlank(dto.getSourceSystem())) {
+            //默认查询“ZX_ONE”数据
+            dto.setSourceSystem("ZX_ONE");
+        }
+        if (StringUtils.isNotBlank(dto.getSourceSystem())) {
+            //不同的数据源
+            cri.where().andEquals("source_system", dto.getSourceSystem());
+        }
+
         //查询游戏列表
         Sql gameListSql = Sqls.create("""
                 SELECT
+                    source_system,
                 	id,
                 	game_name,
                 	parent_game_id,
@@ -49,7 +70,8 @@ public class GameListServiceImpl implements IGameListService {
                 	LEFT JOIN dm_game_order.t_game_super c
                 	on a.source_system = c.source_system AND a.super_game_id = c.id
                 ) a
-                WHERE a.source_system = 'ZX_ONE'
+                """ + cri +
+                """
                 GROUP BY id, game_name, parent_game_id, source_system, parent_game_name, super_game_id, super_game_name;
                 """);
         gameListSql.setCallback(Sqls.callback.maps());
@@ -58,6 +80,7 @@ public class GameListServiceImpl implements IGameListService {
         //查询父游戏列表
         Sql parentGameListSql = Sqls.create("""
                 SELECT
+                    source_system,
                 	parent_game_id,
                 	parent_game_name,
                 	super_game_id,
@@ -75,7 +98,8 @@ public class GameListServiceImpl implements IGameListService {
                 	LEFT JOIN dm_game_order.t_game_super c
                 	on a.source_system = c.source_system AND a.super_game_id = c.id
                 ) a
-                WHERE a.source_system = 'ZX_ONE'
+                """ + cri +
+                """
                 GROUP BY parent_game_id, source_system, parent_game_name, super_game_id, super_game_name;
                 """);
         parentGameListSql.setCallback(Sqls.callback.maps());
@@ -84,6 +108,7 @@ public class GameListServiceImpl implements IGameListService {
         //查询超父游戏列表
         Sql superGameListSql = Sqls.create("""
                 SELECT
+                    source_system,
                 	super_game_id,
                 	super_game_name
                 FROM (
@@ -95,7 +120,8 @@ public class GameListServiceImpl implements IGameListService {
                 	LEFT JOIN dm_game_order.t_game_super b
                 	on a.source_system = b.source_system AND a.super_game_id = b.id
                 ) a
-                WHERE a.source_system = 'ZX_ONE'
+                """ + cri +
+                """
                 GROUP BY super_game_id, source_system, super_game_name;
                 """);
         superGameListSql.setCallback(Sqls.callback.maps());

+ 3 - 7
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/GameServerServiceImpl.java

@@ -317,17 +317,13 @@ public class GameServerServiceImpl implements IGameServerService {
     @Override
     public Page<GameServerSumDayVO> getGameServerDataSumDay(GameServerSumDayDTO dto) {
         //添加权限
-        /*com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo();
-        List<Long> gameIds = dto.getGameId() == null ? poerInfo.second : 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());
         //创建查询条件
         Criteria cri = Cnd.cri();
-        /*if (gameIds != null) {
+        if (gameIds != null) {
             //拼接游戏ID查询条件
             cri.where().andInList("game_id", gameIds);
-        }*/
-        if (dto.getGameId() != null) {
-            //拼接游戏ID查询条件
-            cri.where().andEquals("game_id", dto.getGameId());
         }
         if (dto.getBeginDate() != null && dto.getEndDate() != null) {
             //拼接开服时间查询条件

+ 63 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/PitcherListServiceImpl.java

@@ -0,0 +1,63 @@
+package com.zanxiang.game.data.serve.service.impl;
+
+import com.zanxiang.game.data.serve.pojo.dto.ChoiceListDTO;
+import com.zanxiang.game.data.serve.pojo.vo.PitcherListVO;
+import com.zanxiang.game.data.serve.service.IPitcherListService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.nutz.dao.Cnd;
+import org.nutz.dao.Dao;
+import org.nutz.dao.Sqls;
+import org.nutz.dao.sql.Criteria;
+import org.nutz.dao.sql.Sql;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @author tianhua
+ * @version 1.0
+ * @description: TODO
+ * @date 2023/11/3 16:51
+ */
+@Service
+@Slf4j
+public class PitcherListServiceImpl implements IPitcherListService {
+
+    @Autowired
+    private Dao dao;
+
+    /**
+     * 所有投手列表
+     * @param dto ChoiceListDTO
+     * @return list
+     */
+    @Override
+    public List<PitcherListVO> getPitcherList(ChoiceListDTO dto) {
+
+        Criteria cir = Cnd.cri();
+        if (StringUtils.isBlank(dto.getSourceSystem())) {
+            dto.setSourceSystem("ZX_ONE");
+        }
+        if (StringUtils.isNotBlank(dto.getSourceSystem())) {
+            cir.where().andEquals("source_system", dto.getSourceSystem());
+        }
+        //查询投手信息
+        Sql sql = Sqls.create("""
+                SELECT
+                    source_system,
+                    zx_pitcher_id as pitcher_id,
+                    zx_pitcher_name as pitcher_name
+                FROM dm_game_order.t_pitcher_map
+                """ + cir);
+        //设置回传对象
+        sql.setCallback(Sqls.callback.entities());
+        sql.setEntity(dao.getEntity(PitcherListVO.class));
+        //执行sql
+        dao.execute(sql);
+        //返回结果
+        return sql.getList(PitcherListVO.class);
+    }
+
+}