Browse Source

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

zhimo 8 months ago
parent
commit
7db3ae578b

+ 4 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/GameDataDayTotalVO.java

@@ -1169,4 +1169,8 @@ public class GameDataDayTotalVO {
     @ApiModelProperty(value = "新用户累计有效创角XARPU")
     @ApiModelProperty(value = "新用户累计有效创角XARPU")
     private BigDecimal newUserTotalEffectiveRoleArpu;
     private BigDecimal newUserTotalEffectiveRoleArpu;
 
 
+
+    @ApiModelProperty(value = "首日人均付费次数")
+    private BigDecimal firstDayAvgCostCount;
+
 }
 }

+ 2 - 1
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/GameDataDayVO.java

@@ -1194,7 +1194,8 @@ public class GameDataDayVO {
     @ApiModelProperty(value = "新用户累计有效创角ARPU")
     @ApiModelProperty(value = "新用户累计有效创角ARPU")
     private BigDecimal newUserTotalEffectiveRoleArpu;
     private BigDecimal newUserTotalEffectiveRoleArpu;
 
 
-
+    @ApiModelProperty(value = "首日人均付费次数")
+    private BigDecimal firstDayAvgCostCount;
 
 
 
 
 }
 }

+ 3 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/PitcherGameDataDayTotalVO.java

@@ -2126,4 +2126,7 @@ public class PitcherGameDataDayTotalVO {
     @ApiModelProperty(value = "付费趋势总:增/回/倍")
     @ApiModelProperty(value = "付费趋势总:增/回/倍")
     private RechargeTrendVO amountSumTrend;
     private RechargeTrendVO amountSumTrend;
 
 
+    @ApiModelProperty(value = "首日注册ARPPU")
+    private BigDecimal firstRegArppu;
+
 }
 }

+ 3 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/PitcherGameDataDayVO.java

@@ -2175,4 +2175,7 @@ public class PitcherGameDataDayVO {
     @ApiModelProperty(value = "付费趋势总:增/回/倍")
     @ApiModelProperty(value = "付费趋势总:增/回/倍")
     private RechargeTrendVO amountSumTrend;
     private RechargeTrendVO amountSumTrend;
 
 
+    @ApiModelProperty(value = "首日注册ARPPU")
+    private BigDecimal firstRegArppu;
+
 }
 }

+ 37 - 12
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/GameDataServiceImpl.java

@@ -2958,7 +2958,9 @@ public class GameDataServiceImpl implements IGameDataService {
                                 round(ANY_VALUE(buy_first_effective_role_amount_num_rate)*100,2) as first_effective_role_amount_num_rate, -- 首日有效创角付费比
                                 round(ANY_VALUE(buy_first_effective_role_amount_num_rate)*100,2) as first_effective_role_amount_num_rate, -- 首日有效创角付费比
                                 round(ANY_VALUE(buy_new_user_total_effective_role_amount_num_rate)*100,2) as new_user_total_effective_role_amount_num_rate, -- 新用户累计有效创角付费比
                                 round(ANY_VALUE(buy_new_user_total_effective_role_amount_num_rate)*100,2) as new_user_total_effective_role_amount_num_rate, -- 新用户累计有效创角付费比
                                 ANY_VALUE(buy_first_effective_role_arpu) as first_effective_role_arpu, -- 首日有效创角ARPU
                                 ANY_VALUE(buy_first_effective_role_arpu) as first_effective_role_arpu, -- 首日有效创角ARPU
-                                ANY_VALUE(buy_new_user_total_effective_role_arpu) as new_user_total_effective_role_arpu -- 新用户累计有效创角ARPU
+                                ANY_VALUE(buy_new_user_total_effective_role_arpu) as new_user_total_effective_role_arpu, -- 新用户累计有效创角ARPU
+                                
+                                round(IF(SUM(buy_first_new_user_amount_num) >0, SUM(buy_first_new_user_amount_count) / SUM(buy_first_new_user_amount_num), 0), 4) as first_day_avg_cost_count -- 首日人均付费次数
                             FROM
                             FROM
                                 ads_game_day
                                 ads_game_day
                             """;
                             """;
@@ -3035,7 +3037,9 @@ public class GameDataServiceImpl implements IGameDataService {
                                 round(ANY_VALUE(nature_first_effective_role_amount_num_rate)*100,2) as first_effective_role_amount_num_rate, -- 首日有效创角付费比
                                 round(ANY_VALUE(nature_first_effective_role_amount_num_rate)*100,2) as first_effective_role_amount_num_rate, -- 首日有效创角付费比
                                 round(ANY_VALUE(nature_new_user_total_effective_role_amount_num_rate)*100,2) as new_user_total_effective_role_amount_num_rate, -- 新用户累计有效创角付费比
                                 round(ANY_VALUE(nature_new_user_total_effective_role_amount_num_rate)*100,2) as new_user_total_effective_role_amount_num_rate, -- 新用户累计有效创角付费比
                                 ANY_VALUE(nature_first_effective_role_arpu) as first_effective_role_arpu, -- 首日有效创角ARPU
                                 ANY_VALUE(nature_first_effective_role_arpu) as first_effective_role_arpu, -- 首日有效创角ARPU
-                                ANY_VALUE(nature_new_user_total_effective_role_arpu) as new_user_total_effective_role_arpu -- 新用户累计有效创角ARPU
+                                ANY_VALUE(nature_new_user_total_effective_role_arpu) as new_user_total_effective_role_arpu, -- 新用户累计有效创角ARPU
+                                
+                                round(IF(SUM(nature_first_new_user_amount_num) >0, SUM(nature_first_new_user_amount_count) / SUM(nature_first_new_user_amount_num), 0), 4) as first_day_avg_cost_count -- 首日人均付费次数
                             FROM
                             FROM
                                 ads_game_day
                                 ads_game_day
                             """;
                             """;
@@ -3112,7 +3116,9 @@ public class GameDataServiceImpl implements IGameDataService {
                              round(ANY_VALUE(first_effective_role_amount_num_rate)*100,2) as first_effective_role_amount_num_rate, -- 首日有效创角付费比
                              round(ANY_VALUE(first_effective_role_amount_num_rate)*100,2) as first_effective_role_amount_num_rate, -- 首日有效创角付费比
                              round(ANY_VALUE(new_user_total_effective_role_amount_num_rate)*100,2) as new_user_total_effective_role_amount_num_rate, -- 新用户累计有效创角付费比
                              round(ANY_VALUE(new_user_total_effective_role_amount_num_rate)*100,2) as new_user_total_effective_role_amount_num_rate, -- 新用户累计有效创角付费比
                              ANY_VALUE(first_effective_role_arpu) as first_effective_role_arpu, -- 首日有效创角ARPU
                              ANY_VALUE(first_effective_role_arpu) as first_effective_role_arpu, -- 首日有效创角ARPU
-                             ANY_VALUE(new_user_total_effective_role_arpu) as new_user_total_effective_role_arpu -- 新用户累计有效创角ARPU
+                             ANY_VALUE(new_user_total_effective_role_arpu) as new_user_total_effective_role_arpu, -- 新用户累计有效创角ARPU
+                             
+                             round(IF(SUM(first_new_user_amount_num) >0, SUM(first_new_user_amount_count) / SUM(first_new_user_amount_num), 0), 4) as first_day_avg_cost_count -- 首日人均付费次数
                         FROM
                         FROM
                             ads_game_day
                             ads_game_day
                         """;
                         """;
@@ -3198,7 +3204,10 @@ public class GameDataServiceImpl implements IGameDataService {
                                 round(ANY_VALUE(buy_first_effective_role_amount_num_rate)*100,2) as first_effective_role_amount_num_rate, -- 首日有效创角付费比
                                 round(ANY_VALUE(buy_first_effective_role_amount_num_rate)*100,2) as first_effective_role_amount_num_rate, -- 首日有效创角付费比
                                 round(ANY_VALUE(buy_new_user_total_effective_role_amount_num_rate)*100,2) as new_user_total_effective_role_amount_num_rate, -- 新用户累计有效创角付费比
                                 round(ANY_VALUE(buy_new_user_total_effective_role_amount_num_rate)*100,2) as new_user_total_effective_role_amount_num_rate, -- 新用户累计有效创角付费比
                                 ANY_VALUE(buy_first_effective_role_arpu) as first_effective_role_arpu, -- 首日有效创角ARPU
                                 ANY_VALUE(buy_first_effective_role_arpu) as first_effective_role_arpu, -- 首日有效创角ARPU
-                                ANY_VALUE(buy_new_user_total_effective_role_arpu) as new_user_total_effective_role_arpu -- 新用户累计有效创角ARPU
+                                ANY_VALUE(buy_new_user_total_effective_role_arpu) as new_user_total_effective_role_arpu, -- 新用户累计有效创角ARPU
+                                
+                                round(IF(SUM(buy_first_new_user_amount_num) >0, SUM(buy_first_new_user_amount_count) / SUM(buy_first_new_user_amount_num), 0), 4) as first_day_avg_cost_count -- 首日人均付费次数
+                                
                             FROM
                             FROM
                                 game_ads_parent.ads_game_day_parent
                                 game_ads_parent.ads_game_day_parent
                             """;
                             """;
@@ -3275,7 +3284,9 @@ public class GameDataServiceImpl implements IGameDataService {
                                 round(ANY_VALUE(nature_first_effective_role_amount_num_rate)*100,2) as first_effective_role_amount_num_rate, -- 首日有效创角付费比
                                 round(ANY_VALUE(nature_first_effective_role_amount_num_rate)*100,2) as first_effective_role_amount_num_rate, -- 首日有效创角付费比
                                 round(ANY_VALUE(nature_new_user_total_effective_role_amount_num_rate)*100,2) as new_user_total_effective_role_amount_num_rate, -- 新用户累计有效创角付费比
                                 round(ANY_VALUE(nature_new_user_total_effective_role_amount_num_rate)*100,2) as new_user_total_effective_role_amount_num_rate, -- 新用户累计有效创角付费比
                                 ANY_VALUE(nature_first_effective_role_arpu) as first_effective_role_arpu, -- 首日有效创角ARPU
                                 ANY_VALUE(nature_first_effective_role_arpu) as first_effective_role_arpu, -- 首日有效创角ARPU
-                                ANY_VALUE(nature_new_user_total_effective_role_arpu) as new_user_total_effective_role_arpu -- 新用户累计有效创角ARPU
+                                ANY_VALUE(nature_new_user_total_effective_role_arpu) as new_user_total_effective_role_arpu, -- 新用户累计有效创角ARPU
+                                
+                                round(IF(SUM(nature_first_new_user_amount_num) >0, SUM(nature_first_new_user_amount_count) / SUM(nature_first_new_user_amount_num), 0), 4) as first_day_avg_cost_count -- 首日人均付费次数
                             FROM
                             FROM
                                 game_ads_parent.ads_game_day_parent
                                 game_ads_parent.ads_game_day_parent
                             """;
                             """;
@@ -3352,7 +3363,9 @@ public class GameDataServiceImpl implements IGameDataService {
                              round(ANY_VALUE(first_effective_role_amount_num_rate)*100,2) as first_effective_role_amount_num_rate, -- 首日有效创角付费比
                              round(ANY_VALUE(first_effective_role_amount_num_rate)*100,2) as first_effective_role_amount_num_rate, -- 首日有效创角付费比
                              round(ANY_VALUE(new_user_total_effective_role_amount_num_rate)*100,2) as new_user_total_effective_role_amount_num_rate, -- 新用户累计有效创角付费比
                              round(ANY_VALUE(new_user_total_effective_role_amount_num_rate)*100,2) as new_user_total_effective_role_amount_num_rate, -- 新用户累计有效创角付费比
                              ANY_VALUE(first_effective_role_arpu) as first_effective_role_arpu, -- 首日有效创角ARPU
                              ANY_VALUE(first_effective_role_arpu) as first_effective_role_arpu, -- 首日有效创角ARPU
-                             ANY_VALUE(new_user_total_effective_role_arpu) as new_user_total_effective_role_arpu -- 新用户累计有效创角ARPU
+                             ANY_VALUE(new_user_total_effective_role_arpu) as new_user_total_effective_role_arpu, -- 新用户累计有效创角ARPU
+                             
+                             round(IF(SUM(first_new_user_amount_num) >0, SUM(first_new_user_amount_count) / SUM(first_new_user_amount_num), 0), 4) as first_day_avg_cost_count -- 首日人均付费次数
                         FROM
                         FROM
                             game_ads_parent.ads_game_day_parent
                             game_ads_parent.ads_game_day_parent
                         """;
                         """;
@@ -3811,7 +3824,9 @@ public class GameDataServiceImpl implements IGameDataService {
                                 round(IFNULL(SUM(buy_first_effective_role_amount_num)/SUM(buy_first_new_user_amount_count),0)*100,2) as first_effective_role_amount_num_rate,  -- 首日有效创角付费比=首日有效创角付费人数/首日新用户充值人数
                                 round(IFNULL(SUM(buy_first_effective_role_amount_num)/SUM(buy_first_new_user_amount_count),0)*100,2) as first_effective_role_amount_num_rate,  -- 首日有效创角付费比=首日有效创角付费人数/首日新用户充值人数
                                 round(IFNULL(SUM(buy_new_user_total_effective_role_amount_num)/SUM(buy_new_user_total_amount_count),0)*100,2) as new_user_total_effective_role_amount_num_rate, -- 新用户累计有效创角付费比=新用户累计有效创角付费人数/新用户累计充值人数
                                 round(IFNULL(SUM(buy_new_user_total_effective_role_amount_num)/SUM(buy_new_user_total_amount_count),0)*100,2) as new_user_total_effective_role_amount_num_rate, -- 新用户累计有效创角付费比=新用户累计有效创角付费人数/新用户累计充值人数
                                 ROUND(IFNULL(SUM(buy_new_user_total_amount)/SUM(buy_new_user_total_effective_role_num),0),2) as first_effective_role_arpu,    -- 新用户累计有效创角ARPU=新用户累计充值金额/新用户累计有效创角人数
                                 ROUND(IFNULL(SUM(buy_new_user_total_amount)/SUM(buy_new_user_total_effective_role_num),0),2) as first_effective_role_arpu,    -- 新用户累计有效创角ARPU=新用户累计充值金额/新用户累计有效创角人数
-                                ROUND(IFNULL(SUM(buy_first_new_user_amount)/SUM(buy_first_effective_role_num),0),2) as new_user_total_effective_role_arpu -- 首日有效创角ARPU=首日新用户充值金额/首日有效创角人数
+                                ROUND(IFNULL(SUM(buy_first_new_user_amount)/SUM(buy_first_effective_role_num),0),2) as new_user_total_effective_role_arpu, -- 首日有效创角ARPU=首日新用户充值金额/首日有效创角人数
+                                
+                                round(IF(SUM(buy_first_new_user_amount_num) >0, SUM(buy_first_new_user_amount_count) / SUM(buy_first_new_user_amount_num), 0), 4) as first_day_avg_cost_count -- 首日人均付费次数
                                 
                                 
                             FROM game_ads.ads_game_day as a
                             FROM game_ads.ads_game_day as a
                                 LEFT JOIN game_dw.dw_game_amount_day_buy
                                 LEFT JOIN game_dw.dw_game_amount_day_buy
@@ -3887,7 +3902,9 @@ public class GameDataServiceImpl implements IGameDataService {
                                 round(IFNULL(SUM(nature_first_effective_role_amount_num)/SUM(nature_first_new_user_amount_count),0)*100,2) as first_effective_role_amount_num_rate,  -- 首日有效创角付费比=首日有效创角付费人数/首日新用户充值人数
                                 round(IFNULL(SUM(nature_first_effective_role_amount_num)/SUM(nature_first_new_user_amount_count),0)*100,2) as first_effective_role_amount_num_rate,  -- 首日有效创角付费比=首日有效创角付费人数/首日新用户充值人数
                                 round(IFNULL(SUM(nature_new_user_total_effective_role_amount_num)/SUM(nature_new_user_total_amount_count),0)*100,2) as new_user_total_effective_role_amount_num_rate, -- 新用户累计有效创角付费比=新用户累计有效创角付费人数/新用户累计充值人数
                                 round(IFNULL(SUM(nature_new_user_total_effective_role_amount_num)/SUM(nature_new_user_total_amount_count),0)*100,2) as new_user_total_effective_role_amount_num_rate, -- 新用户累计有效创角付费比=新用户累计有效创角付费人数/新用户累计充值人数
                                 ROUND(IFNULL(SUM(nature_new_user_total_amount)/SUM(nature_new_user_total_effective_role_num),0),2) as first_effective_role_arpu,    -- 新用户累计有效创角ARPU=新用户累计充值金额/新用户累计有效创角人数
                                 ROUND(IFNULL(SUM(nature_new_user_total_amount)/SUM(nature_new_user_total_effective_role_num),0),2) as first_effective_role_arpu,    -- 新用户累计有效创角ARPU=新用户累计充值金额/新用户累计有效创角人数
-                                ROUND(IFNULL(SUM(nature_first_new_user_amount)/SUM(nature_first_effective_role_num),0),2) as new_user_total_effective_role_arpu -- 首日有效创角ARPU=首日新用户充值金额/首日有效创角人数
+                                ROUND(IFNULL(SUM(nature_first_new_user_amount)/SUM(nature_first_effective_role_num),0),2) as new_user_total_effective_role_arpu, -- 首日有效创角ARPU=首日新用户充值金额/首日有效创角人数
+                                
+                                round(IF(SUM(nature_first_new_user_amount_num) >0, SUM(nature_first_new_user_amount_count) / SUM(nature_first_new_user_amount_num), 0), 4) as first_day_avg_cost_count -- 首日人均付费次数
                             FROM game_ads.ads_game_day as a
                             FROM game_ads.ads_game_day as a
                                 left join  game_dw.dw_game_amount_day_nature d
                                 left join  game_dw.dw_game_amount_day_nature d
                                 on a.dt=d.dt and a.game_id = d.nature_game_id
                                 on a.dt=d.dt and a.game_id = d.nature_game_id
@@ -3963,7 +3980,9 @@ public class GameDataServiceImpl implements IGameDataService {
                               round(IFNULL(SUM(first_effective_role_amount_num)/SUM(first_new_user_amount_count),0)*100,2) as first_effective_role_amount_num_rate,  -- 首日有效创角付费比=首日有效创角付费人数/首日新用户充值人数
                               round(IFNULL(SUM(first_effective_role_amount_num)/SUM(first_new_user_amount_count),0)*100,2) as first_effective_role_amount_num_rate,  -- 首日有效创角付费比=首日有效创角付费人数/首日新用户充值人数
                               round(IFNULL(SUM(new_user_total_effective_role_amount_num)/SUM(new_user_total_amount_count),0)*100,2) as new_user_total_effective_role_amount_num_rate, -- 新用户累计有效创角付费比=新用户累计有效创角付费人数/新用户累计充值人数
                               round(IFNULL(SUM(new_user_total_effective_role_amount_num)/SUM(new_user_total_amount_count),0)*100,2) as new_user_total_effective_role_amount_num_rate, -- 新用户累计有效创角付费比=新用户累计有效创角付费人数/新用户累计充值人数
                               ROUND(IFNULL(SUM(new_user_total_amount)/SUM(new_user_total_effective_role_num),0),2) as first_effective_role_arpu,    -- 新用户累计有效创角ARPU=新用户累计充值金额/新用户累计有效创角人数
                               ROUND(IFNULL(SUM(new_user_total_amount)/SUM(new_user_total_effective_role_num),0),2) as first_effective_role_arpu,    -- 新用户累计有效创角ARPU=新用户累计充值金额/新用户累计有效创角人数
-                              ROUND(IFNULL(SUM(first_new_user_amount)/SUM(first_effective_role_num),0),2) as new_user_total_effective_role_arpu -- 首日有效创角ARPU=首日新用户充值金额/首日有效创角人数
+                              ROUND(IFNULL(SUM(first_new_user_amount)/SUM(first_effective_role_num),0),2) as new_user_total_effective_role_arpu, -- 首日有效创角ARPU=首日新用户充值金额/首日有效创角人数
+                              
+                               round(IF(SUM(first_new_user_amount_num) >0, SUM(first_new_user_amount_count) / SUM(first_new_user_amount_num), 0), 4) as first_day_avg_cost_count -- 首日人均付费次数
                           FROM game_ads.ads_game_day as a
                           FROM game_ads.ads_game_day as a
                           left join   game_dw.dw_game_amount_day
                           left join   game_dw.dw_game_amount_day
                           b on a.dt=b.dt and a.game_id = b.game_id
                           b on a.dt=b.dt and a.game_id = b.game_id
@@ -4047,7 +4066,9 @@ public class GameDataServiceImpl implements IGameDataService {
                                 round(IFNULL(SUM(buy_first_effective_role_amount_num)/SUM(buy_first_new_user_amount_count),0)*100,2) as first_effective_role_amount_num_rate,  -- 首日有效创角付费比=首日有效创角付费人数/首日新用户充值人数
                                 round(IFNULL(SUM(buy_first_effective_role_amount_num)/SUM(buy_first_new_user_amount_count),0)*100,2) as first_effective_role_amount_num_rate,  -- 首日有效创角付费比=首日有效创角付费人数/首日新用户充值人数
                                 round(IFNULL(SUM(buy_new_user_total_effective_role_amount_num)/SUM(buy_new_user_total_amount_count),0)*100,2) as new_user_total_effective_role_amount_num_rate, -- 新用户累计有效创角付费比=新用户累计有效创角付费人数/新用户累计充值人数
                                 round(IFNULL(SUM(buy_new_user_total_effective_role_amount_num)/SUM(buy_new_user_total_amount_count),0)*100,2) as new_user_total_effective_role_amount_num_rate, -- 新用户累计有效创角付费比=新用户累计有效创角付费人数/新用户累计充值人数
                                 ROUND(IFNULL(SUM(buy_new_user_total_amount)/SUM(buy_new_user_total_effective_role_num),0),2) as first_effective_role_arpu,    -- 新用户累计有效创角ARPU=新用户累计充值金额/新用户累计有效创角人数
                                 ROUND(IFNULL(SUM(buy_new_user_total_amount)/SUM(buy_new_user_total_effective_role_num),0),2) as first_effective_role_arpu,    -- 新用户累计有效创角ARPU=新用户累计充值金额/新用户累计有效创角人数
-                                ROUND(IFNULL(SUM(buy_first_new_user_amount)/SUM(buy_first_effective_role_num),0),2) as new_user_total_effective_role_arpu -- 首日有效创角ARPU=首日新用户充值金额/首日有效创角人数
+                                ROUND(IFNULL(SUM(buy_first_new_user_amount)/SUM(buy_first_effective_role_num),0),2) as new_user_total_effective_role_arpu, -- 首日有效创角ARPU=首日新用户充值金额/首日有效创角人数
+                                
+                                round(IF(SUM(buy_first_new_user_amount_num) >0, SUM(buy_first_new_user_amount_count) / SUM(buy_first_new_user_amount_num), 0), 4) as first_day_avg_cost_count -- 首日人均付费次数
                             FROM game_ads_parent.ads_game_day_parent as a
                             FROM game_ads_parent.ads_game_day_parent as a
                             LEFT JOIN  game_dw_parent.dw_game_amount_day_buy_parent b
                             LEFT JOIN  game_dw_parent.dw_game_amount_day_buy_parent b
                             on a.source_system = b.source_system
                             on a.source_system = b.source_system
@@ -4122,7 +4143,9 @@ public class GameDataServiceImpl implements IGameDataService {
                                 round(IFNULL(SUM(nature_first_effective_role_amount_num)/SUM(nature_first_new_user_amount_count),0)*100,2) as first_effective_role_amount_num_rate,  -- 首日有效创角付费比=首日有效创角付费人数/首日新用户充值人数
                                 round(IFNULL(SUM(nature_first_effective_role_amount_num)/SUM(nature_first_new_user_amount_count),0)*100,2) as first_effective_role_amount_num_rate,  -- 首日有效创角付费比=首日有效创角付费人数/首日新用户充值人数
                                 round(IFNULL(SUM(nature_new_user_total_effective_role_amount_num)/SUM(nature_new_user_total_amount_count),0)*100,2) as new_user_total_effective_role_amount_num_rate, -- 新用户累计有效创角付费比=新用户累计有效创角付费人数/新用户累计充值人数
                                 round(IFNULL(SUM(nature_new_user_total_effective_role_amount_num)/SUM(nature_new_user_total_amount_count),0)*100,2) as new_user_total_effective_role_amount_num_rate, -- 新用户累计有效创角付费比=新用户累计有效创角付费人数/新用户累计充值人数
                                 ROUND(IFNULL(SUM(nature_new_user_total_amount)/SUM(nature_new_user_total_effective_role_num),0),2) as first_effective_role_arpu,    -- 新用户累计有效创角ARPU=新用户累计充值金额/新用户累计有效创角人数
                                 ROUND(IFNULL(SUM(nature_new_user_total_amount)/SUM(nature_new_user_total_effective_role_num),0),2) as first_effective_role_arpu,    -- 新用户累计有效创角ARPU=新用户累计充值金额/新用户累计有效创角人数
-                                ROUND(IFNULL(SUM(nature_first_new_user_amount)/SUM(nature_first_effective_role_num),0),2) as new_user_total_effective_role_arpu -- 首日有效创角ARPU=首日新用户充值金额/首日有效创角人数
+                                ROUND(IFNULL(SUM(nature_first_new_user_amount)/SUM(nature_first_effective_role_num),0),2) as new_user_total_effective_role_arpu, -- 首日有效创角ARPU=首日新用户充值金额/首日有效创角人数
+                                
+                                round(IF(SUM(nature_first_new_user_amount_num) >0, SUM(nature_first_new_user_amount_count) / SUM(nature_first_new_user_amount_num), 0), 4) as first_day_avg_cost_count -- 首日人均付费次数
                             FROM game_ads_parent.ads_game_day_parent as a
                             FROM game_ads_parent.ads_game_day_parent as a
                                 left join   game_dw_parent.dw_game_amount_day_nature_parent d
                                 left join   game_dw_parent.dw_game_amount_day_nature_parent d
                                 on a.dt=d.dt and a.parent_game_id = d.nature_parent_game_id
                                 on a.dt=d.dt and a.parent_game_id = d.nature_parent_game_id
@@ -4198,7 +4221,9 @@ public class GameDataServiceImpl implements IGameDataService {
                               round(IFNULL(SUM(first_effective_role_amount_num)/SUM(first_new_user_amount_count),0)*100,2) as first_effective_role_amount_num_rate,  -- 首日有效创角付费比=首日有效创角付费人数/首日新用户充值人数
                               round(IFNULL(SUM(first_effective_role_amount_num)/SUM(first_new_user_amount_count),0)*100,2) as first_effective_role_amount_num_rate,  -- 首日有效创角付费比=首日有效创角付费人数/首日新用户充值人数
                               round(IFNULL(SUM(new_user_total_effective_role_amount_num)/SUM(new_user_total_amount_count),0)*100,2) as new_user_total_effective_role_amount_num_rate, -- 新用户累计有效创角付费比=新用户累计有效创角付费人数/新用户累计充值人数
                               round(IFNULL(SUM(new_user_total_effective_role_amount_num)/SUM(new_user_total_amount_count),0)*100,2) as new_user_total_effective_role_amount_num_rate, -- 新用户累计有效创角付费比=新用户累计有效创角付费人数/新用户累计充值人数
                               ROUND(IFNULL(SUM(new_user_total_amount)/SUM(new_user_total_effective_role_num),0),2) as first_effective_role_arpu,    -- 新用户累计有效创角ARPU=新用户累计充值金额/新用户累计有效创角人数
                               ROUND(IFNULL(SUM(new_user_total_amount)/SUM(new_user_total_effective_role_num),0),2) as first_effective_role_arpu,    -- 新用户累计有效创角ARPU=新用户累计充值金额/新用户累计有效创角人数
-                              ROUND(IFNULL(SUM(first_new_user_amount)/SUM(first_effective_role_num),0),2) as new_user_total_effective_role_arpu -- 首日有效创角ARPU=首日新用户充值金额/首日有效创角人数
+                              ROUND(IFNULL(SUM(first_new_user_amount)/SUM(first_effective_role_num),0),2) as new_user_total_effective_role_arpu, -- 首日有效创角ARPU=首日新用户充值金额/首日有效创角人数
+                              
+                              round(IF(SUM(first_new_user_amount_num) >0, SUM(first_new_user_amount_count) / SUM(first_new_user_amount_num), 0), 4) as first_day_avg_cost_count -- 首日人均付费次数
                           FROM game_ads_parent.ads_game_day_parent as a
                           FROM game_ads_parent.ads_game_day_parent as a
                           left join   game_dw_parent.dw_game_amount_day_parent as b
                           left join   game_dw_parent.dw_game_amount_day_parent as b
                           on a.dt = b.dt and a.parent_game_id = b.parent_game_id 
                           on a.dt = b.dt and a.parent_game_id = b.parent_game_id 

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

@@ -2666,6 +2666,9 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
                     ROUND(IF(SUM(first_new_user_amount_num) > 0 , SUM(first_new_user_amount) / SUM(first_new_user_amount_num), 0), 2) as first_arpu,
                     ROUND(IF(SUM(first_new_user_amount_num) > 0 , SUM(first_new_user_amount) / SUM(first_new_user_amount_num), 0), 2) as first_arpu,
                     ROUND(IF(SUM(new_user_total_amount_num) > 0 , SUM(new_user_total_amount) / SUM(new_user_total_amount_num), 0), 2) as today_arpu,
                     ROUND(IF(SUM(new_user_total_amount_num) > 0 , SUM(new_user_total_amount) / SUM(new_user_total_amount_num), 0), 2) as today_arpu,
                     ROUND(IF(SUM(amount_num) > 0 , SUM(amount) / SUM(amount_num), 0), 2) as paper_arpu,
                     ROUND(IF(SUM(amount_num) > 0 , SUM(amount) / SUM(amount_num), 0), 2) as paper_arpu,
+                    
+                    ROUND(IF(SUM(register_num) > 0 , SUM(first_new_user_amount) / SUM(register_num), 0), 2) as first_reg_arppu,
+                    
                     SUM(hundred_user_num) as hundred_user_num,
                     SUM(hundred_user_num) as hundred_user_num,
                     ROUND(IF(SUM(hundred_user_num) > 0 , SUM(cost) / SUM(hundred_user_num), 0), 2) as hundred_user_num_cost,
                     ROUND(IF(SUM(hundred_user_num) > 0 , SUM(cost) / SUM(hundred_user_num), 0), 2) as hundred_user_num_cost,
                     ROUND(IF(SUM(cost) > 0 , SUM(da1) / SUM(cost), 0), 4) as roi1,
                     ROUND(IF(SUM(cost) > 0 , SUM(da1) / SUM(cost), 0), 4) as roi1,
@@ -2776,6 +2779,9 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
                     ROUND(IF(SUM(amount_num) > 0 , SUM(amount) / SUM(amount_num), 0), 2) as paper_arpu,
                     ROUND(IF(SUM(amount_num) > 0 , SUM(amount) / SUM(amount_num), 0), 2) as paper_arpu,
                     SUM(hundred_user_num) as hundred_user_num,
                     SUM(hundred_user_num) as hundred_user_num,
                     ROUND(IF(SUM(hundred_user_num) > 0 , SUM(cost) / SUM(hundred_user_num), 0), 2) as hundred_user_num_cost,
                     ROUND(IF(SUM(hundred_user_num) > 0 , SUM(cost) / SUM(hundred_user_num), 0), 2) as hundred_user_num_cost,
+                    
+                    ROUND(IF(SUM(register_num) > 0 , SUM(first_new_user_amount) / SUM(register_num), 0), 2) as first_reg_arppu,
+                    
                     ROUND(IF(SUM(cost) > 0 , SUM(da1) / SUM(cost), 0), 4) as roi1,
                     ROUND(IF(SUM(cost) > 0 , SUM(da1) / SUM(cost), 0), 4) as roi1,
                     ROUND(IF(SUM(cost) > 0 , SUM(da2) / SUM(cost), 0), 4) as roi2,
                     ROUND(IF(SUM(cost) > 0 , SUM(da2) / SUM(cost), 0), 4) as roi2,
                     ROUND(IF(SUM(cost) > 0 , SUM(da3) / SUM(cost), 0), 4) as roi3,
                     ROUND(IF(SUM(cost) > 0 , SUM(da3) / SUM(cost), 0), 4) as roi3,
@@ -2984,6 +2990,9 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
                     ROUND(IF(SUM(amount_num) > 0 , SUM(amount) / SUM(amount_num), 0), 2) as paper_arpu,
                     ROUND(IF(SUM(amount_num) > 0 , SUM(amount) / SUM(amount_num), 0), 2) as paper_arpu,
                     SUM(hundred_user_num) as hundred_user_num,
                     SUM(hundred_user_num) as hundred_user_num,
                     ROUND(IF(SUM(hundred_user_num) > 0 , SUM(cost) / SUM(hundred_user_num), 0), 2) as hundred_user_num_cost,
                     ROUND(IF(SUM(hundred_user_num) > 0 , SUM(cost) / SUM(hundred_user_num), 0), 2) as hundred_user_num_cost,
+                    
+                    ROUND(IF(SUM(register_num) > 0 , SUM(first_new_user_amount) / SUM(register_num), 0), 2) as first_reg_arppu,
+                    
                     ROUND(IF(SUM(cost) > 0 , SUM(da1) / SUM(cost), 0), 4) as roi1,
                     ROUND(IF(SUM(cost) > 0 , SUM(da1) / SUM(cost), 0), 4) as roi1,
                     ROUND(IF(SUM(cost) > 0 , SUM(da2) / SUM(cost), 0), 4) as roi2,
                     ROUND(IF(SUM(cost) > 0 , SUM(da2) / SUM(cost), 0), 4) as roi2,
                     ROUND(IF(SUM(cost) > 0 , SUM(da3) / SUM(cost), 0), 4) as roi3,
                     ROUND(IF(SUM(cost) > 0 , SUM(da3) / SUM(cost), 0), 4) as roi3,

+ 1 - 1
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/SDKApplication.java

@@ -23,7 +23,7 @@ public class SDKApplication {
 
 
     public static void main(String[] args) {
     public static void main(String[] args) {
         SpringApplication.run(SDKApplication.class, args);
         SpringApplication.run(SDKApplication.class, args);
-        System.out.println("赞象SDK服务启动成功 <订单回传优化> ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象SDK服务启动成功 <修正蜀山cpOrderId前端不正确问题> ( ´・・)ノ(._.`) \n" +
                 " ___________ _   __\n" +
                 " ___________ _   __\n" +
                 "/  ___|  _  \\ | / /\n" +
                 "/  ___|  _  \\ | / /\n" +
                 "\\ `--.| | | | |/ / \n" +
                 "\\ `--.| | | | |/ / \n" +

+ 10 - 1
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/OrderServiceImpl.java

@@ -16,6 +16,7 @@ import com.zanxiang.module.util.bean.BeanUtil;
 import com.zanxiang.module.util.exception.BaseException;
 import com.zanxiang.module.util.exception.BaseException;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.RandomStringUtils;
 import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.logging.log4j.util.Strings;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
@@ -90,7 +91,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 
 
     private Order transform(UserData userData, String orderNum, ProductPayParam payParam, User user, GameUser gameUser,
     private Order transform(UserData userData, String orderNum, ProductPayParam payParam, User user, GameUser gameUser,
                             Game game, GameUserRole gameUserRole, GamePayWayDTO gamePayWayDTO) {
                             Game game, GameUserRole gameUserRole, GamePayWayDTO gamePayWayDTO) {
-        return Order.builder()
+        Order order = Order.builder()
                 .orderId(orderNum)
                 .orderId(orderNum)
                 .cpOrderId(payParam.getOrderId())
                 .cpOrderId(payParam.getOrderId())
                 .agentId(user.getAgentId())
                 .agentId(user.getAgentId())
@@ -117,6 +118,14 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
                 .createTime(LocalDateTime.now())
                 .createTime(LocalDateTime.now())
                 .updateTime(LocalDateTime.now())
                 .updateTime(LocalDateTime.now())
                 .build();
                 .build();
+        //蜀山天下, sdk前端存在bug, cp订单id参数修正
+        if (game.getId() == 29 && !order.getCpOrderId().contains("NZW")) {
+            //ext中记录了正确的cp订单id, 修正订单数据
+            if (Strings.isNotBlank(order.getExt()) && order.getExt().contains("NZW")) {
+                order.setCpOrderId(order.getExt());
+            }
+        }
+        return order;
     }
     }
 
 
     @Override
     @Override