|
@@ -7,6 +7,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
+import org.apache.commons.lang3.tuple.Pair;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.modules.adweb.common.util.DateUtil;
|
|
|
import org.jeecg.modules.adweb.dmp.service.IGACountryReportService;
|
|
@@ -18,7 +19,6 @@ import org.jeecg.modules.adweb.dmp.vo.report.PagePathStatsVO;
|
|
|
import org.jeecg.modules.adweb.dmp.vo.report.SiteOverviewStatsVO;
|
|
|
import org.jeecg.modules.adweb.dmp.vo.report.SourceMediumStatsVO;
|
|
|
import org.jeecg.modules.adweb.enquiry.service.IAdwebEnquiryService;
|
|
|
-import org.jeecg.modules.adweb.site.service.IAdwebSiteService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.format.annotation.DateTimeFormat;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -27,7 +27,6 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* 数据分析 - GA网站流量,询盘数据等
|
|
@@ -40,8 +39,6 @@ import java.util.Map;
|
|
|
@Slf4j
|
|
|
public class DMPDataController {
|
|
|
|
|
|
- @Autowired private IAdwebSiteService adwebSiteService;
|
|
|
-
|
|
|
@Autowired private IGADailyReportService gaDailyReportService;
|
|
|
@Autowired private IGASourceMediumReportService gaSourceMediumReportService;
|
|
|
@Autowired private IGACountryReportService gaCountryReportService;
|
|
@@ -49,7 +46,7 @@ public class DMPDataController {
|
|
|
|
|
|
@Autowired private IAdwebEnquiryService adwebEnquiryService;
|
|
|
|
|
|
- /** 网站流量分析统计 */
|
|
|
+ /** 网站流量整体分析统计 */
|
|
|
@GetMapping("/site-overview/stats")
|
|
|
public Result<SiteOverviewStatsVO> getSiteOverviewStats(
|
|
|
String siteCode,
|
|
@@ -58,9 +55,9 @@ public class DMPDataController {
|
|
|
@DateTimeFormat(pattern = "yyyy-MM-dd") Date end) {
|
|
|
// 1. 计算时间区间
|
|
|
if (StringUtils.isNotBlank(dateType)) {
|
|
|
- Map<String, Date> dateRange = DateUtil.getDateRangeByType(dateType);
|
|
|
- start = dateRange.get("start");
|
|
|
- end = dateRange.get("end");
|
|
|
+ Pair<Date, Date> dateRange = DateUtil.getDateRangeByType(dateType);
|
|
|
+ start = dateRange.getLeft();
|
|
|
+ end = dateRange.getRight();
|
|
|
}
|
|
|
|
|
|
// 2. 查询GA Daily Report和Enquiries
|
|
@@ -79,9 +76,9 @@ public class DMPDataController {
|
|
|
@DateTimeFormat(pattern = "yyyy-MM-dd") Date end) {
|
|
|
// 1. 计算时间区间
|
|
|
if (StringUtils.isNotBlank(dateType)) {
|
|
|
- Map<String, Date> dateRange = DateUtil.getDateRangeByType(dateType);
|
|
|
- start = dateRange.get("start");
|
|
|
- end = dateRange.get("end");
|
|
|
+ Pair<Date, Date> dateRange = DateUtil.getDateRangeByType(dateType);
|
|
|
+ start = dateRange.getLeft();
|
|
|
+ end = dateRange.getRight();
|
|
|
}
|
|
|
|
|
|
// 2. 查询并返回
|
|
@@ -96,9 +93,9 @@ public class DMPDataController {
|
|
|
@DateTimeFormat(pattern = "yyyy-MM-dd") Date end) {
|
|
|
// 1. 计算时间区间
|
|
|
if (StringUtils.isNotBlank(dateType)) {
|
|
|
- Map<String, Date> dateRange = DateUtil.getDateRangeByType(dateType);
|
|
|
- start = dateRange.get("start");
|
|
|
- end = dateRange.get("end");
|
|
|
+ Pair<Date, Date> dateRange = DateUtil.getDateRangeByType(dateType);
|
|
|
+ start = dateRange.getLeft();
|
|
|
+ end = dateRange.getRight();
|
|
|
}
|
|
|
|
|
|
// 2. 查询并返回
|
|
@@ -114,9 +111,9 @@ public class DMPDataController {
|
|
|
int limit) {
|
|
|
// 1. 计算时间区间
|
|
|
if (StringUtils.isNotBlank(dateType)) {
|
|
|
- Map<String, Date> dateRange = DateUtil.getDateRangeByType(dateType);
|
|
|
- start = dateRange.get("start");
|
|
|
- end = dateRange.get("end");
|
|
|
+ Pair<Date, Date> dateRange = DateUtil.getDateRangeByType(dateType);
|
|
|
+ start = dateRange.getLeft();
|
|
|
+ end = dateRange.getRight();
|
|
|
}
|
|
|
|
|
|
// 2. 查询并返回
|