|
@@ -7,6 +7,7 @@ import com.fs.framework.security.LoginUser;
|
|
|
import com.fs.framework.service.TokenService;
|
|
import com.fs.framework.service.TokenService;
|
|
|
import com.fs.statis.StatisticsRedisConstant;
|
|
import com.fs.statis.StatisticsRedisConstant;
|
|
|
import com.fs.statis.dto.*;
|
|
import com.fs.statis.dto.*;
|
|
|
|
|
+import com.fs.statis.service.IStatisticsCompanyService;
|
|
|
import com.fs.statis.service.IStatisticsService;
|
|
import com.fs.statis.service.IStatisticsService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -31,6 +32,9 @@ public class IndexStatisticsController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IStatisticsService statisticsService;
|
|
private IStatisticsService statisticsService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IStatisticsCompanyService statisticsCompanyService;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 分析概览
|
|
* 分析概览
|
|
|
*/
|
|
*/
|
|
@@ -49,7 +53,11 @@ public class IndexStatisticsController {
|
|
|
}
|
|
}
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
- analysisPreviewDTO = redisCache.getCacheObject(String.format("%s:%d:%d:%d",DATA_OVERVIEW_DEALER_ANALYSISPREVIEW,type,userType,param.getCompanyId()));
|
|
|
|
|
|
|
+ if(type == 5) {
|
|
|
|
|
+ analysisPreviewDTO = 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);
|
|
return R.ok().put("data",analysisPreviewDTO);
|
|
|
}
|
|
}
|
|
@@ -96,9 +104,14 @@ public class IndexStatisticsController {
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
Long companyId = loginUser.getCompany().getCompanyId();
|
|
Long companyId = loginUser.getCompany().getCompanyId();
|
|
|
param.setCompanyId(companyId);
|
|
param.setCompanyId(companyId);
|
|
|
|
|
+ List<WatchEndPlayTrendDTO> deaMemberTopTenDTOS = new ArrayList<>();
|
|
|
|
|
+ if(type == 5) {
|
|
|
|
|
+ deaMemberTopTenDTOS = statisticsCompanyService.watchEndPlayTrend(param);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ String key = String.format("%s:%d:%d:%d", DATA_OVERVIEW_DEALER_CHARTS, type,userType,param.getCompanyId());
|
|
|
|
|
+ deaMemberTopTenDTOS = redisCache.getCacheObject(key);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- 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);
|
|
return R.ok().put("data", deaMemberTopTenDTOS);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -120,10 +133,11 @@ public class IndexStatisticsController {
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
Long companyId = loginUser.getCompany().getCompanyId();
|
|
Long companyId = loginUser.getCompany().getCompanyId();
|
|
|
param.setCompanyId(companyId);
|
|
param.setCompanyId(companyId);
|
|
|
-
|
|
|
|
|
- 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<>();
|
|
|
|
|
|
|
+ List<DeaMemberTopTenDTO> deaMemberTopTenDTOS = new ArrayList<>();
|
|
|
|
|
+ if(type == 5) {
|
|
|
|
|
+ deaMemberTopTenDTOS = statisticsCompanyService.deaMemberTopTen(param);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ deaMemberTopTenDTOS = redisCache.getCacheObject(String.format("%s:%d:%d:%d:%d", CHARTS_MEMBER_TOP_TEN_WATCH, type, statisticalType,userType,param.getCompanyId()));
|
|
|
}
|
|
}
|
|
|
return R.ok().put("data", deaMemberTopTenDTOS);
|
|
return R.ok().put("data", deaMemberTopTenDTOS);
|
|
|
}
|
|
}
|