|
|
@@ -11,6 +11,7 @@ import com.fs.framework.service.TokenService;
|
|
|
import com.fs.statis.StatisticsRedisConstant;
|
|
|
import com.fs.statis.dto.*;
|
|
|
import com.fs.statis.service.IStatisticsService;
|
|
|
+import com.fs.statis.service.impl.StatisticsCompanyServiceImpl;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
@@ -42,6 +43,9 @@ public class IndexStatisticsController {
|
|
|
|
|
|
@Autowired
|
|
|
CloudHostProper cloudHostProper;
|
|
|
+ @Autowired
|
|
|
+ private StatisticsCompanyServiceImpl statisticsCompanyService;
|
|
|
+
|
|
|
/**
|
|
|
* 分析概览
|
|
|
*/
|
|
|
@@ -60,7 +64,11 @@ public class IndexStatisticsController {
|
|
|
}
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
- analysisPreviewDTO = redisCache.getCacheObject(String.format("%s:%d:%d:%d",DATA_OVERVIEW_DEALER_ANALYSISPREVIEW,type,userType,param.getCompanyId()));
|
|
|
+ if (param.getType().equals(5)){// 指定日期直接查,不走缓存
|
|
|
+ return R.ok().put("data",statisticsCompanyService.analysisPreview(param));
|
|
|
+ }else {
|
|
|
+ analysisPreviewDTO = redisCache.getCacheObject(String.format("%s:%d:%d:%d",DATA_OVERVIEW_DEALER_ANALYSISPREVIEW,type,userType,param.getCompanyId()));
|
|
|
+ }
|
|
|
|
|
|
return R.ok().put("data",analysisPreviewDTO);
|
|
|
}
|
|
|
@@ -179,7 +187,9 @@ public class IndexStatisticsController {
|
|
|
}else{
|
|
|
Long companyId = loginUser.getCompany().getCompanyId();
|
|
|
param.setCompanyId(companyId);
|
|
|
-
|
|
|
+ if (param.getType().equals(5)){
|
|
|
+ return R.ok().put("data", statisticsCompanyService.watchEndPlayTrend(param));
|
|
|
+ }
|
|
|
String key = String.format("%s:%d:%d:%d", DATA_OVERVIEW_DEALER_CHARTS, type,userType,param.getCompanyId());
|
|
|
List<DeaMemberTopTenDTO> deaMemberTopTenDTOS = redisCache.getCacheObject(key);
|
|
|
return R.ok().put("data", deaMemberTopTenDTOS);
|
|
|
@@ -204,7 +214,9 @@ public class IndexStatisticsController {
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
Long companyId = loginUser.getCompany().getCompanyId();
|
|
|
param.setCompanyId(companyId);
|
|
|
-
|
|
|
+ if (param.getType().equals(5)){
|
|
|
+ return R.ok().put("data", statisticsService.deaMemberTopTen(param));
|
|
|
+ }
|
|
|
List<DeaMemberTopTenDTO> deaMemberTopTenDTOS = redisCache.getCacheObject(String.format("%s:%d:%d:%d:%d", CHARTS_MEMBER_TOP_TEN_WATCH, type, statisticalType,userType,param.getCompanyId()));
|
|
|
if(deaMemberTopTenDTOS == null){
|
|
|
deaMemberTopTenDTOS = new ArrayList<>();
|
|
|
@@ -223,7 +235,9 @@ public class IndexStatisticsController {
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
Long companyId = loginUser.getCompany().getCompanyId();
|
|
|
param.setCompanyId(companyId);
|
|
|
-
|
|
|
+ if (param.getType().equals(5)){
|
|
|
+ R.ok().put("data", statisticsCompanyService.rewardMoneyTopTen(param));
|
|
|
+ }
|
|
|
List<RewardMoneyTopTenDTO> rewardMoneyTopTenDTOS = redisCache.getCacheObject( String.format("%s:%d:%d:%d:%d", CHARTS_REWARD_MONEY_TOP_TEN, type,dataType,userType,param.getCompanyId()));
|
|
|
return R.ok().put("data", rewardMoneyTopTenDTOS);
|
|
|
}
|
|
|
@@ -238,7 +252,9 @@ public class IndexStatisticsController {
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
Long companyId = loginUser.getCompany().getCompanyId();
|
|
|
param.setCompanyId(companyId);
|
|
|
-
|
|
|
+ if (param.getType().equals(5)){
|
|
|
+ return R.ok().put("data", statisticsCompanyService.rewardMoneyTrendDTO(param));
|
|
|
+ }
|
|
|
List<RewardMoneyTrendDTO> rewardMoneyTrendDTOS = redisCache.getCacheObject( String.format("%s:%d:%d:%d", CHARTS_REWARD_MONEY_TREND, type,userType,param.getCompanyId()));
|
|
|
return R.ok().put("data", rewardMoneyTrendDTOS);
|
|
|
}
|
|
|
@@ -256,6 +272,9 @@ public class IndexStatisticsController {
|
|
|
Long companyId = loginUser.getCompany().getCompanyId();
|
|
|
param.setCompanyId(companyId);
|
|
|
|
|
|
+ if (param.getType().equals(5)){
|
|
|
+ return R.ok().put("data",statisticsService.watchCourseTopTen(param));
|
|
|
+ }
|
|
|
List<CourseStatsDTO> courseStatsDTOS = redisCache.getCacheObject(String.format("%s:%d:%d:%d:%s:%d", CHARTS_WATCH_TOP_TEN, type,statisticalType,userType,sort,param.getCompanyId()));
|
|
|
return R.ok().put("data", courseStatsDTOS);
|
|
|
}
|