notices = noticeService.listByNoticeList(noticeIds);
+ for(Notice notice:notices){
+ noticesInfo.put("title",notice.getTitle());
+ noticesInfo.put("content",notice.getContent());
+ noticesInfo.put("create_time",notice.getCreateTime());
+ data.put(Integer.toString(++count),noticesInfo);
+ }
+ return data;
+ }
}
diff --git a/src/main/java/com/mobile_education_platform/service/ClassNoticeService.java b/src/main/java/com/mobile_education_platform/service/ClassNoticeService.java
index 13c344825771badafa8c5d32b135debd402b996a..c1fb50be22311a292d33b7e12330933243b5c6cf 100644
--- a/src/main/java/com/mobile_education_platform/service/ClassNoticeService.java
+++ b/src/main/java/com/mobile_education_platform/service/ClassNoticeService.java
@@ -3,6 +3,8 @@ package com.mobile_education_platform.service;
import com.mobile_education_platform.pojo.ClassNotice;
import com.baomidou.mybatisplus.extension.service.IService;
+import java.util.List;
+
/**
*
* 服务类
@@ -13,4 +15,21 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface ClassNoticeService extends IService {
+ /**
+ * 功能: 根据班级ID获取List
+ * @author: 陈梓康
+ * @Created: 2021/10/26 20:26
+ * @param classId 班级ID
+ * @return List
+ */
+ List listByClassId(String classId);
+
+ /**
+ * 功能: 根据班级ID获取通知ID的List
+ * @author: 陈梓康
+ * @Created: 2021/10/26 20:49
+ * @param classId 班级ID
+ * @return 通知ID的List
+ */
+ List listNoticeIdsByClassId(String classId);
}
diff --git a/src/main/java/com/mobile_education_platform/service/ClassService.java b/src/main/java/com/mobile_education_platform/service/ClassService.java
index 282c65a859cfaf21ba85a2fd1567baeabd9c7483..7b9f0419e37c3cf5821a13ec2a0bf5801dad974f 100644
--- a/src/main/java/com/mobile_education_platform/service/ClassService.java
+++ b/src/main/java/com/mobile_education_platform/service/ClassService.java
@@ -23,4 +23,13 @@ public interface ClassService extends IService {
*/
int whetherTheHeadTeacher(String tId,String cId);
+ /**
+ * 功能: 根据classId和gradeId查询Class
+ * @author: 陈梓康
+ * @Created: 2021/10/26 20:07
+ * @param id class_id
+ * @param gradeId grade_id
+ * @return Class对象
+ */
+ Class getClassByIdAndGradeId(String id,String gradeId);
}
diff --git a/src/main/java/com/mobile_education_platform/service/GradeService.java b/src/main/java/com/mobile_education_platform/service/GradeService.java
index a4f2afbcc2ad18f322e3f3f108768ce75005b4d1..1b540be0cf5948cda1c8d2df9d6504b7a3b848e4 100644
--- a/src/main/java/com/mobile_education_platform/service/GradeService.java
+++ b/src/main/java/com/mobile_education_platform/service/GradeService.java
@@ -13,4 +13,15 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface GradeService extends IService {
+ /**
+ * 功能: 根据学年,学期和classId进行查询
+ * @author: 陈梓康
+ * @Created: 2021/10/26 20:15
+ * @param schoolYear 学年
+ * @param schoolSemester 学期
+ * @param classId 班级ID(模糊查询)
+ * @return Grade对象
+ */
+ Grade getByConditions(String schoolYear,String schoolSemester,String classId);
+
}
diff --git a/src/main/java/com/mobile_education_platform/service/NoticeService.java b/src/main/java/com/mobile_education_platform/service/NoticeService.java
index 15924ab05bc2a9a0d33a71925fd5b98249c0fd2f..21a0d9b7fa3395782b389078c93ef7df62cbd339 100644
--- a/src/main/java/com/mobile_education_platform/service/NoticeService.java
+++ b/src/main/java/com/mobile_education_platform/service/NoticeService.java
@@ -1,8 +1,11 @@
package com.mobile_education_platform.service;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mobile_education_platform.pojo.Notice;
import com.baomidou.mybatisplus.extension.service.IService;
+import java.util.List;
+
/**
*
* 服务类
@@ -13,4 +16,23 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface NoticeService extends IService {
+ /**
+ * 功能: 根据通知ID的List,来得到通知对象List
+ * @author: 陈梓康
+ * @Created: 2021/10/26 20:57
+ * @param noticeIds 通知ID集合
+ * @return 通知对象List
+ */
+ List listByNoticeList(List noticeIds);
+
+ /**
+ * 功能: 根据班级ID给通知分页
+ * @author: 陈梓康
+ * @Created: 2021/10/26 22:08
+ * @param pageNum 分页的通知总数
+ * @param pageCount 分页的页数
+ * @param classId 班级ID
+ * @return Page对象
+ */
+ Page getNoticePage(int pageNum,int pageCount,String classId);
}
diff --git a/src/main/java/com/mobile_education_platform/service/StudentClassService.java b/src/main/java/com/mobile_education_platform/service/StudentClassService.java
index 7bf146d7e3fc12afde4465a0f2d0229f1d5bf8cf..2ed6b5099c1b049bdd937acf51b022739eee74fa 100644
--- a/src/main/java/com/mobile_education_platform/service/StudentClassService.java
+++ b/src/main/java/com/mobile_education_platform/service/StudentClassService.java
@@ -3,6 +3,8 @@ package com.mobile_education_platform.service;
import com.mobile_education_platform.pojo.StudentClass;
import com.baomidou.mybatisplus.extension.service.IService;
+import java.util.List;
+
/**
*
* 服务类
@@ -13,4 +15,21 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface StudentClassService extends IService {
+ /**
+ * 功能: 根据班级ID得到List
+ * @author: 陈梓康
+ * @Created: 2021/10/26 20:33
+ * @param classId 班级ID
+ * @return List
+ */
+ List listByClassId(String classId);
+
+ /**
+ * 功能: 根据学生ID得到一个StudentClass对象
+ * @author: 陈梓康
+ * @Created: 2021/10/26 20:34
+ * @param studentId 学生ID
+ * @return StudentClass对象
+ */
+ StudentClass getByStudentId(String studentId);
}
diff --git a/src/main/java/com/mobile_education_platform/service/TeacherClassSubjectService.java b/src/main/java/com/mobile_education_platform/service/TeacherClassSubjectService.java
index 50faed738d9779c35749479f98b582ecbb0eeb78..55bf308c337cf0c5a088708e55ed0494f313cd08 100644
--- a/src/main/java/com/mobile_education_platform/service/TeacherClassSubjectService.java
+++ b/src/main/java/com/mobile_education_platform/service/TeacherClassSubjectService.java
@@ -3,6 +3,8 @@ package com.mobile_education_platform.service;
import com.mobile_education_platform.pojo.TeacherClassSubject;
import com.baomidou.mybatisplus.extension.service.IService;
+import java.util.List;
+
/**
*
* 服务类
@@ -23,4 +25,12 @@ public interface TeacherClassSubjectService extends IService listByTeacherId(String teacherId);
}
diff --git a/src/main/java/com/mobile_education_platform/service/UserService.java b/src/main/java/com/mobile_education_platform/service/UserService.java
index cbfa8606df22bc528e48bf2623bf15d6f0dfeb43..dcfd372e74f15c6bfa0d02679a045e77c75e8c0c 100644
--- a/src/main/java/com/mobile_education_platform/service/UserService.java
+++ b/src/main/java/com/mobile_education_platform/service/UserService.java
@@ -16,6 +16,13 @@ import java.util.Map;
public interface UserService extends IService {
/**
+ * 功能: 通过userNumber来获取User对象
+ * @author: 陈梓康
+ * @Created: 2021/10/26 20:20
+ * @param userNumber 用户ID
+ * @return User对象
+ */
+ User getByUserNumber(String userNumber);
* @Description: 根据openid判断该用户为新老用户
* @param openid 用户唯一id
* @return 返回查询的结果(用户是否已保定身份,若已绑定需提供身份信息)
diff --git a/src/main/java/com/mobile_education_platform/service/impl/ClassNoticeServiceImpl.java b/src/main/java/com/mobile_education_platform/service/impl/ClassNoticeServiceImpl.java
index 0ab9ec16692689d175fa84e4ed8ee3ee27ab9ef2..7641e991e6fdd539e78ea1ef513e33b9e93f63c9 100644
--- a/src/main/java/com/mobile_education_platform/service/impl/ClassNoticeServiceImpl.java
+++ b/src/main/java/com/mobile_education_platform/service/impl/ClassNoticeServiceImpl.java
@@ -1,11 +1,15 @@
package com.mobile_education_platform.service.impl;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mobile_education_platform.pojo.ClassNotice;
import com.mobile_education_platform.mapper.ClassNoticeMapper;
import com.mobile_education_platform.service.ClassNoticeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
+import java.util.ArrayList;
+import java.util.List;
+
/**
*
* 服务实现类
@@ -17,4 +21,36 @@ import org.springframework.stereotype.Service;
@Service
public class ClassNoticeServiceImpl extends ServiceImpl implements ClassNoticeService {
+ /**
+ * 功能: 根据班级ID获取List
+ * @author: 陈梓康
+ * @Created: 2021/10/26 20:26
+ * @param classId 班级ID
+ * @return List
+ */
+ @Override
+ public List listByClassId(String classId) {
+ QueryWrapper queryWrapper = new QueryWrapper().eq("class_id", classId);
+ return baseMapper.selectList(queryWrapper);
+ }
+
+ /**
+ * 功能: 根据班级ID获取通知ID的List
+ * @author: 陈梓康
+ * @Created: 2021/10/26 20:49
+ * @param classId 班级ID
+ * @return 通知ID的List
+ */
+ @Override
+ public List listNoticeIdsByClassId(String classId) {
+ QueryWrapper queryWrapper=new QueryWrapper<>();
+ queryWrapper.select("notice_id");
+ queryWrapper.eq("class_id",classId);
+ List classNotices = baseMapper.selectList(queryWrapper);
+ List noticeIds=new ArrayList<>();
+ for (ClassNotice classNotice:classNotices){
+ noticeIds.add(classNotice.getNoticeId());
+ }
+ return noticeIds;
+ }
}
diff --git a/src/main/java/com/mobile_education_platform/service/impl/ClassServiceImpl.java b/src/main/java/com/mobile_education_platform/service/impl/ClassServiceImpl.java
index 88b389682553631c2048253658e95d10fba00edb..f2d16b0f8dc5a23b9258d665b051ae3e8d016a68 100644
--- a/src/main/java/com/mobile_education_platform/service/impl/ClassServiceImpl.java
+++ b/src/main/java/com/mobile_education_platform/service/impl/ClassServiceImpl.java
@@ -35,4 +35,20 @@ public class ClassServiceImpl extends ServiceImpl implements
}
+ /**
+ * 功能: 根据classId和gradeId查询Class
+ * @author: 陈梓康
+ * @Created: 2021/10/26 20:07
+ * @param id class_id
+ * @param gradeId grade_id
+ * @return Class对象
+ */
+ @Override
+ public Class getClassByIdAndGradeId(String id, String gradeId) {
+ QueryWrapper classQueryWrapper = new QueryWrapper<>();
+ classQueryWrapper.eq("id", id);
+ classQueryWrapper.eq("grade_id", gradeId);
+ return baseMapper.selectOne(classQueryWrapper);
+ }
+
}
diff --git a/src/main/java/com/mobile_education_platform/service/impl/GradeServiceImpl.java b/src/main/java/com/mobile_education_platform/service/impl/GradeServiceImpl.java
index 6f249afd155199d1809ffb9df9644c7b385c4bfa..6c0ed2b1f8c82e4f09112f1b5796ef00eaa65db0 100644
--- a/src/main/java/com/mobile_education_platform/service/impl/GradeServiceImpl.java
+++ b/src/main/java/com/mobile_education_platform/service/impl/GradeServiceImpl.java
@@ -1,5 +1,6 @@
package com.mobile_education_platform.service.impl;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mobile_education_platform.pojo.Grade;
import com.mobile_education_platform.mapper.GradeMapper;
import com.mobile_education_platform.service.GradeService;
@@ -17,4 +18,21 @@ import org.springframework.stereotype.Service;
@Service
public class GradeServiceImpl extends ServiceImpl implements GradeService {
+ /**
+ * 功能: 根据学年,学期和classId进行查询
+ * @author: 陈梓康
+ * @Created: 2021/10/26 20:15
+ * @param schoolYear 学年
+ * @param schoolSemester 学期
+ * @param classId 班级ID(模糊查询)
+ * @return Grade对象
+ */
+ @Override
+ public Grade getByConditions(String schoolYear, String schoolSemester, String classId) {
+ QueryWrapper gradeQueryWrapper = new QueryWrapper<>();
+ gradeQueryWrapper.like("school_year", schoolYear + "-");
+ gradeQueryWrapper.eq("school_semester", schoolSemester);
+ gradeQueryWrapper.like("class_id_group", classId);
+ return baseMapper.selectOne(gradeQueryWrapper);
+ }
}
diff --git a/src/main/java/com/mobile_education_platform/service/impl/NoticeServiceImpl.java b/src/main/java/com/mobile_education_platform/service/impl/NoticeServiceImpl.java
index 067b95fac31031b52cf66ad9b4abaa331e75198e..85b6f0d10adb06d311e8517b9ac8b3688638cd3c 100644
--- a/src/main/java/com/mobile_education_platform/service/impl/NoticeServiceImpl.java
+++ b/src/main/java/com/mobile_education_platform/service/impl/NoticeServiceImpl.java
@@ -1,11 +1,16 @@
package com.mobile_education_platform.service.impl;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mobile_education_platform.pojo.Notice;
import com.mobile_education_platform.mapper.NoticeMapper;
import com.mobile_education_platform.service.NoticeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.aspectj.weaver.ast.Not;
import org.springframework.stereotype.Service;
+import java.util.List;
+
/**
*
* 服务实现类
@@ -17,4 +22,33 @@ import org.springframework.stereotype.Service;
@Service
public class NoticeServiceImpl extends ServiceImpl implements NoticeService {
+ /**
+ * 功能: 根据通知ID的List,来得到通知对象List
+ * @author: 陈梓康
+ * @Created: 2021/10/26 20:57
+ * @param noticeIds 通知ID集合
+ * @return 通知对象List
+ */
+ @Override
+ public List listByNoticeList(List noticeIds) {
+ List notices = baseMapper.selectBatchIds(noticeIds);
+ return notices;
+ }
+
+ /**
+ * 功能: 根据班级ID给通知分页
+ * @author: 陈梓康
+ * @Created: 2021/10/26 22:08
+ * @param pageNum 分页的通知总数
+ * @param pageCount 分页的页数
+ * @param classId 班级ID
+ * @return Page对象
+ */
+ @Override
+ public Page getNoticePage(int pageNum, int pageCount, String classId) {
+ Page page=new Page<>(pageNum,pageCount);
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("class_id",classId);
+ return baseMapper.selectPage(page,queryWrapper);
+ }
}
diff --git a/src/main/java/com/mobile_education_platform/service/impl/StudentClassServiceImpl.java b/src/main/java/com/mobile_education_platform/service/impl/StudentClassServiceImpl.java
index 2156841bf3ddcc969446abbb687fd5fc9dd114ef..51adef0c68c520b4a1d69fbf902198c87e026729 100644
--- a/src/main/java/com/mobile_education_platform/service/impl/StudentClassServiceImpl.java
+++ b/src/main/java/com/mobile_education_platform/service/impl/StudentClassServiceImpl.java
@@ -1,11 +1,14 @@
package com.mobile_education_platform.service.impl;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mobile_education_platform.pojo.StudentClass;
import com.mobile_education_platform.mapper.StudentClassMapper;
import com.mobile_education_platform.service.StudentClassService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
+import java.util.List;
+
/**
*
* 服务实现类
@@ -17,4 +20,31 @@ import org.springframework.stereotype.Service;
@Service
public class StudentClassServiceImpl extends ServiceImpl implements StudentClassService {
+ /**
+ * 功能: 根据班级ID得到List
+ * @author: 陈梓康
+ * @Created: 2021/10/26 20:33
+ * @param classId 班级ID
+ * @return List
+ */
+ @Override
+ public List listByClassId(String classId) {
+ QueryWrapper queryWrapper=new QueryWrapper<>();
+ queryWrapper.eq("class_id",classId);
+ return baseMapper.selectList(queryWrapper);
+ }
+
+ /**
+ * 功能: 根据学生ID得到一个StudentClass对象
+ * @author: 陈梓康
+ * @Created: 2021/10/26 20:34
+ * @param studentId 学生ID
+ * @return StudentClass对象
+ */
+ @Override
+ public StudentClass getByStudentId(String studentId) {
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("student_id", studentId);
+ return baseMapper.selectOne(queryWrapper);
+ }
}
diff --git a/src/main/java/com/mobile_education_platform/service/impl/TeacherClassSubjectServiceImpl.java b/src/main/java/com/mobile_education_platform/service/impl/TeacherClassSubjectServiceImpl.java
index 4c33a32e3c2e91dc5084303845cf27dae58212cf..a6549ae4505b4a8a7abe7496d861437638fda02e 100644
--- a/src/main/java/com/mobile_education_platform/service/impl/TeacherClassSubjectServiceImpl.java
+++ b/src/main/java/com/mobile_education_platform/service/impl/TeacherClassSubjectServiceImpl.java
@@ -1,11 +1,14 @@
package com.mobile_education_platform.service.impl;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mobile_education_platform.pojo.TeacherClassSubject;
import com.mobile_education_platform.mapper.TeacherClassSubjectMapper;
import com.mobile_education_platform.service.TeacherClassSubjectService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
+import java.util.List;
+
/**
*
* 服务实现类
@@ -30,4 +33,17 @@ public class TeacherClassSubjectServiceImpl extends ServiceImpl listByTeacherId(String teacherId) {
+ QueryWrapper queryWrapper = new QueryWrapper().eq("teacher_id", teacherId);
+ return baseMapper.selectList(queryWrapper);
+ }
+
}
diff --git a/src/main/java/com/mobile_education_platform/service/impl/UserServiceImpl.java b/src/main/java/com/mobile_education_platform/service/impl/UserServiceImpl.java
index cd3c97a7fc5883e3d26ddd4bc9f063461086a12a..db5df9abab92f4568e6d24cbdf92c187c32d42c5 100644
--- a/src/main/java/com/mobile_education_platform/service/impl/UserServiceImpl.java
+++ b/src/main/java/com/mobile_education_platform/service/impl/UserServiceImpl.java
@@ -1,5 +1,6 @@
package com.mobile_education_platform.service.impl;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mobile_education_platform.mapper.ParentMapper;
@@ -28,6 +29,17 @@ import java.util.Map;
@Service
public class UserServiceImpl extends ServiceImpl implements UserService {
+ /**
+ * 功能: 通过userNumber来获取User对象
+ * @author: 陈梓康
+ * @Created: 2021/10/26 20:20
+ * @param userNumber 用户ID
+ * @return User对象
+ */
+ @Override
+ public User getByUserNumber(String userNumber) {
+ QueryWrapper queryWrapper = new QueryWrapper().eq("user_number", userNumber);
+ return baseMapper.selectOne(queryWrapper);
@Resource
private TeacherMapper teacherMapper;