Quellcode durchsuchen

Merge branch 'sitemap' of wangfan/adweb3-server into master

wangfan vor 5 Monaten
Ursprung
Commit
cf3d129ab5

+ 1 - 6
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/dmp/service/impl/GADailyReportServiceImpl.java

@@ -76,12 +76,7 @@ public class GADailyReportServiceImpl extends ServiceImpl<GADailyReportMapper, G
         absentDays.forEach(
                 date -> {
                     DailyStatsVO dailyStatsVO = new DailyStatsVO();
-                    dailyStatsVO.setDate(date);
-                    // 全部设置为默认值
-                    dailyStatsVO.setTotalUsers(0);
-                    dailyStatsVO.setPageViews(0);
-                    dailyStatsVO.setEnquires(0);
-
+                    dailyStatsVO.setDate(date); // 其它数值字段设置为默认值
                     dailyStatsVOs.add(dailyStatsVO);
                 });
 

+ 7 - 6
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/dmp/vo/report/SiteOverviewStatsVO.java

@@ -81,11 +81,11 @@ public class SiteOverviewStatsVO {
 
         // 2.1 日均访问量
         siteOverviewStatsVO.setDailyTotalUsers(
-                NumberUtil.formatDecimal(totalUsers / numDays, 2).doubleValue());
+                NumberUtil.formatDecimal((double) totalUsers / numDays, 2).doubleValue());
 
         // 2.2 平均访问时长
         // -- SUM (avgSessionDuration * sessions)
-        double durationSum =
+        double sessionDurationSum =
                 dailyStatsVOs.stream()
                         .mapToDouble(
                                 dailyStatsVO ->
@@ -93,23 +93,24 @@ public class SiteOverviewStatsVO {
                                                 * dailyStatsVO.getSessions())
                         .sum();
         siteOverviewStatsVO.setAvgTimeOnPage(
-                NumberUtil.formatDecimal(sessions == 0 ? 0 : durationSum / sessions, 2)
+                NumberUtil.formatDecimal(sessions == 0 ? 0 : sessionDurationSum / sessions, 2)
                         .doubleValue());
 
         // 2.3 平均访问页面数
         siteOverviewStatsVO.setPageViewsPerSession(
-                NumberUtil.formatDecimal(sessions == 0 ? 0 : pageViews / sessions, 2)
+                NumberUtil.formatDecimal(sessions == 0 ? 0 : (double) pageViews / sessions, 2)
                         .doubleValue());
 
         // 2.4 跳出率
-        // -- SUM (avgSessionDuration * sessions)
+        // -- SUM (bounceRate)
         double bounceRateSum =
                 dailyStatsVOs.stream().mapToDouble(DailyStatsVO::getBounceRate).sum();
         siteOverviewStatsVO.setBounceRate(NumberUtil.formatPercentage(bounceRateSum / numDays, 2));
 
         // 2.5 UV到询盘转化率
         siteOverviewStatsVO.setEnquiryConversionRate(
-                NumberUtil.formatPercentage(totalUsers == 0 ? 0 : enquires / totalUsers, 2));
+                NumberUtil.formatPercentage(
+                        totalUsers == 0 ? 0 : (double) enquires / totalUsers, 2));
 
         siteOverviewStatsVO.setDailyStats(dailyStatsVOs);