基于javaweb的SpringBoot房屋租赁管理系统(java+springboot+vue+maven+mysql)

运行环境

Java≥8、MySQL≥5.7、Node.js≥14

开发工具

后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可

❗没学过node.js的不要搞前后端分离项目

适用

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

功能说明

480923541103

490923541103

500923541103

510923541103

520923541103

530923541103

基于javaweb的SpringBoot房屋租赁管理系统(java+springboot+vue+maven+mysql)

用户类型:管理员、房主、用户

一、项目运行 环境配置:

Jdk1.8 + Mysql + HBuilderX(Webstorm也行)+ Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)。

项目技术:

Spring + SpringBoot+ mybatis + Maven + Vue 等等组成,B/S模式 + Maven管理等等。  

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
}
package com.like.controller;



@RestController
@RequestMapping("/complaintApply")
@Api( tags = "投诉、申请")
public class ComplaintApplyController {
@Autowired
UserService userService;
@Autowired
ComplaintService complaintService;

@PostMapping("/merchantApply")
@ApiOperation("商家申请 --上传多个材料、图片")
public Result<?> merchantApply(@RequestParam("files") MultipartFile[] files){
Long uId = (Long) SecurityUtils.getSubject().getPrincipal();
// 保存图片+添加记录到申请表
boolean state = userService.merchantApply(files, uId);
if (state){
return Result.success();
}
return Result.error("-1", "上传失败");
}


@PostMapping("/complaint")
@ApiOperation("投诉房源或用户")
@ApiImplicitParam(name = "complaintVo", value = "投诉信息的封装")
public Result<?> complaint(ComplaintVo complaintVo,
HttpServletRequest request){
Long uId = (Long) SecurityUtils.getSubject().getPrincipal();
boolean state = false;

if (complaintVo.getType().equals("house"))
// 投诉房源
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

@RestController
@RequestMapping("/admin")
@Api(tags = "管理员对系统管理的相关操作")
public class AdminOperationController {
@Autowired
MateRuleAction mateRuleAction;
@Autowired
AdminService adminService;
@Autowired
UserService userService;
@Autowired
HouseService houseService;


@GetMapping("/getMerchantApply")
@ApiOperation("获取商家申请未处理的记录")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNum", value = "显示的起始页"),
@ApiImplicitParam(name = "pageSize", value = "每页的条数"),})
public Result<?> getMerchantApply(@RequestParam(defaultValue = "1") Integer pageNum,
@RequestParam(defaultValue = "10") Integer pageSize,
HttpServletRequest request){
Long uId = (Long) SecurityUtils.getSubject().getPrincipal();
Page<LeaserApply> page = adminService.getMerchantApply(new Page<LeaserApply>(pageNum, pageSize), uId);

return Result.success(page);
}

@PostMapping("/updateLeaserApply")
@ApiOperation("更新房主申请的记录状态")
@ApiImplicitParams({
@ApiImplicitParam(name = "leaserApplyId", value = "申请记录的id"),
@ApiImplicitParam(name = "operation", value = "操作(success、fail)"),})
public Result<?> updateLeaserApply(@RequestParam("leaserApplyId") Long leaserApplyId,
@RequestParam("operation") String operation,
HttpServletRequest request){
Long uId = (Long) SecurityUtils.getSubject().getPrincipal();
Long lapUId = adminService.updateLeaserApplyState(leaserApplyId, operation);

// 如果更新成功&&并且通过审核,进入更改用户的角色
if (lapUId != null && operation.equals("success")){
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
49
50
51
    Long uId = (Long) SecurityUtils.getSubject().getPrincipal();

// 获取当前用户最新的匹配规则 和 当前规则匹配成功的房源
MateRuleAndRecordVo marVo = mateRuleService.getRuleAndHouseImfor(uId);

if (marVo == null) {
return Result.success("noMateRule");
}
return Result.success(marVo);
}


@PostMapping("/addMateRule")
@ApiOperation("新建规则征集房源")
public Result<?> addMateRule(@RequestBody MateRuleVo mateRuleVo) {
Long uId = (Long) SecurityUtils.getSubject().getPrincipal();

if (mateRuleVo.getProvinceValue() != null) {
// 将前端选择的户型多选 合并为一个字符串使用#进行间隔
mateRuleVo.transitionToStringHouseType();

// 新增匹配规则
int addResult = mateRuleService.addMateRule(mateRuleVo, uId);
// 启动匹配
int startResult = mateRuleService.startMateRule(mateRuleVo.getMrId(), uId);
if (addResult != 1) {
return Result.error("-1", "创建失败");
} else if (startResult != 1) {
return Result.error("-1", "启动失败");
}

return Result.success("");
}

return Result.error("-1", "必须输入规则");
}

@PostMapping("/updateMateRule")
@ApiOperation("修改规则征集房源")
public Result<?> updateMateRule(@RequestBody MateRuleVo mateRuleVo) {
Long uId = (Long) SecurityUtils.getSubject().getPrincipal();

if (mateRuleVo.getMrId() != null) {
// 将前端选择的户型多选 合并为一个字符串使用#进行间隔
mateRuleVo.transitionToStringHouseType();
// 修改匹配规则
int updateResult = mateRuleService.updateMateRule(mateRuleVo, uId);

if (updateResult == 1) {
return Result.success("");
} else {
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
49
50
51
52
53
54
        @ApiImplicitParam(name = "handleReason", value = "处理理由"),})
public Result<?> updateHouseState(@RequestParam("hId") Long hId,
@RequestParam("operation") String operation,
@RequestParam("handleReason") String handleReason){
int update = adminService.updateHouseState(hId, operation);
if (update == 1){
return Result.success();
}
return Result.error("-1", "操作失败");
}
/* ================end================ */


/* ================用户管理================ */
@GetMapping("/getUserBasicImforByUId")
@ApiOperation("根据用户id获取用户基本信息")
@ApiImplicitParam(name = "uId", value = "用户id")
public Result<?> getUserBasicImforByUId(Long uId){
User user = userService.getUserBasicByUId(uId);
if (user != null){
UserVo userVo = new UserVo();
BeanUtils.copyProperties(user, userVo);
return Result.success(userVo);
}

return Result.error("-1", "没有查到该用户");
}

@PostMapping("/updateUserState")
@ApiOperation("更新用户状态")
@ApiImplicitParams({
@ApiImplicitParam(name = "uId", value = "用户id"),
@ApiImplicitParam(name = "operation", value = "操作(banSay、frozen、close、removeBanSay、removeFrozen)")})
public Result<?> updateUserState(@RequestParam("uId") Long uId,
@RequestParam("operation") String operation){
int num = userService.updateUserState(uId, operation);
if (num == 1){
return Result.success();
}
return Result.error("-1", "操作失败");
}
/* ================end================ */


@GetMapping("/getComplaintUser")
@ApiOperation("获取未处理的投诉用户信息")
@ApiImplicitParams({@ApiImplicitParam(name = "pageNum", value = "显示的起始页"),
@ApiImplicitParam(name = "pageSize", value = "每页的条数"),})
public Result<?> getComplaintUser(@RequestParam(defaultValue = "1") Integer pageNum,
@RequestParam(defaultValue = "10") Integer pageSize){
Page<ComplaintUser> result =
adminService.getUntreatedComplaintUser(new Page<ComplaintUser>(pageNum, pageSize));
return Result.success(result);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
            address = search;
}
else if (type.equals("roomNum")){
roomNum = search;
}

Page<HistoryBill> resultPage = payAndBillService.getHistoryBillByUId("merchant", new Page<HistoryBill>(pageNum, pageSize), uId, price, address, roomNum);
return Result.success(resultPage);
}
}
package com.like.controller;



@RestController
@RequestMapping("/user")
@Api(tags = "用户对房源的相关操作")
public class UserOperationHouseController {
@Autowired
HouseService houseService;
@Autowired


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