源码获取:俺的博客首页 "资源" 里下载!
本项目为后台管理系统,分为管理员与学生两种角色;
管理员角色包含以下功能:
管理员登录,管理员管理,修改密码,教师管理,学生管理,评价指标管理,评价结果查看等功能。
学生角色包含以下功能:
学生角色登录,个人信息修改,评价某一个老师等功能。
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.数据库:MySql 5.7版本;
6.是否Maven项目:否;
JSP+CSS+JavaScript+servlet+mysql
1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;
若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中dao/DB.java配置文件中的数据库配置改为自己的配置;
4. 运行项目,输入http://localhost:8080/pingjia 登录
管理员账号/密码:admin/admin
用户账号/密码: liuguangliang/000000
- @Controller
- @RequestMapping("th")
- public class StudentController {
- @Autowired
- private Sysservice sysservice;
- @Autowired
- private Courseresoureservice recoureservice;
- @Autowired
- private Studyrecordservice recordservice;
- @Autowired
- private Batchservice batchservice;
- @Autowired
- private Examscoreservice examxcore;
- //基本信息查询
- @RequestMapping("/studentmessage")
- public String studentmessage(ModelMap map,Sysuser user) {
- Sysuser user1=sysservice.selectone(user);
- map.addAttribute("sysuser", user1);
- return "thymeleaf/student/studentmessage";
- }
- //课件列表
- @RequestMapping("/studentresoure")
- public String studentresoure(ModelMap map,Courseresoure resoure) {
- List<Courseresoure> resoure1=recoureservice.selectresoure(resoure);
- map.addAttribute("courseresoure", resoure1);
- return "thymeleaf/student/studentresoure";
- }
- //学习课件
- @RequestMapping("/study")
- public String study(ModelMap map,Courseresoure resoure) {
- Courseresoure resoure1=recoureservice.resoure(resoure);
- resoure1.setFileName("http://localhost:8081/upload/"+resoure1.getFileName());
- resoure1.setCoverPath("http://localhost:8081/upload/"+resoure1.getCoverPath());
- map.addAttribute("resoure", resoure1);
- return "thymeleaf/student/study";
- }
- //批次信息记录
- @RequestMapping("/batchmessage")
- public String batchmessage(ModelMap map,Studybatch studybatch,Sysuser user,Userbatch userbatch,Coureseresourebatch resoure) {
- Sysuser user1=sysservice.selectone(user);
- map.addAttribute("sysuser", user1);
- List<Studybatch> selectbatch=batchservice.selectbatch(studybatch);
- map.addAttribute("batch", selectbatch);
- Userbatch userbatch1=batchservice.userone(userbatch);
- map.addAttribute("userbatch", userbatch1);
- Coureseresourebatch resoure1=batchservice.resoureone(resoure);
- map.addAttribute("resoure", resoure1);
- return "thymeleaf/student/studybatch";
- }
- //进入学习
- @RequestMapping("/studyview")
- public String studyview(ModelMap map,Studybatch studybatch,Coureseresourebatch resoure1,Courseresoure resoure,Userbatch userbatch) {
- Coureseresourebatch resoure2=batchservice.resoureone(resoure1);
- map.addAttribute("batchresoure", resoure2);
- if(studybatch.getId()==resoure2.getBatchId())
- {
- Courseresoure resoure3=recoureservice.studyresoure(resoure);
- map.addAttribute("recourseview", resoure3);
- Userbatch user1=batchservice.userone(userbatch);
- map.addAttribute("user", user1);
- if(resoure2.getCourseResoureId()==resoure3.getId()) {
- resoure3.setFileName("http://localhost:8081/upload/"+resoure3.getFileName());
- resoure3.setCoverPath("http://localhost:8081/upload/"+resoure3.getCoverPath());
- map.addAttribute("studview", resoure3);
- }
- }
- return "thymeleaf/student/studyview";
- }
- //记录提交
- @RequestMapping("/studyrecord")
- public String studyrecord(ModelMap map,Studyrecord record) {
- recordservice.insertrecord(record);
- return "thymeleaf/error/success";
- }
- //成绩查询
- @RequestMapping("/examscore")
- public String examscore(ModelMap map,Sysuser user,Studybatch studybatch,Examscore score) {
- Sysuser user1=sysservice.selectone(user);
- map.addAttribute("sysuser", user1);
- Studybatch exambatch=batchservice.exambatch(studybatch);
- map.addAttribute("exambatch", exambatch);
- Examscore score1=examxcore.studyscore(score);
- if(user.getId()==score1.getSysUserId()&& exambatch.getId()==score1.getStudyBatchId()) {
-
- map.addAttribute("scoreexam", score1);
- }
- return "thymeleaf/student/studyrecord";
- }
- }
- @Controller
- @RequestMapping("th")
- public class RoleController {
- @Autowired
- private Sysroleservice roleservice;
- //角色列表
- @RequestMapping("/listrole")
- public String selectRole(ModelMap map,Sysrole role) {
- List<Sysrole> role1=roleservice.selectRole(role);
- System.out.println(role1);
- map.addAttribute("sysrole", role1);
- return "thymeleaf/role/listrole";
- }
- //修改状态
- @RequestMapping("/updaterolez")
- public String updatez(ModelMap map,Sysrole role) {
- Sysrole role1=roleservice.selectone(role);
- int Status=role1.getStatus();
- int Id=role1.getId();
- System.out.println(role1.getStatus());
- if(Status==0)
- {
- Status=Status+1;
- }
- else {
- Status=Status-1;
- }
- roleservice.updatez(Status, Id);
- map.addAttribute("sysrole", role1);
- return "thymeleaf/error/success";
- }
- //修改角色界面
- @RequestMapping("/updatej")
- public String updatej(Sysrole role,ModelMap map) {
- Sysrole role1=roleservice.selectone(role);
- map.addAttribute("sysrole", role1);
- return "thymeleaf/role/updaterole";
- }
- //修改提交页面
- @RequestMapping(value="/updatemj")
- public String updatemj(Sysrole role,ModelMap map) {
- Sysrole role1=roleservice.selectone(role);
- roleservice.update(role);
- map.addAttribute("sysrole", role1);
- return "thymeleaf/error/success";
- }
- //删除角色
- @RequestMapping("/deleterole")
- public String deleterole(Sysrole role,ModelMap map) {
- Sysrole role1=roleservice.selectone(role);
- roleservice.deleterole(role);
- map.addAttribute("sysrole", role1);
- return "thymeleaf/error/success";
- }
- //添加角色界面
- @RequestMapping("/addrole")
- public String addrole(Sysrole role,ModelMap map) {
- return "thymeleaf/role/addrole";
- }
- //提交增加页面
- @RequestMapping("/addrolet")
- public String addrolet(Sysrole role,ModelMap map) {
- roleservice.addrole(role);
- return "thymeleaf/error/success";
- }
- }
- @Controller
- @RequestMapping("th")
- public class LoginController {
- @Autowired
- private Sysservice sysservice;
- //登录页面
- @RequestMapping("/login")
- public String index(ModelMap map) {
- return "thymeleaf/login/login";
- }
- @RequestMapping("/error")
- public String error(ModelMap map) {
- return "thymeleaf/error/error";
- }
- //注册页面
- @RequestMapping("/regiest")
- public String regiest(ModelMap map) {
- return "thymeleaf/login/regiest";
- }
- //提交注册页面
- @RequestMapping(value ="/regiest1")
- public String regiest1(ModelMap map,Sysuser user) {
- int user1=sysservice.addUser(user);
- map.addAttribute("sysuser", user1);
- return "thymeleaf/error/success";
- }
- //传值进入修改密码界面
- @RequestMapping("/updateps")
- public String selectone(Sysuser user,ModelMap map) {
- Sysuser user1=sysservice.selectone(user);
- map.addAttribute("sysuser", user1);
- return "thymeleaf/user/updateps";
- }
- //提交修改密码界面
- @RequestMapping(value ="/updateps1")
- public String updateps(Sysuser user,ModelMap map) {
- Sysuser user1=sysservice.selectone(user);
- sysservice.updateps(user);
- map.addAttribute("sysuser", user1);
- return "thymeleaf/error/success";
- }
- //用户列表
- @RequestMapping("/listuser")
- public String listuser(ModelMap map,Sysuser user) {
- List<Sysuser> user1=sysservice.selectUser(user);
- map.addAttribute("sysuser", user1);
- return "thymeleaf/user/listuser";
- }
- //提交登录界面
- @RequestMapping(value = "/login1")
- public String login(Sysuser user,ModelMap map,Studybatch studybatch){
- Sysuser user1 = sysservice.login(user);
- System.out.println(user1);
- System.out.println(user1.getName());
- System.out.println(user1.getId());
- System.out.println(user1.getStatus());
- if(user1.getStatus()==0 ) {
- if(user1.getPermission()==1)
- {
- map.addAttribute("sysuser", user1);
- return "thymeleaf/user/userindex";
- }
- else {
- map.addAttribute("sysuser", user1);
- return "thymeleaf/student/studentindex";
- }
- }
- else if(user1.getStatus()==1) {
-
- return "thymeleaf/error/error";
-
- }
- return null;
- }
- //删除用户
- @RequestMapping("/delete")
- public String delete(Sysuser user,ModelMap map) {
- Sysuser user1=sysservice.selectone(user);
- sysservice.deleteUser(user);
- map.addAttribute("sysuser", user1);
- return "thymeleaf/error/success";
- }
- //修改用户界面
- @RequestMapping("/updatem")
- public String updatem(Sysuser user,ModelMap map) {
- Sysuser user1=sysservice.selectone(user);
- map.addAttribute("sysuser", user1);
- return "thymeleaf/user/updatemessage";
- }
- //修改提交页面
- @RequestMapping(value="/updatems")
- public String updatems(Sysuser user,ModelMap map) {
- Sysuser user1=sysservice.selectone(user);
- sysservice.updatems(user);
- map.addAttribute("sysuser", user1);
- return "thymeleaf/error/success";
- }
- //修改状态
- @RequestMapping("/updatez")
- public String updatez(ModelMap map,Sysuser user) {
- Sysuser user1=sysservice.selectone(user);
- int Status=user1.getStatus();
- int Id=user1.getId();
- System.out.println(user1.getStatus());
- if(Status==0)
- {
- Status=Status+1;
- }
- else {
- Status=Status-1;
- }
- sysservice.updatez(Status, Id);
- map.addAttribute("sysuser", user1);
- return "thymeleaf/error/success";
- }
- //添加用户页面
- @RequestMapping("/adduser")
- public String adduser(Sysuser user,ModelMap map) {
- return "thymeleaf/user/adduser";
- }
-
- //提交用户页面
- @RequestMapping("/addsysuser")
- public String addsysuser(Sysuser user,ModelMap map) {
- sysservice.addsysuser(user);
- return "thymeleaf/error/success";
- }
-
-
- }
- @Controller
- @RequestMapping("th")
- public class CourseController {
- @Autowired
- private Courseinfoservice courseservice;
- //课程列表
- @RequestMapping("/listcourse")
- public String selectRole(ModelMap map,Courseinfo course) {
- List<Courseinfo> course1=courseservice.selectcourse(course);
- System.out.println(course1);
- map.addAttribute("courseinfo", course1);
- return "thymeleaf/course/listcourse";
- }
- //添加课程页面
- @RequestMapping("/addcourse")
- public String addcourse(Courseinfo course,ModelMap map) {
- return "thymeleaf/course/addcourse";
- }
- //提交添加课程页面
- @RequestMapping("/addcourse1")
- public String addcourse1(Courseinfo course,ModelMap map) {
- System.out.println(course);
- courseservice.addcourse(course);
- return "thymeleaf/error/success";
- }
- //删除
- @RequestMapping("/deletecourse")
- public String deletecourse(Courseinfo course,ModelMap map) {
- Courseinfo course1=courseservice.selecto(course);
- courseservice.deletecourse(course);
- map.addAttribute("courseinfo", course1);
- return "thymeleaf/error/success";
- }
- //修改界面
- @RequestMapping("/updatecourse")
- public String updatecourse(Courseinfo course,ModelMap map) {
- Courseinfo course1=courseservice.selecto(course);
- map.addAttribute("courseinfo",course1);
- return "thymeleaf/course/updatecourse";
- }
- //提交修改界面
- @RequestMapping("/updatecourse1")
- public String updatecourse1(Courseinfo course,ModelMap map) {
- Courseinfo course1=courseservice.selecto(course);
- courseservice.updatecourse(course);
- map.addAttribute("courseinfo",course1);
- return "thymeleaf/error/success";
- }
- }
源码获取:俺的博客首页 "资源" 里下载!