Przeglądaj źródła

为系统管理员加入 小区添加审核功能

wuxw 6 lat temu
rodzic
commit
9b17663118

+ 51 - 0
WebService/src/main/java/com/java110/web/components/community/AuditCommunityManageComponent.java

@@ -0,0 +1,51 @@
+package com.java110.web.components.community;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.common.constant.CommunityStateConstant;
+import com.java110.core.context.IPageData;
+import com.java110.core.context.PageData;
+import com.java110.web.smo.community.IListCommunitysSMO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * 小区审核
+ * <p>
+ * add by wuxw
+ * <p>
+ * 2019-06-29
+ */
+@Component("auditCommunityManage")
+public class AuditCommunityManageComponent {
+
+    @Autowired
+    private IListCommunitysSMO listCommunitysSMOImpl;
+
+    /**
+     * 查询小区列表
+     *
+     * @param pd 页面数据封装
+     * @return 返回 ResponseEntity 对象
+     */
+    public ResponseEntity<String> list(IPageData pd) {
+
+        JSONObject reqParam = JSONObject.parseObject(pd.getReqData());
+        reqParam.put("state", CommunityStateConstant.NO_AUDIT);
+
+        IPageData newPd = PageData.newInstance().builder(pd.getUserId(), pd.getToken(),
+                reqParam.toJSONString(), pd.getComponentCode(), pd.getComponentMethod(), "", pd.getSessionId());
+
+        return listCommunitysSMOImpl.listCommunitys(newPd);
+    }
+
+    public IListCommunitysSMO getListCommunitysSMOImpl() {
+        return listCommunitysSMOImpl;
+    }
+
+    public void setListCommunitysSMOImpl(IListCommunitysSMO listCommunitysSMOImpl) {
+        this.listCommunitysSMOImpl = listCommunitysSMOImpl;
+    }
+}

+ 1 - 1
WebService/src/main/java/com/java110/web/smo/community/impl/ListCommunitysSMOImpl.java

@@ -37,7 +37,7 @@ public class ListCommunitysSMOImpl extends AbstractComponentSMO implements IList
 
         super.validatePageInfo(pd);
 
-        super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_COMMUNITY);
+        super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_COMMUNITY,PrivilegeCodeConstant.ADMIN_HAS_LIST_COMMUNITY);
     }
 
     @Override

+ 62 - 0
WebService/src/main/resources/components/communityPackage/audit-community-manage/auditCommunityManage.html

@@ -0,0 +1,62 @@
+<div id="component">
+    <div class="row">
+        <div class="col-lg-12">
+            <div class="ibox">
+                <div class="ibox-title">
+                    <h5>未审核小区</h5>
+                    <div class="ibox-tools" style="top:10px;">
+
+                    </div>
+                </div>
+                <div class="ibox-content">
+
+                    <table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15">
+                        <thead>
+                        <tr>
+                            <th>小区ID</th>
+                            <th>小区名称</th>
+                            <th>小区地址</th>
+                            <th>附近地标</th>
+                            <th>城市编码</th>
+                            <th>小区维度</th>
+                            <th>小区经度</th>
+                            <th>状态</th>
+                            <th class="text-right">操作</th>
+                        </tr>
+                        </thead>
+                        <tbody>
+                        <tr v-for="community in auditCommunityManageInfo.communitys">
+                            <td>{{community.communityId}}</td>
+                            <td>{{community.name}}</td>
+                            <td>{{community.address}}</td>
+                            <td>{{community.nearbyLandmarks}}</td>
+                            <td>{{community.cityCode}}</td>
+                            <td>{{community.mapX}}</td>
+                            <td>{{community.mapY}}</td>
+                            <td>{{community.stateName}}</td>
+                            <td>
+                                <div class="btn-group">
+                                    <button class="btn-white btn btn-xs"
+                                            v-on:click="_openAuditCommunityModal(community)">审核
+                                    </button>
+                                </div>
+
+
+                        </tr>
+                        </tbody>
+                        <tfoot>
+                        <tr>
+                            <td colspan="7">
+                                <ul class="pagination float-right"></ul>
+                            </td>
+                        </tr>
+                        </tfoot>
+                    </table>
+                    <!-- 分页 -->
+                    <vc:create name="pagination"></vc:create>
+                </div>
+            </div>
+        </div>
+    </div>
+
+</div>

+ 59 - 0
WebService/src/main/resources/components/communityPackage/audit-community-manage/auditCommunityManage.js

@@ -0,0 +1,59 @@
+/**
+    入驻小区
+**/
+(function(vc){
+    var DEFAULT_PAGE = 1;
+    var DEFAULT_ROWS = 10;
+    vc.extends({
+        data:{
+            auditCommunityManageInfo:{
+                communitys:[],
+                total:0,
+                records:1
+            }
+        },
+        _initMethod:function(){
+            vc.component._listCommunitys(DEFAULT_PAGE, DEFAULT_ROWS);
+        },
+        _initEvent:function(){
+            vc.on('communityManage','listCommunity',function(_param){
+                  vc.component._listCommunitys(DEFAULT_PAGE, DEFAULT_ROWS);
+            });
+             vc.on('pagination','page_event',function(_currentPage){
+                vc.component._listCommunitys(_currentPage,DEFAULT_ROWS);
+            });
+        },
+        methods:{
+            _listCommunitys:function(_page, _rows){
+                var param = {
+                    params:{
+                        page:_page,
+                        row:_rows
+                    }
+
+               }
+               //发送get请求
+               vc.http.get('auditCommunityManage',
+                            'list',
+                             param,
+                             function(json,res){
+                                var _auditCommunityManageInfo=JSON.parse(json);
+                                vc.component.auditCommunityManageInfo.total = _auditCommunityManageInfo.total;
+                                vc.component.auditCommunityManageInfo.records = _auditCommunityManageInfo.records;
+                                vc.component.auditCommunityManageInfo.communitys = _auditCommunityManageInfo.communitys;
+                                vc.emit('pagination','init',{
+                                    total:vc.component.auditCommunityManageInfo.records,
+                                    currentPage:_page
+                                });
+                             },function(errInfo,error){
+                                console.log('请求失败处理');
+                             }
+                           );
+            },
+            _openAuditCommunityModal:function(){
+                vc.emit('auditCommunity','openAuditCommunityModal',{});
+            }
+
+        }
+    });
+})(window.vc);

+ 36 - 0
WebService/src/main/resources/views/auditCommunityFlow.html

@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en"
+      xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:th="http://www.thymeleaf.org"
+      xmlns:vc="http://www.thymeleaf.org">
+<head>
+    <meta charset="UTF-8"/>
+    <title>审核小区|java110</title>
+    <vc:create name="commonTop"></vc:create>
+</head>
+<body>
+<vc:create name="bodyTop"></vc:create>
+<div id="wrapper">
+    <vc:create name="menu"></vc:create>
+
+
+    <div id="page-wrapper" class="gray-bg dashbard-1">
+        <div class="row border-bottom">
+            <vc:create name="nav"></vc:create>
+        </div>
+        <div class="wrapper wrapper-content" style="padding-bottom: 0px;">
+            <vc:create name="breadcrumb"></vc:create>
+        </div>
+        <!-- id="component" -->
+        <div class="wrapper wrapper-content animated fadeInRight">
+            <vc:create name="auditCommunityManage"></vc:create>
+        </div>
+
+        <vc:create name="copyright"></vc:create>
+
+    </div>
+</div>
+
+<vc:create name="commonBottom"></vc:create>
+</body>
+</html>

+ 1 - 1
WebService/src/main/resources/views/communityFlow.html

@@ -5,7 +5,7 @@
       xmlns:vc="http://www.thymeleaf.org">
 <head>
     <meta charset="UTF-8"/>
-    <title>添加小区|java110</title>
+    <title>小区信息|java110</title>
     <vc:create name="commonTop"></vc:create>
 </head>
 <body>

+ 27 - 0
java110-common/src/main/java/com/java110/common/constant/CommunityStateConstant.java

@@ -0,0 +1,27 @@
+package com.java110.common.constant;
+
+
+/**
+ * 权限编码常量类
+ */
+public final class CommunityStateConstant {
+
+    private CommunityStateConstant() {
+
+    }
+
+    //未审核
+    public static final String NO_AUDIT = "1000";
+
+
+    //审核同意
+    public static final String AGREE_AUDIT = "1100";
+
+    //审核拒绝
+    public static final String REJECT_AUDIT = "1200";
+
+
+
+
+
+}

+ 1 - 0
java110-common/src/main/java/com/java110/common/constant/PrivilegeCodeConstant.java

@@ -59,6 +59,7 @@ public final class PrivilegeCodeConstant {
 
 
     public static final String AGENT_HAS_LIST_COMMUNITY = "500201906025";
+    public static final String ADMIN_HAS_LIST_COMMUNITY = "502019091797230001";
     public static final String HAS_LIST_NOTICE = "500201904009";
     public static final String AGENT_HAS_LIST_APP = "500201906026";
     public static final String AGENT_HAS_LIST_SERVICE = "500201906027";

+ 6 - 0
java110-db/src/main/resources/mapper/community/CommunityServiceDaoImplMapper.xml

@@ -401,6 +401,9 @@
         <if test="mapX !=null and mapX != ''">
             and t.map_x= #{mapX}
         </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
         <if test="memberId !=null and memberId !=''">
             and cm.community_id = t.community_id
             and cm.member_id = #{memberId}
@@ -449,6 +452,9 @@
         <if test="mapX !=null and mapX != ''">
             and t.map_x= #{mapX}
         </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
         <if test="memberId !=null and memberId !=''">
             and cm.community_id = t.community_id
                 and cm.member_id = #{memberId}