基于微信小程序的房屋租赁管理系统的设计与实现
摘要
随着信息技术在管理上越来越深入而广泛的应用,管理信息系统的实施在技术上已逐步成熟。本文介绍了基于微信小程序的房屋租赁管理系统的开发全过程。通过分析基于微信小程序的房屋租赁管理系统管理的不足,创建了一个计算机管理基于微信小程序的房屋租赁管理系统的方案。文章介绍了基于微信小程序的房屋租赁管理系统的系统分析部分,包括可行性分析等,系统设计部分主要介绍了系统功能设计和数据库设计。
本基于微信小程序的房屋租赁管理系统后端有管理员和中介。管理员功能有,个人中心,用户管理,中介管理,房屋信息管理,房屋类型管理,租房订单管理,租房信息管理,租房账单管理,房源管理,系统管理等。中介功能有,个人中心,房屋信息管理,租房订单管理,租房信息管理等。用户功能有,查看房屋信息,修改个人信息,租房订单,租房信息,租房账单。因而具有一定的实用性。
本站后台采用Java的SSM框架进行后台管理开发,可以在浏览器上登录进行后台数据方面的管理,MySQL作为本地数据库,微信小程序用到了微信开发者工具,充分保证系统的稳定性。系统具有界面清晰、操作简单,功能齐全的特点,使得基于微信小程序的房屋租赁管理系统管理工作系统化、规范化。
validationQuery=SELECT 1
jdbc_url=jdbc:mysql://127.0.0.1:3306/ssmg90dl?useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false
jdbc_username=root
jdbc_password=root
#jdbc_url=jdbc:sqlserver://127.0.0.1:1433;DatabaseName=ssmg90dl
#jdbc_username=sa
#jdbc_password=123456
{
"name": "mas-creator-admin",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.19.2",
"core-js": "^3.4.4",
"echarts": "^4.6.0",
"element-ui": "^2.13.0",
"js-md5": "^0.7.3",
"print-js": "^1.5.0",
"vue": "^2.6.10",
"vue-quill-editor": "^3.0.6",
"vue-amap": "^0.5.10",
"vue-json-excel": "^0.3.0",
"vue-router": "^3.1.5"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0",
"@vue/cli-plugin-eslint": "^4.1.0",
"@vue/cli-service": "^4.1.0",
"babel-eslint": "^10.0.3",
"babel-plugin-component": "^1.1.1",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"node-sass": "^4.13.1",
"sass-loader": "^8.0.2",
"svg-sprite-loader": "4.1.3",
"svgo": "1.2.2",
"vue-template-compiler": "^2.6.10"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"rules": {
"no-console": "off",
"no-unused-vars": 0,
"no-useless-escape": "off"
},
"parserOptions": {
"parser": "babel-eslint"
}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8",
"Android >= 4.0"
]
}
package com.model.enums;
import java.io.Serializable;
import com.baomidou.mybatisplus.enums.IEnum;
/**
* 必须现在 IEnum 配置 该包扫描自动注入,查看文件 spring-mybatis.xml 参数 typeEnumsPackage
*/
public enum TypeEnum implements IEnum {
DISABLED(0, "禁用"),
NORMAL(1, "正常");
private final int value;
private final String desc;
TypeEnum(final int value, final String desc) {
this.value = value;
this.desc = desc;
}
@Override
public Serializable getValue() {
return this.value;
}
// Jackson 注解为 JsonValue 返回中文 json 描述
public String getDesc() {
return this.desc;
}
}
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.FangwuleixingEntity;
import com.entity.view.FangwuleixingView;
import com.service.FangwuleixingService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 房屋类型
* 后端接口
* @author
* @email
* @date 2021-04-19 17:47:04
*/
@RestController
@RequestMapping("/fangwuleixing")
public class FangwuleixingController {
@Autowired
private FangwuleixingService fangwuleixingService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,FangwuleixingEntity fangwuleixing,
HttpServletRequest request){
EntityWrapper<FangwuleixingEntity> ew = new EntityWrapper<FangwuleixingEntity>();
PageUtils page = fangwuleixingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, fangwuleixing), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,FangwuleixingEntity fangwuleixing, HttpServletRequest request){
EntityWrapper<FangwuleixingEntity> ew = new EntityWrapper<FangwuleixingEntity>();
PageUtils page = fangwuleixingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, fangwuleixing), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( FangwuleixingEntity fangwuleixing){
EntityWrapper<FangwuleixingEntity> ew = new EntityWrapper<FangwuleixingEntity>();
ew.allEq(MPUtil.allEQMapPre( fangwuleixing, "fangwuleixing"));
return R.ok().put("data", fangwuleixingService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(FangwuleixingEntity fangwuleixing){
EntityWrapper< FangwuleixingEntity> ew = new EntityWrapper< FangwuleixingEntity>();
ew.allEq(MPUtil.allEQMapPre( fangwuleixing, "fangwuleixing"));
FangwuleixingView fangwuleixingView = fangwuleixingService.selectView(ew);
return R.ok("查询房屋类型成功").put("data", fangwuleixingView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
FangwuleixingEntity fangwuleixing = fangwuleixingService.selectById(id);
return R.ok().put("data", fangwuleixing);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
FangwuleixingEntity fangwuleixing = fangwuleixingService.selectById(id);
return R.ok().put("data", fangwuleixing);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody FangwuleixingEntity fangwuleixing, HttpServletRequest request){
fangwuleixing.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(fangwuleixing);
fangwuleixingService.insert(fangwuleixing);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody FangwuleixingEntity fangwuleixing, HttpServletRequest request){
fangwuleixing.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(fangwuleixing);
fangwuleixingService.insert(fangwuleixing);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody FangwuleixingEntity fangwuleixing, HttpServletRequest request){
//ValidatorUtils.validateEntity(fangwuleixing);
fangwuleixingService.updateById(fangwuleixing);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
fangwuleixingService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<FangwuleixingEntity> wrapper = new EntityWrapper<FangwuleixingEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = fangwuleixingService.selectCount(wrapper);
return R.ok().put("count", count);
}
}