肖海南查老师所教的学生方法修改

master
总裁 4 months ago
parent 3070602cb1
commit dd6e7d9dc2
  1. 3
      src/main/java/com/teaching/backend/mapper/umsAdmin/UmsUserMapper.java
  2. 5
      src/main/java/com/teaching/backend/service/impl/courses/CoursesServiceImpl.java
  3. 5
      src/main/java/com/teaching/backend/service/impl/favour/SeCourseFavourServiceImpl.java
  4. 4
      src/main/java/com/teaching/backend/service/impl/records/CourseLearningRecordServiceImpl.java
  5. 8
      src/main/java/com/teaching/backend/service/impl/records/KnowledgeLearningRecordServiceImpl.java
  6. 2
      src/main/resources/mapper/UmsUserMapper.xml

@ -1,7 +1,6 @@
package com.teaching.backend.mapper.umsAdmin;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.teaching.backend.model.entity.courses.StudentCourses;
import com.teaching.backend.model.entity.umsAdmin.UmsRole;
import com.teaching.backend.model.entity.umsAdmin.UmsTeacher;
import com.teaching.backend.model.entity.umsAdmin.UmsUser;
@ -19,5 +18,5 @@ public interface UmsUserMapper extends BaseMapper<UmsUser> {
UmsStudentVO getByIdStudent(String id);
String getbyIdRoleId(String userId);
String getByIdRoleId(String userId);
}

@ -361,6 +361,7 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl
@Override
public List<PersonalCenterStudentListVO> queryStudentList(String userId) {
LinkedHashSet<UmsStudentManage> umsStudentManageList = queryTeacherByStudentList(userId);
System.out.println("1111111"+umsStudentManageList);
List<PersonalCenterStudentListVO> personalCenterStudentListVOList = new ArrayList<>();
PersonalCenterStudentListVO personalCenterStudentListVO = null;
for (UmsStudentManage umsStudentManage : umsStudentManageList) {
@ -375,7 +376,7 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl
@Override
public LinkedHashSet<UmsStudentManage> queryTeacherByStudentList(String userId) {
String roleId = umsUserMapper.getbyIdRoleId(userId);
String roleId = umsUserMapper.getByIdRoleId(userId);
CourseQuery courseQuery = new CourseQuery();
courseQuery.setUserId(userId);
LinkedHashSet<UmsStudentManage> umsStudentManageList = new LinkedHashSet<>();
@ -388,8 +389,10 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl
List<CourseLearningRecord> courseLearningRecordList = new ArrayList<>();
for (StudentCourses studentUsername : studentUsernames) {
CourseLearningRecord courseLearningRecord = courseLearningRecordMapper.selectNewRecord(String.valueOf(studentUsername.getStudent()));
if (courseLearningRecord != null){
courseLearningRecordList.add(courseLearningRecord);
}
}
courseLearningRecordList = courseLearningRecordList.stream().sorted(Comparator.comparing(CourseLearningRecord::getTimes).reversed()).collect(Collectors.toList());
for (CourseLearningRecord courseLearningRecord : courseLearningRecordList) {
UmsStudentManage umsStudentManage = umsStudentManageMapper.queryStudent(courseLearningRecord.getUserId());

@ -16,9 +16,6 @@ import com.teaching.backend.mapper.favour.SeCourseFavourMapper;
import com.teaching.backend.mapper.umsAdmin.UmsUserMapper;
import com.teaching.backend.model.entity.courses.Courses;
import com.teaching.backend.model.entity.favour.SeCourseFavour;
import com.teaching.backend.model.entity.favour.SeKnowFavour;
import com.teaching.backend.model.entity.favour.SeResourceFavour;
import com.teaching.backend.model.entity.umsAdmin.UmsUser;
import com.teaching.backend.model.vo.courses.CoursesVO;
import com.teaching.backend.model.vo.favour.CourseFavourDetailVO;
import com.teaching.backend.service.courses.ICoursesService;
@ -157,7 +154,7 @@ public class SeCourseFavourServiceImpl extends ServiceImpl<SeCourseFavourMapper,
@Override
public List<CoursesVO> queryNewCollect(String userId) {
String roleId = umsUserMapper.getbyIdRoleId(userId);
String roleId = umsUserMapper.getByIdRoleId(userId);
List<Courses> coursesList = new ArrayList<>();
if (roleId.equals("1")){
//老师

@ -123,7 +123,7 @@ public class CourseLearningRecordServiceImpl extends ServiceImpl<CourseLearningR
@Override
public List<CoursesVO> queryCourseList(String userId) {
String roleId = umsUserMapper.getbyIdRoleId(userId);
String roleId = umsUserMapper.getByIdRoleId(userId);
List<Courses> coursesList = new ArrayList<>();
if (roleId.equals("1")){
List<String> courseIds = courseLearningRecordMapper.selectMaxNumber();
@ -148,7 +148,7 @@ public class CourseLearningRecordServiceImpl extends ServiceImpl<CourseLearningR
@Override
public List<CoursesVO> queryrecommendCourses(String userId) {
String roleId = umsUserMapper.getbyIdRoleId(userId);
String roleId = umsUserMapper.getByIdRoleId(userId);
if (roleId.equals("1")) {

@ -12,18 +12,12 @@ import com.teaching.backend.mapper.umsAdmin.UmsUserMapper;
import com.teaching.backend.model.entity.KnowGraph.KnowledgeLearningNumber;
import com.teaching.backend.model.entity.courses.CourseLearningNumber;
import com.teaching.backend.model.entity.courses.Courses;
import com.teaching.backend.model.entity.knowtmp.Knowtmp;
import com.teaching.backend.model.entity.records.KnowledgeLearningRecord;
import com.teaching.backend.model.vo.courses.CoursesVO;
import com.teaching.backend.model.vo.knowGraph.KnowVO;
import com.teaching.backend.model.vo.records.KnowledgeLearningRecordVo;
import com.teaching.backend.service.Know.KnowService;
import com.teaching.backend.service.impl.courses.CourseLearningNumberServiceImpl;
import com.teaching.backend.service.impl.knowledge.KnowledgeLearningNumberServiceImpl;
import com.teaching.backend.service.knowtmp.KnowtmpService;
import com.teaching.backend.service.records.IKnowledgeLearningRecordService;
@ -141,7 +135,7 @@ public class KnowledgeLearningRecordServiceImpl extends ServiceImpl<KnowledgeLea
@Override
public List<KnowVO> queryMaxKnowledge(String userId) {
String roleId = umsUserMapper.getbyIdRoleId(userId);
String roleId = umsUserMapper.getByIdRoleId(userId);
List<KnowVO> coursesList = new ArrayList<>();
KnowVO knowVO = null;
if (roleId.equals("1")){

@ -76,7 +76,7 @@
WHERE
s.user_id = #{id}
</select>
<select id="getbyIdRoleId" parameterType="java.lang.String" resultType="java.lang.String">
<select id="getByIdRoleId" parameterType="java.lang.String" resultType="java.lang.String">
SELECT
us.role_id roleId
FROM

Loading…
Cancel
Save