基于javaweb+mysql的ssm+maven高校运动会管理系统(java+ssm+jsp+js+jquery+mysql)
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的SSM+Maven高校运动会管理系统(java+ssm+jsp+js+jquery+mysql)
项目介绍
该高校运动会信息管理系统是以B/S架构为设计基础并基于SSM框架开发的系统。系统采用了Java语言和MySQL数据库来实现。 系统按预定的算法完成了创办运动会、广播公告公示、赛事项目拟订、报名参赛、赛后成绩录入、查看比赛成绩、院系人员的信息存储、反馈建议、访问日记等功能。
主要功能:
1.完成校运动会项目管理。具体包括项目的新增、修改、查询等功能。项目信息包括项目编号、项目名称、项目类别(男、女)、项目性质(团体、个人)等 2.完成运动员信息的管理。具体包括运动员信息的新增、修改、查询、删除等功能。运动员信息包括运动员编号、姓名、所在班级、性别等; 3.报名管理。完成运动员选择参赛项目的过程。 本项目分为管理员、教师、学生三种角色;
环境需要
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项目:是;
技术栈
- 后端:Spring+SpringMVC+Mybatis 2. 前端:JSP+CSS+JavaScript+jQuery
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中dbconfig.properties配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入http://localhost:8080/ 登录
return mv;
}
/**
* 删除教师信息
*
* @param tId
* @return
*/
@RequestMapping("/deleteByPK.do")
public String deleteByIds(Integer[] tId) {
teacherService.deleteByPK(tId);
return "redirect:findAll.do";
}
/**
* 根据ID查找教师信息到模态框上
*
* @param id
* @return
*/
@RequestMapping(value = "/findById.do", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
@ResponseBody
public Teacher findById(@RequestParam(name = "id") Integer id) {
return teacherService.findById(id);
}
/**
* 插入教师
*
* @param teacher
* @return
*/
@RequestMapping(value = "/insert.do", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
@ResponseBody
public String insert(@RequestBody Teacher teacher) {
try {
teacherService.insert(teacher);
} catch (Exception e) {
return "新增失败!";
}
return "200";
}
/**
* 修改教师信息
*
* @param teacher
* @return
*/
@RequestMapping(value = "/update.do", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
/**
* 遍历所有学生信息到选择框里
*
* @return
*/
@RequestMapping(value = "/findAllStudents.do", produces = "application/json; charset=utf-8")
@ResponseBody
public List<Student> findAllStudents() {
return studentService.findAllStudents();
}
/**
* 导出学生信息到Excel
*
* @param response
* @throws Exception
*/
@RequestMapping("/exportToExcel.do")
public void exportExcelStyle(HttpServletResponse response) throws Exception {
List<Student> students = studentService.exportExcel();
ExcelExportUtil excelExportUtil = new ExcelExportUtil();
Map<String, Object> params = new HashMap<String, Object>();
params.put("classFilePath", "excel/template.xlsx");
params.put("styleIndex", 1);
params.put("rowIndex", 2);
params.put("objs", students);
params.put("fileName", "学生表.xlsx");
excelExportUtil.export(response, params);
}
@RequestMapping("/uploadExcel")
public String fileUpload(MultipartFile uploadFile, Model model){
try {
ExcelImportUtil<Student> excelImportUtil=new ExcelImportUtil<>();
List<Student> students = excelImportUtil.excelImportUtil(uploadFile.getInputStream(), Student.class, 1);
studentService.importExcel(students);
model.addAttribute("result","上传成功");
}catch (Exception e){
e.printStackTrace();
model.addAttribute("result","上传失败");
}
return "uploadsuccess";
}
}
/**
* 查询赛事成绩详细信息
*
* @param mId
* @return
*/
@RequestMapping("/findDetailsBymId.do")
public ModelAndView findDetailsBysId(Integer mId) {
ModelAndView mv = new ModelAndView();
Map<String, Object> map = matchesService.findDetailsBymId(mId);
Matches matches = (Matches) map.get("matches");
mv.addObject("matches", matches);
mv.setViewName("matches-details");
return mv;
}
/**
* 学生的参赛列表
*
* @param uId
* @return
*/
@RequestMapping("/myParticipate.do")
public ModelAndView myParticipate(String uId) {
ModelAndView mv = new ModelAndView();
List<Matches> matchesList = matchesService.selectMyParticipate(uId);
mv.addObject("matches", matchesList);
mv.setViewName("user-participate");
return mv;
}
@RequestMapping("/concle.do")
public void concle(Integer id){
matchesService.concle(id);
}
/**
* 成绩管理页面
*
* @return
*/
@RequestMapping("/manage.do")
public ModelAndView manage() {
ModelAndView mv = new ModelAndView();
List<Matches> matchesList = matchesService.findAll();
mv.addObject("matches", matchesList);
mv.setViewName("matches-manage");
return mv;
}
/**
* 成绩信息插入
mv.addObject("matchesList", matchesList);
mv.addObject("event", event);
mv.setViewName("event-manage-details");
return mv;
}
/**
* 成绩录入
*
* @param eId
* @return
*/
@RequestMapping("/matchesInput.do")
public ModelAndView matchesInput(Integer eId) {
ModelAndView mv = new ModelAndView();
Map<String, Object> map = eventService.findDetailsByeId(eId);
Event event = (Event) map.get("event");
List<Matches> matchesList = (List<Matches>) map.get("matchesList2");
mv.addObject("matchesList", matchesList);
mv.addObject("event", event);
mv.setViewName("matches-manage-input");
return mv;
}
/**
* 学生参赛项目列表
*
* @param uId
* @return
*/
@RequestMapping("/participateEvent.do")
public ModelAndView participateEvent(String uId) {
ModelAndView mv = new ModelAndView();
List<Event> eventList = eventService.findNewAll(uId);
mv.addObject("event", eventList);
mv.setViewName("participateEvent-list");
return mv;
}
/**
* @param Id
* @param uStatus
* @return
*/
@RequestMapping("/updateUstatus.do")
public String updateUstatus(String Id, Boolean uStatus) {
userService.updateUstatus(Id, uStatus);
return "redirect:user.do";
}
/**
* 批量修改用户状态为开启
*
* @param Id
* @return
*/
@RequestMapping("/updateUstatusOn.do")
public String updateUstatusOn(String[] Id) {
userService.updateUstatusOn(Id);
return "redirect:user.do";
}
/**
* 批量修改用户状态为关闭
*
* @param Id
* @return
*/
@RequestMapping("/updateUstatusOff.do")
public String updateUstatusOff(String[] Id) {
userService.updateUstatusOff(Id);
return "redirect:user.do";
}
}
return "200";
}
/**
* 修改运动会开幕信息
*
* @param sportmeeting
* @return
*/
@RequestMapping(value = "/update.do", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
@ResponseBody
public String update(@RequestBody Sportmeeting sportmeeting) {
System.out.println(sportmeeting);
try {
sportmeetingService.update(sportmeeting);
} catch (Exception e) {
return "修改失败!";
}
return "200";
}
/**
* 运动会开幕信息管理页面
*
* @return
*/
@RequestMapping("/manage.do")
public ModelAndView add() {
ModelAndView mv = new ModelAndView();
List<Sportmeeting> sportmeetingList = sportmeetingService.findAll();
mv.addObject("sportmeeting", sportmeetingList);
mv.setViewName("sportmeeting-manage");
return mv;
}
/**
* 运动会开幕信息导出
*
* @param response
* @throws Exception
*/
@RequestMapping("/export.do")
public void exportExcelStyle(HttpServletResponse response) throws Exception {
List<Sportmeeting> sportmeetings = sportmeetingService.exportExcel();
ExcelExportUtil excelExportUtil = new ExcelExportUtil();
Map<String, Object> params = new HashMap<String, Object>();
params.put("classFilePath", "/excel/template.xlsx");
params.put("styleIndex", 2);
params.put("rowIndex", 2);
params.put("objs", sportmeetings);
params.put("fileName", "s.xlsx");
excelExportUtil.export(response, params);
}
ModelAndView mv = new ModelAndView();
List<Teacher> teacherList = teacherService.findAll();
mv.addObject("teacher", teacherList);
mv.setViewName("teacher-list");
return mv;
}
/**
* 查询教师详细信息
*
* @param tId
* @return
*/
@RequestMapping("/findDetailsBytId.do")
public ModelAndView findDetailsBytId(Integer tId) {
ModelAndView mv = new ModelAndView();
Map<String, Object> map = teacherService.findDetailsBytId(tId);
Teacher teacher = (Teacher) map.get("teacher");
List<Student> studentList = (List<Student>) map.get("studentList");
List<Borrow> borrowList = (List<Borrow>) map.get("borrowList");
mv.addObject("teacher", teacher);
mv.addObject("studentList", studentList);
mv.addObject("borrowList", borrowList);
mv.setViewName("teacher-details");
return mv;
}
/**
* 删除教师信息
*
* @param tId
* @return
*/
@RequestMapping("/deleteByPK.do")
public String deleteByIds(Integer[] tId) {
teacherService.deleteByPK(tId);
return "redirect:findAll.do";
}
/**
* 根据ID查找教师信息到模态框上
mv.addObject("classesList", classesList);
mv.setViewName("department-details");
return mv;
}
/**
* 遍历所有院系信息
*
* @return
*/
@RequestMapping(value = "/findAllDepts.do", produces = "application/json; charset=utf-8")
@ResponseBody
public List<Department> findAllDepts() {
return departmentService.findAllDepts();
}
/**
* 根据id查询出院系信息,获取信息到模态框上
*
* @param id
* @return
*/
@RequestMapping(value = "/findById.do", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
@ResponseBody
public Department findById(@RequestParam(name = "id") Integer id) {
return departmentService.findById(id);
}
/**
* 插入院系
*
* @param department
* @return
*/
@RequestMapping(value = "/insert.do", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
@ResponseBody
public String insert(@RequestBody Department department) {
try {
departmentService.insert(department);
} catch (Exception e) {
return "新增失败!";
}
public String update(@RequestBody Matches matches) {
try {
matchesService.update(matches);
} catch (Exception e) {
return "修改失败!";
}
return "200";
}
/**
* 根据id过去成绩信息到模态框
*
* @param id
* @return
*/
@RequestMapping(value = "/findById.do", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
@ResponseBody
public Matches findById(@RequestParam(name = "id") Integer id) {
return matchesService.findById(id);
}
/**
* 删除成绩信息
*
* @param id
* @return
*/
@RequestMapping("/deleteById.do")
public String deleteByIds(Integer[] id) {
matchesService.deleteById(id);
return "redirect:manage.do";
}
/**
* 成绩录入
*
* @return
*/
@RequestMapping("/input.do")
public ModelAndView input() {
ModelAndView mv = new ModelAndView();
List<Event> eventList = eventService.findNoScore();
mv.addObject("event", eventList);
mv.setViewName("matches-input");
return mv;
private ISysLogService sysLogService;
/**
* 系统日记页面
*
* @return
* @throws Exception
*/
@RequestMapping("/findAll.do")
public ModelAndView findAll() throws Exception {
ModelAndView mv = new ModelAndView();
List<SysLog> sysLogs = sysLogService.findAll();
mv.addObject("sysLogs", sysLogs);
mv.setViewName("syslog-list");
return mv;
}
/**
* 删除系统日记
*
* @param selectIds
* @return
* @throws Exception
*/
@RequestMapping("/delete.do")
public String delete(String[] selectIds) throws Exception {
sysLogService.delete(selectIds);
return "redirect:findAll.do";
}
}
@Controller
@RequestMapping("/other")
public class OtherController {
@Autowired
private OtherService otherService;
@RequestMapping("/department")
public class DepartmentController {
@Autowired
private DepartmentService departmentService;
/**
* 查询所有院系信息
*
* @return
*/
@RequestMapping("findAll.do")
public ModelAndView findAll() {
ModelAndView mv = new ModelAndView();
List<Department> departmentList = departmentService.findAll();
mv.addObject("departmentList", departmentList);
mv.setViewName("department-list");
return mv;
}
/**
* 删除院系会信息
*
* @param dId
* @return
*/
@RequestMapping("/deleteByPK.do")
public String deleteByIds(Integer[] dId) {
departmentService.deleteByPK(dId);
return "redirect:findAll.do";
}
/**
* 查询院系详细信息
*
* @param dId
* @return
*/
@RequestMapping("/findDetailsBydId.do")
public ModelAndView findDetailsBydId(Integer dId) {
ModelAndView mv = new ModelAndView();
Map<String, Object> map = departmentService.findDetailsBydId(dId);
* @return
*/
@RequestMapping(value = "/insert.do", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
@ResponseBody
public String insert(@RequestBody Matches matches) {
try {
matchesService.insert(matches);
} catch (Exception e) {
return "新增失败!";
}
return "200";
}
/**
* 成绩信息修改
*
* @param matches
* @return
*/
@RequestMapping(value = "/update.do", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
@ResponseBody
public String update(@RequestBody Matches matches) {
try {
matchesService.update(matches);
} catch (Exception e) {
return "修改失败!";
}
return "200";
}
/**
* 根据id过去成绩信息到模态框
*
* @param id
* @return
*/
@RequestMapping(value = "/findById.do", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
@ResponseBody
public Matches findById(@RequestParam(name = "id") Integer id) {
return matchesService.findById(id);
@Controller
@RequestMapping("/equipment")
public class EquipmentController {
@Autowired
private EquipmentService equipmentService;
@Autowired
private BorrowService borrowService;
/**
* 查询所有运动器材信息
*
* @return
*/
@RequestMapping("/findAll.do")
public ModelAndView findAll() {
ModelAndView mv = new ModelAndView();
List<Equipment> equipmentList = equipmentService.findAll();
mv.addObject("equipment", equipmentList);
mv.setViewName("equipment-list");
return mv;
}
/**
* 器材借还记录
*
* @param eId
* @return
*/
@RequestMapping("/findDetailsByeId.do")
public ModelAndView findDetailsByeId(Integer eId) {
ModelAndView mv = new ModelAndView();
List<Borrow> borrowList = borrowService.selectByeId(eId);
mv.addObject("borrow", borrowList);
mv.setViewName("equipment-details");
return mv;
}
return classesService.findAllClasses();
}
/**
* 根据id查找班级信息,获取信息到模态框上
*
* @param id
* @return
*/
@RequestMapping(value = "/findById.do", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
@ResponseBody
public Classes findById(@RequestParam(name = "id") Integer id) {
return classesService.findById(id);
}
/**
* 插入班级信息
*
* @param classes
* @return
*/
@RequestMapping(value = "/insert.do", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
@ResponseBody
public String insert(@RequestBody Classes classes) {
try {
classesService.insert(classes);
} catch (Exception e) {
return "新增失败!";
}
return "200";
}
/**
* 修改班级信息
*
* @param classes
* @return
*/
@RequestMapping(value = "/update.do", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
@ResponseBody
public String update(@RequestBody Classes classes) {
try {
classesService.update(classes);
} catch (Exception e) {
return "修改失败!";
}
/**
* 删除运动会信息
*
* @param sId
* @return
*/
@RequestMapping("/deleteByPK.do")
public void deleteByIds(Integer[] sId) {
sportmeetingService.deleteByPK(sId);
}
/**
* 查询运动会详细信息
*
* @param sId
* @return
*/
@RequestMapping("/findDetailsBysId.do")
public ModelAndView findDetailsBysId(Integer sId) {
ModelAndView mv = new ModelAndView();
Map<String, Object> map = sportmeetingService.findDetailsBysId(sId);
Sportmeeting sportmeeting = (Sportmeeting) map.get("sportmeeting");
List<Broadcast> broadcastList = (List<Broadcast>) map.get("broadcastList");
List<Event> eventList = (List<Event>) map.get("eventList");
List<Matches> matchesList = (List<Matches>) map.get("matchesList");
mv.addObject("event", eventList);
mv.addObject("matches", matchesList);
mv.addObject("broadcast", broadcastList);
mv.addObject("sportmeeting", sportmeeting);
mv.setViewName("sportmeeting-details");
return mv;
}
/**
* 根据id查询项目
*
* @param id
* @return
*/
@RequestMapping(value = "/findBysId.do", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
@ResponseBody
* @return
*/
@RequestMapping(value = "/findById.do", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
@ResponseBody
public Student findById(@RequestParam(name = "id") Integer id) {
return studentService.findById(id);
}
/**
* 插入学生信息
*
* @param student
* @return
*/
@RequestMapping(value = "/insert.do", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
@ResponseBody
public String insert(@RequestBody Student student) {
try {
studentService.insert(student);
} catch (Exception e) {
return "新增失败!";
}
return "200";
}
/**
* 修改学生信息
*
* @param student
* @return
*/
@RequestMapping(value = "/update.do", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
@ResponseBody
public String update(@RequestBody Student student) {
try {
studentService.update(student);
} catch (Exception e) {
return "修改失败!";
}
return "200";
}
/**
}
}
@Controller
@RequestMapping("/user")
public class UserController {
@Autowired
private UserService userService;
/**
* 用户信息详情,即我的信息页面
*
* @param uId
* @return
*/
@RequestMapping("/userDetails.do")
public ModelAndView userDetails(String uId) {
ModelAndView mv = new ModelAndView();
Student student = userService.findSDetails(uId);
Teacher teacher = userService.findTDetails(uId);
Other other = userService.findODetails(uId);
mv.addObject("student", student);
mv.addObject("teacher", teacher);
mv.addObject("other", other);
mv.setViewName("user-details");
return mv;
}
/**
* 修改页面
*
* @return
*/
@RequestMapping("/updatePW.do")
}
/**
* 本届运动会的信息管理
*
* @param sId
* @return
*/
@RequestMapping("/manageFindDetailsBysId.do")
public ModelAndView manageFindDetailsBysId(Integer sId) {
ModelAndView mv = new ModelAndView();
Map<String, Object> map = sportmeetingService.findDetailsBysId(sId);
Sportmeeting sportmeeting = (Sportmeeting) map.get("sportmeeting");
List<Broadcast> broadcastList = (List<Broadcast>) map.get("broadcastList");
List<Event> eventList = (List<Event>) map.get("eventList");
List<Matches> matchesList = (List<Matches>) map.get("matchesList");
mv.addObject("event", eventList);
mv.addObject("matches", matchesList);
mv.addObject("broadcast", broadcastList);
mv.addObject("sportmeeting", sportmeeting);
mv.setViewName("sportmeeting-manage-details");
return mv;
}
/**
* 遍历所有运动会到选择框上
*
* @return
*/
@RequestMapping(value = "/findAllSportmeetings.do", produces = "application/json; charset=utf-8")
@ResponseBody
public List<Sportmeeting> findAllSportmeetings() {
return sportmeetingService.findAllSportmeetings();
}
}