基于javaweb的SSM+Maven房产中介管理系统(java+ssm+html+bootstrap+layui+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

410023382402

420023382402

430023382402

440023382402

450023382402

460023382402

基于javaweb的SSM+Maven房产中介管理系统(java+ssm+html+bootstrap+layui+mysql)

项目介绍

本项目为后台管理系统;

管理员角色包含以下功能: 管理员登录,用户管理,通知公告管理,卖家信息管理,买家信息管理,添加房屋,房屋管理,房屋搜索,修改个人信息,修改密码等功能。 管理员账号/密码:admin/admin

环境需要

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项目: 是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目

技术栈

  1. 后端:Spring SpringMVC MyBatis 2. 前端:HTML+CSS+Javascript+jQuery+bootstrap+layui

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中db.properties配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ 登录  管理员账号/密码:admin/admin

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
	sysMenuService.save(menu);

return R.ok();
}

/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody SysMenuEntity menu){
//数据校验
verifyForm(menu);

sysMenuService.update(menu);

return R.ok();
}

/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] menuIds){
for(Long menuId : menuIds){
if(menuId.longValue() <= 30){
return R.error("系统菜单,不能删除");
}
}
sysMenuService.deleteBatch(menuIds);

return R.ok();
}

/**
* 用户菜单列表
*/
@RequestMapping("/user")
public R user(){
List<SysMenuEntity> menuList = sysMenuService.getUserMenuList(getUserId());

return R.ok().put("menuList", menuList);
}

/**
* 验证参数是否正确
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
	PageUtils pageUtil = new PageUtils(houseList, total, query.getLimit(), query.getPage());

return R.ok().put("page", pageUtil);
}


/**
* 列表
*/
@RequestMapping("/list2")
public R list2(@RequestParam Map<String, Object> params){
Query query = new Query(params);
List<HouseEntity> houseList = houseService.queryList(query);
return R.ok().put("list", houseList );
}


/**
* 信息
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
HouseEntity house = houseService.queryObject(id);

return R.ok().put("house", house);
}

/**
* 保存
*/
@RequestMapping("/save")
public R save(@RequestBody HouseEntity house){



houseService.save(house);

return R.ok();
}

/**
* 修改
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38


/**
* 文件上传
*
* @email syt12322@163.com
*/
@RestController
@RequestMapping("file")
public class UploadController {

public static String[] suffixs = {"IMG", "PNG", "JPG", "JPEG", "GIF", "BPM"};

/**
* 上传文件
*/
@RequestMapping("/upload")
public R upload(@RequestParam("file") MultipartFile file, HttpServletRequest request) throws Exception {
if (file.isEmpty()) {
throw new RRException("上传文件不能为空");
}
String url = MultipartFileUtil.uploadFile("/cdn", file, request);
return R.ok().put("url", url);
}


/**
* 上传资讯内容的图片
*
* @param upload 图片
* @param response 响应
*/
@ResponseBody
@RequestMapping("ckEditorUpload")
public void uploadFile(MultipartFile upload, String CKEditorFuncNum, HttpServletRequest request, HttpServletResponse response) throws IOException {

response.setContentType("text/html; charset=UTF-8");
PrintWriter out = response.getWriter();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
	 */
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params){
//如果不是超级管理员,则只查询自己创建的角色列表
// if(getUserId() != Constant.SUPER_ADMIN){
// params.put("createUserId", getUserId());
// }

//查询列表数据
Query query = new Query(params);
List<SysRoleEntity> list = sysRoleService.queryList(query);
int total = sysRoleService.queryTotal(query);

PageUtils pageUtil = new PageUtils(list, total, query.getLimit(), query.getPage());

return R.ok().put("page", pageUtil);
}

/**
* 角色列表
*/
@RequestMapping("/select")
public R select(){
Map<String, Object> map = new HashMap<>();

//如果不是超级管理员,则只查询自己所拥有的角色列表
// if(getUserId() != Constant.SUPER_ADMIN){
// map.put("createUserId", getUserId());
// }
List<SysRoleEntity> list = sysRoleService.queryList(map);

return R.ok().put("list", list);
}

/**
* 角色信息
*/
@RequestMapping("/info/{roleId}")
public R info(@PathVariable("roleId") Long roleId){
SysRoleEntity role = sysRoleService.queryObject(roleId);

//查询角色对应的菜单
List<Long> menuIdList = sysRoleMenuService.queryMenuIdList(roleId);
role.setMenuIdList(menuIdList);

return R.ok().put("role", role);
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
	List<SysMenuEntity> menuList = sysMenuService.getUserMenuList(getUserId());

return R.ok().put("menuList", menuList);
}

/**
* 验证参数是否正确
*/
private void verifyForm(SysMenuEntity menu){
if(StringUtils.isBlank(menu.getName())){
throw new RRException("菜单名称不能为空");
}

if(menu.getParentId() == null){
throw new RRException("上级菜单不能为空");
}

//菜单
if(menu.getType() == Constant.MenuType.MENU.getValue()){
if(StringUtils.isBlank(menu.getUrl())){
throw new RRException("菜单URL不能为空");
}
}

//上级菜单类型
int parentType = Constant.MenuType.CATALOG.getValue();
if(menu.getParentId() != 0){
SysMenuEntity parentMenu = sysMenuService.queryObject(menu.getParentId());
parentType = parentMenu.getType();
}

//目录、菜单
if(menu.getType() == Constant.MenuType.CATALOG.getValue() ||
menu.getType() == Constant.MenuType.MENU.getValue()){
if(parentType != Constant.MenuType.CATALOG.getValue()){
throw new RRException("上级菜单只能为目录类型");
}
return ;
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
    public String logout() {
ShiroUtils.logout();
return "redirect:login.html";
}

}
package com.learn.controller;



/**
* 系统用户
*
* @email admin@gmail.com
*/
@RestController
@RequestMapping("/sys/user")
public class SysUserController extends AbstractController {
@Autowired
private SysUserService sysUserService;
@Autowired
private SysUserRoleService sysUserRoleService;

/**
* 所有用户列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params) {

//查询列表数据
Query query = new Query(params);
List<SysUserEntity> userList = sysUserService.queryList(query);
int total = sysUserService.queryTotal(query);

PageUtils pageUtil = new PageUtils(userList, total, query.getLimit(), query.getPage());

return R.ok().put("page", pageUtil);
}


项目链接:
https://javayms.github.io?id=521122522008200pj
https://javayms.pages.dev?id=521122522008200pj