博主主页:一季春秋
博主简介:专注Java技术领域和毕业设计项目实战、Java、微信小程序、安卓等技术开发,远程调试部署、代码讲解、文档指导、ppt制作等技术指导。
主要内容:毕业设计(Java项目、小程序、安卓等)、简历模板、学习资料、技术咨询。精彩专栏推荐订阅👇🏻👇🏻 不然下次找不到哟
SpringBoot+Vue项目持续更新中
🍅文末获取联系🍅
目录
一、项目介绍
本系统的开发使用Java作为系统开发的开发语言,开发环境选择idea,而B/S结构决定了本系统的兼容性和多员工可操作性,此外选择MySql作为数据库不仅提高了数据安全性更保障了数据的可操作性。
二、项目主要技术
开发语言:Java
使用框架:spring boot
前端技术:JavaScript、Vue 、css3
开发工具:IDEA/MyEclipse/Eclipse、Visual Studio Code
数据库:MySQL 5.7/8.0
数据库管理工具:phpstudy/Navicat
JDK版本:jdk1.8
Maven: apache-maven 3.8.1-bin
三、系统功能
3.1 管理员功能
学院管理:增删改查(模糊查询)
班级管理:增删改查(模糊查询)
用户管理:增删改查(根据学院,班级,用户姓名进行模糊查询)用户属于班级,班级属于学院
教室管理:增删改查(模糊查询)教室名称,教室容纳人数,教室类型这三个字段要有
预约管理:审核该预约能不能通过,如果不能通过给出审核意见
留言管理:查看回复用户的留言
统计功能:教室类型的饼状图,这个月预约次数的折线图
3.2 用户功能
用户管理:查看,修改自己的个人信息
教室预约:可以预约今天明天的教室,按着时间段预约(可多选),如果当前时间超过预约时间段不能预约该时间段的教室,预约教室的时候要有个预约用途,预约教室的时候把当前时间传到数据库,管理员审核的时候可以看到用户发起预约的时间
预约记录查看:查看自己的预约记录,在未审核通过之前可以取消预约,预约过之后可以取消预约释放出来空教室资源,比如小明预约了明天的教室,又取消预约,这个教室可以被其他人预约
留言:用户可以给管理员留言
四、系统实现
4.1 系统前台用户功能实现
系统首页
教室信息
详情信息
4.2 后台管理员模块实现
班级管理
学生管理
教室信息管理
教室预约管理
五、实现代码
5.1 教室信息关键代码
/**
* 教室信息
* 后端接口
* @author
* @email
* @date 2023-04-19 11:51:45
*/
@RestController
@RequestMapping("/jiaoshixinxi")
public class JiaoshixinxiController {
@Autowired
private JiaoshixinxiService jiaoshixinxiService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,JiaoshixinxiEntity jiaoshixinxi,
HttpServletRequest request){
EntityWrapper<JiaoshixinxiEntity> ew = new EntityWrapper<JiaoshixinxiEntity>();
PageUtils page = jiaoshixinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jiaoshixinxi), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,JiaoshixinxiEntity jiaoshixinxi,
HttpServletRequest request){
EntityWrapper<JiaoshixinxiEntity> ew = new EntityWrapper<JiaoshixinxiEntity>();
PageUtils page = jiaoshixinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jiaoshixinxi), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( JiaoshixinxiEntity jiaoshixinxi){
EntityWrapper<JiaoshixinxiEntity> ew = new EntityWrapper<JiaoshixinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( jiaoshixinxi, "jiaoshixinxi"));
return R.ok().put("data", jiaoshixinxiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(JiaoshixinxiEntity jiaoshixinxi){
EntityWrapper< JiaoshixinxiEntity> ew = new EntityWrapper< JiaoshixinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( jiaoshixinxi, "jiaoshixinxi"));
JiaoshixinxiView jiaoshixinxiView = jiaoshixinxiService.selectView(ew);
return R.ok("查询教室信息成功").put("data", jiaoshixinxiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
JiaoshixinxiEntity jiaoshixinxi = jiaoshixinxiService.selectById(id);
return R.ok().put("data", jiaoshixinxi);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
JiaoshixinxiEntity jiaoshixinxi = jiaoshixinxiService.selectById(id);
return R.ok().put("data", jiaoshixinxi);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody JiaoshixinxiEntity jiaoshixinxi, HttpServletRequest request){
jiaoshixinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(jiaoshixinxi);
jiaoshixinxiService.insert(jiaoshixinxi);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody JiaoshixinxiEntity jiaoshixinxi, HttpServletRequest request){
jiaoshixinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(jiaoshixinxi);
jiaoshixinxiService.insert(jiaoshixinxi);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@Transactional
public R update(@RequestBody JiaoshixinxiEntity jiaoshixinxi, HttpServletRequest request){
//ValidatorUtils.validateEntity(jiaoshixinxi);
jiaoshixinxiService.updateById(jiaoshixinxi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
jiaoshixinxiService.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<JiaoshixinxiEntity> wrapper = new EntityWrapper<JiaoshixinxiEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = jiaoshixinxiService.selectCount(wrapper);
return R.ok().put("count", count);
}
/**
* (按值统计)
*/
@RequestMapping("/value/{xColumnName}/{yColumnName}")
public R value(@PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName,HttpServletRequest request) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("xColumn", xColumnName);
params.put("yColumn", yColumnName);
EntityWrapper<JiaoshixinxiEntity> ew = new EntityWrapper<JiaoshixinxiEntity>();
List<Map<String, Object>> result = jiaoshixinxiService.selectValue(params, ew);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for(Map<String, Object> m : result) {
for(String k : m.keySet()) {
if(m.get(k) instanceof Date) {
m.put(k, sdf.format((Date)m.get(k)));
}
}
}
return R.ok().put("data", result);
}
/**
* (按值统计(多))
*/
@RequestMapping("/valueMul/{xColumnName}")
public R valueMul(@PathVariable("xColumnName") String xColumnName,@RequestParam String yColumnNameMul, HttpServletRequest request) {
String[] yColumnNames = yColumnNameMul.split(",");
Map<String, Object> params = new HashMap<String, Object>();
params.put("xColumn", xColumnName);
List<List<Map<String, Object>>> result2 = new ArrayList<List<Map<String,Object>>>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
EntityWrapper<JiaoshixinxiEntity> ew = new EntityWrapper<JiaoshixinxiEntity>();
for(int i=0;i<yColumnNames.length;i++) {
params.put("yColumn", yColumnNames[i]);
List<Map<String, Object>> result = jiaoshixinxiService.selectValue(params, ew);
for(Map<String, Object> m : result) {
for(String k : m.keySet()) {
if(m.get(k) instanceof Date) {
m.put(k, sdf.format((Date)m.get(k)));
}
}
}
result2.add(result);
}
return R.ok().put("data", result2);
}
/**
* (按值统计)时间统计类型
*/
@RequestMapping("/value/{xColumnName}/{yColumnName}/{timeStatType}")
public R valueDay(@PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName, @PathVariable("timeStatType") String timeStatType,HttpServletRequest request) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("xColumn", xColumnName);
params.put("yColumn", yColumnName);
params.put("timeStatType", timeStatType);
EntityWrapper<JiaoshixinxiEntity> ew = new EntityWrapper<JiaoshixinxiEntity>();
List<Map<String, Object>> result = jiaoshixinxiService.selectTimeStatValue(params, ew);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for(Map<String, Object> m : result) {
for(String k : m.keySet()) {
if(m.get(k) instanceof Date) {
m.put(k, sdf.format((Date)m.get(k)));
}
}
}
return R.ok().put("data", result);
}
/**
* (按值统计)时间统计类型(多)
*/
@RequestMapping("/valueMul/{xColumnName}/{timeStatType}")
public R valueMulDay(@PathVariable("xColumnName") String xColumnName, @PathVariable("timeStatType") String timeStatType,@RequestParam String yColumnNameMul,HttpServletRequest request) {
String[] yColumnNames = yColumnNameMul.split(",");
Map<String, Object> params = new HashMap<String, Object>();
params.put("xColumn", xColumnName);
params.put("timeStatType", timeStatType);
List<List<Map<String, Object>>> result2 = new ArrayList<List<Map<String,Object>>>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
EntityWrapper<JiaoshixinxiEntity> ew = new EntityWrapper<JiaoshixinxiEntity>();
for(int i=0;i<yColumnNames.length;i++) {
params.put("yColumn", yColumnNames[i]);
List<Map<String, Object>> result = jiaoshixinxiService.selectTimeStatValue(params, ew);
for(Map<String, Object> m : result) {
for(String k : m.keySet()) {
if(m.get(k) instanceof Date) {
m.put(k, sdf.format((Date)m.get(k)));
}
}
}
result2.add(result);
}
return R.ok().put("data", result2);
}
/**
* 分组统计
*/
@RequestMapping("/group/{columnName}")
public R group(@PathVariable("columnName") String columnName,HttpServletRequest request) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("column", columnName);
EntityWrapper<JiaoshixinxiEntity> ew = new EntityWrapper<JiaoshixinxiEntity>();
List<Map<String, Object>> result = jiaoshixinxiService.selectGroup(params, ew);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for(Map<String, Object> m : result) {
for(String k : m.keySet()) {
if(m.get(k) instanceof Date) {
m.put(k, sdf.format((Date)m.get(k)));
}
}
}
return R.ok().put("data", result);
}
}