Przeglądaj źródła

优化小区信息页面展示物业公司名字

wuxw 1 rok temu
rodzic
commit
ebefc9b149

+ 10 - 0
java110-bean/src/main/java/com/java110/dto/room/RoomDto.java

@@ -51,6 +51,8 @@ public class RoomDto extends PageDto implements Serializable {
     private String apartment;
     private String apartmentName;
     private String communityId;
+
+    private String communityName;
     private String floorId;
     private String[] floorIds;
     private String floorNum;
@@ -589,4 +591,12 @@ public class RoomDto extends PageDto implements Serializable {
     public void setLogEndTime(String logEndTime) {
         this.logEndTime = logEndTime;
     }
+
+    public String getCommunityName() {
+        return communityName;
+    }
+
+    public void setCommunityName(String communityName) {
+        this.communityName = communityName;
+    }
 }

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

@@ -28,6 +28,9 @@ public class ApiCommunityDataVo implements Serializable {
     private String endTime;
     private String createTime;
 
+
+    private String storeId;
+
     private List<CommunityAttrDto> communityAttrDtos;
 
     public String getCommunityId() {
@@ -197,4 +200,12 @@ public class ApiCommunityDataVo implements Serializable {
     public void setCreateTime(String createTime) {
         this.createTime = createTime;
     }
+
+    public String getStoreId() {
+        return storeId;
+    }
+
+    public void setStoreId(String storeId) {
+        this.storeId = storeId;
+    }
 }

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

@@ -471,24 +471,16 @@
         select t.address,t.nearby_landmarks,t.nearby_landmarks nearbyLandmarks,
         t.city_code,t.city_code cityCode,t.name,t.status_cd,t.status_cd statusCd,t.tel,
         t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.map_y,t.map_y mapY,
-        t.map_x,t.map_x mapX,t.state,(CASE
-        WHEN t.state='1000'
-        THEN '待审核'
-        WHEN t.state = '1100'
-        THEN '审核完成'
-        ELSE
-        '审核拒绝'
-        END) stateName,ca.area_code areaCode,ca.area_name areaName,
+        t.map_x,t.map_x mapX,t.state,td.name stateName,ca.area_code areaCode,ca.area_name areaName,
         ca.parent_area_code parentAreaCode,ca.parent_area_name parentAreaName,
         t.community_area communityArea,t.pay_fee_month,t.pay_fee_month payFeeMonth,t.fee_price,t.fee_price
-        feePrice,t.qr_code qrCode,t.create_time createTime
-        from s_community t,city_area ca
-        <if test="memberId !=null and memberId !=''">
-            ,s_community_member cm
-        </if>
+        feePrice,t.qr_code qrCode,t.create_time createTime,s.name storeName,s.store_id storeId
+        from s_community t
+        left join city_area ca on t.city_code = ca.area_code and ca.status_cd = '0'
+        left join s_community_member cm on t.community_id = cm.community_id and cm.member_type_cd = '390001200002' and cm.status_cd = '0'
+        left join s_store s on cm.member_id = s.store_id and s.status_cd = '0'
+        left join t_dict td on t.state = td.status_cd and td.table_name = 's_community' and td.table_columns = 'state'
         where t.status_cd = '0'
-        and t.city_code = ca.area_code
-        and ca.status_cd = '0'
         <if test="address !=null and address != ''">
             and t.address= #{address}
         </if>
@@ -551,14 +543,13 @@
 
     <!-- 查询小区数量 add by wuxw 2018-07-03 -->
     <select id="queryCommunitysCount" parameterType="Map" resultType="Map">
-        select count(DISTINCT(t.community_id)) count
-        from s_community t,city_area ca
-        <if test="memberId !=null and memberId !=''">
-            ,s_community_member cm
-        </if>
-        where 1 =1
-        and t.city_code = ca.area_code
-        and ca.status_cd = '0'
+        select count(1) count
+        from s_community t
+        left join city_area ca on t.city_code = ca.area_code and ca.status_cd = '0'
+        left join s_community_member cm on t.community_id = cm.community_id and cm.member_type_cd = '390001200002' and cm.status_cd = '0'
+        left join s_store s on cm.member_id = s.store_id and s.status_cd = '0'
+        left join t_dict td on t.state = td.status_cd and td.table_name = 's_community' and td.table_columns = 'state'
+        where t.status_cd = '0'
         <if test="address !=null and address != ''">
             and t.address= #{address}
         </if>

+ 12 - 0
java110-db/src/main/resources/mapper/community/CommunityV1ServiceDaoImplMapper.xml

@@ -59,6 +59,12 @@
         <if test="communityId !=null and communityId != ''">
             and t.community_id= #{communityId}
         </if>
+        <if test="communityIds != null">
+            and t.community_id in
+            <foreach collection="communityIds" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
         <if test="communityArea !=null and communityArea != ''">
             and t.community_area= #{communityArea}
         </if>
@@ -163,6 +169,12 @@
         <if test="communityId !=null and communityId != ''">
             and t.community_id= #{communityId}
         </if>
+        <if test="communityIds != null">
+            and t.community_id in
+            <foreach collection="communityIds" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
         <if test="communityArea !=null and communityArea != ''">
             and t.community_area= #{communityArea}
         </if>

+ 30 - 0
service-community/src/main/java/com/java110/community/bmo/room/impl/QueryRoomStatisticsBMOImpl.java

@@ -1,8 +1,10 @@
 package com.java110.community.bmo.room.impl;
 
 import com.java110.community.bmo.room.IQueryRoomStatisticsBMO;
+import com.java110.dto.community.CommunityDto;
 import com.java110.dto.owner.OwnerRoomRelDto;
 import com.java110.dto.room.RoomDto;
+import com.java110.intf.community.ICommunityV1InnerServiceSMO;
 import com.java110.intf.store.IComplaintV1InnerServiceSMO;
 import com.java110.intf.community.IRepairPoolV1InnerServiceSMO;
 import com.java110.intf.report.IReportOweFeeInnerServiceSMO;
@@ -46,6 +48,9 @@ public class QueryRoomStatisticsBMOImpl implements IQueryRoomStatisticsBMO {
     @Autowired
     private IContractRoomInnerServiceSMO contractRoomInnerServiceSMOImpl;
 
+    @Autowired
+    private ICommunityV1InnerServiceSMO communityV1InnerServiceSMOImpl;
+
     @Override
     public List<RoomDto> query(List<RoomDto> roomDtos) {
 
@@ -121,6 +126,7 @@ public class QueryRoomStatisticsBMOImpl implements IQueryRoomStatisticsBMO {
         queryRoomOwner(roomIds, roomDtos);
         List<String> ownerIds = new ArrayList<>();
         List<String> ownerTels = new ArrayList<>();
+        List<String> communityIds = new ArrayList<>();
         for (RoomDto roomDto : roomDtos) {
             if (!StringUtil.isEmpty(roomDto.getOwnerId())) {
                 ownerIds.add(roomDto.getOwnerId());
@@ -128,8 +134,12 @@ public class QueryRoomStatisticsBMOImpl implements IQueryRoomStatisticsBMO {
             if (!StringUtil.isEmpty(roomDto.getOwnerTel())) {
                 ownerTels.add(roomDto.getOwnerTel());
             }
+            communityIds.add(roomDto.getCommunityId());
         }
 
+        // 查询小区名称
+        queryCommunityName(communityIds,roomDtos);
+
         // 查询 家庭成员数
         queryOwnerMemberCount(ownerIds, roomDtos);
 
@@ -145,6 +155,26 @@ public class QueryRoomStatisticsBMOImpl implements IQueryRoomStatisticsBMO {
         return roomDtos;
     }
 
+    private void queryCommunityName(List<String> communityIds, List<RoomDto> roomDtos) {
+        if(ListUtil.isNull(communityIds)){
+            return ;
+        }
+        CommunityDto communityDto = new CommunityDto();
+        communityDto.setCommunityIds(communityIds.toArray(new String[communityIds.size()]));
+        List<CommunityDto> communityDtos = communityV1InnerServiceSMOImpl.queryCommunitys(communityDto);
+        if(ListUtil.isNull(communityDtos)){
+            return;
+        }
+        for (RoomDto tmpRoomDto : roomDtos) {
+            for (CommunityDto tCommunityDto : communityDtos) {
+                if (!tmpRoomDto.getCommunityId().equals(tCommunityDto.getCommunityId())) {
+                    continue;
+                }
+                tmpRoomDto.setCommunityName(tCommunityDto.getName());
+            }
+        }
+    }
+
 
     private void queryRoomOwner(List<String> roomIds, List<RoomDto> roomDtos) {
         if (ListUtil.isNull(roomDtos)) {