Browse Source

Merge http://139.155.19.15:8000/supervip/MicroCommunity

java110 5 years ago
parent
commit
5bdf058a2a

+ 27 - 1
java110-bean/src/main/java/com/java110/dto/community/CommunityAttrDto.java

@@ -19,12 +19,14 @@ public class CommunityAttrDto extends PageDto implements Serializable {
     private String communityId;
     private String specCd;
     private String value;
+    private String specName;
+    private String valueName;
+    private String listShow;
 
     private Date createTime;
 
     private String statusCd = "0";
 
-
     public String getAttrId() {
         return attrId;
     }
@@ -72,4 +74,28 @@ public class CommunityAttrDto extends PageDto implements Serializable {
     public void setStatusCd(String statusCd) {
         this.statusCd = statusCd;
     }
+
+    public String getSpecName() {
+        return specName;
+    }
+
+    public void setSpecName(String specName) {
+        this.specName = specName;
+    }
+
+    public String getValueName() {
+        return valueName;
+    }
+
+    public void setValueName(String valueName) {
+        this.valueName = valueName;
+    }
+
+    public String getListShow() {
+        return listShow;
+    }
+
+    public void setListShow(String listShow) {
+        this.listShow = listShow;
+    }
 }

+ 14 - 2
java110-bean/src/main/java/com/java110/vo/api/community/ApiCommunityDataVo.java

@@ -1,9 +1,11 @@
 package com.java110.vo.api.community;
 
+import com.java110.dto.community.CommunityAttrDto;
+
 import java.io.Serializable;
-import java.util.Date;
+import java.util.List;
 
-public class ApiCommunityDataVo  implements Serializable {
+public class ApiCommunityDataVo implements Serializable {
 
     private String communityMemberId;
     private String communityId;
@@ -23,6 +25,8 @@ public class ApiCommunityDataVo  implements Serializable {
     private String storeTypeName;
     private String tel;
 
+    private List<CommunityAttrDto> communityAttrDtos;
+
     public String getCommunityId() {
         return communityId;
     }
@@ -158,4 +162,12 @@ public class ApiCommunityDataVo  implements Serializable {
     public void setAuditStatusCd(String auditStatusCd) {
         this.auditStatusCd = auditStatusCd;
     }
+
+    public List<CommunityAttrDto> getCommunityAttrDtos() {
+        return communityAttrDtos;
+    }
+
+    public void setCommunityAttrDtos(List<CommunityAttrDto> communityAttrDtos) {
+        this.communityAttrDtos = communityAttrDtos;
+    }
 }

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

@@ -122,8 +122,14 @@
 
     <!-- 查询小区属性信息 add by wuxw 2018-07-03 -->
     <select id="getCommunityAttrs" parameterType="Map" resultType="Map">
-        select sa.b_id,sa.attr_id,sa.community_id,sa.spec_cd,sa.value,sa.status_cd
+        select sa.b_id,sa.attr_id,sa.community_id,sa.spec_cd,sa.value,sa.status_cd,
+        sa.b_id bId,sa.attr_id attrId,sa.community_id communityId,sa.spec_cd specCd,
+        s.spec_name specName,
+        v.value_name valueName,
+        s.list_show listShow
         from s_community_attr sa
+        left join attr_spec s on sa.spec_cd = s.spec_cd and s.status_cd = '0' and s.table_name = 'building_community_attr'
+        left join attr_value v on sa.`value` = v.`value` and sa.spec_cd = v.spec_cd and v.status_cd = '0'
         where
         1=1
         <if test="statusCd != null and statusCd != ''">

+ 17 - 9
service-api/src/main/java/com/java110/api/listener/community/ListCommunitysListener.java

@@ -2,15 +2,15 @@ package com.java110.api.listener.community;
 
 import com.alibaba.fastjson.JSONObject;
 import com.java110.api.listener.AbstractServiceApiListener;
-import com.java110.intf.common.IAreaInnerServiceSMO;
-import com.java110.dto.area.AreaDto;
-import com.java110.utils.constant.ServiceCodeConstant;
-import com.java110.utils.util.BeanConvertUtil;
 import com.java110.core.annotation.Java110Listener;
 import com.java110.core.context.DataFlowContext;
-import com.java110.intf.community.ICommunityInnerServiceSMO;
-import com.java110.dto.community.CommunityDto;
 import com.java110.core.event.service.api.ServiceDataFlowEvent;
+import com.java110.dto.area.AreaDto;
+import com.java110.dto.community.CommunityDto;
+import com.java110.intf.common.IAreaInnerServiceSMO;
+import com.java110.intf.community.ICommunityInnerServiceSMO;
+import com.java110.utils.constant.ServiceCodeConstant;
+import com.java110.utils.util.BeanConvertUtil;
 import com.java110.vo.api.community.ApiCommunityDataVo;
 import com.java110.vo.api.community.ApiCommunityVo;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -72,9 +72,17 @@ public class ListCommunitysListener extends AbstractServiceApiListener {
         int count = communityInnerServiceSMOImpl.queryCommunitysCount(communityDto);
 
         List<ApiCommunityDataVo> communitys = null;
-
+        ApiCommunityDataVo apiCommunityDataVo = null;
         if (count > 0) {
-            communitys = BeanConvertUtil.covertBeanList(communityInnerServiceSMOImpl.queryCommunitys(communityDto), ApiCommunityDataVo.class);
+            communitys = new ArrayList<>();
+            List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto);
+
+            for (CommunityDto tmpCommunityDto : communityDtos) {
+                apiCommunityDataVo = BeanConvertUtil.covertBean(tmpCommunityDto, ApiCommunityDataVo.class);
+                apiCommunityDataVo.setCommunityAttrDtos(tmpCommunityDto.getCommunityAttrDtos());
+                communitys.add(apiCommunityDataVo);
+            }
+
 
             refreshCommunityCity(communitys);
         } else {
@@ -104,7 +112,7 @@ public class ListCommunitysListener extends AbstractServiceApiListener {
         for (ApiCommunityDataVo communityDataVo : communitys) {
             areaCodes.add(communityDataVo.getCityCode());
         }
-        if(areaCodes.size() > 0){
+        if (areaCodes.size() > 0) {
             AreaDto areaDto = new AreaDto();
             areaDto.setAreaCodes(areaCodes.toArray(new String[areaCodes.size()]));
             List<AreaDto> areaDtos = areaInnerServiceSMOImpl.getProvCityArea(areaDto);