|
@@ -17,6 +17,7 @@ import com.ym.mec.util.collection.MapUtil;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.*;
|
|
@@ -31,6 +32,8 @@ public class StudentStatisticsServiceImpl extends BaseServiceImpl<Integer, Stude
|
|
|
private TeacherDao teacherDao;
|
|
|
@Autowired
|
|
|
private StudentBasicInfoDao studentBasicInfoDao;
|
|
|
+ @Autowired
|
|
|
+ private RedisTemplate<String,Integer> redisTemplate;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Integer, StudentStatistics> getDAO() {
|
|
@@ -39,24 +42,34 @@ public class StudentStatisticsServiceImpl extends BaseServiceImpl<Integer, Stude
|
|
|
|
|
|
@Override
|
|
|
public void updateStudentStatistics() {
|
|
|
- //更新声部班老师
|
|
|
- studentBasicInfoDao.updateSubjectTeacher();
|
|
|
- //更新乐团主管、指导老师
|
|
|
- studentStatisticsDao.updateTeacherAndEdu();
|
|
|
- //更新未排课总数
|
|
|
- studentStatisticsDao.updateNoCourseNum();
|
|
|
- //更新未开始价值总和
|
|
|
- studentStatisticsDao.updateNotStartCourseFee();
|
|
|
- //更新未排课价值
|
|
|
- studentStatisticsDao.updateNoCourseFee();
|
|
|
- //更新第一次课的时间\最近一次课时间
|
|
|
- studentStatisticsDao.updateFirstAndLastCourseTime();
|
|
|
- //更新进行中课程组数量
|
|
|
- studentStatisticsDao.updateNormalGroupNum();
|
|
|
- //更新总课时数、已完成、剩余课时数、最近30天课耗、最近1年课耗
|
|
|
- studentStatisticsDao.updateCourseNum();
|
|
|
- //更新第一次付费时间
|
|
|
- studentStatisticsDao.updateFirstOrderTime();
|
|
|
+ Integer num = redisTemplate.opsForValue().get("updateStudentStatisticsNum:");
|
|
|
+ if(num == null || num == 1){
|
|
|
+ if(num == null){
|
|
|
+ num = 1;
|
|
|
+ }
|
|
|
+ //更新未排课总数
|
|
|
+ studentStatisticsDao.updateNoCourseNum();
|
|
|
+ //更新未开始价值总和
|
|
|
+ studentStatisticsDao.updateNotStartCourseFee();
|
|
|
+ //更新未排课价值
|
|
|
+ studentStatisticsDao.updateNoCourseFee();
|
|
|
+ }else if (num == 2){
|
|
|
+ //更新第一次课的时间\最近一次课时间
|
|
|
+ studentStatisticsDao.updateFirstAndLastCourseTime();
|
|
|
+ //更新进行中课程组数量
|
|
|
+ studentStatisticsDao.updateNormalGroupNum();
|
|
|
+ //更新总课时数、已完成、剩余课时数、最近30天课耗、最近1年课耗
|
|
|
+ studentStatisticsDao.updateCourseNum();
|
|
|
+ } else if (num == 3) {
|
|
|
+ //更新声部班老师
|
|
|
+ studentBasicInfoDao.updateSubjectTeacher();
|
|
|
+ //更新乐团主管、指导老师
|
|
|
+ studentStatisticsDao.updateTeacherAndEdu();
|
|
|
+ //更新第一次付费时间
|
|
|
+ studentStatisticsDao.updateFirstOrderTime();
|
|
|
+ num = 0;
|
|
|
+ }
|
|
|
+ redisTemplate.opsForValue().set("updateStudentStatisticsNum:",num++);
|
|
|
}
|
|
|
|
|
|
@Override
|