|
@@ -14,6 +14,7 @@ import org.jeecg.modules.adweb.common.util.DateUtil;
|
|
|
import org.jeecg.modules.adweb.dmp.entity.GADailyReport;
|
|
|
import org.jeecg.modules.adweb.dmp.mapper.GADailyReportMapper;
|
|
|
import org.jeecg.modules.adweb.dmp.service.IGADailyReportService;
|
|
|
+import org.jeecg.modules.adweb.dmp.vo.report.PeriodicStatsVO;
|
|
|
import org.jeecg.modules.adweb.enquiry.mapper.AdwebEnquiryMapper;
|
|
|
import org.jeecg.modules.adweb.site.service.IAdwebSiteService;
|
|
|
import org.jeecg.modules.redis.CacheConfig;
|
|
@@ -34,10 +35,12 @@ public class GADailyReportServiceImpl extends ServiceImpl<GADailyReportMapper, G
|
|
|
|
|
|
@Autowired private IAdwebSiteService adwebSiteService;
|
|
|
|
|
|
+ @Autowired private GADailyReportMapper gaDailyReportMapper;
|
|
|
+
|
|
|
@Autowired private AdwebEnquiryMapper adwebEnquiryMapper;
|
|
|
|
|
|
/**
|
|
|
- * 查询指定时间区间内的{@DailyStatsVO}
|
|
|
+ * 查询指定时间区间内的{@link DailyStatsVO}
|
|
|
*
|
|
|
* <p>如数据库中某天数据缺失,需填充空数据
|
|
|
*
|
|
@@ -50,7 +53,7 @@ public class GADailyReportServiceImpl extends ServiceImpl<GADailyReportMapper, G
|
|
|
"getDailyStatsWithinPeriod"
|
|
|
+ TTLCacheManager.TTL_SPLITTER
|
|
|
+ 60 * 30) // Redis TTL为半小时
|
|
|
- public List<DailyStatsVO> getDailyStatsWithinPeriod(String siteCode, Date start, Date end) {
|
|
|
+ public List<DailyStatsVO> getDailyStatsForDateRange(String siteCode, Date start, Date end) {
|
|
|
Map<String, DailyStatsVO> dailyStatsVOs = Maps.newHashMap();
|
|
|
|
|
|
// 0. 起止时间为空时,设置默认区间 - start = 网站发布日期 & end = 今天
|
|
@@ -114,4 +117,18 @@ public class GADailyReportServiceImpl extends ServiceImpl<GADailyReportMapper, G
|
|
|
.sorted(Comparator.comparing(DailyStatsVO::getDate)) // 排日期升序排序
|
|
|
.collect(Collectors.toList()); // 使用toList()方法返回UnmodifiableList,导致Redis类型解析异常
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询分时间段的{@link PeriodicStatsVO} - 今天,昨天,本周,上周,本月,上月,全部
|
|
|
+ *
|
|
|
+ * <p>填充各时间段询盘数据
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ @Cacheable(
|
|
|
+ cacheManager = CacheConfig.TTL_CACHE_MANAGER,
|
|
|
+ cacheNames =
|
|
|
+ "getPeriodicStats" + TTLCacheManager.TTL_SPLITTER + 60 * 30) // Redis TTL为半小时
|
|
|
+ public List<PeriodicStatsVO> getPeriodicStats(String siteCode) {
|
|
|
+ return gaDailyReportMapper.getPeriodicStats(siteCode);
|
|
|
+ }
|
|
|
}
|