java+spring基于ssm的中学校园网站设计与实现
文末获取源码
开发环境
项目编号:Java+MySQL ssm249中学校园网站
开发语言:Java
开发工具:IDEA /Eclipse
数据库:MYSQL5.7
应用服务:Tomcat7/Tomcat8
使用框架:ssm+vue
项目介绍
论文主要是对中学校园网站进行了介绍,包括研究的现状,还有涉及的开发背景,然后还对系统的设计目标进行了论述,还有系统的需求,以及整个的设计方案,对系统的设计以及实现,也都论述的比较细致,最后对中学校园网站进行了一些具体测试。
本文以JSP为开发技术,实现了一个中学校园网站。中学校园网站的主要使用者分为管理员;个人中心、教师管理、学生管理、校园概况管理、名师风采管理、校园公告管理、试卷管理、试题管理、校园论坛、系统管理、考试管理,教师;个人中心、校园概况管理、名师风采管理、校园公告管理、试题管理、试卷管理、系统管理、考试管理,学生;个人中心、校园概况管理、名师风采管理、校园公告管理、系统管理、考试管理,前台首页;首页、校园概况、名师风采、校园公告、论坛信息、试卷列表、新闻资讯、我的、跳转到后台等功能。通过这些功能模块的设计,基本上实现了整个中学校园网站的过程。
系统截图
关键代码
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.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-03-08 15:26:55*/
@RestController
@RequestMapping("/jiaoshi")
public class JiaoshiController {@Autowiredprivate JiaoshiService jiaoshiService;@Autowiredprivate 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));request.setAttribute("data", page);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));request.setAttribute("data", page);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);}}
java+spring基于ssm的中学校园网站设计与实现相关推荐
- Java+spring 基于ssm的高校校园点餐外卖管理系统#毕业设计
*文末获取源码 开发环境 项目编号:Java+spring ssm415高校校园点餐外卖管理系统#毕业设计 开发语言:Java 开发工具:IDEA /Eclipse 数据库:MYSQL5.7 应用服务 ...
- java毕业设计基于Bootstrap框架的读书网站设计与实现mybatis+源码+调试部署+系统+数据库+lw
java毕业设计基于Bootstrap框架的读书网站设计与实现mybatis+源码+调试部署+系统+数据库+lw java毕业设计基于Bootstrap框架的读书网站设计与实现mybatis+源码+调 ...
- 基于ssm的宠物商城网站设计与实现
项目描述 临近学期结束,还是毕业设计,你还在做java程序网络编程,期末作业,老师的作业要求觉得大了吗?不知道毕业设计该怎么办?网页功能的数量是否太多?没有合适的类型或系统?等等.这里根据疫情当下,你 ...
- 基于SSM框架的校园论坛设计与实现(MySQL、JSP)
此文章记录了本人毕业设计的设计与实现过程,欢迎大家交流讨论. 目录 摘 要 第1章 绪 论 1.1 课题背景及研究的目的和意义 1.2 国内外研究现状 1.3 本文的主要研究内容 第2章 系统总体设计 ...
- Java+spring 基于ssm的社区流浪猫狗动物救助网站#毕业设计
*文末获取源码 开发环境 项目编号:Java+spring ssm290社区流浪猫狗动物救助网站#毕业设计 开发语言:Java 开发工具:IDEA /Eclipse 数据库:MYSQL5.7 应用服务 ...
- Java+spring 基于ssm的美食网站设计与实现#毕业设计
*文末获取源码 开发环境 项目编号:Java+spring ssm408美食网站设计与实现#毕业设计 开发语言:Java 开发工具:IDEA /Eclipse 数据库:MYSQL5.7 应用服务:To ...
- Java+spring 基于ssm的电影视频在线点播系统#毕业设计
*文末获取源码 开发环境 项目编号:Java+spring ssm289电影视频在线点播系统#毕业设计 开发语言:Java 开发工具:IDEA /Eclipse 数据库:MYSQL5.7 应用服务:T ...
- Java+spring 基于ssm的车辆违章处理系统#毕业设计
*文末获取源码 开发环境 项目编号:Java+spring ssm407车辆违章处理系统#毕业设计 开发语言:Java 开发工具:IDEA /Eclipse 数据库:MYSQL5.7 应用服务:Tom ...
- Java+spring 基于ssm的幼儿园管理系统程序#毕业设计
*文末获取源码 开发环境 项目编号:Java+spring ssm401幼儿园管理系统程序#毕业设计 开发语言:Java 开发工具:IDEA /Eclipse 数据库:MYSQL5.7 应用服务:To ...
最新文章
- java的销毁方法_销毁Spring Bean的三种方法
- HP小型机superdome配置MC双机、PV、VG、LV初体验
- 下列不是c++ 标准数据类型得是?
- 【转】Ubuntu VI基本用法
- 工具推荐:22款最流行的计算机取证工具【2017年更新版】
- factorytalkview 卡 86_徕卡M党的街拍小贴士
- CVE-2020-3580: Cisco ASA安全软件XSS漏洞
- open读取文件操作
- Opencv打开相机,并在上面用鼠标画框
- C语言必背18个经典程序(含免费源码大全)
- 实现导出excel,pdf功能
- 腾讯下载的qlv格式视频转换mp4格式方法
- Visual Studio 2017 下创建ASP.NET网站程序详细步骤
- echarts字体大小自适应
- JDK 1.8 中的 Timer 类
- 悟已往之不谏,知来者之可追;实迷途其未远,觉今是而昨非
- html5 发送邮件,【JS】使用 Emailjs 发送邮件
- JavaScript-ES6-基础语法
- Linux进程地址空间
- java线程状态研究