文章目录
Java毕业设计-基于springboot开发的计算机学院校友网-毕业论文(附毕设源代码)
如需其他项目或毕设源码,可进主页看下往期的毕设资源分享哦,希望对您有帮助!
逃逸的卡路里
–
前言
随着信息技术的飞速发展,Java语言作为一种成熟、稳定且功能强大的编程语言,已经广泛应用于企业级应用、移动开发、大数据处理等多个领域。作为本科大学生,我们在学习Java编程语言的过程中,不仅掌握了其语法规则和编程技巧,更重要的是学会了如何利用Java解决实际问题,实现软件系统的设计与开发。
本次毕业设计旨在通过实际项目的开发,将我们在大学期间所学的Java编程语言知识与实践相结合,进一步加深对Java语言的理解和应用。毕业设计的宗旨在于培养我们的独立思考能力、团队协作精神和创新能力,提升我们解决实际问题的能力,为未来的职业发展打下坚实的基础。
在毕业设计中,我们将综合运用Java编程语言、数据库技术、前端开发技术等,设计并实现一个具有实际应用价值的软件系统。通过需求分析、系统设计、编码实现、测试维护等阶段的实践,我们将全面提升自己的软件开发能力,为未来的学习和工作积累宝贵的经验。
计算机学院校友网在Eclipse环境中,使用Java语言进行编码,使用Mysql创建数据表保存本系统产生的数据。系统可以提供信息显示和相应服务,其管理员增删改查校友分会和校友分会资料,审核校友分会预订订单,查看订单评价和评分,通过留言功能回复用户提问。
总之,计算机学院校友网集中管理信息,有着保密性强,效率高,存储空间大,成本低等诸多优点。它可以降低信息管理成本,实现信息管理计算机化。
关键词:计算机学院校友网;Java语言;Mysql
一、毕设成果演示(源代码在文末)
二、毕设摘要展示
1、开发说明
开发语言:Java
框架:springboot
JDK版本:JDK1.8
服务器:tomcat7
数据库:mysql 5.7(一定要5.7版本)
数据库工具:Navicat11
开发软件:eclipse/myeclipse/idea
Maven包:Maven3.3.9
浏览器:谷歌浏览器
推荐使用:谷歌浏览器
前台登录页面
http://localhost:8080/xiaoyouwang/front/index.html
后台登录页面
http://localhost:8080/xiaoyouwang/admin/dist/index.html
管理员 账户:admin 密码:admin
校友 账户:a1 密码:123456
校友 账户:a2 密码:123456
校友 账户:a3 密码:123456
在src\main\resources\application.yml中编辑
url: jdbc:mysql://127.0.0.1:3306/xiaoyouwang?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8
username: root 数据库用户名 root
password: 123456 用户密码 123456
图片存放路径: src\main\webapp\upload 里面上传图片名里面不能有中文
2、需求/流程分析
package com.controller;
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
* 校友风采
* 后端接口
* @author
* @email
*/
@RestController
@Controller
@RequestMapping("/xiaoyoufengcai")
public class XiaoyoufengcaiController {
private static final Logger logger = LoggerFactory.getLogger(XiaoyoufengcaiController.class);
@Autowired
private XiaoyoufengcaiService xiaoyoufengcaiService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表service
@Autowired
private YonghuService yonghuService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永不会进入");
else if("校友".equals(role))
params.put("yonghuId",request.getSession().getAttribute("userId"));
if(params.get("orderBy")==null || params.get("orderBy")==""){
params.put("orderBy","id");
}
PageUtils page = xiaoyoufengcaiService.queryPage(params);
//字典表数据转换
List<XiaoyoufengcaiView> list =(List<XiaoyoufengcaiView>)page.getList();
for(XiaoyoufengcaiView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
return R.ok().put("data", page);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
XiaoyoufengcaiEntity xiaoyoufengcai = xiaoyoufengcaiService.selectById(id);
if(xiaoyoufengcai !=null){
//entity转view
XiaoyoufengcaiView view = new XiaoyoufengcaiView();
BeanUtils.copyProperties( xiaoyoufengcai , view );//把实体数据重构到view中
//级联表
YonghuEntity yonghu = yonghuService.selectById(xiaoyoufengcai.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody XiaoyoufengcaiEntity xiaoyoufengcai, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,xiaoyoufengcai:{}",this.getClass().getName(),xiaoyoufengcai.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
else if("校友".equals(role))
xiaoyoufengcai.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
Wrapper<XiaoyoufengcaiEntity> queryWrapper = new EntityWrapper<XiaoyoufengcaiEntity>()
.eq("yonghu_id", xiaoyoufengcai.getYonghuId())
.eq("xiaoyoufengcai_name", xiaoyoufengcai.getXiaoyoufengcaiName())
.eq("xiaoyoufengcai_types", xiaoyoufengcai.getXiaoyoufengcaiTypes())
.eq("xiaoyoufengcai_jiango", xiaoyoufengcai.getXiaoyoufengcaiJiango())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
XiaoyoufengcaiEntity xiaoyoufengcaiEntity = xiaoyoufengcaiService.selectOne(queryWrapper);
if(xiaoyoufengcaiEntity==null){
xiaoyoufengcai.setCreateTime(new Date());
xiaoyoufengcaiService.insert(xiaoyoufengcai);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 后端修改
*/
@RequestMapping("/update")
public R update(@RequestBody XiaoyoufengcaiEntity xiaoyoufengcai, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,xiaoyoufengcai:{}",this.getClass().getName(),xiaoyoufengcai.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// else if("校友".equals(role))
// xiaoyoufengcai.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
//根据字段查询是否有相同数据
Wrapper<XiaoyoufengcaiEntity> queryWrapper = new EntityWrapper<XiaoyoufengcaiEntity>()
.notIn("id",xiaoyoufengcai.getId())
.andNew()
.eq("yonghu_id", xiaoyoufengcai.getYonghuId())
.eq("xiaoyoufengcai_name", xiaoyoufengcai.getXiaoyoufengcaiName())
.eq("xiaoyoufengcai_types", xiaoyoufengcai.getXiaoyoufengcaiTypes())
.eq("xiaoyoufengcai_jiango", xiaoyoufengcai.getXiaoyoufengcaiJiango())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
XiaoyoufengcaiEntity xiaoyoufengcaiEntity = xiaoyoufengcaiService.selectOne(queryWrapper);
if("".equals(xiaoyoufengcai.getXiaoyoufengcaiPhoto()) || "null".equals(xiaoyoufengcai.getXiaoyoufengcaiPhoto())){
xiaoyoufengcai.setXiaoyoufengcaiPhoto(null);
}
if(xiaoyoufengcaiEntity==null){
xiaoyoufengcaiService.updateById(xiaoyoufengcai);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
xiaoyoufengcaiService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 批量上传
*/
@RequestMapping("/batchInsert")
public R save( String fileName, HttpServletRequest request){
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
List<XiaoyoufengcaiEntity> xiaoyoufengcaiList = new ArrayList<>();//上传的东西
Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
Date date = new Date();
int lastIndexOf = fileName.lastIndexOf(".");
if(lastIndexOf == -1){
return R.error(511,"该文件没有后缀");
}else{
String suffix = fileName.substring(lastIndexOf);
if(!".xls".equals(suffix)){
return R.error(511,"只支持后缀为xls的excel文件");
}else{
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径
File file = new File(resource.getFile());
if(!file.exists()){
return R.error(511,"找不到上传文件,请联系管理员");
}else{
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
dataList.remove(0);//删除第一行,因为第一行是提示
for(List<String> data:dataList){
//循环
XiaoyoufengcaiEntity xiaoyoufengcaiEntity = new XiaoyoufengcaiEntity();
// xiaoyoufengcaiEntity.setYonghuId(Integer.valueOf(data.get(0))); //校友 要改的
// xiaoyoufengcaiEntity.setXiaoyoufengcaiName(data.get(0)); //标题 要改的
// xiaoyoufengcaiEntity.setXiaoyoufengcaiTypes(Integer.valueOf(data.get(0))); //奖项类型 要改的
// xiaoyoufengcaiEntity.setXiaoyoufengcaiPhoto("");//详情和图片
// xiaoyoufengcaiEntity.setXiaoyoufengcaiJiango(data.get(0)); //所得奖项 要改的
// xiaoyoufengcaiEntity.setXiaoyoufengcaiContent("");//详情和图片
// xiaoyoufengcaiEntity.setCreateTime(date);//时间
xiaoyoufengcaiList.add(xiaoyoufengcaiEntity);
//把要查询是否重复的字段放入map中
}
//查询是否重复
xiaoyoufengcaiService.insertBatch(xiaoyoufengcaiList);
return R.ok();
}
}
}
}catch (Exception e){
e.printStackTrace();
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
// 没有指定排序字段就默认id倒序
if(StringUtil.isEmpty(String.valueOf(params.get("orderBy")))){
params.put("orderBy","id");
}
PageUtils page = xiaoyoufengcaiService.queryPage(params);
//字典表数据转换
List<XiaoyoufengcaiView> list =(List<XiaoyoufengcaiView>)page.getList();
for(XiaoyoufengcaiView c:list)
dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段
return R.ok().put("data", page);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
XiaoyoufengcaiEntity xiaoyoufengcai = xiaoyoufengcaiService.selectById(id);
if(xiaoyoufengcai !=null){
//entity转view
XiaoyoufengcaiView view = new XiaoyoufengcaiView();
BeanUtils.copyProperties( xiaoyoufengcai , view );//把实体数据重构到view中
//级联表
YonghuEntity yonghu = yonghuService.selectById(xiaoyoufengcai.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody XiaoyoufengcaiEntity xiaoyoufengcai, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,xiaoyoufengcai:{}",this.getClass().getName(),xiaoyoufengcai.toString());
Wrapper<XiaoyoufengcaiEntity> queryWrapper = new EntityWrapper<XiaoyoufengcaiEntity>()
.eq("yonghu_id", xiaoyoufengcai.getYonghuId())
.eq("xiaoyoufengcai_name", xiaoyoufengcai.getXiaoyoufengcaiName())
.eq("xiaoyoufengcai_types", xiaoyoufengcai.getXiaoyoufengcaiTypes())
.eq("xiaoyoufengcai_jiango", xiaoyoufengcai.getXiaoyoufengcaiJiango())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
XiaoyoufengcaiEntity xiaoyoufengcaiEntity = xiaoyoufengcaiService.selectOne(queryWrapper);
if(xiaoyoufengcaiEntity==null){
xiaoyoufengcai.setCreateTime(new Date());
xiaoyoufengcaiService.insert(xiaoyoufengcai);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
}
3、系统功能结构
三、系统实现展示
1、校友信息管理
校友信息管理页面,此页面提供给管理员的功能有:校友信息的查询管理,可以删除校友信息、修改校友信息、新增校友信息,还进行了对用户名称的模糊查询的条件
2、校友分会管理
校友分会管理页面,此页面提供给管理员的功能有:查看已发布的校友分会数据,修改校友分会,校友分会作废,即可删除,还进行了对校友分会名称的模糊查询 校友分会信息的类型查询等等一些条件。
3、校友风采管理
校友风采管理页面,此页面提供给管理员的功能有:根据校友风采进行条件查询,还可以对校友风采进行新增、修改、查询操作等等。
4、公告信息管理
公告信息管理页面,此页面提供给管理员的功能有:根据公告信息进行新增、修改、查询操作等等。
四、毕设内容和源代码获取
Java毕业设计-基于springboot开发的计算机学院校友网-毕业论文(附毕设源代码):https://download.csdn.net/download/u014740628/88921806
如需其他项目或毕设源码,可进主页看下往期的毕设资源分享哦,希望对您有帮助!
逃逸的卡路里
总结
通过本次毕业设计,我们不仅巩固了所学的Java编程语言知识,还学会了如何将理论知识应用于实际项目中。我们设计的软件系统具有一定的实际应用价值,这让我们对自己的能力充满了信心,也为未来的职业发展打下了坚实的基础。
参考文献
[1]江涛.校友分会网上预订系统的设计与分析[J].现代商贸工业,2020,41(22):150.
[2]徐微微.晓庄连锁校友分会校友分会预订系统的设计[J].企业导报,2016(08):180-181.
[3]张振超,吴杰,陈序蓬.浅谈Java中Mysql数据库的连接与操作[J].信息记录材料,2020,21(02):144-145.
[4]郑智方,魏恺乐,李彬,谢易壮.MySQL得到广泛使用的原因以及它的嵌入应用[J].科技风,2020(05):114.
[5]赵秀芹,刘杨青,李瑞祥.MySQL数据库使用技巧三例[J].网络安全和信息化,2019(08):90-91.
[6]余涛.计算机软件开发中Java编程语言的应用研究[J].信息记录材料,2020,21(01):113-115.
[7]岳青玲.Java面向对象编程的三大特性[J].电子技术与软件工程,2019(24):239-240.
[8]耿学.关于Java Web中中文乱码问题的探讨[J].现代信息科技,2020,4(01):74-75+78.
[9]张彦芳.Java Web项目开发中的中文乱码问题与对策[J].电脑知识与技术,2020,16(09):96-97.
[10]韩思凡.Web开发中的vue与H T ML的基础应用[J].科学技术创新,2020(14):71-72.
[11]赵晓丹.网页开发中的vue技术分析[J].南方农机,2019,50(20):247-248.
[12]薛茹.基于Spring Boot框架的Web系统研究与应用[J].计算机产品与流通,2018(07):30.
[13]邱丹萍.Web开发中Spring Boot框架的分析[J].电脑知识与技术,2020,16(17):81-82.
[14]仲崇文.关于计算机软件开发中常见问题的研究[J].通讯世界,2020,27(07):89-90.
[15]Raffi Khatchadourian.Automated refactoring of legacy Java software to enumerated types[J].Automated Software Engineering,2017,24(4).
[16]Ben White.Marx and Chayanov at the margins:understanding agrarian change in Java[J].The Journal of Peasant Studies,2018,45(5-6).