1.举报管理功能修改

2.增加申请资料模块
3.主页-房源模块修改
4.主页-公示模块修改
master
pan 4 years ago
parent a97d216194
commit c6f2bfa06f
  1. 58
      WebRoot/admin/applylist.jsp
  2. 154
      WebRoot/admin/applylist1.jsp
  3. 37
      WebRoot/admin/applylist2.jsp
  4. 5
      WebRoot/admin/communitylist.jsp
  5. 8
      WebRoot/admin/index.jsp
  6. 16
      WebRoot/admin/jblist.jsp
  7. 76
      WebRoot/admin/material.jsp
  8. 85
      WebRoot/admin/materialAdd.jsp
  9. 84
      WebRoot/admin/materialUpdate.jsp
  10. 59
      WebRoot/admin/userMaterial.jsp
  11. 48
      WebRoot/head.jsp
  12. 203
      WebRoot/ui/apply.jsp
  13. 22
      WebRoot/ui/detail.jsp
  14. 112
      WebRoot/ui/house.jsp
  15. 203
      WebRoot/ui/index.jsp
  16. 144
      WebRoot/ui/pub.jsp
  17. 7
      WebRoot/upload.jsp
  18. 103
      src/com/app/action/AppAction.java
  19. 46
      src/com/app/action/ApplyAction.java
  20. 4
      src/com/app/action/CommunityAction.java
  21. 190
      src/com/app/action/MaterialAction.java
  22. 6
      src/com/app/action/ReportAction.java
  23. 65
      src/com/app/bean/ApplicationMaterial.java
  24. 9
      src/com/app/bean/Apply.java
  25. 40
      src/com/app/bean/House.java
  26. 1
      src/com/app/bean/RefuseApply.java
  27. 2
      src/com/app/bean/Report.hbm.xml
  28. 28
      src/com/app/bean/Report.java
  29. 86
      src/com/app/bean/UserMaterial.java
  30. 16
      src/com/app/service/ApplyService.java
  31. 4
      src/com/app/service/ApplyServiceImpl.java
  32. 20
      src/com/app/service/ConstantsService.java
  33. 18
      src/com/app/service/HouseService.java
  34. 17
      src/com/app/service/HouseServiceImpl.java
  35. 36
      src/com/app/service/MaterialService.java
  36. 135
      src/com/app/service/MaterialServiceImpl.java
  37. 3
      src/com/app/service/ReportServiceImpl.java
  38. 2
      src/com/app/servlet/FileUploadServlet.java
  39. 44
      src/struts.xml

@ -27,6 +27,13 @@ String usertype = session.getAttribute("userType")+"";
<link href="<%=basePath %>static/assets/css/icons.min.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath %>static/assets/css/app.min.css" rel="stylesheet" type="text/css" />
<script>
function edit(id,content) {
$('#editDialog input[name=id]').val(id)
$('#editDialog textarea[name=content]').val(content)
$("#editDialog form").removeAttr("style").attr("action",'<%=basePath%>admin/apply/updateApply.do')
}
</script>
</head>
@ -72,12 +79,12 @@ String usertype = session.getAttribute("userType")+"";
<c:forEach items="${list}" var="item">
<tr class="even gradeA">
<td>${item.userid}</td>
<td>${USERS_MAP[item.userid].username}</td>
<td>${item.name}</td>
<td>${item.cate}</td>
<td>上传文件</td>
<td>
<td class="align-middle">${item.userid}</td>
<td class="align-middle">${USERS_MAP[item.userid].username}</td>
<td class="align-middle">${item.name}</td>
<td class="align-middle">${item.cate}</td>
<td class="align-middle"><a href="${pageContext.request.contextPath}/admin/material/findMaterial.do?applyId=${item.id}">查看申请资料</a></td>
<td class="align-middle">
<c:if test="${item.state eq '1' }">
<span class="badge badge-warning">待街道审核</span>
@ -88,7 +95,7 @@ String usertype = session.getAttribute("userType")+"";
<c:if test="${item.state eq '3' }">
<span class="badge badge-danger">街道审核不通过</span>
</c:if>
<c:if test="${item.state eq '4' }">
<c:if test="${item.state eq '4' }">
<span class="badge badge-warning">待市级审核</span>
</c:if>
<c:if test="${item.state eq '5' }">
@ -98,8 +105,8 @@ String usertype = session.getAttribute("userType")+"";
<span class="badge badge-danger">市级审核不通过</span>
</c:if>
</td>
<td>
<a style="margin-left: 10px" class="" href="<%=basePath%>admin/apply/edit.do?ret=list&id=${item.id}">
<td class="align-middle">
<a style="margin-left: 10px; cursor: pointer;" class="" data-toggle="modal" data-target="#editDialog" onclick="edit(${item.id},'${item.message}')">
<i class="icon-pencil"></i>
修改
</a>
@ -165,7 +172,38 @@ $(document).ready(function(){
</script>
</html>
<div class="modal fade" id="editDialog" tabindex="-1" role="dialog" aria-labelledby="editDialogTitle" aria-hidden="true">
<div class="modal-dialog " role="document">
<div class="modal-content">
<form method="post">
<input type="hidden" name="id"/>
<div class="modal-header">
<h5 class="modal-title" id="editDialogTitle">修改申请</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">详细申请说明</span>
</div>
<textarea class="form-control" name="content" aria-label="With textarea" ></textarea>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
<button type="submit" class="btn btn-primary">提交</button>
</div>
</form>
</div>
</div>
</div>
</body>
</html>

@ -58,108 +58,82 @@ String usertype = session.getAttribute("userType")+"";
<table id="example" class="data display datatable">
<thead>
<tr>
<th>房源</th>
<th>大小</th>
<th>类型</th>
<th>价格</th>
<th>申请人</th>
<th>上传资料</th>
<th>备注</th>
<th>申请时间</th>
<th>状态</th>
<th>申请人id</th>
<th>申请人姓名</th>
<th>申请社区</th>
<th>申请房源</th>
<th>申请资料</th>
<th>状态</th>
<th style="width: 150px;">操作</th>
</tr>
</thead>
<tbody>
<c:forEach items="${list}" var="item">
<c:forEach items="${list}" var="item">
<tr class="even gradeA">
<td>
${item.hs.rooname}
</td>
<td>${item.hs.size} </td>
<td>${item.hs.cate} </td>
<td>${item.hs.price}元/月 </td>
<td>
${item.user.username}/
${item.user.realname}</td>
<td>
<a target="_blank" href="<%=basePath%>${item.attachfile}">
查看
</a>
</td>
<td>
<span class="bz badge badge-info" txt="${item.message }">查看</span>
</td>
<td>${item.created}</td>
<td>
<c:if test="${item.state eq '1' }">
<span class="badge badge-warning">待街道审核</span>
</c:if>
<c:if test="${item.state eq '2' }">
<span class="badge badge-success">街道审核通过</span>
</c:if>
<c:if test="${item.state eq '3' }">
<span class="badge badge-danger">街道审核不通过</span>
</c:if>
<c:if test="${item.state eq '4' }">
<span class="badge badge-warning">待市级审核</span>
</c:if>
<c:if test="${item.state eq '5' }">
<span class="badge badge-success">市级审核通过</span>
</c:if>
<c:if test="${item.state eq '6' }">
<span class="badge badge-danger">市级审核不通过</span>
</c:if>
<td>${item.userid}</td>
<td>${USERS_MAP[item.userid].username}</td>
<td>${item.name}</td>
<td>${item.cate}</td>
<td class="align-middle"><a href="${pageContext.request.contextPath}/admin/material/findMaterial.do?applyId=${item.id}">查看申请资料</a></td>
<td class="align-middle">
<c:if test="${item.state eq '1' }">
<span class="badge badge-warning">待街道审核</span>
</c:if>
<c:if test="${item.state eq '2' }">
<span class="badge badge-success">街道审核通过</span>
</c:if>
<c:if test="${item.state eq '3' }">
<span class="badge badge-danger">街道审核不通过</span>
</c:if>
<c:if test="${item.state eq '4' }">
<span class="badge badge-warning">待市级审核</span>
</c:if>
<c:if test="${item.state eq '5' }">
<span class="badge badge-success">市级审核通过</span>
</c:if>
<c:if test="${item.state eq '6' }">
<span class="badge badge-danger">市级审核不通过</span>
</c:if>
</td>
<td>
<c:if test="${item.state eq '1' }">
<a class="" href="<%=basePath%>admin/apply/pass.do?ret=list1&statex=2&id=${item.id}">
<i class="icon-pencil"></i>
通过
</a>
<a class="" href="<%=basePath%>admin/apply/pass.do?ret=list1&statex=3&id=${item.id}">
<i class="icon-pencil"></i>
不通过
</a>
</c:if>
<c:if test="${item.state eq '2' }">
<a class="" href="<%=basePath%>admin/apply/pass.do?ret=list1&statex=3&id=${item.id}">
<i class="icon-pencil"></i>
不通过
</a>
</c:if>
<c:if test="${item.state eq '3' }">
<a class="" href="<%=basePath%>admin/apply/pass.do?ret=list1&statex=2&id=${item.id}">
<i class="icon-pencil"></i>
通过
</a>
</c:if>
<a style="margin-left: 10px" class="" href="<%=basePath%>admin/apply/delete.do?ret=list1&id=${item.id}">
<i class="icon-pencil"></i>
删除
<c:if test="${item.state eq '1' }">
<a class="" href="<%=basePath%>admin/apply/pass.do?ret=list1&statex=2&id=${item.id}">
<i class="icon-pencil"></i>
通过
</a>
<a class="" href="<%=basePath%>admin/apply/pass.do?ret=list1&statex=3&id=${item.id}">
<i class="icon-pencil"></i>
不通过
</a>
</c:if>
<c:if test="${item.state eq '2' }">
<a class="" href="<%=basePath%>admin/apply/pass.do?ret=list1&statex=3&id=${item.id}">
<i class="icon-pencil"></i>
不通过
</a>
</c:if>
<c:if test="${item.state eq '3' }">
<a class="" href="<%=basePath%>admin/apply/pass.do?ret=list1&statex=2&id=${item.id}">
<i class="icon-pencil"></i>
通过
</a>
</c:if>
<a style="margin-left: 10px" class="" href="<%=basePath%>admin/apply/delete.do?ret=list2&id=${item.id}">
<i class="icon-pencil"></i>
删除
</a>
</td>
</tr>
</c:forEach>
</c:forEach>
</tbody>
</table>

@ -70,6 +70,7 @@ String usertype = session.getAttribute("userType")+"";
<th>申请社区</th>
<th>申请房源</th>
<th>申请资料</th>
<th>状态</th>
<th style="width: 150px;">操作</th>
</tr>
</thead>
@ -79,12 +80,32 @@ String usertype = session.getAttribute("userType")+"";
<tr class="even gradeA">
<td>${item.userid}</td>
<td>${USERS_MAP[item.userid].username}</td>
<td>${USERS_MAP[item.userid].realname}</td>
<td>${item.name}</td>
<td>${item.cate}</td>
<td>上传文件</td>
<td class="align-middle"><a href="${pageContext.request.contextPath}/admin/material/findMaterial.do?applyId=${item.id}">查看申请资料</a></td>
<td class="align-middle">
<c:if test="${item.state eq '1' }">
<span class="badge badge-warning">待街道审核</span>
</c:if>
<c:if test="${item.state eq '2' }">
<span class="badge badge-success">街道审核通过</span>
</c:if>
<c:if test="${item.state eq '3' }">
<span class="badge badge-danger">街道审核不通过</span>
</c:if>
<c:if test="${item.state eq '4' }">
<span class="badge badge-warning">待市级审核</span>
</c:if>
<c:if test="${item.state eq '5' }">
<span class="badge badge-success">市级审核通过</span>
</c:if>
<c:if test="${item.state eq '6' }">
<span class="badge badge-danger">市级审核不通过</span>
</c:if>
</td>
<td>
<c:if test="${item.state eq 2 }">
@ -99,7 +120,7 @@ String usertype = session.getAttribute("userType")+"";
</c:if>
<c:if test="${item.state eq 5 }">
<a class="" data-toggle="modal" data-target="#refuseDialog"style="cursor:pointer" onclick="refuse(${item.id})">
<a class="" data-toggle="modal" data-target="#refuseDialog" style="cursor:pointer" onclick="refuse(${item.id})">
<i class="icon-pencil"></i>
不通过
</a>
@ -116,12 +137,6 @@ String usertype = session.getAttribute("userType")+"";
<i class="icon-pencil"></i>
删除
</a>
</td>
</tr>

@ -30,10 +30,7 @@
</c:if>
<c:if test="${!empty state }">
toastr.${state}('${message}', '提示');
<%--setTimeout(function(){--%>
<%-- window.location.href = "<%=basePath%>${url}";--%>
<%--},1500)--%>
toastr.${state}('${message}', '提示');
</c:if>
})

@ -187,7 +187,7 @@ background-image: linear-gradient(160deg, #80D0C7 0%, #0093E9 100%);
<span> 数据统计 </span>
</a>
</li>
</c:if>
</c:if>
<c:if test="${userType eq '3'}">
<li>
@ -303,6 +303,12 @@ background-image: linear-gradient(160deg, #80D0C7 0%, #0093E9 100%);
<span> 数据统计 </span>
</a>
</li>
<li>
<a target="rightFrame" href="<%=basePath%>admin/material/list.do" aria-expanded="false">
<i data-feather="file"></i>
<span> 申请资料 </span>
</a>
</li>
</c:if>
</ul>

@ -47,8 +47,8 @@ String usertype = session.getAttribute("userType")+"";
<table id="example" class="data display datatable">
<thead>
<tr>
<th>举报用户id</th>
<th>举报用户姓名</th>
<th>举报用户id</th>
<th>举报用户姓名</th>
<th>举报人id</th>
<th>举报人事宜</th>
</tr>
@ -58,15 +58,11 @@ String usertype = session.getAttribute("userType")+"";
<c:forEach items="${list}" var="item">
<tr class="even gradeA">
<td>
${item.user}
</td>
<td>${item.applyUserId}</td>
<td>${item.title} </td>
<td>${item.content} </td>
<td>${item.created}</td>
<td>${USERS_MAP[item.applyUserId].username} </td>
<td>${item.userId} </td>
<td>${item.content}</td>

@ -0,0 +1,76 @@
<%--
Created by IntelliJ IDEA.
User: pan
Date: 2020/6/10 0010
Time: 6:46
To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
<c:import url="../head.jsp"/>
<link href="<%=basePath %>static/toastr-master/toastr.min.css" rel="stylesheet" type="text/css" />
<script src="<%=basePath %>static/toastr-master/toastr.min.js"></script>
<script>
$(function () {
<c:if test="${!empty state }">
toastr.${state}('${message}', '提示');
</c:if>
})
</script>
</head>
<body>
<div class="box round first" style="margin:15px;">
<div class="block">
<h2>数据列表</h2>
<div>
<a class="btn btn-primary" href="<%=basePath%>admin/material/toAdd.do">添加资料</a>
</div>
</div>
<table id="example" class="data display datatable">
<thead>
<th>资料名</th>
<th>资料类型</th>
<th>资料表单名</th>
<th>资料表单顺序</th>
<th>操作</th>
</thead>
<tbody>
<c:forEach items="${list}" var="item">
<tr class="even gradeA">
<td>${item.materialName}</td>
<td>
<c:choose>
<c:when test="${item.formType eq 'text'}">文本</c:when>
<c:when test="${item.formType eq 'doc'}">图片</c:when>
</c:choose>
</td>
<td>${item.formName}</td>
<td>${item.formOrder}</td>
<td>
<a href="<%=basePath%>admin/material/toUpdate.do?applicationMaterial.id=${item.id}">
<i class="icon-pencil"></i>
更新资料
</a>
<a href="<%=basePath%>admin/material/delete.do?applicationMaterial.id=${item.id}">
<i class="icon-remove"></i>
删除资料
</a>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</body>
</html>

@ -0,0 +1,85 @@
<%--
Created by IntelliJ IDEA.
User: pan
Date: 2020/6/10 0010
Time: 6:46
To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
<c:import url="../head.jsp"/>
<script>
function validateIt(inputelement){
if(inputelement.validity.patternMismatch){
inputelement.setCustomValidity('只允许输入英文字母');
}else{
inputelement.setCustomValidity(''); //输入内容符合验证条件
}
return true;
}
</script>
</head>
<body>
<div class="box round first" style="margin:15px;">
<h2>录入数据</h2>
<div class="block">
<form method="POST" action="<%=basePath%>admin/material/add.do">
<table class="form">
<tbody>
<tr>
<td class="col1">
<label>资料名</label>
</td>
<td class="col3">
<input name="applicationMaterial.materialName" required value="" type="text" class="medium">
</td>
</tr>
<tr>
<td class="col1">
<label>资料类型</label>
</td>
<td class="col3">
<select name="applicationMaterial.formType" required class="medium">
<option value="">请选择资料类型</option>
<option value="text">文本</option>
<option value="doc">图片</option>
</select>
</td>
</tr>
<tr>
<td class="col1">
<label>资料表单名</label>
</td>
<td class="col3">
<input name="applicationMaterial.formName" required class="medium" pattern="[a-zA-Z]+" oninvalid="validateIt(this)" oninput="validateIt(this)"/>
<span class="text-danger">只允许输入英文字母</span>
</td>
</tr>
<tr>
<td class="col1">
<label>资料表单顺序</label>
</td>
<td class="col3">
<input name="applicationMaterial.formOrder" class="medium" type="number" min="0">
</td>
</tr>
<tr>
<td colspan="2">
<button type="submit" class="btn btn-blue">提交数据</button>
</td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
</body>
</html>

@ -0,0 +1,84 @@
<%--
Created by IntelliJ IDEA.
User: pan
Date: 2020/6/10 0010
Time: 6:46
To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
<c:import url="../head.jsp"/>
<script>
function validateIt(inputelement){
if(inputelement.validity.patternMismatch){
inputelement.setCustomValidity('只允许输入英文字母');
}else{
inputelement.setCustomValidity(''); //输入内容符合验证条件
}
return true;
}
</script>
</head>
<body>
<div class="box round first" style="margin:15px;">
<h2>录入数据</h2>
<div class="block">
<form method="POST" action="<%=basePath%>admin/material/update.do">
<table class="form">
<tbody>
<tr>
<td class="col1">
<label>资料名</label>
</td>
<td class="col3">
<input name="applicationMaterial.materialName" required value="${model.materialName}" type="text" class="medium">
</td>
</tr>
<%-- <tr>--%>
<%-- <td class="col1">--%>
<%-- <label>资料类型</label>--%>
<%-- </td>--%>
<%-- <td class="col3">--%>
<%-- <input readonly value="--%>
<%--<c:choose>--%>
<%-- <c:when test="${model.formType eq 'text'}">文本</c:when>--%>
<%-- <c:when test="${model.formType eq 'doc'}">文件</c:when>--%>
<%--</c:choose>" type="text" class="medium">--%>
<%-- </td>--%>
<%-- </tr>--%>
<%-- <tr>--%>
<%-- <td class="col1">--%>
<%-- <label>资料表单名</label>--%>
<%-- </td>--%>
<%-- <td class="col3">--%>
<%-- <input readonly value="${model.formName}" type="text" class="medium">--%>
<%-- </td>--%>
<%-- </tr>--%>
<tr>
<td class="col1">
<label>资料表单顺序</label>
</td>
<td class="col3">
<input name="applicationMaterial.formOrder" value="${model.formOrder}" class="medium" type="number" min="0">
</td>
</tr>
<tr>
<td colspan="2">
<button type="submit" class="btn btn-blue">更新数据</button>
</td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
</body>
</html>

@ -0,0 +1,59 @@
<%--
Created by IntelliJ IDEA.
User: pan
Date: 2020/6/10 0010
Time: 13:05
To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
<c:import url="../head.jsp"/>
<style>
img:hover{
width: auto;
height: auto;
}
img{
width: 100px;
height: 100px;
}
</style>
</head>
<body>
<div class="box round first" style="margin:15px;">
<table>
<thead>
<tr>
<th>资料名</th>
<th>内容</th>
</tr>
</thead>
<tbody>
<c:forEach items="${materialList}" var="item">
<tr>
<td class="align-middle">${item.materialName}</td>
<td>
<c:choose>
<c:when test="${item.formType eq 'text'}">${item.formValue}</c:when>
<c:when test="${item.formType eq 'doc'}">
<img src="<%=basePath%>${item.formValue}" />
</c:when>
</c:choose>
</td>
</tr>
</c:forEach>
</tbody>
</table>
<button onclick="history.back()" class="btn-block col-1 ml-auto mr-auto">返回</button>
</div>
</body>
</html>

@ -12,37 +12,33 @@
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
<meta charset="utf-8" />
<title>公共租赁住房租赁管理系统</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8" />
<title>公共租赁住房租赁管理系统</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- App favicon -->
<link rel="shortcut icon" href="<%=basePath %>static/assets/images/favicon.ico">
<!-- App favicon -->
<link rel="shortcut icon" href="<%=basePath %>static/assets/images/favicon.ico">
<!-- plugins -->
<link href="<%=basePath %>static/assets/libs/flatpickr/flatpickr.min.css" rel="stylesheet" type="text/css" />
<!-- plugins -->
<link href="<%=basePath %>static/assets/libs/flatpickr/flatpickr.min.css" rel="stylesheet" type="text/css" />
<!-- App css -->
<link href="<%=basePath %>static/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath %>static/assets/css/icons.min.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath %>static/assets/css/app.min.css" rel="stylesheet" type="text/css" />
<!-- App css -->
<link href="<%=basePath %>static/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath %>static/assets/css/icons.min.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath %>static/assets/css/app.min.css" rel="stylesheet" type="text/css" />
<script src="<%=basePath %>static/assets/js/vendor.min.js"></script>
<script src="<%=basePath %>static/assets/js/vendor.min.js"></script>
<!-- optional plugins -->
<script src="<%=basePath %>static/assets/libs/moment/moment.min.js"></script>
<script src="<%=basePath %>static/assets/libs/apexcharts/apexcharts.min.js"></script>
<script src="<%=basePath %>static/assets/libs/flatpickr/flatpickr.min.js"></script>
<!-- optional plugins -->
<script src="<%=basePath %>static/assets/libs/moment/moment.min.js"></script>
<script src="<%=basePath %>static/assets/libs/apexcharts/apexcharts.min.js"></script>
<script src="<%=basePath %>static/assets/libs/flatpickr/flatpickr.min.js"></script>
<!-- page js -->
<script src="<%=basePath %>static/assets/js/pages/dashboard.init.js"></script>
<!-- page js -->
<script src="<%=basePath %>static/assets/js/pages/dashboard.init.js"></script>
<!-- App js -->
<script src="<%=basePath %>static/assets/js/app.min.js"></script>
<script src="<%=basePath %>static/js.js"></script>
</head>
</html>
<!-- App js -->
<script src="<%=basePath %>static/assets/js/app.min.js"></script>
<script src="<%=basePath %>static/js.js"></script>

@ -1,37 +1,66 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" %>
<%@ page language="java" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<jsp:include page="header.jsp"></jsp:include>
<style>
.breadcrumb-area{position:relative}
.breadcrumb-area:before{
width: 100%;
height: 100%;
content: "";
position: absolute;
left: 0;
top: 0;
pointer-events: none;
background: linear-gradient(45deg, rgb(240, 100, 150), rgb(140, 200, 208));
opacity: .7;
-webkit-transition: .4s;
transition: .4s;
}
.breadcrumb-area {
position: relative
}
.breadcrumb-area:before {
width: 100%;
height: 100%;
content: "";
position: absolute;
left: 0;
top: 0;
pointer-events: none;
background: linear-gradient(45deg, rgb(240, 100, 150), rgb(140, 200, 208));
opacity: .7;
-webkit-transition: .4s;
transition: .4s;
}
hr {
border: none;
border-top: 3px double #333;
color: #333;
overflow: visible;
text-align: center;
height: 5px;
}
hr.basic:after {
background: #fff;
content: '基础信息';
padding: 0 4px;
position: relative;
top: -13px;
}
hr.detail:after {
background: #fff;
content: '申请资质';
padding: 0 4px;
position: relative;
top: -13px;
}
</style>
<!-- Breadcrumb -->
<div class="breadcrumb-area section"
style="background:url(<%=basePath %>static/breadcrumb.jpg);"
<div class="breadcrumb-area section"
style="background:url(<%=basePath %>static/breadcrumb.jpg);"
>
<div class="container">
<div class="breadcrumb pt-75 pb-75 pt-sm-70 pb-sm-40 pt-xs-70 pb-xs-40">
@ -51,8 +80,8 @@ style="background:url(<%=basePath %>static/breadcrumb.jpg);"
</div>
<!--// Breadcrumb -->
<!-- Our Agents Section Start -->
<!-- Our Agents Section Start -->
<div class="contact-section section pt-110 pt-md-90 pt-sm-70 pt-xs-60 pb-110 pb-md-90 pb-sm-70 pb-xs-60">
<div class="container">
<div class="row">
@ -61,23 +90,28 @@ style="background:url(<%=basePath %>static/breadcrumb.jpg);"
<div class="contact-title pb-30">
<h4>GET IN <span>APPLY</span></h4>
<p>
在线提交申请租赁公租房申请
<c:set value="在线申请租赁" var="typePrefix"/>
<c:choose>
<c:when test="${communityType eq 1}">${typePrefix}公租房</c:when>
<c:when test="${communityType eq 2}">${typePrefix}廉租房</c:when>
<c:when test="${communityType eq 3}">${typePrefix}经济适用房</c:when>
</c:choose>
</p>
</div>
<div class="contact-info">
<ul>
<li>
<div class="contact-text d-flex align-items-center">
<i class="glyph-icon flaticon-placeholder"></i>
<p>${model.address } <br></p>
<i class="glyph-icon flaticon-placeholder"></i>
<p>${address } <br></p>
</div>
</li>
<li>
<div class="contact-text d-flex align-items-center">
<i class="glyph-icon flaticon-earth"></i>
<i class="glyph-icon flaticon-earth"></i>
<p>
<span>大小 : <a href="#"> ${model.size }/</a></span>
<span>大小 : <a href="#"> ${model.size }</a></span>
<span>房型 : <a href="#">${model.cate }</a></span>
</p>
</div>
@ -86,65 +120,106 @@ style="background:url(<%=basePath %>static/breadcrumb.jpg);"
<div class="contact-text d-flex align-items-center">
<i class="glyph-icon flaticon-call"></i>
<p>
<span>有问题联系:</span>
<span>有问题联系:</span>
<span>邮箱 : <a href="#">service@gzf.com</a></span>
<span>电话 : <a href="#">0871 115 455 2541</a></span>
</p>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="contact-us-wrap">
<h4>详细填写申请表</h4>
<div class="contact-form">
<form id="" method="POST" action="<%=basePath%>app/post.do">
<div class="row row-10">
<div class="col-md-6 col-12 mb-30"><input required value="${userName }" readonly name="name" type="text" placeholder=""></div>
<input type="hidden" name="id" value="${model.id }"/>
<div class="col-12 mb-30">
申请材料:
<input type="text" required class="form-control" id="attachfile" value="" name="attachfile" >
<a href="javascript:;" style="margin-top:10px" class="btn uploadImg ">点击上传</a>
<div class="contact-form">
<form method="POST" action="<%=basePath%>app/post.do">
<input type="hidden" name="id" value="${model.id }"/>
<hr class="basic">
<div class="row">
<div class="col-3 d-flex align-items-center justify-content-end ">
申请人
</div>
<div class="col">
<input name="name" required value="${userName }" readonly type="text"
class="medium">
</div>
</div>
<div class="row mt-3">
<div class="col-3 d-flex align-items-center justify-content-end ">
申请说明
</div>
<div class="col">
<textarea name="messagex" required
placeholder="详细申请说明"></textarea>
</div>
</div>
<hr class="detail">
<c:forEach items="${materialMap}" var="item">
<div class="row mt-3">
<div class="col-3 d-flex align-items-center justify-content-end ">
${item.value.materialName}
</div>
<div class="col">
<c:choose>
<c:when test="${item.value.formType eq 'text'}">
<input name="${item.key}" required type="text">
</c:when>
<c:when test="${item.value.formType eq 'doc'}">
<input type="text" required class="form-control"
name="${item.key}">
<a style="margin-top:10px" class="btn uploadImg">点击上传</a>
</c:when>
</c:choose>
</div>
</div>
</c:forEach>
<div class="row">
<div class="col text-center">
<button class="btn send-btn btn-info btn-block col-5 offset-5 mt-3">提交</button>
</div>
<div class="col-12 mb-30"><textarea name="messagex" required placeholder="详细申请说明"></textarea></div>
<div class="col-12"><button class="btn send-btn btn-circle">提交</button></div>
</div>
</form>
<p class="form-messege"></p>
</div>
<p class="form-messege"></p>
</div>
</div>
</div>
</div>
</div><!-- Our Agents Section End -->
</div>
</div>
<!-- Our Agents Section End -->
<jsp:include page="footer.jsp"></jsp:include>
<script src="<%=basePath %>static/window.js"></script>
<link href="<%=basePath %>static/toastr-master/toastr.min.css" rel="stylesheet" type="text/css" />
<script src="<%=basePath %>static/toastr-master/toastr.min.js"></script>
<script>
$(".uploadImg").click(function(){
openWindow("<%=basePath%>upload.jsp");
});
<link href="<%=basePath %>static/toastr-master/toastr.min.css" rel="stylesheet" type="text/css"/>
<script src="<%=basePath %>static/toastr-master/toastr.min.js"></script>
<script>
$(function () {
$(".uploadImg").click(function (e) {
openWindow("<%=basePath%>upload.jsp?name=" + $(this).prev().attr('name'))
})
<c:if test="${!empty state }">
toastr.${state}('${message}', '提示');
setTimeout(function(){
window.location.href = "<%=basePath%>";
},1500)
toastr.${state}('${message}', '提示');
</c:if>
</script>
})
</script>

@ -41,7 +41,7 @@ style="background:url(<%=basePath %>static/breadcrumb.jpg);"
<!-- breadcrumb-list start -->
<ul class="breadcrumb-list">
<li class="breadcrumb-item"><a href="">首页</a></li>
<li class="breadcrumb-item active">房源</li>
<li class="breadcrumb-item active">社区</li>
</ul>
<!-- breadcrumb-list end -->
</div>
@ -125,14 +125,7 @@ style="background:url(<%=basePath %>static/breadcrumb.jpg);"
<div>
${model.description }
</div>
<p>
${model.content }
</p>
<div class="propertice-details pt-25">
<div class="row">
@ -165,12 +158,13 @@ style="background:url(<%=basePath %>static/breadcrumb.jpg);"
<strong>价格: ¥ ${model.price }元/月</strong>
</div>
</div>
<div class="col-md-4 col-sm-6">
<c:if test="${!empty userName }">
<c:if test="${model.state==1 }">
<a class="btn btn-primary" href="<%=basePath%>app/apply.do?id=${model.id}">我要申请</a>
</c:if>
<c:if test="${!empty userName}">
<c:if test="${model.state==1 }">
<a class="btn btn-primary" href="<%=basePath%>app/apply.do?id=${model.id}">我要申请</a>
</c:if>
</c:if>
</div>
</div>

@ -30,7 +30,7 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
<!-- Breadcrumb -->
<div class="breadcrumb-area section"
<div class="breadcrumb-area section"
style="background:url(<%=basePath %>static/breadcrumb.jpg);"
>
<div class="container">
@ -50,10 +50,10 @@ style="background:url(<%=basePath %>static/breadcrumb.jpg);"
</div>
</div>
<!--// Breadcrumb -->
<!-- Page Conttent -->
<main class="page-content section">
<!-- Featured Properites Start -->
<main class="page-content section">
<!-- Featured Properites Start -->
<div class="featured-properites-section section pt-110 pt-md-90 pt-sm-70 pt-xs-60 pb-110 pb-md-90 pb-sm-70 pb-xs-60">
<div class="container">
@ -75,8 +75,8 @@ style="background:url(<%=basePath %>static/breadcrumb.jpg);"
<div class="row">
<div class="col">
<ul class="properties-list nav justify-content-end" role="tablist">
<li class="active"><a class="active" href="#all" role="tab"
data-toggle="tab">ALL</a></li>
<li><a href="#buy" role="tab" data-toggle="tab">可用</a></li>
@ -84,7 +84,7 @@ style="background:url(<%=basePath %>static/breadcrumb.jpg);"
</ul>
</div>
</div>
<div class="row" style="margin-top: 10px">
<div class="col">
<ul class="properties-list nav justify-content-end" role="tablist">
@ -141,7 +141,7 @@ style="background:url(<%=basePath %>static/breadcrumb.jpg);"
<div class="tab-content">
<div class="tab-pane active" id="all">
<div class="row">
<c:forEach items="${hs}" var="item" varStatus="x">
<div class="col-lg-3 col-md-4 col-12">
<!-- single-property Start -->
@ -157,34 +157,34 @@ style="background:url(<%=basePath %>static/breadcrumb.jpg);"
</div>
<div class="property-desc">
<h4>
<a href="<%=basePath %>app/detail.do?id=${item.id}">${item.rooname} </a>
<a href="<%=basePath %>app/detail.do?id=${item.id}">${item.communityName}</a>
</h4>
<p>
<span class="location">
${item.address}</span>
<span class="property-info"> 发布 ${item.created}
<em>
${item.cate }
</em>
</span>
</p>
<div class="price-box">
<p>${item.price}元/月</p>
</div>
<span class="location">
${item.address}</span>
<span class="property-info"> 发布 ${item.created}
<em>
${item.cate }
</em>
</span>
</p>
<div class="price-box">
<p>${item.price}元/月</p>
</div>
</div>
</div><!-- single-property End -->
</div>
</c:forEach>
</div>
</div>
<div class="tab-pane" id="buy">
<div class="row">
<c:forEach items="${hs}" var="item" varStatus="x">
<c:if test="${item.state==1 }">
<div class="col-lg-3 col-md-4 col-12">
@ -206,10 +206,10 @@ style="background:url(<%=basePath %>static/breadcrumb.jpg);"
<p>
<span class="location">
${item.address}</span>
<span class="property-info"> 发布 ${item.created}
<span class="property-info"> 发布 ${item.created}
<em>
${item.cate }
</em>
</em>
</span>
</p>
<div class="price-box">
@ -220,17 +220,17 @@ style="background:url(<%=basePath %>static/breadcrumb.jpg);"
</div></c:if>
</c:forEach>
</div>
</div>
<div class="tab-pane" id="buy1">
<div class="row">
<c:forEach items="${hs}" var="item" varStatus="x">
<c:if test="${item.state==2 }">
<div class="col-lg-3 col-md-4 col-12">
@ -252,10 +252,10 @@ style="background:url(<%=basePath %>static/breadcrumb.jpg);"
<p>
<span class="location">
${item.address}</span>
<span class="property-info"> 发布 ${item.created}
<span class="property-info"> 发布 ${item.created}
<em>
${item.cate }
</em>
</em>
</span>
</p>
<div class="price-box">
@ -266,34 +266,34 @@ style="background:url(<%=basePath %>static/breadcrumb.jpg);"
</div></c:if>
</c:forEach>
</div>
</div>
</div>
</div>
</div><!-- Featured Properites End -->
</div><!-- Featured Properites End -->
</main>
<!--// Page Conttent -->
<jsp:include page="footer.jsp"></jsp:include>
<script type="text/javascript">
$(document).ready(function(){
// loadRegion("province",1);
// loadRegion("province",1);
//loadRegion("city",2);
// loadRegion("area",52);
$("#province,#city").change(function(){
//sel = $(this).next("select").attr("id");
var v_t=$(this).attr("id");
@ -303,29 +303,29 @@ $(document).ready(function(){
if (v_t=='city') {
loadRegion('area',$(this).val());
}
});
$('#area').change(function(){
window.location.href = "<%=basePath%>app/house.do?areaid="+$('#area').val();
});
})
function loadRegion(sel,parentId)
{
{
//sel=="city"?$("#area").html(""):false
$("#"+sel).html("");
$.get("<%=basePath%>rg.sl?flag=1&id="+parentId,function(e){
$("#"+sel).html(e);
sel=="city"?reload():false;
})
})
}
function reload()
{
sel = "area";
loadRegion(sel,$("#city").val());
}
</script>

@ -1,11 +1,11 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" %>
<%@ page language="java" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
@ -13,150 +13,149 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
<jsp:include page="header.jsp"></jsp:include>
<div class="container1">
<div class="hero-section section">
<div class="hero-slider hero-slider-one">
<c:forEach items="${ads}" var="item">
<div class="hero-slide-item" style="height:450px; background-image: url(<%=basePath%>${item.thumb })">
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-9 ml-auto mr-auto">
<div class="hero-content text-center">
<h1>${item.title }</h1>
<h3 class="text-white mt-25">
Public rental housing rental </h3>
<div class="hero-section section">
<div class="hero-slider hero-slider-one">
<c:forEach items="${ads}" var="item">
<div class="hero-slide-item" style="height:450px; background-image: url(<%=basePath%>
${item.thumb })">
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-9 ml-auto mr-auto">
<div class="hero-content text-center">
<h1>${item.title }</h1>
<h3 class="text-white mt-25">
Public rental housing rental </h3>
</div>
</div>
</div>
</div>
</div>
</div>
</c:forEach>
</div>
</c:forEach>
</div>
</div><!-- Hero Section End -->
</div><!-- Hero Section End -->
</div>
<!-- Featured Properites Start -->
<!-- Featured Properites Start -->
<!-- Featured Properites Start -->
<!-- Featured Properites Start -->
<div class="featured-properites-section section" style="margin-top:50px;">
<div class="container">
<div class="row">
<div class="col-12">
<div class="tabs-categorys-list mb-30 mb-md-20 mb-xs-20 mb-sm-20">
<ul class="nav" role="tablist">
<li class="active"><a class="active"
href="#tab_item_01" role="tab" data-toggle="tab">
Newest house</a></li>
<li><a href="#tab_item_01" role="tab" data-toggle="tab">
最新房源</a></li>
</ul>
<li class="active"><a class="active"
href="#tab_item_01" role="tab" data-toggle="tab">
Newest house</a></li>
<li><a href="#tab_item_01" role="tab" data-toggle="tab">
最新房源</a></li>
</ul>
</div>
</div>
</div>
<!-- tab-contnt start -->
<div class="tab-content">
<div class="tab-pane active" id="tab_item_01">
<div class="row ">
<c:forEach items="${hs}" var="item" varStatus="x">
<c:if test="${x.index<4 }">
<div class="col-lg-3 col-md-6 col-12">
<!-- single-property Start -->
<div class="single-property mt-30">
<div class="property-img">
<a href="<%=basePath %>app/detail.do?id=${item.id}">
<img src="<%=basePath %>${item.thunb}" alt="">
</a>
<span class="level-stryker">
<c:if test="${item.state==1 }">闲置</c:if>
<c:if test="${item.state==2 }">使用中</c:if></span>
</div>
<div class="property-desc">
<h4>
<a href="<%=basePath %>app/detail.do?id=${item.id}">${item.rooname} </a></h4>
<p>
<span class="location">
${item.address}</span>
<span class="property-info"> 发布 ${item.created}
<em>
${item.cate }
</em>
<c:forEach items="${hs}" var="item" varStatus="x">
<c:if test="${x.index<4 }">
<div class="col-lg-3 col-md-4 col-12">
<!-- single-property Start -->
<div class="single-property mt-30">
<div class="property-img">
<a href="<%=basePath %>app/detail.do?id=${item.id}">
<img src="<%=basePath %>${item.thunb}" alt="">
</a>
<span class="level-stryker">
<c:if test="${item.state==1 }">闲置</c:if>
<c:if test="${item.state==2 }">使用中</c:if>
</span>
</p>
<div class="price-box">
<p>${item.price}元/月</p>
</div>
</div>
<div class="property-desc">
<h4>
<a href="<%=basePath %>app/detail.do?id=${item.id}">${item.communityName}</a>
</h4>
<p>
<span class="location">
${item.address}</span>
<span class="property-info"> 发布 ${item.created}
<em>
${item.cate }
</em>
</span>
</p>
<div class="price-box">
<p>${item.price}元/月</p>
</div>
</div>
</div><!-- single-property End -->
</div>
</div><!-- single-property End -->
</div>
</c:if>
</c:if>
</c:forEach>
</div>
</div>
</div>
</div>
</div><!-- Featured Properites End -->
</div>
<!-- Featured Properites End -->
<!-- Latest Blog Section Start -->
<div class="latest-blog-section section pt-160 pt-md-140 pt-sm-120 pt-xs-110 pb-110 pb-md-90 pb-sm-70 pb-xs-60">
<div class="container">
<div class="row">
<div class="section-title text-center col mb-30 mb-md-20 mb-xs-20 mb-sm-20">
<h2>资料下载</h2>
<p> DOWNLOADS </p>
</div>
</div>
<div class="row">
<c:forEach items="${news}" var="item" varStatus="x">
<c:if test="${x.index<3 }">
<div class="col-lg-4 col-md-6 mt-30">
<!-- Single latest blog Start -->
<div class="single-latest-blog">
<div class="latest-blog-image">
<a href="<%=basePath %>app/view.do?id=${item.id}">
<c:forEach items="${news}" var="item" varStatus="x">
<c:if test="${x.index<3 }">
<div class="col-lg-4 col-md-6 mt-30">
<!-- Single latest blog Start -->
<div class="single-latest-blog">
<div class="latest-blog-image">
<a href="<%=basePath %>app/view.do?id=${item.id}">
<img src="<%=basePath %>${item.thumb}" alt="">
</a>
</div>
<div class="latest-blog-contents">
<h4><a href="<%=basePath %>app/view.do?id=${item.id}">
${item.title }</a></h4>
<p><span>${item.created }</span> / <span>POSTED</span></p>
<p>
${item.description}
</p>
<a class="read-more" href="<%=basePath %>app/view.do?id=${item.id}">Read More</a>
</div>
</div><!-- Single latest blog End -->
</div>
<div class="latest-blog-contents">
<h4><a href="<%=basePath %>app/view.do?id=${item.id}">
${item.title }</a></h4>
<p><span>${item.created }</span> / <span>POSTED</span></p>
<p>
${item.description}
</p>
<a class="read-more" href="<%=basePath %>app/view.do?id=${item.id}">Read More</a>
</div>
</div><!-- Single latest blog End -->
</div>
</c:if>
</c:if>
</c:forEach>
</div>
</div>
</div><!-- Latest Blog Section End -->
</div>
<!-- Latest Blog Section End -->
<jsp:include page="footer.jsp"></jsp:include>

@ -1,11 +1,11 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" %>
<%@ page language="java" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
@ -13,9 +13,9 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
<jsp:include page="header.jsp"></jsp:include>
<!-- Breadcrumb -->
<div class="breadcrumb-area section" style="background: linear-gradient(45deg, rgb(240, 100, 150), rgb(140, 200, 208));">
<div class="breadcrumb-area section"
style="background: linear-gradient(45deg, rgb(240, 100, 150), rgb(140, 200, 208));">
<div class="container">
<div class="breadcrumb pt-75 pb-75 pt-sm-70 pb-sm-40 pt-xs-70 pb-xs-40">
<div class="row">
@ -33,86 +33,54 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
</div>
</div>
<!--// Breadcrumb -->
<!-- Page Conttent -->
<main class="page-content section">
<main class="page-content section">
<!-- Blog Grids Area -->
<div class="blog-grids-area pt-80 pt-md-60 pt-sm-40 pt-xs-30 pb-110 pb-md-90 pb-sm-70 pb-xs-60">
<div class="container">
<div class="row">
<table id="example" class="table">
<thead>
<tr>
<th>房源</th>
<th>大小</th>
<th>类型</th>
<th>价格</th>
<th>申请人</th>
<th>上传资料</th>
<th>备注</th>
<th>申请时间</th>
<th>状态</th>
<th style="width: 150px;">投诉举报</th>
</tr>
<div class="col">
<ul class="properties-list nav justify-content-end" role="tablist">
<li><a class="${empty param.type?'active':''}" href="${pageContext.request.contextPath}/app/pub.do">所有</a></li>
<li><a class="${param.type eq 'type1'?'active':''}" href="${pageContext.request.contextPath}/app/pub.do?type=type1">公租房</a></li>
<li><a class="${param.type eq 'type2'?'active':''}" href="${pageContext.request.contextPath}/app/pub.do?type=type2">廉租房</a></li>
<li><a class="${param.type eq 'type3'?'active':''}" href="${pageContext.request.contextPath}/app/pub.do?type=type3">经济适用房</a></li>
</ul>
</div>
</div>
<div class="row mt-3">
<table id="example" class="table">
<thead>
<tr>
<th>地区</th>
<th>申请人姓名</th>
<th>社区名称</th>
<th>户型</th>
<th style="width: 150px;">投诉举报</th>
</tr>
</thead>
<tbody>
<c:forEach items="${list}" var="item">
<tr class="even gradeA">
<td>
${item.hs.rooname}
</td>
<td>${item.hs.size} </td>
<td>${item.hs.cate} </td>
<td>${item.hs.price}元/月 </td>
<td>
${item.user.username}/
${item.user.realname}</td>
<td>
<a target="_blank" href="<%=basePath%>${item.attachfile}">
查看
</a>
</td>
<td>
<span class="bz badge badge-info" txt="${item.message }">查看</span>
</td>
<td>${item.created}</td>
<td>
<c:if test="${item.state eq '1' }">
<span class="badge badge-warning">待街道审核</span>
</c:if>
<c:if test="${item.state eq '2' }">
<span class="badge badge-success">街道审核通过</span>
</c:if>
<c:if test="${item.state eq '3' }">
<span class="badge badge-danger">街道审核不通过</span>
</c:if>
<c:if test="${item.state eq '4' }">
<span class="badge badge-warning">待市级审核</span>
</c:if>
<c:if test="${item.state eq '5' }">
<span class="badge badge-success">市级审核通过</span>
</c:if>
<c:if test="${item.state eq '6' }">
<span class="badge badge-danger">市级审核不通过</span>
</c:if>
</td>
<td>
<a class="btn" href="<%=basePath%>app/jb.do?id=${item.id}">举报</a>
</td>
</tr>
</c:forEach>
<c:forEach items="${list}" var="item">
<tr class="even gradeA">
<td>${RegionMap[item.pid].region_name}-${RegionMap[item.cid].region_name}-${RegionMap[item.aid].region_name}</td>
<td>${USERS_MAP[item.userid].username}</td>
<td>${item.name}</td>
<td>${item.houseType}</td>
<td>
<a class="btn" href="<%=basePath%>app/jb.do?id=${item.id}">举报</a>
</td>
</tr>
</c:forEach>
</tbody>
</table>
@ -122,15 +90,15 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
<!--// Blog Grids Area -->
</main>
<!--// Page Conttent -->
<jsp:include page="footer.jsp"></jsp:include>
<link href="<%=basePath %>static/toastr-master/toastr.min.css" rel="stylesheet" type="text/css" />
<script src="<%=basePath %>static/toastr-master/toastr.min.js"></script>
<script>
$(".bz").click(function(){
var txt = $(this).attr("txt");
toastr.success(txt, '提示');
});
</script>
<link href="<%=basePath %>static/toastr-master/toastr.min.css" rel="stylesheet" type="text/css"/>
<script src="<%=basePath %>static/toastr-master/toastr.min.js"></script>
<script>
$(".bz").click(function () {
var txt = $(this).attr("txt");
toastr.success(txt, '提示');
});
</script>

@ -24,8 +24,8 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
</head>
<body>
<form enctype="multipart/form-data" method="POST" action="<%=basePath%>upfile">
<input type="file" name="image" required>
<form enctype="multipart/form-data" method="POST" action="<%=basePath%>upfile?name=${param.name}">
<input type="file" accept="image/jpg, image/png, image/jpeg, image/gif" name="image" required>
<button type="submit">上传文件</button>
<br>
@ -41,8 +41,7 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
function copy()
{
var savePath = "${Saved}";
//alert(savePath);
window.opener.document.getElementById("attachfile").value=savePath;
window.opener.document.querySelector('input[name=${param.name}]').value=savePath
window.close();
}
</script>

@ -2,28 +2,43 @@ package com.app.action;
import com.app.bean.*;
import com.app.service.*;
import com.app.utils.CommunityType;
import com.app.utils.Constants;
import com.app.utils.MainUtils;
import com.opensymphony.xwork2.ActionContext;
import org.apache.struts2.ServletActionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@Controller
@Scope("prototype")
public class AppAction {
@Resource
AdsService adsService;
@Resource
CatesService catesService;
@Resource
NewsService newsService;
@Resource
HouseService houseService;
@Autowired
private AdsService adsService;
@Autowired
private CatesService catesService;
@Autowired
private NewsService newsService;
@Autowired
private HouseService houseService;
@Autowired
private CommunityService communityService;
@Autowired
private ApplyService applyService;
@Autowired
private UsersService usersService;
@Autowired
private MaterialService materialService;
private CommunityType type;
public List<Cates> getCate() {
List<Cates> list = catesService.list(" FROM Cates where pid=0");
@ -39,7 +54,8 @@ public class AppAction {
act.put("cates", getCate());
act.put("ads", adsService.list(" FROM Ads order by id DESC"));
act.put("news", newsService.list(" FROM News order by id DESC"));
act.put("hs", houseService.list(" FROM House order by id DESC"));
act.put("hs", houseService.transformList("select c.address as address,h.state as state,h.id as id,c.name as communityName,h.created as created,h.price as price,h.thunb " +
"as thunb FROM House h,Community c where h.communityId=c.id order by h.id DESC"));
return "success";
}
@ -73,10 +89,13 @@ public class AppAction {
act.put("cates", getCate());
//根据条件模糊查询
if (queryString==null||"".equals(queryString.trim())) {
act.put("hs", houseService.list(" FROM House order by id DESC"));
act.put("hs", houseService.transformList("select c.address as address,h.state as state,h.id as id,c.name as communityName,h.created as created,h.price as price,h.thunb " +
"as thunb FROM House h,Community c where h.communityId=c.id order by h.id DESC"));
}else {
queryString="%"+queryString+"%";
act.put("hs", houseService.list(" FROM House where rooname like '"+queryString+"' or address like '"+queryString+"' order by id DESC"));
act.put("hs", houseService.transformList("select c.address as address,h.state as state,h.id as id,c.name as communityName,h.created as created,h.price " +
"as price,h.thunb as thunb FROM House h,Community c where h.communityId=c.id and h.rooname like '"+queryString+"' " +
"or h.address like '"+queryString+"' order by h.id DESC"));
}
//根据地区查询
@ -105,22 +124,25 @@ public class AppAction {
public String detail() {
ActionContext act = ActionContext.getContext();
act.put("cates", getCate());
act.put("model", houseService.findById(id));
act.put("model", houseService.findByIdWithCommunity(id));
act.put("cates1", catesService.list());
act.put("hs", houseService.list(" FROM House ORDER BY NEWID() "));
return "success";
}
@Resource
ApplyService applyService;
@Resource
UsersService usersService;
public String apply() {
ActionContext act = ActionContext.getContext();
Users u = (Users) act.getSession().get("users");
House model = houseService.findById(id);
Community community= communityService.findById(model.getCommunityId());
act.put("cates", getCate());
act.put("model", model);
act.put("communityType",community.getType());
act.put("address",community.getAddress());
act.put("materialMap",ConstantsService.materialMap);
if (applyService.list(" FROM Apply where userid=" + u.getId()).size() > 0) {
act.put("message", "出错:您已经申请过");
act.put("state", "error");
@ -139,9 +161,19 @@ public class AppAction {
public String pub() {
ActionContext act = ActionContext.getContext();
List<Apply> list = applyService.list();
String whereType;
if(type!=null){
whereType=" and c.type="+type.getType();
}else{
whereType="";
}
List<Apply> list = applyService.transformList("select c.houseType as houseType,a.pid as pid,a.cid as cid,a.aid as aid,a.id as id,c.name as name" +
",a.userid as userid from Apply a,House h,Community c where a.hid=h.id and h.communityId=c.id and a.state=5"+whereType);
act.put("cates", getCate());
act.put("list", list);
act.put(Constants.USERS_MAP,ConstantsService.usersMap);
act.put(Constants.REGION_MAP,ConstantsService.regionMap);
return "success";
}
public String jb() {
@ -167,10 +199,25 @@ public class AppAction {
model.setState("1");
model.setType("1");
model.setCreated(MainUtils.getTime());
model.setAttachfile(attachfile);
model.setHid(id);
model.setMessage(messagex);
model.setMessage(messagex);
applyService.save(model);
HttpServletRequest request=ServletActionContext.getRequest();
Map<String,ApplicationMaterial> map=ConstantsService.materialMap;
Enumeration<String> enumeration= request.getParameterNames();
while (enumeration.hasMoreElements()){
String key=enumeration.nextElement();
if(map.containsKey(key)){
String value=request.getParameter(key);
UserMaterial userMaterial=new UserMaterial();
userMaterial.setUserId(u.getId());
userMaterial.setFormValue(value);
userMaterial.setFormId(map.get(key).getId());
userMaterial.setApplyId(model.getId());
materialService.submitMaterial(userMaterial);
}
}
model1.setState(2);
houseService.update(model1);
@ -188,7 +235,7 @@ public class AppAction {
act.put("model", model1);
Report model = new Report();
model.setUserid(u.getId()+"");
model.setUserid(u.getId());
model.setState("1");
model.setCreated(MainUtils.getTime());
model.setMid(id+"");
@ -199,16 +246,7 @@ public class AppAction {
return "success";
}
public String attachfile;
public String messagex;
public String getAttachfile() {
return attachfile;
}
public void setAttachfile(String attachfile) {
this.attachfile = attachfile;
}
public String getMessagex() {
@ -229,4 +267,11 @@ public class AppAction {
this.id = id;
}
public CommunityType getType() {
return type;
}
public void setType(CommunityType type) {
this.type = type;
}
}

@ -16,14 +16,14 @@ import java.util.List;
@Controller
@Scope("prototype")
public class ApplyAction {
@Resource
ApplyService applyService;
@Resource
UsersService usersService;
@Resource
HouseService houseService;
@Autowired
private ApplyService applyService;
@Autowired
private UsersService usersService;
@Autowired
private HouseService houseService;
@Autowired
private MaterialService materialService;
@Autowired
private RefuseApplyService refuseApplyService;
@ -175,15 +175,10 @@ public class ApplyAction {
public String jblist() {
ActionContext act = ActionContext.getContext();
List<Report> list = reportService.list();
for (Report report : list) {
Apply apply = applyService.findById(Integer.parseInt(report.getMid()));
report.setUser(usersService.findById(Integer.parseInt(report.getUserid())).getUsername());
Users u = usersService.findById(apply.getUserid());
House h = houseService.findById(apply.getHid());
report.setTitle(u.getUsername()+"ÉêÇë×âÁÞ"+h.getRooname());
}
List<Report> list = reportService.list("select a.userid as applyUserId,r.userid as userId,r.content as content " +
"from Report r,Apply a where r.mid=a.id");
act.put("list", list);
act.put(Constants.USERS_MAP,ConstantsService.usersMap);
return "success";
}
@Resource
@ -237,13 +232,15 @@ public class ApplyAction {
this.ret = ret;
}
public String applyList() {
ActionContext act = ActionContext.getContext();
Users u = (Users) act.getSession().get("users");
List<Apply> list = applyService.list("select a.id as id,a.userid as userid,h.cate as cate,c.name as name,a.state as state " +
List<Apply> list = applyService.transformList("select a.id as id,a.userid as userid,h.cate " +
"as cate,c.name as name,a.state as state,a.message as message " +
"FROM Apply a,House h,Community c,Users u where a.userid="+ u.getId()+"and a.hid=h.id and h.communityId=c.id and a.userid=u.id ");
act.put("list", list);
act.put(Constants.USERS_MAP,ConstantsService.getUsersMap());
act.put(Constants.USERS_MAP,ConstantsService.usersMap);
return "success";
}
@ -252,11 +249,11 @@ public class ApplyAction {
Users u = (Users) act.getSession().get("users");
String wh = " a.pid=" + u.getPid() + " AND a.cid=" + u.getCid()
+ " AND a.aid=" + u.getAid();
List<Apply> list = applyService.list("select a.id as id,a.userid as userid,h.cate as cate,c.name as name,a.state as state FROM " +
List<Apply> list = applyService.transformList("select a.id as id,a.userid as userid,h.cate as cate,c.name as name,a.state as state FROM " +
"Apply a,House h,Community c,Users u where " + wh+" and a.hid=h.id and h.communityId=c.id and a.userid=u.id ");
act.put("list", list);
act.put(Constants.USERS_MAP,ConstantsService.getUsersMap());
act.put(Constants.USERS_MAP,ConstantsService.usersMap);
return "success";
}
@ -272,17 +269,18 @@ public class ApplyAction {
}
List<Apply> list = applyService.list("select a.id as id,a.userid as userid,h.cate as cate,c.name as name," +
List<Apply> list = applyService.transformList("select a.id as id,a.userid as userid,h.cate as cate,c.name as name," +
"a.state as state FROM Apply a,House h,Community c,Users u where a.hid=h.id and h.communityId=c.id and a.userid=u.id "+whereSql);
act.put("list", list);
act.put(Constants.USERS_MAP,ConstantsService.getUsersMap());
act.put(Constants.USERS_MAP,ConstantsService.usersMap);
return "success";
}
public String delete() {
Integer id = this.id;
applyService.delete(id);
ActionContext act = ActionContext.getContext();
Users u = (Users) act.getSession().get("users");
applyService.delete(this.id);
materialService.deleteUserMaterial(u.getId());
act.put("message", "ɾ³ý³É¹¦!");
act.put("state", "success");
act.put("url", "admin/apply/"+ret+".do");

@ -95,8 +95,8 @@ public class CommunityAction {
}
act.put(Constants.LIST, communityService.list(community, type.getType()));
act.put(Constants.REGION_MAP, ConstantsService.getRegionMap());
act.put(Constants.USERS_MAP, ConstantsService.getUsersMap());
act.put(Constants.REGION_MAP, ConstantsService.regionMap);
act.put(Constants.USERS_MAP, ConstantsService.usersMap);
this.setState(request.getParameter(Constants.STATE) == null ? null : StateType.valueOf(request.getParameter(Constants.STATE)));
this.setMessage(request.getParameter(Constants.MESSAGE));

@ -0,0 +1,190 @@
package com.app.action;
import com.app.bean.ApplicationMaterial;
import com.app.bean.UserMaterial;
import com.app.service.ConstantsService;
import com.app.service.MaterialService;
import com.app.utils.Constants;
import com.app.utils.StateType;
import com.opensymphony.xwork2.ActionContext;
import org.apache.log4j.Logger;
import org.apache.struts2.ServletActionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import javax.servlet.http.HttpServletRequest;
@Controller
public class MaterialAction {
@Autowired
private MaterialService materialService;
private static final Logger logger= Logger.getLogger(MaterialAction.class);
private StateType state;
private String message;
private UserMaterial userMaterial;
private ApplicationMaterial applicationMaterial;
private Integer applyId;
@Autowired
private ConstantsService constantsService;
/**
* 申请资料定义列表
* @return 资料
*/
public String materialList(){
ActionContext actionContext=ActionContext.getContext();
HttpServletRequest request= ServletActionContext.getRequest();
String result;
try {
actionContext.put(Constants.LIST,materialService.materialList());
result= Constants.SUCCESS;
} catch (Exception e) {
e.printStackTrace();
logger.error(e);
result=Constants.ERROR;
}
this.setState(request.getParameter(Constants.STATE) == null ? null : StateType.valueOf(request.getParameter(Constants.STATE)));
this.setMessage(request.getParameter(Constants.MESSAGE));
constantsService.initMaterial();
return result;
}
/**
* 添加申请资料定义
* @return 返回添加结果
*/
public String addMaterial(){
if(applicationMaterial==null||applicationMaterial.getFormName()==null||applicationMaterial.getFormName().isEmpty()
||applicationMaterial.getFormType()==null||applicationMaterial.getFormType().isEmpty()||!materialService.addMaterial(applicationMaterial)){
this.setState(StateType.error);
this.setMessage("添加申请资料失败");
return Constants.ERROR;
}else{
this.setState(StateType.success);
this.setMessage("添加申请资料成功");
return Constants.SUCCESS;
}
}
/**
* 更新申请资料定义
* @return 返回更新结果
*/
public String toUpdate(){
ActionContext act=ActionContext.getContext();
ApplicationMaterial material;
if(applicationMaterial==null||applicationMaterial.getId()==null||(material=materialService.find(applicationMaterial.getId()))==null){
this.setState(StateType.error);
this.setMessage("进入编辑申请资料失败");
return Constants.ERROR;
}else {
act.put(Constants.MODEL,material);
return Constants.SUCCESS;
}
}
/**
* 删除申请资料定义
* @return 返回删除结果
*/
public String deleteMaterial(){
if(applicationMaterial==null||applicationMaterial.getId()==null||!materialService.deleteMaterial(applicationMaterial.getId())){
this.setState(StateType.error);
this.setMessage("删除申请资料失败");
return Constants.ERROR;
}else{
this.setState(StateType.success);
this.setMessage("删除申请资料成功");
return Constants.SUCCESS;
}
}
/**
* 更新申请资料定义
* @return 返回更新结果
*/
public String updateMaterial(){
if(applicationMaterial==null||applicationMaterial.getId()==null||applicationMaterial.getFormOrder()==null
||applicationMaterial.getMaterialName()==null||!materialService.updateMaterial(applicationMaterial)){
this.setState(StateType.error);
this.setMessage("更新申请资料失败");
return Constants.ERROR;
}else{
this.setState(StateType.success);
this.setMessage("更新申请资料成功");
return Constants.SUCCESS;
}
}
/**
* 查看用户申请资料
* @return 返回列表
*/
public String findMaterial(){
ActionContext act=ActionContext.getContext();
if(applyId==null){
this.setState(StateType.error);
this.setMessage("查看失败");
return Constants.ERROR;
}else{
act.put("materialList",materialService.export(applyId));
return Constants.SUCCESS;
}
}
public Integer getApplyId() {
return applyId;
}
public void setApplyId(Integer applyId) {
this.applyId = applyId;
}
public MaterialService getMaterialService() {
return materialService;
}
public void setMaterialService(MaterialService materialService) {
this.materialService = materialService;
}
public StateType getState() {
return state;
}
public void setState(StateType state) {
this.state = state;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public UserMaterial getUserMaterial() {
return userMaterial;
}
public void setUserMaterial(UserMaterial userMaterial) {
this.userMaterial = userMaterial;
}
public ApplicationMaterial getApplicationMaterial() {
return applicationMaterial;
}
public void setApplicationMaterial(ApplicationMaterial applicationMaterial) {
this.applicationMaterial = applicationMaterial;
}
}

@ -36,13 +36,13 @@ public class ReportAction {
return content;
}
public String userid;
public Integer userid;
public void setUserid(String userid) {
public void setUserid(Integer userid) {
this.userid = userid;
}
public String getUserid() {
public Integer getUserid() {
return userid;
}

@ -0,0 +1,65 @@
package com.app.bean;
import javax.persistence.*;
@Entity
@Table(name = "application_material")
public class ApplicationMaterial {
private Integer id;
private String formName;
private String formType;
private Integer formOrder;
private String materialName;
@Id
@Column(name = "id")
@SequenceGenerator(name="increment")
@GeneratedValue(strategy=GenerationType.IDENTITY)
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@Basic
@Column(name = "form_name")
public String getFormName() {
return formName;
}
public void setFormName(String formName) {
this.formName = formName;
}
@Basic
@Column(name = "form_type")
public String getFormType() {
return formType;
}
public void setFormType(String formType) {
this.formType = formType;
}
@Basic
@Column(name = "form_order")
public Integer getFormOrder() {
return formOrder;
}
public void setFormOrder(Integer formOrder) {
this.formOrder = formOrder;
}
@Basic
@Column(name = "material_name")
public String getMaterialName() {
return materialName;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
}

@ -10,6 +10,15 @@ public class Apply {
private String cate;
private String name;
private String houseType;
public String getHouseType() {
return houseType;
}
public void setHouseType(String houseType) {
this.houseType = houseType;
}
public String getCate() {
return cate;

@ -1,7 +1,6 @@
package com.app.bean;
import javax.persistence.*;
import java.util.Objects;
@Entity
public class House {
@ -24,6 +23,7 @@ public class House {
private String address;
private String cate;
private Integer communityId;
private String communityName;
private Integer total;
private Integer remain;
@ -239,36 +239,12 @@ public class House {
this.remain = remain;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
House house = (House) o;
return Objects.equals(id, house.id) &&
Objects.equals(rooname, house.rooname) &&
Objects.equals(size, house.size) &&
Objects.equals(thunb, house.thunb) &&
Objects.equals(price, house.price) &&
Objects.equals(description, house.description) &&
Objects.equals(created, house.created) &&
Objects.equals(content, house.content) &&
Objects.equals(lat, house.lat) &&
Objects.equals(lng, house.lng) &&
Objects.equals(userid, house.userid) &&
Objects.equals(username, house.username) &&
Objects.equals(pid, house.pid) &&
Objects.equals(cid, house.cid) &&
Objects.equals(aid, house.aid) &&
Objects.equals(state, house.state) &&
Objects.equals(address, house.address) &&
Objects.equals(cate, house.cate) &&
Objects.equals(communityId, house.communityId) &&
Objects.equals(total, house.total) &&
Objects.equals(remain, house.remain);
}
@Override
public int hashCode() {
return Objects.hash(id, rooname, size, thunb, price, description, created, content, lat, lng, userid, username, pid, cid, aid, state, address, cate, communityId, total, remain);
@Transient
public String getCommunityName() {
return communityName;
}
public void setCommunityName(String communityName) {
this.communityName = communityName;
}
}

@ -4,7 +4,6 @@ import javax.persistence.*;
import java.util.Objects;
@Entity
@Table(name = "refuse_apply", schema = "dbo", catalog = "gzf")
public class RefuseApply {
private Integer id;
private Integer applyId;

@ -7,7 +7,7 @@
<id name="id" column="ID" type="int">
<generator class="identity" />
</id><property name="content" not-null="false" type="java.lang.String" />
<property name="userid" not-null="false" type="java.lang.String" />
<property name="userid" not-null="false" type="java.lang.Integer" />
<property name="mid" not-null="false" type="java.lang.String" />
<property name="created" not-null="false" type="java.lang.String" />
<property name="state" not-null="false" type="java.lang.String" />

@ -4,14 +4,24 @@ public class Report {
public int id;
public String content;
public String title;
public String user;
public String getUser() {
return user;
public Integer userId;
public Integer applyUserId;
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Integer getApplyUserId() {
return applyUserId;
}
public void setUser(String user) {
this.user = user;
public void setApplyUserId(Integer applyUserId) {
this.applyUserId = applyUserId;
}
public String getTitle() {
@ -30,13 +40,13 @@ public class Report {
return content;
}
public String userid;
public Integer userid;
public void setUserid(String userid) {
public void setUserid(Integer userid) {
this.userid = userid;
}
public String getUserid() {
public Integer getUserid() {
return userid;
}

@ -0,0 +1,86 @@
package com.app.bean;
import javax.persistence.*;
@Entity
@Table(name = "user_material")
public class UserMaterial {
private Integer id;
private Integer userId;
private Integer formId;
private String formValue;
private Integer applyId;
private String formType;
private String materialName;
@Id
@Column(name = "id")
@SequenceGenerator(name="increment")
@GeneratedValue(strategy=GenerationType.IDENTITY)
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@Basic
@Column(name = "user_id")
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
@Basic
@Column(name = "form_id")
public Integer getFormId() {
return formId;
}
public void setFormId(Integer formId) {
this.formId = formId;
}
@Basic
@Column(name = "form_value")
public String getFormValue() {
return formValue;
}
public void setFormValue(String formValue) {
this.formValue = formValue;
}
@Basic
@Column(name="apply_id")
public Integer getApplyId() {
return applyId;
}
public void setApplyId(Integer applyId) {
this.applyId = applyId;
}
@Transient
public String getFormType() {
return formType;
}
public void setFormType(String formType) {
this.formType = formType;
}
@Transient
public String getMaterialName() {
return materialName;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
}

@ -5,17 +5,19 @@ import com.app.bean.Apply;
import java.util.List;
public interface ApplyService {
public void save(Apply model);
void save(Apply model);
public void update(Apply model);
void update(Apply model);
public Apply findById(int id);
Apply findById(int id);
public void delete(int id);
void delete(int id);
public List<Apply> list();
List<Apply> list();
public List<Apply> list(String where);
List<Apply> list(String where);
public List<Apply> list(String where, String[] param);
List<Apply> transformList(String where);
List<Apply> list(String where, String[] param);
}

@ -38,6 +38,10 @@ public class ApplyServiceImpl implements ApplyService {
}
public List<Apply> list(String where) {
return factory.getCurrentSession().createQuery(where).list();
}
public List<Apply> transformList(String where) {
return factory.getCurrentSession().createQuery(where).setResultTransformer(Transformers.aliasToBean(Apply.class)).list();
}

@ -1,5 +1,6 @@
package com.app.service;
import com.app.bean.ApplicationMaterial;
import com.app.bean.Region;
import com.app.bean.Users;
import org.springframework.beans.factory.annotation.Autowired;
@ -17,17 +18,24 @@ public class ConstantsService {
public static final Map<Integer, Users> usersMap=new HashMap<>();
public static final Map<String, ApplicationMaterial> materialMap=new HashMap<>();
@Autowired
private RegionService regionService;
@Autowired
private UsersService usersService;
@Autowired
private MaterialService materialService;
@PostConstruct
public void init(){
initRegion();
initUsers();
initMaterial();
}
public void initRegion(){
@ -46,11 +54,11 @@ public class ConstantsService {
}
}
public static Map<Integer, Region> getRegionMap() {
return regionMap;
}
public static Map<Integer, Users> getUsersMap() {
return usersMap;
public void initMaterial(){
materialMap.clear();
List<ApplicationMaterial> applicationMaterials=materialService.materialList();
for(ApplicationMaterial material:applicationMaterials){
materialMap.put(material.getFormName(),material);
}
}
}

@ -5,17 +5,21 @@ import com.app.bean.House;
import java.util.List;
public interface HouseService {
public void save(House model);
void save(House model);
public void update(House model);
void update(House model);
public House findById(int id);
House findById(int id);
public void delete(int id);
House findByIdWithCommunity(int id);
public List<House> list();
void delete(int id);
public List<House> list(String where);
List<House> list();
public List<House> list(String where, String[] param);
List<House> list(String where);
List<House> transformList(String where);
List<House> list(String where, String[] param);
}

@ -3,6 +3,7 @@ package com.app.service;
import com.app.bean.House;
import org.hibernate.Query;
import org.hibernate.SessionFactory;
import org.hibernate.transform.Transformers;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -27,6 +28,16 @@ public class HouseServiceImpl implements HouseService {
return (House) factory.getCurrentSession().get(House.class, id);
}
@Override
public House findByIdWithCommunity(int id) {
return (House) factory.getCurrentSession().createQuery(
"select h.id as id,c.name as rooname,c.address as address,h.size as size," +
"c.houseType as cate,h.price as price,c.description as description ,h.state as state " +
"from House h,Community c where h.id=? and h.communityId=c.id")
.setInteger(0,id)
.setResultTransformer(Transformers.aliasToBean(House.class)).uniqueResult();
}
public void delete(int id) {
factory.getCurrentSession().delete(
factory.getCurrentSession().load(House.class, id));
@ -36,10 +47,16 @@ public class HouseServiceImpl implements HouseService {
return factory.getCurrentSession().createQuery("from House").list();
}
public List<House> transformList(String where){
return factory.getCurrentSession().createQuery(where).setResultTransformer(Transformers.aliasToBean(House.class)).list();
}
public List<House> list(String where) {
return factory.getCurrentSession().createQuery(where).list();
}
public List<House> list(String where, String[] param) {
Query q = factory.getCurrentSession().createQuery(where);
int i = 0;

@ -0,0 +1,36 @@
package com.app.service;
import com.app.bean.ApplicationMaterial;
import com.app.bean.UserMaterial;
import java.util.List;
public interface MaterialService {
//获取申请资料定义列表
List<ApplicationMaterial> materialList();
//增加申请资料定义
boolean addMaterial(ApplicationMaterial applicationMaterial);
//查找申请资料
ApplicationMaterial find(Integer id);
//更新申请资料定义顺序
boolean updateMaterial(ApplicationMaterial applicationMaterial);
//删除申请资料定义
boolean deleteMaterial(Integer id);
//用户提交申请资料
boolean submitMaterial(UserMaterial userMaterial);
//用户编辑申请资料
boolean updateMaterial(UserMaterial userMaterial);
//删除用户申请资料
boolean deleteUserMaterial(Integer userId);
//查找用户申请资料
List<UserMaterial> export(Integer applyId);
}

@ -0,0 +1,135 @@
package com.app.service;
import com.app.bean.ApplicationMaterial;
import com.app.bean.UserMaterial;
import org.apache.log4j.Logger;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;
import org.hibernate.transform.Transformers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
@Service
@Transactional
public class MaterialServiceImpl implements MaterialService{
private static final Logger logger= Logger.getLogger(MaterialServiceImpl.class);
@Autowired
private HibernateTemplate hibernateTemplate;
@Override
public List<ApplicationMaterial> materialList() {
try {
return (List<ApplicationMaterial>) hibernateTemplate.findByCriteria(DetachedCriteria.forClass(ApplicationMaterial.class).addOrder(Order.asc("formOrder")));
} catch (DataAccessException e) {
e.printStackTrace();
logger.error(e);
}
return new ArrayList<>();
}
@Override
public boolean addMaterial(ApplicationMaterial applicationMaterial) {
try {
ApplicationMaterial c=new ApplicationMaterial();
c.setFormName(applicationMaterial.getFormName());
c.setFormOrder(applicationMaterial.getFormOrder());
c.setMaterialName(applicationMaterial.getMaterialName());
c.setFormType(applicationMaterial.getFormType());
return hibernateTemplate.save(c)!=null;
} catch (DataAccessException e) {
e.printStackTrace();
logger.error(e);
}
return false;
}
@Override
public boolean deleteMaterial(final Integer id) {
return (boolean) hibernateTemplate.execute(new HibernateCallback() {
public Object doInHibernate(Session session) throws HibernateException {
Query query = session.createQuery("delete from ApplicationMaterial where id=?");
query.setInteger(0,id);
return query.executeUpdate()>0;
}
});
}
@Override
public boolean updateMaterial(final ApplicationMaterial applicationMaterial) {
return (boolean) hibernateTemplate.execute(new HibernateCallback() {
public Object doInHibernate(Session session) throws HibernateException {
Query query = session.createQuery("update ApplicationMaterial set formOrder=?,materialName=? where id=?");
query.setInteger(0,applicationMaterial.getFormOrder());
query.setString(1,applicationMaterial.getMaterialName());
query.setInteger(2,applicationMaterial.getId());
return query.executeUpdate()>0;
}
});
}
@Override
public ApplicationMaterial find(Integer id) {
return (ApplicationMaterial) hibernateTemplate.get(ApplicationMaterial.class,id);
}
@Override
public boolean submitMaterial(UserMaterial userMaterial) {
try {
return hibernateTemplate.save(userMaterial)!=null;
} catch (DataAccessException e) {
e.printStackTrace();
logger.error(e);
}
return false;
}
@Override
public boolean updateMaterial(UserMaterial userMaterial) {
try {
hibernateTemplate.update(userMaterial);
return true;
} catch (DataAccessException e) {
e.printStackTrace();
logger.error(e);
}
return false;
}
@Override
public boolean deleteUserMaterial(final Integer userId) {
return (boolean) hibernateTemplate.execute(new HibernateCallback() {
public Object doInHibernate(Session session) throws HibernateException {
Query query = session.createQuery("delete from UserMaterial where userId=?");
query.setInteger(0,userId);
return query.executeUpdate()>0;
}
});
}
@SuppressWarnings("unchecked")
@Override
public List<UserMaterial> export(final Integer applyId) {
return (List<UserMaterial>) hibernateTemplate.execute(new HibernateCallback() {
@Override
public Object doInHibernate(Session session) throws HibernateException, SQLException {
Query query = session.createQuery("select u.formValue as formValue,a.materialName as materialName,a.formType as formType from UserMaterial u,ApplicationMaterial a " +
"where u.formId=a.id and u.applyId=? order by a.formOrder").setResultTransformer(Transformers.aliasToBean(UserMaterial.class));
query.setInteger(0,applyId);
return query.list();
}
});
}
}

@ -3,6 +3,7 @@ package com.app.service;
import com.app.bean.Report;
import org.hibernate.Query;
import org.hibernate.SessionFactory;
import org.hibernate.transform.Transformers;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -37,7 +38,7 @@ public class ReportServiceImpl implements ReportService {
}
public List<Report> list(String where) {
return factory.getCurrentSession().createQuery(where).list();
return factory.getCurrentSession().createQuery(where).setResultTransformer(Transformers.aliasToBean(Report.class)).list();
}
public List<Report> list(String where, String[] param) {

@ -89,7 +89,7 @@ public class FileUploadServlet extends HttpServlet {
request.setAttribute("Saved", savePath);
request.setAttribute("message", "Upload OK!~");
request.getRequestDispatcher("upload.jsp").forward(request, response);
request.getRequestDispatcher("upload.jsp?name="+request.getParameter("name")).forward(request, response);
}
/**

@ -351,5 +351,49 @@
</action>
</package>
<!-- 申请资料定义接口-->
<package name="material" namespace="/admin/material" extends="struts-default">
<action name="add" method="addMaterial" class="materialAction">
<result type="redirect">
<param name="location">list.do?state=${state}&amp;message=${message}</param>
<param name="encode">true</param>
</result>
</action>
<action name="toAdd">
<result>/admin/materialAdd.jsp</result>
</action>
<action name="toUpdate" method="toUpdate" class="materialAction">
<result name="success">/admin/materialUpdate.jsp</result>
<result name="error" type="redirect">
<param name="location">list.do?state=${state}&amp;message=${message}</param>
<param name="encode">true</param>
</result>
</action>
<action name="update" method="updateMaterial" class="materialAction">
<result type="redirect">
<param name="location">list.do?state=${state}&amp;message=${message}</param>
<param name="encode">true</param>
</result>
</action>
<action name="list" method="materialList" class="materialAction">
<result>/admin/material.jsp</result>
</action>
<action name="delete" method="deleteMaterial" class="materialAction">
<result type="redirect">
<param name="location">list.do?state=${state}&amp;message=${message}</param>
<param name="encode">true</param>
</result>
</action>
<action name="findMaterial" method="findMaterial" class="materialAction">
<result>/admin/userMaterial.jsp</result>
</action>
</package>
</struts>

Loading…
Cancel
Save