|
@@ -10,12 +10,8 @@ import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.lang3.tuple.Pair;
|
|
import org.apache.commons.lang3.tuple.Pair;
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.modules.adweb.common.util.DateUtil;
|
|
import org.jeecg.modules.adweb.common.util.DateUtil;
|
|
-import org.jeecg.modules.adweb.dmp.service.IGACountryReportService;
|
|
|
|
-import org.jeecg.modules.adweb.dmp.service.IGADailyReportService;
|
|
|
|
-import org.jeecg.modules.adweb.dmp.service.IGAPagePathReportService;
|
|
|
|
-import org.jeecg.modules.adweb.dmp.service.IGASourceMediumReportService;
|
|
|
|
|
|
+import org.jeecg.modules.adweb.dmp.service.*;
|
|
import org.jeecg.modules.adweb.dmp.vo.report.*;
|
|
import org.jeecg.modules.adweb.dmp.vo.report.*;
|
|
-import org.jeecg.modules.adweb.enquiry.service.IAdwebEnquiryService;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.format.annotation.DateTimeFormat;
|
|
import org.springframework.format.annotation.DateTimeFormat;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -43,8 +39,7 @@ public class DMPDataController {
|
|
@Autowired private IGASourceMediumReportService gaSourceMediumReportService;
|
|
@Autowired private IGASourceMediumReportService gaSourceMediumReportService;
|
|
@Autowired private IGACountryReportService gaCountryReportService;
|
|
@Autowired private IGACountryReportService gaCountryReportService;
|
|
@Autowired private IGAPagePathReportService gaPagePathReportService;
|
|
@Autowired private IGAPagePathReportService gaPagePathReportService;
|
|
-
|
|
|
|
- @Autowired private IAdwebEnquiryService adwebEnquiryService;
|
|
|
|
|
|
+ @Autowired private IEnquiryReportService enquiryReportService;
|
|
|
|
|
|
/** 首页:网站流量按时间段分析统计 - 今天,昨天,本周,上周等 */
|
|
/** 首页:网站流量按时间段分析统计 - 今天,昨天,本周,上周等 */
|
|
@GetMapping("/site-periodic/stats")
|
|
@GetMapping("/site-periodic/stats")
|
|
@@ -134,4 +129,21 @@ public class DMPDataController {
|
|
gaPagePathReportService.getPagePathStats(
|
|
gaPagePathReportService.getPagePathStats(
|
|
siteCode, start, end, limit >= 0 ? limit : 10));
|
|
siteCode, start, end, limit >= 0 ? limit : 10));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @GetMapping("/enquiry-country/stats")
|
|
|
|
+ public Result<List<EnquiryCountryStatsVO>> getEnquiryCountryStats(
|
|
|
|
+ String siteCode,
|
|
|
|
+ String dateType,
|
|
|
|
+ @DateTimeFormat(pattern = "yyyy-MM-dd") Date start,
|
|
|
|
+ @DateTimeFormat(pattern = "yyyy-MM-dd") Date end) {
|
|
|
|
+ // 1. 计算时间区间
|
|
|
|
+ if (StringUtils.isNotBlank(dateType)) {
|
|
|
|
+ Pair<Date, Date> dateRange = DateUtil.getDateRangeByType(dateType);
|
|
|
|
+ start = dateRange.getLeft();
|
|
|
|
+ end = dateRange.getRight();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 2. 查询并返回
|
|
|
|
+ return Result.ok(enquiryReportService.getEnquiryCountryStats(siteCode, start, end));
|
|
|
|
+ }
|
|
}
|
|
}
|