基于javaweb和mysql的ssm公开课记录管理系统(java+ssm+html+javascript+jsp+mysql)
·
基于javaweb和mysql的ssm公开课记录管理系统(java+ssm+html+javascript+jsp+mysql)
私信源码获取及调试交流
私信源码获取及调试交流
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SSM公开课记录管理系统(java+ssm+html+javascript+jsp+mysql)
项目介绍
管理员: 登录,修改个人资料,用户管理,公告管理,教室管理,科目管理,听课记录管理等功能。
用户角色包含以下功能: 用户登录,修改个人资料,查看公告,查看听课记录等功能。
环境需要
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版本;
技术栈
- 后端:Spring+SpringMVC+Mybatis 2. 前端:HTML+CSS+JavaScript+jsp
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.yml配置文件中的数据库配置改为自己的配置; 4. 运行项目,http://localhost:8080/shop/index
response.setContentType("application/binary;charset=UTF-8");
try {
ServletOutputStream out = response.getOutputStream();
String fileName1 = "学生信息";
String fileName2 = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date());
String fileName = fileName1+fileName2;
response.setHeader("Content-disposition", "attachment; filename=" +new String(fileName.getBytes("gbk"),"iso8859-1") + ".xls");
String[] titles = { "成绩编号","学生编号", "学生姓名", "课程编号", "课程名称", "成绩" };
courseService.export(titles, out,user);
} catch (Exception e) {
e.printStackTrace();
@RequestMapping("delete")
public String delete(String ID){
power.setId(ID);
System.out.println(ID);
depot.setRoleid(ID);
List<Role> list = depotService.QueryAll(depot);
Role role1 = list.get(0);
Power power1 = powerService.selectByPrimaryKey(role1.getPowerid());
String name = role1.getRolename();
role1.setPowerid(power1.getPower());
String data = json.toJSONString(role1);
return data;
@ResponseBody
@RequestMapping("/getAll")
public String getAll(Role role){
JSONObject json = new JSONObject();
return json.toJSONString(list);
@RequestMapping("/student")
public String QueryAllStudent(HttpServletRequest request,User user){
List<User> list = userService.QueryAllStudent(user);
request.setAttribute("list", list);
if(null != user.getName()){
request.setAttribute("name", user.getName());
if(null != user.getMobile()){
request.setAttribute("mobile", user.getMobile());
return "student";
@RequestMapping("/addteacher")
public String addUser(User user){
return "redirect:/Course/teacher";
@RequestMapping("update2")
public String update2(HttpServletRequest request,Course course){
User user = (User) request.getSession().getAttribute("user");
Curelation curelation = new Curelation();
curelation.setUserid(user.getId());
curelation.setCourseid(course.getId());
List<Curelation> curelationList = curelationService.queryAll(curelation);
if(curelationList.size() == 0){
curelation.setId(String.valueOf(Math.random()).substring(2, 10));
curelation.setType("1");
curelationService.insert(curelation);
}else{
Curelation curelation1 = curelationList.get(0);
curelation1.setUserid(user.getId());
curelation1.setCourseid(course.getId());
System.out.println(curelation1.toString());
curelationService.updateByPrimaryKey(curelation1);
return "redirect:/Course/student";
@ResponseBody
@RequestMapping("/queryOne")
public String queryOne(String ID){
Course course = new Course();
course.setId(ID);
@RequestMapping("suggeetion")
public String suggeetion(HttpServletRequest request, Coursecomment coursecomment){
List<Coursecomment> coursecomments = coursecommentService.queryAll(coursecomment);
request.setAttribute("list",coursecomments);
return "suggeetion";
@RequestMapping("view")
public String view(HttpServletRequest request){
User user = (User) request.getSession().getAttribute("user");
String type = "1";
if ("1".equals(user.getType())){
type="2";
List<Map<String,String>> list=curelationService.courseview(type,user.getId());
courseService.deleteByPrimaryKey(ID);
return "redirect:/Course/queryAll";
@RequestMapping("update")
public String update(Course course){
courseService.updateByPrimaryKey(course);
return "redirect:/Course/queryAll";
@Transactional
@RequestMapping("update1")
public String update1(HttpServletRequest request,Course course){
course.setStatus("1");
courseService.updateByPrimaryKey(course);
cell = sheet.getCell(0,i);
cell1 = sheet.getCell(5,i);
Curelation curelation = new Curelation();
curelation.setId(cell.getContents());
curelation.setScore(cell1.getContents());
curelationService.updateByPrimaryKey(curelation);
} catch (IOException e) {
e.printStackTrace();
} catch (BiffException e) {
e.printStackTrace();
return "redirect:/Course/queryCourse";
@RequestMapping("/queryCourse")
public String queryScore(HttpServletRequest request,Curelation curelation){
curelation.setType("1");
return "redirect:/Course/suggeetion";
@RequestMapping("queryAll")
public String queryAll(HttpServletRequest request, Course course){
List<Course> list = courseService.queryAll(course);
request.setAttribute("list",list);
return "course";
@RequestMapping("/receive")
public String receive(HttpServletRequest request, HttpServletResponse response, MultipartFile file){
try {
//也可以用request获取上传文件
//MultipartFile fileFile = request.getFile("file"); //这里是页面的name属性
//得到sheet
Sheet sheet = workbook.getSheet(0);
//得到列数
int colsNum = sheet.getColumns();
//得到行数
int rowsNum = sheet.getRows();
//单元格
Cell cell;
Cell cell1;
List<Map> list = new ArrayList<>();
Map<Integer, String> map = new HashMap<Integer, String>();
for (int i = 1; i < rowsNum; i++) {//我的excel第一行是标题,所以 i从1开始
cell = sheet.getCell(0,i);
@RequestMapping("/receive")
public String receive(HttpServletRequest request, HttpServletResponse response, MultipartFile file){
try {
//也可以用request获取上传文件
//MultipartFile fileFile = request.getFile("file"); //这里是页面的name属性
//转换成输入流
InputStream is = file.getInputStream();
//得到excel
Workbook workbook = Workbook.getWorkbook(is);
//得到sheet
notice = list.get(0);
User user = userService.selectByPrimaryKey(notice.getUserid());
notice.setUserid(user.getName());
request.getSession().setAttribute("notice", notice);
return "Main";
@RequestMapping("/changePa")
public String res1(){
return "changePass";
@RequestMapping("/Login")
public ModelAndView login(HttpServletRequest request,String id,String password) throws Exception{
ModelAndView mav = new ModelAndView();
User user1 = userService.selectByPrimaryKey(id);
int rowsNum = sheet.getRows();
//单元格
Cell cell;
Cell cell1;
List<Map> list = new ArrayList<>();
Map<Integer, String> map = new HashMap<Integer, String>();
for (int i = 1; i < rowsNum; i++) {//我的excel第一行是标题,所以 i从1开始
cell = sheet.getCell(0,i);
cell1 = sheet.getCell(5,i);
Curelation curelation = new Curelation();
curelation.setId(cell.getContents());
courseService.export(titles, out,user);
} catch (Exception e) {
e.printStackTrace();
@RequestMapping("delete")
public String delete(String ID){
courseService.deleteByPrimaryKey(ID);
return "redirect:/Course/queryAll";
@RequestMapping("update")
public String update(Course course){
courseService.updateByPrimaryKey(course);
@RequestMapping("update1")
public String update1(HttpServletRequest request,Course course){
course.setStatus("1");
courseService.updateByPrimaryKey(course);
User user = (User) request.getSession().getAttribute("user");
Curelation curelation1 = new Curelation();
curelation1.setCourseid(course.getId());
curelation1.setUserid(user.getId());
List<Curelation> curelationList = curelationService.queryAll(curelation1);
if(curelationList.size()==0){
Curelation curelation = new Curelation();
curelation.setUserid(user.getId());
curelation.setCourseid(course.getId());
userService.updateByPrimaryKey(user1);
return "Main";
@RequestMapping("/delete")
public String delete(String ID){
userService.deleteByPrimaryKey(ID);
return "redirect:/User/queryAll";
@RequestMapping("/teacher")
public String QueryAllTeacher(HttpServletRequest request,User user){
List<User> list = userService.QueryAllTeacher(user);
request.setAttribute("list", list);
if(null != user.getName()){
request.setAttribute("name", user.getName());
User user = (User) request.getSession().getAttribute("user");
coursecomment.setCreatetime(DateUtil.getStringToday());
coursecomment.setUserid(user.getName());
coursecomment.setId(String.valueOf(Math.random()).substring(2,10));
coursecommentService.insert(coursecomment);
return "redirect:/Course/suggeetion";
@ResponseBody
@RequestMapping("jsoncourse")
public String jsoncourse(HttpServletRequest request, Curelation course){
User user = (User) request.getSession().getAttribute("user");
/*String type = "1";
if ("1".equals(user.getType())){
type="2";






更多推荐




所有评论(0)