文章详情

短信预约-IT技能 免费直播动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

Java 实战项目基于遗传算法学校排课系统的实现流程

2024-04-02 19:55

关注

一、项目简述

本系统功能包括:
排课管理,课程管理,讲师管理,班级管理,学生管理,教学资料,学习文档,在线测试,教材列表,教学设计,帮助中心等等功能。

二、项目运行

环境配置:

Jdk1.8 + Tomcat8.5 + Mysql + HBuilderX(Webstorm也行)+ Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)。

项目技术:

Springboot + Maven + mybatis+ Vue 等等组成,B/S模式 + Maven管理等等。

管理员控制器:



@RestController
public class AdminController {
 
    @Resource(name = "adminService")
    private IAdminService adminService;
 
    
    @RequestMapping(value = "/admin/qryPage", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.admin})
    public ListResult<Admin> qryPage(HttpRequest request) {
        Map<String, Object> param = new HashMap<>();
        int pageNo = request.containsKey("page_no") ? request.getInteger("page_no") : 1;
        int pageSize = request.containsKey("page_size") ? request.getInteger("page_size") : 20;
        if (request.containsKey("login_name")) {
            param.put("login_name", request.getString("login_name"));
        }
        if (request.containsKey("name")) {
            param.put("name", request.getString("name"));
        }
        return adminService.qryPage(param, pageNo, pageSize);
    }
 
    
    @RequestMapping(value = "/admin/add", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.admin})
    public Result<Admin> insert(HttpRequest request) {
        Admin admin = new Admin();
        admin.setLoginName(request.getString("login_name"));
        admin.setName(request.getString("admin_name"));
        admin.setPwd(request.getString("login_name"));
        admin.setSex(request.getInteger("sex"));
        admin.setUpdateTime(new Date());
        return adminService.insert(admin, ImageUtil.stringToBytes(request.getString("admin_image")));
    }
 
    
    @RequestMapping(value = "/admin/update", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.admin})
    public Result<Admin> update(HttpRequest request) {
        Admin admin = new Admin();
        admin.setLoginName(request.getString("login_name"));
        admin.setName(request.getString("admin_name"));
        admin.setPwd(request.getString("login_name"));
        admin.setSex(request.getInteger("sex"));
        admin.setUpdateTime(new Date());
        return adminService.update(admin, ImageUtil.stringToBytes(request.getString("admin_image")));
    }
 
    
    @RequestMapping(value = "/admin/del", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.admin})
    public Result<Admin> del(HttpRequest request) {
        List<String> adminIdList = new ArrayList<>();
        JSONArray array = request.getJSONArray("admin_id_list");
        for (int i = 0; i < array.size(); i++) {
            adminIdList.add(array.getString(i));
        }
        return adminService.del(adminIdList);
    }
}

学生控制器:



@RestController
public class StudentController {
 
    @Resource(name = "studentService")
    private IStudentService studentService;
 
    
    @RequestMapping(value = "/student/qryPage", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.admin})
    public ListResult<Student> qryPage(HttpRequest request) {
        Map<String, Object> param = new HashMap<>();
        int pageNo = request.containsKey("page_no") ? request.getInteger("page_no") : 1;
        int pageSize = request.containsKey("page_size") ? request.getInteger("page_size") : 20;
        if (request.containsKey("student_id")) {
            param.put("student_id", request.getString("student_id"));
        }
        if (request.containsKey("name")) {
            param.put("name", request.getString("name"));
        }
        return studentService.qryPage(param, pageNo, pageSize);
    }
 
    @RequestMapping(value = "/student/add", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.admin})
    public Result<Student> insert(HttpRequest request) {
        Student student = new Student();
        student.setStudentId(request.getString("student_id"));
        student.setName(request.getString("student_name"));
        student.setPwd(request.getString("student_id"));
        student.setSex(request.getInteger("sex"));
        student.setClassId(request.getString("class_id"));
        student.setUpdateTime(new Date());
        return studentService.insert(student, ImageUtil.stringToBytes(request.getString("student_image")));
    }
 
    @RequestMapping(value = "/student/update", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.admin})
    public Result<Student> update(HttpRequest request) {
        Student student = new Student();
        student.setStudentId(request.getString("student_id"));
        student.setName(request.getString("student_name"));
        student.setPwd(request.getString("student_id"));
        student.setSex(request.getInteger("sex"));
        student.setClassId(request.getString("class_id"));
        student.setUpdateTime(new Date());
        return studentService.update(student, ImageUtil.stringToBytes(request.getString("student_image")));
    }
 
    @RequestMapping(value = "/student/del", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.admin})
    public Result<Student> del(HttpRequest request) {
        List<String> studentIdList = new ArrayList<>();
        JSONArray array = request.getJSONArray("student_id_list");
        for (int i = 0; i < array.size(); i++) {
            studentIdList.add(array.getString(i));
        }
        return studentService.del(studentIdList);
    }
 
 
}

教师控制器:



@RestController
public class TeacherController {
 
    @Resource(name = "teacherService")
    private ITeacherService teacherService;
 
    
    @RequestMapping(value = "/teacher/qryPage", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.admin})
    public ListResult<Teacher> qryPage(HttpRequest request) {
        Map<String, Object> param = new HashMap<>();
        int pageNo = request.containsKey("page_no") ? request.getInteger("page_no") : 1;
        int pageSize = request.containsKey("page_size") ? request.getInteger("page_size") : 20;
        if (request.containsKey("teacher_id")) {
            param.put("teacher_id", request.getString("teacher_id"));
        }
        if (request.containsKey("name")) {
            param.put("name", request.getString("name"));
        }
        return teacherService.qryPage(param, pageNo, pageSize);
    }
 
    
    @RequestMapping(value = "/teacher/add", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.admin})
    public Result<Teacher> insert(HttpRequest request) {
        Teacher teacher = new Teacher();
        teacher.setTeacherId(request.getString("teacher_id"));
        teacher.setName(request.getString("teacher_name"));
        teacher.setPwd(request.getString("teacher_id"));
        teacher.setSex(request.getInteger("sex"));
        teacher.setUpdateTime(new Date());
        return teacherService.insert(teacher, ImageUtil.stringToBytes(request.getString("teacher_image")));
    }
 
    
    @RequestMapping(value = "/teacher/update", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.admin})
    public Result<Teacher> update(HttpRequest request) {
        Teacher teacher = new Teacher();
        teacher.setTeacherId(request.getString("teacher_id"));
        teacher.setName(request.getString("teacher_name"));
        teacher.setPwd(request.getString("teacher_id"));
        teacher.setSex(request.getInteger("sex"));
        teacher.setUpdateTime(new Date());
        return teacherService.update(teacher, ImageUtil.stringToBytes(request.getString("teacher_image")));
    }
 
    
    @RequestMapping(value = "/teacher/del", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.admin})
    public Result<Teacher> del(HttpRequest request) {
        List<String> teacherIdList = new ArrayList<>();
        JSONArray array = request.getJSONArray("teacher_id_list");
        for (int i = 0; i < array.size(); i++) {
            teacherIdList.add(array.getString(i));
        }
        return teacherService.del(teacherIdList);
    }
 
    
    @RequestMapping(value = "/teacher/qryAllList", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.admin})
    public ListResult<Teacher> qryAllList() {
        return teacherService.qryAllList();
    }
}

到此这篇关于Java 实战项目基于遗传算法学校排课系统的实现流程的文章就介绍到这了,更多相关Java 排课系统内容请搜索编程网以前的文章或继续浏览下面的相关文章希望大家以后多多支持编程网!

阅读原文内容投诉

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     813人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     354人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     318人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     435人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     224人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-后端开发
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯