瀏覽代碼

优化 车位结构图

java110 4 年之前
父節點
當前提交
9b9a527faf

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

@@ -71,6 +71,7 @@ public class OwnerCarDto extends PageDto implements Serializable {
     private String carTypeCd;
     private String carTypeCd;
     private String[] carTypeCds;
     private String[] carTypeCds;
     private String memberId;
     private String memberId;
+    private String unitId;
 
 
 
 
     public String getCarColor() {
     public String getCarColor() {
@@ -361,4 +362,12 @@ public class OwnerCarDto extends PageDto implements Serializable {
     public void setSpaceSate(String spaceSate) {
     public void setSpaceSate(String spaceSate) {
         this.spaceSate = spaceSate;
         this.spaceSate = spaceSate;
     }
     }
+
+    public String getUnitId() {
+        return unitId;
+    }
+
+    public void setUnitId(String unitId) {
+        this.unitId = unitId;
+    }
 }
 }

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

@@ -63,6 +63,30 @@
         order by t.room_num
         order by t.room_num
     </select>
     </select>
 
 
+    <select id="queryCarStructures" parameterType="Map" resultType="Map">
+        select pa.num areaNum,ps.num,t.car_num carNum,br.room_id roomId,br.room_num roomNum,br.section,
+        br.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,
+        (
+        select if (SUM(rof.amount_owed)!='',SUM(rof.amount_owed),0) from report_owe_fee rof where rof.payer_obj_id = t.car_id and rof.payer_obj_type = '6666'
+        ) oweAmount
+        from owner_car t
+        INNER join building_owner bo on t.owner_id = bo.member_id and bo.status_cd = '0'
+        INNER JOIN building_owner_room_rel borr on bo.owner_id = borr.owner_id and borr.status_cd = '0'
+        INNER join building_room br on borr.room_id = br.room_id and br.status_cd = '0'
+        INNER JOIN building_unit bu on br.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 parking_space ps on t.ps_id = ps.ps_id and ps.status_cd = '0'
+        LEFT JOIN parking_area pa on ps.pa_id = pa.pa_id and pa.status_cd = '0'
+        where t.status_cd = '0'
+        and t.community_id = #{communityId}
+        and bu.unit_id = #{unitId}
+        order by t.car_num
+    </select>
+
+
+
+
 
 
     <!-- 查询房屋个数 add by wuxw 2018-07-03 -->
     <!-- 查询房屋个数 add by wuxw 2018-07-03 -->
     <select id="getCarCount" parameterType="com.java110.dto.report.ReportCarDto" resultType="Map">
     <select id="getCarCount" parameterType="com.java110.dto.report.ReportCarDto" resultType="Map">

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

@@ -2,6 +2,7 @@ package com.java110.intf.report;
 
 
 import com.java110.config.feign.FeignConfiguration;
 import com.java110.config.feign.FeignConfiguration;
 import com.java110.dto.RoomDto;
 import com.java110.dto.RoomDto;
+import com.java110.dto.owner.OwnerCarDto;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -31,5 +32,14 @@ public interface IReportCommunityInnerServiceSMO {
     @RequestMapping(value = "/queryRoomStructures", method = RequestMethod.POST)
     @RequestMapping(value = "/queryRoomStructures", method = RequestMethod.POST)
     List<RoomDto> queryRoomStructures(@RequestBody RoomDto roomDto);
     List<RoomDto> queryRoomStructures(@RequestBody RoomDto roomDto);
 
 
+    /**
+     * <p>查询结构化房屋信息</p>
+     *
+     * @param ownerCarDto 数据对象分享
+     * @return ReportOwnerPayFeeDto 对象数据
+     */
+    @RequestMapping(value = "/queryCarStructures", method = RequestMethod.POST)
+    List<OwnerCarDto> queryCarStructures(@RequestBody OwnerCarDto ownerCarDto);
+
 
 
 }
 }

+ 44 - 0
service-report/src/main/java/com/java110/report/cmd/car/ListCarStructureCmd.java

@@ -0,0 +1,44 @@
+package com.java110.report.cmd.car;
+
+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.dto.owner.OwnerCarDto;
+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 = "car.listCarStructure")
+public class ListCarStructureCmd 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 {
+
+        OwnerCarDto carDto = BeanConvertUtil.covertBean(reqJson, OwnerCarDto.class);
+        List<OwnerCarDto> ownerCarDtos = reportCommunityInnerServiceSMOImpl.queryCarStructures(carDto);
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.createResponseEntity(ownerCarDtos));
+    }
+}

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

@@ -61,4 +61,12 @@ public interface IReportCommunityServiceDao {
      * @return
      * @return
      */
      */
     List<Map> queryRoomStructures(Map info);
     List<Map> queryRoomStructures(Map info);
+
+    /**
+     * 查询车位 结构化数据
+     *
+     * @param info
+     * @return
+     */
+    List<Map> queryCarStructures(Map info);
 }
 }

+ 10 - 1
service-report/src/main/java/com/java110/report/dao/impl/ReportCommunityServiceDaoImpl.java

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

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

@@ -4,6 +4,7 @@ package com.java110.report.smo.impl;
 import com.java110.core.base.smo.BaseServiceSMO;
 import com.java110.core.base.smo.BaseServiceSMO;
 import com.java110.dto.PageDto;
 import com.java110.dto.PageDto;
 import com.java110.dto.RoomDto;
 import com.java110.dto.RoomDto;
+import com.java110.dto.owner.OwnerCarDto;
 import com.java110.dto.reportOwnerPayFee.ReportOwnerPayFeeDto;
 import com.java110.dto.reportOwnerPayFee.ReportOwnerPayFeeDto;
 import com.java110.intf.report.IReportCommunityInnerServiceSMO;
 import com.java110.intf.report.IReportCommunityInnerServiceSMO;
 import com.java110.intf.report.IReportOwnerPayFeeInnerServiceSMO;
 import com.java110.intf.report.IReportOwnerPayFeeInnerServiceSMO;
@@ -46,5 +47,13 @@ public class ReportCommunityInnerServiceSMOImpl extends BaseServiceSMO implement
         return roomDtos;
         return roomDtos;
     }
     }
 
 
+    @Override
+    public List<OwnerCarDto> queryCarStructures(OwnerCarDto ownerCarDto) {
+        //校验是否传了 分页信息
+        List<OwnerCarDto> ownerCarDtos = BeanConvertUtil.covertBeanList(reportCommunityServiceDaoImpl.queryCarStructures(BeanConvertUtil.beanCovertMap(ownerCarDto)), OwnerCarDto.class);
+
+        return ownerCarDtos;
+    }
+
 
 
 }
 }