|
@@ -1,10 +1,14 @@
|
|
|
package com.fs.statis.service.impl;
|
|
package com.fs.statis.service.impl;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
+import com.fs.common.constant.FsConstants;
|
|
|
import com.fs.common.core.domain.R;
|
|
import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.core.redis.RedisCache;
|
|
import com.fs.common.core.redis.RedisCache;
|
|
|
|
|
+import com.fs.common.utils.DateUtils;
|
|
|
import com.fs.common.utils.TimeUtils;
|
|
import com.fs.common.utils.TimeUtils;
|
|
|
|
|
+import com.fs.common.utils.model.DateTimeEntity;
|
|
|
import com.fs.company.cache.ICompanyCacheService;
|
|
import com.fs.company.cache.ICompanyCacheService;
|
|
|
|
|
+import com.fs.course.domain.FsCourseWatchLog;
|
|
|
import com.fs.course.dto.WatchLogDTO;
|
|
import com.fs.course.dto.WatchLogDTO;
|
|
|
import com.fs.course.mapper.FsCourseTrafficLogMapper;
|
|
import com.fs.course.mapper.FsCourseTrafficLogMapper;
|
|
|
import com.fs.course.mapper.FsCourseWatchLogMapper;
|
|
import com.fs.course.mapper.FsCourseWatchLogMapper;
|
|
@@ -24,6 +28,7 @@ import com.fs.statis.service.utils.TrendDataFiller;
|
|
|
import com.fs.store.service.cache.IFsUserCourseCacheService;
|
|
import com.fs.store.service.cache.IFsUserCourseCacheService;
|
|
|
import com.fs.system.domain.SysConfig;
|
|
import com.fs.system.domain.SysConfig;
|
|
|
import com.fs.system.service.ISysConfigService;
|
|
import com.fs.system.service.ISysConfigService;
|
|
|
|
|
+import com.hc.openapi.tool.fastjson.JSON;
|
|
|
import com.hc.openapi.tool.util.ObjectUtils;
|
|
import com.hc.openapi.tool.util.ObjectUtils;
|
|
|
import com.hc.openapi.tool.util.StringUtils;
|
|
import com.hc.openapi.tool.util.StringUtils;
|
|
|
import org.apache.http.util.Asserts;
|
|
import org.apache.http.util.Asserts;
|
|
@@ -38,7 +43,9 @@ import java.time.LocalTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.time.temporal.TemporalAdjusters;
|
|
import java.time.temporal.TemporalAdjusters;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
import com.fs.statistics.dto.WatchCourseStatisticsDTO;
|
|
import com.fs.statistics.dto.WatchCourseStatisticsDTO;
|
|
|
|
|
|
|
@@ -80,6 +87,8 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IQwIpadServerService qwIpadServerService;
|
|
private IQwIpadServerService qwIpadServerService;
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public void dataOverviewTask() {
|
|
public void dataOverviewTask() {
|
|
|
DealerAggregatedDTO dealerAggregatedDTO = this.dealerAggregated();
|
|
DealerAggregatedDTO dealerAggregatedDTO = this.dealerAggregated();
|
|
@@ -998,4 +1007,27 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
|
|
|
|
|
return watchCourseStatisticsDTO;
|
|
return watchCourseStatisticsDTO;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @Description: 统计按TimeType 0-今天,1-昨天,2-本周,3-本月,4-上月;各公司的观看人数和完播人数, 存到redis中,定时任务每 ? 分钟执行一次
|
|
|
|
|
+ * @Param:
|
|
|
|
|
+ * @Return:
|
|
|
|
|
+ * @Author xgb
|
|
|
|
|
+ * @Date 2025/10/27 13:09
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void watchCourseStatisticsGroupByCompany() {
|
|
|
|
|
+ for(int i = 0; i < 5; i++){
|
|
|
|
|
+ Map<String,Object> params=new HashMap<>();
|
|
|
|
|
+ DateTimeEntity timeEntity =DateUtils.getBetweenTime(i);
|
|
|
|
|
+ params.put("startTime",timeEntity.getStartTime());
|
|
|
|
|
+ params.put("endTime",timeEntity.getEndTime());
|
|
|
|
|
+
|
|
|
|
|
+ List<WatchCourseStatisticsResultDTO> watchCourseStatisticsDTOS=fsCourseWatchLogMapper.watchCourseStatisticsGroupByCompany(params);
|
|
|
|
|
+ // 存到redis中 按TimeType 0-今天,1-昨天,2-本周,3-本月,4-上月;
|
|
|
|
|
+ redisCache.setCacheObject(FsConstants.WATCH_COURSE_STATISTICS_GROUP_COMPANY+i, JSON.toJSONString(watchCourseStatisticsDTOS));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|