package com.shencangblue.design.icrs.controller;
import com.shencangblue.design.icrs.model.ClassRoom;
import com.shencangblue.design.icrs.model.Meeting;
import com.shencangblue.design.icrs.model.User;
import com.shencangblue.design.icrs.result.Result;
import com.shencangblue.design.icrs.result.ResultFactory;
import com.shencangblue.design.icrs.service.MeetingService;
import com.shencangblue.design.icrs.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
@RestController
@RequestMapping("/api")
public class MeetingController {
@Resource
MeetingService meetingService;
@Resource
UserService userService;
Timestamp nowTime;
Timestamp tomTime;
/**
* 保存或者修改会议活动
*
* @param meeting 活动与会议
* @return 封装的提示消息
*/
@RequestMapping("/meeting/save")
public Result save(@RequestBody Meeting meeting) {
meetingService.save(meeting);
if (meetingService.getById(meeting.getMeetingId()) != null) {
return ResultFactory.buildSuccessResult("添加成功");
}
return ResultFactory.buildFailResult("添加失败");
}
/**
* 删除指定活动
*
* @param meeting 要删除指定活动
* @return 封装的封装消息
*/
@RequestMapping("/meeting/delete")
public Result delete(@RequestBody Meeting meeting) {
System.out.println(meeting.getMeetingId());
meetingService.delete(meeting.getMeetingId());
return ResultFactory.buildSuccessResult("success");
}
/**
* 查找所有会议
*
* @return 封装好的所有会议信息
*/
@RequestMapping("/meeting")
public Result getAll() {
return ResultFactory.buildSuccessResult(meetingService.getAll());
}
/**
* 获取活动数量
*
* @return 封装好的活动数量
*/
@RequestMapping("/meeting/count")
public Result getAllCount() {
return ResultFactory.buildSuccessResult(meetingService.CountByAllMeeting());
}
/**
* 获取指定用户的活动
*
* @param requestUser 要查找的用户
* @return 封装好活动信息列表
*/
@RequestMapping("/meeting/get/user")
public Result getAllMeetingByUsername(@RequestBody User requestUser) {
return ResultFactory.buildSuccessResult(meetingService.findAllByStuId(requestUser.getUsername()));
}
/**
* 获取管理员的活动
*
* @return 封装好的管理员活动
*/
@RequestMapping("/meeting/get/admin")
public Result getAllMeetingByAdmin() {
return ResultFactory.buildSuccessResult(meetingService.findAllByStuId("admin"));
}
/**
* 查询用户可用的活动
*
* @param requestUser 要查询的用户
* @return 封装好的用户
*/
@RequestMapping("/meeting/get/user_used")
public Result getAllMeetingByUsernameUsable(@RequestBody User requestUser) {
return ResultFactory.buildSuccessResult(meetingService.findAllByStuIdUsable(requestUser.getUsername()));
}
/**
* 取消活动
*
* @param meeting 要取消的活动
* @return 封装好的取消提示
*/
@RequestMapping("/meeting/cancel")
public Result cancelMeeting(@RequestBody Meeting meeting) {
Meeting meeting_s = meetingService.getById(meeting.getMeetingId());
meeting_s.setStatus(0);
meeting_s.setCanceledTime(meeting.getCanceledTime());
meeting_s.setCanceledReason(meeting.getCanceledReason());
meetingService.save(meeting_s);
return ResultFactory.buildSuccessResult("取消成功");
}
/**
* 查询用户取消的活动
*
* @param requestUser 要查询的用户
* @return 封装好的活动列表
*/
@RequestMapping("/meeting/get/user_cancel")
public Result getAllMeetingByUsernameCanceled(@RequestBody User requestUser) {
return ResultFactory.buildSuccessResult(meetingService.findAllByStuIdCancel(requestUser.getUsername()));
}
/**
* 查询用户超时活动
*
* @param requestUser 要查询的用户
* @return 封装好的查询结果
*/
@RequestMapping("/meeting/get/user_timeout")
public Result getAllMeetingByUsernameTimeout(@RequestBody User requestUser) {
return ResultFactory.buildSuccessResult(meetingService.findAllByStuIdTimeout(requestUser.getUsername()));
}
/**
* 查询所有可用的活动数量
*
* @return 封装好的可用活动数量
*/
@RequestMapping("/meeting/get/count/classify/usable")
public Result getAllMeetingCountClassifyUsable() {
return ResultFactory.buildSuccessResult(meetingService.CountByAllMeetingUsable());
}
/**
* 查询所有取消和超时的活动
*
* @return 封装好的超时和取消活动数量
*/
@RequestMapping("/meeting/get/count/classify/c&t")
public Result getAllMeetingCountClassifyCancelAndTimeout() {
return ResultFactory.buildSuccessResult(meetingService.CountByAllMeetingCancelAndTimeout());
}
/**
* 查询当前日期所有教室预约情况
*
* @return 预约情况
*/
@RequestMapping("/queryReservationOfCurrentDate")
public Result QueryReservationOfCurrentDate() {
//List<List<List<Integer>>> d2AList = new ArrayList<List<List<Integer>>>();
List<int[]> list = new ArrayList<>();
nowTime = new Timestamp(new Date().getTime());
tomTime = new Timestamp(new Date().getTime());
nowTime.setHours(0);
nowTime.setSeconds(0);
nowTime.setMinutes(0);
nowTime.setNanos(0);
tomTime.setHours(0);
tomTime.setSeconds(0);
tomTime.setMinutes(0);
tomTime.setNanos(0);
tomTime.setDate(tomTime.getDate() + 1);
int count = 0;
for (Meeting meeting : meetingService.findAllByStartTimeBetweenAndStatusGreaterThan(nowTime, tomTime, 0)) {
list.add(new int[]{count, meeting.getStartTime().getHours(), meeting.getNumberOfParticipants()});
count++;
}
return ResultFactory.buildSuccessResult(list);
}
/**
* 查询活动预约的状态
*
* @return
*/
@RequestMapping("/queryReservationOfCurrentDateRoom")
public Result QueryReservationOfCurrentDateRoom() {
List<String> list = new ArrayList<>();
nowTime = new Timestamp(new Date().getTime());
tomTime = new Timestamp(new Date().getTime());
nowTime.setHours(0);
nowTime.setSeconds(0);
nowTime.setMinutes(0);
nowTime.setNanos(0);
tomTime.setHours(0);
tomTime.setSeconds(0);
tomTime.setMinutes(0);
tomTime.setNanos(0);
tomTime.setDate(tomTime.getDate() + 1);
for (Meeting meeting : meetingService.findAllByStartTimeBetweenAndStatusGreaterThan(nowTime, tomTime, 0)) {
list.add(meeting.getRoomName());
;
}
return ResultFactory.buildSuccessResult(list);
}
/**
* 查询活动是否结束
* @return 封装好的活动状态提升
*/
@RequestMapping("/checkMeetBegin")
public Result checkMeetBegin() {
Iterable<Meeting> meetings = meetingService.findAllByStartTimeAfterAndEndTimeBefore(nowTime, nowTime);
nowTime = new Timestamp(new Date().getTime());
for (Meeting meeting : meetings) {
meeting.setStatus(2);
}
meetingService.saveAll(meetings);
return Res
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
这是一个基于SpringBoot+Vue的教室图书馆预约系统的源码资源包。 系统后台采用SpringBoot框架,SpringBoot是一个基于Java的开源框架,它可以简化Spring应用的初始搭建以及开发过程。SpringBoot集成了大量的库和工具,使得开发者可以更专注于业务逻辑的开发。 系统前端采用Vue.js框架,Vue.js是一个用于构建用户界面的JavaScript框架,它以数据驱动和组件化的思想让开发者能够轻松构建出美观且易于维护的用户界面。 此外,这个资源包还包括了项目介绍文档
资源推荐
资源详情
资源评论
收起资源包目录
springboot+vue教室图书馆预约管理系统.zip (500个子文件)
089f8052a606dd8515c7b98d643bfee29a2b721d 502B
14abb7bd466c502d8ea6ebe7139675956d0dfa4d 0B
3d3a075e3c0137519ada14c88b06ca7b2dee627e 259B
442292b8a7efeabbe4cc176709b833b1792140ec 0B
4ab759e8de82586c64d9c77e10880bbfccca4f61 78B
506f83a3949634e8ba04b7db1ae6617aef8c0135 145B
8596d4e1e5662ec3f55ef6161ca6e0a5ebed3fbb 323B
8baa74a0994b44f1b2f4e5ebdf50a75ec1fe8c24 316B
MeetingController.class 8KB
User.class 7KB
MeetingService.class 7KB
ClassRoomService.class 7KB
UserService.class 7KB
StudentService.class 6KB
ClassRoomController.class 6KB
RedisService.class 6KB
AdminRoleService.class 5KB
AdminMenuService.class 5KB
BeanUtils.class 5KB
AdminRole.class 5KB
AdminMenu.class 5KB
JotterArticle.class 5KB
Book.class 5KB
AdminPermissionService.class 5KB
UserDTO.class 5KB
ShiroConfiguration.class 5KB
Student.class 4KB
Meeting.class 4KB
LibraryController.class 4KB
LoginController.class 4KB
RoleController.class 4KB
StudentController.class 4KB
URLPathMatchingFilter.class 4KB
User$UserBuilder.class 3KB
ICRSRealm.class 3KB
UserController.class 3KB
AdminPermission.class 3KB
AdminRolePermissionService.class 3KB
BookService.class 3KB
AdminUserRoleService.class 3KB
MeetingDao.class 3KB
AdminRoleMenuService.class 3KB
AdminRole$AdminRoleBuilder.class 3KB
JotterController.class 3KB
Result.class 2KB
ClassRoom.class 2KB
AdminRolePermission.class 2KB
MyWebConfigurer.class 2KB
AdminRoleMenu.class 2KB
AdminUserRole.class 2KB
DepartmentController.class 2KB
Category.class 2KB
JotterArticleService.class 2KB
HardwareService.class 2KB
DepartmentService.class 2KB
CategoryService.class 2KB
DefaultExceptionHandler.class 2KB
ResultFactory.class 2KB
ResultCode.class 1KB
Department.class 1KB
MenuController.class 1KB
HardwareController.class 1KB
ErrorConfig.class 1KB
ClassRoomDao.class 1KB
StudentDao.class 1KB
StringUtils.class 1KB
OutputConverter.class 1KB
GlobalDefaultExceptionHandler.class 1021B
ImageInfoUtils.class 990B
SpringContextUtils.class 932B
BookDAO.class 872B
StartController.class 865B
AdminRolePermissionDao.class 818B
AdminRoleMenuDao.class 788B
IcrsApplication.class 757B
UserDAO.class 663B
BeanUtilsException.class 650B
AdminMenuDao.class 645B
AdminUserRoleDao.class 601B
AdminPermissionDao.class 513B
JotterArticleDAO.class 496B
AdminRoleDao.class 489B
BDAipBodyAnalysis.class 447B
CategoryDAO.class 365B
DepartmentDao.class 356B
MeetingParticipantsDao.class 158B
CountDao.class 130B
mvnw.cmd 6KB
markdown.css 13KB
iconfont.css 3KB
reset.css 2KB
dfc98451b348fd84e9d0b542c2c02009ff0de0ef 178B
说明.docx 12KB
e293a9a8224917462fbcbdc9db26809336da5329 0B
iconfont.eot 3KB
.gitignore 333B
.gitignore 214B
.gitignore 184B
index.html 654B
new.ico 17KB
共 500 条
- 1
- 2
- 3
- 4
- 5
资源评论
Java毕设王
- 粉丝: 7337
- 资源: 1083
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- mysql修改密码.md
- 微信浏览器网页版打开插件 支持 Edge / Chrome / Chromium 内核:Wechat-need-web
- 国家开放大学电大化工制图形考任务答案
- 基于python+sqlite实现知识图谱的农作物病虫害防治智能问答平台
- 移动通信系统ofdm的STO和CFO matlab
- 2024年全国职业院校技能大赛集成电路应用开发赛项竞赛试题(03卷)
- 基于CRT(远程访问终端)+ARM(GEC)+Linux+C语言的视频监控系统源码+文档说明.zip
- 用vue.js开发微信app
- CentOS-7-x86-64-Minimal-2009-迷你版系统镜像
- wireshark抓包软件
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功