|
@@ -5,7 +5,12 @@ import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.core.redis.RedisCache;
|
|
|
import com.fs.common.utils.TimeUtils;
|
|
|
import com.fs.company.cache.ICompanyCacheService;
|
|
|
+import com.fs.company.domain.Company;
|
|
|
+import com.fs.company.domain.CompanyUser;
|
|
|
+import com.fs.company.mapper.CompanyUserMapper;
|
|
|
import com.fs.company.service.ICompanyService;
|
|
|
+import com.fs.company.service.ICompanyUserService;
|
|
|
+import com.fs.company.service.impl.CompanyUserServiceImpl;
|
|
|
import com.fs.course.mapper.FsCourseTrafficLogMapper;
|
|
|
import com.fs.his.vo.OptionsVO;
|
|
|
import com.fs.statis.StatisticsRedisConstant;
|
|
@@ -75,6 +80,10 @@ public class StatisticsCompanyServiceImpl implements IStatisticsCompanyService {
|
|
|
|
|
|
@Autowired
|
|
|
private ICompanyService companyService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private CompanyUserMapper companyUserMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public void dataOverviewTask() {
|
|
|
List<OptionsVO> optionsVOS = companyService.selectAllCompanyList();
|
|
@@ -87,6 +96,14 @@ public class StatisticsCompanyServiceImpl implements IStatisticsCompanyService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void dataOverviewTaskCompanyUser() {
|
|
|
+ List<CompanyUser> companyUsers = companyUserMapper.selectAllCompanyUser();
|
|
|
+ for (CompanyUser companyUser : companyUsers) {
|
|
|
+ dataOverviewTaskCompany(companyUser.getCompanyId(),companyUser.getUserId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void dataOverviewTaskCompany(Long companyId){
|
|
|
DealerAggregatedDTO dealerAggregatedDTO = this.dealerAggregated(companyId);
|
|
|
ConsumptionBalanceDataDTO consumptionBalanceDataDTO = this.rechargeConsumption(companyId);
|
|
@@ -100,6 +117,21 @@ public class StatisticsCompanyServiceImpl implements IStatisticsCompanyService {
|
|
|
redisCache.setCacheObject(String.format(StatisticsRedisConstant.DATA_OVERVIEW_DEALER_SMS_BALANCE+":%d",companyId), smsBalance);
|
|
|
redisCache.setCacheObject(String.format(StatisticsRedisConstant.DATA_OVERVIEW_TRAFFIC_LOG+":%d",companyId),trafficLog);
|
|
|
}
|
|
|
+
|
|
|
+ private void dataOverviewTaskCompany(Long companyId,Long companyUserId){
|
|
|
+ DealerAggregatedDTO dealerAggregatedDTO = this.dealerAggregated(companyId,companyUserId);
|
|
|
+ ConsumptionBalanceDataDTO consumptionBalanceDataDTO = this.rechargeConsumption(companyId);
|
|
|
+ AuthorizationInfoDTO authorizationInfoDTO = authorizationInfo();
|
|
|
+ Long smsBalance = this.smsBalance(companyId);
|
|
|
+ TrafficLogDTO trafficLog = this.getTrafficLog(companyId,companyUserId);
|
|
|
+
|
|
|
+ redisCache.setCacheObject(String.format(StatisticsRedisConstant.DATA_OVERVIEW_DEALER_AGGREGATED+":%d:%d",companyId,companyUserId), dealerAggregatedDTO);
|
|
|
+ redisCache.setCacheObject(String.format(StatisticsRedisConstant.DATA_OVERVIEW_DEALER_BALANCE+":%d:%d",companyId,companyUserId), consumptionBalanceDataDTO);
|
|
|
+ redisCache.setCacheObject(String.format(StatisticsRedisConstant.DATA_OVERVIEW_DEALER_AUTHORIZATION_INFO+":%d:%d",companyId,companyUserId), authorizationInfoDTO);
|
|
|
+ redisCache.setCacheObject(String.format(StatisticsRedisConstant.DATA_OVERVIEW_DEALER_SMS_BALANCE+":%d:%d",companyId,companyUserId), smsBalance);
|
|
|
+ redisCache.setCacheObject(String.format(StatisticsRedisConstant.DATA_OVERVIEW_TRAFFIC_LOG+":%d:%d",companyId,companyUserId),trafficLog);
|
|
|
+ }
|
|
|
+
|
|
|
public void analysisPreviewTask0(){
|
|
|
List<OptionsVO> optionsVOS = companyService.selectAllCompanyList();
|
|
|
for (OptionsVO optionsVO : optionsVOS) {
|
|
@@ -134,6 +166,41 @@ public class StatisticsCompanyServiceImpl implements IStatisticsCompanyService {
|
|
|
analysisPreviewTask(4,2,companyId);
|
|
|
}
|
|
|
}
|
|
|
+ public void analysisPreviewTask0CompanyUser(){
|
|
|
+ List<CompanyUser> companyUsers = companyUserMapper.selectAllCompanyUser();
|
|
|
+ for (CompanyUser companyUser : companyUsers) {
|
|
|
+ Long companyId = companyUser.getCompanyId();
|
|
|
+ if (companyId == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ analysisPreviewTask(0,1,companyId,companyUser.getUserId());
|
|
|
+ analysisPreviewTask(0,2,companyId,companyUser.getUserId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void analysisPreviewTask1CompanyUser(){
|
|
|
+ List<CompanyUser> companyUsers = companyUserMapper.selectAllCompanyUser();
|
|
|
+ for (CompanyUser companyUser : companyUsers) {
|
|
|
+ Long companyId = companyUser.getCompanyId();
|
|
|
+ if (companyId == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ analysisPreviewTask(0,1,companyId,companyUser.getUserId());
|
|
|
+ analysisPreviewTask(1,1,companyId,companyUser.getUserId());
|
|
|
+ analysisPreviewTask(2,1,companyId,companyUser.getUserId());
|
|
|
+ analysisPreviewTask(3,1,companyId,companyUser.getUserId());
|
|
|
+ analysisPreviewTask(4,1,companyId,companyUser.getUserId());
|
|
|
+
|
|
|
+ analysisPreviewTask(0,2,companyId,companyUser.getUserId());
|
|
|
+ analysisPreviewTask(1,2,companyId,companyUser.getUserId());
|
|
|
+ analysisPreviewTask(2,2,companyId,companyUser.getUserId());
|
|
|
+ analysisPreviewTask(3,2,companyId,companyUser.getUserId());
|
|
|
+ analysisPreviewTask(4,2,companyId,companyUser.getUserId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public void analysisPreviewTask(Integer type, Integer userType,Long companyId) {
|
|
|
// 根据type计算出时间范围
|
|
@@ -192,6 +259,64 @@ public class StatisticsCompanyServiceImpl implements IStatisticsCompanyService {
|
|
|
redisCache.setCacheObject(String.format("%s:%d:%d:%d",DATA_OVERVIEW_DEALER_ANALYSISPREVIEW,type,userType,companyId), analysisPreviewDTO);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void analysisPreviewTask(Integer type, Integer userType, Long companyId, Long companyUserId) {
|
|
|
+ // 根据type计算出时间范围
|
|
|
+ String startDate = "";
|
|
|
+ String endDate = "";
|
|
|
+
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+
|
|
|
+ LocalTime startOfDayTime = LocalTime.MIN;
|
|
|
+ LocalTime endOfDayTime = LocalTime.of(23, 59, 59);
|
|
|
+
|
|
|
+ if(0 == type){
|
|
|
+ LocalDateTime startOfDay = now.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfDay = now.with(endOfDayTime);
|
|
|
+ startDate = startOfDay.format(formatter);
|
|
|
+ endDate = endOfDay.format(formatter);
|
|
|
+ } else if(1 == type){
|
|
|
+ LocalDateTime yesterday = now.minusDays(1);
|
|
|
+ LocalDateTime startOfYesterday = yesterday.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfYesterday = yesterday.with(endOfDayTime);
|
|
|
+ startDate = startOfYesterday.format(formatter);
|
|
|
+ endDate = endOfYesterday.format(formatter);
|
|
|
+ } else if(2 == type) {
|
|
|
+ LocalDateTime startOfWeek = now.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY));
|
|
|
+ LocalDateTime startOfStartOfWeek = startOfWeek.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfToday = now.with(endOfDayTime);
|
|
|
+ startDate = startOfStartOfWeek.format(formatter);
|
|
|
+ endDate = endOfToday.format(formatter);
|
|
|
+ } else if(3 == type) {
|
|
|
+ LocalDateTime startOfMonth = now.withDayOfMonth(1);
|
|
|
+ LocalDateTime startOfStartOfMonth = startOfMonth.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfToday = now.with(endOfDayTime);
|
|
|
+ startDate = startOfStartOfMonth.format(formatter);
|
|
|
+ endDate = endOfToday.format(formatter);
|
|
|
+ } else if(4 == type) {
|
|
|
+ LocalDateTime firstDayOfPreviousMonth = now.minusMonths(1).withDayOfMonth(1);
|
|
|
+ LocalDateTime lastDayOfPreviousMonth = now.withDayOfMonth(1).minusDays(1);
|
|
|
+
|
|
|
+ LocalDateTime startOfPrevMonthStart = firstDayOfPreviousMonth.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfPrevMonthEnd = lastDayOfPreviousMonth.with(endOfDayTime);
|
|
|
+
|
|
|
+ startDate = startOfPrevMonthStart.format(formatter);
|
|
|
+ endDate = endOfPrevMonthEnd.format(formatter);
|
|
|
+ }
|
|
|
+
|
|
|
+ AnalysisPreviewQueryDTO param = new AnalysisPreviewQueryDTO();
|
|
|
+ param.setStartTime(startDate);
|
|
|
+ param.setEndTime(endDate);
|
|
|
+ param.setType(type);
|
|
|
+ param.setUserType(userType);
|
|
|
+ param.setCompanyId(companyId);
|
|
|
+
|
|
|
+ AnalysisPreviewDTO analysisPreviewDTO = this.analysisPreview(param);
|
|
|
+
|
|
|
+ redisCache.setCacheObject(String.format("%s:%d:%d:%d:%d",DATA_OVERVIEW_DEALER_ANALYSISPREVIEW,type,userType,companyId,companyUserId), analysisPreviewDTO);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public void watchEndPlayTrendTask0(){
|
|
|
List<OptionsVO> optionsVOS = companyService.selectAllCompanyList();
|
|
@@ -204,6 +329,18 @@ public class StatisticsCompanyServiceImpl implements IStatisticsCompanyService {
|
|
|
this.watchEndPlayTrendTask(0,2,companyId);
|
|
|
}
|
|
|
|
|
|
+ }
|
|
|
+ public void watchEndPlayTrendTask0CompanyUser(){
|
|
|
+ List<CompanyUser> companyUsers = companyUserMapper.selectAllCompanyUser();
|
|
|
+ for (CompanyUser companyUser : companyUsers) {
|
|
|
+ Long companyId = companyUser.getCompanyId();
|
|
|
+ if(companyId == null){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ this.watchEndPlayTrendTask(0,1,companyId,companyUser.getUserId());
|
|
|
+ this.watchEndPlayTrendTask(0,2,companyId,companyUser.getUserId());
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public void watchEndPlayTrendTask1(){
|
|
@@ -224,6 +361,27 @@ public class StatisticsCompanyServiceImpl implements IStatisticsCompanyService {
|
|
|
this.watchEndPlayTrendTask(4,2,companyId);
|
|
|
}
|
|
|
|
|
|
+ }
|
|
|
+
|
|
|
+ public void watchEndPlayTrendTask1CompanyUser(){
|
|
|
+ List<CompanyUser> companyUsers = companyUserMapper.selectAllCompanyUser();
|
|
|
+
|
|
|
+ for (CompanyUser companyUser : companyUsers) {
|
|
|
+ Long companyId = companyUser.getCompanyId();
|
|
|
+ if(companyId == null){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ this.watchEndPlayTrendTask(1,1,companyId,companyUser.getUserId());
|
|
|
+ this.watchEndPlayTrendTask(2,1,companyId,companyUser.getUserId());
|
|
|
+ this.watchEndPlayTrendTask(3,1,companyId,companyUser.getUserId());
|
|
|
+ this.watchEndPlayTrendTask(4,1,companyId,companyUser.getUserId());
|
|
|
+
|
|
|
+ this.watchEndPlayTrendTask(1,2,companyId,companyUser.getUserId());
|
|
|
+ this.watchEndPlayTrendTask(2,2,companyId,companyUser.getUserId());
|
|
|
+ this.watchEndPlayTrendTask(3,2,companyId,companyUser.getUserId());
|
|
|
+ this.watchEndPlayTrendTask(4,2,companyId,companyUser.getUserId());
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
@Override
|
|
|
public void watchEndPlayTrendTask(Integer type, Integer userType,Long companyId) {
|
|
@@ -283,6 +441,65 @@ public class StatisticsCompanyServiceImpl implements IStatisticsCompanyService {
|
|
|
redisCache.setCacheObject(String.format("%s:%d:%d",DATA_OVERVIEW_DEALER_CHARTS,type,userType),watchEndPlayTrendDTOS);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void watchEndPlayTrendTask(Integer type, Integer userType, Long companyId, Long companyUserId) {
|
|
|
+ // 根据type计算出时间范围
|
|
|
+ String startDate = "";
|
|
|
+ String endDate = "";
|
|
|
+
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+
|
|
|
+ LocalTime startOfDayTime = LocalTime.MIN;
|
|
|
+ LocalTime endOfDayTime = LocalTime.of(23, 59, 59);
|
|
|
+
|
|
|
+ if(0 == type){
|
|
|
+ LocalDateTime startOfDay = now.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfDay = now.with(endOfDayTime);
|
|
|
+ startDate = startOfDay.format(formatter);
|
|
|
+ endDate = endOfDay.format(formatter);
|
|
|
+ } else if(1 == type){
|
|
|
+ LocalDateTime yesterday = now.minusDays(1);
|
|
|
+ LocalDateTime startOfYesterday = yesterday.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfYesterday = yesterday.with(endOfDayTime);
|
|
|
+ startDate = startOfYesterday.format(formatter);
|
|
|
+ endDate = endOfYesterday.format(formatter);
|
|
|
+ } else if(2 == type) {
|
|
|
+ LocalDateTime startOfWeek = now.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY));
|
|
|
+ LocalDateTime startOfStartOfWeek = startOfWeek.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfToday = now.with(endOfDayTime);
|
|
|
+ startDate = startOfStartOfWeek.format(formatter);
|
|
|
+ endDate = endOfToday.format(formatter);
|
|
|
+ } else if(3 == type) {
|
|
|
+ LocalDateTime startOfMonth = now.withDayOfMonth(1);
|
|
|
+ LocalDateTime startOfStartOfMonth = startOfMonth.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfToday = now.with(endOfDayTime);
|
|
|
+ startDate = startOfStartOfMonth.format(formatter);
|
|
|
+ endDate = endOfToday.format(formatter);
|
|
|
+ } else if(4 == type) {
|
|
|
+ LocalDateTime firstDayOfPreviousMonth = now.minusMonths(1).withDayOfMonth(1);
|
|
|
+ LocalDateTime lastDayOfPreviousMonth = now.withDayOfMonth(1).minusDays(1);
|
|
|
+
|
|
|
+ LocalDateTime startOfPrevMonthStart = firstDayOfPreviousMonth.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfPrevMonthEnd = lastDayOfPreviousMonth.with(endOfDayTime);
|
|
|
+
|
|
|
+ startDate = startOfPrevMonthStart.format(formatter);
|
|
|
+ endDate = endOfPrevMonthEnd.format(formatter);
|
|
|
+ }
|
|
|
+
|
|
|
+ AnalysisPreviewQueryDTO param = new AnalysisPreviewQueryDTO();
|
|
|
+ param.setStartTime(startDate);
|
|
|
+ param.setEndTime(endDate);
|
|
|
+ param.setType(type);
|
|
|
+ param.setCompanyId(companyId);
|
|
|
+
|
|
|
+ param.setUserType(userType);
|
|
|
+ param.setCompanyUserId(companyUserId);
|
|
|
+ List<WatchEndPlayTrendDTO> watchEndPlayTrendDTOS = this.watchEndPlayTrend(param);
|
|
|
+
|
|
|
+ redisCache.setCacheObject(String.format("%s:%d:%d:%d",DATA_OVERVIEW_DEALER_CHARTS,type,userType,companyUserId),watchEndPlayTrendDTOS);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void companyWatchCourseTopTenTask(Integer type, Integer statisticalType, Integer userType,Long companyId) {
|
|
|
|
|
@@ -342,6 +559,65 @@ public class StatisticsCompanyServiceImpl implements IStatisticsCompanyService {
|
|
|
redisCache.setCacheObject(String.format("%s:%d:%d:%d:%d", CHARTS_MEMBER_TOP_TEN_WATCH, type,statisticalType,userType,companyId), deaMemberTopTenDTOS);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void companyWatchCourseTopTenTask(Integer type, Integer statisticalType, Integer userType, Long companyId, Long companyUserId) {
|
|
|
+ AnalysisPreviewQueryDTO dto = new AnalysisPreviewQueryDTO();
|
|
|
+ dto.setType(type);
|
|
|
+ dto.setStatisticalType(statisticalType);
|
|
|
+
|
|
|
+ String startDate = "";
|
|
|
+ String endDate = "";
|
|
|
+
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+
|
|
|
+ LocalTime startOfDayTime = LocalTime.MIN;
|
|
|
+ LocalTime endOfDayTime = LocalTime.of(23, 59, 59);
|
|
|
+
|
|
|
+ if(0 == type){
|
|
|
+ LocalDateTime startOfDay = now.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfDay = now.with(endOfDayTime);
|
|
|
+ startDate = startOfDay.format(formatter);
|
|
|
+ endDate = endOfDay.format(formatter);
|
|
|
+ } else if(1 == type){
|
|
|
+ LocalDateTime yesterday = now.minusDays(1);
|
|
|
+ LocalDateTime startOfYesterday = yesterday.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfYesterday = yesterday.with(endOfDayTime);
|
|
|
+ startDate = startOfYesterday.format(formatter);
|
|
|
+ endDate = endOfYesterday.format(formatter);
|
|
|
+ } else if(2 == type) {
|
|
|
+ LocalDateTime startOfWeek = now.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY));
|
|
|
+ LocalDateTime startOfStartOfWeek = startOfWeek.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfToday = now.with(endOfDayTime);
|
|
|
+ startDate = startOfStartOfWeek.format(formatter);
|
|
|
+ endDate = endOfToday.format(formatter);
|
|
|
+ } else if(3 == type) {
|
|
|
+ LocalDateTime startOfMonth = now.withDayOfMonth(1);
|
|
|
+ LocalDateTime startOfStartOfMonth = startOfMonth.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfToday = now.with(endOfDayTime);
|
|
|
+ startDate = startOfStartOfMonth.format(formatter);
|
|
|
+ endDate = endOfToday.format(formatter);
|
|
|
+ } else if(4 == type) {
|
|
|
+ LocalDateTime firstDayOfPreviousMonth = now.minusMonths(1).withDayOfMonth(1);
|
|
|
+ LocalDateTime lastDayOfPreviousMonth = now.withDayOfMonth(1).minusDays(1);
|
|
|
+
|
|
|
+ LocalDateTime startOfPrevMonthStart = firstDayOfPreviousMonth.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfPrevMonthEnd = lastDayOfPreviousMonth.with(endOfDayTime);
|
|
|
+
|
|
|
+ startDate = startOfPrevMonthStart.format(formatter);
|
|
|
+ endDate = endOfPrevMonthEnd.format(formatter);
|
|
|
+ }
|
|
|
+
|
|
|
+ dto.setStartTime(startDate);
|
|
|
+ dto.setEndTime(endDate);
|
|
|
+ dto.setUserType(userType);
|
|
|
+ dto.setCompanyId(companyId);
|
|
|
+ dto.setCompanyUserId(companyUserId);
|
|
|
+
|
|
|
+ List<DeaMemberTopTenDTO> deaMemberTopTenDTOS = deaMemberTopTen(dto);
|
|
|
+ redisCache.setCacheObject(String.format("%s:%d:%d:%d:%d:%d", CHARTS_MEMBER_TOP_TEN_WATCH, type,statisticalType,userType,companyId,companyUserId), deaMemberTopTenDTOS);
|
|
|
+ }
|
|
|
+
|
|
|
public void companyWatchCourseTopTenTask0(){
|
|
|
List<OptionsVO> optionsVOS = companyService.selectAllCompanyList();
|
|
|
for (OptionsVO optionsVO : optionsVOS) {
|
|
@@ -387,6 +663,56 @@ public class StatisticsCompanyServiceImpl implements IStatisticsCompanyService {
|
|
|
|
|
|
|
|
|
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public void companyWatchCourseTopTenTask0CompanyUser(){
|
|
|
+ List<CompanyUser> companyUsers = companyUserMapper.selectAllCompanyUser();
|
|
|
+ for (CompanyUser companyUser : companyUsers) {
|
|
|
+ Long companyId = companyUser.getCompanyId();
|
|
|
+ if (companyId == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ companyWatchCourseTopTenTask(0,0,1,companyId,companyUser.getUserId());
|
|
|
+ companyWatchCourseTopTenTask(0,1,1,companyId,companyUser.getUserId());
|
|
|
+
|
|
|
+
|
|
|
+ companyWatchCourseTopTenTask(0,0,2,companyId,companyUser.getUserId());
|
|
|
+ companyWatchCourseTopTenTask(0,1,2,companyId,companyUser.getUserId());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ public void companyWatchCourseTopTenTask1CompanyUser(){
|
|
|
+ List<CompanyUser> companyUsers = companyUserMapper.selectAllCompanyUser();
|
|
|
+ for (CompanyUser companyUser : companyUsers) {
|
|
|
+ Long companyId = companyUser.getCompanyId();
|
|
|
+ if (companyId == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ companyWatchCourseTopTenTask(1,0,1,companyId,companyUser.getUserId());
|
|
|
+ companyWatchCourseTopTenTask(1,1,1,companyId,companyUser.getUserId());
|
|
|
+ companyWatchCourseTopTenTask(2,0,1,companyId,companyUser.getUserId());
|
|
|
+ companyWatchCourseTopTenTask(2,1,1,companyId,companyUser.getUserId());
|
|
|
+ companyWatchCourseTopTenTask(3,0,1,companyId,companyUser.getUserId());
|
|
|
+ companyWatchCourseTopTenTask(3,1,1,companyId,companyUser.getUserId());
|
|
|
+ companyWatchCourseTopTenTask(4,0,1,companyId,companyUser.getUserId());
|
|
|
+ companyWatchCourseTopTenTask(4,1,1,companyId,companyUser.getUserId());
|
|
|
+
|
|
|
+ companyWatchCourseTopTenTask(1,0,2,companyId,companyUser.getUserId());
|
|
|
+ companyWatchCourseTopTenTask(1,1,2,companyId,companyUser.getUserId());
|
|
|
+ companyWatchCourseTopTenTask(2,0,2,companyId,companyUser.getUserId());
|
|
|
+ companyWatchCourseTopTenTask(2,1,2,companyId,companyUser.getUserId());
|
|
|
+ companyWatchCourseTopTenTask(3,0,2,companyId,companyUser.getUserId());
|
|
|
+ companyWatchCourseTopTenTask(3,1,2,companyId,companyUser.getUserId());
|
|
|
+ companyWatchCourseTopTenTask(4,0,2,companyId,companyUser.getUserId());
|
|
|
+ companyWatchCourseTopTenTask(4,1,2,companyId,companyUser.getUserId());
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -448,6 +774,66 @@ public class StatisticsCompanyServiceImpl implements IStatisticsCompanyService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void watchCourseTopTenTask(Integer type, Integer statisticalType, Integer userType, String sort, Long companyId, Long companyUserId) {
|
|
|
+ AnalysisPreviewQueryDTO dto = new AnalysisPreviewQueryDTO();
|
|
|
+ dto.setType(type);
|
|
|
+ dto.setStatisticalType(statisticalType);
|
|
|
+ dto.setSort(sort);
|
|
|
+
|
|
|
+ String startDate = "";
|
|
|
+ String endDate = "";
|
|
|
+
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+
|
|
|
+ LocalTime startOfDayTime = LocalTime.MIN;
|
|
|
+ LocalTime endOfDayTime = LocalTime.of(23, 59, 59);
|
|
|
+
|
|
|
+ if(0 == type){
|
|
|
+ LocalDateTime startOfDay = now.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfDay = now.with(endOfDayTime);
|
|
|
+ startDate = startOfDay.format(formatter);
|
|
|
+ endDate = endOfDay.format(formatter);
|
|
|
+ } else if(1 == type){
|
|
|
+ LocalDateTime yesterday = now.minusDays(1);
|
|
|
+ LocalDateTime startOfYesterday = yesterday.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfYesterday = yesterday.with(endOfDayTime);
|
|
|
+ startDate = startOfYesterday.format(formatter);
|
|
|
+ endDate = endOfYesterday.format(formatter);
|
|
|
+ } else if(2 == type) {
|
|
|
+ LocalDateTime startOfWeek = now.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY));
|
|
|
+ LocalDateTime startOfStartOfWeek = startOfWeek.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfToday = now.with(endOfDayTime);
|
|
|
+ startDate = startOfStartOfWeek.format(formatter);
|
|
|
+ endDate = endOfToday.format(formatter);
|
|
|
+ } else if(3 == type) {
|
|
|
+ LocalDateTime startOfMonth = now.withDayOfMonth(1);
|
|
|
+ LocalDateTime startOfStartOfMonth = startOfMonth.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfToday = now.with(endOfDayTime);
|
|
|
+ startDate = startOfStartOfMonth.format(formatter);
|
|
|
+ endDate = endOfToday.format(formatter);
|
|
|
+ } else if(4 == type) {
|
|
|
+ LocalDateTime firstDayOfPreviousMonth = now.minusMonths(1).withDayOfMonth(1);
|
|
|
+ LocalDateTime lastDayOfPreviousMonth = now.withDayOfMonth(1).minusDays(1);
|
|
|
+
|
|
|
+ LocalDateTime startOfPrevMonthStart = firstDayOfPreviousMonth.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfPrevMonthEnd = lastDayOfPreviousMonth.with(endOfDayTime);
|
|
|
+
|
|
|
+ startDate = startOfPrevMonthStart.format(formatter);
|
|
|
+ endDate = endOfPrevMonthEnd.format(formatter);
|
|
|
+ }
|
|
|
+ dto.setStartTime(startDate);
|
|
|
+ dto.setEndTime(endDate);
|
|
|
+ dto.setUserType(userType);
|
|
|
+ dto.setCompanyId(companyId);
|
|
|
+ dto.setCompanyUserId(companyUserId);
|
|
|
+ List<CourseStatsDTO> courseStatsDTOS = watchCourseTopTen(dto);
|
|
|
+
|
|
|
+ redisCache.setCacheObject( String.format("%s:%d:%d:%d:%s:%d:%d", CHARTS_WATCH_TOP_TEN, type,statisticalType,userType,sort,companyId,companyUserId), courseStatsDTOS);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public void watchCourseTopTenTask0(){
|
|
|
List<OptionsVO> optionsVOS = companyService.selectAllCompanyList();
|
|
@@ -585,6 +971,117 @@ public class StatisticsCompanyServiceImpl implements IStatisticsCompanyService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public void watchCourseTopTenTask0CompanyUser(){
|
|
|
+ List<CompanyUser> companyUsers = companyUserMapper.selectAllCompanyUser();
|
|
|
+ for (CompanyUser companyUser : companyUsers) {
|
|
|
+ Long companyId = companyUser.getCompanyId();
|
|
|
+ Long userId = companyUser.getUserId();
|
|
|
+
|
|
|
+ if (companyId == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ watchCourseTopTenTask(0,0,1,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(0,0,1,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(0,1,1,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(0,1,1,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(0,2,1,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(0,2,1,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(0,3,1,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(0,3,1,"ASC",companyId,userId);
|
|
|
+
|
|
|
+ watchCourseTopTenTask(0,0,1,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(0,0,1,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(0,1,1,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(0,1,1,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(0,2,1,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(0,2,1,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(0,3,1,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(0,3,1,"ASC",companyId,userId);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ public void watchCourseTopTenTask1CompanyUser(){
|
|
|
+ List<CompanyUser> companyUsers = companyUserMapper.selectAllCompanyUser();
|
|
|
+
|
|
|
+ for (CompanyUser companyUser : companyUsers) {
|
|
|
+ Long companyId = companyUser.getCompanyId();
|
|
|
+ Long userId = companyUser.getUserId();
|
|
|
+ if (companyId == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ watchCourseTopTenTask(1,0,1,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(1,0,1,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(1,0,2,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(1,0,2,"ASC",companyId,userId);
|
|
|
+
|
|
|
+ watchCourseTopTenTask(1,1,1,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(1,1,1,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(1,1,2,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(1,1,2,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(1,2,1,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(1,2,1,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(1,2,2,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(1,2,2,"ASC",companyId,userId);
|
|
|
+
|
|
|
+ watchCourseTopTenTask(1,3,1,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(1,3,1,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(1,3,2,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(1,3,2,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(2,0,1,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(2,0,1,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(2,0,2,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(2,0,2,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(2,1,1,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(2,1,1,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(2,1,2,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(2,1,2,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(2,2,1,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(2,2,1,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(2,2,2,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(2,2,2,"ASC",companyId,userId);
|
|
|
+
|
|
|
+ watchCourseTopTenTask(2,3,1,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(2,3,1,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(2,3,2,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(2,3,2,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(3,0,1,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(3,0,1,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(3,0,2,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(3,0,2,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(3,1,1,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(3,1,1,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(3,1,2,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(3,1,2,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(3,2,1,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(3,2,1,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(3,2,2,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(3,2,2,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(3,3,1,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(3,3,1,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(3,3,2,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(3,3,2,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(4,0,1,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(4,0,1,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(4,0,2,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(4,0,2,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(4,1,1,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(4,1,1,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(4,2,1,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(4,2,1,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(4,3,1,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(4,3,1,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(4,1,2,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(4,1,2,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(4,2,2,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(4,2,2,"ASC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(4,3,2,"DESC",companyId,userId);
|
|
|
+ watchCourseTopTenTask(4,3,2,"ASC",companyId,userId);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public void rewardMoneyTopTenTask(Integer type, Integer dataType, Integer userType,Long companyId) {
|
|
@@ -646,6 +1143,66 @@ public class StatisticsCompanyServiceImpl implements IStatisticsCompanyService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void rewardMoneyTopTenTask(Integer type, Integer dataType, Integer userType, Long companyId, Long companyUserId) {
|
|
|
+ AnalysisPreviewQueryDTO dto = new AnalysisPreviewQueryDTO();
|
|
|
+ dto.setType(type);
|
|
|
+ dto.setDataType(dataType);
|
|
|
+
|
|
|
+ String startDate = "";
|
|
|
+ String endDate = "";
|
|
|
+
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+
|
|
|
+ LocalTime startOfDayTime = LocalTime.MIN;
|
|
|
+ LocalTime endOfDayTime = LocalTime.of(23, 59, 59);
|
|
|
+
|
|
|
+ if(0 == type){
|
|
|
+ LocalDateTime startOfDay = now.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfDay = now.with(endOfDayTime);
|
|
|
+ startDate = startOfDay.format(formatter);
|
|
|
+ endDate = endOfDay.format(formatter);
|
|
|
+ } else if(1 == type){
|
|
|
+ LocalDateTime yesterday = now.minusDays(1);
|
|
|
+ LocalDateTime startOfYesterday = yesterday.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfYesterday = yesterday.with(endOfDayTime);
|
|
|
+ startDate = startOfYesterday.format(formatter);
|
|
|
+ endDate = endOfYesterday.format(formatter);
|
|
|
+ } else if(2 == type) {
|
|
|
+ LocalDateTime startOfWeek = now.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY));
|
|
|
+ LocalDateTime startOfStartOfWeek = startOfWeek.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfToday = now.with(endOfDayTime);
|
|
|
+ startDate = startOfStartOfWeek.format(formatter);
|
|
|
+ endDate = endOfToday.format(formatter);
|
|
|
+ } else if(3 == type) {
|
|
|
+ LocalDateTime startOfMonth = now.withDayOfMonth(1);
|
|
|
+ LocalDateTime startOfStartOfMonth = startOfMonth.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfToday = now.with(endOfDayTime);
|
|
|
+ startDate = startOfStartOfMonth.format(formatter);
|
|
|
+ endDate = endOfToday.format(formatter);
|
|
|
+ } else if(4 == type) {
|
|
|
+ LocalDateTime firstDayOfPreviousMonth = now.minusMonths(1).withDayOfMonth(1);
|
|
|
+ LocalDateTime lastDayOfPreviousMonth = now.withDayOfMonth(1).minusDays(1);
|
|
|
+
|
|
|
+ LocalDateTime startOfPrevMonthStart = firstDayOfPreviousMonth.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfPrevMonthEnd = lastDayOfPreviousMonth.with(endOfDayTime);
|
|
|
+
|
|
|
+ startDate = startOfPrevMonthStart.format(formatter);
|
|
|
+ endDate = endOfPrevMonthEnd.format(formatter);
|
|
|
+ }
|
|
|
+
|
|
|
+ dto.setStartTime(startDate);
|
|
|
+ dto.setEndTime(endDate);
|
|
|
+ dto.setUserType(userType);
|
|
|
+ dto.setCompanyId(companyId);
|
|
|
+ dto.setCompanyUserId(companyUserId);
|
|
|
+ List<RewardMoneyTopTenDTO> rewardMoneyTopTenDTOS = rewardMoneyTopTen(dto);
|
|
|
+
|
|
|
+ redisCache.setCacheObject( String.format("%s:%d:%d:%d:%d:%d", CHARTS_REWARD_MONEY_TOP_TEN, type,dataType,userType,companyId,companyUserId), rewardMoneyTopTenDTOS);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void rewardMoneyTradeTask(Integer type, Integer userType,Long companyId) {
|
|
|
AnalysisPreviewQueryDTO dto = new AnalysisPreviewQueryDTO();
|
|
@@ -699,7 +1256,64 @@ public class StatisticsCompanyServiceImpl implements IStatisticsCompanyService {
|
|
|
dto.setUserType(userType);
|
|
|
dto.setCompanyId(companyId);
|
|
|
List<RewardMoneyTrendDTO> rewardMoneyTrendDTOS = rewardMoneyTrendDTO(dto);
|
|
|
- redisCache.setCacheObject( String.format("%s:%d:%d", CHARTS_REWARD_MONEY_TREND, type,userType), rewardMoneyTrendDTOS);
|
|
|
+ redisCache.setCacheObject( String.format("%s:%d:%d:%d", CHARTS_REWARD_MONEY_TREND, type,userType,companyId), rewardMoneyTrendDTOS);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void rewardMoneyTradeTask(Integer type, Integer userType, Long companyId, Long companyUserId) {
|
|
|
+ AnalysisPreviewQueryDTO dto = new AnalysisPreviewQueryDTO();
|
|
|
+ dto.setType(type);
|
|
|
+
|
|
|
+ String startDate = "";
|
|
|
+ String endDate = "";
|
|
|
+
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+
|
|
|
+ LocalTime startOfDayTime = LocalTime.MIN;
|
|
|
+ LocalTime endOfDayTime = LocalTime.of(23, 59, 59);
|
|
|
+
|
|
|
+ if(0 == type){
|
|
|
+ LocalDateTime startOfDay = now.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfDay = now.with(endOfDayTime);
|
|
|
+ startDate = startOfDay.format(formatter);
|
|
|
+ endDate = endOfDay.format(formatter);
|
|
|
+ } else if(1 == type){
|
|
|
+ LocalDateTime yesterday = now.minusDays(1);
|
|
|
+ LocalDateTime startOfYesterday = yesterday.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfYesterday = yesterday.with(endOfDayTime);
|
|
|
+ startDate = startOfYesterday.format(formatter);
|
|
|
+ endDate = endOfYesterday.format(formatter);
|
|
|
+ } else if(2 == type) {
|
|
|
+ LocalDateTime startOfWeek = now.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY));
|
|
|
+ LocalDateTime startOfStartOfWeek = startOfWeek.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfToday = now.with(endOfDayTime);
|
|
|
+ startDate = startOfStartOfWeek.format(formatter);
|
|
|
+ endDate = endOfToday.format(formatter);
|
|
|
+ } else if(3 == type) {
|
|
|
+ LocalDateTime startOfMonth = now.withDayOfMonth(1);
|
|
|
+ LocalDateTime startOfStartOfMonth = startOfMonth.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfToday = now.with(endOfDayTime);
|
|
|
+ startDate = startOfStartOfMonth.format(formatter);
|
|
|
+ endDate = endOfToday.format(formatter);
|
|
|
+ } else if(4 == type) {
|
|
|
+ LocalDateTime firstDayOfPreviousMonth = now.minusMonths(1).withDayOfMonth(1);
|
|
|
+ LocalDateTime lastDayOfPreviousMonth = now.withDayOfMonth(1).minusDays(1);
|
|
|
+
|
|
|
+ LocalDateTime startOfPrevMonthStart = firstDayOfPreviousMonth.with(startOfDayTime);
|
|
|
+ LocalDateTime endOfPrevMonthEnd = lastDayOfPreviousMonth.with(endOfDayTime);
|
|
|
+
|
|
|
+ startDate = startOfPrevMonthStart.format(formatter);
|
|
|
+ endDate = endOfPrevMonthEnd.format(formatter);
|
|
|
+ }
|
|
|
+
|
|
|
+ dto.setStartTime(startDate);
|
|
|
+ dto.setEndTime(endDate);
|
|
|
+ dto.setUserType(userType);
|
|
|
+ dto.setCompanyId(companyId);
|
|
|
+ List<RewardMoneyTrendDTO> rewardMoneyTrendDTOS = rewardMoneyTrendDTO(dto);
|
|
|
+ redisCache.setCacheObject( String.format("%s:%d:%d:%d", CHARTS_REWARD_MONEY_TREND, type,userType,companyId), rewardMoneyTrendDTOS);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -724,7 +1338,74 @@ public class StatisticsCompanyServiceImpl implements IStatisticsCompanyService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public void rewardMoneyTask15MinutesCompanyUser(){
|
|
|
+ List<CompanyUser> companyUsers = companyUserMapper.selectAllCompanyUser();
|
|
|
+ for (CompanyUser companyUser : companyUsers) {
|
|
|
+ Long companyId = companyUser.getCompanyId();
|
|
|
+ Long companyUserId = companyUser.getUserId();
|
|
|
+
|
|
|
+ if (companyId == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ rewardMoneyTopTenTask(0,0,1,companyId,companyUserId);
|
|
|
+ rewardMoneyTopTenTask(0,1,1,companyId,companyUserId);
|
|
|
+
|
|
|
+ rewardMoneyTradeTask(0,1,companyId,companyUserId);
|
|
|
+
|
|
|
+ rewardMoneyTopTenTask(0,0,2,companyId,companyUserId);
|
|
|
+ rewardMoneyTopTenTask(0,1,2,companyId,companyUserId);
|
|
|
+
|
|
|
+ rewardMoneyTradeTask(0,2,companyId,companyUserId);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ public void rewardMoneyTaskEverydayCompanyUser(){
|
|
|
+ List<CompanyUser> companyUsers = companyUserMapper.selectAllCompanyUser();
|
|
|
+
|
|
|
+ for (CompanyUser companyUser : companyUsers) {
|
|
|
+ Long companyId = companyUser.getCompanyId();
|
|
|
+ Long companyUserId = companyUser.getUserId();
|
|
|
+
|
|
|
+ if (companyId == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ rewardMoneyTopTenTask(1,0,1,companyId,companyUserId);
|
|
|
+ rewardMoneyTopTenTask(1,1,1,companyId,companyUserId);
|
|
|
+
|
|
|
+
|
|
|
+ rewardMoneyTopTenTask(2,0,1,companyId,companyUserId);
|
|
|
+ rewardMoneyTopTenTask(2,1,1,companyId,companyUserId);
|
|
|
+
|
|
|
+ rewardMoneyTopTenTask(3,0,1,companyId,companyUserId);
|
|
|
+ rewardMoneyTopTenTask(3,1,1,companyId,companyUserId);
|
|
|
|
|
|
+ rewardMoneyTopTenTask(4,0,1,companyId,companyUserId);
|
|
|
+ rewardMoneyTopTenTask(4,1,1,companyId,companyUserId);
|
|
|
+
|
|
|
+
|
|
|
+ rewardMoneyTradeTask(1,1,companyId,companyUserId);
|
|
|
+ rewardMoneyTradeTask(2,1,companyId,companyUserId);
|
|
|
+ rewardMoneyTradeTask(3,1,companyId,companyUserId);
|
|
|
+ rewardMoneyTradeTask(4,1,companyId,companyUserId);
|
|
|
+
|
|
|
+
|
|
|
+ rewardMoneyTopTenTask(1,0,2,companyId,companyUserId);
|
|
|
+ rewardMoneyTopTenTask(1,1,2,companyId,companyUserId);
|
|
|
+ rewardMoneyTopTenTask(2,0,2,companyId,companyUserId);
|
|
|
+ rewardMoneyTopTenTask(2,1,2,companyId,companyUserId);
|
|
|
+ rewardMoneyTopTenTask(3,0,2,companyId,companyUserId);
|
|
|
+ rewardMoneyTopTenTask(3,1,2,companyId,companyUserId);
|
|
|
+ rewardMoneyTopTenTask(4,0,2,companyId,companyUserId);
|
|
|
+ rewardMoneyTopTenTask(4,1,2,companyId,companyUserId);
|
|
|
+
|
|
|
+ rewardMoneyTradeTask(1,2,companyId,companyUserId);
|
|
|
+ rewardMoneyTradeTask(2,2,companyId,companyUserId);
|
|
|
+ rewardMoneyTradeTask(3,2,companyId,companyUserId);
|
|
|
+ rewardMoneyTradeTask(4,2,companyId,companyUserId);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
public void rewardMoneyTaskEveryday(){
|
|
|
List<OptionsVO> optionsVOS = companyService.selectAllCompanyList();
|
|
|
for (OptionsVO optionsVO : optionsVOS) {
|
|
@@ -772,14 +1453,34 @@ public class StatisticsCompanyServiceImpl implements IStatisticsCompanyService {
|
|
|
|
|
|
@Override
|
|
|
public DealerAggregatedDTO dealerAggregated(Long companyId) {
|
|
|
- Long dayUserCount=userService.selectFsUserCount(1,companyId);
|
|
|
- Long storeOrderCount=storeOrderService.selectFsStoreOrderTotalCount(0,companyId);
|
|
|
- Long dayStoreOrderCount=storeOrderService.selectFsStoreOrderTotalCount(1,companyId);
|
|
|
- Long paymentCount=paymentService.selectFsStorePaymentCount(0,companyId);
|
|
|
- Long dayPaymentCount=paymentService.selectFsStorePaymentCount(1,companyId);
|
|
|
+ Long dayUserCount=userService.selectFsUserCount(1,companyId,null);
|
|
|
+ Long storeOrderCount=storeOrderService.selectFsStoreOrderTotalCount(0,companyId,null);
|
|
|
+ Long dayStoreOrderCount=storeOrderService.selectFsStoreOrderTotalCount(1,companyId,null);
|
|
|
+ Long paymentCount=paymentService.selectFsStorePaymentCount(0,companyId,null);
|
|
|
+ Long dayPaymentCount=paymentService.selectFsStorePaymentCount(1,companyId,null);
|
|
|
Long productCount=productService.selectFsStoreProductCount(0,companyId);
|
|
|
Long dayProductCount=productService.selectFsStoreProductCount(1,companyId);
|
|
|
- DealerAggregatedDTO dealerAggregatedDTO = consumptionBalanceMapper.dealerAggregatedCompanyId(companyId);
|
|
|
+ DealerAggregatedDTO dealerAggregatedDTO = consumptionBalanceMapper.dealerAggregatedCompanyId(companyId,null);
|
|
|
+ dealerAggregatedDTO.setTodayIncreaseUserNum(dayUserCount);
|
|
|
+ dealerAggregatedDTO.setOrderTotalNum(storeOrderCount);
|
|
|
+ dealerAggregatedDTO.setTodayOrderNum(dayStoreOrderCount);
|
|
|
+ dealerAggregatedDTO.setRecvTodayNum(paymentCount);
|
|
|
+ dealerAggregatedDTO.setRecvTodayNum(dayPaymentCount);
|
|
|
+ dealerAggregatedDTO.setGoodsTotalNum(productCount);
|
|
|
+ dealerAggregatedDTO.setTodayGoodsNum(dayProductCount);
|
|
|
+ return dealerAggregatedDTO;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public DealerAggregatedDTO dealerAggregated(Long companyId, Long companyUserId) {
|
|
|
+ Long dayUserCount=userService.selectFsUserCount(1,companyId,companyUserId);
|
|
|
+ Long storeOrderCount=storeOrderService.selectFsStoreOrderTotalCount(0,companyId,companyUserId);
|
|
|
+ Long dayStoreOrderCount=storeOrderService.selectFsStoreOrderTotalCount(1,companyId,companyUserId);
|
|
|
+ Long paymentCount=paymentService.selectFsStorePaymentCount(0,companyId,companyUserId);
|
|
|
+ Long dayPaymentCount=paymentService.selectFsStorePaymentCount(1,companyId,companyUserId);
|
|
|
+ Long productCount=productService.selectFsStoreProductCount(0,companyId);
|
|
|
+ Long dayProductCount=productService.selectFsStoreProductCount(1,companyId);
|
|
|
+ DealerAggregatedDTO dealerAggregatedDTO = consumptionBalanceMapper.dealerAggregatedCompanyId(companyId,companyUserId);
|
|
|
dealerAggregatedDTO.setTodayIncreaseUserNum(dayUserCount);
|
|
|
dealerAggregatedDTO.setOrderTotalNum(storeOrderCount);
|
|
|
dealerAggregatedDTO.setTodayOrderNum(dayStoreOrderCount);
|
|
@@ -1017,9 +1718,21 @@ public class StatisticsCompanyServiceImpl implements IStatisticsCompanyService {
|
|
|
@Override
|
|
|
public TrafficLogDTO getTrafficLog(Long companyId) {
|
|
|
TrafficLogDTO trafficLogDTO = new TrafficLogDTO();
|
|
|
- Long todayTrafficLog = fsCourseTrafficLogMapper.getTodayTrafficLogCompanyId(companyId);
|
|
|
- Long yesterdayTrafficLog = fsCourseTrafficLogMapper.getYesterdayTrafficLogCompanyId(companyId);
|
|
|
- Long monthTrafficLog = fsCourseTrafficLogMapper.getMonthTrafficLogCompanyId(companyId);
|
|
|
+ Long todayTrafficLog = fsCourseTrafficLogMapper.getTodayTrafficLogCompanyId(companyId,null);
|
|
|
+ Long yesterdayTrafficLog = fsCourseTrafficLogMapper.getYesterdayTrafficLogCompanyId(companyId,null);
|
|
|
+ Long monthTrafficLog = fsCourseTrafficLogMapper.getMonthTrafficLogCompanyId(companyId,null);
|
|
|
+ trafficLogDTO.setToday(todayTrafficLog);
|
|
|
+ trafficLogDTO.setThisMonth(monthTrafficLog);
|
|
|
+ trafficLogDTO.setYesterday(yesterdayTrafficLog);
|
|
|
+ return trafficLogDTO;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public TrafficLogDTO getTrafficLog(Long companyId, Long companyUserId) {
|
|
|
+ TrafficLogDTO trafficLogDTO = new TrafficLogDTO();
|
|
|
+ Long todayTrafficLog = fsCourseTrafficLogMapper.getTodayTrafficLogCompanyId(companyId,companyUserId);
|
|
|
+ Long yesterdayTrafficLog = fsCourseTrafficLogMapper.getYesterdayTrafficLogCompanyId(companyId,companyUserId);
|
|
|
+ Long monthTrafficLog = fsCourseTrafficLogMapper.getMonthTrafficLogCompanyId(companyId,companyUserId);
|
|
|
trafficLogDTO.setToday(todayTrafficLog);
|
|
|
trafficLogDTO.setThisMonth(monthTrafficLog);
|
|
|
trafficLogDTO.setYesterday(yesterdayTrafficLog);
|