|
@@ -8,6 +8,7 @@ import com.yonge.cooleshow.biz.dal.dao.CourseScheduleDao;
|
|
|
import com.yonge.cooleshow.biz.dal.dao.StudentStarDao;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.search.StudentSearch;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.StudentTotal;
|
|
|
+import com.yonge.cooleshow.biz.dal.entity.Subject;
|
|
|
import com.yonge.cooleshow.biz.dal.enums.CacheNameEnum;
|
|
|
import com.yonge.cooleshow.biz.dal.service.SysConfigService;
|
|
|
import com.yonge.cooleshow.biz.dal.vo.*;
|
|
@@ -24,6 +25,7 @@ import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.lang.reflect.InvocationTargetException;
|
|
|
import java.util.*;
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
@@ -76,4 +78,16 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, Student> impleme
|
|
|
public Integer setSubject(Long id, String subjectIds) {
|
|
|
return baseMapper.setSubject(id, subjectIds);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<Subject> querySubjectItem(Long id) {
|
|
|
+ List<Subject> subjectList = (List<Subject>) redissonClient.getBucket(CacheNameEnum.STUDENT_SUBJECT_ITEM.getRedisKey(id)).get();
|
|
|
+ if (null == subjectList) {
|
|
|
+ subjectList = baseMapper.querySubjectItem(id);
|
|
|
+ redissonClient.getBucket(CacheNameEnum.STUDENT_SUBJECT_ITEM.getRedisKey(id))
|
|
|
+ .set(subjectList, CacheNameEnum.STUDENT_SUBJECT_ITEM.getDuration().toHours(),
|
|
|
+ TimeUnit.HOURS);
|
|
|
+ }
|
|
|
+ return subjectList;
|
|
|
+ }
|
|
|
}
|