package cn.jbit.controller;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import cn.jbit.entity.Announcement;
import cn.jbit.entity.Classroom;
import cn.jbit.entity.Course;
import cn.jbit.entity.Mustbedone;
import cn.jbit.entity.Office;
import cn.jbit.entity.Student;
import cn.jbit.entity.Teacher;
import cn.jbit.service.OfficeService;
@Controller
@RequestMapping("/office")
public class officeController {
@Autowired
private OfficeService officeService;
@ResponseBody
@RequestMapping(value = "/login",method=RequestMethod.POST,produces = "application/json;charset=utf-8")
public Map<String,String> login(String account,String password,HttpSession session) {
Map<String, String> map = new HashMap<String, String>();
Office office=officeService.login(account, password);
if(office!=null) {
session.setAttribute("Office", office);
map.put("account", office.getOfficeId());
}
return map;
}
@RequestMapping(value="/showMain",method=RequestMethod.GET)
public String showOffice_main(HttpSession session,Model model) {
Office office= (Office) session.getAttribute("Office");
model.addAttribute("OfficeUser", office);
System.out.println(office.toString());
return "office_main";
}
@ResponseBody
@RequestMapping(value = "/update",method=RequestMethod.POST,produces = "application/json;charset=utf-8")
public Map<String,Object> update(Office office,HttpSession session) {
System.out.println(office.toString());
Map<String, Object> map = new HashMap<String, Object>();
if(officeService.update(office)==0) {
map.put("success", "修改错误!你填入的信息不符合信息规则");
}else {
session.removeAttribute("Office");
session.setAttribute("Office", office);
map.put("success", "修改成功!");
}
return map;
}
@ResponseBody
@RequestMapping(value = "/AddAnnouncement",method=RequestMethod.POST,produces = "application/json;charset=utf-8")
public Map<String,Object> AddAnnouncement(Announcement announcement) {
announcement.setReleaseTime(new Date());
announcement.setFrequency(0);
Map<String, Object> map = new HashMap<String, Object>();
if(officeService.AddAnnouncement(announcement)==0) {
map.put("success", "新增错误!你填入的信息不符合信息规则");
}else {
map.put("success", "新增成功!");
}
return map;
}
@ResponseBody
@RequestMapping(value = "/getStudents",method=RequestMethod.GET,produces = "application/json;charset=utf-8")
public Map<String,List<Student>> getStudents(Integer pageNO) {
Map<String, List<Student>> map = new HashMap<String, List<Student>>();
List<Student> data=officeService.getStudents(pageNO);
map.put("data", data);
return map;
}
@ResponseBody
@RequestMapping(value = "/geTeachers",method=RequestMethod.GET,produces = "application/json;charset=utf-8")
public Map<String,List<Teacher>> geTeachers(Integer pageNO) {
Map<String, List<Teacher>> map = new HashMap<String, List<Teacher>>();
List<Teacher> data=officeService.geTeachers(pageNO);
map.put("data", data);
return map;
}
@ResponseBody
@RequestMapping(value = "/getCountStudent",method=RequestMethod.GET,produces = "application/json;charset=utf-8")
public Map<String,Integer> getCountStudent() {
Map<String, Integer> map = new HashMap<String, Integer>();
int count=officeService.getCountStudent();
map.put("data", count);
return map;
}
@ResponseBody
@RequestMapping(value = "/getCountTeachers",method=RequestMethod.GET,produces = "application/json;charset=utf-8")
public Map<String,Integer> getCountTeachers() {
Map<String, Integer> map = new HashMap<String, Integer>();
int count=officeService.getCountTeachers();
map.put("data", count);
return map;
}
@ResponseBody
@RequestMapping(value = "/deleteStudent",method=RequestMethod.POST,produces = "application/json;charset=utf-8")
public Map<String, String> deleteStudent(int id){
Map<String, String> map = new HashMap<String, String>();
if(officeService.deleteStudent(id)==0) {
map.put("data", "删除失败!");
}else {
map.put("data", "删除成功!");
}
return map;
}
@ResponseBody
@RequestMapping(value = "/deleteTeachers",method=RequestMethod.POST,produces = "application/json;charset=utf-8")
public Map<String, String> deleteTeachers(int id){
Map<String, String> map = new HashMap<String, String>();
if(officeService.deleteTeachers(id)==0) {
map.put("data", "删除失败!");
}else {
map.put("data", "删除成功!");
}
return map;
}
@ResponseBody
@RequestMapping(value = "/AddStudent",method=RequestMethod.POST,produces = "application/json;charset=utf-8")
public Map<String, String> AddStudent(Student student){
System.out.println(student.toString());
Map<String, String> map = new HashMap<String, String>();
if(officeService.AddStudent(student)==0) {
map.put("data", "新增失败!");
}else {
map.put("data", "新增成功!");
}
return map;
}
@ResponseBody
@RequestMapping(value = "/AddTeachers",method=RequestMethod.POST,produces = "application/json;charset=utf-8")
public Map<String, String> AddTeachers(Teacher teacher){
System.out.println(teacher.toString());
Map<String, String> map = new HashMap<String, String>();
if(officeService.AddTeachers(teacher)==0) {
map.put("data", "新增失败!");
}else {
map.put("data", "新增成功!");
}
return map;
}
@ResponseBody
@RequestMapping(value = "/getStudent",method=RequestMethod.GET,produces = "application/json;charset=utf-8")
public Map<String, Boolean> getStudent(String account){
Map<String, Boolean> map = new HashMap<String, Boolean>();
if(officeService.getStudent(account)!=null) {
map.put("data", false);
}else {
map.put("data", true);
}
return map;
}
@ResponseBody
@RequestMapping(value = "/getTeacher",method=RequestMethod.GET,produces = "application/json;charset=utf-8")
public Map<String, Boolean> getTeacher(String account){
Map<String, Boolean> map = new HashMap<String, Boolean>();
if(officeService.getTeacher(account)!=null) {
map.put("data", false);
}else {
map.put("data", true);
}
return map;
}
@ResponseBody
@RequestMapping(value = "/getClassrooms",method=RequestMethod.GET,produces = "application/json;charset=utf-8")
public Map<String, List<Classroom>> getClassrooms(int pageNO){
Map<String, List<Classroom>> map = new HashMap<String, List<Classroom>>();
List<Classroom> list=officeService.getClassrooms(pageNO);
map.put("data", list);
return map;
}
@ResponseBody
@RequestMapping(value = "/deleteClassrooms",method=RequestMethod.POST,produces = "application/json;charset=utf-8")
public Map<String, String> deleteClassrooms(int id) {
Map<String, String> map = new HashMap<String, String>();
if(officeService.deleteClassrooms(id)==0) {
map.put("data", "删除失败!");
}else {
map.put("data", "删除成功!");
}
return map;
}
@ResponseBody
@RequestMapping(value = "/AddClassrooms",method=RequestMethod.POST,produces = "application/json;charset=utf-8")
public Map<String, String> AddClassrooms(Classroom classroom) {
Map<String, String> map = new HashMap<String, String>();
if(officeService.AddClassrooms(classroom)==0) {
map.put("data", "新增失败!");
}else {
map.put("data", "新增成功!");
}
return map;
}
@ResponseBody
@RequestMapping(value = "/getClassroomsCount",method=RequestMethod.GET,produces = "application/json;charset=utf-8")
public Map<String, Integer> getClassroomsCount() {
Map<String, Integer> map = new HashMap<String, Integer>();
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
毕业设计,基于SSM+Bootstrap+MySql开发的大学管理系统,内含Java完整源代码,数据库脚本 大学管理系统是一种用于协助大学进行教学、科研、管理等方面的高效工具。它能够有效提高大学的运作效率,降低人力成本,并确保各项工作的有序进行。大学管理系统主要包括以下几个功能模块:1. 学生信息管理:包括学生的基本信息、课程信息、成绩信息等,便于教师快速了解学生情况,为教学和科研提供数据支持。2. 教师信息管理:包括教师的基本信息、授课信息、考试信息等,便于学生了解教师情况,为选择合适的导师提供参考。3. 课程信息管理:包括课程的基本信息、授课信息、考试信息等,便于教师和学生在教学过程中快速了解课程信息。4. 成绩信息管理:包括学生的考试成绩、平时成绩、综合成绩等,便于教师了解学生的学习情况,为教学和科研提供数据支持。5. 选课管理:包括学生选课、退课、课程调整等,便于学生根据自己的兴趣和需求选择课程,提高学习效果。6. 财务管理:包括课程费用、教师费用、设备费用等,便于学校进行财务预算和控制,确保资金的合理使用。7. 报表统计:包括学生信息、教师信息、课程信息、成绩信息等报表,便
资源推荐
资源详情
资源评论
收起资源包目录
毕业设计,基于SSM+Bootstrap+MySql开发的大学管理系统,内含Java完整源代码,数据库脚本 (110个子文件)
officeController.class 12KB
TeacherController.class 11KB
StudentController.class 8KB
OfficeServiceImpl.class 4KB
TeacherServiceImpl.class 4KB
StudentServiceImpl.class 3KB
Mustbedone.class 3KB
Curriculum.class 3KB
Student.class 2KB
Question.class 2KB
indexController.class 2KB
Teacher.class 2KB
Achievement.class 2KB
Course.class 2KB
Announcement.class 2KB
Answer.class 2KB
OfficeDao.class 2KB
TeacherDao.class 2KB
Classroom.class 2KB
OfficeService.class 2KB
TeacherService.class 1KB
StudentDao.class 1KB
Office.class 996B
StudentService.class 874B
.classpath 1KB
org.eclipse.wst.common.component 655B
org.eclipse.wst.jsdt.ui.superType.container 49B
bootstrap.css 118KB
officeController.java 10KB
TeacherController.java 9KB
StudentController.java 6KB
OfficeServiceImpl.java 4KB
TeacherServiceImpl.java 3KB
OfficeDao.java 2KB
StudentServiceImpl.java 2KB
TeacherDao.java 2KB
Mustbedone.java 2KB
OfficeService.java 2KB
Curriculum.java 1KB
Student.java 1KB
Teacher.java 1KB
indexController.java 1KB
TeacherService.java 1KB
Question.java 1KB
Course.java 1KB
StudentDao.java 1KB
Answer.java 1KB
Announcement.java 1KB
Achievement.java 1KB
Classroom.java 866B
StudentService.java 819B
Office.java 475B
jQuery.js 83KB
bootstrap.js 36KB
tool.js 3KB
verification.js 1KB
.jsdtscope 626B
schedule.jsp 10KB
registered.jsp 8KB
student_main.jsp 6KB
teacher_main.jsp 6KB
Reply.jsp 5KB
Reply.jsp 5KB
index.jsp 5KB
login.jsp 4KB
curriculum.jsp 4KB
office_main.jsp 4KB
elective.jsp 3KB
student.jsp 3KB
fk_main.jsp 3KB
TeacherTimetable.jsp 2KB
teacher.jsp 2KB
student.jsp 2KB
Question.jsp 2KB
addAnnouncement.jsp 2KB
compulsory.jsp 2KB
compulsory.jsp 1KB
Achievement.jsp 1KB
MANIFEST.MF 110B
org.eclipse.wst.jsdt.ui.superType.name 6B
login_pic.png 199KB
dada.png 97KB
aaa.png 11KB
touxian.png 10KB
org.eclipse.jdt.core.prefs 605B
org.eclipse.core.resources.prefs 302B
org.eclipse.jst.j2ee.ejb.annotations.xdoclet.prefs 112B
org.eclipse.m2e.core.prefs 86B
org.eclipse.wst.validation.prefs 48B
.project 2KB
log4j.properties 3KB
log4j.properties 3KB
database.properties 243B
database.properties 243B
pom.properties 198B
ab.sql 10KB
pom.xml 6KB
pom.xml 6KB
TeacherDao.xml 6KB
TeacherDao.xml 6KB
共 110 条
- 1
- 2
资源评论
流华追梦
- 粉丝: 4639
- 资源: 2155
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- n.cpp
- jdk-8u411-windows-x64下载安装可用
- vgg模型-图像分类算法对水果识别-不含数据集图片-含逐行注释和说明文档.zip
- KMP算法(Knuth-Morris-Pratt算法
- vgg模型-python语言pytorch框架训练识别化妆品分类-不含数据集图片-含逐行注释和说明文档.zip
- KMP算法(Knuth-Morris-Pratt算法
- shufflenet模型-基于人工智能的卷积网络训练识别狗的表情-不含数据集图片-含逐行注释和说明文档.zip
- shufflenet模型-python语言pytorch框架训练识别张嘴闭嘴-不含数据集图片-含逐行注释和说明文档.zip
- resnet模型-基于人工智能的卷积网络训练识别面部表情识别-不含数据集图片-含逐行注释和说明文档
- resnet模型-python语言pytorch框架训练识别香蕉品质-不含数据集图片-含逐行注释和说明文档.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功