讲师审批添加讲师工号

This commit is contained in:
zhaolongfei
2024-11-08 15:04:12 +08:00
parent ae75aedff9
commit a3aad61ac8
2 changed files with 42 additions and 3 deletions

View File

@@ -11,6 +11,7 @@ import com.xboe.core.orm.FieldFilters;
import com.xboe.module.course.dto.CourseQueryDto;
import com.xboe.module.course.dto.CourseTeacherDto;
import com.xboe.module.course.dto.RankingDto;
import com.xboe.module.course.dto.TeacherCourseDto;
import com.xboe.module.course.entity.*;
import com.xboe.module.course.service.ICourseContentService;
import com.xboe.module.course.service.ICourseSectionService;
@@ -28,6 +29,8 @@ import com.xboe.school.study.entity.StudyHomeWork;
import com.xboe.school.study.service.IStudyCourseService;
import com.xboe.school.study.service.IStudyHomeWorkService;
import com.xboe.school.study.service.IStudyService;
import com.xboe.system.user.entity.User;
import com.xboe.system.user.service.IUserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -60,7 +63,8 @@ public class CoursePortalApi extends ApiBaseController{
@Resource
private ICourseService courseService;
@Resource
private IUserService userService;
@Resource
private ITeacherService teacherService;
@@ -301,17 +305,30 @@ public class CoursePortalApi extends ApiBaseController{
List<CourseContent> cclist=contentService.getByCourseId(id);
List<CourseSection> sectionlist=sectionService.getByCourseId(id);
List<CourseTeacher> teachers=courseService.findTeachersByCourseId(id);
List<TeacherCourseDto> teacherCourseDtos = new ArrayList<>();
//获取教师的介绍信息,因为一门课程 的教师不会太多,所以这里简单直接遍历查询,后续再优化
for(CourseTeacher ct : teachers) {
TeacherCourseDto teacherCourseDto = new TeacherCourseDto();
Teacher t = teacherService.get(ct.getTeacherId());
User user = userService.get(ct.getTeacherId());
if(t!=null) {
ct.setRemark(t.getDescription());
if(redisTemplate.opsForValue().get(ct.getTeacherId())!=null){
if(Objects.equals(redisTemplate.opsForValue().get(ct.getTeacherId()), "1")){
ct.setTeacherName("BOE教师");
}
teacherCourseDto.setCourseId(ct.getCourseId());
teacherCourseDto.setTeacherName(ct.getTeacherName());
teacherCourseDto.setTeacherId(ct.getTeacherId());
teacherCourseDto.setCode(ct.getCode());
teacherCourseDto.setRemark(ct.getRemark());
teacherCourseDto.setSysCreateAid(ct.getSysCreateAid());
teacherCourseDto.setSysCreateBy(ct.getSysCreateBy());
teacherCourseDto.setSysCreateTime(ct.getSysCreateTime());
teacherCourseDto.setId(ct.getId());
teacherCourseDto.setUserNo(user.getUserNo());
teacherCourseDtos.add(teacherCourseDto);
}else if (redisTemplate.opsForValue().get(ct.getTeacherId())==null){
List<String> list=new ArrayList<>();
list.add(ct.getTeacherId());
@@ -319,6 +336,17 @@ public class CoursePortalApi extends ApiBaseController{
if(Objects.equals(redisTemplate.opsForValue().get(ct.getTeacherId()), "1")){
ct.setTeacherName("BOE教师");
}
teacherCourseDto.setCourseId(ct.getCourseId());
teacherCourseDto.setTeacherName(ct.getTeacherName());
teacherCourseDto.setTeacherId(ct.getTeacherId());
teacherCourseDto.setCode(ct.getCode());
teacherCourseDto.setRemark(ct.getRemark());
teacherCourseDto.setSysCreateAid(ct.getSysCreateAid());
teacherCourseDto.setSysCreateBy(ct.getSysCreateBy());
teacherCourseDto.setSysCreateTime(ct.getSysCreateTime());
teacherCourseDto.setId(ct.getId());
teacherCourseDto.setUserNo(user.getUserNo());
teacherCourseDtos.add(teacherCourseDto);
}
}
@@ -327,7 +355,7 @@ public class CoursePortalApi extends ApiBaseController{
rs.put("isCrowd",pass);
rs.put("contents", cclist);
rs.put("sections",sectionlist);
rs.put("teachers",teachers);
rs.put("teachers",teacherCourseDtos);
//查询课程
return success(rs);

View File

@@ -0,0 +1,11 @@
package com.xboe.module.course.dto;
import com.xboe.module.course.entity.CourseTeacher;
import lombok.Data;
import java.util.List;
@Data
public class TeacherCourseDto extends CourseTeacher {
private String userNo;
}