——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明




基于javaweb的SSM驾校管理系统(java+ssm+mysql+jsp)
管理员:admin 密码:123456
学员:zhangsan 密码:123456
教员:T102 密码:123456
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| model.addAttribute("count", count); return "/jsp/student_assment.jsp"; }
@RequestMapping("/student/toTargetStudentAssmentList") public void toTargetStudentAssmentList(Integer Page, HttpServletRequest request, PrintWriter pw) { System.out.println(Page + "<<<<<<<<<------"); int startNum = (Page - 1) * 4; HttpSession session = request.getSession(); String userAccount = (String) session.getAttribute("account"); List<TeacherAssment> list = ts.getStudentAssmentByStuId(userAccount, startNum, 4); Map<String, Object> map = new HashMap<String, Object>(); map.put("list", list); ObjectMapper om = new ObjectMapper(); try { String jsonString = om.writeValueAsString(map); pw.write(jsonString); pw.flush(); pw.close(); } catch (JsonProcessingException e) { e.printStackTrace(); } return; }
@RequestMapping("/student/studentToAddTeacherAssmentInfo") public void toAddTeacherAssmentInfoById(HttpServletRequest request, TeacherAssment teacherAssment, PrintWriter pw) { boolean flag = false; HttpSession session = request.getSession(); String userAccount = (String) session.getAttribute("account");
TeacherAssment temp = ts.checkExist(teacherAssment.getTea_id(), teacherAssment.getStu_id()); System.out.println("-----******" + temp); if (temp == null) { teacherAssment.setStu_id(userAccount); flag = ts.addTeacherAssment(teacherAssment); }
Map<String, Object> map = new HashMap<String, Object>(); map.put("flag", flag); ObjectMapper om = new ObjectMapper(); try { String jsonString = om.writeValueAsString(map);
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
@Controller public class CourseController { @Autowired SchoolCourseService scs; @Autowired CarService cs; @RequestMapping("/course/toCourseList") public String addCourse(Model model,HttpServletRequest request){ HttpSession session=request.getSession(); String userLimit=(String)session.getAttribute("userLimit"); List<SchoolCourse> list=scs.getSchoolCourseList(0 , 3); System.out.println(list.toString()); int count =scs.getCourseCount(); if(count/3<=1){count=2;} model.addAttribute("list" , list); model.addAttribute("count" , count); if(userLimit.equals("学员")){ return "/jsp/school_course.jsp"; }else{ System.out.println("管理员------"); return "/jsp/school_course_car.jsp"; }
}
@RequestMapping("/course/toTargetCoursePage") public void toTargetCourse(Integer Page,PrintWriter pw){
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| pw.write(jsonString); pw.flush(); pw.close(); }catch(JsonProcessingException e){ e.printStackTrace(); } return;
} @RequestMapping("/course/toModSchoolCourseById") public String toModSchoolCourseById(String keywords,Model model){ SchoolCourse schoolCourse=scs.getSignalSchoolCourseById(keywords); model.addAttribute("schoolCourse" , schoolCourse); System.out.println("获取到的信息-----"+schoolCourse); return"/jsp/school_course_mod.jsp";
} @RequestMapping("/course/ModSchoolCourseById") public String toModSchoolCourseById(SchoolCourse schoolCourse,Model model){ System.out.println("更新----"+schoolCourse); scs.updateSchoolCourseById(schoolCourse); return"redirect:/course/toCourseList";
} @RequestMapping("/course/getSignalSchoolCourse") public void getSignalSchoolCourse(String keywords,PrintWriter pw){
SchoolCourse schoolCourse=scs.getSignalSchoolCourseById(keywords); Map<String,Object> map=new HashMap<String,Object>(); map.put("schoolCourse" , schoolCourse); ObjectMapper om=new ObjectMapper(); try{ String jsonString =om.writeValueAsString(map); pw.write(jsonString); pw.flush(); pw.close(); }catch(JsonProcessingException e){ e.printStackTrace(); } return;
}
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| @RequestMapping("/stu/modifyScore") public void modifyScore(Student student, PrintWriter pw) { ObjectMapper om = new ObjectMapper(); Map<String, Object> map = new HashMap<String, Object>(); boolean flag = false; flag = ss.updateScoreInfo(student); System.out.println(flag + "《《《-----"); map.put("flag", flag); String jsonString; try { jsonString = om.writeValueAsString(map); pw.write(jsonString); pw.flush(); pw.close();
} catch (JsonProcessingException e) { e.printStackTrace(); } }
@RequestMapping("/stu/deleteStuScore") public void deleteStuScore(String studentId, Integer courseId, PrintWriter pw) { System.out.println(studentId + "---->" + courseId); ObjectMapper om = new ObjectMapper(); Map<String, Object> map = new HashMap<String, Object>(); boolean flag = false; flag = ss.deleteStuScoreInfo(studentId, courseId); map.put("flag", flag); String jsonString; try { jsonString = om.writeValueAsString(map); pw.write(jsonString); pw.flush(); pw.close();
} catch (JsonProcessingException e) { e.printStackTrace(); } return; }
@RequestMapping("/stu/insertStuScore") public String insertStuScore(Student student, Model model) { String account = student.getStudentId(); Student s = ss.getSignalStudent(account); student.setStudentName(s.getStudentName()); Integer CourseId = student.getCourseId(); boolean flag = ss.insertStuScore(student); List<Student> list = ss.getStuScore(account); model.addAttribute("list", list); model.addAttribute("account", account); return "/jsp/stu_score.jsp"; }
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| car.setCar_owner(teacher.getTea_name()); car.setStartTime(new SimpleDateFormat("yyyy-MM-dd").format(new Date())); cs.addCar(car); flag=ts.addTeacher(teacher); Map<String,Object> map=new HashMap<String,Object>(); map.put("flag" , flag); ObjectMapper om=new ObjectMapper(); try{ String jsonString =om.writeValueAsString(map); pw.write(jsonString); pw.flush(); pw.close(); }catch(JsonProcessingException e){ e.printStackTrace(); } return; }
@RequestMapping("/teacher/getTeacherAssmentList") public String getTeacherAssmentList(HttpServletRequest request,Model model){ HttpSession session=request.getSession(); String userAccount=(String)session.getAttribute("account"); System.out.println("账号"+userAccount); List<TeacherAssment> list=tas.getTeacherAssmentByTeaId(userAccount , 0 , 4); System.out.println("获取信息----"+list); int count=tas.getTeacherAssmentCount(); System.out.println(list.toString()); model.addAttribute("list" , list); model.addAttribute("count" , count); return "/jsp/signal_teacher_assment.jsp"; } @RequestMapping("/teacher/toTargetTeacherAssmentList") public void toTargetTeacherAssmentList(Integer Page,HttpServletRequest request,PrintWriter pw){ System.out.println(Page+"<<<<<<<<<------"); int startNum=(Page-1)*4; HttpSession session=request.getSession(); String userAccount=(String)session.getAttribute("account"); List<TeacherAssment> list=tas.getTeacherAssmentByTeaId(userAccount , startNum, 4); Map<String,Object> map=new HashMap<String,Object>(); map.put("list" , list); ObjectMapper om=new ObjectMapper(); try{ String jsonString =om.writeValueAsString(map); pw.write(jsonString); pw.flush(); pw.close();
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=281723442808201cx
https://javayms.pages.dev?id=281723442808201cx