Browse Source

加入 交物业费时定位房屋 定位出已售卖房屋就可以

wuxw 7 years ago
parent
commit
87c0719a19

+ 155 - 0
Api/src/main/java/com/java110/api/listener/room/QueryRoomsWithSellListener.java

@@ -0,0 +1,155 @@
+package com.java110.api.listener.room;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.listener.AbstractServiceApiDataFlowListener;
+import com.java110.common.constant.ResponseConstant;
+import com.java110.common.constant.ServiceCodeConstant;
+import com.java110.common.exception.SMOException;
+import com.java110.common.util.Assert;
+import com.java110.common.util.BeanConvertUtil;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.core.smo.floor.IFloorInnerServiceSMO;
+import com.java110.core.smo.room.IRoomInnerServiceSMO;
+import com.java110.dto.FloorDto;
+import com.java110.dto.RoomDto;
+import com.java110.event.service.api.ServiceDataFlowEvent;
+import com.java110.vo.api.ApiRoomDataVo;
+import com.java110.vo.api.ApiRoomVo;
+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.List;
+
+/**
+ * @ClassName QueryRoomsListener
+ * @Description TODO 查询已销售房屋信息
+ * @Author wuxw
+ * @Date 2019/5/8 0:15
+ * @Version 1.0
+ * add by wuxw 2019/5/8
+ **/
+@Java110Listener("queryRoomsWithSellListener")
+public class QueryRoomsWithSellListener extends AbstractServiceApiDataFlowListener {
+
+    @Autowired
+    private IFloorInnerServiceSMO floorInnerServiceSMOImpl;
+
+    @Autowired
+    private IRoomInnerServiceSMO roomInnerServiceSMOImpl;
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeConstant.SERVICE_CODE_QUERY_ROOMS_WITHOUT_SELL;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.GET;
+    }
+
+    @Override
+    public void soService(ServiceDataFlowEvent event) {
+        DataFlowContext dataFlowContext = event.getDataFlowContext();
+        //获取请求数据
+        JSONObject reqJson = dataFlowContext.getReqJson();
+        validateRoomData(reqJson);
+
+        //将小区楼ID刷入到 请求参数中
+        freshFloorIdToParam(reqJson);
+
+        RoomDto roomDto = BeanConvertUtil.covertBean(reqJson, RoomDto.class);
+
+        ApiRoomVo apiRoomVo = new ApiRoomVo();
+        //查询总记录数
+        int total = roomInnerServiceSMOImpl.queryRoomsWithSellCount(BeanConvertUtil.covertBean(reqJson, RoomDto.class));
+        apiRoomVo.setTotal(total);
+        if (total > 0) {
+            List<RoomDto> roomDtoList = roomInnerServiceSMOImpl.queryRoomsWithSell(roomDto);
+            apiRoomVo.setRooms(BeanConvertUtil.covertBeanList(roomDtoList, ApiRoomDataVo.class));
+        }
+        int row = reqJson.getInteger("row");
+        apiRoomVo.setRecords((int) Math.ceil((double) total / (double) row));
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiRoomVo), HttpStatus.OK);
+        dataFlowContext.setResponseEntity(responseEntity);
+    }
+
+    /**
+     * 将floorNum 转化为 floorId 刷入到入参对象中
+     *
+     * @param reqJson 入参对象
+     */
+    private void freshFloorIdToParam(JSONObject reqJson) {
+
+        FloorDto floorDto = BeanConvertUtil.covertBean(reqJson, FloorDto.class);
+        String floorId = "001";
+        //检查 请求报文中是否有floorNum 小区楼编号,如果没有就随机选一个
+        try {
+            //if (!reqJson.containsKey("floorNum") || StringUtils.isEmpty(reqJson.getString("floorNum"))) {
+
+                List<FloorDto> floorDtos = floorInnerServiceSMOImpl.queryFloors(floorDto);
+
+                if (floorDtos.size() == 0) {
+                    return;
+                }
+
+                floorId = floorDtos.get(0).getFloorId();
+            //}
+        } finally {
+            reqJson.put("floorId", floorId);
+        }
+    }
+
+    /**
+     * 校验小区房屋查询入参信息
+     *
+     * @param reqJson 请求入参信息
+     */
+    private void validateRoomData(JSONObject reqJson) {
+        Assert.jsonObjectHaveKey(reqJson, "communityId", "请求中未包含communityId信息");
+        Assert.jsonObjectHaveKey(reqJson, "page", "请求报文中未包含page节点");
+        Assert.jsonObjectHaveKey(reqJson, "row", "请求报文中未包含row节点");
+
+        Assert.isInteger(reqJson.getString("page"), "page不是数字");
+        Assert.isInteger(reqJson.getString("row"), "row不是数字");
+        Assert.hasLength(reqJson.getString("communityId"), "小区ID不能为空");
+        int row = Integer.parseInt(reqJson.getString("row"));
+
+
+        if (row > MAX_ROW) {
+            throw new SMOException(ResponseConstant.RESULT_CODE_ERROR, "row 数量不能大于50");
+        }
+       /* //校验小区楼ID和小区是否有对应关系
+        int total = floorInnerServiceSMOImpl.queryFloorsCount(BeanConvertUtil.covertBean(reqJson, FloorDto.class));
+
+        if (total < 1) {
+            throw new IllegalArgumentException("传入小区楼ID不是该小区的楼");
+        }*/
+
+    }
+
+
+    @Override
+    public int getOrder() {
+        return DEFAULT_ORDER;
+    }
+
+    public IFloorInnerServiceSMO getFloorInnerServiceSMOImpl() {
+        return floorInnerServiceSMOImpl;
+    }
+
+    public void setFloorInnerServiceSMOImpl(IFloorInnerServiceSMO floorInnerServiceSMOImpl) {
+        this.floorInnerServiceSMOImpl = floorInnerServiceSMOImpl;
+    }
+
+    public IRoomInnerServiceSMO getRoomInnerServiceSMOImpl() {
+        return roomInnerServiceSMOImpl;
+    }
+
+    public void setRoomInnerServiceSMOImpl(IRoomInnerServiceSMO roomInnerServiceSMOImpl) {
+        this.roomInnerServiceSMOImpl = roomInnerServiceSMOImpl;
+    }
+}

+ 18 - 0
CommunityService/src/main/java/com/java110/community/dao/IRoomServiceDao.java

@@ -88,6 +88,14 @@ public interface IRoomServiceDao {
      */
     int queryRoomsWithOutSellByCommunityIdCount(Map info);
 
+    /**
+     * 查询小区房屋(未销售)总数
+     *
+     * @param info 小区房屋信息
+     * @return 小区房屋数量
+     */
+    int queryRoomsWithSellByCommunityIdCount(Map info);
+
 
     /**
      * 查询小区房屋信息
@@ -118,4 +126,14 @@ public interface IRoomServiceDao {
      */
     List<Map> getRoomInfoWithOutSellByCommunityId(Map info);
 
+
+    /**
+     * 查询小区房屋信息
+     * 根据bId 查询小区房屋信息
+     *
+     * @param info bId 信息
+     * @return 小区房屋信息
+     */
+    List<Map> getRoomInfoWithSellByCommunityId(Map info);
+
 }

+ 22 - 0
CommunityService/src/main/java/com/java110/community/dao/impl/RoomServiceDaoImpl.java

@@ -154,6 +154,18 @@ public class RoomServiceDaoImpl extends BaseServiceDao implements IRoomServiceDa
         return Integer.parseInt(businessRoomInfos.get(0).get("count").toString());
     }
 
+    @Override
+    public int queryRoomsWithSellByCommunityIdCount(Map info) {
+        logger.debug("查询小区房屋数据 入参 info : {}", info);
+
+        List<Map> businessRoomInfos = sqlSessionTemplate.selectList("roomServiceDaoImpl.queryRoomsWithSellByCommunityIdCount", info);
+        if (businessRoomInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessRoomInfos.get(0).get("count").toString());
+    }
+
     @Override
     public List<Map> getRoomInfoByCommunityId(Map info) {
         logger.debug("查询小区房屋信息 入参 info : {}", info);
@@ -182,5 +194,15 @@ public class RoomServiceDaoImpl extends BaseServiceDao implements IRoomServiceDa
     }
 
 
+    @Override
+    public List<Map> getRoomInfoWithSellByCommunityId(Map info) {
+        logger.debug("查询小区房屋信息 入参 info : {}", info);
+
+        List<Map> businessRoomInfos = sqlSessionTemplate.selectList("roomServiceDaoImpl.getRoomInfoWithSellByCommunityId", info);
+
+        return businessRoomInfos;
+    }
+
+
 
 }

+ 39 - 0
CommunityService/src/main/java/com/java110/community/smo/impl/RoomInnerServiceSMOImpl.java

@@ -182,6 +182,45 @@ public class RoomInnerServiceSMOImpl extends BaseServiceSMO implements IRoomInne
         return rooms;
     }
 
+    @Override
+    public int queryRoomsWithSellCount(@RequestBody RoomDto roomDto) {
+        return roomServiceDaoImpl.queryRoomsWithSellByCommunityIdCount(BeanConvertUtil.beanCovertMap(roomDto));
+    }
+
+    @Override
+    public List<RoomDto> queryRoomsWithSell(@RequestBody RoomDto roomDto) {
+
+        //校验是否传了 分页信息
+
+        int page = roomDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            roomDto.setPage((page - 1) * roomDto.getRow());
+            roomDto.setRow(page * roomDto.getRow());
+        }
+
+        List<RoomDto> rooms = BeanConvertUtil.covertBeanList(roomServiceDaoImpl.getRoomInfoWithSellByCommunityId(BeanConvertUtil.beanCovertMap(roomDto)), RoomDto.class);
+
+        if (rooms == null || rooms.size() == 0) {
+            return rooms;
+        }
+
+        String[] roomIds = getRoomIds(rooms);
+        Map attrParamInfo = new HashMap();
+        attrParamInfo.put("roomIds", roomIds);
+        attrParamInfo.put("statusCd", StatusConstant.STATUS_CD_VALID);
+        List<RoomAttrDto> roomAttrDtos = BeanConvertUtil.covertBeanList(roomAttrServiceDaoImpl.getRoomAttrInfo(attrParamInfo), RoomAttrDto.class);
+
+        String[] userIds = getUserIds(rooms);
+        //根据 userId 查询用户信息
+        List<UserDto> users = userInnerServiceSMOImpl.getUserInfo(userIds);
+
+        for (RoomDto room : rooms) {
+            refreshRoom(room, users, roomAttrDtos);
+        }
+        return rooms;
+    }
+
     @Override
     public List<RoomDto> queryRoomsByOwner(@RequestBody RoomDto roomDto) {
 

+ 1 - 1
WebService/src/main/java/com/java110/web/components/fee/ViewMainFeeComponent.java

@@ -14,7 +14,7 @@ import org.springframework.stereotype.Component;
  * @Version 1.0
  * add by wuxw 2019/6/1
  **/
-@Component("viewPropertyFeeConfig")
+@Component("viewMainFee")
 public class ViewMainFeeComponent {
 
     @Autowired

+ 5 - 0
WebService/src/main/java/com/java110/web/components/room/SearchRoomComponent.java

@@ -1,6 +1,7 @@
 package com.java110.web.components.room;
 
 
+import com.alibaba.fastjson.JSONObject;
 import com.java110.core.context.IPageData;
 import com.java110.web.smo.IRoomServiceSMO;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -29,6 +30,10 @@ public class SearchRoomComponent {
      * @return ResponseEntity对象
      */
     public ResponseEntity<String> listRoom(IPageData pd) {
+        JSONObject paramIn = JSONObject.parseObject(pd.getReqData());
+        if(paramIn.containsKey("roomFlag") && "1".equals(paramIn.getString("roomFlag"))){
+            return roomServiceSMOImpl.listRoomWithSell(pd);
+        }
         return roomServiceSMOImpl.listRoomWithOutSell(pd);
     }
 

+ 8 - 0
WebService/src/main/java/com/java110/web/smo/IRoomServiceSMO.java

@@ -42,6 +42,14 @@ public interface IRoomServiceSMO {
      */
     ResponseEntity<String> listRoomWithOutSell(IPageData pd);
 
+    /**
+     * 查询 房间信息 已销售的
+     *
+     * @param pd 页面数据封装对象  分页信息 房屋编号 单元信息
+     * @return 返回 ResponseEntity对象包含 http状态 信息 body信息
+     */
+    ResponseEntity<String> listRoomWithSell(IPageData pd);
+
 
     /**
      * 修改房屋信息

+ 31 - 0
WebService/src/main/java/com/java110/web/smo/impl/RoomServiceSMOImpl.java

@@ -152,6 +152,37 @@ public class RoomServiceSMOImpl extends BaseComponentSMO implements IRoomService
         return responseEntity;
     }
 
+    @Override
+    public ResponseEntity<String> listRoomWithSell(IPageData pd) {
+        validateListRoom(pd);
+
+        //校验用户是否有权限
+        super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.PRIVILEGE_ROOM);
+
+        JSONObject paramIn = JSONObject.parseObject(pd.getReqData());
+        String communityId = paramIn.getString("communityId");
+
+
+        ResponseEntity responseEntity = super.getStoreInfo(pd, restTemplate);
+        if (responseEntity.getStatusCode() != HttpStatus.OK) {
+            return responseEntity;
+        }
+        Assert.jsonObjectHaveKey(responseEntity.getBody().toString(), "storeId", "根据用户ID查询商户ID失败,未包含storeId节点");
+        Assert.jsonObjectHaveKey(responseEntity.getBody().toString(), "storeTypeCd", "根据用户ID查询商户类型失败,未包含storeTypeCd节点");
+
+        String storeId = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeId");
+        String storeTypeCd = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeTypeCd");
+        //数据校验是否 商户是否入驻该小区
+        super.checkStoreEnterCommunity(pd, storeId, storeTypeCd, communityId, restTemplate);
+
+        String apiUrl = ServiceConstant.SERVICE_API_URL + "/api/room.queryRoomsWithSell" + mapToUrlParam(paramIn);
+
+        responseEntity = this.callCenterService(restTemplate, pd, "",
+                apiUrl,
+                HttpMethod.GET);
+        return responseEntity;
+    }
+
     @Override
     public ResponseEntity<String> updateRoom(IPageData pd) {
         validateUpdateRoom(pd);

+ 16 - 33
WebService/src/main/resources/components/property-fee/propertyFee.html

@@ -24,7 +24,7 @@
                         </div>
 
                         <div class="col-sm-2">
-                            <button type="button" class="btn btn-primary btn-sm" v-on:click="queryRoomMethod()">
+                            <button type="button" class="btn btn-primary btn-sm" v-on:click="queryFeeDetailMethod()">
                                 <i class="glyphicon glyphicon-search"></i> 马上查询</button>
                         </div>
 
@@ -33,54 +33,37 @@
                     <table class="footable table table-stripped toggle-arrow-tiny" style="margin-top:10px" data-page-size="10">
                         <thead>
                         <tr>
-                            <th>房屋ID</th>
-                            <th data-hide="phone">房屋编号</th>
-                            <th data-hide="phone">单元</th>
-                            <th data-hide="phone">楼层</th>
-                            <th data-hide="phone">房间数</th>
-                            <th data-hide="phone" >户型</th>
-                            <th data-hide="phone">建筑面积</th>
-                            <th data-hide="phone">单价</th>
-                            <th data-hide="phone">房屋状态</th>
-                            <th data-hide="phone">创建员工</th>
-                            <th data-hide="phone">备注</th>
-
+                            <th>缴费ID</th>
+                            <th data-hide="phone">周期</th>
+                            <th data-hide="phone">应收金额</th>
+                            <th data-hide="phone">实收金额</th>
+                            <th data-hide="phone">打折率</th>
+                            <th data-hide="phone" >备注</th>
+                            <th data-hide="phone">缴费时间</th>
                         </tr>
                         </thead>
                         <tbody>
-                        <tr v-for="room in roomInfo.rooms">
-                            <td>
-                                {{room.roomId}}
-                            </td>
-                            <td>
-                                {{room.roomNum}}
-                            </td>
-                            <td>
-                                {{room.unitNum}}
-                            </td>
-                            <td>
-                                {{room.layer}}
-                            </td>
+                        <tr v-for="feeDetail in feeDetailInfo.feeDetails">
                             <td>
-                                {{room.section}}
+                                {{feeDetail.detailId}}
                             </td>
                             <td>
-                                {{room.apartment}}
+                                {{feeDetail.cycles}} 月
                             </td>
                             <td>
-                                {{room.builtUpArea}}
+                                {{feeDetail.receivableAmount}} 元
                             </td>
                             <td>
-                                {{room.unitPrice}}
+                                {{feeDetail.receivedAmount}} 元
                             </td>
                             <td>
-                                {{vc.component.showState(room.state)}}
+                                {{feeDetail.primeRate}}
                             </td>
                             <td>
-                                {{room.userName}}
+                                {{feeDetail.remark}}
                             </td>
                             <td>
-                                {{room.remark}}
+                                {{feeDetail.createTime}}
                             </td>
                         </tr>
                         </tbody>

+ 16 - 90
WebService/src/main/resources/components/property-fee/propertyFee.js

@@ -6,15 +6,11 @@
     var DEFAULT_ROW = 10;
     vc.extends({
         data:{
-            roomUnits:[],
-            roomInfo:{
-                rooms:[],
+            feeDetailInfo:{
+                feeDetails:[],
                 total:0,
                 records:1,
-                floorId:'',
-                unitId:'',
-                state:'',
-                roomNum:''
+                feeId:''
             }
         },
         _initMethod:function(){
@@ -22,17 +18,9 @@
         },
         _initEvent:function(){
             vc.on('propertyFee','listFeeDetail',function(_param){
-                  vc.component.listRoom();
+                  vc.component.listFeeDetail();
             });
-            vc.on('room','loadData',function(_param){
-                vc.component.roomInfo.floorId = _param.floorId;
-                vc.component.roomInfo.unitId = '';
-                vc.component.roomInfo.state = '';
-                vc.component.roomInfo.roomNum = '';
 
-                vc.component.listRoom(DEFAULT_PAGE,DEFAULT_ROW);
-                vc.component.loadUnits(_param.floorId);
-            });
             vc.on('pagination','page_event',function(_currentPage){
                 vc.component.listRoom(_currentPage,DEFAULT_ROW);
             });
@@ -41,33 +29,29 @@
             initDate:function(){
                 $(".start_time").datetimepicker({format: 'yyyy-mm-dd'});
                 $(".end_time").datetimepicker({format: 'yyyy-mm-dd'});
-            }
-            listRoom:function(_page,_row){
+            },
+            listFeeDetail:function(_page,_row){
                 var param = {
                     params:{
                         page:_page,
                         row:_row,
                         communityId:vc.getCurrentCommunity().communityId,
-                        floorId:vc.component.roomInfo.floorId,
-                        unitId:vc.component.roomInfo.unitId,
-                        state:vc.component.roomInfo.state,
-                        roomNum:vc.component.roomInfo.roomNum
-
+                        feeId:vc.component.roomInfo.floorId
                     }
                 }
                //发送get请求
-               vc.http.get('room',
-                            'listRoom',
+               vc.http.get('propertyFee',
+                            'listFeeDetail',
                              param,
                              function(json,res){
-                                var listRoomData =JSON.parse(json);
+                                var listFeeDetailData =JSON.parse(json);
 
-                                vc.component.roomInfo.total = listRoomData.total;
-                                vc.component.roomInfo.records = listRoomData.records;
-                                vc.component.roomInfo.rooms = listRoomData.rooms;
+                                vc.component.feeDetailInfo.total = listFeeDetailData.total;
+                                vc.component.feeDetailInfo.records = listFeeDetailData.records;
+                                vc.component.feeDetailInfo.feeDetails = listFeeDetailData.feeDetails;
 
                                 vc.emit('pagination','init',{
-                                    total:vc.component.roomInfo.records,
+                                    total:vc.component.feeDetailInfo.records,
                                     currentPage:_page
                                 });
                              },function(errInfo,error){
@@ -75,66 +59,8 @@
                              }
                            );
             },
-            _openEditRoomModel:function(_room){
-                _room.floorId = vc.component.roomInfo.floorId;
-                vc.emit('editRoom','openEditRoomModal',_room);
-            },
-            _openDelRoomModel:function(_room){
-                 _room.floorId = vc.component.roomInfo.floorId;
-                 vc.emit('deleteRoom','openRoomModel',_room);
-            },
-            /**
-                根据楼ID加载房屋
-            **/
-            loadUnits:function(_floorId){
-                vc.component.addRoomUnits = [];
-                var param = {
-                    params:{
-                        floorId:_floorId,
-                        communityId:vc.getCurrentCommunity().communityId
-                    }
-                }
-                vc.http.get(
-                    'room',
-                    'loadUnits',
-                     param,
-                     function(json,res){
-                        //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
-                        if(res.status == 200){
-                            var tmpUnits = JSON.parse(json);
-                            vc.component.roomUnits = tmpUnits;
-                            /*if(tmpUnits == null || tmpUnits.length == 0){
-                                return ;
-                            }
-                            for(var unitIndex = 0; unitIndex < tmpUnits.length;unitIndex++){
-                               vc.component.addRoomInfo.units[unitIndex] = tmpUnits[unitIndex];
-                            }*/
-                            return ;
-                        }
-                        vc.message(json);
-                     },
-                     function(errInfo,error){
-                        console.log('请求失败处理');
-
-                        vc.message(errInfo);
-                     });
-            },
-            queryRoomMethod:function(){
-                vc.component.listRoom(DEFAULT_PAGE,DEFAULT_ROW);
-            },
-            showState:function(_state){
-                if(_state == '2001'){
-                    return "房屋已售";
-                }else if(_state == '2002'){
-                    return "房屋未售";
-                }else if(_state == '2003'){
-                    return "已交定金";
-                }
-                else if(_state == '2004'){
-                    return "已出租";
-                }else{
-                    return "未知";
-                }
+            queryFeeDetailMethod:function(){
+                vc.component.listFeeDetail(DEFAULT_PAGE,DEFAULT_ROW);
             }
         }
     });

+ 4 - 2
WebService/src/main/resources/components/search-room/searchRoom.js

@@ -2,7 +2,8 @@
     vc.extends({
         propTypes: {
            emitChooseRoom:vc.propTypes.string,
-           emitLoadData:vc.propTypes.string
+           emitLoadData:vc.propTypes.string,
+           roomFlag:vc.propTypes.string // 如果 1 表示查询售卖房屋 2 表示查询未售卖房屋
         },
         data:{
             searchRoomInfo:{
@@ -36,7 +37,8 @@
                         row:_row,
                         communityId:vc.getCurrentCommunity().communityId,
                         roomNum:_roomNum,
-                        floorNum:vc.component.searchRoomInfo._currentFloorNum
+                        floorNum:vc.component.searchRoomInfo._currentFloorNum,
+                        roomFlag:$props.roomFlag
                     }
                 };
 

+ 1 - 0
WebService/src/main/resources/components/sell-room-select-room/sellRoomSelectRoom.html

@@ -79,5 +79,6 @@
     <vc:create name="searchRoom"
                emitChooseRoom="sellRoomSelectRoom"
                emitLoadData="sellRoomOther"
+               roomFlag="2"
     ></vc:create>
 </div>

+ 2 - 1
WebService/src/main/resources/components/view-main-fee/viewMainFee.html

@@ -88,6 +88,7 @@
     <vc:create name="searchRoom"
                emitChooseRoom="viewMainFee"
                emitLoadData="propertyFee"
+               roomFlag="1"
     ></vc:create>
-    <vc:create name="addRoom"></vc:create>
+    <!--<vc:create name="addRoom"></vc:create>-->
 </div>

+ 19 - 0
java110-core/src/main/java/com/java110/core/smo/room/IRoomInnerServiceSMO.java

@@ -49,6 +49,15 @@ public interface IRoomInnerServiceSMO {
     @RequestMapping(value = "/queryRoomsWithOutSellCount", method = RequestMethod.POST)
     int queryRoomsWithOutSellCount(@RequestBody RoomDto roomDto);
 
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param roomDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryRoomsWithSellCount", method = RequestMethod.POST)
+    int queryRoomsWithSellCount(@RequestBody RoomDto roomDto);
+
     /**
      * <p>查询小区楼信息</p>
      *
@@ -59,6 +68,16 @@ public interface IRoomInnerServiceSMO {
     @RequestMapping(value = "/queryRoomsWithOutSell", method = RequestMethod.POST)
     List<RoomDto> queryRoomsWithOutSell(@RequestBody RoomDto roomDto);
 
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param roomDto 数据对象分享
+     * @return RoomDto 对象数据
+     */
+    @RequestMapping(value = "/queryRoomsWithSell", method = RequestMethod.POST)
+    List<RoomDto> queryRoomsWithSell(@RequestBody RoomDto roomDto);
+
 
     /**
      * <p>根据业主查询房屋信息</p>

+ 142 - 0
java110-db/src/main/resources/mapper/room/RoomServiceDaoImplMapper.xml

@@ -392,6 +392,78 @@ where 1 =1
         )
 
 
+    </select>
+
+    <!-- 查询小区房屋数量 add by wuxw 2018-07-03 -->
+    <select id="queryRoomsWithSellByCommunityIdCount" parameterType="Map" resultType="Map">
+        select
+        count(1) count
+        FROM
+        building_room t,
+        s_community c,
+        s_community_member cm,
+        building_unit u,
+        f_floor f
+        WHERE 1 =1
+        AND t.`unit_id` = u.`unit_id`
+        AND u.`floor_id` = f.`floor_id`
+        AND f.`floor_id` = cm.`member_id`
+        AND cm.`community_id` = c.`community_id`
+        AND cm.`member_type_cd` = '390001200004'
+        AND c.`status_cd` = '0'
+        AND cm.`status_cd` = '0'
+        AND u.`status_cd` = '0'
+        AND f.`status_cd` = '0'
+        AND c.`community_id` = #{communityId}
+        <if test="floorId !=null and floorId != ''">
+            and f.`floor_id`= #{floorId}
+        </if>
+        <if test="unitPrice !=null and unitPrice != ''">
+            and t.unit_price= #{unitPrice}
+        </if>
+        <if test="section !=null and section != ''">
+            and t.section= #{section}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="remark !=null and remark != ''">
+            and t.remark= #{remark}
+        </if>
+        <if test="userId !=null and userId != ''">
+            and t.user_id= #{userId}
+        </if>
+        <if test="roomId !=null and roomId != ''">
+            and t.room_id= #{roomId}
+        </if>
+        <if test="layer !=null and layer != ''">
+            and t.layer= #{layer}
+        </if>
+        <if test="builtUpArea !=null and builtUpArea != ''">
+            and t.built_up_area= #{builtUpArea}
+        </if>
+        <if test="roomNum !=null and roomNum != ''">
+            and t.room_num= #{roomNum}
+        </if>
+        <if test="unitId !=null and unitId != ''">
+            and t.unit_id= #{unitId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="apartment !=null and apartment != ''">
+            and t.apartment= #{apartment}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
+        AND EXISTS(
+        SELECT 1 FROM building_owner_room_rel borr
+        WHERE borr.`status_cd` = '0'
+        AND borr.`room_id` = t.`room_id`
+        )
+
+
     </select>
 
     <!-- 查询小区房屋信息 add by wuxw 2018-07-03 -->
@@ -464,6 +536,76 @@ where 1 =1
 
     </select>
 
+    <!-- 查询小区房屋信息 add by wuxw 2018-07-03 -->
+    <select id="getRoomInfoWithSellByCommunityId" parameterType="Map" resultType="Map">
+        SELECT  t.unit_price,t.unit_price unitPrice,t.section,t.status_cd,t.status_cd statusCd,t.remark,t.user_id,
+        t.user_id userId,t.room_id,t.room_id roomId,t.layer,t.built_up_area,t.built_up_area builtUpArea,t.room_num,
+        t.room_num roomNum,t.unit_id,t.unit_id unitId,t.b_id,t.b_id bId,t.apartment,t.state,u.`unit_num` unitNum
+        FROM building_room t,s_community c,s_community_member cm,building_unit u,f_floor f
+        WHERE 1 =1
+        AND t.`unit_id` = u.`unit_id`
+        AND u.`floor_id` = f.`floor_id`
+        AND f.`floor_id` = cm.`member_id`
+        AND cm.`community_id` = c.`community_id`
+        AND cm.`member_type_cd` = '390001200004'
+        AND c.`status_cd` = '0'
+        AND cm.`status_cd` = '0'
+        AND u.`status_cd` = '0'
+        AND f.`status_cd` = '0'
+        AND c.`community_id` = #{communityId}
+        <if test="floorId !=null and floorId != ''">
+            and f.`floor_id`= #{floorId}
+        </if>
+        <if test="unitPrice !=null and unitPrice != ''">
+            and t.unit_price= #{unitPrice}
+        </if>
+        <if test="section !=null and section != ''">
+            and t.section= #{section}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="remark !=null and remark != ''">
+            and t.remark= #{remark}
+        </if>
+        <if test="userId !=null and userId != ''">
+            and t.user_id= #{userId}
+        </if>
+        <if test="roomId !=null and roomId != ''">
+            and t.room_id= #{roomId}
+        </if>
+        <if test="layer !=null and layer != ''">
+            and t.layer= #{layer}
+        </if>
+        <if test="builtUpArea !=null and builtUpArea != ''">
+            and t.built_up_area= #{builtUpArea}
+        </if>
+        <if test="roomNum !=null and roomNum != ''">
+            and t.room_num= #{roomNum}
+        </if>
+        <if test="unitId !=null and unitId != ''">
+            and t.unit_id= #{unitId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="apartment !=null and apartment != ''">
+            and t.apartment= #{apartment}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
+        AND EXISTS(
+        SELECT 1 FROM building_owner_room_rel borr
+        WHERE borr.`status_cd` = '0'
+        AND borr.`room_id` = t.`room_id`
+        )
+        <if test="page != -1 and page != null">
+            limit #{page},#{row}
+        </if>
+
+    </select>
+
 
     <!-- 查询小区房屋信息 add by wuxw 2018-07-03 -->
     <select id="getRoomInfoByCommunityId" parameterType="Map" resultType="Map">