|
@@ -6,12 +6,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.qmth.boot.core.collection.PageResult;
|
|
import com.qmth.boot.core.collection.PageResult;
|
|
import com.qmth.boot.core.exception.StatusException;
|
|
import com.qmth.boot.core.exception.StatusException;
|
|
import com.qmth.exam.reserve.bean.applytask.CurrentApplyTaskVO;
|
|
import com.qmth.exam.reserve.bean.applytask.CurrentApplyTaskVO;
|
|
|
|
+import com.qmth.exam.reserve.bean.category.CategoryCacheBean;
|
|
import com.qmth.exam.reserve.bean.category.CategoryInfo;
|
|
import com.qmth.exam.reserve.bean.category.CategoryInfo;
|
|
import com.qmth.exam.reserve.bean.login.LoginUser;
|
|
import com.qmth.exam.reserve.bean.login.LoginUser;
|
|
import com.qmth.exam.reserve.bean.stdapply.CategoryVO;
|
|
import com.qmth.exam.reserve.bean.stdapply.CategoryVO;
|
|
import com.qmth.exam.reserve.bean.teaching.TeachingReq;
|
|
import com.qmth.exam.reserve.bean.teaching.TeachingReq;
|
|
import com.qmth.exam.reserve.bean.teaching.TeachingVO;
|
|
import com.qmth.exam.reserve.bean.teaching.TeachingVO;
|
|
import com.qmth.exam.reserve.cache.impl.ApplyTaskCacheService;
|
|
import com.qmth.exam.reserve.cache.impl.ApplyTaskCacheService;
|
|
|
|
+import com.qmth.exam.reserve.cache.impl.CategoryCacheService;
|
|
import com.qmth.exam.reserve.dao.CategoryDao;
|
|
import com.qmth.exam.reserve.dao.CategoryDao;
|
|
import com.qmth.exam.reserve.entity.CategoryEntity;
|
|
import com.qmth.exam.reserve.entity.CategoryEntity;
|
|
import com.qmth.exam.reserve.enums.CategoryLevel;
|
|
import com.qmth.exam.reserve.enums.CategoryLevel;
|
|
@@ -31,6 +33,9 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryDao, CategoryEntity
|
|
@Autowired
|
|
@Autowired
|
|
private ApplyTaskCacheService applyTaskCacheService;
|
|
private ApplyTaskCacheService applyTaskCacheService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private CategoryCacheService categoryCacheService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public List<CategoryVO> listTeaching(LoginUser user) {
|
|
public List<CategoryVO> listTeaching(LoginUser user) {
|
|
QueryWrapper<CategoryEntity> wrapper = new QueryWrapper<>();
|
|
QueryWrapper<CategoryEntity> wrapper = new QueryWrapper<>();
|
|
@@ -78,16 +83,16 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryDao, CategoryEntity
|
|
if (curApplyTask.getSelfApplyEndTime() > System.currentTimeMillis()) {
|
|
if (curApplyTask.getSelfApplyEndTime() > System.currentTimeMillis()) {
|
|
// 自主预约截止时间 之前,只能预约本教学点下的考点
|
|
// 自主预约截止时间 之前,只能预约本教学点下的考点
|
|
|
|
|
|
- CategoryEntity curEntity = this.getById(student.getCategoryId());
|
|
|
|
- if (curEntity == null) {
|
|
|
|
|
|
+ CategoryCacheBean curCategory = categoryCacheService.getCategoryById(student.getCategoryId());
|
|
|
|
+ if (curCategory == null) {
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
|
|
|
|
CategoryInfo curInfo = new CategoryInfo();
|
|
CategoryInfo curInfo = new CategoryInfo();
|
|
- curInfo.setId(curEntity.getId());
|
|
|
|
- curInfo.setName(curEntity.getName());
|
|
|
|
- curInfo.setLevel(curEntity.getLevel());
|
|
|
|
- curInfo.setParentId(curEntity.getParentId());
|
|
|
|
|
|
+ curInfo.setId(curCategory.getId());
|
|
|
|
+ curInfo.setName(curCategory.getName());
|
|
|
|
+ curInfo.setLevel(curCategory.getLevel());
|
|
|
|
+ curInfo.setParentId(curCategory.getParentId());
|
|
curInfo.setSubNodes(new ArrayList<>());
|
|
curInfo.setSubNodes(new ArrayList<>());
|
|
|
|
|
|
// 根节点
|
|
// 根节点
|
|
@@ -154,7 +159,7 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryDao, CategoryEntity
|
|
return cur;
|
|
return cur;
|
|
}
|
|
}
|
|
|
|
|
|
- CategoryEntity parent = this.getById(cur.getParentId());
|
|
|
|
|
|
+ CategoryCacheBean parent = categoryCacheService.getCategoryById(cur.getParentId());
|
|
if (parent == null) {
|
|
if (parent == null) {
|
|
return cur;
|
|
return cur;
|
|
}
|
|
}
|