コード例 #1
0
 /**
  * 班级添加学生
  *
  * @param userId 学乐号
  * @param classId 班级ID
  */
 @Override
 public int saveStudents(String userId, String classId) {
   String[] userIds = userId.split(",");
   String schoolId = classService.getSchoolId(classId);
   MClass mClass = classMapper.selectByPrimaryKey(classId, schoolId);
   int in = studentMapper.updateStudents(Arrays.asList(userIds), mClass);
   // 学生换班,删除该家长的缓存信息
   deleteRedisOfParent(Arrays.asList(userIds), schoolId);
   return in;
 }
コード例 #2
0
 /** APP接口、WEB平台:根据班级ID查询该班级所有学生 */
 @Override
 public List<StudentManagerDTO> queryClassStudents(String classId) {
   String schoolId = classService.getSchoolId(classId);
   List<MStudentManager> userList = studentMapper.selectClassStudents(classId, schoolId);
   List<StudentManagerDTO> userDTOList = new ArrayList<>();
   for (MStudentManager u : userList) {
     StudentManagerDTO userDTO = new StudentManagerDTO();
     BeanUtils.copyProperties(u, userDTO);
     userDTOList.add(userDTO);
   }
   return userDTOList;
 }