项目介绍
近年来,信息化管理行业的不断兴起,使得人们的日常生活越来越离不开计算机和互联网技术。首先,根据收集到的用户需求分析,对设计系统有一个初步的认识与了解,确定实习管理系统的总体功能模块。然后,详细设计系统的主要功能模块,通过数据库设计过程将相关的数据信息存储到数据库中,再通过使用关键的开发工具,如IDEA开发平台、AJAX技术等,编码设计相关的功能模块。接着,主要采用功能测试的方式对系统进行测试,找出系统在运行过程中存在的问题,以及解决问题的方法,不断地改进和完善系统的设计。最后,总结本文介绍的系统的设计和实现过程,并且针对于系统的开发提出未来的展望工作。本系统的研发具有重大的意义,在安全性方面,用户使用浏览器访问网站时,采用注册和密码等相关的保护措施,提高系统的可靠性,维护用户的个人信息和财产的安全。在方便性方面,促进了实习管理系统的信息化建设,极大的方便了相关的工作人员对实习管理系统信息进行管理。
开发环境
编程语言:Java
数据库 :Mysql
系统架构:B/S
后端框架:SpringBoot
编译工具:idea或者eclipse,jdk1.8,maven
支持定做:java/php/python/android/小程序vue/爬虫/c#/asp.net
系统实现
5.1管理员功能模块实现
5.1.1管理员登录
管理员可以选择任一浏览器打开网址,输入信息无误后,以管理员的身份行使相关的管理权限,管理员登录界面设计如图5-1所示。
图5-1管理员登录界面
5.1.2实习管理
管理员可以通过选择实习管理,管理相关的实习信息记录,比如进行查看实习信息标题,修改实习信息来源等操作,实习管理界面设计如图5-2所示。
图5-2实习管理界面
5.1.3公告管理
管理员可以通过选择公告管理,管理相关的公告信息记录,比如进行查看公告详情,删除错误的公告信息,发布公告等操作,公告管理界面如图5-3所示。
图5-3 公告管理界面
5.1.4公告类型管理
管理员可以通过选择公告类型管理,管理相关的公告类型信息,比如查看所有公告类型,删除无用公告类型,修改公告类型,添加公告类型等操作,公告类型管理界面设计如图5-4所示。
图5-4会员管理界面
核心代码
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("/shixiChengji")
public class ShixiChengjiController {
private static final Logger logger = LoggerFactory.getLogger(ShixiChengjiController.class);
@Autowired
private ShixiChengjiService shixiChengjiService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表service
@Autowired
private ShixiService shixiService;
@Autowired
private XueshengService xueshengService;
@Autowired
private LaoshiService laoshiService;
/**
* 后端列表
*/
@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("xueshengId",request.getSession().getAttribute("userId"));
else if("老师".equals(role))
params.put("laoshiId",request.getSession().getAttribute("userId"));
if(params.get("orderBy")==null || params.get("orderBy")==""){
params.put("orderBy","id");
}
PageUtils page = shixiChengjiService.queryPage(params);
//字典表数据转换
List<ShixiChengjiView> list =(List<ShixiChengjiView>)page.getList();
for(ShixiChengjiView 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);
ShixiChengjiEntity shixiChengji = shixiChengjiService.selectById(id);
if(shixiChengji !=null){
//entity转view
ShixiChengjiView view = new ShixiChengjiView();
BeanUtils.copyProperties( shixiChengji , view );//把实体数据重构到view中
//级联表
ShixiEntity shixi = shixiService.selectById(shixiChengji.getShixiId());
if(shixi != null){
BeanUtils.copyProperties( shixi , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "xueshengId"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setShixiId(shixi.getId());
view.setShixiXueshengId(shixi.getXueshengId());
}
//级联表
XueshengEntity xuesheng = xueshengService.selectById(shixiChengji.getXueshengId());
if(xuesheng != null){
BeanUtils.copyProperties( xuesheng , view ,new String[]{ "id", "createTime", "insertTime", "updateTime"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setXueshengId(xuesheng.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody ShixiChengjiEntity shixiChengji, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,shixiChengji:{}",this.getClass().getName(),shixiChengji.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
else if("学生".equals(role))
shixiChengji.setXueshengId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
Wrapper<ShixiChengjiEntity> queryWrapper = new EntityWrapper<ShixiChengjiEntity>()
.eq("shixi_id", shixiChengji.getShixiId())
.orNew(
)
.eq("xuesheng_id", shixiChengji.getXueshengId())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ShixiChengjiEntity shixiChengjiEntity = shixiChengjiService.selectOne(queryWrapper);
if(shixiChengjiEntity==null){
shixiChengji.setInsertTime(new Date());
shixiChengji.setCreateTime(new Date());
shixiChengjiService.insert(shixiChengji);
return R.ok();
}else {
return R.error(511,"该实习或者该学生已经有成绩记录");
}
}
/**
* 后端修改
*/
@RequestMapping("/update")
public R update(@RequestBody ShixiChengjiEntity shixiChengji, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,shixiChengji:{}",this.getClass().getName(),shixiChengji.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// else if("学生".equals(role))
// shixiChengji.setXueshengId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
//根据字段查询是否有相同数据
Wrapper<ShixiChengjiEntity> queryWrapper = new EntityWrapper<ShixiChengjiEntity>()
.notIn("id",shixiChengji.getId())
.andNew()
.eq("shixi_id", shixiChengji.getShixiId())
.orNew(
)
.eq("xuesheng_id", shixiChengji.getXueshengId())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ShixiChengjiEntity shixiChengjiEntity = shixiChengjiService.selectOne(queryWrapper);
if(shixiChengjiEntity==null){
shixiChengjiService.updateById(shixiChengji);//根据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());
shixiChengjiService.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<ShixiChengjiEntity> shixiChengjiList = 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){
//循环
ShixiChengjiEntity shixiChengjiEntity = new ShixiChengjiEntity();
// shixiChengjiEntity.setShixiId(Integer.valueOf(data.get(0))); //实习 要改的
// shixiChengjiEntity.setXueshengId(Integer.valueOf(data.get(0))); //学生 要改的
// shixiChengjiEntity.setShixiChengjiUuidNumber(data.get(0)); //成绩编号 要改的
// shixiChengjiEntity.setShixiChengjiTypes(Integer.valueOf(data.get(0))); //成绩结果 要改的
// shixiChengjiEntity.setFenshu(data.get(0)); //成绩分数 要改的
// shixiChengjiEntity.setShixiChengjiYesnoText(data.get(0)); //实习评语 要改的
// shixiChengjiEntity.setInsertTime(date);//时间
// shixiChengjiEntity.setCreateTime(date);//时间
shixiChengjiList.add(shixiChengjiEntity);
//把要查询是否重复的字段放入map中
//成绩编号
if(seachFields.containsKey("shixiChengjiUuidNumber")){
List<String> shixiChengjiUuidNumber = seachFields.get("shixiChengjiUuidNumber");
shixiChengjiUuidNumber.add(data.get(0));//要改的
}else{
List<String> shixiChengjiUuidNumber = new ArrayList<>();
shixiChengjiUuidNumber.add(data.get(0));//要改的
seachFields.put("shixiChengjiUuidNumber",shixiChengjiUuidNumber);
}
}
//查询是否重复
//成绩编号
List<ShixiChengjiEntity> shixiChengjiEntities_shixiChengjiUuidNumber = shixiChengjiService.selectList(new EntityWrapper<ShixiChengjiEntity>().in("shixi_chengji_uuid_number", seachFields.get("shixiChengjiUuidNumber")));
if(shixiChengjiEntities_shixiChengjiUuidNumber.size() >0 ){
ArrayList<String> repeatFields = new ArrayList<>();
for(ShixiChengjiEntity s:shixiChengjiEntities_shixiChengjiUuidNumber){
repeatFields.add(s.getShixiChengjiUuidNumber());
}
return R.error(511,"数据库的该表中的 [成绩编号] 字段已经存在 存在数据为:"+repeatFields.toString());
}
shixiChengjiService.insertBatch(shixiChengjiList);
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 = shixiChengjiService.queryPage(params);
//字典表数据转换
List<ShixiChengjiView> list =(List<ShixiChengjiView>)page.getList();
for(ShixiChengjiView 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);
ShixiChengjiEntity shixiChengji = shixiChengjiService.selectById(id);
if(shixiChengji !=null){
//entity转view
ShixiChengjiView view = new ShixiChengjiView();
BeanUtils.copyProperties( shixiChengji , view );//把实体数据重构到view中
//级联表
ShixiEntity shixi = shixiService.selectById(shixiChengji.getShixiId());
if(shixi != null){
BeanUtils.copyProperties( shixi , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setShixiId(shixi.getId());
}
//级联表
XueshengEntity xuesheng = xueshengService.selectById(shixiChengji.getXueshengId());
if(xuesheng != null){
BeanUtils.copyProperties( xuesheng , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setXueshengId(xuesheng.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody ShixiChengjiEntity shixiChengji, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,shixiChengji:{}",this.getClass().getName(),shixiChengji.toString());
Wrapper<ShixiChengjiEntity> queryWrapper = new EntityWrapper<ShixiChengjiEntity>()
.eq("shixi_id", shixiChengji.getShixiId())
.eq("xuesheng_id", shixiChengji.getXueshengId())
.eq("shixi_chengji_uuid_number", shixiChengji.getShixiChengjiUuidNumber())
.eq("shixi_chengji_types", shixiChengji.getShixiChengjiTypes())
.eq("shixi_chengji_yesno_text", shixiChengji.getShixiChengjiYesnoText())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ShixiChengjiEntity shixiChengjiEntity = shixiChengjiService.selectOne(queryWrapper);
if(shixiChengjiEntity==null){
shixiChengji.setInsertTime(new Date());
shixiChengji.setCreateTime(new Date());
shixiChengjiService.insert(shixiChengji);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
}
论文参考
目 录
摘要 1
Abstract 1
目 录 2
1绪论 4
1.1研究背景与意义 4
1.2国内外研究现状 4
1.3研究内容 5
1.4论文结构 5
1.5本章小结 5
2理论基础 6
2.1 B/S模式 6
2.2 IDEA开发环境 6
2.3 MySQL数据库 6
2.4 Java语言 7
2.5本章小结 7
3需求分析 8
3.1功能需求分析 8
3.2技术需求分析 8
3.3数据需求分析 8
3.4安全需求分析 8
3.5可行性分析 8
3.5.1经济可行性 8
3.5.2技术可行性 9
3.5.3操作可行性 9
3.6本章小结 9
4系统设计 10
4.1系统功能设计 10
4.2数据库设计 10
4.2.1概念设计 10
4.2.2逻辑设计 11
4.3本章小结 14
5系统实现 15
5.1管理员功能模块实现 15
5.1.1管理员登录 15
5.1.2实习管理 15
5.1.3公告管理 15
5.1.4公告类型管理 16
5.3系统测试 16
5.3.1测试概述 16
5.3.2测试结果 17
5.3本章小结 17
6总结与展望 18
参考文献 19
致谢 20