Explorar el Código

优化 商户入驻审核页面

wuxw hace 6 años
padre
commit
0346b73214

+ 64 - 12
Api/src/main/java/com/java110/api/listener/community/ListAuditEnterCommunitysListener.java

@@ -11,6 +11,7 @@ import com.java110.core.smo.store.IStoreInnerServiceSMO;
 import com.java110.dto.CommunityMemberDto;
 import com.java110.dto.CommunityMemberDto;
 import com.java110.dto.store.StoreDto;
 import com.java110.dto.store.StoreDto;
 import com.java110.event.service.api.ServiceDataFlowEvent;
 import com.java110.event.service.api.ServiceDataFlowEvent;
+import com.java110.utils.util.StringUtil;
 import com.java110.vo.api.community.ApiCommunityDataVo;
 import com.java110.vo.api.community.ApiCommunityDataVo;
 import com.java110.vo.api.community.ApiCommunityVo;
 import com.java110.vo.api.community.ApiCommunityVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -67,23 +68,42 @@ public class ListAuditEnterCommunitysListener extends AbstractServiceApiListener
     @Override
     @Override
     protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
     protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
 
 
-        CommunityMemberDto communityMemberDto = BeanConvertUtil.covertBean(reqJson, CommunityMemberDto.class);
+        if (StringUtil.jsonHasKayAndValue(reqJson, "name") || StringUtil.jsonHasKayAndValue(reqJson, "tel")) {
+            getInfoByStore(context,reqJson);
+        }else{
+            getInfoByCommunity(context,reqJson);
+        }
 
 
-        communityMemberDto.setNeedCommunityInfo(true);
-        communityMemberDto.setNoAuditEnterCommunity(true);
+    }
 
 
-        int count = communityInnerServiceSMOImpl.getCommunityMemberCount(communityMemberDto);
+    private void getInfoByStore(DataFlowContext context, JSONObject reqJson) {
+        StoreDto storeDto = new StoreDto();
+        storeDto.setName(reqJson.getString("name"));
+        storeDto.setTel(reqJson.getString("tel"));
+        List<StoreDto> storeDtos = storeInnerServiceSMOImpl.getStores(storeDto);
 
 
         List<ApiCommunityDataVo> communitys = null;
         List<ApiCommunityDataVo> communitys = null;
-
-        if (count > 0) {
-            communitys = BeanConvertUtil.covertBeanList(communityInnerServiceSMOImpl.getCommunityMembers(communityMemberDto), ApiCommunityDataVo.class);
+        int count = 0;
+        if (storeDtos.size() > 0) {
+            CommunityMemberDto communityMemberDto = new CommunityMemberDto();
+            communityMemberDto.setNeedCommunityInfo(true);
+            communityMemberDto.setNoAuditEnterCommunity(true);
+            communityMemberDto.setMemberId(reqJson.getString("memberId"));
+            communityMemberDto.setSubMemberId(storeDtos.get(0).getStoreId());
+
+            count = communityInnerServiceSMOImpl.getCommunityMemberCount(communityMemberDto);
+
+            if (count > 0) {
+                communitys = BeanConvertUtil.covertBeanList(communityInnerServiceSMOImpl.getCommunityMembers(communityMemberDto), ApiCommunityDataVo.class);
+            }else{
+                communitys = new ArrayList<>();
+            }
         } else {
         } else {
             communitys = new ArrayList<>();
             communitys = new ArrayList<>();
         }
         }
 
 
         //刷入 商户信息
         //刷入 商户信息
-        if(communitys.size() > 0){
+        if (communitys.size() > 0) {
             freshCommunityInfo(communitys);
             freshCommunityInfo(communitys);
         }
         }
 
 
@@ -96,20 +116,20 @@ public class ListAuditEnterCommunitysListener extends AbstractServiceApiListener
         ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiCommunityVo), HttpStatus.OK);
         ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiCommunityVo), HttpStatus.OK);
 
 
         context.setResponseEntity(responseEntity);
         context.setResponseEntity(responseEntity);
-
     }
     }
 
 
     /**
     /**
      * 刷新 小区 商户信息
      * 刷新 小区 商户信息
+     *
      * @param communityDataVos
      * @param communityDataVos
      */
      */
-    private void freshCommunityInfo(List<ApiCommunityDataVo> communityDataVos){
-        for(ApiCommunityDataVo apiCommunityDataVo : communityDataVos) {
+    private void freshCommunityInfo(List<ApiCommunityDataVo> communityDataVos) {
+        for (ApiCommunityDataVo apiCommunityDataVo : communityDataVos) {
             StoreDto storeDto = new StoreDto();
             StoreDto storeDto = new StoreDto();
             storeDto.setStoreId(apiCommunityDataVo.getMemberId());
             storeDto.setStoreId(apiCommunityDataVo.getMemberId());
             List<StoreDto> storeDtos = storeInnerServiceSMOImpl.getStores(storeDto);
             List<StoreDto> storeDtos = storeInnerServiceSMOImpl.getStores(storeDto);
 
 
-            if(storeDtos.size() != 1){
+            if (storeDtos.size() != 1) {
                 continue;
                 continue;
             }
             }
             //BeanConvertUtil.covertBean(storeDtos.get(0), apiCommunityDataVo);
             //BeanConvertUtil.covertBean(storeDtos.get(0), apiCommunityDataVo);
@@ -122,6 +142,38 @@ public class ListAuditEnterCommunitysListener extends AbstractServiceApiListener
         }
         }
     }
     }
 
 
+    private void getInfoByCommunity(DataFlowContext context, JSONObject reqJson) {
+        CommunityMemberDto communityMemberDto = BeanConvertUtil.covertBean(reqJson, CommunityMemberDto.class);
+
+        communityMemberDto.setNeedCommunityInfo(true);
+        communityMemberDto.setNoAuditEnterCommunity(true);
+
+        int count = communityInnerServiceSMOImpl.getCommunityMemberCount(communityMemberDto);
+
+        List<ApiCommunityDataVo> communitys = null;
+
+        if (count > 0) {
+            communitys = BeanConvertUtil.covertBeanList(communityInnerServiceSMOImpl.getCommunityMembers(communityMemberDto), ApiCommunityDataVo.class);
+        } else {
+            communitys = new ArrayList<>();
+        }
+
+        //刷入 商户信息
+        if (communitys.size() > 0) {
+            freshCommunityInfo(communitys);
+        }
+
+        ApiCommunityVo apiCommunityVo = new ApiCommunityVo();
+
+        apiCommunityVo.setTotal(count);
+        apiCommunityVo.setRecords((int) Math.ceil((double) count / (double) reqJson.getInteger("row")));
+        apiCommunityVo.setCommunitys(communitys);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiCommunityVo), HttpStatus.OK);
+
+        context.setResponseEntity(responseEntity);
+    }
+
     public IStoreInnerServiceSMO getStoreInnerServiceSMOImpl() {
     public IStoreInnerServiceSMO getStoreInnerServiceSMOImpl() {
         return storeInnerServiceSMOImpl;
         return storeInnerServiceSMOImpl;
     }
     }

+ 1 - 1
Api/src/main/java/com/java110/api/listener/parkingSpace/SaveParkingSpaceListener.java

@@ -125,7 +125,7 @@ public class SaveParkingSpaceListener extends AbstractServiceApiDataFlowListener
         Assert.jsonObjectHaveKey(paramIn, "num", "请求报文中未包含age");
         Assert.jsonObjectHaveKey(paramIn, "num", "请求报文中未包含age");
         Assert.jsonObjectHaveKey(paramIn, "area", "请求报文中未包含name");
         Assert.jsonObjectHaveKey(paramIn, "area", "请求报文中未包含name");
         Assert.jsonObjectHaveKey(paramIn, "userId", "请求报文中未包含userId");
         Assert.jsonObjectHaveKey(paramIn, "userId", "请求报文中未包含userId");
-        Assert.jsonObjectHaveKey(paramIn, "paId", "请求报文停车场信息");
+        Assert.jsonObjectHaveKey(paramIn, "paId", "请求报文中未包含停车场信息");
     }
     }
 
 
 
 

+ 1 - 1
WebService/src/main/java/com/java110/web/components/community/AuditEnterCommunityManageComponent.java

@@ -37,7 +37,7 @@ public class AuditEnterCommunityManageComponent {
     public ResponseEntity<String> list(IPageData pd) {
     public ResponseEntity<String> list(IPageData pd) {
 
 
         JSONObject reqParam = JSONObject.parseObject(pd.getReqData());
         JSONObject reqParam = JSONObject.parseObject(pd.getReqData());
-        reqParam.put("auditStatusCd", StateConstant.NO_AUDIT);
+        //reqParam.put("auditStatusCd", StateConstant.NO_AUDIT);
 
 
         IPageData newPd = PageData.newInstance().builder(pd.getUserId(), pd.getUserName(), pd.getToken(),
         IPageData newPd = PageData.newInstance().builder(pd.getUserId(), pd.getUserName(), pd.getToken(),
                 reqParam.toJSONString(), pd.getComponentCode(), pd.getComponentMethod(), "", pd.getSessionId());
                 reqParam.toJSONString(), pd.getComponentCode(), pd.getComponentMethod(), "", pd.getSessionId());

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

@@ -36,7 +36,7 @@ public class ListAuditEnterCommunitysSMOImpl extends AbstractComponentSMO implem
 
 
         super.validatePageInfo(pd);
         super.validatePageInfo(pd);
 
 
-        super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_AUDIT_ENTER_COMMUNITY);
+        //super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_AUDIT_ENTER_COMMUNITY);
     }
     }
 
 
     @Override
     @Override

+ 74 - 2
WebService/src/main/resources/components/communityPackage/audit-enter-community-manage/auditEnterCommunityManage.html

@@ -1,9 +1,75 @@
 <div id="component">
 <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;">
+                        <button type="button" class="btn btn-link btn-sm" style="margin-right:10px;"
+                                v-on:click="_moreCondition()">{{auditEnterCommunityManageInfo.moreCondition ==
+                            true?'隐藏':'更多'}}
+                        </button>
+                    </div>
+                </div>
+                <div class="ibox-content">
+                    <div class="row">
+                        <div class="col-sm-4">
+                            <div class="form-group">
+                                <input type="text" placeholder="请输入商户名称"
+                                       v-model="auditEnterCommunityManageInfo.conditions.name" class=" form-control">
+                            </div>
+                        </div>
+                        <div class="col-sm-4">
+                            <div class="form-group">
+                                <input type="text" placeholder="请输入小区名称"
+                                       v-model="auditEnterCommunityManageInfo.conditions.communityName"
+                                       class=" form-control">
+                            </div>
+                        </div>
+                        <div class="col-sm-3">
+                            <select class="custom-select"
+                                    v-model="auditEnterCommunityManageInfo.conditions.auditStatusCd">
+                                <option selected value="">请选择审核状态</option>
+                                <option value="1000">未审核</option>
+                                <option value="1100">审核通过</option>
+                                <option value="1200">审核未通过</option>
+                            </select></div>
+
+                        <div class="col-sm-1">
+                            <button type="button" class="btn btn-primary btn-sm"
+                                    v-on:click="_queryEnterCommunityMethod()">
+                                <i class="glyphicon glyphicon-search"></i> 查询
+                            </button>
+                        </div>
+                    </div>
+                    <div class="row" v-if="auditEnterCommunityManageInfo.moreCondition == true">
+                        <div class="col-sm-4">
+                            <select class="custom-select"
+                                    v-model="auditEnterCommunityManageInfo.conditions.memberTypeCd">
+                                <option selected value="">请选择商户类型</option>
+                                <option value="390001200002">物业公司</option>
+                                <option value="390001200003">代理商</option>
+                            </select>
+                        </div>
+                        <div class="col-sm-4">
+                            <div class="form-group">
+                                <input type="text" placeholder="请输入联系电话"
+                                       v-model="auditEnterCommunityManageInfo.conditions.tel"
+                                       class=" form-control">
+                            </div>
+                        </div>
+
+                    </div>
+
+                </div>
+            </div>
+        </div>
+    </div>
     <div class="row">
     <div class="row">
         <div class="col-lg-12">
         <div class="col-lg-12">
             <div class="ibox">
             <div class="ibox">
                 <div class="ibox-title">
                 <div class="ibox-title">
-                    <h5>入驻审核</h5>
+                    <h5>商户审核</h5>
                     <div class="ibox-tools" style="top:10px;">
                     <div class="ibox-tools" style="top:10px;">
 
 
                     </div>
                     </div>
@@ -33,11 +99,17 @@
                             <td>{{community.address}}</td>
                             <td>{{community.address}}</td>
                             <td>{{community.stateName}}</td>
                             <td>{{community.stateName}}</td>
                             <td>
                             <td>
-                                <div class="btn-group">
+                                <div class="btn-group" v-if="community.auditStatusCd=='1000'">
                                     <button class="btn-white btn btn-xs"
                                     <button class="btn-white btn btn-xs"
                                             v-on:click="_openEnterAuditCommunityModal(community)">审核
                                             v-on:click="_openEnterAuditCommunityModal(community)">审核
                                     </button>
                                     </button>
                                 </div>
                                 </div>
+                                <!--v-on:click="_openEnterAuditCommunityModal(community)"-->
+                                <div class="btn-group" v-if="community.auditStatusCd!='1000'">
+                                    <button class="btn-white btn btn-xs"
+                                            >撤回审核
+                                    </button>
+                                </div>
 
 
 
 
                         </tr>
                         </tr>

+ 26 - 7
WebService/src/main/resources/components/communityPackage/audit-enter-community-manage/auditEnterCommunityManage.js

@@ -10,7 +10,15 @@
                 communitys:[],
                 communitys:[],
                 total:0,
                 total:0,
                 records:1,
                 records:1,
-                currentCommunityMemberId:''
+                currentCommunityMemberId:'',
+                moreCondition:false,
+                conditions:{
+                    name:'',
+                    memberTypeCd:'',
+                    communityName:'',
+                    auditStatusCd:'1000',
+                    tel:''
+                }
             }
             }
         },
         },
         _initMethod:function(){
         _initMethod:function(){
@@ -29,13 +37,13 @@
         },
         },
         methods:{
         methods:{
             _listCommunitys:function(_page, _rows){
             _listCommunitys:function(_page, _rows){
-                var param = {
-                    params:{
-                        page:_page,
-                        row:_rows
-                    }
 
 
-               }
+               vc.component.auditEnterCommunityManageInfo.conditions.page = _page;
+               vc.component.auditEnterCommunityManageInfo.conditions.row = _rows;
+               var param = {
+                   params: vc.component.auditEnterCommunityManageInfo.conditions
+               };
+
                //发送get请求
                //发送get请求
                vc.http.get('auditEnterCommunityManage',
                vc.http.get('auditEnterCommunityManage',
                             'list',
                             'list',
@@ -80,6 +88,17 @@
                         console.log('请求失败处理');
                         console.log('请求失败处理');
                         vc.message(errInfo);
                         vc.message(errInfo);
                 });
                 });
+            },
+            _queryEnterCommunityMethod: function () {
+                vc.component._listCommunitys(DEFAULT_PAGE, DEFAULT_ROWS);
+
+            },
+            _moreCondition: function () {
+                if (vc.component.auditEnterCommunityManageInfo.moreCondition) {
+                    vc.component.auditEnterCommunityManageInfo.moreCondition = false;
+                } else {
+                    vc.component.auditEnterCommunityManageInfo.moreCondition = true;
+                }
             }
             }
 
 
         }
         }

+ 18 - 0
java110-bean/src/main/java/com/java110/dto/CommunityMemberDto.java

@@ -12,8 +12,10 @@ public class CommunityMemberDto extends CommunityDto implements Serializable {
     private String communityMemberId;
     private String communityMemberId;
 
 
     private String communityId;
     private String communityId;
+    private String communityName;
 
 
     private String memberId;
     private String memberId;
+    private String subMemberId;
 
 
     private String memberTypeCd;
     private String memberTypeCd;
 
 
@@ -98,4 +100,20 @@ public class CommunityMemberDto extends CommunityDto implements Serializable {
     public void setAuditStatusCds(String[] auditStatusCds) {
     public void setAuditStatusCds(String[] auditStatusCds) {
         this.auditStatusCds = auditStatusCds;
         this.auditStatusCds = auditStatusCds;
     }
     }
+
+    public String getCommunityName() {
+        return communityName;
+    }
+
+    public void setCommunityName(String communityName) {
+        this.communityName = communityName;
+    }
+
+    public String getSubMemberId() {
+        return subMemberId;
+    }
+
+    public void setSubMemberId(String subMemberId) {
+        this.subMemberId = subMemberId;
+    }
 }
 }

+ 9 - 0
java110-bean/src/main/java/com/java110/vo/api/community/ApiCommunityDataVo.java

@@ -15,6 +15,7 @@ public class ApiCommunityDataVo  implements Serializable {
     private String mapX;
     private String mapX;
     private String mapY;
     private String mapY;
     private String state;
     private String state;
+    private String auditStatusCd;
     private String stateName;
     private String stateName;
     private String memberId;
     private String memberId;
     private String storeName;
     private String storeName;
@@ -149,4 +150,12 @@ public class ApiCommunityDataVo  implements Serializable {
     public void setCityName(String cityName) {
     public void setCityName(String cityName) {
         this.cityName = cityName;
         this.cityName = cityName;
     }
     }
+
+    public String getAuditStatusCd() {
+        return auditStatusCd;
+    }
+
+    public void setAuditStatusCd(String auditStatusCd) {
+        this.auditStatusCd = auditStatusCd;
+    }
 }
 }

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

@@ -319,6 +319,9 @@
         <if test="memberId != null and memberId != '' and needCommunityInfo == false">
         <if test="memberId != null and memberId != '' and needCommunityInfo == false">
             and ms.member_id = #{memberId}
             and ms.member_id = #{memberId}
         </if>
         </if>
+        <if test="subMemberId != null and subMemberId != ''">
+            and ms.member_id = #{memberId}
+        </if>
         <if test="noAuditEnterCommunity == true">
         <if test="noAuditEnterCommunity == true">
             and ms.member_type_cd not in ('390001200003','390001200005','390001200000')
             and ms.member_type_cd not in ('390001200003','390001200005','390001200000')
         </if>
         </if>
@@ -332,6 +335,10 @@
         <if test="communityId != null and communityId != ''">
         <if test="communityId != null and communityId != ''">
             and ms.community_id = #{communityId}
             and ms.community_id = #{communityId}
         </if>
         </if>
+        <if test="communityName != null and communityName != '' and needCommunityInfo == true">
+            and sc.name like concat('%',#{communityName},'%')
+        </if>
+        order by ms.create_time desc
         <if test="page != -1 and page != null">
         <if test="page != -1 and page != null">
             limit #{page},#{row}
             limit #{page},#{row}
         </if>
         </if>
@@ -388,6 +395,10 @@
             and ms.member_id = #{memberId}
             and ms.member_id = #{memberId}
         </if>
         </if>
 
 
+        <if test="subMemberId != null and subMemberId != ''">
+            and ms.member_id = #{memberId}
+        </if>
+
         <if test="noAuditEnterCommunity == true">
         <if test="noAuditEnterCommunity == true">
             and ms.member_type_cd not in ('390001200003','390001200005','390001200000')
             and ms.member_type_cd not in ('390001200003','390001200005','390001200000')
         </if>
         </if>
@@ -408,6 +419,9 @@
         <if test="communityId != null and communityId != ''">
         <if test="communityId != null and communityId != ''">
             and ms.community_id = #{communityId}
             and ms.community_id = #{communityId}
         </if>
         </if>
+        <if test="communityName != null and communityName != '' and needCommunityInfo == true">
+            and sc.name like concat('%',#{communityName},'%')
+        </if>
     </select>
     </select>
 
 
     <!-- 查询小区信息 add by wuxw 2018-07-03 -->
     <!-- 查询小区信息 add by wuxw 2018-07-03 -->

+ 24 - 0
java110-utils/src/main/java/com/java110/utils/util/StringUtil.java

@@ -7,6 +7,8 @@
 package com.java110.utils.util;
 package com.java110.utils.util;
 
 
 
 
+import com.alibaba.fastjson.JSONObject;
+
 import java.io.UnsupportedEncodingException;
 import java.io.UnsupportedEncodingException;
 import java.util.Date;
 import java.util.Date;
 import java.util.regex.Pattern;
 import java.util.regex.Pattern;
@@ -481,4 +483,26 @@ public class StringUtil {
 
 
         return description;
         return description;
     }
     }
+
+    /**
+     * json是否包含key 并且存在值
+     * @param param
+     * @param key
+     * @return
+     */
+    public static boolean jsonHasKayAndValue(JSONObject param,String key){
+        if(param == null){
+            return false;
+        }
+
+        if(!param.containsKey(key)){
+            return false;
+        }
+
+        if(isEmpty(param.getString(key))){
+            return false;
+        }
+
+        return true;
+    }
 }
 }