1.举报管理功能修改

2.增加申请资料模块
3.主页-房源模块修改
4.主页-公示模块修改
master
pan 5 years ago
parent c6f2bfa06f
commit 49720af638
  1. 7
      WebRoot/admin/applylist.jsp
  2. 14
      WebRoot/admin/applylist1.jsp
  3. 52
      WebRoot/admin/applylist2.jsp
  4. 48
      WebRoot/admin/refuse.jsp
  5. 12
      WebRoot/ui/apply.jsp
  6. 2
      src/com/app/action/AppAction.java
  7. 93
      src/com/app/action/ApplyAction.java
  8. 4
      src/com/app/service/CommunityServiceImpl.java
  9. 8
      src/com/app/service/ConstantsService.java
  10. 2
      src/com/app/service/HouseService.java
  11. 7
      src/com/app/service/HouseServiceImpl.java
  12. 15
      src/struts.xml

@ -31,7 +31,7 @@ String usertype = session.getAttribute("userType")+"";
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')
$("#editDialog form").removeAttr("style").attr("action",'<%=basePath%>admin/apply/updateapply.do')
}
</script>
</head>
@ -110,7 +110,7 @@ String usertype = session.getAttribute("userType")+"";
<i class="icon-pencil"></i>
修改
</a>
<a style="margin-left: 10px" class="" href="<%=basePath%>admin/apply/delete.do?ret=list&id=${item.id}">
<a style="margin-left: 10px" class="" href="<%=basePath%>admin/apply/delete.do?action=list&id=${item.id}">
<i class="icon-pencil"></i>
删除
</a>
@ -155,9 +155,6 @@ String usertype = session.getAttribute("userType")+"";
<script>
<c:if test="${!empty state }">
toastr.${state}('${message}', '提示');
setTimeout(function(){
window.location.href = "<%=basePath%>${url}";
},1500)
</c:if>
</script>
<script>

@ -102,31 +102,31 @@ String usertype = session.getAttribute("userType")+"";
<c:if test="${item.state eq '1' }">
<a class="" href="<%=basePath%>admin/apply/pass.do?ret=list1&statex=2&id=${item.id}">
<a class="" href="<%=basePath%>admin/apply/pass.do?action=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}">
<a data-toggle="modal" data-target="#refuseDialog" style="cursor:pointer" onclick="refuse(${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}">
<a data-toggle="modal" data-target="#refuseDialog" style="cursor:pointer" onclick="refuse(${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}">
<a class="" href="<%=basePath%>admin/apply/pass.do?action=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}">
<a style="margin-left: 10px" class="" href="<%=basePath%>admin/apply/delete.do?action=list1&id=${item.id}">
<i class="icon-pencil"></i>
删除
</a>
@ -145,6 +145,7 @@ String usertype = session.getAttribute("userType")+"";
</div>
<c:import url="refuse.jsp?action=list1&statex=3"/>
<!-- Vendor js -->
<script src="<%=basePath %>static/assets/js/vendor.min.js"></script>
@ -169,9 +170,6 @@ String usertype = session.getAttribute("userType")+"";
<script>
<c:if test="${!empty state }">
toastr.${state}('${message}', '提示');
setTimeout(function(){
window.location.href = "<%=basePath%>${url}";
},1500)
</c:if>
</script>
<script>

@ -28,12 +28,7 @@ String usertype = session.getAttribute("userType")+"";
<link href="<%=basePath %>static/assets/css/app.min.css" rel="stylesheet" type="text/css" />
<script src="<%=basePath %>static/bootstrap-4.4.1/js/bootstrap.min.js"></script>
<script>
function refuse(id) {
$('#refuseDialog input[name=id]').val(id)
$('#refuseDialog form').removeAttr("style").attr('action','<%=basePath%>admin/apply/pass.do')
}
</script>
</head>
@ -109,7 +104,7 @@ String usertype = session.getAttribute("userType")+"";
<td>
<c:if test="${item.state eq 2 }">
<a class="" href="<%=basePath%>admin/apply/pass.do?ret=list2&statex=5&id=${item.id}">
<a class="" href="<%=basePath%>admin/apply/pass.do?action=list2&statex=5&id=${item.id}">
<i class="icon-pencil"></i>
通过
</a>
@ -120,20 +115,20 @@ 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 data-toggle="modal" data-target="#refuseDialog" style="cursor:pointer" onclick="refuse(${item.id})">
<i class="icon-pencil"></i>
不通过
</a>
</c:if>
<c:if test="${item.state eq 6 }">
<a class="" href="<%=basePath%>admin/apply/pass.do?ret=list2&statex=5&id=${item.id}">
<a class="" href="<%=basePath%>admin/apply/pass.do?action=list2&statex=5&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}">
<a style="margin-left: 10px" class="" href="<%=basePath%>admin/apply/delete.do?action=list2&id=${item.id}">
<i class="icon-pencil"></i>
删除
</a>
@ -176,9 +171,6 @@ String usertype = session.getAttribute("userType")+"";
<script>
<c:if test="${!empty state }">
toastr.${state}('${message}', '提示');
setTimeout(function(){
window.location.href = "<%=basePath%>${url}";
},1500)
</c:if>
</script>
<script>
@ -193,39 +185,7 @@ $(document).ready(function(){
</script>
<div class="modal fade" id="refuseDialog" tabindex="-1" role="dialog" aria-labelledby="refuseDialogTitle" aria-hidden="true">
<div class="modal-dialog " role="document">
<div class="modal-content">
<form method="post">
<input type="hidden" name="id"/>
<input type="hidden" name="ret" value="list2"/>
<input type="hidden" name="statex" value="6"/>
<div class="modal-header">
<h5 class="modal-title" id="refuseDialogTitle">不通过</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>
<c:import url="refuse.jsp?action=list2&statex=6"/>
</body>
</html>

@ -0,0 +1,48 @@
<%--
Created by IntelliJ IDEA.
User: pan
Date: 2020/6/10 0010
Time: 17:12
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<script>
function refuse(id) {
$('#refuseDialog input[name=id]').val(id)
$('#refuseDialog form').removeAttr("style").attr('action','${pageContext.request.contextPath}/admin/apply/pass.do')
}
</script>
<div class="modal fade" id="refuseDialog" tabindex="-1" role="dialog" aria-labelledby="refuseDialogTitle" aria-hidden="true">
<div class="modal-dialog " role="document">
<div class="modal-content">
<form method="post">
<input type="hidden" name="id"/>
<input type="hidden" name="statex" value="${param.statex}"/>
<input type="hidden" name="action" value="${param.action}"/>
<div class="modal-header">
<h5 class="modal-title" id="refuseDialogTitle">不通过</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>

@ -161,19 +161,19 @@
<hr class="detail">
<c:forEach items="${materialMap}" var="item">
<c:forEach items="${materialList}" var="item">
<div class="row mt-3">
<div class="col-3 d-flex align-items-center justify-content-end ">
${item.value.materialName}
${item.materialName}
</div>
<div class="col">
<c:choose>
<c:when test="${item.value.formType eq 'text'}">
<input name="${item.key}" required type="text">
<c:when test="${item.formType eq 'text'}">
<input name="${item.formName}" required type="text">
</c:when>
<c:when test="${item.value.formType eq 'doc'}">
<c:when test="${item.formType eq 'doc'}">
<input type="text" required class="form-control"
name="${item.key}">
name="${item.formName}">
<a style="margin-top:10px" class="btn uploadImg">点击上传</a>
</c:when>
</c:choose>

@ -141,7 +141,7 @@ public class AppAction {
act.put("model", model);
act.put("communityType",community.getType());
act.put("address",community.getAddress());
act.put("materialMap",ConstantsService.materialMap);
act.put("materialList",ConstantsService.materialList);
if (applyService.list(" FROM Apply where userid=" + u.getId()).size() > 0) {
act.put("message", "出错:您已经申请过");

@ -3,6 +3,7 @@ package com.app.action;
import com.app.bean.*;
import com.app.service.*;
import com.app.utils.Constants;
import com.app.utils.StateType;
import com.opensymphony.xwork2.ActionContext;
import org.apache.struts2.ServletActionContext;
import org.springframework.beans.factory.annotation.Autowired;
@ -25,15 +26,48 @@ public class ApplyAction {
@Autowired
private MaterialService materialService;
private String action;
@Autowired
private RefuseApplyService refuseApplyService;
public int id;
public StateType state;
private String message;
private String content;
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public StateType getState() {
return state;
}
public void setState(StateType state) {
this.state = state;
}
public void setId(int id) {
this.id = id;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public int getId() {
return id;
@ -148,25 +182,15 @@ public class ApplyAction {
public String updateApply() {
ActionContext act = ActionContext.getContext();
HttpServletRequest request=ServletActionContext.getRequest();
Apply model = applyService.findById(id);
model.setPid(pid);
model.setUserid(userid);
model.setState(statex);
model.setType(type);
model.setCreated(created);
model.setAttachfile(attachfile);
model.setMessage(content);
model.setStateid(stateid);
applyService.update(model);
act.put("message", "Update Data Success!");
act.put("url", "admin/apply/edit?id=" + id);
act.put("state", "success");
this.setMessage("更新成功");
this.setState(StateType.success);
return "success";
}
@ -235,17 +259,21 @@ public class ApplyAction {
public String applyList() {
ActionContext act = ActionContext.getContext();
HttpServletRequest request=ServletActionContext.getRequest();
Users u = (Users) act.getSession().get("users");
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.usersMap);
this.setState(request.getParameter(Constants.STATE) == null ? null : StateType.valueOf(request.getParameter(Constants.STATE)));
this.setMessage(request.getParameter(Constants.MESSAGE));
return "success";
}
public String applyList1() {
ActionContext act = ActionContext.getContext();
HttpServletRequest request=ServletActionContext.getRequest();
Users u = (Users) act.getSession().get("users");
String wh = " a.pid=" + u.getPid() + " AND a.cid=" + u.getCid()
+ " AND a.aid=" + u.getAid();
@ -254,6 +282,8 @@ public class ApplyAction {
act.put("list", list);
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));
return "success";
}
@ -273,17 +303,36 @@ public class ApplyAction {
"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.usersMap);
this.setState(request.getParameter(Constants.STATE) == null ? null : StateType.valueOf(request.getParameter(Constants.STATE)));
this.setMessage(request.getParameter(Constants.MESSAGE));
return "success";
}
public String delete() {
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");
return "success";
Apply apply=applyService.findById(this.id);
if(apply!=null) {
applyService.delete(this.id);
materialService.deleteUserMaterial(u.getId());
House house=houseService.findById(apply.getHid());
house.setState(1);
houseService.update(house);
this.setMessage("删除成功!");
this.setState(StateType.success);
return Constants.SUCCESS;
}else{
this.setMessage("删除失败!");
this.setState(StateType.error);
return Constants.ERROR;
}
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}

@ -24,6 +24,9 @@ public class CommunityServiceImpl implements CommunityService{
@Autowired
private HibernateTemplate hibernateTemplate;
@Autowired
private HouseService houseService;
@Override
public boolean add(Community community) {
try {
@ -51,6 +54,7 @@ public class CommunityServiceImpl implements CommunityService{
@Override
public boolean delete(Community community) {
try {
houseService.deleteWithCommunityId(community.getId());
hibernateTemplate.delete(community);
return true;
} catch (DataAccessException e) {

@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -20,6 +21,8 @@ public class ConstantsService {
public static final Map<String, ApplicationMaterial> materialMap=new HashMap<>();
public static final List<ApplicationMaterial> materialList=new ArrayList<>();
@Autowired
private RegionService regionService;
@ -56,8 +59,9 @@ public class ConstantsService {
public void initMaterial(){
materialMap.clear();
List<ApplicationMaterial> applicationMaterials=materialService.materialList();
for(ApplicationMaterial material:applicationMaterials){
materialList.clear();
materialList.addAll(materialService.materialList());
for(ApplicationMaterial material:materialList){
materialMap.put(material.getFormName(),material);
}
}

@ -22,4 +22,6 @@ public interface HouseService {
List<House> transformList(String where);
List<House> list(String where, String[] param);
boolean deleteWithCommunityId(int id);
}

@ -65,4 +65,11 @@ public class HouseServiceImpl implements HouseService {
}
return q.list();
}
@Override
public boolean deleteWithCommunityId(int id) {
Query query=factory.getCurrentSession().createQuery("delete from House where communityId=?");
query.setInteger(0,id);
return query.executeUpdate()>0;
}
}

@ -130,7 +130,10 @@
<result>/admin/applyedit.jsp</result>
</action>
<action name="updateapply" method="updateApply" class="applyAction">
<result>/message.jsp</result>
<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="applyList" class="applyAction">
<result>/admin/applylist.jsp</result>
@ -148,10 +151,16 @@
<result>/admin/report.jsp</result>
</action>
<action name="pass" method="pass" class="applyAction">
<result>/admin/applylist1.jsp</result>
<result type="redirect">
<param name="location">${action}.do?state=${state}&amp;message=${message}</param>
<param name="encode">true</param>
</result>
</action>
<action name="delete" method="delete" class="applyAction">
<result>/admin/applylist1.jsp</result>
<result type="redirect">
<param name="location">${action}.do?state=${state}&amp;message=${message}</param>
<param name="encode">true</param>
</result>
</action>
</package>

Loading…
Cancel
Save