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>();
没有合适的资源?快使用搜索试试~ 我知道了~
《毕业设计&代码复用》--大学管理系统-springboot - mybatis - html --毕业设计.zip
共110个文件
class:24个
java:24个
jsp:21个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 195 浏览量
2024-04-10
14:27:29
上传
评论
收藏 484KB ZIP 举报
温馨提示
本人十余年JAVA架构设计经验,擅长JAVA高可用、分布式、高并发系统架构设计。有志于做JAVA系统性的技术提升的同学可与我联系,交个朋友哦~ 本人十余年JAVA架构设计经验,擅长JAVA高可用、分布式、高并发系统架构设计。有志于做JAVA系统性的技术提升的同学可与我联系,交个朋友哦~ 本人十余年JAVA架构设计经验,擅长JAVA高可用、分布式、高并发系统架构设计。有志于做JAVA系统性的技术提升的同学可与我联系,交个朋友哦~
资源推荐
资源详情
资源评论
收起资源包目录
《毕业设计&代码复用》--大学管理系统-springboot - mybatis - html --毕业设计.zip (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
资源评论
季风泯灭的季节
- 粉丝: 696
- 资源: 2920
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功