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

master
总裁 3 months ago
parent 3070602cb1
commit dd6e7d9dc2
  1. 3
      src/main/java/com/teaching/backend/mapper/umsAdmin/UmsUserMapper.java
  2. 17
      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; package com.teaching.backend.mapper.umsAdmin;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; 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.UmsRole;
import com.teaching.backend.model.entity.umsAdmin.UmsTeacher; import com.teaching.backend.model.entity.umsAdmin.UmsTeacher;
import com.teaching.backend.model.entity.umsAdmin.UmsUser; import com.teaching.backend.model.entity.umsAdmin.UmsUser;
@ -19,5 +18,5 @@ public interface UmsUserMapper extends BaseMapper<UmsUser> {
UmsStudentVO getByIdStudent(String id); 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 @Override
public List<PersonalCenterStudentListVO> queryStudentList(String userId) { public List<PersonalCenterStudentListVO> queryStudentList(String userId) {
LinkedHashSet<UmsStudentManage> umsStudentManageList = queryTeacherByStudentList(userId); LinkedHashSet<UmsStudentManage> umsStudentManageList = queryTeacherByStudentList(userId);
System.out.println("1111111"+umsStudentManageList);
List<PersonalCenterStudentListVO> personalCenterStudentListVOList = new ArrayList<>(); List<PersonalCenterStudentListVO> personalCenterStudentListVOList = new ArrayList<>();
PersonalCenterStudentListVO personalCenterStudentListVO = null; PersonalCenterStudentListVO personalCenterStudentListVO = null;
for (UmsStudentManage umsStudentManage : umsStudentManageList) { for (UmsStudentManage umsStudentManage : umsStudentManageList) {
@ -375,7 +376,7 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl
@Override @Override
public LinkedHashSet<UmsStudentManage> queryTeacherByStudentList(String userId) { public LinkedHashSet<UmsStudentManage> queryTeacherByStudentList(String userId) {
String roleId = umsUserMapper.getbyIdRoleId(userId); String roleId = umsUserMapper.getByIdRoleId(userId);
CourseQuery courseQuery = new CourseQuery(); CourseQuery courseQuery = new CourseQuery();
courseQuery.setUserId(userId); courseQuery.setUserId(userId);
LinkedHashSet<UmsStudentManage> umsStudentManageList = new LinkedHashSet<>(); LinkedHashSet<UmsStudentManage> umsStudentManageList = new LinkedHashSet<>();
@ -388,13 +389,15 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl
List<CourseLearningRecord> courseLearningRecordList = new ArrayList<>(); List<CourseLearningRecord> courseLearningRecordList = new ArrayList<>();
for (StudentCourses studentUsername : studentUsernames) { for (StudentCourses studentUsername : studentUsernames) {
CourseLearningRecord courseLearningRecord = courseLearningRecordMapper.selectNewRecord(String.valueOf(studentUsername.getStudent())); CourseLearningRecord courseLearningRecord = courseLearningRecordMapper.selectNewRecord(String.valueOf(studentUsername.getStudent()));
courseLearningRecordList.add(courseLearningRecord); 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());
umsStudentManageList.add(umsStudentManage);
} }
courseLearningRecordList = courseLearningRecordList.stream().sorted(Comparator.comparing(CourseLearningRecord::getTimes).reversed()).collect(Collectors.toList());
for (CourseLearningRecord courseLearningRecord : courseLearningRecordList) {
UmsStudentManage umsStudentManage = umsStudentManageMapper.queryStudent(courseLearningRecord.getUserId());
umsStudentManageList.add(umsStudentManage);
}
} }
return umsStudentManageList; return umsStudentManageList;
} }

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

@ -123,7 +123,7 @@ public class CourseLearningRecordServiceImpl extends ServiceImpl<CourseLearningR
@Override @Override
public List<CoursesVO> queryCourseList(String userId) { public List<CoursesVO> queryCourseList(String userId) {
String roleId = umsUserMapper.getbyIdRoleId(userId); String roleId = umsUserMapper.getByIdRoleId(userId);
List<Courses> coursesList = new ArrayList<>(); List<Courses> coursesList = new ArrayList<>();
if (roleId.equals("1")){ if (roleId.equals("1")){
List<String> courseIds = courseLearningRecordMapper.selectMaxNumber(); List<String> courseIds = courseLearningRecordMapper.selectMaxNumber();
@ -148,7 +148,7 @@ public class CourseLearningRecordServiceImpl extends ServiceImpl<CourseLearningR
@Override @Override
public List<CoursesVO> queryrecommendCourses(String userId) { public List<CoursesVO> queryrecommendCourses(String userId) {
String roleId = umsUserMapper.getbyIdRoleId(userId); String roleId = umsUserMapper.getByIdRoleId(userId);
if (roleId.equals("1")) { 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.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.knowtmp.Knowtmp;
import com.teaching.backend.model.entity.records.KnowledgeLearningRecord; 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.knowGraph.KnowVO;
import com.teaching.backend.model.vo.records.KnowledgeLearningRecordVo; 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.impl.knowledge.KnowledgeLearningNumberServiceImpl;
import com.teaching.backend.service.knowtmp.KnowtmpService; import com.teaching.backend.service.knowtmp.KnowtmpService;
import com.teaching.backend.service.records.IKnowledgeLearningRecordService; import com.teaching.backend.service.records.IKnowledgeLearningRecordService;
@ -141,7 +135,7 @@ public class KnowledgeLearningRecordServiceImpl extends ServiceImpl<KnowledgeLea
@Override @Override
public List<KnowVO> queryMaxKnowledge(String userId) { public List<KnowVO> queryMaxKnowledge(String userId) {
String roleId = umsUserMapper.getbyIdRoleId(userId); String roleId = umsUserMapper.getByIdRoleId(userId);
List<KnowVO> coursesList = new ArrayList<>(); List<KnowVO> coursesList = new ArrayList<>();
KnowVO knowVO = null; KnowVO knowVO = null;
if (roleId.equals("1")){ if (roleId.equals("1")){

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

Loading…
Cancel
Save