Bläddra i källkod

优化 入驻审核功能

wuxw 6 år sedan
förälder
incheckning
7f1536155e

+ 126 - 0
Api/src/main/java/com/java110/api/listener/community/ListAuditEnterCommunitysListener.java

@@ -0,0 +1,126 @@
+package com.java110.api.listener.community;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.listener.AbstractServiceApiListener;
+import com.java110.common.constant.ServiceCodeConstant;
+import com.java110.common.util.BeanConvertUtil;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.core.smo.community.ICommunityInnerServiceSMO;
+import com.java110.core.smo.store.IStoreInnerServiceSMO;
+import com.java110.dto.CommunityMemberDto;
+import com.java110.dto.community.CommunityDto;
+import com.java110.dto.store.StoreDto;
+import com.java110.event.service.api.ServiceDataFlowEvent;
+import com.java110.vo.api.community.ApiCommunityDataVo;
+import com.java110.vo.api.community.ApiCommunityVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * 查询需要入驻审核单子
+ */
+@Java110Listener("listAuditEnterCommunitysListener")
+public class ListAuditEnterCommunitysListener extends AbstractServiceApiListener {
+
+    @Autowired
+    private ICommunityInnerServiceSMO communityInnerServiceSMOImpl;
+
+    @Autowired
+    private IStoreInnerServiceSMO storeInnerServiceSMOImpl;
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeConstant.SERVICE_CODE_LIST_AUDIT_ENTER_COMMUNITYS;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.GET;
+    }
+
+
+    @Override
+    public int getOrder() {
+        return DEFAULT_ORDER;
+    }
+
+
+    public ICommunityInnerServiceSMO getCommunityInnerServiceSMOImpl() {
+        return communityInnerServiceSMOImpl;
+    }
+
+    public void setCommunityInnerServiceSMOImpl(ICommunityInnerServiceSMO communityInnerServiceSMOImpl) {
+        this.communityInnerServiceSMOImpl = communityInnerServiceSMOImpl;
+    }
+
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+        super.validatePageInfo(reqJson);
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+
+        CommunityMemberDto communityMemberDto = BeanConvertUtil.covertBean(reqJson, CommunityMemberDto.class);
+
+        communityMemberDto.setNeedCommunityInfo(true);
+
+        int count = communityInnerServiceSMOImpl.getCommunityMemberCount(communityMemberDto);
+
+        List<ApiCommunityDataVo> communitys = null;
+
+        if (count > 0) {
+            communitys = BeanConvertUtil.covertBeanList(communityInnerServiceSMOImpl.queryCommunitys(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);
+
+    }
+
+    /**
+     * 刷新 小区 商户信息
+     * @param communityDataVos
+     */
+    private void freshCommunityInfo(List<ApiCommunityDataVo> communityDataVos){
+        for(ApiCommunityDataVo apiCommunityDataVo : communityDataVos) {
+            StoreDto storeDto = new StoreDto();
+            storeDto.setStoreId(apiCommunityDataVo.getMemberId());
+            List<StoreDto> storeDtos = storeInnerServiceSMOImpl.getStores(storeDto);
+
+            if(storeDtos.size() != 1){
+                continue;
+            }
+            BeanConvertUtil.covertBean(storeDtos.get(0), apiCommunityDataVo);
+        }
+    }
+
+    public IStoreInnerServiceSMO getStoreInnerServiceSMOImpl() {
+        return storeInnerServiceSMOImpl;
+    }
+
+    public void setStoreInnerServiceSMOImpl(IStoreInnerServiceSMO storeInnerServiceSMOImpl) {
+        this.storeInnerServiceSMOImpl = storeInnerServiceSMOImpl;
+    }
+}

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

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

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

@@ -15,11 +15,10 @@
                         <tr>
                             <th>小区ID</th>
                             <th>小区名称</th>
-                            <th>小区地址</th>
-                            <th>附近地标</th>
-                            <th>城市编码</th>
-                            <th>小区维度</th>
-                            <th>小区经度</th>
+                            <th>商户名称</th>
+                            <th>商户类型</th>
+                            <th>联系电话</th>
+                            <th>商户地址</th>
                             <th>状态</th>
                             <th class="text-right">操作</th>
                         </tr>
@@ -28,11 +27,10 @@
                         <tr v-for="community in auditEnterCommunityManageInfo.communitys">
                             <td>{{community.communityId}}</td>
                             <td>{{community.name}}</td>
+                            <td>{{community.storeName}}</td>
+                            <td>{{community.storeTypeName}}</td>
+                            <td>{{community.tel}}</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">

+ 13 - 1
java110-bean/src/main/java/com/java110/dto/CommunityMemberDto.java

@@ -1,11 +1,13 @@
 package com.java110.dto;
 
+import com.java110.dto.community.CommunityDto;
+
 import java.io.Serializable;
 
 /**
  * 小区成员dto
  */
-public class CommunityMemberDto extends PageDto implements Serializable {
+public class CommunityMemberDto extends CommunityDto implements Serializable {
 
     private String communityMemberId;
 
@@ -19,6 +21,8 @@ public class CommunityMemberDto extends PageDto implements Serializable {
 
     private String statusCd;
 
+    private boolean needCommunityInfo;
+
     public String getCommunityMemberId() {
         return communityMemberId;
     }
@@ -66,4 +70,12 @@ public class CommunityMemberDto extends PageDto implements Serializable {
     public void setStatusCd(String statusCd) {
         this.statusCd = statusCd;
     }
+
+    public boolean isNeedCommunityInfo() {
+        return needCommunityInfo;
+    }
+
+    public void setNeedCommunityInfo(boolean needCommunityInfo) {
+        this.needCommunityInfo = needCommunityInfo;
+    }
 }

+ 130 - 0
java110-bean/src/main/java/com/java110/dto/store/StoreDto.java

@@ -0,0 +1,130 @@
+package com.java110.dto.store;
+
+import com.java110.dto.PageDto;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @ClassName FloorDto
+ * @Description 业主数据层封装
+ * @Author wuxw
+ * @Date 2019/4/24 8:52
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+public class StoreDto extends PageDto implements Serializable {
+
+
+    private String storeId;
+    private String userId;
+    private String name;
+    private String address;
+    private String tel;
+    private String storeTypeCd;
+    private String nearByLandmarks;
+    private String mapX;
+    private String mapY;
+    private String storeName;
+
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+    public String getStoreId() {
+        return storeId;
+    }
+
+    public void setStoreId(String storeId) {
+        this.storeId = storeId;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getTel() {
+        return tel;
+    }
+
+    public void setTel(String tel) {
+        this.tel = tel;
+    }
+
+    public String getStoreTypeCd() {
+        return storeTypeCd;
+    }
+
+    public void setStoreTypeCd(String storeTypeCd) {
+        this.storeTypeCd = storeTypeCd;
+    }
+
+    public String getNearByLandmarks() {
+        return nearByLandmarks;
+    }
+
+    public void setNearByLandmarks(String nearByLandmarks) {
+        this.nearByLandmarks = nearByLandmarks;
+    }
+
+    public String getMapX() {
+        return mapX;
+    }
+
+    public void setMapX(String mapX) {
+        this.mapX = mapX;
+    }
+
+    public String getMapY() {
+        return mapY;
+    }
+
+    public void setMapY(String mapY) {
+        this.mapY = mapY;
+    }
+
+    public String getStoreName() {
+        return storeName;
+    }
+
+    public void setStoreName(String storeName) {
+        this.storeName = storeName;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+}

+ 19 - 1
java110-bean/src/main/java/com/java110/vo/api/community/ApiCommunityDataVo.java

@@ -3,7 +3,7 @@ package com.java110.vo.api.community;
 import java.io.Serializable;
 import java.util.Date;
 
-public class ApiCommunityDataVo implements Serializable {
+public class ApiCommunityDataVo  implements Serializable {
 
     private String communityId;
     private String name;
@@ -14,6 +14,8 @@ public class ApiCommunityDataVo implements Serializable {
     private String mapY;
     private String state;
     private String stateName;
+    private String memberId;
+    private String storeName;
 
     public String getCommunityId() {
         return communityId;
@@ -86,4 +88,20 @@ public class ApiCommunityDataVo implements Serializable {
     public void setStateName(String stateName) {
         this.stateName = stateName;
     }
+
+    public String getMemberId() {
+        return memberId;
+    }
+
+    public void setMemberId(String memberId) {
+        this.memberId = memberId;
+    }
+
+    public String getStoreName() {
+        return storeName;
+    }
+
+    public void setStoreName(String storeName) {
+        this.storeName = storeName;
+    }
 }

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

@@ -60,6 +60,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 AGENT_HAS_LIST_AUDIT_ENTER_COMMUNITY = "502019091978690002";
     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";

+ 5 - 0
java110-common/src/main/java/com/java110/common/constant/ServiceCodeConstant.java

@@ -496,6 +496,11 @@ public class ServiceCodeConstant {
      */
     public static final String SERVICE_CODE_LIST_COMMUNITYS = "community.listCommunitys";
 
+    /**
+     * 查询需要审核入驻小区商户
+     */
+    public static final String SERVICE_CODE_LIST_AUDIT_ENTER_COMMUNITYS = "community.listAuditEnterCommunitys";
+
     /**
      * 保存小区
      */

+ 14 - 0
java110-core/src/main/java/com/java110/core/smo/store/IStoreInnerServiceSMO.java

@@ -0,0 +1,14 @@
+package com.java110.core.smo.store;
+
+import com.java110.dto.store.StoreDto;
+
+import java.util.List;
+
+/**
+ * 商户 服务内部交互接口类
+ * add by wuxw 2019-09-19
+ */
+public interface IStoreInnerServiceSMO {
+
+    public List<StoreDto> getStores(StoreDto storeDto);
+}

+ 28 - 1
java110-db/src/main/resources/mapper/community/CommunityServiceDaoImplMapper.xml

@@ -279,9 +279,28 @@
     <select id="getCommunityMember" parameterType="Map" resultType="Map">
         select ms.community_member_id ,ms.b_id,ms.community_id,ms.member_id,ms.member_type_cd,ms.status_cd,ms.audit_status_cd,
         ms.community_member_id communityMemberId ,ms.b_id bId,ms.community_id communityId,ms.member_id memberId,ms.member_type_cd memberTypeCd,ms.status_cd statusCd,
-        ms.audit_status_cd auditStatusCd
+        ms.audit_status_cd auditStatusCd,
+        (CASE
+        WHEN ms.audit_status_cd='1000'
+        THEN '待审核'
+        WHEN ms.audit_status_cd = '1100'
+        THEN '审核完成'
+        ELSE
+        '审核拒绝'
+        END) stateName
+        <if test="needCommunityInfo == true">
+            ,sc.name
+        </if>
         from s_community_member ms
+        <if test="needCommunityInfo == true">
+            ,s_community sc
+        </if>
         where 1=1
+        <if test="needCommunityInfo == true">
+            and sc.`community_id` = ms.`community_id`
+            AND sc.`status_cd` = '0'
+            and sc.state='1100'
+        </if>
         <if test="statusCd != null and statusCd != ''">
             and ms.status_cd = #{statusCd}
         </if>
@@ -333,7 +352,15 @@
     <select id="getCommunityMemberCount" parameterType="Map" resultType="Map">
         select count(1) count
         from s_community_member ms
+        <if test="needCommunityInfo == true">
+            ,s_community sc
+        </if>
         where 1=1
+        <if test="needCommunityInfo == true">
+            and sc.`community_id` = ms.`community_id`
+            AND sc.`status_cd` = '0'
+            and sc.state='1100'
+        </if>
         <if test="statusCd != null and statusCd != ''">
             and ms.status_cd = #{statusCd}
         </if>