From cb115953879ee007d3157843f9cff0afbb5c2baa Mon Sep 17 00:00:00 2001 From: ChineseTony <13206573871@163.com> Date: Tue, 9 Apr 2019 12:51:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebContent/jsp/AddTbPermission.jsp | 124 +++++++++++++++++ WebContent/jsp/AddTbRole.jsp | 99 ++++++++++++++ WebContent/jsp/Header.jsp | 10 +- WebContent/jsp/QueryTbPermission.jsp | 102 ++++++++++++++ WebContent/jsp/QueryTbRole.jsp | 103 +++++++++++++++ WebContent/jsp/UpdateTbPermission.jsp | 125 ++++++++++++++++++ .../controller/CourseController.class | Bin 6350 -> 6334 bytes .../controller/CourseController.java | 1 - .../controller/TbPermissionController.java | 96 ++++++++++++++ .../controller/TbRoleController.java | 93 +++++++++++++ 10 files changed, 751 insertions(+), 2 deletions(-) create mode 100644 WebContent/jsp/AddTbPermission.jsp create mode 100644 WebContent/jsp/AddTbRole.jsp create mode 100644 WebContent/jsp/QueryTbPermission.jsp create mode 100644 WebContent/jsp/QueryTbRole.jsp create mode 100644 WebContent/jsp/UpdateTbPermission.jsp create mode 100644 src/cn/edu/hrbcu/curriculum/controller/TbPermissionController.java create mode 100644 src/cn/edu/hrbcu/curriculum/controller/TbRoleController.java diff --git a/WebContent/jsp/AddTbPermission.jsp b/WebContent/jsp/AddTbPermission.jsp new file mode 100644 index 0000000..44028bc --- /dev/null +++ b/WebContent/jsp/AddTbPermission.jsp @@ -0,0 +1,124 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + +
+ + + +%IgfUL@j;)T0j6H;q#X8U0EdWQBCubP(mpya-2L6-E};r+v2vn1xZkpX$*pWDS{{k6%kP~k`8R{psVhoomp$Gu t)C!(~kIPGef(9SV c*+W|Z@lIgMF+t2)^EjqeIAnPZH^W#DLAU2iE1ii-Y3I%OKMM8q&lSt=S< zCYdu<6xEgy?jMZC2V#abn23nEHeFWLto%O}d-NeQsh>|q!j^H)0Zsp@ZugY+;z9!^ z><)i(`xI~MXZWDV@+DN_>#onzc|pW{LqRMaFNo!kyP#G>p1hhAjEkUrPf}%X`wxzH z5$7Tau90Mz>!e9Bj!8&nTJzVkkNxsj&P{sgLs26;3!-*$fCx*XT+|6=MU 5Tc(#AcynBWrk zF?b+pA9907;y&gXPk6~wr=M<0h4adO9jL9%_2Cjy#_7W?ytvbcN2vX**}nsak1ViW ioY|0&`I$`#>CCVtO(}lm;@U022G4UUcwvtQTmJ&!r?kTW diff --git a/src/cn/edu/hrbcu/curriculum/controller/CourseController.java b/src/cn/edu/hrbcu/curriculum/controller/CourseController.java index 69411c6..5c20c94 100644 --- a/src/cn/edu/hrbcu/curriculum/controller/CourseController.java +++ b/src/cn/edu/hrbcu/curriculum/controller/CourseController.java @@ -106,7 +106,6 @@ public class CourseController { List examinationmethods = examinationmethodService.selectAllExaminationmethod(); ModelAndView modelAndView = new ModelAndView(); modelAndView.setViewName("/jsp/AddCourse"); - System.out.println(academies.size()); modelAndView.addObject("academies", academies); modelAndView.addObject("coursemodes", coursemodes); modelAndView.addObject("coursetypes", coursetypes); diff --git a/src/cn/edu/hrbcu/curriculum/controller/TbPermissionController.java b/src/cn/edu/hrbcu/curriculum/controller/TbPermissionController.java new file mode 100644 index 0000000..5a06dfb --- /dev/null +++ b/src/cn/edu/hrbcu/curriculum/controller/TbPermissionController.java @@ -0,0 +1,96 @@ +package cn.edu.hrbcu.curriculum.controller; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.servlet.ModelAndView; + +import com.github.pagehelper.PageInfo; +import cn.edu.hrbcu.curriculum.pojo.TbPermission; +import cn.edu.hrbcu.curriculum.pojo.TbRole; +import cn.edu.hrbcu.curriculum.service.TbPermissionService; + +@Controller +@RequestMapping("/TbPermissionController") +public class TbPermissionController { + + @Autowired + TbPermissionService tbPermissionService; + + @RequestMapping("/QueryTbPermission.action") + public ModelAndView QueryTbPermission(@RequestParam(value = "currentPage",required=false, defaultValue="1") Integer currentPage){ + List list = tbPermissionService.selectTbPermissions(currentPage); + + PageInfo page = new PageInfo (list); + + ModelAndView modelAndView = new ModelAndView(); + modelAndView.setViewName("/jsp/QueryTbPermission"); + modelAndView.addObject("pageInfo", page); + modelAndView.addObject("page_url", "/CurriculumSystemManager/TbPermissionController/QueryTbPermission.action"); + + return modelAndView; + } + + @RequestMapping("/QueryAllTbPermission.action") + @ResponseBody + public Object QueryAllTbPermission(){ + List list = tbPermissionService.selectAllPermission(); + return list; + } + + + @RequestMapping("/QueryTbPermissionById.action") + @ResponseBody + public Object QueryTbPermissionById(@RequestParam(value = "id",required=true, defaultValue="1") Long id){ + TbPermission tbPermission_ = new TbPermission(); + tbPermission_.setId(id); + + TbPermission tbPermission = tbPermissionService.selectTbPermissionById(tbPermission_); + return tbPermission; + } + + @RequestMapping("/AddTbPermission.action") + public Object AddTbPermission(TbPermission tbPermission){ + + tbPermissionService.insertPermission(tbPermission); + + return "forward:/TbPermissionController/QueryTbPermission.action"; + } + + @RequestMapping("/DeleteTbPermission.action") + public Object DeleteTbPermission(TbPermission tbPermission){ + + tbPermissionService.deletTbPermission(tbPermission); + + return "forward:/TbPermissionController/QueryTbPermission.action"; + } + + + @RequestMapping("/UpdateTbPermission.action") + public Object UpdateTbRole(TbPermission tbPermission){ + int cnt = tbPermissionService.updateTbPermission(tbPermission); + + return "forward:/TbPermissionController/QueryTbPermission.action"; + } + + @RequestMapping("/toUpdateTbPermission.action") + public Object toUpdateTbPermission(TbPermission tbPermission){ + tbPermission = tbPermissionService.selectTbPermissionById(tbPermission); + ModelAndView modelAndView = new ModelAndView(); + modelAndView.setViewName("/jsp/UpdateTbPermission"); + modelAndView.addObject("tbPermission", tbPermission); + return modelAndView; + } + + @RequestMapping("/toAddTbPermission.action") + public Object toAddTbPermission(){ + ModelAndView modelAndView = new ModelAndView(); + modelAndView.setViewName("/jsp/AddTbPermission"); + return modelAndView; + } + +} diff --git a/src/cn/edu/hrbcu/curriculum/controller/TbRoleController.java b/src/cn/edu/hrbcu/curriculum/controller/TbRoleController.java new file mode 100644 index 0000000..889bedc --- /dev/null +++ b/src/cn/edu/hrbcu/curriculum/controller/TbRoleController.java @@ -0,0 +1,93 @@ +package cn.edu.hrbcu.curriculum.controller; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.servlet.ModelAndView; +import com.github.pagehelper.PageInfo; +import cn.edu.hrbcu.curriculum.pojo.TbRole; +import cn.edu.hrbcu.curriculum.service.TbRoleService; + +@Controller +@RequestMapping("/TbRoleController") +public class TbRoleController { + @Autowired + TbRoleService tbRoleService; + + @RequestMapping("/QueryTbRole.action") + public ModelAndView QueryTbRole(@RequestParam(value = "currentPage",required=false, defaultValue="1") Integer currentPage){ + List list = tbRoleService.selectTbRoles(currentPage); + + PageInfo page = new PageInfo (list); + + ModelAndView modelAndView = new ModelAndView(); + modelAndView.setViewName("/jsp/QueryTbRole"); + modelAndView.addObject("pageInfo", page); + modelAndView.addObject("page_url", "/CurriculumSystemManager/TbRoleController/QueryCourse.action"); + + return modelAndView; + } + + @RequestMapping("/QueryAllTbRole.action") + @ResponseBody + public Object QueryAllTbRole(){ + List list = tbRoleService.selectAllRole(); + return list; + } + + + @RequestMapping("/QueryTbRoleById.action") + @ResponseBody + public Object QueryTbRoleById(@RequestParam(value = "id",required=true, defaultValue="1") Long id){ + TbRole tbRole_ = new TbRole(); + tbRole_.setId(id); + + TbRole course = tbRoleService.selectTbRoleById(tbRole_); + return course; + } + + @RequestMapping("/AddTbRole.action") + public Object AddTbRole(TbRole tbRole){ + + tbRoleService.insertRole(tbRole); + + return "forward:/TbRoleController/QueryTbRole.action"; + } + + @RequestMapping("/DeleteTbRole.action") + public Object DeleteCourse(TbRole tbRole){ + + tbRoleService.deletTbRole(tbRole); + + return "forward:/TbRoleController/QueryTbRole.action"; + } + + @RequestMapping("/UpdateTbRole.action") + public Object UpdateTbRole(TbRole tbRole){ + int cnt = tbRoleService.updateTbRole(tbRole); + + return "forward:/TbRoleController/QueryTbRole.action"; + } + + @RequestMapping("/toUpdateTbRole.action") + public Object toUpdateTbRole(TbRole tbRole){ + tbRole = tbRoleService.selectTbRoleById(tbRole); + ModelAndView modelAndView = new ModelAndView(); + modelAndView.setViewName("/jsp/UpdateTbRole"); + modelAndView.addObject("tbRole", tbRole); + return modelAndView; + } + + @RequestMapping("/toAddTbRole.action") + public Object toAddTbRole(){ + ModelAndView modelAndView = new ModelAndView(); + modelAndView.setViewName("/jsp/AddTbRole"); + return modelAndView; + } + + +} -- Gitee