关于java:Spring-Boot-蓝天幼儿园管理系统拿来练手真不错

27次阅读

共计 22528 个字符,预计需要花费 57 分钟才能阅读完成。

我的项目介绍

蓝天幼儿园管理系统,共分为三种角色:

  • 管理员
  • 家长
  • 老师

管理员角色具备性能:

  • 系统管理:用户治理、页面治理、角色治理
  • 校园治理:老师治理、工资管理、物资治理、菜谱治理、班级治理
  • 班级治理:学生治理、布告治理、课程管理
  • 考勤治理:老师考勤、学生考勤、老师考勤统计、学生考勤统计、签到签退

技术栈

1、Springboot

Spring Boot 根底就不介绍了,举荐下这个实战教程:https://github.com/javastacks…

2、html+thymeleaf

环境须要

  1. 运行环境:最好是 java jdk 1.8,咱们在这个平台上运行的。其余版本实践上也能够。
  2. IDE 环境:IDEA,Eclipse,Myeclipse 都能够。举荐 IDEA;
  3. tomcat 环境:Tomcat 7.x,8.x,9.x 版本均可
  4. 硬件环境:windows 7/8/10 1G 内存以上;或者 Mac OS;
  5. 是否 Maven 我的项目: 是;查看源码目录中是否蕴含 pom.xml;若蕴含,则为 maven 我的项目,否则为非 maven 我的项目
  6. 数据库:MySql 8.0 版本;

应用阐明

  1. 应用 Navicat 或者其它工具,在 mysql 中创立对应名称的数据库,并导入我的项目的 sql 文件;
  2. 将我的项目中 yml 配置文件中的数据库配置改为本人的配置
  3. 应用 IDEA/Eclipse/MyEclipse 导入我的项目,Eclipse/MyEclipse 导入时,若为 maven 我的项目请抉择 maven; 若为 maven 我的项目,导入胜利后请执行 maven clean;maven install 命令,
  4. 运行我的项目,输出 localhost:8081 登录
  5. 管理员账户 admin 明码 123456
  6. 老师账号 wangjianlin 明码 123456

代码

用户管理控制层:

@Controller
@RequestMapping("admin/system/user")
public class UserController {

    @Autowired
    UserService userService;

    @Autowired
    RoleService roleService;

    @Autowired
    UploadService uploadService;

    @RequestMapping("list")
    @SysLog("跳转零碎用户列表页面")
    public String list(){return "admin/user/list";}

    @RequiresPermissions("sys:user:list")
    @PostMapping("list")
    @ResponseBody
    public PageData<User> list(@RequestParam(value = "page",defaultValue = "1")Integer page,
                               @RequestParam(value = "limit",defaultValue = "10")Integer limit,
                               ServletRequest request){Map map = WebUtils.getParametersStartingWith(request, "s_");
        PageData<User> userPageData = new PageData<>();
        QueryWrapper<User> userWrapper = new QueryWrapper<>();
        if(!map.isEmpty()){String type = (String) map.get("type");
            if(StringUtils.isNotBlank(type)) {userWrapper.eq("is_admin", "admin".equals(type) ? true : false);
            }
            String keys = (String) map.get("key");
            if(StringUtils.isNotBlank(keys)) {userWrapper.and(wrapper -> wrapper.like("login_name", keys).or().like("tel", keys).or().like("email", keys));
            }
        }
        IPage<User> userPage = userService.page(new Page<>(page,limit),userWrapper);
        userPageData.setCount(userPage.getTotal());
        userPageData.setData(userPage.getRecords());
        return userPageData;
    }

    @RequestMapping("add")
    public String add(ModelMap modelMap){List<Role> roleList = roleService.selectAll();
        modelMap.put("roleList",roleList);
        return "admin/user/add";
    }

    @RequiresPermissions("sys:user:add")
    @PostMapping("add")
    @ResponseBody
    @SysLog("保留新增零碎用户数据")
    public ResponseEntity add(@RequestBody  User user){if(StringUtils.isBlank(user.getLoginName())){return ResponseEntity.failure("登录名不能为空");
        }
        if(user.getRoleLists() == null || user.getRoleLists().size() == 0){return  ResponseEntity.failure("用户角色至多抉择一个");
        }
        if(userService.userCount(user.getLoginName())>0){return ResponseEntity.failure("登录名称曾经存在");
        }
//        if(StringUtils.isNotBlank(user.getEmail())){//            if(userService.userCount(user.getEmail())>0){//                return ResponseEntity.failure("该邮箱已被应用");
//            }
//        }
//        if(StringUtils.isNoneBlank(user.getTel())){//            if(userService.userCount(user.getTel())>0){//                return ResponseEntity.failure("该手机号已被绑定");
//            }
//        }
        // 设置默认明码
        if(StringUtils.isBlank(user.getPassword())){user.setPassword(Constants.DEFAULT_PASSWORD);
        }
        userService.saveUser(user);
        if(StringUtils.isBlank(user.getId())){return ResponseEntity.failure("保留用户信息出错");
        }
        // 保留用户角色关系
        userService.saveUserRoles(user.getId(),user.getRoleLists());
        return ResponseEntity.success("操作胜利");
    }

    @RequestMapping("edit")
    public String edit(String id,ModelMap modelMap){User user = userService.findUserById(id);
        String roleIds = "";
        if(user != null) {roleIds = user.getRoleLists().stream().map(role -> role.getId()).collect(Collectors.joining(","));
        }
        List<Role> roleList = roleService.selectAll();
        modelMap.put("localuser",user);
        modelMap.put("roleIds",roleIds);
        modelMap.put("roleList",roleList);
        return "admin/user/edit";
    }

    @RequiresPermissions("sys:user:edit")
    @PostMapping("edit")
    @ResponseBody
    @SysLog("保留零碎用户编辑数据")
    public ResponseEntity edit(@RequestBody  User user){if(StringUtils.isBlank(user.getId())){return ResponseEntity.failure("用户 ID 不能为空");
        }
        if(StringUtils.isBlank(user.getLoginName())){return ResponseEntity.failure("登录名不能为空");
        }
        if(user.getRoleLists() == null || user.getRoleLists().size() == 0){return  ResponseEntity.failure("用户角色至多抉择一个");
        }
        User oldUser = userService.findUserById(user.getId());
        if(StringUtils.isNotBlank(user.getEmail())){if(!user.getEmail().equals(oldUser.getEmail())){if(userService.userCount(user.getEmail())>0){return ResponseEntity.failure("该邮箱已被应用");
                }
            }
        }
        if(StringUtils.isNotBlank(user.getLoginName())){if(!user.getLoginName().equals(oldUser.getLoginName())) {if (userService.userCount(user.getLoginName()) > 0) {return ResponseEntity.failure("该登录名已存在");
                }
            }
        }
        if(StringUtils.isNotBlank(user.getTel())){if(!user.getTel().equals(oldUser.getTel())) {if (userService.userCount(user.getTel()) > 0) {return ResponseEntity.failure("该手机号曾经被绑定");
                }
            }
        }
        user.setIcon(oldUser.getIcon());
        userService.updateUser(user);

        if(StringUtils.isBlank(user.getId())){return ResponseEntity.failure("保留用户信息出错");
        }
        userService.saveUserRoles(user.getId(),user.getRoleLists());
        return ResponseEntity.success("操作胜利");
    }

    @RequiresPermissions("sys:user:lock")
    @PostMapping("lock")
    @ResponseBody
    @SysLog("锁定或开启零碎用户")
    public ResponseEntity lock(@RequestParam(value = "id",required = false)String id){if(StringUtils.isBlank(id)){return ResponseEntity.failure("参数谬误");
        }
        User user = userService.getById(id);
        if(user == null){return ResponseEntity.failure("用户不存在");
        }
        userService.lockUser(user);
        return ResponseEntity.success("操作胜利");
    }

    @RequiresPermissions("sys:user:delete")
    @PostMapping("delete")
    @ResponseBody
    @SysLog("删除零碎用户数据 ( 单个)")
    public ResponseEntity delete(@RequestParam(value = "id",required = false)String id){if(StringUtils.isBlank(id)){return ResponseEntity.failure("参数谬误");
        }
        User user = userService.getById(id);
        if(user == null){return ResponseEntity.failure("用户不存在");
        }else if(user.getAdminUser()) {return ResponseEntity.failure("不能删除后盾用户");
        }
        userService.deleteUser(user);
        return ResponseEntity.success("操作胜利");
    }

    @RequiresPermissions("sys:user:delete")
    @PostMapping("deleteSome")
    @ResponseBody
    @SysLog("删除零碎用户数据 ( 多个)")
    public ResponseEntity deleteSome(@RequestBody List<User> users){if(users == null || users.size()==0){return ResponseEntity.failure("请抉择须要删除的用户");
        }
        for (User u : users){if(u.getAdminUser()){return ResponseEntity.failure("不能删除超级管理员");
            }else{userService.deleteUser(u);
            }
        }
        return ResponseEntity.success("操作胜利");
    }

    @RequestMapping("userinfo")
    public String toEditMyInfo(ModelMap modelMap){String userId = MySysUser.id();
        User user = userService.findUserById(userId);
        modelMap.put("userinfo",user);
        modelMap.put("userRole",user.getRoleLists());
        return "admin/user/userInfo";
    }

    @SysLog("零碎用户个人信息批改")
    @PostMapping("saveUserinfo")
    @ResponseBody
    public ResponseEntity saveUserInfo(User user){if(StringUtils.isBlank(user.getId())){return ResponseEntity.failure("用户 ID 不能为空");
        }
        if(StringUtils.isBlank(user.getLoginName())){return ResponseEntity.failure("登录名不能为空");
        }
        User oldUser = userService.findUserById(user.getId());
        if(StringUtils.isNotBlank(user.getEmail())){if(!user.getEmail().equals(oldUser.getEmail())){if(userService.userCount(user.getEmail())>0){return ResponseEntity.failure("该邮箱已被应用");
                }
            }
        }
        if(StringUtils.isNotBlank(user.getTel())){if(!user.getTel().equals(oldUser.getTel())) {if (userService.userCount(user.getTel()) > 0) {return ResponseEntity.failure("该手机号曾经被绑定");
                }
            }
        }
        userService.updateById(user);
        return ResponseEntity.success("操作胜利");
    }

    @RequestMapping("changePassword")
    public String changePassword(ModelMap modelMap){modelMap.put("currentUser",userService.getById(MySysUser.id()));
        return "admin/user/changePassword";
    }
    @CrossOrigin
    @SysLog("用户批改明码")
    @PostMapping("changePassword")
    @ResponseBody
    public ResponseEntity changePassword(@RequestParam(value = "userName",required = false)String userName,
                                         @RequestParam(value = "oldPwd",required = false)String oldPwd,
                                       @RequestParam(value = "newPwd",required = false)String newPwd,
                                       @RequestParam(value = "confirmPwd",required = false)String confirmPwd){if(StringUtils.isBlank(oldPwd)){return ResponseEntity.failure("旧明码不能为空");
        }
        if(StringUtils.isBlank(newPwd)){return ResponseEntity.failure("新密码不能为空");
        }
        if(StringUtils.isBlank(confirmPwd)){return ResponseEntity.failure("确认明码不能为空");
        }
        if(!confirmPwd.equals(newPwd)){return ResponseEntity.failure("确认明码与新密码不统一");
        }
        // 小程序修改明码
        if(StringUtils.isBlank(userName)){
            //PC 批改明码
            User user = userService.findUserById(MySysUser.id());

            byte[] hashPassword = Encodes.sha1(oldPwd.getBytes(), Encodes.SHA1, Encodes.decodeHex(user.getSalt()), Constants.HASH_INTERATIONS);
            String password = Encodes.encodeHex(hashPassword);

            if(!user.getPassword().equals(password)){return ResponseEntity.failure("旧明码谬误");
            }
            user.setPassword(newPwd);
            Encodes.entryptPassword(user);
            userService.updateById(user);
            return ResponseEntity.success("操作胜利");
        }else {
            // 小程序修改明码
            User user = userService.findUserByLoginName(userName);

            byte[] hashPassword = Encodes.sha1(oldPwd.getBytes(), Encodes.SHA1, Encodes.decodeHex(user.getSalt()), Constants.HASH_INTERATIONS);
            String password = Encodes.encodeHex(hashPassword);

            if(!user.getPassword().equals(password)){return ResponseEntity.failure("旧明码谬误");
            }
            user.setPassword(newPwd);
            Encodes.entryptPassword(user);
            userService.updateById(user);
            return ResponseEntity.success("操作胜利");
        }

    }

    @SysLog("上传头像")
    @PostMapping("uploadFace")
    @ResponseBody
    public ResponseEntity uploadFile(@RequestParam("icon") MultipartFile file, HttpServletRequest httpServletRequest) {if(file == null){return ResponseEntity.failure("上传文件为空");
        }
        String url = null;
        Map map = new HashMap();
        try {url = uploadService.upload(file);
            map.put("url", url);
            map.put("name", file.getOriginalFilename());
        } catch (Exception e) {e.printStackTrace();
            return ResponseEntity.failure(e.getMessage());
        }
        return ResponseEntity.success("操作胜利").setAny("data",map);
    }

}

老师管理控制层:

@Controller
public class TeacherController {
    @Autowired
    private TeacherService lxxTeacherService;
    @Autowired
    private StudentService lxxStudentService;
    @Autowired
    private DeleteService deleteService;

    // 跳转老师查问页面
    @RequestMapping("/selectTeacher")
    public String selectTeacher(){return "view/teacher/selTeacher";}

    //  查问老师信息
    @RequestMapping("selTeacher")
    @ResponseBody
    public LayuiResult<Map> selTeacher(TeacherDB teacherDB, pageCount pageCount){LayuiResult<Map> result = new LayuiResult<>();
        //  查问所有老师信息 / 含糊查问老师信息
        List<Map> list = lxxTeacherService.selTeacher(teacherDB,pageCount);
        //  查问符合条件的老师数量
        int count = lxxTeacherService.selTeacherCount(teacherDB);
        result.setData(list);
        result.setCount(count);
        return result;
    }

    //  依据老师编号查问老师信息
    @RequestMapping("/selTeacherId")
    public String selTeacherId(Integer id, Model model){List<TeacherDB> tea = lxxTeacherService.selTeacherId(id);
        //  查问政治面貌
        List<PoliticsTypeDB> selpol = lxxStudentService.selPolitics();
        model.addAttribute("tea",tea);
        model.addAttribute("selpol",selpol);
        return "view/teacher/updTeacher";
    }

    //  依据老师编号查问老师详细信息
    @RequestMapping("/selectTeaMessage")
    public String selectTeaMessage(Integer id, Model model){List<TeacherDB> tea = lxxTeacherService.selTeacherId(id);
        //  查问政治面貌
        List<PoliticsTypeDB> selpol = lxxStudentService.selPolitics();
        model.addAttribute("tea",tea);
        model.addAttribute("selpol",selpol);
        return "view/teacher/selTchMessage";
    }

    //  批改老师信息
    @RequestMapping("/updateTeacher")
    @ResponseBody
    public LayuiResult<TeacherDB> updTeacher(TeacherDB teacherDB, String birthday) throws Exception{LayuiResult result= new LayuiResult();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        Date date=format.parse(birthday);
        teacherDB.setTbirthday(date);
        Integer state = teacherDB.getTchstate();
        Integer tid = teacherDB.getTid();
        if(state == 1){
            //  批改老师为到职状态并逻辑删除
            Integer deleteTeacher = deleteService.deleteTeacher(teacherDB);
            //  删除老师授课信息
            Integer deleteTchCourse = deleteService.deleteTchCourse(tid);
            //  删除老师班级信息
            Integer deleteTchClass = deleteService.deleteTchClass(tid);
            //  删除老师问题信息
            Integer deleteTchExam = deleteService.deleteTchExam(tid);
            //  删除教评记录信息
            Integer deleteTeaRecord = deleteService.deleteTeaRecord(tid);
            //  改用户登录状态改为(1)锁定状态
            Integer deleteUser = deleteService.deleteUser(teacherDB.getTchid());
            // 删除提醒
            result.setMsg("批改胜利!");
            return result;
        }else{int a =lxxTeacherService.updTeacher(teacherDB);
            // 删除提醒
            result.setMsg("批改胜利!");
            return result;
        }
    }

}

学生管理控制层:

@Controller
public class StudentController extends BaseController {
    @Autowired
    private StudentService studentService;

    // 跳转学生查问页面
    @RequestMapping("/selectStudent")
    public String selectStudent(){return "view/student/selStudent";}

    //  查问所有学生
    @RequestMapping("selStudent")
    @ResponseBody
    public LayuiResult<Map> selectStu(pageCount pageCount, StudentVO studentVO){LayuiResult<Map> result = new LayuiResult<>();
        List<Map> list = studentService.selStudent(studentVO,pageCount);
        int count = studentService.selCount(studentVO);
        result.setData(list);
        result.setCount(count);
        return result;
    }

    //  查问所有业余
    @RequestMapping("selDepartment")
    @ResponseBody
    public LayuiResult<Map> selDepartment(){List<DepartmentDB> selDepartment = studentService.selDepartment();
        LayuiResult result = new LayuiResult();
        result.setData(selDepartment);
        return result;
    }

    //  依据系部查问业余
    @RequestMapping("selectdid")
    @ResponseBody
    public LayuiResult<Map> selMajorDB(Integer did){List<MajorDB> major  =studentService.selMajorDB(did);
        LayuiResult result = new LayuiResult();
        result.setData(major);
        return result;
    }
    //  依据业余查问年级
    @RequestMapping("selectmid")
    @ResponseBody
    public LayuiResult<Map> selGradeDB(Integer mid){List<GradeDB> grade = studentService.selGradeDB(mid);
        LayuiResult result = new LayuiResult();
        result.setData(grade);
        return result;
    }

    //  依据年级查问班级
    @RequestMapping("selectgid")
    @ResponseBody
    public LayuiResult<Map> selClassinfoDB(Integer gid){List<ClassinfoDB> classinfo = studentService.selClassinfoDB(gid);
        LayuiResult result = new LayuiResult();
        result.setData(classinfo);
        return result;
    }

    //  依据 id 查问一条学生信息以此进行批改
    @RequestMapping("/selStudentId")
    public String selStudentId(Integer id, Model model){
        //  查问学生信息
        List<StudentDB> stu = studentService.selStudentId(id);
        //  查问班级
        List<ClassinfoDB> cls = studentService.selClass();
        //  查问政治面貌表
        List<PoliticsTypeDB> stupol = studentService.selPolitics();
        model.addAttribute("stu",stu);
        model.addAttribute("cls",cls);
        model.addAttribute("stupol",stupol);
        return "view/student/updStudent";
    }

    //  依据 id 查问显示学生详细信息
    @RequestMapping("/selectMessage")
    public String selectMessage(Integer id, Model model){
        //  查问学生信息
        List<StudentDB> stu = studentService.selStudentId(id);
        //  查问班级
        List<ClassinfoDB> cls = studentService.selClass();
        //  查问政治面貌表
        List<PoliticsTypeDB> stupol = studentService.selPolitics();
        model.addAttribute("stu",stu);
        model.addAttribute("cls",cls);
        model.addAttribute("stupol",stupol);
        return "view/student/selStuExam";
    }

    //  批改用户信息
    @RequestMapping("/updateStudent")
    @ResponseBody
    public LayuiResult<StudentDB> updateStudent(StudentDB studentDB, String birthday) throws Exception{SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        Date date=format.parse(birthday);
        studentDB.setSbirthday(date);
        studentService.updateStudent(studentDB);
        LayuiResult result= new LayuiResult();
        // 删除提醒
        result.setMsg("批改胜利!");
        return result;
    }
}

校园管理控制层:

@Controller
@RequestMapping("schoolmanage")
public class SchoolManageController extends BaseController {
    @Autowired
    private SchoolManageService schoolManageService;

    /**
     * 进入班级治理页面
     */
    @RequestMapping("classmanage")
    public String classmanage() {return "view/schoolmanage/classmanage";}

    /**
     * 进入年级治理页面
     */
    @RequestMapping("grademanage")
    public String grademanage() {return "view/schoolmanage/grademanage";}

    /**
     * 进入业余治理页面
     */
    @RequestMapping("majormanage")
    public String majormanage() {return "view/schoolmanage/majormanage";}

    /**
     * 进入系部治理页面
     */
    @RequestMapping("dpmmanage")
    public String dpmmanage() {return "view/schoolmanage/dpmmanage";}

    /******************************************************************* 系部治理 *********************************************************************/

    /**
     * 增加系部
     */
    @RequestMapping("addonedpm")
    @ResponseBody
    public Object addOneDpm(DepartmentDB departmentDB) {int check = schoolManageService.checkOneDpm(departmentDB);
        if (check > 0) {return false;} else {int r = schoolManageService.addOneDpm(departmentDB);
            if (r == 1) {return true;} else {return false;}
        }

    }

    /**
     * 获取系部列表
     */
    @RequestMapping("findalldpm")
    @ResponseBody
    public Object findAllDpm(SchoolManageVO schoolManageVO, Integer page, Integer limit) {PageHelper.startPage(page, limit);
        List<SchoolManageVO> listAll = schoolManageService.findAllDpm(schoolManageVO);
        PageInfo pageInfo = new PageInfo(listAll);
        Map<String, Object> dpmData = new HashMap<String, Object>();
        dpmData.put("code", 0);
        dpmData.put("msg", "");
        dpmData.put("count", pageInfo.getTotal());
        dpmData.put("data", pageInfo.getList());
        return dpmData;
    }

    /**
     * 编辑系部
     */
    @RequestMapping("editonedpm")
    @ResponseBody
    public Object editOneDpm(DepartmentDB departmentDB) {int check = schoolManageService.checkOneDpm(departmentDB);
        if (check > 0) {return false;} else {int r = schoolManageService.editOneDpm(departmentDB);
            if (r == 1) {return true;} else {return false;}
        }
    }

    /******************************************************************* 业余治理 *********************************************************************/

    /**
     * 增加业余
     */
    @RequestMapping("addonemajor")
    @ResponseBody
    public Object addOneMajor(MajorDB majorDB) {int check = schoolManageService.checkOneMajor(majorDB);
        if (check > 0) {return false;} else {int r = schoolManageService.addOneMajor(majorDB);
            if (r == 1) {return true;} else {return false;}
        }
    }

    /**
     * 获取业余列表
     */
    @RequestMapping("findallmajor")
    @ResponseBody
    public Object findAllMajor(SchoolManageVO schoolManageVO, Integer page, Integer limit) {PageHelper.startPage(page, limit);
        List<SchoolManageVO> listAll = schoolManageService.findAllMajor(schoolManageVO);
        PageInfo pageInfo = new PageInfo(listAll);
        Map<String, Object> majorData = new HashMap<String, Object>();
        majorData.put("code", 0);
        majorData.put("msg", "");
        majorData.put("count", pageInfo.getTotal());
        majorData.put("data", pageInfo.getList());
        return majorData;
    }

    /**
     * 编辑业余
     */
    @RequestMapping("editonemajor")
    @ResponseBody
    public Object editOneMajor(MajorDB majorDB) {int check = schoolManageService.checkOneMajor(majorDB);
        if (check > 0) {return false;} else {int r = schoolManageService.editOneMajor(majorDB);
            if (r == 1) {return true;} else {return false;}
        }
    }

    /******************************************************************* 年级治理 *********************************************************************/

    /**
     * 增加年级
     */
    @RequestMapping("addonegrade")
    @ResponseBody
    public Object addOneGrade(GradeDB gradeDB) {int check = schoolManageService.checkOneGrade(gradeDB);
        if (check > 0) {return false;} else {int r = schoolManageService.addOneGrade(gradeDB);
            if (r == 1) {return true;} else {return false;}
        }
    }

    /**
     * 获取年级列表
     */
    @RequestMapping("findallgrade")
    @ResponseBody
    public Object findAllGrade(SchoolManageVO schoolManageVO, Integer page, Integer limit) {PageHelper.startPage(page, limit);
        List<SchoolManageVO> listAll = schoolManageService.findAllGrade(schoolManageVO);
        PageInfo pageInfo = new PageInfo(listAll);
        Map<String, Object> gradeData = new HashMap<String, Object>();
        gradeData.put("code", 0);
        gradeData.put("msg", "");
        gradeData.put("count", pageInfo.getTotal());
        gradeData.put("data", pageInfo.getList());
        return gradeData;
    }

    /**
     * 级联获取业余列表
     */
    @RequestMapping("jlselmajor")
    @ResponseBody
    public Object jlSelMajor(SchoolManageVO schoolManageVO, Integer page, Integer limit) {PageHelper.startPage(page, limit);
        List<SchoolManageVO> listAll = schoolManageService.jlSelMajor(schoolManageVO);
        PageInfo pageInfo = new PageInfo(listAll);
        Map<String, Object> jlmajorData = new HashMap<String, Object>();
        jlmajorData.put("code", 0);
        jlmajorData.put("msg", "");
        jlmajorData.put("count", pageInfo.getTotal());
        jlmajorData.put("data", pageInfo.getList());
        return jlmajorData;
    }

    /**
     * 编辑年级
     */
    @RequestMapping("editonegrade")
    @ResponseBody
    public Object editOneGrade(GradeDB gradeDB) {int check = schoolManageService.checkOneGrade(gradeDB);
        if (check > 0) {return false;} else {int r = schoolManageService.editOneGrade(gradeDB);
            if (r == 1) {return true;} else {return false;}
        }
    }

/******************************************************************* 年级治理 *********************************************************************/

    /**
     * 增加班级
     */
    @RequestMapping("addoneclass")
    @ResponseBody
    public Object addOneClass(ClassinfoDB classinfoDB) {int check = schoolManageService.checkOneClass(classinfoDB);
        if (check > 0) {return false;} else {int r = schoolManageService.addOneClass(classinfoDB);
            if (r == 1) {return true;} else {return false;}
        }
    }

    /**
     * 获取班级列表
     */
    @RequestMapping("findallclass")
    @ResponseBody
    public Object findAllClass(SchoolManageVO schoolManageVO, Integer page, Integer limit) {PageHelper.startPage(page, limit);
        List<SchoolManageVO> listAll = schoolManageService.findAllClass(schoolManageVO);
        PageInfo pageInfo = new PageInfo(listAll);
        Map<String, Object> classData = new HashMap<String, Object>();
        classData.put("code", 0);
        classData.put("msg", "");
        classData.put("count", pageInfo.getTotal());
        classData.put("data", pageInfo.getList());
        return classData;
    }

    /**
     * 级联获取年级列表
     */
    @RequestMapping("jlselgrade")
    @ResponseBody
    public Object jlSelGrade(SchoolManageVO schoolManageVO, Integer page, Integer limit) {PageHelper.startPage(page, limit);
        List<SchoolManageVO> listAll = schoolManageService.jlSelGrade(schoolManageVO);
        PageInfo pageInfo = new PageInfo(listAll);
        Map<String, Object> jlgradeData = new HashMap<String, Object>();
        jlgradeData.put("code", 0);
        jlgradeData.put("msg", "");
        jlgradeData.put("count", pageInfo.getTotal());
        jlgradeData.put("data", pageInfo.getList());
        return jlgradeData;
    }

    /**
     * 编辑班级
     */
    @RequestMapping("editoneclass")
    @ResponseBody
    public Object editOneClass(ClassinfoDB classinfoDB) {int check = schoolManageService.checkOneClass(classinfoDB);
        if (check > 0) {return false;} else {int r = schoolManageService.editOneClass(classinfoDB);
            if (r == 1) {return true;} else {return false;}
        }
    }

/******************************************************************* 条件查问 *********************************************************************/

    /**
     * 条件查问班级
     */
    @RequestMapping("tjselclass")
    @ResponseBody
    public Object tjSelClass(SchoolManageVO schoolManageVO, Integer page, Integer limit) {PageHelper.startPage(page, limit);
        List<SchoolManageVO> listAll = schoolManageService.tjSelClass(schoolManageVO);
        PageInfo pageInfo = new PageInfo(listAll);
        Map<String, Object> classData = new HashMap<String, Object>();
        classData.put("code", 0);
        classData.put("msg", "");
        classData.put("count", pageInfo.getTotal());
        classData.put("data", pageInfo.getList());
        return classData;
    }

    /**
     * 条件查问系部
     */
    @RequestMapping("tjseldpm")
    @ResponseBody
    public Object tjSelDpm(SchoolManageVO schoolManageVO, Integer page, Integer limit) {PageHelper.startPage(page, limit);
        List<SchoolManageVO> listAll = schoolManageService.tjSelDpm(schoolManageVO);
        PageInfo pageInfo = new PageInfo(listAll);
        Map<String, Object> dpmData = new HashMap<String, Object>();
        dpmData.put("code", 0);
        dpmData.put("msg", "");
        dpmData.put("count", pageInfo.getTotal());
        dpmData.put("data", pageInfo.getList());
        return dpmData;
    }

    /**
     * 条件查问业余
     */
    @RequestMapping("tjselmajor")
    @ResponseBody
    public Object tjSelMajor(SchoolManageVO schoolManageVO, Integer page, Integer limit) {PageHelper.startPage(page, limit);
        List<SchoolManageVO> listAll = schoolManageService.tjSelMajor(schoolManageVO);
        PageInfo pageInfo = new PageInfo(listAll);
        Map<String, Object> majorData = new HashMap<String, Object>();
        majorData.put("code", 0);
        majorData.put("msg", "");
        majorData.put("count", pageInfo.getTotal());
        majorData.put("data", pageInfo.getList());
        return majorData;
    }

    /**
     * 条件查问年级
     */
    @RequestMapping("tjselgrade")
    @ResponseBody
    public Object tjSelGrade(SchoolManageVO schoolManageVO, Integer page, Integer limit) {PageHelper.startPage(page, limit);
        List<SchoolManageVO> listAll = schoolManageService.tjSelGrade(schoolManageVO);
        PageInfo pageInfo = new PageInfo(listAll);
        Map<String, Object> gradeData = new HashMap<String, Object>();
        gradeData.put("code", 0);
        gradeData.put("msg", "");
        gradeData.put("count", pageInfo.getTotal());
        gradeData.put("data", pageInfo.getList());
        return gradeData;
    }

}

起源:https://blog.csdn.net/biyeshe…

近期热文举荐:

1.1,000+ 道 Java 面试题及答案整顿 (2022 最新版)

2. 劲爆!Java 协程要来了。。。

3.Spring Boot 2.x 教程,太全了!

4. 别再写满屏的爆爆爆炸类了,试试装璜器模式,这才是优雅的形式!!

5.《Java 开发手册(嵩山版)》最新公布,速速下载!

感觉不错,别忘了顺手点赞 + 转发哦!

正文完
 0