源码获取:俺的博客首页 "资源" 里下载!
项目介绍
本系统采用java作为前台开发工具、MySQL作为后台数据库平台的管理系统。系统通过实现公寓管理人员的信息输入与维护、公寓入住人员的信息修改与维护、宿舍用品配置登记与维护、公寓信息查询、来访人员登记等功能,使大学生公寓管理变得系统化、规范化、自动化,从而达到掌握宿舍成员的情况、提高管理效率的目的。
该项目主要包括管理员、宿管老师、学生三种角色。
管理员主要功能包括:
系统设置:菜单管理、角色管理、修改密码;
用户管理:老师管理、学生管理、管理员管理;
系统日志:日志列表;
宿舍楼管理;
财产管理;
财产盘点管理;
同产报修管理;
报废管理;
宿管老师主要功能包括:
财产管理、财产盘点管理、财产报修管理、报废处理;
学生主要功能包括:
财产管理、财产报修管理;
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
5.数据库:MySql 5.7版本;
6.是否Maven项目:否;
技术栈
1. 后端:spring+springMVC+mybaits
2. 前端:JSP+EasyUI+H-ui+jQuery+Ajax
使用说明
1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中db.properties配置文件中的数据库配置改为自己的配置;
4. 前台访问路径:http://localhost:8080/
用户管理控制层:
@RestController
@RequestMapping("/user")
@RequiresPermissions(value = {"sys:user","system-administrator-permission"},logical = Logical.OR)
public class UserController {
@Autowired
private UserService userService;
@PostMapping("/add")
public ResultDto<Object> add(@RequestBody User user){
return userService.add(user);
}
@DeleteMapping("/delete")
public ResultDto<Object> delete(@RequestParam("ids") Long[] ids) throws AssetException {
return userService.delete(ids);
}
@PutMapping("/update")
public ResultDto<Object> update(@RequestBody User user) {
return userService.update(user);
}
@GetMapping("/list")
public ResultDto<PageDto<User>> getList(UserDto dto){
return userService.getList(dto);
}
}
角色管理控制层:
@RestController
@RequestMapping("/role")
@RequiresRoles("system-administrator-role")
public class RoleController {
@Autowired
private RoleService roleService;
@PostMapping("/add")
public ResultDto<Object> add(@RequestBody Role role){
return roleService.add(role);
}
@DeleteMapping("/delete")
public ResultDto<Object> delete(@RequestParam("ids") Long[] ids) throws AssetException {
return roleService.delete(ids);
}
@PutMapping("/update")
public ResultDto<Object> update(@RequestBody Role role) {
return roleService.update(role);
}
@GetMapping("/list")
public ResultDto<PageDto<Role>> getList(RoleDto dto){
return roleService.getList(dto);
}
@GetMapping("/getPermission")
public ResultDto<Object> getPermission(@RequestParam Long roleId){
return roleService.getPermission(roleId);
}
@PutMapping("/updatePermission")
public ResultDto<Object> updatePermission(@RequestBody Map<String,String> body){
List<Long> longs = Arrays.stream(body.get("permissionIds").split(","))
.map(Long::parseLong).collect(Collectors.toList());
return roleService.updatePermission(Long.parseLong(body.get("roleId")),
longs.toArray(new Long[longs.size()]));
}
}
宿舍楼信息管理控制层:
@Controller
@RequestMapping("/dorm")
public class DormController {
@Autowired
private DormServiceI dormServiceI;
/**
* 跳转宿舍楼信息管理页面
* @return
*/
@GetMapping("/view")
public String getDormView() {
return "dorm/dorm";
}
/**
* 宿舍楼信息列表-带分页
* @param pageable
* @return
*/
@GetMapping("/list")
@ResponseBody
public Page<Dorm> getDormInfo(@PageableDefault Pageable pageable) {
return dormServiceI.findDorms(pageable);
}
/**
* 获取宿舍列表
* @param session
* @return
*/
@GetMapping("/getDorms")
@ResponseBody
public List<Dorm> getDorms(HttpSession session) {
UserExpand user = (UserExpand) session.getAttribute("LOGIN_USER");
return dormServiceI.getDorms(user.getStaffinfo());
}
/**
* 导入-宿舍楼信息文件
* @param file
* @return
*/
@PostMapping("/importExcel")
@ResponseBody
public Boolean importExcel(@RequestParam("file") MultipartFile file) {
return dormServiceI.importExcel(file);
}
}
源码获取:俺的博客首页 "资源" 里下载!