|
@@ -76,6 +76,11 @@ public class BytedanceAdvertiserHourlyReportServiceImpl extends ServiceImpl<Byte
|
|
|
|
|
|
//当前时间段数据
|
|
|
nowCostList = bytedanceAdvertiserHourlyReportMapper.getReportCostInfo(accountId,startTime,endTime);
|
|
|
+
|
|
|
+ //更新时间
|
|
|
+ List<ReportCostVo> updTimeList = nowCostList.stream().sorted(Comparator.comparing(ReportCostVo::getCreateTime)).collect(Collectors.toList());
|
|
|
+ resultMap.put("updTime",Check.isNull(updTimeList) ? new Date() : updTimeList.get(0).getCreateTime());
|
|
|
+
|
|
|
//当前阶段 总花费
|
|
|
double nowCost = nowCostList.stream().mapToDouble(ReportCostVo::getCost).sum();
|
|
|
resultMap.put("nowCost", String.format("%.2f", nowCost));
|
|
@@ -90,7 +95,8 @@ public class BytedanceAdvertiserHourlyReportServiceImpl extends ServiceImpl<Byte
|
|
|
|
|
|
//环比 =(当前花费 - 上阶段花费 )/ 上阶段花费
|
|
|
compare = (nowCost - lastCost) / lastCost;
|
|
|
- resultMap.put("compare", Double.isNaN(compare) ? "0" : df.format(compare));
|
|
|
+ //resultMap.put("compare", Double.isNaN(compare) ? "0" : df.format(compare));
|
|
|
+ resultMap.put("compare", Double.isNaN(compare) ? "0" : String.format("%.2f", compare*100));
|
|
|
|
|
|
//花费占比 = 花费 / 账户预算
|
|
|
//获取账户预算
|
|
@@ -126,6 +132,8 @@ public class BytedanceAdvertiserHourlyReportServiceImpl extends ServiceImpl<Byte
|
|
|
|
|
|
resultMap.put("nowMap", nowMap);
|
|
|
resultMap.put("lastMap", lastMap);
|
|
|
+
|
|
|
+
|
|
|
return Result.successMsg("成功。",resultMap);
|
|
|
}
|
|
|
|