ssm+vue线上学习网站源码和论文194
开发工具:idea 或eclipse
数据库mysql5.7+
数据库链接工具:navcat,小海豚等
技术:ssm
线上学习网站
摘要
随着信息技术在管理上越来越深入而广泛的应用,作为学校以及一些培训机构,都在用信息化战术来部署线上学习以及线上考试,可以与线下的考试有机的结合在一起,实现线上学习网站在技术上已成熟。本文介绍了线上学习网站的开发全过程。通过分析企业对于线上学习网站的需求,创建了一个计算机管理线上学习网站的方案。文章介绍了线上学习网站的系统分析部分,包括可行性分析等,系统设计部分主要介绍了系统功能设计和数据库设计。
本线上学习网站管理员功能管理员功能,可以对个人中心进行管理,学生管理,教师管理,学科信息管理,课程管理,课程视频管理,课程资料管理,试卷管理,试题管理,系统管理,以及考试管理。员工可以注册登录,登录后可以在前台首页查看企业介绍信息,产品信息,企业动态,企业相册,文章信息,企业新闻,个人中心,在个人中心可以修改自己的注册信息,可以添加属于自己发布的文章信息,发布之后管理员可以对员工发布的文章信息进行审核操作。还可以在个人后台查看企业介绍,产品信息,企业动态,企业相册,文章信息等。因而具有一定的实用性。
本站是一个B/S模式系统,采用Java的SSM框架作为开发技术,MYSQL数据库设计开发,充分保证系统的稳定性。系统具有界面清晰、操作简单,功能齐全的特点,使得线上学习网站管理工作系统化、规范化。
关键词:线上学习网站;SSM框架;MYSQL数据库
Abstract
With the more and more in-depth and extensive application of information technology in management, as a general enterprise, it has begun to focus on its own information display platform, and the realization of corporate blog sites has become technically mature. This article introduces the whole process of corporate blog website development. By analyzing the needs of enterprises for blog sites, a solution for computer management of corporate blog sites was created. The article introduces the system analysis part of the corporate blog website, including feasibility analysis, etc. The system design part mainly introduces the system function design and database design.
The corporate blog site administrator functions include personal center, employee management, department classification management, company introduction management, product information management, corporate dynamic management, corporate photo album management, article information management, system management, etc. Employees can register and log in. After logging in, they can view company introduction information, product information, company news, company albums, article information, company news, and personal center on the front page of the front desk. In the personal center, they can modify their registration information and add their own publications. Article information. After publishing, the administrator can review the article information published by employees. You can also view company introduction, product information, company news, company photo albums, article information, etc. in your personal background. So it has a certain practicability.
This site is a B/S model system, using Java's SSM framework as the development technology, and MYSQL database design and development, which fully guarantees the stability of the system. The system has the characteristics of clear interface, simple operation and complete functions, which makes the management of corporate blog website systematized and standardized.
Keywords: Corporate blog site; SSM framework; MYSQL database
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-04-17 15:01:27
*/
@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("gonghao", 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("gonghao", jiaoshi.getGonghao()));
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("gonghao", 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("gonghao", jiaoshi.getGonghao()));
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("gonghao", jiaoshi.getGonghao()));
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);
}
}