基于javaweb+jsp的房屋房产档案管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Layui Ajax)
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Layui Ajax
基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可
开发工具:eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
* 增加房产
*
* @param response
* @param request
* @throws IOException
*/
@RequestMapping("fangAdd")
public void add(HttpServletResponse response, HttpServletRequest request) throws IOException {
Fang vo = new Fang();
//取出页面传进来的参数
vo.setFangName(Util.decode(request, "fangName"));
vo.setFangDanyuan(Util.decode(request, "fangDanyuan"));
vo.setFangAddress(Util.decode(request, "fangAddress"));
vo.setFangHuxing(Util.decode(request, "fangHuxing"));
vo.setFangArea(Util.decode(request, "fangArea"));
vo.setFangRen(Util.decode(request, "fangRen"));
vo.setFangIdno(Util.decode(request, "fangIdno"));
vo.setFangType(Util.decode(request, "fangType"));
vo.setFangQixian(Util.decode(request, "fangQixian"));
vo.setFangText(Util.decode(request, "fangText"));
//调用Service层的增加(insert)方法
fangService.insert(vo);
this.redirectList(request, response);
}
/**
* 删除房产
vo.setFangName(Util.decode(request, "fangName"));
vo.setFangDanyuan(Util.decode(request, "fangDanyuan"));
vo.setFangAddress(Util.decode(request, "fangAddress"));
vo.setFangHuxing(Util.decode(request, "fangHuxing"));
vo.setFangArea(Util.decode(request, "fangArea"));
vo.setFangRen(Util.decode(request, "fangRen"));
vo.setFangIdno(Util.decode(request, "fangIdno"));
vo.setFangType(Util.decode(request, "fangType"));
vo.setFangQixian(Util.decode(request, "fangQixian"));
vo.setFangText(Util.decode(request, "fangText"));
//调用Service层的增加(insert)方法
fangService.insert(vo);
this.redirectList(request, response);
}
/**
*/
public class Fang implements Serializable {
private Long id;//主键
private String fangName;//房产
private String fangDanyuan;//不动产号
private String fangAddress;//地址
private String fangHuxing;//户型
private String fangArea;//建筑面积
private String fangRen;//权利人
private String fangIdno;//身份证
private String fangType;//房产性质:商品房/经适房/公产房/小产权房
private String fangQixian;//使用期限
private String fangText;//备注
public Long getId() {
return id;
}
<div class="layui-input-block">
<input type="text" name="fangDanyuan" lay-verify="required" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">地址:</label>
<div class="layui-input-block">
<input type="text" name="fangAddress" lay-verify="required" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">户型:</label>
<div class="layui-input-block">
<input type="text" name="fangHuxing" lay-verify="required" class="layui-input">
<div class="layui-input-block">
<input type="text" name="fangName" lay-verify="required" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">不动产号:</label>
<div class="layui-input-block">
<input type="text" name="fangDanyuan" lay-verify="required" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">地址:</label>
<div class="layui-input-block">
<input type="text" name="fangAddress" lay-verify="required" class="layui-input">
</div>
</div>
<div class="layui-form-item">
}
});
obj.del(); //删除对应行(tr)的DOM结构,并更新缓存
//parent.location.reload();//刷新父级页面
// layer.close(index);
//parent.location.reload();//刷新父级页面
layer.msg(data.fangName + ' 删除成功!');
// });
} else if (layEvent === 'edit') { //编辑
layer.open({
type: 2,
area: ['800px', '550px'],
fixed: false, //不固定
let bytes = new Uint8Array(buffer);
let len = bytes.byteLength;
for (let i = 0; i < len; i++) {
binary += String.fromCharCode(bytes[i]);
}
return window.btoa(binary);
}
layui.use('table', function () {
let table = layui.table;
table.render({
elem: '#myData',
id: 'myTable',
url: 'noticeList',
parseData: function (res) { //res:即为原始返回的数据
let result = this.page.curr ? res.slice(this.limit * (this.page.curr - 1), this.limit * this.page.curr) : res.slice(0, this.limit);
return {
params.put("keyword", keyword);//查询的关键字
response.getWriter().println(com.alibaba.fastjson.JSONObject.toJSONString(noticeService.list(params).get("list")));
}
}
package com.demo.util;
import java.sql.Connection;
import java.sql.DriverManager;
import java.text.SimpleDateFormat;
/**
* 该方法为通用的工具类,放置一些共用的方法
*/
public class Util {
/**
* 获取系统当前时间并格式化为字符串
*
* @return
*/
public static String getTime() {
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(System.currentTimeMillis());
}
/**
* 判断字符串是不是中文
*
* @param c
* @param c
* @return
*/
private static boolean isChinese(char c) {
Character.UnicodeBlock ub = Character.UnicodeBlock.of(c);
return (ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
|| ub == Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS
|| ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A
|| ub == Character.UnicodeBlock.GENERAL_PUNCTUATION
|| ub == Character.UnicodeBlock.CJK_SYMBOLS_AND_PUNCTUATION
|| ub == Character.UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS);
}
/**
* 判断字符串是否是乱码
*
* @param strName
* @return
*/
public static boolean isMessyCode(String strName) {
java.util.regex.Pattern p = java.util.regex.Pattern.compile("\\s*|\t*|\r*|\n*");
java.util.regex.Matcher m = p.matcher(strName);
String after = m.replaceAll("");
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>房屋房产档案管理系统</title>
<link rel="stylesheet" href="js/layui/css/layui.css">
<script src="js/jquery.js"></script>
<script src="js/layer.js"></script>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
<div class="layui-header">
<div class="layui-logo" style="font-weight: bold;font-size: 19px">房屋房产档案管理系统</div>
<ul class="layui-nav layui-layout-left"></ul>
<c:if test="${loginUser==null}">
<ul class="layui-nav layui-layout-right">
<li class="layui-nav-item"><a href="login.jsp">请登录</a></li>
</ul>
</c:if>
<c:if test="${loginUser!=null}">
<ul class="layui-nav layui-layout-right">
<li class="layui-nav-item"><a>${loginUser.username}</a></li>
<li class="layui-nav-item"><a href="authLogout">退出登录</a></li>
</ul>
</c:if>
</div>
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
/**
* User模块的Service层(业务层)的具体实现类,对UserService接口中定义的抽象方法作出具体的功能实现
*/
@Service
public class UserServiceImpl implements UserService {
@Autowired
private UserMapper userMapper;
//@Override
public boolean insert(User vo) {
return this.userMapper.doCreate(vo) == 1;
}
//@Override
public boolean delete(Collection<Serializable> ids) {
return ids.isEmpty() ? false : this.userMapper.doRemoveBatch(ids) == ids.size();
}
运行环境
Java≥6、Tomcat≥7.0、MySQL≥5.5
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
技术框架
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Layui Ajax
基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
登录、注册、退出、用户模块、公告模块、房产模块的增删改查管理