标签:row 登录模块 http move 参考资料 turn mod 角色 ora
(1)登录模块;
(2)角色管理模块:共有超级管理员、学生宿舍管理员、办公房管理员、周转房管理员、实验室管理员五种管理员,每个管理员所拥有的权限不同,超级管理员可增加、修改、删除各管理人员以及权限;
(3)管理员ID模块:记录管理员信息,拥有该权限的管理员可进行增加、修改、删除各管理员信息;
(4)学生宿舍ID模块:记录学生宿舍信息,拥有该权限的管理员可进行增加、修改、删除各学生宿舍信息;
(5)办公室ID模块:记录办公室信息,拥有该权限的管理员可进行增加、修改、删除各办公室信息;
(6)实验室ID模块:记录实验室信息,拥有该权限的管理员可进行增加、修改、删除实验室信息;
(7)教师周转房ID模块:记录教师周转房信息,拥有该权限的管理员可进行增加、修改、删除各教师周转房信息;
(8)申请房产模块:用户可查询各房产信息并进行申请;
(9)房产分配模块:管理员对用户申请的房产进行分配;
(10)个人信息模块:管理员可修改个人信息;
(11)修改密码模块;
(1)角色管理
@RequestMapping("/findAdmin.do")
public String find(AdminPage page, Model model) {
//-----------------------
page.setRows(adminDao.findRows(page));
model.addAttribute("adminPage", page);
List<Admin> admins = adminDao.findByPage(page);
model.addAttribute("admins", admins);
List<Module> modules = roleDao.findAllModules();
model.addAttribute("modules", modules);
return "admin/adminList";
}
@RequestMapping("/resetPassword.do")
@ResponseBody
public Map<String, Object> resetPassword(@RequestParam("ids") String ids) {
Map<String, Object> param = new HashMap<String, Object>();
param.put("ids", buildIdList(ids));
param.put("password", "123456");
adminDao.updatePassword(param);
Map<String, Object> info = new HashMap<String, Object>();
info.put("success", true);
info.put("message", "重置密码成功!");
return info;
}
private List<Integer> buildIdList(String ids) {
if (ids == null || ids.length() == 0)
return null;
List<Integer> list = new ArrayList<Integer>();
String[] idsArray = ids.split(",");
for (String id : idsArray) {
list.add(Integer.valueOf(id));
}
return list;
}
@RequestMapping("/toAddAdmin.do")
public String toAdd(Model model) {
RolePage page = new RolePage();
page.setPageSize(100000);
List<Role> roles = roleDao.findByPage(page);
model.addAttribute("roles", roles);
return "admin/addAdmin";
}
@RequestMapping("/addAdmin.do")
public String add(Admin admin, Model model) {
admin.setEnrollDate(new Timestamp(System.currentTimeMillis()));
adminDao.saveAdmin(admin);
List<Integer> roleIds = admin.getRoleIds();
for (Integer roleId : roleIds) {
Map<String, Object> adminRoles = new HashMap<String, Object>();
adminRoles.put("adminId", admin.getAdminId());
adminRoles.put("roleId", roleId);
adminDao.saveAdminRoles(adminRoles);
}
return "redirect:findAdmin.do";
}
@RequestMapping("/toUpdateAdmin.do")
public String toUpdate(@RequestParam("id") int id, Model model) {
RolePage page = new RolePage();
page.setPageSize(100000);
List<Role> roles = roleDao.findByPage(page);
model.addAttribute("roles", roles);
Admin admin = adminDao.findById(id);
model.addAttribute("admin", admin);
return "admin/updateAdmin";
}
@RequestMapping("/updateAdmin.do")
public String update(Admin admin, Model model) {
adminDao.updateAdmin(admin);
adminDao.deleteAdminRoles(admin.getAdminId());
List<Integer> roleIds = admin.getRoleIds();
for (Integer roleId : roleIds) {
Map<String, Object> adminRoles = new HashMap<String, Object>();
adminRoles.put("adminId", admin.getAdminId());
adminRoles.put("roleId", roleId);
adminDao.saveAdminRoles(adminRoles);
}
return "redirect:findAdmin.do";
}
@RequestMapping("/deleteAdmin.do")
public String delete(@RequestParam("adminId") int id) {
adminDao.deleteAdminRoles(id);
adminDao.deleteAdmin(id);
return "redirect:findAdmin.do";
}
}
(2)管理员角色
@RequestMapping("/findRole.do")
public String find(RolePage page, Model model) {
//------------------------
page.setRows(roleDao.findRows(page));
model.addAttribute("rolePage", page);
List<Role> roles = roleDao.findByPage(page);
model.addAttribute("roles", roles);
return "role/roleList";
}
@RequestMapping("/toAddRole.do")
public String toAdd(Model model) {
//-----------------------------
List<Module> modules = roleDao.findAllModules();
model.addAttribute("modules", modules);
return "role/addRole";
}
@RequestMapping("/addRole.do")
public String add(Role role, Model model) {
roleDao.saveRole(role);//将角色的名称添加角色表中
//-----------------------
List<Integer> moduleIds = role.getModuleIds();
for (Integer moduleId : moduleIds) {
Map<String,Object> roleModules =
new HashMap<String, Object>();
roleModules.put("roleId", role.getRoleId());
roleModules.put("moduleId", moduleId);
roleDao.saveRoleModules(roleModules);
}
return "redirect:findRole.do";
}
@RequestMapping("/toUpdateRole.do")
public String toUpdate(@RequestParam("id") int id, Model model) {
//---------------------------
List<Module> modules = roleDao.findAllModules();
model.addAttribute("modules", modules);
Role role = roleDao.findById(id);
model.addAttribute("role", role);
return "role/updateRole";
}
@RequestMapping("/updateRole.do")
public String update(Role role, Model model) {
roleDao.updateRole(role);
//---------------------------
roleDao.deleteRoleModules(role.getRoleId());
List<Integer> moduleIds = role.getModuleIds();
for (Integer moduleId : moduleIds) {
Map<String,Object> roleModules =
new HashMap<String, Object>();
roleModules.put("roleId", role.getRoleId());
roleModules.put("moduleId", moduleId);
roleDao.saveRoleModules(roleModules);
}
return "redirect:findRole.do";
}
@RequestMapping("/deleteRole.do")
public String delete(@RequestParam("id") int id) {
//-------------------------
roleDao.deleteRoleModules(id);
roleDao.deleteRole(id);
return "redirect:findRole.do";
}
@RequestMapping("/checkRoleName.do")
@ResponseBody
public boolean checkName(String name) {
//--------------------------------
Role role = roleDao.findByName(name);
if(role == null)
return true;
else
return false;
}
}
(3)实验室
@RequestMapping("/findLaboratory.do")
public String find(LaboratoryPage page,Model model)
{
page.setRows(laboratoryDao.findRows(page));
model.addAttribute("laboratoryPage", page);
List<Laboratory> laboratorys = laboratoryDao.findByPage(page);
model.addAttribute("laboratorys", laboratorys);
return "laboratory/laboratoryList";
}
@RequestMapping("/deleteLaboratory.do")
public String delete(@RequestParam("id") int id) {
laboratoryDao.delete(id);
return "redirect:findLaboratory.do";
}
@RequestMapping("/toUpdateLaboratory.do")
public String toUpdate(@RequestParam("id") int id, Model model) {
Laboratory laboratory=laboratoryDao.findById(id);
model.addAttribute("laboratory", laboratory);
return "laboratory/updateLaboratory";
}
@RequestMapping("/checkAddress.do")
@ResponseBody
public boolean checkAddress(String address) {
List<Laboratory> laboratorys = laboratoryDao.findByAddress(address);
if(laboratorys.size()==0)
return true;
else
return false;
}
@RequestMapping("/updateLaboratory.do")
public String update(Laboratory laboratory)
{
laboratoryDao.update(laboratory);
return "redirect:findLaboratory.do";
}
@RequestMapping("/toAddLaboratory.do")
public String toAdd()
{
return "laboratory/addLaboratory";
}
@RequestMapping("addLaboratory.do")
public String add(Laboratory laboratory) {
laboratoryDao.save(laboratory);
return "redirect:findLaboratory.do";
}
(4)办公室
@RequestMapping("/findOffice.do")
public String find(OfficePage page,Model model)
{
page.setRows(officeDao.findRows(page));
model.addAttribute("officePage", page);
List<Office> offices = officeDao.findByPage(page);
model.addAttribute("offices", offices);
return "office/officeList";
}
@RequestMapping("/deleteOffice.do")
public String delete(@RequestParam("id") int id) {
officeDao.delete(id);
return "redirect:findOffice.do";
}
@RequestMapping("/toUpdateOffice.do")
public String toUpdate(@RequestParam("id") int id, Model model) {
Office office=officeDao.findById(id);
model.addAttribute("office", office);
return "office/updateOffice";
}
@RequestMapping("/checkAddress.do")
@ResponseBody
public boolean checkAddress(String address) {
List<Office> offices = officeDao.findByAddress(address);
if(offices.size()==0)
return true;
else
return false;
}
@RequestMapping("/updateOffice.do")
public String update(Office office)
{
officeDao.update(office);
return "redirect:findOffice.do";
}
@RequestMapping("/toAddOffice.do")
public String toAdd()
{
return "office/addOffice";
}
@RequestMapping("addOffice.do")
public String add(Office office) {
officeDao.save(office);
return "redirect:findOffice.do";
}
}
(5)学生宿舍
@RequestMapping("/findStuDormitory.do")
public String find(StuDormitoryPage page,Model model)
{
page.setRows(stuDormitoryDao.findRows(page));
model.addAttribute("stuDormitoryPage", page);
List<StuDormitory> stuDormitorys = stuDormitoryDao.findByPage(page);
model.addAttribute("stuDormitorys", stuDormitorys);
return "stuDormitory/stuDormitoryList";
}
@RequestMapping("/deleteStuDormitory.do")
public String delete(@RequestParam("id") int id) {
stuDormitoryDao.delete(id);
return "redirect:findStuDormitory.do";
}
@RequestMapping("/toUpdateStuDormitory.do")
public String toUpdate(@RequestParam("id") int id, Model model) {
StuDormitory stuDormitory=stuDormitoryDao.findById(id);
model.addAttribute("stuDormitory", stuDormitory);
return "stuDormitory/updateStuDormitory";
}
@RequestMapping("/checkAddress.do")
@ResponseBody
public boolean checkAddress(String address) {
List<StuDormitory> stuDormitorys = stuDormitoryDao.findByAddress(address);
if(stuDormitorys.size()==0)
return true;
else
return false;
}
@RequestMapping("/updateStuDormitory.do")
public String update(StuDormitory stuDormitory)
{
stuDormitoryDao.update(stuDormitory);
return "redirect:findStuDormitory.do";
}
@RequestMapping("/toAddStuDormitory.do")
public String toAdd()
{
return "stuDormitory/addStuDormitory";
}
@RequestMapping("addStuDormitory.do")
public String add(StuDormitory stuDormitory) {
stuDormitoryDao.save(stuDormitory);
return "redirect:findStuDormitory.do";
}
}
(6)教师周转房
@RequestMapping("/findTeahouseturnover.do")
public String find(TeahouseturnoverPage page,Model model)
{
page.setRows(teahouseturnoverDao.findRows(page));
model.addAttribute("teahouseturnoverPage", page);
List<Teahouseturnover> teahouseturnovers = teahouseturnoverDao.findByPage(page);
model.addAttribute("teahouseturnovers", teahouseturnovers);
return "teahouseturnover/teahouseturnoverList";
}
@RequestMapping("/deleteTeahouseturnover.do")
public String delete(@RequestParam("id") int id) {
teahouseturnoverDao.delete(id);
return "redirect:findTeahouseturnover.do";
}
@RequestMapping("/toUpdateTeahouseturnover.do")
public String toUpdate(@RequestParam("id") int id, Model model) {
Teahouseturnover teahouseturnover=teahouseturnoverDao.findById(id);
model.addAttribute("teahouseturnover", teahouseturnover);
return "teahouseturnover/updateTeahouseturnover";
}
@RequestMapping("/checkAddress.do")
@ResponseBody
public boolean checkAddress(String address) {
List<Teahouseturnover> teahouseturnovers = teahouseturnoverDao.findByAddress(address);
if(teahouseturnovers.size()==0)
return true;
else
return false;
}
@RequestMapping("/updateTeahouseturnover.do")
public String update(Teahouseturnover teahouseturnover)
{
teahouseturnoverDao.update(teahouseturnover);
return "redirect:findTeahouseturnover.do";
}
@RequestMapping("/toAddTeahouseturnover.do")
public String toAdd()
{
return "teahouseturnover/addTeahouseturnover";
}
@RequestMapping("addTeahouseturnover.do")
public String add(Teahouseturnover teahouseturnover) {
teahouseturnoverDao.save(teahouseturnover);
return "redirect:findTeahouseturnover.do";
}
}
(7)修改密码
@RequestMapping("/toModifyPwd.do")
public String toModifyPwd() {
return "admin/modifyPwd";
}
@RequestMapping("/ModifyPwd.do")
public String modifyPwd(String adminCode,String oldPassword,String newPassword, HttpSession session){
Admin admin = adminDao.findByCode(adminCode);
if(admin.getPassword().equals(oldPassword)){
admin.setPassword(newPassword);
adminDao.updateByPassword(admin);
session.removeAttribute("admin");
return "redirect:/login/toLogin.do";
}else{
return "main/error";
}
}
}
(8)修改个人信息
@RequestMapping("/touserInfo.do")
public String toadminInfo() {
return "admin/adminInfo";
}
@RequestMapping("/update.do")
public String update(Admin admin,Model model,HttpSession session){
adminDao.updateAdmin(admin);
session.setAttribute("admin", adminDao.findById(admin.getAdminId()));
model.addAttribute("flag", true);
return "admin/adminInfo";
}
}
申请房产、房产分配模块还未实现以及前端页面不够完善。
实现申请房产、房产分配模块,完善前端页面,并开始准备论文初稿。
中文 | 列名 | 数据类型 | 主外键 | 长度 |
管理员ID | adminId | int | PK | 10 |
管理员账号 | adminCode | varchar | NOT NULL | 30 |
密码 | password | varchar | NOT NULL | 30 |
姓名 | name | varchar | NOT NULL | 30 |
电话 | telephone | varchar | NOT NULL | 15 |
电子邮箱 | varchar | NOT NULL | 50 | |
授权日期 | enrollDate | datetime | NOT NULL | 0 |
中文 | 列名 | 数据类型 | 主外键 | 长度 |
管理员ID | adminId | int | NOT NULL | 10 |
角色ID | roleId | int | NOT NULL | 10 |
ID | id | int | PK | 11 |
中文 | 列名 | 数据类型 | 主外键 | 长度 |
申请人ID | applicatId | int | PK | 10 |
申请人 | applicat | varchar | NOT NULL | 10 |
地址 | address | varchar | NOT NULL | 50 |
中文 | 列名 | 数据类型 | 主外键 | 长度 |
实验室ID | laboratoryId | int | PK | 10 |
地址 | address | varchar | NOT NULL | 50 |
状态 | status | char | NOT NULL | 10 |
使用者 | user | char | NOT NULL | 10 |
中文 | 列名 | 数据类型 | 主外键 | 长度 |
模块ID | moduleId | int | PK | 10 |
名字 | name | varchar | NOT NULL | 50 |
中文 | 列名 | 数据类型 | 主外键 | 长度 |
办公室ID | officeId | int | PK | 10 |
地址 | address | varchar | NOT NULL | 50 |
状态 | status | char | NOT NULL | 10 |
使用者 | user | varchar | NOT NULL | 50 |
中文 | 列名 | 数据类型 | 主外键 | 长度 |
角色ID | roleId | int | PK | 10 |
名字 | name | varchar | NOT NULL | 50 |
中文 | 列名 | 数据类型 | 主外键 | 长度 |
角色ID | moduleId | int | PK | 10 |
模块ID | moduleId | int | NOT NULL | 10 |
ID | id | int | NOT NULL | 11 |
中文 | 列名 | 数据类型 | 主外键 | 长度 |
学生宿舍ID | studentDormitoryId | int | PK | 10 |
地址 | address | varchar | NOT NULL | 50 |
状态 | status | char | NOT NULL | 10 |
学院 | academy | varchar | NOT NULL | 50 |
居住者 | dweller | varchar | NOT NULL | 50 |
中文 | 列名 | 数据类型 | 主外键 | 长度 |
教师周转房ID | teacherHouseTurnoverId | int | PK | 10 |
地址 | address | varchar | NOT NULL | 50 |
状态 | status | char | NOT NULL | 10 |
使用者 | user | varchar | NOT NULL | 50 |
《锋利的jQuery》、MyBatis从入门到精通》...
标签:row 登录模块 http move 参考资料 turn mod 角色 ora
原文地址:https://www.cnblogs.com/keyi123/p/8971455.html