博主介绍:专注于Java(springboot ssm 等开发框架) vue .net php phython node.js uniapp 微信小程序 等诸多技术领域和毕业项目实战、企业信息化系统建设,从业十五余年开发设计教学工作
☆☆☆ 精彩专栏推荐订阅☆☆☆☆☆不然下次找不到哟
我的博客空间发布了2000+毕设题目 方便大家学习使用
感兴趣的可以先收藏起来,还有大家在毕设选题,项目以及论文编写等相关问题都可以给我留言咨询,希望帮助更多的人
文末下方有源码获取地址
4.2系统结构
本系统是基于B/S架构的网站系统,设计的功能结构图如下图所示:
图4-2管理员功能结构图
4.3.数据库设计
4.3.1数据库实体
概念设计的目标是设计出反映某个组织部门信息需求的数据库系统概念模式,数据库系统的概念模式独立于数据库系统的逻辑结构、独立于数据库管理系统(DBMS)、独立于计算机系统。
概念模式的设计方法是在需求分析的基础上,用概念数据模型(例如E-R模型)表示数据及数据之间的相互联系,设计出反映用户信息需求和处理需求的数据库系统概念模式。概念设计的目标是准确描述应用领域的信息模式,支持用户的各种应用,这样既容易转换为数据库系统逻辑模式,又容易为用户理解。数据库系统概念模式是面向现实世界的数据模型,不能直接用于数据库系统的实现。在此阶段,用户可以参与和评价数据库系统的设计,从而有利于保证数据库系统的设计与用户的需求相吻合。在概念模式的设计中,E-R模型法是最常见的设计方法。本系统的E-R图如下图所示:
4.3.2数据库设计表
信息化在线教学平台需要后台数据库,下面介绍数据库中的各个表的详细信息:
表4.1 教师
字段 | 类型 | 空 | 默认 | 注释 |
id (主键) | bigint(20) | 否 | 主键 | |
addtime | timestamp | 否 | CURRENT_TIMESTAMP | 创建时间 |
zhanghao | varchar(200) | 否 | 账号 | |
mima | varchar(200) | 否 | 密码 | |
xingming | varchar(200) | 否 | 姓名 | |
bianhao | varchar(200) | 是 | NULL | 编号 |
xingbie | varchar(200) | 是 | NULL | 性别 |
nianling | int(11) | 是 | NULL | 年龄 |
shouji | varchar(200) | 是 | NULL | 手机 |
shenfenzheng | varchar(200) | 是 | NULL | 身份证 |
zhaopian | varchar(200) | 是 | NULL | 照片 |
表4.2 教学信息
字段 | 类型 | 空 | 默认 | 注释 |
id (主键) | bigint(20) | 否 | 主键 | |
addtime | timestamp | 否 | CURRENT_TIMESTAMP | 创建时间 |
kechenghao | varchar(200) | 是 | NULL | 课程号 |
kechengming | varchar(200) | 是 | NULL | 课程名 |
kechengxiangqing | longtext | 是 | NULL | 课程详情 |
kechengshizhang | int(11) | 是 | NULL | 课程时长 |
jiaoshixingming | varchar(200) | 是 | NULL | 教师姓名 |
zhaopian | varchar(200) | 是 | NULL | 照片 |
表4.3 留言板
字段 | 类型 | 空 | 默认 | 注释 |
id (主键) | bigint(20) | 否 | 主键 | |
addtime | timestamp | 否 | CURRENT_TIMESTAMP | 创建时间 |
userid | bigint(20) | 否 | 留言人id | |
username | varchar(200) | 是 | NULL | 用户名 |
content | longtext | 否 | 留言内容 | |
reply | longtext | 是 | NULL | 回复内容 |
表4. 4学校公告
字段 | 类型 | 空 | 默认 | 注释 |
id (主键) | bigint(20) | 否 | 主键 | |
addtime | timestamp | 否 | CURRENT_TIMESTAMP | 创建时间 |
title | varchar(200) | 否 | 标题 | |
introduction | longtext | 是 | NULL | 简介 |
picture | varchar(200) | 否 | 图片 | |
content | longtext | 否 | 内容 |
表4.5 管理员表
字段 | 类型 | 空 | 默认 | 注释 |
id (主键) | bigint(20) | 否 | 主键 | |
username | varchar(100) | 否 | 用户名 | |
password | varchar(100) | 否 | 密码 | |
role | varchar(100) | 是 | 管理员 | 角色 |
addtime | timestamp | 否 | CURRENT_TIMESTAMP | 新增时间 |
表4.6 学生
字段 | 类型 | 空 | 默认 | 注释 |
id (主键) | bigint(20) | 否 | 主键 | |
addtime | timestamp | 否 | CURRENT_TIMESTAMP | 创建时间 |
xuehao | varchar(200) | 否 | 学号 | |
mima | varchar(200) | 否 | 密码 | |
xingming | varchar(200) | 否 | 姓名 | |
xingbie | varchar(200) | 是 | NULL | 性别 |
nianling | int(11) | 是 | NULL | 年龄 |
shouji | varchar(200) | 是 | NULL | 手机 |
shenfenzheng | varchar(200) | 是 | NULL | 身份证 |
zhaopian | varchar(200) | 是 | NULL | 照片 |
表4.7 学生成绩
字段 | 类型 | 空 | 默认 | 注释 |
id (主键) | bigint(20) | 否 | 主键 | |
addtime | timestamp | 否 | CURRENT_TIMESTAMP | 创建时间 |
xuehao | varchar(200) | 是 | NULL | 学号 |
xingming | varchar(200) | 是 | NULL | 姓名 |
kemu1chengji | int(11) | 是 | NULL | 科目1成绩 |
kemu2chengji | int(11) | 是 | NULL | 科目2成绩 |
kemu3chengji | int(11) | 是 | NULL | 科目3成绩 |
kemu4chengji | int(11) | 是 | NULL | 科目4成绩 |
5系统详细实现
5.1 管理员模块的实现
5.1.1 学生信息管理
信息化在线教学平台的系统管理员可以管理学生信息检,可以对学生信息信息添加修改删除以及查询操作。具体界面的展示如图5.1所示。
图5.1 学生信息管理界面
5.1.2 教师信息管理
系统管理员可以查看对教师信息信息进行添加,修改,删除以及查询操作。具体界面如图5.2所示。
图5.2 教师信息信息管理界面、
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.JiaoshiEntity;
import com.entity.view.JiaoshiView;
import com.service.JiaoshiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 教师
* 后端接口
* @author
* @email
* @date 2021-05-07 11:01:23
*/
@RestController
@RequestMapping("/jiaoshi")
public class JiaoshiController {
@Autowired
private JiaoshiService jiaoshiService;
@Autowired
private TokenService tokenService;
/**
* 登录
*/
@IgnoreAuth
@RequestMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
JiaoshiEntity user = jiaoshiService.selectOne(new EntityWrapper<JiaoshiEntity>().eq("zhanghao", username));
if(user==null || !user.getMima().equals(password)) {
return R.error("账号或密码不正确");
}
String token = tokenService.generateToken(user.getId(), username,"jiaoshi", "管理员" );
return R.ok().put("token", token);
}
/**
* 注册
*/
@IgnoreAuth
@RequestMapping("/register")
public R register(@RequestBody JiaoshiEntity jiaoshi){
//ValidatorUtils.validateEntity(jiaoshi);
JiaoshiEntity user = jiaoshiService.selectOne(new EntityWrapper<JiaoshiEntity>().eq("zhanghao", jiaoshi.getZhanghao()));
if(user!=null) {
return R.error("注册用户已存在");
}
Long uId = new Date().getTime();
jiaoshi.setId(uId);
jiaoshiService.insert(jiaoshi);
return R.ok();
}
/**
* 退出
*/
@RequestMapping("/logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
/**
* 获取用户的session用户信息
*/
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
Long id = (Long)request.getSession().getAttribute("userId");
JiaoshiEntity user = jiaoshiService.selectById(id);
return R.ok().put("data", user);
}
/**
* 密码重置
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
JiaoshiEntity user = jiaoshiService.selectOne(new EntityWrapper<JiaoshiEntity>().eq("zhanghao", username));
if(user==null) {
return R.error("账号不存在");
}
user.setMima("123456");
jiaoshiService.updateById(user);
return R.ok("密码已重置为:123456");
}
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,JiaoshiEntity jiaoshi,
HttpServletRequest request){
EntityWrapper<JiaoshiEntity> ew = new EntityWrapper<JiaoshiEntity>();
PageUtils page = jiaoshiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jiaoshi), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,JiaoshiEntity jiaoshi,
HttpServletRequest request){
EntityWrapper<JiaoshiEntity> ew = new EntityWrapper<JiaoshiEntity>();
PageUtils page = jiaoshiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jiaoshi), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( JiaoshiEntity jiaoshi){
EntityWrapper<JiaoshiEntity> ew = new EntityWrapper<JiaoshiEntity>();
ew.allEq(MPUtil.allEQMapPre( jiaoshi, "jiaoshi"));
return R.ok().put("data", jiaoshiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(JiaoshiEntity jiaoshi){
EntityWrapper< JiaoshiEntity> ew = new EntityWrapper< JiaoshiEntity>();
ew.allEq(MPUtil.allEQMapPre( jiaoshi, "jiaoshi"));
JiaoshiView jiaoshiView = jiaoshiService.selectView(ew);
return R.ok("查询教师成功").put("data", jiaoshiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
JiaoshiEntity jiaoshi = jiaoshiService.selectById(id);
return R.ok().put("data", jiaoshi);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
JiaoshiEntity jiaoshi = jiaoshiService.selectById(id);
return R.ok().put("data", jiaoshi);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody JiaoshiEntity jiaoshi, HttpServletRequest request){
jiaoshi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(jiaoshi);
JiaoshiEntity user = jiaoshiService.selectOne(new EntityWrapper<JiaoshiEntity>().eq("zhanghao", jiaoshi.getZhanghao()));
if(user!=null) {
return R.error("用户已存在");
}
jiaoshi.setId(new Date().getTime());
jiaoshiService.insert(jiaoshi);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody JiaoshiEntity jiaoshi, HttpServletRequest request){
jiaoshi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(jiaoshi);
JiaoshiEntity user = jiaoshiService.selectOne(new EntityWrapper<JiaoshiEntity>().eq("zhanghao", jiaoshi.getZhanghao()));
if(user!=null) {
return R.error("用户已存在");
}
jiaoshi.setId(new Date().getTime());
jiaoshiService.insert(jiaoshi);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody JiaoshiEntity jiaoshi, HttpServletRequest request){
//ValidatorUtils.validateEntity(jiaoshi);
jiaoshiService.updateById(jiaoshi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
jiaoshiService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<JiaoshiEntity> wrapper = new EntityWrapper<JiaoshiEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = jiaoshiService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
5.2 教师模块的实现
5.2.1 学生成绩管理
教师可以对学生成绩信息进行修改,删除以及查询操作。界面如下图所示:
图5.3 学生成绩信息管理界面
5.2.1 留言板
老师可以对留言板信息进行回复。界面如下图所示:
图5.4 留言板管理界面
大家点赞、收藏、关注、评论啦 其他的定制服务 商务合作 下方联系卡片↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 或者私信作者