|
@@ -54,7 +54,7 @@ public class OverallSummaryServiceImpl implements IOverallSummaryService {
|
|
|
IFNULL(SUM(x.today_amount),0) total_amount ,
|
|
|
IFNULL(SUM(x.today_agent_count),0) total_agent_count ,
|
|
|
IFNULL(SUM(x.today_game_count),0) total_game_count ,
|
|
|
- IFNULL(SUM(x.today_new_player_amount)/SUM(x.today_total_cost),0) total_roi
|
|
|
+ IFNULL(SUM(x.today_amount)/SUM(x.today_total_cost),0) total_roi
|
|
|
FROM ads_overall_summary x
|
|
|
""" + totalDataConString);
|
|
|
|
|
@@ -101,19 +101,23 @@ public class OverallSummaryServiceImpl implements IOverallSummaryService {
|
|
|
|
|
|
//7日和30日Roi数据需要手动计算
|
|
|
//7日内新用户累计充值
|
|
|
- BigDecimal d7NewPlayerAmount = (BigDecimal) dao.func2(AdsOverallSummary.class, "sum", "todayNewPlayerAmount", myCondition(dto, false, 7));
|
|
|
+ BigDecimal d7NewPlayerAmount = (BigDecimal) dao.func2(AdsOverallSummary.class, "sum", "todayAmount", myCondition(dto, false, 7));
|
|
|
//7日内总消耗
|
|
|
BigDecimal d7TotalCost = (BigDecimal) dao.func2(AdsOverallSummary.class, "sum", "todayTotalCost", myCondition(dto, false, 7));
|
|
|
//cost 查询出的结果为null或者为0.00 设置为默认值0
|
|
|
- overallSummaryVO.setD7TotalRoi((d7TotalCost == null || BigDecimal.ZERO.compareTo(d7TotalCost) == 0) ? BigDecimal.ZERO : d7NewPlayerAmount.divide(d7TotalCost, 4, RoundingMode.HALF_UP));
|
|
|
+ overallSummaryVO.setD7TotalRoi((d7TotalCost == null || BigDecimal.ZERO.compareTo(d7TotalCost) == 0) ? BigDecimal.ZERO : d7NewPlayerAmount.multiply(BigDecimal.valueOf(100)).divide(d7TotalCost, 4, RoundingMode.HALF_UP));
|
|
|
|
|
|
//30日内新用户累计充值
|
|
|
- BigDecimal d30NewPlayerAmount = (BigDecimal) dao.func2(AdsOverallSummary.class, "sum", "todayNewPlayerAmount", myCondition(dto, false, 30));
|
|
|
+ BigDecimal d30NewPlayerAmount = (BigDecimal) dao.func2(AdsOverallSummary.class, "sum", "todayAmount", myCondition(dto, false, 30));
|
|
|
//30日内总消耗
|
|
|
BigDecimal d30TotalCost = (BigDecimal) dao.func2(AdsOverallSummary.class, "sum", "todayTotalCost", myCondition(dto, false, 30));
|
|
|
//计算30日Roi
|
|
|
//cost 查询出的结果为null或者为0.00 设置为默认值0
|
|
|
- overallSummaryVO.setD30TotalRoi((d30TotalCost == null || BigDecimal.ZERO.compareTo(d30TotalCost) == 0) ? BigDecimal.ZERO : d30NewPlayerAmount.divide(d30TotalCost, 4, RoundingMode.HALF_UP));
|
|
|
+ overallSummaryVO.setD30TotalRoi((d30TotalCost == null || BigDecimal.ZERO.compareTo(d30TotalCost) == 0) ? BigDecimal.ZERO : d30NewPlayerAmount.multiply(BigDecimal.valueOf(100)).divide(d30TotalCost, 4, RoundingMode.HALF_UP));
|
|
|
+
|
|
|
+ //计算百分比
|
|
|
+ overallSummaryVO.setFirstRoi(overallSummaryVO.getFirstRoi().multiply(BigDecimal.valueOf(100)));
|
|
|
+ overallSummaryVO.setTotalRoi(overallSummaryVO.getTotalRoi().multiply(BigDecimal.valueOf(100)));
|
|
|
|
|
|
return overallSummaryVO;
|
|
|
}
|