Quellcode durchsuchen

Merge branch 'package' of GameCenter/game-center into dev

zhangxianyu vor 3 Monaten
Ursprung
Commit
3696f8f3df

+ 2 - 2
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/GameDataController.java

@@ -140,14 +140,14 @@ public class GameDataController {
     }
     }
 
 
     @ApiOperation(value = "留存数据-月")
     @ApiOperation(value = "留存数据-月")
-    @PreAuthorize(permissionKey = "gameData:activeDay:activeMonth")
+    @PreAuthorize(permissionKey = "gameData:activeData:activeMonth")
     @PostMapping("/activeData/month")
     @PostMapping("/activeData/month")
     public ResultVO<Page<ActiveDataMonthVO>> getActiveDataMonth(@RequestBody ActiveDataDayDTO dto) {
     public ResultVO<Page<ActiveDataMonthVO>> getActiveDataMonth(@RequestBody ActiveDataDayDTO dto) {
         return ResultVO.ok(activeDataService.getActiveDataMonth(dto));
         return ResultVO.ok(activeDataService.getActiveDataMonth(dto));
     }
     }
 
 
     @ApiOperation(value = "留存数据-月总计")
     @ApiOperation(value = "留存数据-月总计")
-    @PreAuthorize(permissionKey = "gameData:activeDay:activeMonthTotal")
+    @PreAuthorize(permissionKey = "gameData:activeData:activeMonthTotal")
     @PostMapping("/activeData/monthTotal")
     @PostMapping("/activeData/monthTotal")
     public ResultVO<ActiveDataMonthTotalVO> getActiveMonthDataTotal(@RequestBody ActiveDataTotalDTO dto) {
     public ResultVO<ActiveDataMonthTotalVO> getActiveMonthDataTotal(@RequestBody ActiveDataTotalDTO dto) {
         return ResultVO.ok(activeDataService.getActiveMonthDataTotal(dto));
         return ResultVO.ok(activeDataService.getActiveMonthDataTotal(dto));

+ 49 - 11
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/IActiveDataServiceImpl.java

@@ -1141,9 +1141,9 @@ public class IActiveDataServiceImpl implements IActiveDataService {
         //创建sql查询数据
         //创建sql查询数据
         Sql sql;
         Sql sql;
         if (dto.getGameDimension() == 1L) {
         if (dto.getGameDimension() == 1L) {
-            sql = Sqls.create(getActiveDataMonthSql(dto.getTableTypes(), queryTableName, cri) + orderByCri);
+            sql = Sqls.create(getActiveDataMonthSql(dto.getTableTypes(),dto.getActiveTypes(), queryTableName, cri) + orderByCri);
         } else {
         } else {
-            sql = Sqls.create(getActiveDataMonthSqlForParent(dto.getTableTypes(), queryTableName, cri) + orderByCri);
+            sql = Sqls.create(getActiveDataMonthSqlForParent(dto.getTableTypes(),dto.getActiveTypes(), queryTableName, cri) + orderByCri);
         }
         }
         //设置自定义回传类型
         //设置自定义回传类型
         sql.setCallback(Sqls.callback.entities());
         sql.setCallback(Sqls.callback.entities());
@@ -2609,16 +2609,23 @@ public class IActiveDataServiceImpl implements IActiveDataService {
      * @param cri       查询条件
      * @param cri       查询条件
      * @return String
      * @return String
      */
      */
-    private String getActiveDataMonthSql(String type, String tableName, Criteria cri) {
+    private String getActiveDataMonthSql(String type, String activeTypes,String tableName, Criteria cri) {
+        boolean isReg = "reg".equals(activeTypes);
         if ("buy".equals(type)) {
         if ("buy".equals(type)) {
+            String regNumField = "buy_reg_num as reg_num,";
+            if(!isReg){
+                regNumField = "";
+            }
             return """
             return """
-                    SELECT 
+                    SELECT
                                                         dt,
                                                         dt,
                                                         source_system,
                                                         source_system,
                                                         game_id,
                                                         game_id,
                                                         game_name,
                                                         game_name,
                                                         game_classify,
                                                         game_classify,
-                                                        buy_reg_num as reg_num,
+                                                        """
+                                                        +regNumField+
+                                                        """
                                                         buy_m1 as m1,
                                                         buy_m1 as m1,
                                                         buy_m2 as m2,
                                                         buy_m2 as m2,
                                                         buy_m3 as m3,
                                                         buy_m3 as m3,
@@ -2645,6 +2652,10 @@ public class IActiveDataServiceImpl implements IActiveDataService {
                                                         buy_m24 as m24
                                                         buy_m24 as m24
                                                     FROM """ +" " + tableName + cri;
                                                     FROM """ +" " + tableName + cri;
         } else if ("nature".equals(type)) {
         } else if ("nature".equals(type)) {
+            String regNumField = "nature_reg_num as reg_num,";
+            if(!isReg){
+                regNumField = "";
+            }
             return """
             return """
                     SELECT
                     SELECT
                                                         dt,
                                                         dt,
@@ -2652,7 +2663,9 @@ public class IActiveDataServiceImpl implements IActiveDataService {
                                                         game_id,
                                                         game_id,
                                                         game_name,
                                                         game_name,
                                                         game_classify,
                                                         game_classify,
-                                                        nature_reg_num as reg_num,
+                                                        """
+                                                        +regNumField+
+                                                        """
                                                         nature_m1 as m1,
                                                         nature_m1 as m1,
                                                         nature_m2 as m2,
                                                         nature_m2 as m2,
                                                         nature_m3 as m3,
                                                         nature_m3 as m3,
@@ -2679,6 +2692,10 @@ public class IActiveDataServiceImpl implements IActiveDataService {
                                                         nature_m24 as m24
                                                         nature_m24 as m24
                                                     FROM """ + " "+tableName + cri;
                                                     FROM """ + " "+tableName + cri;
         }
         }
+        String regNumField = "reg_num,";
+        if(!isReg){
+            regNumField = "";
+        }
         //总量 total
         //总量 total
         return """
         return """
                     SELECT
                     SELECT
@@ -2687,7 +2704,9 @@ public class IActiveDataServiceImpl implements IActiveDataService {
                                                         game_id,
                                                         game_id,
                                                         game_name,
                                                         game_name,
                                                         game_classify,
                                                         game_classify,
-                                                        reg_num,
+                                                        """
+                                                        +regNumField+
+                                                        """
                                                         total_m1 as m1,
                                                         total_m1 as m1,
                                                         total_m2 as m2,
                                                         total_m2 as m2,
                                                         total_m3 as m3,
                                                         total_m3 as m3,
@@ -3240,8 +3259,13 @@ public class IActiveDataServiceImpl implements IActiveDataService {
      * @param cri       查询条件
      * @param cri       查询条件
      * @return String
      * @return String
      */
      */
-    private String getActiveDataMonthSqlForParent(String type, String tableName, Criteria cri) {
+    private String getActiveDataMonthSqlForParent(String type,String activeTypes, String tableName, Criteria cri) {
+        boolean isReg = "reg".equals(activeTypes);
         if ("buy".equals(type)) {
         if ("buy".equals(type)) {
+            String regNumField = "buy_reg_num as reg_num,";
+            if(!isReg){
+                regNumField = "";
+            }
             return """
             return """
                     SELECT
                     SELECT
                                                         dt,
                                                         dt,
@@ -3249,7 +3273,9 @@ public class IActiveDataServiceImpl implements IActiveDataService {
                                                         parent_game_id as game_id,
                                                         parent_game_id as game_id,
                                                         parent_game_name as game_name,
                                                         parent_game_name as game_name,
                                                         parent_game_name_classify as game_classify,
                                                         parent_game_name_classify as game_classify,
-                                                        buy_reg_num as reg_num,
+                                                        """
+                                                            +regNumField+
+                                                        """
                                                         buy_m1 as m1,
                                                         buy_m1 as m1,
                                                         buy_m2 as m2,
                                                         buy_m2 as m2,
                                                         buy_m3 as m3,
                                                         buy_m3 as m3,
@@ -3276,6 +3302,10 @@ public class IActiveDataServiceImpl implements IActiveDataService {
                                                         buy_m24 as m24
                                                         buy_m24 as m24
                                                     FROM """ + " " + tableName + cri;
                                                     FROM """ + " " + tableName + cri;
         } else if ("nature".equals(type)) {
         } else if ("nature".equals(type)) {
+            String regNumField = "nature_reg_num as reg_num,";
+            if(!isReg){
+                regNumField = "";
+            }
             return """
             return """
                     SELECT
                     SELECT
                                                         dt,
                                                         dt,
@@ -3283,7 +3313,9 @@ public class IActiveDataServiceImpl implements IActiveDataService {
                                                         parent_game_id as game_id,
                                                         parent_game_id as game_id,
                                                         parent_game_name as game_name,
                                                         parent_game_name as game_name,
                                                         parent_game_name_classify as game_classify,
                                                         parent_game_name_classify as game_classify,
-                                                        nature_reg_num as reg_num,
+                                                        """
+                                                        +regNumField+
+                                                        """
                                                         nature_m1 as m1,
                                                         nature_m1 as m1,
                                                         nature_m2 as m2,
                                                         nature_m2 as m2,
                                                         nature_m3 as m3,
                                                         nature_m3 as m3,
@@ -3310,6 +3342,10 @@ public class IActiveDataServiceImpl implements IActiveDataService {
                                                         nature_m24 as m24
                                                         nature_m24 as m24
                                                     FROM """ + " " + tableName + cri;
                                                     FROM """ + " " + tableName + cri;
         }
         }
+        String regNumField = "reg_num,";
+        if(!isReg){
+            regNumField = "";
+        }
         //总量 total
         //总量 total
         return """
         return """
                     SELECT
                     SELECT
@@ -3318,7 +3354,9 @@ public class IActiveDataServiceImpl implements IActiveDataService {
                                                         parent_game_id as game_id,
                                                         parent_game_id as game_id,
                                                         parent_game_name as game_name,
                                                         parent_game_name as game_name,
                                                         parent_game_name_classify as game_classify,
                                                         parent_game_name_classify as game_classify,
-                                                        reg_num,
+                                                        """
+                                                        +regNumField+
+                                                        """
                                                         total_m1 as m1,
                                                         total_m1 as m1,
                                                         total_m2 as m2,
                                                         total_m2 as m2,
                                                         total_m3 as m3,
                                                         total_m3 as m3,