|
@@ -55,9 +55,13 @@ public class PromotionDayServiceImpl implements IAdsPromotionDayService {
|
|
|
* @return
|
|
|
*/
|
|
|
public Page<PromotionDayVO> getPromotionDayListData(PromotionDayDTO 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());
|
|
|
+// 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());
|
|
|
+
|
|
|
+ List<Long> userIds = dto.getPitcherId() == null ? null : Collections.singletonList(dto.getPitcherId());
|
|
|
+ List<Long> gameIds = dto.getGameId() == null ? null : Collections.singletonList(dto.getGameId());
|
|
|
+
|
|
|
//如果没有排序条件给默认值
|
|
|
if (StringUtils.isBlank(dto.getSortFiled())) {
|
|
|
dto.setSortFiled("dt");
|
|
@@ -142,9 +146,13 @@ public class PromotionDayServiceImpl implements IAdsPromotionDayService {
|
|
|
*/
|
|
|
@Override
|
|
|
public Page<PromotionDayVO> getPromotionDayData(PromotionDayDTO 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());
|
|
|
+// 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());
|
|
|
+
|
|
|
+ List<Long> userIds = dto.getPitcherId() == null ? null : Collections.singletonList(dto.getPitcherId());
|
|
|
+ List<Long> gameIds = dto.getGameId() == null ? null : Collections.singletonList(dto.getGameId());
|
|
|
+
|
|
|
//如果没有排序条件给默认值
|
|
|
if (StringUtils.isBlank(dto.getSortFiled())) {
|
|
|
dto.setSortFiled("today_cost");
|
|
@@ -225,9 +233,13 @@ public class PromotionDayServiceImpl implements IAdsPromotionDayService {
|
|
|
*/
|
|
|
@Override
|
|
|
public PromotionDayTotalVO getPromotionDayTotalData(PromotionDayTotalDTO 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());
|
|
|
+// 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());
|
|
|
+
|
|
|
+ List<Long> userIds = dto.getPitcherId() == null ? null : Collections.singletonList(dto.getPitcherId());
|
|
|
+ List<Long> gameIds = dto.getGameId() == null ? null : Collections.singletonList(dto.getGameId());
|
|
|
+
|
|
|
//创建查询条件
|
|
|
Criteria cri = Cnd.cri();
|
|
|
if (dto.getAccountId() != null) {
|
|
@@ -1058,7 +1070,16 @@ public class PromotionDayServiceImpl implements IAdsPromotionDayService {
|
|
|
sub_order_amount,
|
|
|
ROUND(IF(first_new_user_amount_count > 0, today_cost / first_new_user_amount_count, 0), 2) as first_new_user_amount_count_cost,
|
|
|
ROUND(IF(new_user_total_amount_count > 0, today_cost / new_user_total_amount_count, 0), 2) as new_user_total_amount_count_cost,
|
|
|
- ROUND(IF(total_amount_count > 0, promotion_total_cost / total_amount_count, 0), 2) as total_amount_count_cost
|
|
|
+ ROUND(IF(total_amount_count > 0, promotion_total_cost / total_amount_count, 0), 2) as total_amount_count_cost,
|
|
|
+ attribution_game_pay7d_count,
|
|
|
+ attribution_active_pay7d_per_count,
|
|
|
+ attribution_game_pay7d_cost,
|
|
|
+ day7_amount_count,
|
|
|
+ day7_amount_per_cost,
|
|
|
+ day7_amount_per_count,
|
|
|
+ day7_arpu,
|
|
|
+ day7_amount_num,
|
|
|
+ day7_amount
|
|
|
FROM
|
|
|
game_ads.ads_promotion_day
|
|
|
""";
|
|
@@ -1166,7 +1187,16 @@ public class PromotionDayServiceImpl implements IAdsPromotionDayService {
|
|
|
(SUM(first_new_user_amount_count) - SUM(first_sub_amount_count)) as sub_order_num,
|
|
|
(SUM(first_new_user_amount) - SUM(first_sub_amount)) as sub_order_amount,
|
|
|
ROUND(IF(SUM(first_new_user_amount_count) > 0, SUM(today_cost) / SUM(first_new_user_amount_count), 0), 2) as first_new_user_amount_count_cost,
|
|
|
- ROUND(IF(SUM(new_user_total_amount_count) > 0, SUM(today_cost) / SUM(new_user_total_amount_count), 0), 2) as new_user_total_amount_count_cost
|
|
|
+ ROUND(IF(SUM(new_user_total_amount_count) > 0, SUM(today_cost) / SUM(new_user_total_amount_count), 0), 2) as new_user_total_amount_count_cost,
|
|
|
+ SUM(attribution_game_pay7d_count) as attribution_game_pay7d_count,
|
|
|
+ SUM(attribution_active_pay7d_per_count) as attribution_active_pay7d_per_count,
|
|
|
+ ROUND(if(SUM(attribution_game_pay7d_count) > 0, SUM(today_cost) / SUM(attribution_game_pay7d_count), 0), 2) as attribution_game_pay7d_cost,
|
|
|
+ SUM(day7_amount_count) as day7_amount_count,
|
|
|
+ ROUND(if(SUM(day7_amount_count) > 0, SUM(today_cost) / SUM(day7_amount_count), 0), 2) as day7_amount_per_cost,
|
|
|
+ ROUND(if(SUM(day7_amount_num) > 0, SUM(day7_amount_count) / SUM(day7_amount_num), 0), 2) as day7_amount_per_count,
|
|
|
+ ROUND(if(SUM(day7_amount_num) > 0, SUM(day7_amount) / SUM(day7_amount_num), 0), 2) as day7_arpu,
|
|
|
+ SUM(day7_amount) as day7_amount,
|
|
|
+ SUM(day7_amount_num) as day7_amount_num
|
|
|
FROM
|
|
|
game_ads.ads_promotion_day
|
|
|
""" + criA +
|
|
@@ -1294,7 +1324,16 @@ public class PromotionDayServiceImpl implements IAdsPromotionDayService {
|
|
|
(SUM(first_new_user_amount_count) - SUM(first_sub_amount_count)) as sub_order_num,
|
|
|
(SUM(first_new_user_amount) - SUM(first_sub_amount)) as sub_order_amount,
|
|
|
ROUND(IF(SUM(first_new_user_amount_count) > 0, SUM(today_cost) / SUM(first_new_user_amount_count), 0), 2) as first_new_user_amount_count_cost,
|
|
|
- ROUND(IF(SUM(new_user_total_amount_count) > 0, SUM(today_cost) / SUM(new_user_total_amount_count), 0), 2) as new_user_total_amount_count_cost
|
|
|
+ ROUND(IF(SUM(new_user_total_amount_count) > 0, SUM(today_cost) / SUM(new_user_total_amount_count), 0), 2) as new_user_total_amount_count_cost,
|
|
|
+ SUM(attribution_game_pay7d_count) as attribution_game_pay7d_count,
|
|
|
+ SUM(attribution_active_pay7d_per_count) as attribution_active_pay7d_per_count,
|
|
|
+ ROUND(if(SUM(attribution_game_pay7d_count) > 0, SUM(today_cost) / SUM(attribution_game_pay7d_count), 0), 2) as attribution_game_pay7d_cost,
|
|
|
+ SUM(day7_amount_count) as day7_amount_count,
|
|
|
+ ROUND(if(SUM(day7_amount_count) > 0, SUM(today_cost) / SUM(day7_amount_count), 0), 2) as day7_amount_per_cost,
|
|
|
+ ROUND(if(SUM(day7_amount_num) > 0, SUM(day7_amount_count) / SUM(day7_amount_num), 0), 2) as day7_amount_per_count,
|
|
|
+ ROUND(if(SUM(day7_amount_num) > 0, SUM(day7_amount) / SUM(day7_amount_num), 0), 2) as day7_arpu,
|
|
|
+ SUM(day7_amount) as day7_amount,
|
|
|
+ SUM(day7_amount_num) as day7_amount_num
|
|
|
FROM
|
|
|
game_ads.ads_promotion_day
|
|
|
""";
|