java110 лет назад: 4
Родитель
Сommit
6dbfbe669d

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

@@ -59,6 +59,7 @@ public class RoomDto extends PageDto implements Serializable {
     private String roomSubTypeName;
     private String roomRent;
     private String roomArea;
+    private String oweAmount;
 
     private String state;
     private String[] states;
@@ -381,4 +382,12 @@ public class RoomDto extends PageDto implements Serializable {
     public void setEndTime(Date endTime) {
         this.endTime = endTime;
     }
+
+    public String getOweAmount() {
+        return oweAmount;
+    }
+
+    public void setOweAmount(String oweAmount) {
+        this.oweAmount = oweAmount;
+    }
 }

+ 19 - 0
java110-db/src/main/resources/mapper/report/ReportCommunityServiceDaoImplMapper.xml

@@ -42,6 +42,25 @@
         </if>
     </select>
 
+    <select id="queryRoomStructures" parameterType="Map" resultType="Map">
+        select t.apartment,t.built_up_area builtUpArea,t.community_id communityId,t.create_time createTime,
+        t.fee_coefficient feeCoefficient,t.layer,t.room_id roomId,t.room_num roomNum,t.section,
+        t.state,bu.unit_id unitId,bu.unit_num unitNum,ff.floor_id floorId,ff.floor_num floorNum,
+        bo.age,bo.id_card idCard,bo.link,bo.member_id memberId,bo.`name`,bo.`name` ownerName,bo.owner_id ownerId,t.room_type roomType,
+        t.room_sub_type roomSubType,t.room_rent roomRent,t.room_area roomArea,
+        (
+        select if (SUM(rof.amount_owed)!='',SUM(rof.amount_owed),0) from report_owe_fee rof where rof.payer_obj_id = t.room_id and rof.payer_obj_type = '3333'
+        ) oweAmount
+        from building_room t
+        INNER JOIN building_unit bu on t.unit_id = bu.unit_id and bu.status_cd = '0'
+        inner join f_floor ff on bu.floor_id = ff.floor_id and ff.status_cd = '0'
+        LEFT JOIN building_owner_room_rel borr on t.room_id = borr.room_id and borr.status_cd = '0'
+        left join building_owner bo on borr.owner_id = bo.member_id and bo.status_cd = '0'
+        where t.status_cd = '0'
+        and t.community_id = #{communityId}
+        and bu.unit_id = #{unitId}
+    </select>
+
 
     <!-- 查询房屋个数 add by wuxw 2018-07-03 -->
     <select id="getCarCount" parameterType="com.java110.dto.report.ReportCarDto" resultType="Map">

+ 35 - 0
java110-interface/src/main/java/com/java110/intf/report/IReportCommunityInnerServiceSMO.java

@@ -0,0 +1,35 @@
+package com.java110.intf.report;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.RoomDto;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.util.List;
+
+/**
+ * @ClassName IReportOwnerPayFeeInnerServiceSMO
+ * @Description 业主缴费明细接口类
+ * @Author wuxw
+ * @Date 2019/4/24 9:04
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+@FeignClient(name = "${java110.report-service}", configuration = {FeignConfiguration.class})
+@RequestMapping("/reportCommunityApi")
+public interface IReportCommunityInnerServiceSMO {
+
+
+    /**
+     * <p>查询结构化房屋信息</p>
+     *
+     * @param roomDto 数据对象分享
+     * @return ReportOwnerPayFeeDto 对象数据
+     */
+    @RequestMapping(value = "/queryRoomStructures", method = RequestMethod.POST)
+    List<RoomDto> queryRoomStructures(@RequestBody RoomDto roomDto);
+
+
+}

+ 43 - 0
service-report/src/main/java/com/java110/report/cmd/room/ListRoomStructureCmd.java

@@ -0,0 +1,43 @@
+package com.java110.report.cmd.room;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.AbstractServiceCmdListener;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.dto.RoomDto;
+import com.java110.intf.report.IReportCommunityInnerServiceSMO;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.List;
+
+/*
+     查询房屋结构图
+ */
+@Java110Cmd(serviceCode = "room.listRoomStructure")
+public class ListRoomStructureCmd extends AbstractServiceCmdListener {
+
+    @Autowired
+    private IReportCommunityInnerServiceSMO reportCommunityInnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+
+        Assert.hasKeyAndValue(reqJson, "unitId", "未传入单元信息");
+        Assert.hasKeyAndValue(reqJson, "communityId", "未传入房屋信息");
+
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        RoomDto roomDto = BeanConvertUtil.covertBean(reqJson, RoomDto.class);
+        List<RoomDto> roomDtos = reportCommunityInnerServiceSMOImpl.queryRoomStructures(roomDto);
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.createResponseEntity(roomDtos));
+    }
+}

+ 8 - 1
service-report/src/main/java/com/java110/report/dao/IReportCommunityServiceDao.java

@@ -1,6 +1,5 @@
 package com.java110.report.dao;
 
-import com.java110.dto.community.CommunityDto;
 import com.java110.dto.report.ReportCarDto;
 import com.java110.dto.report.ReportRoomDto;
 
@@ -54,4 +53,12 @@ public interface IReportCommunityServiceDao {
      * @return
      */
     List<Map> getCommunitys(Map communityDto);
+
+    /**
+     * 查询房屋结构化数据
+     *
+     * @param info
+     * @return
+     */
+    List<Map> queryRoomStructures(Map info);
 }

+ 9 - 0
service-report/src/main/java/com/java110/report/dao/impl/ReportCommunityServiceDaoImpl.java

@@ -82,4 +82,13 @@ public class ReportCommunityServiceDaoImpl extends BaseServiceDao implements IRe
 
         return communityDtos;
     }
+
+    @Override
+    public List<Map> queryRoomStructures(Map info) {
+        logger.debug("查询getCommunitys信息 入参 info : {}", JSONObject.toJSONString(info));
+
+        List<Map> communityDtos = sqlSessionTemplate.selectList("reportCommunityServiceDaoImpl.queryRoomStructures", info);
+
+        return communityDtos;
+    }
 }

+ 50 - 0
service-report/src/main/java/com/java110/report/smo/impl/ReportCommunityInnerServiceSMOImpl.java

@@ -0,0 +1,50 @@
+package com.java110.report.smo.impl;
+
+
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.dto.PageDto;
+import com.java110.dto.RoomDto;
+import com.java110.dto.reportOwnerPayFee.ReportOwnerPayFeeDto;
+import com.java110.intf.report.IReportCommunityInnerServiceSMO;
+import com.java110.intf.report.IReportOwnerPayFeeInnerServiceSMO;
+import com.java110.po.reportOwnerPayFee.ReportOwnerPayFeePo;
+import com.java110.report.dao.IReportCommunityServiceDao;
+import com.java110.report.dao.IReportOwnerPayFeeServiceDao;
+import com.java110.utils.util.BeanConvertUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * @ClassName FloorInnerServiceSMOImpl
+ * @Description 业主缴费明细内部服务实现类
+ * @Author wuxw
+ * @Date 2019/4/24 9:20
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+@RestController
+public class ReportCommunityInnerServiceSMOImpl extends BaseServiceSMO implements IReportCommunityInnerServiceSMO {
+
+    @Autowired
+    private IReportOwnerPayFeeServiceDao reportOwnerPayFeeServiceDaoImpl;
+
+    @Autowired
+    private IReportCommunityServiceDao reportCommunityServiceDaoImpl;
+
+
+
+
+    @Override
+    public List<RoomDto> queryRoomStructures(@RequestBody RoomDto roomDto) {
+
+        //校验是否传了 分页信息
+        List<RoomDto> roomDtos = BeanConvertUtil.covertBeanList(reportCommunityServiceDaoImpl.queryRoomStructures(BeanConvertUtil.beanCovertMap(roomDto)), RoomDto.class);
+
+        return roomDtos;
+    }
+
+
+}