目录
1.1 项目介绍
在现代教育体系中,学校管理的复杂性和多样性对校园信息系统提出了更高的要求。为了提高教育管理的效率和质量,促进教育资源的优化配置,我们设计并开发了一个综合性的教育管理系统。该系统旨在为学校管理层、教师和学生提供一个一体化的信息服务平台,以实现教育信息的快速流通和高效管理。
背景:
随着教育信息化的不断深入,传统的手工或半自动管理模式已无法满足现代教育的需求。学校需要一个能够集中管理学生信息、成绩、活动、奖学金等数据的平台,同时为教师和学生提供便捷的服务。此外,随着教育政策的不断更新和教育活动的多样化,信息的实时更新和有效传达变得尤为重要。
目的意义:
- 1. 提高管理效率:系统通过集成化的管理模块,使得管理员能够高效地处理学生、教师、成绩、活动等信息,减少了管理工作的复杂性和时间成本。
- 2. 优化资源配置:系统提供的基础数据管理和资源调配功能,有助于学校合理分配教育资源,提高资源利用效率。
- 3. 增强信息透明度:通过公告管理和政策信息管理,系统确保所有用户能够及时获取最新的教育政策和学校通知,增强了信息的透明度和公开性。
- 4. 促进学生发展:系统的学生成绩管理、综合评测管理和奖学金申请管理等功能,有助于学生更好地了解自己的学习情况,激励学生积极进取。
- 5. 加强家校联系:通过活动管理和学生管理,系统为家长提供了了解孩子在校表现的窗口,加强了家校之间的沟通和联系。
综上所述,该教育管理系统的设计与实现,不仅能够为学校管理带来便捷和高效,还能够为教师和学生提供一个全面、便捷的信息服务平台。通过技术手段优化教育管理流程,该系统有望成为推动教育信息化发展的重要工具,为提升教育质量和效率做出贡献。
1.2 开发技术
功能模块结构图
│
├── 管理员
│ ├── 登录
│ ├── 个人中心
│ ├── 管理员管理
│ ├── 基础数据管理
│ ├── 公告管理
│ ├── 老师管理
│ ├── 政策信息管理
│ ├── 学生成绩管理
│ ├── 活动管理
│ ├── 综合评测管理
│ ├── 奖学金申请管理
│ └── 学生管理
│
├── 老师
│ ├── 登录
│ ├── 个人中心
│ ├── 学年管理
│ ├── 公告管理
│ ├── 政策信息管理
│ ├── 学生成绩管理
│ ├── 活动管理
│ ├── 综合评测管理
│ └── 奖学金申请管理
│
└── 学生
├── 登录
├── 个人中心
├── 公告管理
├── 政策信息管理
├── 学生成绩管理
├── 活动管理
├── 综合评测管理
└── 奖学金申请管理
系统MVC框架,请求流程展示:
3.1 学生功能
3.2 老师功能
3.3 管理员功能
DROP TABLE IF EXISTS `chengji`;
CREATE TABLE `chengji` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
`xuesheng_id` int(11) DEFAULT NULL COMMENT '学生',
`chengji_uuid_number` varchar(200) DEFAULT NULL COMMENT '学生成绩编号',
`chengji_name` varchar(200) DEFAULT NULL COMMENT '学生成绩名称 Search111 ',
`xuenian_types` int(11) DEFAULT NULL COMMENT '学年 Search111',
`xueqi_types` int(11) DEFAULT NULL COMMENT '学期 Search111',
`chengji_file` varchar(200) DEFAULT NULL COMMENT '附件',
`chengji_defen` decimal(10,2) DEFAULT NULL COMMENT '成绩',
`chengji_content` longtext COMMENT '备注',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '上传时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show3 listShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8 COMMENT='学生成绩';
CREATE TABLE `dictionary` (
`id` int(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`dic_code` varchar(200) DEFAULT NULL COMMENT '字段',
`dic_name` varchar(200) DEFAULT NULL COMMENT '字段名',
`code_index` int(11) DEFAULT NULL COMMENT '编码',
`index_name` varchar(200) DEFAULT NULL COMMENT '编码名字 Search111 ',
`super_id` int(11) DEFAULT NULL COMMENT '父字段id',
`beizhu` varchar(200) DEFAULT NULL COMMENT '备注',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=utf8 COMMENT='字典表';
CREATE TABLE `gonggao` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
`gonggao_name` varchar(200) DEFAULT NULL COMMENT '公告名称 Search111 ',
`gonggao_photo` varchar(200) DEFAULT NULL COMMENT '公告图片 ',
`gonggao_types` int(11) NOT NULL COMMENT '公告类型 Search111 ',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '发布时间',
`gonggao_content` longtext COMMENT '公告详情 ',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show1 show2 nameShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='公告';
CREATE TABLE `jiangxuejin_shenqing` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
`xuesheng_id` int(11) DEFAULT NULL COMMENT '学生',
`jiangxuejin_shenqing_uuid_number` varchar(200) DEFAULT NULL COMMENT '奖学金申请编号',
`jiangxuejin_shenqing_name` varchar(200) DEFAULT NULL COMMENT '申请标题 Search111 ',
`jiangxuejin_shenqing_types` int(11) DEFAULT NULL COMMENT '奖学金申请类型 Search111',
`jiangxuejin_shenqing_jine` decimal(10,2) DEFAULT NULL COMMENT '申请金额',
`jiangxuejin_shenqing_content` longtext COMMENT '申请理由',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '申请时间',
`jiangxuejin_shenqing_yesno_types` int(11) DEFAULT NULL COMMENT '申请状态 Search111',
`jiangxuejin_shenqing_yesno_text` longtext COMMENT '审核意见',
`jiangxuejin_shenqing_shenhe_time` timestamp NULL DEFAULT NULL COMMENT '审核时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show3 listShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 COMMENT='奖学金申请';
DROP TABLE IF EXISTS `laoshi`;
CREATE TABLE `laoshi` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`username` varchar(200) DEFAULT NULL COMMENT '账户',
`password` varchar(200) DEFAULT NULL COMMENT '密码',
`laoshi_uuid_number` varchar(200) DEFAULT NULL COMMENT '工号 Search111 ',
`laoshi_name` varchar(200) DEFAULT NULL COMMENT '老师姓名 Search111 ',
`laoshi_phone` varchar(200) DEFAULT NULL COMMENT '老师手机号',
`laoshi_id_number` varchar(200) DEFAULT NULL COMMENT '老师身份证号',
`laoshi_photo` varchar(200) DEFAULT NULL COMMENT '老师头像',
`sex_types` int(11) DEFAULT NULL COMMENT '性别',
`laoshi_email` varchar(200) DEFAULT NULL COMMENT '老师邮箱',
`xueyuan_types` int(11) DEFAULT NULL COMMENT '学院 Search111 ',
`zhuanye_types` int(11) DEFAULT NULL COMMENT '专业 Search111 ',
`jinyong_types` int(11) DEFAULT NULL COMMENT '账户状态 Search111 ',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='老师';
CREATE TABLE `token` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`userid` bigint(20) NOT NULL COMMENT '员工id',
`username` varchar(100) NOT NULL COMMENT '员工名',
`tablename` varchar(100) DEFAULT NULL COMMENT '表名',
`role` varchar(100) DEFAULT NULL COMMENT '角色',
`token` varchar(200) NOT NULL COMMENT '密码',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '新增时间',
`expiratedtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '过期时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='token表';
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`username` varchar(100) NOT NULL COMMENT '员工名',
`password` varchar(100) NOT NULL COMMENT '密码',
`role` varchar(100) DEFAULT '管理员' COMMENT '角色',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '新增时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='管理员';
DROP TABLE IF EXISTS `zonghepingce`;
CREATE TABLE `zonghepingce` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
`xuesheng_id` int(11) DEFAULT NULL COMMENT '学生',
`zonghepingce_uuid_number` varchar(200) DEFAULT NULL COMMENT '综合评测编号',
`xuenian_types` int(11) DEFAULT NULL COMMENT '学年 Search111',
`xueqi_types` int(11) DEFAULT NULL COMMENT '学期 Search111',
`zonghepingce_chengji_defen` decimal(10,2) DEFAULT NULL COMMENT '成绩计算得分',
`zonghepingce_huodong_defen` decimal(10,2) DEFAULT NULL COMMENT '活动计算得分',
`zonghepingce_zuizhong_defen` decimal(10,2) DEFAULT NULL COMMENT '最终得分',
`zonghepingce_content` longtext COMMENT '备注',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '评测时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show3 listShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 COMMENT='综合评测';
5.1 奖学金申请Controller模块
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("/jiangxuejinShenqing")
public class JiangxuejinShenqingController {
private static final Logger logger = LoggerFactory.getLogger(JiangxuejinShenqingController.class);
private static final String TABLE_NAME = "jiangxuejinShenqing";
@Autowired
private JiangxuejinShenqingService jiangxuejinShenqingService;
@Autowired
private TokenService tokenService;
@Autowired
private ChengjiService chengjiService;//学生成绩
@Autowired
private DictionaryService dictionaryService;//字典表
@Autowired
private GonggaoService gonggaoService;//公告
@Autowired
private HuodongService huodongService;//活动
@Autowired
private LaoshiService laoshiService;//老师
@Autowired
private NewsService newsService;//政策信息
@Autowired
private XueshengService xueshengService;//学生
@Autowired
private ZonghepingceService zonghepingceService;//综合评测
@Autowired
private UsersService usersService;//管理员
/**
* 后端列表
*/
@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"));
LaoshiEntity laoshiEntity = laoshiService.selectById((Integer) request.getSession().getAttribute("userId"));
if(laoshiEntity != null){
params.put("xueyuanTypes",laoshiEntity.getXueyuanTypes());
params.put("zhuanyeTypes",laoshiEntity.getZhuanyeTypes());
}
} CommonUtil.checkMap(params);
PageUtils page = jiangxuejinShenqingService.queryPage(params);
//字典表数据转换
List<JiangxuejinShenqingView> list =(List<JiangxuejinShenqingView>)page.getList();
for(JiangxuejinShenqingView 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);
JiangxuejinShenqingEntity jiangxuejinShenqing = jiangxuejinShenqingService.selectById(id);
if(jiangxuejinShenqing !=null){
//entity转view
JiangxuejinShenqingView view = new JiangxuejinShenqingView();
BeanUtils.copyProperties( jiangxuejinShenqing , view );//把实体数据重构到view中
//级联表 学生
//级联表
XueshengEntity xuesheng = xueshengService.selectById(jiangxuejinShenqing.getXueshengId());
if(xuesheng != null){
BeanUtils.copyProperties( xuesheng , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "username", "password", "newMoney", "xueshengId"});//把级联的数据添加到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 JiangxuejinShenqingEntity jiangxuejinShenqing, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,jiangxuejinShenqing:{}",this.getClass().getName(),jiangxuejinShenqing.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
else if("学生".equals(role))
jiangxuejinShenqing.setXueshengId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
Wrapper<JiangxuejinShenqingEntity> queryWrapper = new EntityWrapper<JiangxuejinShenqingEntity>()
.eq("xuesheng_id", jiangxuejinShenqing.getXueshengId())
.eq("jiangxuejin_shenqing_name", jiangxuejinShenqing.getJiangxuejinShenqingName())
.eq("jiangxuejin_shenqing_types", jiangxuejinShenqing.getJiangxuejinShenqingTypes())
.in("jiangxuejin_shenqing_yesno_types", new Integer[]{1,2})
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
JiangxuejinShenqingEntity jiangxuejinShenqingEntity = jiangxuejinShenqingService.selectOne(queryWrapper);
if(jiangxuejinShenqingEntity==null){
jiangxuejinShenqing.setInsertTime(new Date());
jiangxuejinShenqing.setJiangxuejinShenqingYesnoTypes(1);
jiangxuejinShenqing.setCreateTime(new Date());
jiangxuejinShenqingService.insert(jiangxuejinShenqing);
return R.ok();
}else {
if(jiangxuejinShenqingEntity.getJiangxuejinShenqingYesnoTypes()==1)
return R.error(511,"有相同的待审核的数据");
else if(jiangxuejinShenqingEntity.getJiangxuejinShenqingYesnoTypes()==2)
return R.error(511,"有相同的审核通过的数据");
else
return R.error(511,"表中有相同数据");
}
}
/**
* 后端修改
*/
@RequestMapping("/update")
public R update(@RequestBody JiangxuejinShenqingEntity jiangxuejinShenqing, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,jiangxuejinShenqing:{}",this.getClass().getName(),jiangxuejinShenqing.toString());
JiangxuejinShenqingEntity oldJiangxuejinShenqingEntity = jiangxuejinShenqingService.selectById(jiangxuejinShenqing.getId());//查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// else if("学生".equals(role))
// jiangxuejinShenqing.setXueshengId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
if("".equals(jiangxuejinShenqing.getJiangxuejinShenqingContent()) || "null".equals(jiangxuejinShenqing.getJiangxuejinShenqingContent())){
jiangxuejinShenqing.setJiangxuejinShenqingContent(null);
}
if("".equals(jiangxuejinShenqing.getJiangxuejinShenqingYesnoText()) || "null".equals(jiangxuejinShenqing.getJiangxuejinShenqingYesnoText())){
jiangxuejinShenqing.setJiangxuejinShenqingYesnoText(null);
}
jiangxuejinShenqingService.updateById(jiangxuejinShenqing);//根据id更新
return R.ok();
}
/**
* 审核
*/
@RequestMapping("/shenhe")
public R shenhe(@RequestBody JiangxuejinShenqingEntity jiangxuejinShenqingEntity, HttpServletRequest request){
logger.debug("shenhe方法:,,Controller:{},,jiangxuejinShenqingEntity:{}",this.getClass().getName(),jiangxuejinShenqingEntity.toString());
JiangxuejinShenqingEntity oldJiangxuejinShenqing = jiangxuejinShenqingService.selectById(jiangxuejinShenqingEntity.getId());//查询原先数据
// if(jiangxuejinShenqingEntity.getJiangxuejinShenqingYesnoTypes() == 2){//通过
// jiangxuejinShenqingEntity.setJiangxuejinShenqingTypes();
// }else if(jiangxuejinShenqingEntity.getJiangxuejinShenqingYesnoTypes() == 3){//拒绝
// jiangxuejinShenqingEntity.setJiangxuejinShenqingTypes();
// }
jiangxuejinShenqingEntity.setJiangxuejinShenqingShenheTime(new Date());//审核时间
jiangxuejinShenqingService.updateById(jiangxuejinShenqingEntity);//审核
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids, HttpServletRequest request){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
List<JiangxuejinShenqingEntity> oldJiangxuejinShenqingList =jiangxuejinShenqingService.selectBatchIds(Arrays.asList(ids));//要删除的数据
jiangxuejinShenqingService.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 xueshengId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//.eq("time", new SimpleDateFormat("yyyy-MM-dd").format(new Date()))
try {
List<JiangxuejinShenqingEntity> jiangxuejinShenqingList = 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){
//循环
JiangxuejinShenqingEntity jiangxuejinShenqingEntity = new JiangxuejinShenqingEntity();
// jiangxuejinShenqingEntity.setXueshengId(Integer.valueOf(data.get(0))); //学生 要改的
// jiangxuejinShenqingEntity.setJiangxuejinShenqingUuidNumber(data.get(0)); //奖学金申请编号 要改的
// jiangxuejinShenqingEntity.setJiangxuejinShenqingName(data.get(0)); //申请标题 要改的
// jiangxuejinShenqingEntity.setJiangxuejinShenqingTypes(Integer.valueOf(data.get(0))); //奖学金申请类型 要改的
// jiangxuejinShenqingEntity.setJiangxuejinShenqingJine(data.get(0)); //申请金额 要改的
// jiangxuejinShenqingEntity.setJiangxuejinShenqingContent("");//详情和图片
// jiangxuejinShenqingEntity.setInsertTime(date);//时间
// jiangxuejinShenqingEntity.setJiangxuejinShenqingYesnoTypes(Integer.valueOf(data.get(0))); //申请状态 要改的
// jiangxuejinShenqingEntity.setJiangxuejinShenqingYesnoText(data.get(0)); //审核意见 要改的
// jiangxuejinShenqingEntity.setJiangxuejinShenqingShenheTime(sdf.parse(data.get(0))); //审核时间 要改的
// jiangxuejinShenqingEntity.setCreateTime(date);//时间
jiangxuejinShenqingList.add(jiangxuejinShenqingEntity);
//把要查询是否重复的字段放入map中
//奖学金申请编号
if(seachFields.containsKey("jiangxuejinShenqingUuidNumber")){
List<String> jiangxuejinShenqingUuidNumber = seachFields.get("jiangxuejinShenqingUuidNumber");
jiangxuejinShenqingUuidNumber.add(data.get(0));//要改的
}else{
List<String> jiangxuejinShenqingUuidNumber = new ArrayList<>();
jiangxuejinShenqingUuidNumber.add(data.get(0));//要改的
seachFields.put("jiangxuejinShenqingUuidNumber",jiangxuejinShenqingUuidNumber);
}
}
//查询是否重复
//奖学金申请编号
List<JiangxuejinShenqingEntity> jiangxuejinShenqingEntities_jiangxuejinShenqingUuidNumber = jiangxuejinShenqingService.selectList(new EntityWrapper<JiangxuejinShenqingEntity>().in("jiangxuejin_shenqing_uuid_number", seachFields.get("jiangxuejinShenqingUuidNumber")));
if(jiangxuejinShenqingEntities_jiangxuejinShenqingUuidNumber.size() >0 ){
ArrayList<String> repeatFields = new ArrayList<>();
for(JiangxuejinShenqingEntity s:jiangxuejinShenqingEntities_jiangxuejinShenqingUuidNumber){
repeatFields.add(s.getJiangxuejinShenqingUuidNumber());
}
return R.error(511,"数据库的该表中的 [奖学金申请编号] 字段已经存在 存在数据为:"+repeatFields.toString());
}
jiangxuejinShenqingService.insertBatch(jiangxuejinShenqingList);
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));
CommonUtil.checkMap(params);
PageUtils page = jiangxuejinShenqingService.queryPage(params);
//字典表数据转换
List<JiangxuejinShenqingView> list =(List<JiangxuejinShenqingView>)page.getList();
for(JiangxuejinShenqingView c:list)
dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段
return R.ok().put("data", page);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Integer id, HttpServletRequest request){
logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
JiangxuejinShenqingEntity jiangxuejinShenqing = jiangxuejinShenqingService.selectById(id);
if(jiangxuejinShenqing !=null){
//entity转view
JiangxuejinShenqingView view = new JiangxuejinShenqingView();
BeanUtils.copyProperties( jiangxuejinShenqing , view );//把实体数据重构到view中
//级联表
XueshengEntity xuesheng = xueshengService.selectById(jiangxuejinShenqing.getXueshengId());
if(xuesheng != null){
BeanUtils.copyProperties( xuesheng , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "username", "password", "newMoney", "xueshengId"});//把级联的数据添加到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 JiangxuejinShenqingEntity jiangxuejinShenqing, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,jiangxuejinShenqing:{}",this.getClass().getName(),jiangxuejinShenqing.toString());
Wrapper<JiangxuejinShenqingEntity> queryWrapper = new EntityWrapper<JiangxuejinShenqingEntity>()
.eq("xuesheng_id", jiangxuejinShenqing.getXueshengId())
.eq("jiangxuejin_shenqing_uuid_number", jiangxuejinShenqing.getJiangxuejinShenqingUuidNumber())
.eq("jiangxuejin_shenqing_name", jiangxuejinShenqing.getJiangxuejinShenqingName())
.eq("jiangxuejin_shenqing_types", jiangxuejinShenqing.getJiangxuejinShenqingTypes())
.in("jiangxuejin_shenqing_yesno_types", new Integer[]{1,2})
.eq("jiangxuejin_shenqing_yesno_text", jiangxuejinShenqing.getJiangxuejinShenqingYesnoText())
// .notIn("jiangxuejin_shenqing_types", new Integer[]{102})
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
JiangxuejinShenqingEntity jiangxuejinShenqingEntity = jiangxuejinShenqingService.selectOne(queryWrapper);
if(jiangxuejinShenqingEntity==null){
jiangxuejinShenqing.setInsertTime(new Date());
jiangxuejinShenqing.setJiangxuejinShenqingYesnoTypes(1);
jiangxuejinShenqing.setCreateTime(new Date());
jiangxuejinShenqingService.insert(jiangxuejinShenqing);
return R.ok();
}else {
if(jiangxuejinShenqingEntity.getJiangxuejinShenqingYesnoTypes()==1)
return R.error(511,"有相同的待审核的数据");
else if(jiangxuejinShenqingEntity.getJiangxuejinShenqingYesnoTypes()==2)
return R.error(511,"有相同的审核通过的数据");
else
return R.error(511,"表中有相同数据");
}
}
}
5.2 奖学金申请Service模块
package com.service;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.JiangxuejinShenqingEntity;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.lang.Nullable;
import java.util.List;
/**
* 奖学金申请 服务类
*/
public interface JiangxuejinShenqingService extends IService<JiangxuejinShenqingEntity> {
/**
* @param params 查询参数
* @return 带分页的查询出来的数据
*/
PageUtils queryPage(Map<String, Object> params);
}
5.3 奖学金申请ServiceImpl模块
package com.service.impl;
import com.utils.StringUtil;
import com.service.DictionaryService;
import com.utils.ClazzDiff;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.lang.reflect.Field;
import java.util.*;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import com.utils.PageUtils;
import com.utils.Query;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import com.dao.JiangxuejinShenqingDao;
import com.entity.JiangxuejinShenqingEntity;
import com.service.JiangxuejinShenqingService;
import com.entity.view.JiangxuejinShenqingView;
/**
* 奖学金申请 服务实现类
*/
@Service("jiangxuejinShenqingService")
@Transactional
public class JiangxuejinShenqingServiceImpl extends ServiceImpl<JiangxuejinShenqingDao, JiangxuejinShenqingEntity> implements JiangxuejinShenqingService {
@Override
public PageUtils queryPage(Map<String,Object> params) {
Page<JiangxuejinShenqingView> page =new Query<JiangxuejinShenqingView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,params));
return new PageUtils(page);
}
}
5.4 奖学金申请Dao模块
package com.dao;
import com.entity.JiangxuejinShenqingEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.JiangxuejinShenqingView;
/**
* 奖学金申请 Dao 接口
*
* @author
*/
public interface JiangxuejinShenqingDao extends BaseMapper<JiangxuejinShenqingEntity> {
List<JiangxuejinShenqingView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}
摘要... I
Abstract... II
1 绪论... 1
1.1 项目简介... 1
1.2 调查研究... 1
1.2.1 研究背景及意义... 1
1.2.2 国内外研究现状... 2
1.2.3 研究主要内容... 2
1.3 论文的章节安排... 3
2 系统相关技术介绍... 4
2.1 Java语言... 4
2.2 SpringBoot框架... 4
2.3 Vue框架... 4
2.4 MySQL数据库... 4
3 系统需求分析... 6
3.1 可行性分析... 6
3.1.1 技术可行性... 6
3.1.2 经济可行性... 6
3.1.3 操作可行性... 6
3.2 系统功能需求... 6
3.2.1 用户端功能需求... 6
3.2.2 XX端功能需求... 6
3.2.3 管理员端功能需求... 6
3.3 系统性能需求... 6
4 系统总体设计... 7
4.1 系统总体架构设计... 7
4.2 系统的功能设计... 7
4.3 数据库设计... 7
4.3.1 概念设计E-R图... 7
4.3.2 逻辑设计关系模式... 7
4.3.3 数据库物理设计... 7
5 系统详细实现... 14
5.1 系统实现环境... 14
5.2 用户端... 14
5.2.1 登录页面... 14
5.2.2 注册页面... 14
5.2.3 XXXX页面... 14
5.2.4 XXXX页面... 14
5.2.5 XXXX页面... 14
5.3 XXXX端... 15
5.3.1 XXXX页面... 15
5.3.2 XXXX页面... 15
5.3.3 XXXX页面... 15
5.3.4 XXXX页面... 15
5.4 管理端... 15
5.4.1 用户管理页面... 15
5.4.2 XXXX页面... 15
5.4.3 XXXX页面... 16
5.4.4 XXXX页面... 16
6 系统测试... 16
6.1 测试目的... 16
6.2 测试方法... 16
6.3 测试用例... 16
6.3.1 XXXX测试... 16
6.3.2 XXXX测试... 16
6.4 测试结果... 16
结论... 17
参考文献... 18
致谢... 19
更多源码:
感谢大家的阅读,如有不懂的问题可以评论区交流或私聊!
喜欢文章可以点赞、收藏、关注、评论啦
→下方联系方式获取源码←