コード例 #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;
 }
コード例 #3
0
 /** 毕业班级 */
 @RequestMapping("index")
 public String index(
     ModelMap modelMap,
     @RequestParam(value = "aliasName", required = false, defaultValue = "") String aliasName) {
   // 学制学段
   List<SchoolPeriodDTO> schoolPeriodDTOList = schoolPeriodService.queryBySchoolId(getSchoolId());
   modelMap.put("schoolPeriod", schoolPeriodDTOList);
   // 获取毕业班级
   List<GraduateingClassDTO> classDTOList =
       classService.queryALLGraduateClass(getSchoolId(), aliasName);
   modelMap.put("graduatingClass", classDTOList);
   // 获取年级列表
   ClassDTO classDTO = new ClassDTO();
   classDTO.setSchoolId(getSchoolId());
   List<GradeDTO> gradeDTOs = classService.queryGrades(classDTO);
   modelMap.put("gradeDTOs", gradeDTOs);
   modelMap.put("primary", SectionConstants.PRIMARY_SCHOOL_NUM);
   modelMap.put("middle", SectionConstants.JUNIOR_MIDDLE_SCHOOL_NUM);
   modelMap.put("high", SectionConstants.SENIOR_HIGH_SCHOOL_NUM);
   modelMap.put("aliasName", aliasName);
   return "/class/graduatingClass/index";
 }