Browse Source

fix: 修复不动产房屋管理相关接口错误

weijianghai 10 months ago
parent
commit
ac69a4631d
31 changed files with 3213 additions and 489 deletions
  1. 245 246
      src/main/java/com/example/controller/WzBuildManageDetailsController.java
  2. 189 189
      src/main/java/com/example/controller/WzBuildmanageAvageareaController.java
  3. 3 3
      src/main/java/com/example/controller/WzHouseContracController.java
  4. 3 3
      src/main/java/com/example/controller/WzHouseLeaseInConController.java
  5. 2 2
      src/main/java/com/example/controller/WzHouseUseController.java
  6. 1 1
      src/main/java/com/example/controller/WzScoreRankingController.java
  7. 43 1
      src/main/java/com/example/controller/house/HouseWzBuildManageDetailsController.java
  8. 41 0
      src/main/java/com/example/controller/house/HouseWzBuildmanageAvageareaController.java
  9. 234 5
      src/main/java/com/example/dao/house/HouseBuildingDao.java
  10. 100 0
      src/main/java/com/example/entity/house/BuildingIdleStatPo.java
  11. 57 0
      src/main/java/com/example/entity/house/BuildingOfficeAreaStatPo.java
  12. 128 0
      src/main/java/com/example/entity/house/HouseAgeStatPo.java
  13. 108 0
      src/main/java/com/example/entity/house/HouseBuildingIdleRepairPo.java
  14. 195 0
      src/main/java/com/example/enums/ListBuildingOrderEnum.java
  15. 19 0
      src/main/java/com/example/pojo/bo/BuildingIdleStatBo.java
  16. 19 0
      src/main/java/com/example/pojo/bo/BuildingOfficeAreaStatBo.java
  17. 19 0
      src/main/java/com/example/pojo/bo/HouseAgeStatBo.java
  18. 27 0
      src/main/java/com/example/pojo/bo/ListBuildingBo.java
  19. 17 4
      src/main/java/com/example/pojo/bo/ListBuildingIdleBo.java
  20. 38 0
      src/main/java/com/example/pojo/dto/BuildingIdleStatDto.java
  21. 38 0
      src/main/java/com/example/pojo/dto/BuildingOfficeAreaStatDto.java
  22. 38 0
      src/main/java/com/example/pojo/dto/HouseAgeStatDto.java
  23. 56 0
      src/main/java/com/example/pojo/dto/ListBuildingDto.java
  24. 22 0
      src/main/java/com/example/pojo/dto/ListBuildingIdleDto.java
  25. 51 0
      src/main/java/com/example/pojo/vo/BuildingIdleStatVo.java
  26. 39 0
      src/main/java/com/example/pojo/vo/BuildingOfficeAreaStatVo.java
  27. 66 0
      src/main/java/com/example/pojo/vo/HouseAgeStatVo.java
  28. 67 33
      src/main/java/com/example/pojo/vo/ListBuildingIdleVo.java
  29. 154 0
      src/main/java/com/example/pojo/vo/ListBuildingVo.java
  30. 933 2
      src/main/java/com/example/service/house/HouseWzBuildManageDetailsService.java
  31. 261 0
      src/main/java/com/example/service/house/HouseWzBuildmanageAvageareaService.java

+ 245 - 246
src/main/java/com/example/controller/WzBuildManageDetailsController.java

@@ -16,7 +16,6 @@ import com.example.service.WzHouseMaintenaCostService;
 import com.example.service.WzOtnAreaService;
 import com.example.service.WzStrategyService;
 import com.example.utils.PageMap;
-import com.example.utils.PageUtils;
 import com.example.utils.Query;
 import com.example.utils.R;
 import com.example.utils.excel.ExcelExport;
@@ -57,232 +56,232 @@ public class WzBuildManageDetailsController {
     @Autowired
     private WzHouseMaintenaCostDao wzHouseMaintenaCostDao;
 
-    /**
-     * 房屋管理-->闲置管理看板
-     */
-    @RequestMapping("/list")
-    @IgnoreAuth
-    public R list(@RequestBody PageMap pageMap) {
-
-        List<LeaveUseVo> resultList = wzBuildManageDetailsService.queryLeaveUseList(pageMap.getMap());
-        PageUtils pageUtil = new PageUtils(resultList, 10, 10, 10);
-        return R.ok().put("page", pageUtil);
-    }
-
-    @RequestMapping("/queryHouseYear")
-    @IgnoreAuth
-    public R queryHouseYear(@RequestBody PageMap pageMap) {
-        //查询列表数据
-        Query query = new Query(pageMap);
-
-        int repeatNum = 0;
-        //全省节点
-        HouseYearVo province = new HouseYearVo();
-        province.setCountyName("全省");
-        province.setCounty("全省");
-
-        int aoneNum = 0;
-        int atwoNum = 0;
-        int athrNum = 0;
-        int aforNum = 0;
-        int afivNum = 0;
-        int asixNum = 0;
-
-        List<LeaveUseVo> leaveUseVoList = wzBuildManageDetailsService.queryLeaveUseByEchart(pageMap.getMap());
-        Map<String, List<LeaveUseVo>> map = new HashMap<>();
-        for (LeaveUseVo leaveUseVo : leaveUseVoList) {
-            double avera = leaveUseVo.getBuildingAreaIdelArea() / (leaveUseVo.getBuildingAreaIdelArea() + leaveUseVo.getBuildingAreaRentArea());
-            if (leaveUseVo.getBuildingAreaIdelArea() + leaveUseVo.getBuildingAreaRentArea() == 0) {
-                avera = 0;
-            } else {
-                avera = formatDouble(avera);
-            }
-            leaveUseVo.setAverage(avera);
-            int num = 0;
-            if (leaveUseVo.getBuildingStartyear() == null || leaveUseVo.getBuildingStartyear().equals("")) {
-                num = 0;
-            } else {
-                int year1 = Integer.parseInt(leaveUseVo.getBuildingStartyear());
-                Calendar cal2 = Calendar.getInstance();
-                cal2.setTime(new Date());
-                int year2 = cal2.get(Calendar.YEAR);
-                num = year2 - year1;
-            }
-            leaveUseVo.setHouseYearNum(num);
-
-
-            List<LeaveUseVo> list;
-            if (map.get(leaveUseVo.getCity()) != null) {
-                list = map.get(leaveUseVo.getCity());
-                list.add(leaveUseVo);
-            } else {
-                list = new ArrayList<>();
-                list.add(leaveUseVo);
-            }
-            map.put(leaveUseVo.getCity(), list);
-        }
-        List<HouseYearVo> resultList = new ArrayList<>();
-        List<HouseYearVo> cityList = new ArrayList<>();
-
-        double provinceYearNum = 0;
-        double provinceSize = 0;
-        for (Map.Entry<String, List<LeaveUseVo>> entry : map.entrySet()) {
-
-            double cityYearNum = 0;
-            double citySize = 0;
-
-            List<LeaveUseVo> list = entry.getValue();
-            //对该list相同的县进行统计
-            Map<String, List<LeaveUseVo>> leaveMap = new HashMap<>();
-            for (LeaveUseVo leaveUseVo : list) {
-                if (leaveMap.get(leaveUseVo.getCounty()) != null) {
-                    list = leaveMap.get(leaveUseVo.getCounty());
-                    list.add(leaveUseVo);
-                } else {
-                    list = new ArrayList<>();
-                    list.add(leaveUseVo);
-                }
-                leaveMap.put(leaveUseVo.getCounty(), list);
-            }
-
-            List<HouseYearVo> houseYearVoList = new ArrayList<>();
-            int oneNum = 0;
-            int twoNum = 0;
-            int thrNum = 0;
-            int forNum = 0;
-            int fivNum = 0;
-            int sixNum = 0;
-
-
-            for (Map.Entry<String, List<LeaveUseVo>> entry1 : leaveMap.entrySet()) {
-
-                List<LeaveUseVo> value = entry1.getValue();
-                citySize += value.size();
-                provinceSize += value.size();
-
-                HouseYearVo yearVo = new HouseYearVo();
-                yearVo.setCity(value.get(0).getCity());
-                yearVo.setCityName(value.get(0).getCityName());
-                yearVo.setCounty(value.get(0).getCounty());
-                yearVo.setCountyName(value.get(0).getCountyName());
-                double houseYear = 0;
-
-                String reapStr = "";
-                if (entry1.getKey().equals("市本部")) {
-                    reapStr = "市本部" + repeatNum;
-                    repeatNum++;
-                }
-                if (!reapStr.equals("")) {
-                    yearVo.setCity(reapStr);
-                    yearVo.setCounty(reapStr);
-                    yearVo.setCountyName(reapStr);
-                }
-
-                for (LeaveUseVo leaveUseVo : value) {
-                    houseYear += leaveUseVo.getHouseYearNum();
-                    cityYearNum += leaveUseVo.getHouseYearNum();
-                    provinceYearNum += leaveUseVo.getHouseYearNum();
-                    if(leaveUseVo.getHouseYearNum()==0){
-                        System.out.println();
-                    }
-                    else if (leaveUseVo.getHouseYearNum() < 10) {
-                        oneNum++;
-                        aoneNum++;
-                        yearVo.setOneLevelYear(yearVo.getOneLevelYear() + 1);
-                    } else if (leaveUseVo.getHouseYearNum() > 11 && leaveUseVo.getHouseYearNum() < 21) {
-                        twoNum++;
-                        atwoNum++;
-                        yearVo.setTwoLevelYear(yearVo.getTwoLevelYear() + 1);
-                    } else if (leaveUseVo.getHouseYearNum() > 20 && leaveUseVo.getHouseYearNum() < 31) {
-                        thrNum++;
-                        athrNum++;
-                        yearVo.setThrLevelYear(yearVo.getThrLevelYear() + 1);
-                    } else if (leaveUseVo.getHouseYearNum() > 30 && leaveUseVo.getHouseYearNum() < 41) {
-                        forNum++;
-                        aforNum++;
-                        yearVo.setFouLevelYear(yearVo.getFouLevelYear() + 1);
-                    } else if (leaveUseVo.getHouseYearNum() > 40 && leaveUseVo.getHouseYearNum() < 51) {
-                        fivNum++;
-                        afivNum++;
-                        yearVo.setFivLevelYear(yearVo.getFivLevelYear() + 1);
-                    } else {
-                        sixNum++;
-                        asixNum++;
-                        yearVo.setSixLevelYear(yearVo.getSixLevelYear() + 1);
-                    }
-                }
-                double aveage = houseYear / value.size();
-                yearVo.setAverage(formatDouble1(aveage));
-                houseYearVoList.add(yearVo);
-            }
-
-            List<HouseYearVo> orderCountyList = new ArrayList<>();
-            try {
-                //对countList 进行排序
-                OtnAreaEntity area = otnAreaService.queryObject(list.get(0).getCity());
-                List<OtnAreaEntity> countyAreaList = otnAreaService.getCityOption(area.getId());
-                int i=0;
-                for (OtnAreaEntity otnAreaEntity : countyAreaList) {
-                    for (HouseYearVo wzCity : houseYearVoList) {
-                        if (wzCity.getCounty().contains(otnAreaEntity.getName())) {
-                            i++;
-                            wzCity.setFlag(i%2==0);
-                            orderCountyList.add(wzCity);
-                        }
-                    }
-                }
-            } catch (Exception e) {
-                orderCountyList = houseYearVoList;
-                e.printStackTrace();
-            }
-
-            HouseYearVo parent = new HouseYearVo();
-            parent.setOneLevelYear(oneNum);
-            parent.setTwoLevelYear(twoNum);
-            parent.setThrLevelYear(thrNum);
-            parent.setFouLevelYear(forNum);
-            parent.setFivLevelYear(fivNum);
-            parent.setSixLevelYear(sixNum);
-            parent.setCity(houseYearVoList.get(0).getCity());
-            parent.setCounty(houseYearVoList.get(0).getCity());
-            parent.setCountyName(houseYearVoList.get(0).getCityName());
-            parent.setChildren(orderCountyList);
-            double cityAvage = cityYearNum / citySize;
-            parent.setAverage(formatDouble1(cityAvage));
-
-            cityList.add(parent);
-        }
-
-        //对cityList 进行排序
-        List<OtnAreaEntity> areaList = otnAreaService.getCityOption("018");
-        List<HouseYearVo> orderList = new ArrayList<>();
-        int i=0;
-        for (OtnAreaEntity otnAreaEntity : areaList) {
-            for (HouseYearVo wzCity : cityList) {
-                if (otnAreaEntity.getName().equals(wzCity.getCity())) {
-                    wzCity.setFlag(i%2==0);
-                    orderList.add(wzCity);
-                    i++;
-                }
-            }
-        }
+//    /**
+//     * 房屋管理-->闲置管理看板
+//     */
+//    @RequestMapping("/list")
+//    @IgnoreAuth
+//    public R list(@RequestBody PageMap pageMap) {
+//
+//        List<LeaveUseVo> resultList = wzBuildManageDetailsService.queryLeaveUseList(pageMap.getMap());
+//        PageUtils pageUtil = new PageUtils(resultList, 10, 10, 10);
+//        return R.ok().put("page", pageUtil);
+//    }
 
-        province.setOneLevelYear(aoneNum);
-        province.setTwoLevelYear(atwoNum);
-        province.setThrLevelYear(athrNum);
-        province.setFouLevelYear(aforNum);
-        province.setFivLevelYear(afivNum);
-        province.setSixLevelYear(asixNum);
-        province.setChildren(orderList);
-        double provinceAvage = provinceYearNum / provinceSize;
-        province.setAverage(formatDouble1(provinceAvage));
-        if(orderList.size()>0){
-            resultList.add(province);
-        }
-        int total = wzBuildManageDetailsService.queryTotal(query);
-        PageUtils pageUtil = new PageUtils(resultList, total, query.getLimit(), query.getPage());
-        return R.ok().put("page", pageUtil);
-    }
+//    @RequestMapping("/queryHouseYear")
+//    @IgnoreAuth
+//    public R queryHouseYear(@RequestBody PageMap pageMap) {
+//        //查询列表数据
+//        Query query = new Query(pageMap);
+//
+//        int repeatNum = 0;
+//        //全省节点
+//        HouseYearVo province = new HouseYearVo();
+//        province.setCountyName("全省");
+//        province.setCounty("全省");
+//
+//        int aoneNum = 0;
+//        int atwoNum = 0;
+//        int athrNum = 0;
+//        int aforNum = 0;
+//        int afivNum = 0;
+//        int asixNum = 0;
+//
+//        List<LeaveUseVo> leaveUseVoList = wzBuildManageDetailsService.queryLeaveUseByEchart(pageMap.getMap());
+//        Map<String, List<LeaveUseVo>> map = new HashMap<>();
+//        for (LeaveUseVo leaveUseVo : leaveUseVoList) {
+//            double avera = leaveUseVo.getBuildingAreaIdelArea() / (leaveUseVo.getBuildingAreaIdelArea() + leaveUseVo.getBuildingAreaRentArea());
+//            if (leaveUseVo.getBuildingAreaIdelArea() + leaveUseVo.getBuildingAreaRentArea() == 0) {
+//                avera = 0;
+//            } else {
+//                avera = formatDouble(avera);
+//            }
+//            leaveUseVo.setAverage(avera);
+//            int num = 0;
+//            if (leaveUseVo.getBuildingStartyear() == null || leaveUseVo.getBuildingStartyear().equals("")) {
+//                num = 0;
+//            } else {
+//                int year1 = Integer.parseInt(leaveUseVo.getBuildingStartyear());
+//                Calendar cal2 = Calendar.getInstance();
+//                cal2.setTime(new Date());
+//                int year2 = cal2.get(Calendar.YEAR);
+//                num = year2 - year1;
+//            }
+//            leaveUseVo.setHouseYearNum(num);
+//
+//
+//            List<LeaveUseVo> list;
+//            if (map.get(leaveUseVo.getCity()) != null) {
+//                list = map.get(leaveUseVo.getCity());
+//                list.add(leaveUseVo);
+//            } else {
+//                list = new ArrayList<>();
+//                list.add(leaveUseVo);
+//            }
+//            map.put(leaveUseVo.getCity(), list);
+//        }
+//        List<HouseYearVo> resultList = new ArrayList<>();
+//        List<HouseYearVo> cityList = new ArrayList<>();
+//
+//        double provinceYearNum = 0;
+//        double provinceSize = 0;
+//        for (Map.Entry<String, List<LeaveUseVo>> entry : map.entrySet()) {
+//
+//            double cityYearNum = 0;
+//            double citySize = 0;
+//
+//            List<LeaveUseVo> list = entry.getValue();
+//            //对该list相同的县进行统计
+//            Map<String, List<LeaveUseVo>> leaveMap = new HashMap<>();
+//            for (LeaveUseVo leaveUseVo : list) {
+//                if (leaveMap.get(leaveUseVo.getCounty()) != null) {
+//                    list = leaveMap.get(leaveUseVo.getCounty());
+//                    list.add(leaveUseVo);
+//                } else {
+//                    list = new ArrayList<>();
+//                    list.add(leaveUseVo);
+//                }
+//                leaveMap.put(leaveUseVo.getCounty(), list);
+//            }
+//
+//            List<HouseYearVo> houseYearVoList = new ArrayList<>();
+//            int oneNum = 0;
+//            int twoNum = 0;
+//            int thrNum = 0;
+//            int forNum = 0;
+//            int fivNum = 0;
+//            int sixNum = 0;
+//
+//
+//            for (Map.Entry<String, List<LeaveUseVo>> entry1 : leaveMap.entrySet()) {
+//
+//                List<LeaveUseVo> value = entry1.getValue();
+//                citySize += value.size();
+//                provinceSize += value.size();
+//
+//                HouseYearVo yearVo = new HouseYearVo();
+//                yearVo.setCity(value.get(0).getCity());
+//                yearVo.setCityName(value.get(0).getCityName());
+//                yearVo.setCounty(value.get(0).getCounty());
+//                yearVo.setCountyName(value.get(0).getCountyName());
+//                double houseYear = 0;
+//
+//                String reapStr = "";
+//                if (entry1.getKey().equals("市本部")) {
+//                    reapStr = "市本部" + repeatNum;
+//                    repeatNum++;
+//                }
+//                if (!reapStr.equals("")) {
+//                    yearVo.setCity(reapStr);
+//                    yearVo.setCounty(reapStr);
+//                    yearVo.setCountyName(reapStr);
+//                }
+//
+//                for (LeaveUseVo leaveUseVo : value) {
+//                    houseYear += leaveUseVo.getHouseYearNum();
+//                    cityYearNum += leaveUseVo.getHouseYearNum();
+//                    provinceYearNum += leaveUseVo.getHouseYearNum();
+//                    if(leaveUseVo.getHouseYearNum()==0){
+//                        System.out.println();
+//                    }
+//                    else if (leaveUseVo.getHouseYearNum() < 10) {
+//                        oneNum++;
+//                        aoneNum++;
+//                        yearVo.setOneLevelYear(yearVo.getOneLevelYear() + 1);
+//                    } else if (leaveUseVo.getHouseYearNum() > 11 && leaveUseVo.getHouseYearNum() < 21) {
+//                        twoNum++;
+//                        atwoNum++;
+//                        yearVo.setTwoLevelYear(yearVo.getTwoLevelYear() + 1);
+//                    } else if (leaveUseVo.getHouseYearNum() > 20 && leaveUseVo.getHouseYearNum() < 31) {
+//                        thrNum++;
+//                        athrNum++;
+//                        yearVo.setThrLevelYear(yearVo.getThrLevelYear() + 1);
+//                    } else if (leaveUseVo.getHouseYearNum() > 30 && leaveUseVo.getHouseYearNum() < 41) {
+//                        forNum++;
+//                        aforNum++;
+//                        yearVo.setFouLevelYear(yearVo.getFouLevelYear() + 1);
+//                    } else if (leaveUseVo.getHouseYearNum() > 40 && leaveUseVo.getHouseYearNum() < 51) {
+//                        fivNum++;
+//                        afivNum++;
+//                        yearVo.setFivLevelYear(yearVo.getFivLevelYear() + 1);
+//                    } else {
+//                        sixNum++;
+//                        asixNum++;
+//                        yearVo.setSixLevelYear(yearVo.getSixLevelYear() + 1);
+//                    }
+//                }
+//                double aveage = houseYear / value.size();
+//                yearVo.setAverage(formatDouble1(aveage));
+//                houseYearVoList.add(yearVo);
+//            }
+//
+//            List<HouseYearVo> orderCountyList = new ArrayList<>();
+//            try {
+//                //对countList 进行排序
+//                OtnAreaEntity area = otnAreaService.queryObject(list.get(0).getCity());
+//                List<OtnAreaEntity> countyAreaList = otnAreaService.getCityOption(area.getId());
+//                int i=0;
+//                for (OtnAreaEntity otnAreaEntity : countyAreaList) {
+//                    for (HouseYearVo wzCity : houseYearVoList) {
+//                        if (wzCity.getCounty().contains(otnAreaEntity.getName())) {
+//                            i++;
+//                            wzCity.setFlag(i%2==0);
+//                            orderCountyList.add(wzCity);
+//                        }
+//                    }
+//                }
+//            } catch (Exception e) {
+//                orderCountyList = houseYearVoList;
+//                e.printStackTrace();
+//            }
+//
+//            HouseYearVo parent = new HouseYearVo();
+//            parent.setOneLevelYear(oneNum);
+//            parent.setTwoLevelYear(twoNum);
+//            parent.setThrLevelYear(thrNum);
+//            parent.setFouLevelYear(forNum);
+//            parent.setFivLevelYear(fivNum);
+//            parent.setSixLevelYear(sixNum);
+//            parent.setCity(houseYearVoList.get(0).getCity());
+//            parent.setCounty(houseYearVoList.get(0).getCity());
+//            parent.setCountyName(houseYearVoList.get(0).getCityName());
+//            parent.setChildren(orderCountyList);
+//            double cityAvage = cityYearNum / citySize;
+//            parent.setAverage(formatDouble1(cityAvage));
+//
+//            cityList.add(parent);
+//        }
+//
+//        //对cityList 进行排序
+//        List<OtnAreaEntity> areaList = otnAreaService.getCityOption("018");
+//        List<HouseYearVo> orderList = new ArrayList<>();
+//        int i=0;
+//        for (OtnAreaEntity otnAreaEntity : areaList) {
+//            for (HouseYearVo wzCity : cityList) {
+//                if (otnAreaEntity.getName().equals(wzCity.getCity())) {
+//                    wzCity.setFlag(i%2==0);
+//                    orderList.add(wzCity);
+//                    i++;
+//                }
+//            }
+//        }
+//
+//        province.setOneLevelYear(aoneNum);
+//        province.setTwoLevelYear(atwoNum);
+//        province.setThrLevelYear(athrNum);
+//        province.setFouLevelYear(aforNum);
+//        province.setFivLevelYear(afivNum);
+//        province.setSixLevelYear(asixNum);
+//        province.setChildren(orderList);
+//        double provinceAvage = provinceYearNum / provinceSize;
+//        province.setAverage(formatDouble1(provinceAvage));
+//        if(orderList.size()>0){
+//            resultList.add(province);
+//        }
+//        int total = wzBuildManageDetailsService.queryTotal(query);
+//        PageUtils pageUtil = new PageUtils(resultList, total, query.getLimit(), query.getPage());
+//        return R.ok().put("page", pageUtil);
+//    }
 
 
 //    /**
@@ -309,21 +308,21 @@ public class WzBuildManageDetailsController {
 //        return R.ok().put("page", pageUtil);
 //    }
 
-    /**
-     * 房产详情
-     */
-    @RequestMapping("/queryHouseDetail")
-    @IgnoreAuth
-    public R queryHouseDetail(@RequestBody PageMap pageMap) {
-        //查询列表数据
-        Query query = new Query(pageMap);
-        List<WzBuildManageDetailsEntity> list = wzBuildManageDetailsService.queryList(query);
-        Query query1 = new Query(pageMap);
-        int total = wzBuildManageDetailsService.queryTotal(query1);
-
-        PageUtils pageUtil = new PageUtils(list, total, query.getLimit(), query.getPage());
-        return R.ok().put("page", pageUtil);
-    }
+//    /**
+//     * 房产记录
+//     */
+//    @RequestMapping("/queryHouseDetail")
+//    @IgnoreAuth
+//    public R queryHouseDetail(@RequestBody PageMap pageMap) {
+//        //查询列表数据
+//        Query query = new Query(pageMap);
+//        List<WzBuildManageDetailsEntity> list = wzBuildManageDetailsService.queryList(query);
+//        Query query1 = new Query(pageMap);
+//        int total = wzBuildManageDetailsService.queryTotal(query1);
+//
+//        PageUtils pageUtil = new PageUtils(list, total, query.getLimit(), query.getPage());
+//        return R.ok().put("page", pageUtil);
+//    }
 
     /**
      * 清单excel
@@ -367,7 +366,7 @@ public class WzBuildManageDetailsController {
 
         DateFormat df = new SimpleDateFormat("yyyyMMdd");
         ExcelExport ee1 ;
-        //判定是闲置管理还是详情
+        //判定是闲置管理还是记录
         if (name.contains("自有房产")) {
             ee1 = new ExcelExport("房屋管理_自有房产人均办公面积" + df.format(new Date()));
             responseTab1(df, ee1, map);
@@ -380,8 +379,8 @@ public class WzBuildManageDetailsController {
             ee1 = new ExcelExport("房屋管理_房龄统计" + df.format(new Date()));
             responseTab3(df, ee1, map);
             ee1.export(response);
-        } else if (name.contains("房产详单")) {
-            ee1 = new ExcelExport("房屋管理_房产详单" + df.format(new Date()));
+        } else if (name.contains("房产记录")) {
+            ee1 = new ExcelExport("房屋管理_房产记录" + df.format(new Date()));
             responseTab4(df, ee1, map);
             ee1.export(response);
         } else if (name.contains("空置")) {
@@ -1319,7 +1318,7 @@ public class WzBuildManageDetailsController {
 //    }
 
     /**
-     * 土地详情
+     * 土地记录
      */
     @RequestMapping("/queryBuildDetailByCode")
     @IgnoreAuth
@@ -1461,7 +1460,7 @@ public class WzBuildManageDetailsController {
 
 
     /**
-     * 土地详情
+     * 土地记录
      */
     @RequestMapping("/queryCityAreaByCode")
     @IgnoreAuth

+ 189 - 189
src/main/java/com/example/controller/WzBuildmanageAvageareaController.java

@@ -1,189 +1,189 @@
-package com.example.controller;
-
-import com.example.config.annotation.IgnoreAuth;
-import com.example.entity.OtnAreaEntity;
-import com.example.entity.vo.housemanager.WzBuildmanageAvageareaVo;
-import com.example.service.WzBuildmanageAvageareaService;
-import com.example.service.WzOtnAreaService;
-import com.example.utils.PageMap;
-import com.example.utils.PageUtils;
-import com.example.utils.Query;
-import com.example.utils.R;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.text.DecimalFormat;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-@Slf4j
-@RestController
-@RequestMapping("/house-car/house/dist/api/WzBuildmanageAvagearea")
-public class WzBuildmanageAvageareaController {
-
-    @Autowired
-    private WzBuildmanageAvageareaService wzBuildmanageAvageareaService;
-    @Autowired
-    private WzOtnAreaService otnAreaService;
-
-    /**
-     * 自有房产人均办公面积-----一个接口整个界面
-     */
-    @RequestMapping("/list")
-    @IgnoreAuth
-    public R list(@RequestBody PageMap pageMap) {
-        //查询列表数据
-        Query query = new Query(pageMap);
-        //全省节点
-        WzBuildmanageAvageareaVo province = new WzBuildmanageAvageareaVo();
-        double pareaNum = 0l;
-        double pallEmp = 0l;
-
-        List<WzBuildmanageAvageareaVo> appointmentRecordList = wzBuildmanageAvageareaService.queryVoList(query);
-        Map<String, List<WzBuildmanageAvageareaVo>> map = new HashMap<>();
-        for (WzBuildmanageAvageareaVo wzBuildmanageAvageareaVo : appointmentRecordList) {
-            double avera = 0;
-            if (wzBuildmanageAvageareaVo.getOfficeArea() != null
-                    && wzBuildmanageAvageareaVo.getEmployees() != null
-                    && !wzBuildmanageAvageareaVo.getEmployees().equals(0d)) {
-                avera = wzBuildmanageAvageareaVo.getOfficeArea() / wzBuildmanageAvageareaVo.getEmployees();
-            }
-            avera = formatDouble(avera);
-            wzBuildmanageAvageareaVo.setAverage(avera);
-            List<WzBuildmanageAvageareaVo> list;
-            if (map.get(wzBuildmanageAvageareaVo.getCity()) != null) {
-                list = map.get(wzBuildmanageAvageareaVo.getCity());
-                list.add(wzBuildmanageAvageareaVo);
-            } else {
-                list = new ArrayList<>();
-                list.add(wzBuildmanageAvageareaVo);
-            }
-            map.put(wzBuildmanageAvageareaVo.getCity(), list);
-            pareaNum += wzBuildmanageAvageareaVo.getOfficeArea();
-            pallEmp += wzBuildmanageAvageareaVo.getEmployees();
-        }
-        pareaNum = formatDouble(pareaNum);
-        double pavera = 0;
-        if (pallEmp != 0) {
-            pavera = formatDouble(pareaNum / pallEmp);
-        }
-        province.setOfficeArea(pareaNum);
-        province.setEmployees(pallEmp);
-        province.setCountyName("全省");
-        province.setCity("全省");
-        province.setAverage(pavera);
-
-        List<WzBuildmanageAvageareaVo> resultList = new ArrayList<>();
-        List<WzBuildmanageAvageareaVo> cityList = new ArrayList<>();
-
-        double allareaNum = 0l;
-        double allEmp = 0l;
-        for (Map.Entry<String, List<WzBuildmanageAvageareaVo>> entry : map.entrySet()) {
-
-            List<WzBuildmanageAvageareaVo> list = entry.getValue();
-            double cityAreaNum=0l;
-            double cityEmp=0l;
-            //县的Map集合
-            Map<String, List<WzBuildmanageAvageareaVo>> countyMap = new HashMap<>();
-            for (WzBuildmanageAvageareaVo leaveUseVo : list) {
-                if (countyMap.get(leaveUseVo.getCounty()) != null) {
-                    list = countyMap.get(leaveUseVo.getCounty());
-                    list.add(leaveUseVo);
-                } else {
-                    list = new ArrayList<>();
-                    list.add(leaveUseVo);
-                }
-                countyMap.put(leaveUseVo.getCounty(), list);
-            }
-
-            List<WzBuildmanageAvageareaVo> countyList = new ArrayList<>();
-            for (Map.Entry<String, List<WzBuildmanageAvageareaVo>> countyEntry : countyMap.entrySet()) {
-                double areaNum=0l;
-                double emp=0l;
-                for (WzBuildmanageAvageareaVo wzBuildmanageAvageareaVo : countyEntry.getValue()) {
-                    areaNum += wzBuildmanageAvageareaVo.getOfficeArea();
-                    emp += wzBuildmanageAvageareaVo.getEmployees();
-                    cityAreaNum += wzBuildmanageAvageareaVo.getOfficeArea();
-                    cityEmp += wzBuildmanageAvageareaVo.getEmployees();
-                    allareaNum += wzBuildmanageAvageareaVo.getOfficeArea();
-                    allEmp += wzBuildmanageAvageareaVo.getEmployees();
-                }
-                WzBuildmanageAvageareaVo countyObject = new WzBuildmanageAvageareaVo();
-                double avera = 0;
-                if (emp != 0) {
-                    avera = areaNum / emp;
-                }
-                avera = formatDouble(avera);
-                countyObject.setOfficeArea(formatDouble(areaNum));
-                countyObject.setEmployees(emp);
-                countyObject.setCity(countyEntry.getValue().get(0).getCounty());
-                countyObject.setCountyName(list.get(0).getCityName());
-                countyObject.setAverage(formatDouble(avera));
-                countyList.add(countyObject);
-            }
-
-            List<WzBuildmanageAvageareaVo> orderCountyList = new ArrayList<>();
-            try {
-                //对countList 进行排序
-                OtnAreaEntity area = otnAreaService.queryObject(list.get(0).getCity());
-                List<OtnAreaEntity> countyAreaList = otnAreaService.getCityOption(area.getId());
-                int i=0;
-                for (OtnAreaEntity otnAreaEntity : countyAreaList) {
-                    for (WzBuildmanageAvageareaVo wzCity : countyList) {
-                        if (wzCity.getCity().equals(otnAreaEntity.getName())) {
-                            i++;
-                            wzCity.setFlag(i%2==0);
-                            orderCountyList.add(wzCity);
-                        }
-                    }
-                }
-            } catch (Exception e) {
-                orderCountyList = countyList;
-                e.printStackTrace();
-            }
-
-            double cityavera = formatDouble(cityAreaNum / cityEmp);
-            WzBuildmanageAvageareaVo cityObject = new WzBuildmanageAvageareaVo();
-            cityObject.setOfficeArea(formatDouble(cityAreaNum));
-            cityObject.setEmployees(cityEmp);
-            cityObject.setCity(list.get(0).getCity());
-            cityObject.setCountyName(list.get(0).getCityName());
-            cityObject.setAverage(formatDouble(cityavera));
-            cityObject.setChildren(orderCountyList);
-            cityList.add(cityObject);
-        }
-        //对cityList 进行排序
-        List<OtnAreaEntity> areaList = otnAreaService.getCityOption("018");
-        List<WzBuildmanageAvageareaVo> orderList = new ArrayList<>();
-        int i=0;
-        for (OtnAreaEntity otnAreaEntity : areaList) {
-            for (WzBuildmanageAvageareaVo wzCity : cityList) {
-                if (wzCity.getCity().equals(otnAreaEntity.getName())) {
-                    wzCity.setFlag(i%2==0);
-                    orderList.add(wzCity);
-                    i++;
-                }
-            }
-        }
-        province.setChildren(orderList);
-        if(orderList.size()>0){
-            resultList.add(province);
-        }
-        int total = wzBuildmanageAvageareaService.queryTotal(query);
-        PageUtils pageUtil = new PageUtils(resultList, total, query.getLimit(), query.getPage());
-        return R.ok().put("page", pageUtil);
-    }
-
-    public double formatDouble(double num) {
-        if (num == 0) return 0;
-        DecimalFormat format2 = new DecimalFormat("#.00");
-        String str2 = format2.format(num);
-        double avera = Double.parseDouble(str2);
-        return avera;
-    }
-}
+//package com.example.controller;
+//
+//import com.example.config.annotation.IgnoreAuth;
+//import com.example.entity.OtnAreaEntity;
+//import com.example.entity.vo.housemanager.WzBuildmanageAvageareaVo;
+//import com.example.service.WzBuildmanageAvageareaService;
+//import com.example.service.WzOtnAreaService;
+//import com.example.utils.PageMap;
+//import com.example.utils.PageUtils;
+//import com.example.utils.Query;
+//import com.example.utils.R;
+//import lombok.extern.slf4j.Slf4j;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.web.bind.annotation.RequestBody;
+//import org.springframework.web.bind.annotation.RequestMapping;
+//import org.springframework.web.bind.annotation.RestController;
+//
+//import java.text.DecimalFormat;
+//import java.util.ArrayList;
+//import java.util.HashMap;
+//import java.util.List;
+//import java.util.Map;
+//
+//@Slf4j
+//@RestController
+//@RequestMapping("/house-car/house/dist/api/WzBuildmanageAvagearea")
+//public class WzBuildmanageAvageareaController {
+//
+//    @Autowired
+//    private WzBuildmanageAvageareaService wzBuildmanageAvageareaService;
+//    @Autowired
+//    private WzOtnAreaService otnAreaService;
+//
+//    /**
+//     * 自有房产人均办公面积-----一个接口整个界面
+//     */
+//    @RequestMapping("/list")
+//    @IgnoreAuth
+//    public R list(@RequestBody PageMap pageMap) {
+//        //查询列表数据
+//        Query query = new Query(pageMap);
+//        //全省节点
+//        WzBuildmanageAvageareaVo province = new WzBuildmanageAvageareaVo();
+//        double pareaNum = 0l;
+//        double pallEmp = 0l;
+//
+//        List<WzBuildmanageAvageareaVo> appointmentRecordList = wzBuildmanageAvageareaService.queryVoList(query);
+//        Map<String, List<WzBuildmanageAvageareaVo>> map = new HashMap<>();
+//        for (WzBuildmanageAvageareaVo wzBuildmanageAvageareaVo : appointmentRecordList) {
+//            double avera = 0;
+//            if (wzBuildmanageAvageareaVo.getOfficeArea() != null
+//                    && wzBuildmanageAvageareaVo.getEmployees() != null
+//                    && !wzBuildmanageAvageareaVo.getEmployees().equals(0d)) {
+//                avera = wzBuildmanageAvageareaVo.getOfficeArea() / wzBuildmanageAvageareaVo.getEmployees();
+//            }
+//            avera = formatDouble(avera);
+//            wzBuildmanageAvageareaVo.setAverage(avera);
+//            List<WzBuildmanageAvageareaVo> list;
+//            if (map.get(wzBuildmanageAvageareaVo.getCity()) != null) {
+//                list = map.get(wzBuildmanageAvageareaVo.getCity());
+//                list.add(wzBuildmanageAvageareaVo);
+//            } else {
+//                list = new ArrayList<>();
+//                list.add(wzBuildmanageAvageareaVo);
+//            }
+//            map.put(wzBuildmanageAvageareaVo.getCity(), list);
+//            pareaNum += wzBuildmanageAvageareaVo.getOfficeArea();
+//            pallEmp += wzBuildmanageAvageareaVo.getEmployees();
+//        }
+//        pareaNum = formatDouble(pareaNum);
+//        double pavera = 0;
+//        if (pallEmp != 0) {
+//            pavera = formatDouble(pareaNum / pallEmp);
+//        }
+//        province.setOfficeArea(pareaNum);
+//        province.setEmployees(pallEmp);
+//        province.setCountyName("全省");
+//        province.setCity("全省");
+//        province.setAverage(pavera);
+//
+//        List<WzBuildmanageAvageareaVo> resultList = new ArrayList<>();
+//        List<WzBuildmanageAvageareaVo> cityList = new ArrayList<>();
+//
+//        double allareaNum = 0l;
+//        double allEmp = 0l;
+//        for (Map.Entry<String, List<WzBuildmanageAvageareaVo>> entry : map.entrySet()) {
+//
+//            List<WzBuildmanageAvageareaVo> list = entry.getValue();
+//            double cityAreaNum=0l;
+//            double cityEmp=0l;
+//            //县的Map集合
+//            Map<String, List<WzBuildmanageAvageareaVo>> countyMap = new HashMap<>();
+//            for (WzBuildmanageAvageareaVo leaveUseVo : list) {
+//                if (countyMap.get(leaveUseVo.getCounty()) != null) {
+//                    list = countyMap.get(leaveUseVo.getCounty());
+//                    list.add(leaveUseVo);
+//                } else {
+//                    list = new ArrayList<>();
+//                    list.add(leaveUseVo);
+//                }
+//                countyMap.put(leaveUseVo.getCounty(), list);
+//            }
+//
+//            List<WzBuildmanageAvageareaVo> countyList = new ArrayList<>();
+//            for (Map.Entry<String, List<WzBuildmanageAvageareaVo>> countyEntry : countyMap.entrySet()) {
+//                double areaNum=0l;
+//                double emp=0l;
+//                for (WzBuildmanageAvageareaVo wzBuildmanageAvageareaVo : countyEntry.getValue()) {
+//                    areaNum += wzBuildmanageAvageareaVo.getOfficeArea();
+//                    emp += wzBuildmanageAvageareaVo.getEmployees();
+//                    cityAreaNum += wzBuildmanageAvageareaVo.getOfficeArea();
+//                    cityEmp += wzBuildmanageAvageareaVo.getEmployees();
+//                    allareaNum += wzBuildmanageAvageareaVo.getOfficeArea();
+//                    allEmp += wzBuildmanageAvageareaVo.getEmployees();
+//                }
+//                WzBuildmanageAvageareaVo countyObject = new WzBuildmanageAvageareaVo();
+//                double avera = 0;
+//                if (emp != 0) {
+//                    avera = areaNum / emp;
+//                }
+//                avera = formatDouble(avera);
+//                countyObject.setOfficeArea(formatDouble(areaNum));
+//                countyObject.setEmployees(emp);
+//                countyObject.setCity(countyEntry.getValue().get(0).getCounty());
+//                countyObject.setCountyName(list.get(0).getCityName());
+//                countyObject.setAverage(formatDouble(avera));
+//                countyList.add(countyObject);
+//            }
+//
+//            List<WzBuildmanageAvageareaVo> orderCountyList = new ArrayList<>();
+//            try {
+//                //对countList 进行排序
+//                OtnAreaEntity area = otnAreaService.queryObject(list.get(0).getCity());
+//                List<OtnAreaEntity> countyAreaList = otnAreaService.getCityOption(area.getId());
+//                int i=0;
+//                for (OtnAreaEntity otnAreaEntity : countyAreaList) {
+//                    for (WzBuildmanageAvageareaVo wzCity : countyList) {
+//                        if (wzCity.getCity().equals(otnAreaEntity.getName())) {
+//                            i++;
+//                            wzCity.setFlag(i%2==0);
+//                            orderCountyList.add(wzCity);
+//                        }
+//                    }
+//                }
+//            } catch (Exception e) {
+//                orderCountyList = countyList;
+//                e.printStackTrace();
+//            }
+//
+//            double cityavera = formatDouble(cityAreaNum / cityEmp);
+//            WzBuildmanageAvageareaVo cityObject = new WzBuildmanageAvageareaVo();
+//            cityObject.setOfficeArea(formatDouble(cityAreaNum));
+//            cityObject.setEmployees(cityEmp);
+//            cityObject.setCity(list.get(0).getCity());
+//            cityObject.setCountyName(list.get(0).getCityName());
+//            cityObject.setAverage(formatDouble(cityavera));
+//            cityObject.setChildren(orderCountyList);
+//            cityList.add(cityObject);
+//        }
+//        //对cityList 进行排序
+//        List<OtnAreaEntity> areaList = otnAreaService.getCityOption("018");
+//        List<WzBuildmanageAvageareaVo> orderList = new ArrayList<>();
+//        int i=0;
+//        for (OtnAreaEntity otnAreaEntity : areaList) {
+//            for (WzBuildmanageAvageareaVo wzCity : cityList) {
+//                if (wzCity.getCity().equals(otnAreaEntity.getName())) {
+//                    wzCity.setFlag(i%2==0);
+//                    orderList.add(wzCity);
+//                    i++;
+//                }
+//            }
+//        }
+//        province.setChildren(orderList);
+//        if(orderList.size()>0){
+//            resultList.add(province);
+//        }
+//        int total = wzBuildmanageAvageareaService.queryTotal(query);
+//        PageUtils pageUtil = new PageUtils(resultList, total, query.getLimit(), query.getPage());
+//        return R.ok().put("page", pageUtil);
+//    }
+//
+//    public double formatDouble(double num) {
+//        if (num == 0) return 0;
+//        DecimalFormat format2 = new DecimalFormat("#.00");
+//        String str2 = format2.format(num);
+//        double avera = Double.parseDouble(str2);
+//        return avera;
+//    }
+//}

+ 3 - 3
src/main/java/com/example/controller/WzHouseContracController.java

@@ -237,7 +237,7 @@ public class WzHouseContracController {
         DateFormat df = new SimpleDateFormat("yyyyMMdd");
         ExcelExport ee1;
 
-        //判定是闲置管理还是详情
+        //判定是闲置管理还是记录
         if(name.contains("合同管理")){
             ee1 = new ExcelExport("房屋对外出租_合同管理" + df.format(new Date()));
             responseTab1(df,ee1,map1);
@@ -254,8 +254,8 @@ public class WzHouseContracController {
             ee1 = new ExcelExport("房屋对外出租_市场调查" + df.format(new Date()));
             responseTab4(df,ee1,map1);
             ee1.export(response);
-        }else if(name.contains("出租合同详单")){
-            ee1 = new ExcelExport("房屋对外出租_出租合同详情" + df.format(new Date()));
+        }else if(name.contains("出租合同记录")){
+            ee1 = new ExcelExport("房屋对外出租_出租合同记录" + df.format(new Date()));
             responseTab5(df,ee1,map1);
             ee1.export(response);
         }

+ 3 - 3
src/main/java/com/example/controller/WzHouseLeaseInConController.java

@@ -282,7 +282,7 @@ public class WzHouseLeaseInConController {
         DateFormat df = new SimpleDateFormat("yyyyMMdd");
         ExcelExport ee1;
 
-        //判定是闲置管理还是详情
+        //判定是闲置管理还是记录
         if(name.contains("合同管理")){
             ee1= new ExcelExport("房屋租入_合同管理" + df.format(new Date()));
             responseTab1(df,ee1,map1);
@@ -299,8 +299,8 @@ public class WzHouseLeaseInConController {
             ee1= new ExcelExport("房屋租入_租入单价与平均单价比较" + df.format(new Date()));
             responseTab4(df,ee1,map1);
             ee1.export(response);
-        }else if(name.contains("租入合同详单")){
-            ee1= new ExcelExport("房屋租入_租入合同详单" + df.format(new Date()));
+        }else if(name.contains("租入合同记录")){
+            ee1= new ExcelExport("房屋租入_租入合同记录" + df.format(new Date()));
             responseTab5(df,ee1,map1);
             ee1.export(response);
         }

+ 2 - 2
src/main/java/com/example/controller/WzHouseUseController.java

@@ -234,11 +234,11 @@ public class WzHouseUseController {
         DateFormat df = new SimpleDateFormat("yyyyMMdd");
         ExcelExport ee1 = new ExcelExport("报表" + df.format(new Date()));
 
-        //判定是闲置管理还是详情
+        //判定是闲置管理还是记录
         if(name.contains("出租合同统计")){
 //            responseTab1(df,ee1,map1);
             ee1.export(response);
-        }else if(name.contains("出租合同详单")){
+        }else if(name.contains("出租合同记录")){
             responseTab2(df,ee1,map1);
             ee1.export(response);
         }

+ 1 - 1
src/main/java/com/example/controller/WzScoreRankingController.java

@@ -161,7 +161,7 @@ public class WzScoreRankingController {
         DateFormat df = new SimpleDateFormat("yyyyMMdd");
         ExcelExport ee1;
 
-        //判定是闲置管理还是详情
+        //判定是闲置管理还是记录
         if(name.contains("综合评价总分排名")){
             ee1 = new ExcelExport("综合评价总分排名" + df.format(new Date()));
             responseTab1(df,ee1,map0,map1,map2);

+ 43 - 1
src/main/java/com/example/controller/house/HouseWzBuildManageDetailsController.java

@@ -2,10 +2,16 @@ package com.example.controller.house;
 
 import com.example.common.PageVo;
 import com.example.common.Rsp;
+import com.example.pojo.dto.BuildingIdleStatDto;
+import com.example.pojo.dto.HouseAgeStatDto;
+import com.example.pojo.dto.ListBuildingDto;
 import com.example.pojo.dto.ListBuildingIdleDto;
 import com.example.pojo.dto.ListSiteNameDto;
 import com.example.pojo.dto.ListSiteNumDto;
+import com.example.pojo.vo.BuildingIdleStatVo;
+import com.example.pojo.vo.HouseAgeStatVo;
 import com.example.pojo.vo.ListBuildingIdleVo;
+import com.example.pojo.vo.ListBuildingVo;
 import com.example.service.house.HouseWzBuildManageDetailsService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
@@ -37,7 +43,7 @@ public class HouseWzBuildManageDetailsController {
 
     @Operation(summary = "空置1000平米以上建筑导出")
     @GetMapping("/ideListExport")
-    public void ideListExport(@Valid ListBuildingIdleDto dto) {
+    public void ideListExport(@Valid ListBuildingIdleDto.ListBuildingIdleMapDTO dto) {
         houseWzBuildManageDetailsService.ideListExport(dto);
     }
 
@@ -52,4 +58,40 @@ public class HouseWzBuildManageDetailsController {
     public Rsp<PageVo<String>> listSiteNum(@RequestBody ListSiteNumDto dto) {
         return houseWzBuildManageDetailsService.listSiteNum(dto);
     }
+
+    @Operation(summary = "查询房产记录")
+    @PostMapping("/queryHouseDetail")
+    public Rsp<PageVo<ListBuildingVo>> listBuilding(@Valid @RequestBody ListBuildingDto dto) {
+        return houseWzBuildManageDetailsService.listBuilding(dto);
+    }
+
+    @Operation(summary = "房产记录导出")
+    @GetMapping("/queryHouseDetailExport")
+    public void listBuildingExport(@Valid ListBuildingDto.ListBuildingMapDTO dto) {
+        houseWzBuildManageDetailsService.listBuildingExport(dto);
+    }
+
+    @Operation(summary = "房龄统计")
+    @PostMapping("/queryHouseYear")
+    public Rsp<PageVo<HouseAgeStatVo>> houseAgeStat(@Valid @RequestBody HouseAgeStatDto dto) {
+        return houseWzBuildManageDetailsService.houseAgeStat(dto);
+    }
+
+    @Operation(summary = "房龄统计导出")
+    @GetMapping("/queryHouseYearExport")
+    public void queryHouseYearExport(@Valid HouseAgeStatDto.HouseAgeStatMapDTO dto) {
+        houseWzBuildManageDetailsService.queryHouseYearExport(dto);
+    }
+
+    @Operation(summary = "闲置管理")
+    @PostMapping("/list")
+    public Rsp<PageVo<BuildingIdleStatVo>> buildingIdleStat(@Valid @RequestBody BuildingIdleStatDto dto) {
+        return houseWzBuildManageDetailsService.buildingIdleStat(dto);
+    }
+
+    @Operation(summary = "闲置管理导出")
+    @GetMapping("/buildingIdleStatExport")
+    public void buildingIdleStatExport(@Valid BuildingIdleStatDto.BuildingIdleStatMapDTO dto) {
+        houseWzBuildManageDetailsService.buildingIdleStatExport(dto);
+    }
 }

+ 41 - 0
src/main/java/com/example/controller/house/HouseWzBuildmanageAvageareaController.java

@@ -0,0 +1,41 @@
+package com.example.controller.house;
+
+import com.example.common.PageVo;
+import com.example.common.Rsp;
+import com.example.pojo.dto.BuildingOfficeAreaStatDto;
+import com.example.pojo.vo.BuildingOfficeAreaStatVo;
+import com.example.service.house.HouseWzBuildmanageAvageareaService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+
+@Tag(name = "自有房产人均办公面积")
+@Slf4j
+@RestController
+@RequestMapping("/house-car/house/dist/api/WzBuildmanageAvagearea")
+public class HouseWzBuildmanageAvageareaController {
+    private final HouseWzBuildmanageAvageareaService houseWzBuildmanageAvageareaService;
+
+    public HouseWzBuildmanageAvageareaController(HouseWzBuildmanageAvageareaService houseWzBuildmanageAvageareaService) {
+        this.houseWzBuildmanageAvageareaService = houseWzBuildmanageAvageareaService;
+    }
+
+    @Operation(summary = "查询自有房产人均办公面积")
+    @PostMapping("/list")
+    public Rsp<PageVo<BuildingOfficeAreaStatVo>> buildingOfficeAreaStat(@Valid @RequestBody BuildingOfficeAreaStatDto dto) {
+        return houseWzBuildmanageAvageareaService.buildingOfficeAreaStat(dto);
+    }
+
+    @Operation(summary = "自有房产人均办公面积导出")
+    @GetMapping("/buildingOfficeAreaStatExport")
+    public void buildingOfficeAreaStatExport(@Valid BuildingOfficeAreaStatDto.BuildingOfficeAreaStatMapDTO dto) {
+        houseWzBuildmanageAvageareaService.buildingOfficeAreaStatExport(dto);
+    }
+}

+ 234 - 5
src/main/java/com/example/dao/house/HouseBuildingDao.java

@@ -1,8 +1,14 @@
 package com.example.dao.house;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.example.entity.house.HouseBuildingHighRepairPo;
+import com.example.entity.house.BuildingIdleStatPo;
+import com.example.entity.house.BuildingOfficeAreaStatPo;
+import com.example.entity.house.HouseAgeStatPo;
 import com.example.entity.house.HouseBuildingPo;
+import com.example.pojo.bo.BuildingIdleStatBo;
+import com.example.pojo.bo.BuildingOfficeAreaStatBo;
+import com.example.pojo.bo.HouseAgeStatBo;
+import com.example.pojo.bo.ListBuildingBo;
 import com.example.pojo.bo.ListBuildingIdleBo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -19,14 +25,13 @@ public interface HouseBuildingDao {
 <script>
 select
 *
-from house.building_month
-where building_area_idle > 1000
+from house.building_idle_strategy
 <choose>
   <when test="dto.yearMonth != null">
-    and year_month = #{dto.yearMonth}
+    where year_month = #{dto.yearMonth}
   </when>
   <otherwise>
-    and year_month = (select max(year_month) from house.building_month)
+    where year_month = (select max(year_month) from house.building_idle_strategy)
   </otherwise>
 </choose>
 <if test="dto.areaNo != null and dto.areaNo != ''">
@@ -35,7 +40,231 @@ where building_area_idle > 1000
 <if test="dto.cityNo != null and dto.cityNo != ''">
   and city_no = #{dto.cityNo}
 </if>
+<if test="dto.siteName != null and dto.siteName != ''">
+  and site_name = #{dto.siteName}
+</if>
+<if test="dto.siteNum != null and dto.siteNum != ''">
+  and site_num = #{dto.siteNum}
+</if>
 </script>
 """)
     List<HouseBuildingPo> listBuildingIdle(Page<HouseBuildingPo> page, @Param("dto") ListBuildingIdleBo dto);
+
+    /**
+     * 查询不动产建筑
+     */
+    @Select("""
+<script>
+select
+*
+from house.building_month
+<choose>
+  <when test="dto.yearMonth != null">
+    where year_month = #{dto.yearMonth}
+  </when>
+  <otherwise>
+    where year_month = (select max(year_month) from house.building_month)
+  </otherwise>
+</choose>
+<if test="dto.areaNo != null and dto.areaNo != ''">
+  and area_no = #{dto.areaNo}
+</if>
+<if test="dto.cityNo != null and dto.cityNo != ''">
+  and city_no = #{dto.cityNo}
+</if>
+<if test="dto.siteName != null and dto.siteName != ''">
+  and site_name = #{dto.siteName}
+</if>
+<if test="dto.siteNum != null and dto.siteNum != ''">
+  and site_num = #{dto.siteNum}
+</if>
+</script>
+""")
+    List<HouseBuildingPo> listBuilding(Page<HouseBuildingPo> page, @Param("dto") ListBuildingBo dto);
+
+    /**
+     * 不动产自有房产房龄统计
+     */
+    @Select("""
+<script>
+with
+t101 as (
+select
+    area_no,
+    city_no,
+    count(house_age <![CDATA[ >= ]]> 0 and house_age <![CDATA[ <= ]]> 10 or null) as a1,
+    count(house_age <![CDATA[ >= ]]> 11 and house_age <![CDATA[ <= ]]> 20 or null) as a2,
+    count(house_age <![CDATA[ >= ]]> 21 and house_age <![CDATA[ <= ]]> 30 or null) as a3,
+    count(house_age <![CDATA[ >= ]]> 31 and house_age <![CDATA[ <= ]]> 40 or null) as a4,
+    count(house_age <![CDATA[ >= ]]> 41 and house_age <![CDATA[ <= ]]> 50 or null) as a5,
+    count(house_age <![CDATA[ > ]]> 50 or null) as a6,
+    count(house_age is null or null) as au,
+    count(house_age) as total,
+    sum(house_age) as house_age_sum,
+    round(avg(house_age),
+    2) as house_age_avg
+from
+    house.building_month
+<choose>
+  <when test="dto.yearMonth != null">
+    where year_month = #{dto.yearMonth}
+  </when>
+  <otherwise>
+    where year_month = (select max(year_month) from house.building_month)
+  </otherwise>
+</choose>
+<if test="dto.areaNo != null and dto.areaNo != ''">
+  and area_no = #{dto.areaNo}
+</if>
+<if test="dto.cityNo != null and dto.cityNo != ''">
+  and city_no = #{dto.cityNo}
+</if>
+group by
+    area_no,
+    city_no
+),
+t102 as (
+select
+    b.id as area_no,
+    b."name" as area_name,
+    a.id as city_no,
+    a."name" as city_name,
+    coalesce(c.a1, 0) as a1,
+    coalesce(c.a2, 0) as a2,
+    coalesce(c.a3, 0) as a3,
+    coalesce(c.a4, 0) as a4,
+    coalesce(c.a5, 0) as a5,
+    coalesce(c.a6, 0) as a6,
+    coalesce(c.au, 0) as au,
+    coalesce(c.total, 0) as total,
+    coalesce(c.house_age_sum, 0) as house_age_sum,
+    c.house_age_avg as house_age_avg
+from
+    common.organization a
+left join common.organization b on
+    a.parent_id = b.id
+left join t101 c on
+    a.id = c.city_no
+where
+    a.grade = 2
+    and a.unhide = 1
+<if test="dto.areaNo != null and dto.areaNo != ''">
+  and a.parent_id = #{dto.areaNo}
+</if>
+<if test="dto.cityNo != null and dto.cityNo != ''">
+  and a.id = #{dto.cityNo}
+</if>
+order by
+    b.order_num,
+    a.order_num
+)
+select
+    *
+from
+    t102
+</script>
+""")
+    List<HouseAgeStatPo> houseAgeStat(@Param("dto") HouseAgeStatBo dto);
+
+    /**
+     * 不动产自有房产闲置统计
+     */
+    @Select("""
+<script>
+with
+t101 as (
+select
+    area_no,
+    city_no,
+    count(building_area_idle <![CDATA[ > ]]> 0 or null) as idle_count,
+    sum(building_area) as building_area_sum,
+    sum(building_area_self_use) as building_area_self_use_sum,
+    sum(building_area_rent) as building_area_rent_sum,
+    sum(building_area_idle) as building_area_idle_sum,
+    case
+        when (sum(building_area_idle) + sum(building_area_rent)) = 0 then null
+        else round(sum(building_area_idle) / (sum(building_area_idle) + sum(building_area_rent)),
+        4)
+    end as idle_percent
+from
+    house.building_month
+<choose>
+  <when test="dto.yearMonth != null">
+    where year_month = #{dto.yearMonth}
+  </when>
+  <otherwise>
+    where year_month = (select max(year_month) from house.building_month)
+  </otherwise>
+</choose>
+<if test="dto.areaNo != null and dto.areaNo != ''">
+  and area_no = #{dto.areaNo}
+</if>
+<if test="dto.cityNo != null and dto.cityNo != ''">
+  and city_no = #{dto.cityNo}
+</if>
+group by
+    area_no,
+    city_no
+),
+t102 as (
+select
+    b.id as area_no,
+    b."name" as area_name,
+    a.id as city_no,
+    a."name" as city_name,
+    coalesce(c.idle_count, 0) as idle_count,
+    coalesce(c.building_area_sum, 0) as building_area_sum,
+    coalesce(c.building_area_self_use_sum, 0) as building_area_self_use_sum,
+    coalesce(c.building_area_rent_sum, 0) as building_area_rent_sum,
+    coalesce(c.building_area_idle_sum, 0) as building_area_idle_sum,
+    c.idle_percent as idle_percent
+from
+    common.organization a
+left join common.organization b on
+    a.parent_id = b.id
+left join t101 c on
+    a.id = c.city_no
+where
+    a.grade = 2
+    and a.unhide = 1
+<if test="dto.areaNo != null and dto.areaNo != ''">
+  and a.parent_id = #{dto.areaNo}
+</if>
+<if test="dto.cityNo != null and dto.cityNo != ''">
+  and a.id = #{dto.cityNo}
+</if>
+order by
+    b.order_num, a.order_num
+)
+select * from t102
+</script>
+""")
+    List<BuildingIdleStatPo> buildingIdleStat(@Param("dto") BuildingIdleStatBo dto);
+
+    /**
+     * 不动产自有房产人均办公面积统计
+     */
+    @Select("""
+<script>
+select * from house.building_office_area_stat
+<choose>
+  <when test="dto.yearMonth != null">
+    where year_month = #{dto.yearMonth}
+  </when>
+  <otherwise>
+    where year_month = (select max(year_month) from house.building_office_area_stat)
+  </otherwise>
+</choose>
+<if test="dto.areaNo != null and dto.areaNo != ''">
+  and area_no = #{dto.areaNo}
+</if>
+<if test="dto.cityNo != null and dto.cityNo != ''">
+  and city_no = #{dto.cityNo}
+</if>
+order by
+    area_order,
+    city_order
+</script>
+""")
+    List<BuildingOfficeAreaStatPo> buildingOfficeAreaStat(@Param("dto") BuildingOfficeAreaStatBo dto);
 }

+ 100 - 0
src/main/java/com/example/entity/house/BuildingIdleStatPo.java

@@ -0,0 +1,100 @@
+package com.example.entity.house;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+public class BuildingIdleStatPo {
+    /**
+     * 二级组织机构编码
+     */
+    private String areaNo;
+    /**
+     * 二级组织机构名称
+     */
+    private String areaName;
+    /**
+     * 三级组织机构编码
+     */
+    private String cityNo;
+    /**
+     * 三级组织机构名称
+     */
+    private String cityName;
+    /**
+     * 闲置建筑数量
+     */
+    private Integer idleCount;
+    /**
+     * 建筑面积
+     */
+    private BigDecimal buildingAreaSum;
+    /**
+     * 建筑面积自用
+     */
+    private BigDecimal buildingAreaSelfUseSum;
+    /**
+     * 建筑面积出租
+     */
+    private BigDecimal buildingAreaRentSum;
+    /**
+     * 建筑面积闲置
+     */
+    private BigDecimal buildingAreaIdleSum;
+    /**
+     * 闲置率
+     */
+    private BigDecimal idlePercent;
+    /**
+     * 子列表
+     */
+    private List<BuildingIdleStatPo> children;
+
+    public BuildingIdleStatPo() {
+        this.areaNo = "";
+        this.areaName = "";
+        this.cityNo = "";
+        this.cityName = "";
+        this.idleCount = 0;
+        this.buildingAreaSum = BigDecimal.ZERO;
+        this.buildingAreaSelfUseSum = BigDecimal.ZERO;
+        this.buildingAreaRentSum = BigDecimal.ZERO;
+        this.buildingAreaIdleSum = BigDecimal.ZERO;
+        this.idlePercent = BigDecimal.ZERO;
+        this.children = new ArrayList<>();
+    }
+
+    public BuildingIdleStatPo(String areaNo, String areaName) {
+        this.areaNo = areaNo;
+        this.areaName = areaName;
+        this.cityNo = areaNo;
+        this.cityName = areaName;
+        this.idleCount = 0;
+        this.buildingAreaSum = BigDecimal.ZERO;
+        this.buildingAreaSelfUseSum = BigDecimal.ZERO;
+        this.buildingAreaRentSum = BigDecimal.ZERO;
+        this.buildingAreaIdleSum = BigDecimal.ZERO;
+        this.idlePercent = BigDecimal.ZERO;
+        this.children = new ArrayList<>();
+    }
+
+    public void update(BuildingIdleStatPo po) {
+        this.idleCount = this.idleCount + po.idleCount;
+        this.buildingAreaSum = this.buildingAreaSum.add(po.buildingAreaSum);
+        this.buildingAreaSelfUseSum = this.buildingAreaSelfUseSum.add(po.buildingAreaSelfUseSum);
+        this.buildingAreaRentSum = this.buildingAreaRentSum.add(po.buildingAreaRentSum);
+        this.buildingAreaIdleSum = this.buildingAreaIdleSum.add(po.buildingAreaIdleSum);
+        if (BigDecimal.ZERO.compareTo(this.buildingAreaRentSum.add(this.buildingAreaIdleSum)) != 0) {
+            this.idlePercent = this.buildingAreaIdleSum
+                    .divide(this.buildingAreaRentSum.add(this.buildingAreaIdleSum), 4, RoundingMode.HALF_DOWN);
+        } else {
+//            this.idlePercent = null;
+            this.idlePercent = BigDecimal.ZERO;
+        }
+        this.children.add(po);
+    }
+}

+ 57 - 0
src/main/java/com/example/entity/house/BuildingOfficeAreaStatPo.java

@@ -0,0 +1,57 @@
+package com.example.entity.house;
+
+import lombok.Data;
+import org.springframework.util.StringUtils;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+public class BuildingOfficeAreaStatPo {
+    private Integer yearMonth;
+    private String areaNo;
+    private String areaName;
+    private String cityNo;
+    private String cityName;
+    private BigDecimal buildingAreaSelfUseSum;
+    private Integer total;
+    private BigDecimal areaAvg;
+    private Integer areaOrder;
+    private Integer cityOrder;
+    private List<BuildingOfficeAreaStatPo> children;
+
+    public BuildingOfficeAreaStatPo() {
+        this.areaNo = "";
+        this.areaName = "";
+        this.cityNo = "";
+        this.cityName = "";
+        this.buildingAreaSelfUseSum = BigDecimal.ZERO;
+        this.total = 0;
+        this.areaAvg = BigDecimal.ZERO;
+        this.children = new ArrayList<>();
+    }
+
+    public BuildingOfficeAreaStatPo(String areaNo, String areaName) {
+        this.areaNo = areaNo;
+        this.areaName = areaName;
+        this.cityNo = areaNo;
+        this.cityName = areaName;
+        this.buildingAreaSelfUseSum = BigDecimal.ZERO;
+        this.total = 0;
+        this.areaAvg = BigDecimal.ZERO;
+        this.children = new ArrayList<>();
+    }
+
+    public void update(BuildingOfficeAreaStatPo po) {
+        this.buildingAreaSelfUseSum = this.buildingAreaSelfUseSum.add(po.getBuildingAreaSelfUseSum());
+        this.total = this.total + po.getTotal();
+        if (total != 0) {
+            this.areaAvg = this.buildingAreaSelfUseSum.divide(new BigDecimal(total), 2, RoundingMode.HALF_DOWN);
+        }
+        if (StringUtils.hasText(po.getCityNo())) {
+            this.children.add(po);
+        }
+    }
+}

+ 128 - 0
src/main/java/com/example/entity/house/HouseAgeStatPo.java

@@ -0,0 +1,128 @@
+package com.example.entity.house;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+public class HouseAgeStatPo {
+    /**
+     * 二级组织机构编码
+     */
+    private String areaNo;
+    /**
+     * 二级组织机构名称
+     */
+    private String areaName;
+    /**
+     * 三级组织机构编码
+     */
+    private String cityNo;
+    /**
+     * 三级组织机构名称
+     */
+    private String cityName;
+    /**
+     * 1-10年
+     */
+    private Integer a1;
+    /**
+     * 11-20年
+     */
+    private Integer a2;
+    /**
+     * 21-30年
+     */
+    private Integer a3;
+    /**
+     * 31-40年
+     */
+    private Integer a4;
+    /**
+     * 41-50年
+     */
+    private Integer a5;
+    /**
+     * 50年以上
+     */
+    private Integer a6;
+    /**
+     * 未知房龄
+     */
+    private Integer au;
+    /**
+     * 建筑数量
+     */
+    private Integer total;
+    /**
+     * 房龄合计
+     */
+    private Integer houseAgeSum;
+    /**
+     * 平均房龄
+     */
+    private BigDecimal houseAgeAvg;
+    /**
+     * 子列表
+     */
+    private List<HouseAgeStatPo> children;
+
+    public HouseAgeStatPo() {
+        this.areaNo = "";
+        this.areaName = "";
+        this.cityNo = "";
+        this.cityName = "";
+        this.a1 = 0;
+        this.a2 = 0;
+        this.a3 = 0;
+        this.a4 = 0;
+        this.a5 = 0;
+        this.a6 = 0;
+        this.au = 0;
+        this.total = 0;
+        this.houseAgeSum = 0;
+        this.houseAgeAvg = BigDecimal.ZERO;
+        this.children = new ArrayList<>();
+    }
+
+    public HouseAgeStatPo(String areaNo, String areaName) {
+        this.areaNo = areaNo;
+        this.areaName = areaName;
+        this.cityNo = areaNo;
+        this.cityName = areaName;
+        this.a1 = 0;
+        this.a2 = 0;
+        this.a3 = 0;
+        this.a4 = 0;
+        this.a5 = 0;
+        this.a6 = 0;
+        this.au = 0;
+        this.total = 0;
+        this.houseAgeSum = 0;
+        this.houseAgeAvg = BigDecimal.ZERO;
+        this.children = new ArrayList<>();
+    }
+
+    public void update(HouseAgeStatPo po) {
+        this.a1 = this.a1 + po.a1;
+        this.a2 = this.a2 + po.a2;
+        this.a3 = this.a3 + po.a3;
+        this.a4 = this.a4 + po.a4;
+        this.a5 = this.a5 + po.a5;
+        this.a6 = this.a6 + po.a6;
+        this.au = this.au + po.au;
+        this.total = this.total + po.total;
+        this.houseAgeSum = this.houseAgeSum + po.houseAgeSum;
+        if (this.total != 0) {
+            this.houseAgeAvg = new BigDecimal(this.houseAgeSum)
+                    .divide(new BigDecimal(this.total), 2, RoundingMode.HALF_DOWN);
+        } else {
+//            this.houseAgeAvg = null;
+            this.houseAgeAvg = BigDecimal.ZERO;
+        }
+        this.children.add(po);
+    }
+}

+ 108 - 0
src/main/java/com/example/entity/house/HouseBuildingIdleRepairPo.java

@@ -0,0 +1,108 @@
+package com.example.entity.house;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class HouseBuildingIdleRepairPo {
+    /**
+     * 账期
+     */
+    private Integer yearMonth;
+
+    /**
+     * 建筑id
+     */
+    private String buildingId;
+
+    /**
+     * 建筑别名
+     */
+    private String buildingName;
+
+    /**
+     * 维修类型
+     */
+    private String repairType;
+
+    /**
+     * 维修内容
+     */
+    private String repairContent;
+
+    /**
+     * 维修金额
+     */
+    private BigDecimal amount;
+
+    /**
+     * 局址id
+     */
+    private String siteId;
+
+    /**
+     * 局址别名
+     */
+    private String siteName;
+
+    /**
+     * 局址编号
+     */
+    private String siteNum;
+
+    /**
+     * 二级组织机构编码
+     */
+    private String areaNo;
+
+    /**
+     * 二级组织机构名称
+     */
+    private String areaName;
+
+    /**
+     * 三级组织机构编码
+     */
+    private String cityNo;
+
+    /**
+     * 三级组织机构名称
+     */
+    private String cityName;
+
+    /**
+     * 标准地址
+     */
+    private String address;
+
+    /**
+     * 使用状态
+     */
+    private String usageStatus;
+
+    /**
+     * 建筑面积
+     */
+    private BigDecimal buildingArea;
+
+    /**
+     * 建筑面积自用
+     */
+    private BigDecimal buildingAreaSelfUse;
+
+    /**
+     * 建筑面积出租
+     */
+    private BigDecimal buildingAreaRent;
+
+    /**
+     * 建筑面积闲置
+     */
+    private BigDecimal buildingAreaIdle;
+
+    /**
+     * 建筑面积不可使用
+     */
+    private BigDecimal buildingAreaUnusable;
+}

+ 195 - 0
src/main/java/com/example/enums/ListBuildingOrderEnum.java

@@ -0,0 +1,195 @@
+package com.example.enums;
+
+public enum ListBuildingOrderEnum {
+    /**
+     * 二级单位
+     */
+    city("area_name"),
+    /**
+     * 三级单位
+     */
+    county("city_name"),
+    /**
+     * 建筑别名
+     */
+    buildingAias("building_name"),
+    /**
+     * 标准地址
+     */
+    standardAddress("address"),
+    /**
+     * 建筑用途
+     */
+    buildingUse("building_use"),
+    /**
+     * 建筑面积
+     */
+    buildingArea("building_area"),
+    /**
+     * 建筑面积自用
+     */
+    buildingAreaUseArea("building_area_self_use"),
+    /**
+     * 建筑面积出租
+     */
+    buildingAreaRentArea("building_area_rent"),
+    /**
+     * 建筑面积闲置
+     */
+    buildingAreaIdelArea("building_area_idle"),
+    /**
+     * 建筑面积不可使用
+     */
+    buildingAreaUnavailable("building_area_unusable"),
+    /**
+     * 一级单位
+     */
+    province("first_unit"),
+    /**
+     * 得房率
+     */
+    buildingRate("housing_acquisition_rate"),
+    /**
+     * 局址别名
+     */
+    parentBuildingName("site_name"),
+    /**
+     * 土地别名
+     */
+    parentLandName("land_name"),
+    /**
+     * 房屋来源
+     */
+    buildingSource("housing_source"),
+    /**
+     * 取得日期
+     */
+    getDate("acquisition_date"),
+    /**
+     * 房龄开始年份
+     */
+    buildingStartYear("house_year_began"),
+    /**
+     * 投资主体
+     */
+    investmentEntity("investor"),
+    /**
+     * 管理层级
+     */
+    managementHierarchy("management_level"),
+    /**
+     * 建筑结构
+     */
+    buildingStructure("building_structure"),
+    /**
+     * 楼层总数
+     */
+    totalNumberOfFloors("total_floors"),
+    /**
+     * 是否临街
+     */
+    buildingFaceStreet("frontage"),
+    /**
+     * 是否有院落
+     */
+    courtyard("courtyard"),
+    /**
+     * 整栋是否独有
+     */
+    wholeBuilding("whole_building"),
+    /**
+     * 是否有房产证
+     */
+    premisesPermit("property_ownership_certificate"),
+    /**
+     * 无房产证原因
+     */
+    noPremisesPermitReason("no_property_ownership_certificate_reason"),
+    /**
+     * 未关联资产
+     */
+    unrelatedAssets("unrelated_assets"),
+    /**
+     * 资产编号
+     */
+    assetCode("assets_num"),
+    /**
+     * 资产标签号
+     */
+    astsLabe("assets_tag_num"),
+    /**
+     * 使用状态
+     */
+    useState("usage_status"),
+    /**
+     * 权属状态
+     */
+    ownershipStatus("ownership_status"),
+    /**
+     * 建筑占地面积(㎡)
+     */
+    buildingFloorArea("floor_area"),
+    /**
+     * 使用面积(㎡)
+     */
+    useArea("usable_area"),
+    /**
+     * 使用面积-自用(㎡)
+     */
+    useAreaSelfUseArea("usable_area_self_use"),
+    /**
+     * 使用面积-出租(㎡)
+     */
+    useAreaRentArea("usable_area_rent"),
+    /**
+     * 使用面积-闲置(㎡)
+     */
+    useAreaIdelArea("usable_area_idle"),
+    /**
+     * 使用面积-不可使用(㎡)
+     */
+    useAreaUnavailableArea("usable_area_unusable"),
+    /**
+     * 楼长姓名
+     */
+    landManageName("community_assistant_name"),
+    /**
+     * 楼长单位
+     */
+    landManageCompany("community_assistant_unit"),
+    /**
+     * 经度集团
+     */
+    buildingLongitude("lng_jt"),
+    /**
+     * 纬度集团
+     */
+    buildingDimension("lat_jt"),
+    /**
+     * 实际产权人
+     */
+    buildingActualPropertyRights("property_owner"),
+    /**
+     * 局址编号
+     */
+    buildingAddressNumber("site_num"),
+    /**
+     * 局址别名
+     */
+    buildingNameAlias("site_name"),
+    /**
+     * 地段
+     */
+    areaSector("area_sector"),
+    ;
+
+    private final String columnName;
+
+    ListBuildingOrderEnum(String columnName) {
+        this.columnName = columnName;
+    }
+
+    public String getColumnName() {
+        return columnName;
+    }
+}

+ 19 - 0
src/main/java/com/example/pojo/bo/BuildingIdleStatBo.java

@@ -0,0 +1,19 @@
+package com.example.pojo.bo;
+
+import lombok.Data;
+
+@Data
+public class BuildingIdleStatBo {
+    /**
+     * 账期
+     */
+    private Integer yearMonth;
+    /**
+     * 二级组织机构编码
+     */
+    private String areaNo;
+    /**
+     * 三级组织机构编码
+     */
+    private String cityNo;
+}

+ 19 - 0
src/main/java/com/example/pojo/bo/BuildingOfficeAreaStatBo.java

@@ -0,0 +1,19 @@
+package com.example.pojo.bo;
+
+import lombok.Data;
+
+@Data
+public class BuildingOfficeAreaStatBo {
+    /**
+     * 账期
+     */
+    private Integer yearMonth;
+    /**
+     * 二级组织机构编码
+     */
+    private String areaNo;
+    /**
+     * 三级组织机构编码
+     */
+    private String cityNo;
+}

+ 19 - 0
src/main/java/com/example/pojo/bo/HouseAgeStatBo.java

@@ -0,0 +1,19 @@
+package com.example.pojo.bo;
+
+import lombok.Data;
+
+@Data
+public class HouseAgeStatBo {
+    /**
+     * 账期
+     */
+    private Integer yearMonth;
+    /**
+     * 二级组织机构编码
+     */
+    private String areaNo;
+    /**
+     * 三级组织机构编码
+     */
+    private String cityNo;
+}

+ 27 - 0
src/main/java/com/example/pojo/bo/ListBuildingBo.java

@@ -0,0 +1,27 @@
+package com.example.pojo.bo;
+
+import lombok.Data;
+
+@Data
+public class ListBuildingBo {
+    /**
+     * 账期
+     */
+    private Integer yearMonth;
+    /**
+     * 二级组织机构编码
+     */
+    private String areaNo;
+    /**
+     * 三级组织机构编码
+     */
+    private String cityNo;
+    /**
+     * 局址编号
+     */
+    private String siteNum;
+    /**
+     * 局址别名
+     */
+    private String siteName;
+}

+ 17 - 4
src/main/java/com/example/pojo/bo/ListBuildingIdleBo.java

@@ -1,14 +1,27 @@
 package com.example.pojo.bo;
 
-import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
 @Data
 public class ListBuildingIdleBo {
-    @Schema(description = "账期", example = "202312")
+    /**
+     * 账期
+     */
     private Integer yearMonth;
-    @Schema(description = "二级组织机构编码")
+    /**
+     * 二级组织机构编码
+     */
     private String areaNo;
-    @Schema(description = "三级组织机构编码")
+    /**
+     * 三级组织机构编码
+     */
     private String cityNo;
+    /**
+     * 局址编号
+     */
+    private String siteNum;
+    /**
+     * 局址别名
+     */
+    private String siteName;
 }

+ 38 - 0
src/main/java/com/example/pojo/dto/BuildingIdleStatDto.java

@@ -0,0 +1,38 @@
+package com.example.pojo.dto;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.springframework.util.StringUtils;
+
+import javax.validation.Valid;
+import java.net.URLDecoder;
+import java.nio.charset.StandardCharsets;
+
+@NoArgsConstructor
+@Data
+public class BuildingIdleStatDto {
+    @Valid
+    private BuildingIdleStatMapDTO map;
+
+    @NoArgsConstructor
+    @Data
+    public static class BuildingIdleStatMapDTO {
+        @Schema(description = "账期", example = "202312")
+        private Integer statisticalMonth;
+        @Schema(description = "二级组织机构id")
+        private String city;
+        @Schema(description = "三级级组织机构id")
+        private String county;
+    }
+
+    public BuildingIdleStatDto(BuildingIdleStatMapDTO map) {
+        if (StringUtils.hasText(map.city)) {
+            map.city = URLDecoder.decode(map.city, StandardCharsets.UTF_8);
+        }
+        if (StringUtils.hasText(map.county)) {
+            map.county = URLDecoder.decode(map.county, StandardCharsets.UTF_8);
+        }
+        this.map = map;
+    }
+}

+ 38 - 0
src/main/java/com/example/pojo/dto/BuildingOfficeAreaStatDto.java

@@ -0,0 +1,38 @@
+package com.example.pojo.dto;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.springframework.util.StringUtils;
+
+import javax.validation.Valid;
+import java.net.URLDecoder;
+import java.nio.charset.StandardCharsets;
+
+@NoArgsConstructor
+@Data
+public class BuildingOfficeAreaStatDto {
+    @Valid
+    private BuildingOfficeAreaStatMapDTO map;
+
+    @NoArgsConstructor
+    @Data
+    public static class BuildingOfficeAreaStatMapDTO {
+        @Schema(description = "账期", example = "202312")
+        private Integer statisticalMonth;
+        @Schema(description = "二级组织机构id")
+        private String city;
+        @Schema(description = "三级级组织机构id")
+        private String county;
+    }
+
+    public BuildingOfficeAreaStatDto(BuildingOfficeAreaStatMapDTO map) {
+        if (StringUtils.hasText(map.city)) {
+            map.city = URLDecoder.decode(map.city, StandardCharsets.UTF_8);
+        }
+        if (StringUtils.hasText(map.county)) {
+            map.county = URLDecoder.decode(map.county, StandardCharsets.UTF_8);
+        }
+        this.map = map;
+    }
+}

+ 38 - 0
src/main/java/com/example/pojo/dto/HouseAgeStatDto.java

@@ -0,0 +1,38 @@
+package com.example.pojo.dto;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.springframework.util.StringUtils;
+
+import javax.validation.Valid;
+import java.net.URLDecoder;
+import java.nio.charset.StandardCharsets;
+
+@NoArgsConstructor
+@Data
+public class HouseAgeStatDto {
+    @Valid
+    private HouseAgeStatMapDTO map;
+
+    @NoArgsConstructor
+    @Data
+    public static class HouseAgeStatMapDTO {
+        @Schema(description = "账期", example = "202312")
+        private Integer statisticalMonth;
+        @Schema(description = "二级组织机构id")
+        private String city;
+        @Schema(description = "三级级组织机构id")
+        private String county;
+    }
+
+    public HouseAgeStatDto(HouseAgeStatMapDTO map) {
+        if (StringUtils.hasText(map.city)) {
+            map.city = URLDecoder.decode(map.city, StandardCharsets.UTF_8);
+        }
+        if (StringUtils.hasText(map.county)) {
+            map.county = URLDecoder.decode(map.county, StandardCharsets.UTF_8);
+        }
+        this.map = map;
+    }
+}

+ 56 - 0
src/main/java/com/example/pojo/dto/ListBuildingDto.java

@@ -0,0 +1,56 @@
+package com.example.pojo.dto;
+
+import com.example.enums.ListBuildingOrderEnum;
+import com.example.enums.OrderEnum;
+import com.example.utils.Page;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.springframework.util.StringUtils;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import java.net.URLDecoder;
+import java.nio.charset.StandardCharsets;
+
+@NoArgsConstructor
+@Data
+public class ListBuildingDto {
+    @Valid
+    @NotNull
+    private Page page;
+    @Valid
+    private ListBuildingMapDTO map;
+
+    @NoArgsConstructor
+    @Data
+    public static class ListBuildingMapDTO {
+        @Schema(description = "账期", example = "202312")
+        private Integer statisticalMonth;
+        @Schema(description = "二级组织机构id")
+        private String city;
+        @Schema(description = "三级级组织机构id")
+        private String county;
+        @Schema(description = "排序字段")
+        private ListBuildingOrderEnum sidx;
+        @Schema(description = "排序方式")
+        private OrderEnum order;
+        @Schema(description = "局址别名")
+        private String buildingNameAlias;
+        @Schema(description = "局址编号")
+        private String buildingAddressNumber;
+    }
+
+    public ListBuildingDto(ListBuildingMapDTO map) {
+        if (StringUtils.hasText(map.city)) {
+            map.city = URLDecoder.decode(map.city, StandardCharsets.UTF_8);
+        }
+        if (StringUtils.hasText(map.county)) {
+            map.county = URLDecoder.decode(map.county, StandardCharsets.UTF_8);
+        }
+        if (StringUtils.hasText(map.buildingNameAlias)) {
+            map.buildingNameAlias = URLDecoder.decode(map.buildingNameAlias, StandardCharsets.UTF_8);
+        }
+        this.map = map;
+    }
+}

+ 22 - 0
src/main/java/com/example/pojo/dto/ListBuildingIdleDto.java

@@ -6,13 +6,18 @@ import com.example.utils.Page;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import lombok.NoArgsConstructor;
+import org.springframework.util.StringUtils;
 
 import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import java.net.URLDecoder;
+import java.nio.charset.StandardCharsets;
 
 @NoArgsConstructor
 @Data
 public class ListBuildingIdleDto {
     @Valid
+    @NotNull
     private Page page;
     @Valid
     private ListBuildingIdleMapDTO map;
@@ -30,5 +35,22 @@ public class ListBuildingIdleDto {
         private ListBuildingIdleOrderEnum sidx;
         @Schema(description = "排序方式")
         private OrderEnum order;
+        @Schema(description = "局址别名")
+        private String buildingNameAlias;
+        @Schema(description = "局址编号")
+        private String buildingAddressNumber;
+    }
+
+    public ListBuildingIdleDto(ListBuildingIdleMapDTO map) {
+        if (StringUtils.hasText(map.city)) {
+            map.city = URLDecoder.decode(map.city, StandardCharsets.UTF_8);
+        }
+        if (StringUtils.hasText(map.county)) {
+            map.county = URLDecoder.decode(map.county, StandardCharsets.UTF_8);
+        }
+        if (StringUtils.hasText(map.buildingNameAlias)) {
+            map.buildingNameAlias = URLDecoder.decode(map.buildingNameAlias, StandardCharsets.UTF_8);
+        }
+        this.map = map;
     }
 }

+ 51 - 0
src/main/java/com/example/pojo/vo/BuildingIdleStatVo.java

@@ -0,0 +1,51 @@
+package com.example.pojo.vo;
+
+import com.example.entity.house.BuildingIdleStatPo;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+public class BuildingIdleStatVo {
+    @Schema(description = "单位名称")
+    private String city;
+    @Schema(description = "闲置数量")
+    private Integer idelNum;
+    @Schema(description = "建筑面积")
+    private BigDecimal buildingArea;
+    @Schema(description = "建筑面积自用")
+    private BigDecimal buildingAreaUseArea;
+    @Schema(description = "建筑面积出租")
+    private BigDecimal buildingAreaRentArea;
+    @Schema(description = "建筑面积闲置")
+    private BigDecimal buildingAreaIdelArea;
+    @Schema(description = "闲置率")
+    private BigDecimal average;
+    @Schema(description = "子列表")
+    private List<BuildingIdleStatVo> children;
+    @Schema(description = "是否变色")
+    private Boolean flag;
+
+    public BuildingIdleStatVo(BuildingIdleStatPo po, Boolean flag) {
+        this.city = po.getCityName();
+        this.idelNum = po.getIdleCount();
+        this.buildingArea = po.getBuildingAreaSum();
+        this.buildingAreaUseArea = po.getBuildingAreaSelfUseSum();
+        this.buildingAreaRentArea = po.getBuildingAreaRentSum();
+        this.buildingAreaIdelArea = po.getBuildingAreaIdleSum();
+        if (po.getIdlePercent() != null) {
+            this.average = po.getIdlePercent().multiply(new BigDecimal("100"));
+        }
+        this.flag = flag;
+        this.children = new ArrayList<>();
+        List<BuildingIdleStatPo> list = po.getChildren();
+        int size = list.size();
+        for (int i = 0; i < size; i++) {
+            BuildingIdleStatPo t = list.get(i);
+            this.children.add(new BuildingIdleStatVo(t, flag == (i % 2 != 0)));
+        }
+    }
+}

+ 39 - 0
src/main/java/com/example/pojo/vo/BuildingOfficeAreaStatVo.java

@@ -0,0 +1,39 @@
+package com.example.pojo.vo;
+
+import com.example.entity.house.BuildingOfficeAreaStatPo;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+public class BuildingOfficeAreaStatVo {
+    @Schema(description = "单位名称")
+    private String city;
+    @Schema(description = "办公面积")
+    private BigDecimal officeArea;
+    @Schema(description = "员工数")
+    private Integer employees;
+    @Schema(description = "人均办公面积")
+    private BigDecimal average;
+    private List<BuildingOfficeAreaStatVo> children;
+    @Schema(description = "是否变色")
+    private Boolean flag;
+
+    public BuildingOfficeAreaStatVo(BuildingOfficeAreaStatPo po, Boolean flag) {
+        this.city = po.getCityName();
+        this.officeArea = po.getBuildingAreaSelfUseSum();
+        this.employees = po.getTotal();
+        this.average = po.getAreaAvg();
+        this.flag = flag;
+        this.children = new ArrayList<>();
+        List<BuildingOfficeAreaStatPo> list = po.getChildren();
+        int size = list.size();
+        for (int i = 0; i < size; i++) {
+            BuildingOfficeAreaStatPo t = list.get(i);
+            this.children.add(new BuildingOfficeAreaStatVo(t, flag == (i % 2 != 0)));
+        }
+    }
+}

+ 66 - 0
src/main/java/com/example/pojo/vo/HouseAgeStatVo.java

@@ -0,0 +1,66 @@
+package com.example.pojo.vo;
+
+import com.example.entity.house.HouseAgeStatPo;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+@NoArgsConstructor
+@Data
+public class HouseAgeStatVo {
+    @Schema(description = "二级单位名称")
+    private String city;
+    @Schema(description = "三级单位名称")
+    private String county;
+    @Schema(description = "1-10年")
+    private Integer oneLevelYear;
+    @Schema(description = "11-20年")
+    private Integer twoLevelYear;
+    @Schema(description = "21-30年")
+    private Integer thrLevelYear;
+    @Schema(description = "31-40年")
+    private Integer fouLevelYear;
+    @Schema(description = "41-50年")
+    private Integer fivLevelYear;
+    @Schema(description = "50年以上")
+    private Integer sixLevelYear;
+    @Schema(description = "平均房龄")
+    private BigDecimal average;
+    @Schema(description = "是否变色")
+    private Boolean flag;
+    @Schema(description = "子列表")
+    private List<HouseAgeStatVo> children;
+    @Schema(description = "未知房龄")
+    private Integer au;
+    @Schema(description = "建筑总数")
+    private Integer total;
+    @Schema(description = "房龄合计")
+    private Integer houseAgeSum;
+
+    public HouseAgeStatVo(HouseAgeStatPo po, Boolean flag) {
+        this.city = po.getAreaName();
+        this.county = po.getCityName();
+        this.oneLevelYear = po.getA1();
+        this.twoLevelYear = po.getA2();
+        this.thrLevelYear = po.getA3();
+        this.fouLevelYear = po.getA4();
+        this.fivLevelYear = po.getA5();
+        this.sixLevelYear = po.getA6();
+        this.average = po.getHouseAgeAvg();
+        this.flag = flag;
+        this.au = po.getAu();
+        this.total = po.getTotal();
+        this.houseAgeSum = po.getHouseAgeSum();
+        this.children = new ArrayList<>();
+        List<HouseAgeStatPo> list = po.getChildren();
+        int size = list.size();
+        for (int i = 0; i < size; i++) {
+            HouseAgeStatPo t = list.get(i);
+            this.children.add(new HouseAgeStatVo(t, flag == (i % 2 != 0)));
+        }
+    }
+}

+ 67 - 33
src/main/java/com/example/pojo/vo/ListBuildingIdleVo.java

@@ -33,39 +33,73 @@ public class ListBuildingIdleVo {
     private String standardAddress;
     @Schema(description = "建筑用途")
     private String buildingUse;
-    private String buildingRate;            //得房率
-    private String parentBuildingName;      //上级局址名称
-    private String parentLandName;          //上级土地名称
-    private String buildingSource;          //房屋来源
-    private String getDate;                 //取得日期
-    private Integer buildingStartYear;       //房龄开始年份
-    private String investmentEntity;        //投资主体
-    private String managementHierarchy;     //管理层级
-    private String buildingStructure;       //房屋结构
-    private String totalNumberOfFloors;     //楼层总数
-    private String buildingFaceStreet;      //是否临街
-    private String courtyard;               //是否有院落
-    private String wholeBuilding;           //整栋是否独有
-    private String premisesPermit;          //是否有房产证
-    private String noPremisesPermitReason;  //无房产证原因
-    private String unrelatedAssets;         //未关联资产
-    private String assetCode;               //资产编号
-    private String astsLabe;                //资产标签号
-    private String useState;                //使用状态
-    private String ownershipStatus;         //权属状态
-    private BigDecimal buildingFloorArea;       //建筑占地面积(㎡)
-    private BigDecimal useArea;                 //使用面积(㎡)
-    private BigDecimal useAreaSelfUseArea;      //使用面积-自用(㎡)
-    private BigDecimal useAreaRentArea;         //使用面积-出租(㎡)
-    private BigDecimal useAreaIdelArea;         //使用面积-闲置(㎡)
-    private BigDecimal useAreaUnavailableArea;  //使用面积-不可使用(㎡)
-    private String landManageName;      //楼长姓名
-    private String landManageCompany;   //楼长所在单位
-    private BigDecimal buildingLongitude;       //房屋经度
-    private BigDecimal buildingDimension;       //房屋纬度
-    private String buildingActualPropertyRights;  //房屋实际产权
-    private String buildingAddressNumber;   //局址编码
-    private String buildingNameAlias;       //局址别名
+    @Schema(description = "得房率")
+    private String buildingRate;
+    @Schema(description = "上级局址名称")
+    private String parentBuildingName;
+    @Schema(description = "上级土地名称")
+    private String parentLandName;
+    @Schema(description = "房屋来源")
+    private String buildingSource;
+    @Schema(description = "取得日期")
+    private String getDate;
+    @Schema(description = "房龄开始年份")
+    private Integer buildingStartYear;
+    @Schema(description = "投资主体")
+    private String investmentEntity;
+    @Schema(description = "管理层级")
+    private String managementHierarchy;
+    @Schema(description = "房屋结构")
+    private String buildingStructure;
+    @Schema(description = "楼层总数")
+    private String totalNumberOfFloors;
+    @Schema(description = "是否临街")
+    private String buildingFaceStreet;
+    @Schema(description = "是否有院落")
+    private String courtyard;
+    @Schema(description = "整栋是否独有")
+    private String wholeBuilding;
+    @Schema(description = "是否有房产证")
+    private String premisesPermit;
+    @Schema(description = "无房产证原因")
+    private String noPremisesPermitReason;
+    @Schema(description = "未关联资产")
+    private String unrelatedAssets;
+    @Schema(description = "资产编号")
+    private String assetCode;
+    @Schema(description = "资产标签号")
+    private String astsLabe;
+    @Schema(description = "使用状态")
+    private String useState;
+    @Schema(description = "权属状态")
+    private String ownershipStatus;
+    @Schema(description = "建筑占地面积(㎡)")
+    private BigDecimal buildingFloorArea;
+    @Schema(description = "使用面积(㎡)")
+    private BigDecimal useArea;
+    @Schema(description = "使用面积-自用(㎡)")
+    private BigDecimal useAreaSelfUseArea;
+    @Schema(description = "使用面积-出租(㎡)")
+    private BigDecimal useAreaRentArea;
+    @Schema(description = "使用面积-闲置(㎡)")
+    private BigDecimal useAreaIdelArea;
+    @Schema(description = "使用面积-不可使用(㎡)")
+    private BigDecimal useAreaUnavailableArea;
+    @Schema(description = "楼长姓名")
+    private String landManageName;
+    @Schema(description = "楼长所在单位")
+    private String landManageCompany;
+    @Schema(description = "房屋经度")
+    private BigDecimal buildingLongitude;
+    @Schema(description = "房屋纬度")
+    private BigDecimal buildingDimension;
+    @Schema(description = "房屋实际产权")
+    private String buildingActualPropertyRights;
+    @Schema(description = "局址编码")
+    private String buildingAddressNumber;
+    @Schema(description = "局址别名")
+    private String buildingNameAlias;
+    @Schema(description = "地段")
     private String areaSector;
 
     public ListBuildingIdleVo(HouseBuildingPo po) {

+ 154 - 0
src/main/java/com/example/pojo/vo/ListBuildingVo.java

@@ -0,0 +1,154 @@
+package com.example.pojo.vo;
+
+import com.example.entity.house.HouseBuildingPo;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.text.DecimalFormat;
+
+@Data
+public class ListBuildingVo {
+    @Schema(description = "账期", example = "202312")
+    private Integer statisticalMonth;
+    @Schema(description = "资产所属单位一级")
+    private String province;
+    @Schema(description = "资产所属单位二级")
+    private String city;
+    @Schema(description = "资产所属单位三级")
+    private String county;
+    @Schema(description = "建筑别名")
+    private String buildingAias;
+    @Schema(description = "建筑面积㎡")
+    private BigDecimal buildingArea;
+    @Schema(description = "建筑面积自用㎡")
+    private BigDecimal buildingAreaUseArea;
+    @Schema(description = "建筑面积出租㎡")
+    private BigDecimal buildingAreaRentArea;
+    @Schema(description = "建筑面积闲置㎡")
+    private BigDecimal buildingAreaIdelArea;
+    @Schema(description = "建筑面积不可使用㎡")
+    private BigDecimal buildingAreaUnavailable;
+    @Schema(description = "标准地址")
+    private String standardAddress;
+    @Schema(description = "建筑用途")
+    private String buildingUse;
+    @Schema(description = "得房率")
+    private String buildingRate;
+    @Schema(description = "上级局址名称")
+    private String parentBuildingName;
+    @Schema(description = "上级土地名称")
+    private String parentLandName;
+    @Schema(description = "房屋来源")
+    private String buildingSource;
+    @Schema(description = "取得日期")
+    private String getDate;
+    @Schema(description = "房龄开始年份")
+    private Integer buildingStartYear;
+    @Schema(description = "投资主体")
+    private String investmentEntity;
+    @Schema(description = "管理层级")
+    private String managementHierarchy;
+    @Schema(description = "房屋结构")
+    private String buildingStructure;
+    @Schema(description = "楼层总数")
+    private String totalNumberOfFloors;
+    @Schema(description = "是否临街")
+    private String buildingFaceStreet;
+    @Schema(description = "是否有院落")
+    private String courtyard;
+    @Schema(description = "整栋是否独有")
+    private String wholeBuilding;
+    @Schema(description = "是否有房产证")
+    private String premisesPermit;
+    @Schema(description = "无房产证原因")
+    private String noPremisesPermitReason;
+    @Schema(description = "未关联资产")
+    private String unrelatedAssets;
+    @Schema(description = "资产编号")
+    private String assetCode;
+    @Schema(description = "资产标签号")
+    private String astsLabe;
+    @Schema(description = "使用状态")
+    private String useState;
+    @Schema(description = "权属状态")
+    private String ownershipStatus;
+    @Schema(description = "建筑占地面积(㎡)")
+    private BigDecimal buildingFloorArea;
+    @Schema(description = "使用面积(㎡)")
+    private BigDecimal useArea;
+    @Schema(description = "使用面积-自用(㎡)")
+    private BigDecimal useAreaSelfUseArea;
+    @Schema(description = "使用面积-出租(㎡)")
+    private BigDecimal useAreaRentArea;
+    @Schema(description = "使用面积-闲置(㎡)")
+    private BigDecimal useAreaIdelArea;
+    @Schema(description = "使用面积-不可使用(㎡)")
+    private BigDecimal useAreaUnavailableArea;
+    @Schema(description = "楼长姓名")
+    private String landManageName;
+    @Schema(description = "楼长所在单位")
+    private String landManageCompany;
+    @Schema(description = "房屋经度")
+    private BigDecimal buildingLongitude;
+    @Schema(description = "房屋纬度")
+    private BigDecimal buildingDimension;
+    @Schema(description = "房屋实际产权")
+    private String buildingActualPropertyRights;
+    @Schema(description = "局址编码")
+    private String buildingAddressNumber;
+    @Schema(description = "局址别名")
+    private String buildingNameAlias;
+    @Schema(description = "地段")
+    private String areaSector;
+
+    public ListBuildingVo(HouseBuildingPo po) {
+        this.statisticalMonth = po.getYearMonth();
+        this.province = po.getFirstUnit();
+        this.city = po.getAreaName();
+        this.county = po.getCityName();
+        this.buildingAias = po.getBuildingName();
+        this.buildingArea = po.getBuildingArea();
+        this.buildingAreaUseArea = po.getBuildingAreaSelfUse();
+        this.buildingAreaRentArea = po.getBuildingAreaRent();
+        this.buildingAreaIdelArea = po.getBuildingAreaIdle();
+        this.buildingAreaUnavailable = po.getBuildingAreaUnusable();
+        this.standardAddress = po.getAddress();
+        this.buildingUse = po.getBuildingUse();
+        this.buildingRate = po.getHousingAcquisitionRate() != null
+                ? new DecimalFormat("#.00%").format(po.getHousingAcquisitionRate()) : null;
+        this.parentBuildingName = po.getSiteName();
+        this.parentLandName = po.getLandName();
+        this.buildingSource = po.getHousingSource();
+        this.getDate = po.getAcquisitionDate();
+        this.buildingStartYear = po.getHouseYearBegan();
+        this.investmentEntity = po.getInvestor();
+        this.managementHierarchy = po.getManagementLevel();
+        this.buildingStructure = po.getBuildingStructure();
+        this.totalNumberOfFloors = po.getTotalFloors();
+        this.buildingFaceStreet = po.getFrontage();
+        this.courtyard = po.getCourtyard();
+        this.wholeBuilding = po.getWholeBuilding();
+        this.premisesPermit = po.getPropertyOwnershipCertificate();
+        this.noPremisesPermitReason = po.getNoPropertyOwnershipCertificateReason();
+        this.unrelatedAssets = po.getUnrelatedAssets();
+        this.assetCode = po.getAssetsNum();
+        this.astsLabe = po.getAssetsTagNum();
+        this.useState = po.getUsageStatus();
+        this.ownershipStatus = po.getOwnershipStatus();
+        this.buildingFloorArea = po.getFloorArea();
+        this.useArea = po.getUsableArea();
+        this.useAreaSelfUseArea = po.getUsableAreaSelfUse();
+        this.useAreaRentArea = po.getUsableAreaRent();
+        this.useAreaIdelArea = po.getUsableAreaIdle();
+        this.useAreaUnavailableArea = po.getUsableAreaUnusable();
+        this.landManageName = po.getCommunityAssistantName();
+        this.landManageCompany = po.getCommunityAssistantUnit();
+        this.buildingLongitude = po.getLngJt();
+        this.buildingDimension = po.getLatJt();
+        this.buildingActualPropertyRights = po.getPropertyOwner();
+        this.buildingAddressNumber = po.getSiteNum();
+        this.buildingNameAlias = po.getSiteName();
+        this.areaSector = po.getAreaSector();
+    }
+}

+ 933 - 2
src/main/java/com/example/service/house/HouseWzBuildManageDetailsService.java

@@ -7,16 +7,28 @@ import com.example.common.PageVo;
 import com.example.common.Rsp;
 import com.example.dao.WzOtnAreaDao;
 import com.example.dao.house.HouseBuildingDao;
+import com.example.entity.house.BuildingIdleStatPo;
+import com.example.entity.house.HouseAgeStatPo;
 import com.example.entity.house.HouseBuildingPo;
 import com.example.entity.house.HouseSitePo;
 import com.example.enums.ListBuildingIdleOrderEnum;
+import com.example.enums.ListBuildingOrderEnum;
 import com.example.enums.OrderEnum;
+import com.example.pojo.bo.BuildingIdleStatBo;
+import com.example.pojo.bo.HouseAgeStatBo;
+import com.example.pojo.bo.ListBuildingBo;
 import com.example.pojo.bo.ListBuildingIdleBo;
 import com.example.pojo.bo.ListHouseSiteBo;
+import com.example.pojo.dto.BuildingIdleStatDto;
+import com.example.pojo.dto.HouseAgeStatDto;
+import com.example.pojo.dto.ListBuildingDto;
 import com.example.pojo.dto.ListBuildingIdleDto;
 import com.example.pojo.dto.ListSiteNameDto;
 import com.example.pojo.dto.ListSiteNumDto;
+import com.example.pojo.vo.BuildingIdleStatVo;
+import com.example.pojo.vo.HouseAgeStatVo;
 import com.example.pojo.vo.ListBuildingIdleVo;
+import com.example.pojo.vo.ListBuildingVo;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.CellStyle;
@@ -27,6 +39,7 @@ import org.apache.poi.ss.usermodel.VerticalAlignment;
 import org.apache.poi.xssf.streaming.SXSSFSheet;
 import org.apache.poi.xssf.streaming.SXSSFWorkbook;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;
 import org.springframework.web.context.request.RequestContextHolder;
 import org.springframework.web.context.request.ServletRequestAttributes;
@@ -35,6 +48,8 @@ import javax.servlet.http.HttpServletResponse;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.stream.Stream;
@@ -61,7 +76,7 @@ public class HouseWzBuildManageDetailsService {
         return Rsp.ok(pageVo);
     }
 
-    public void ideListExport(ListBuildingIdleDto dto) {
+    public void ideListExport(ListBuildingIdleDto.ListBuildingIdleMapDTO dto) {
         ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder
                 .getRequestAttributes();
         if (servletRequestAttributes == null) {
@@ -76,13 +91,16 @@ public class HouseWzBuildManageDetailsService {
         response.setHeader("Content-Disposition", "attachment;filename=" + URLEncodeUtil.encode(filename));
         response.setContentType("application/octet-stream");
         try (SXSSFWorkbook wb = new SXSSFWorkbook()) {
-            writeIdleList(dto, wb);
+            writeIdleList(new ListBuildingIdleDto(dto), wb);
             wb.write(response.getOutputStream());
         } catch (Exception e) {
             log.error(e.getMessage(), e);
         }
     }
 
+    /**
+     * 查询房屋空置
+     */
     private List<HouseBuildingPo> getBuildingIdle(ListBuildingIdleDto dto, Page<HouseBuildingPo> page) {
         ListBuildingIdleBo bo = new ListBuildingIdleBo();
         if (dto.getMap() != null && dto.getMap().getStatisticalMonth() != null) {
@@ -94,6 +112,12 @@ public class HouseWzBuildManageDetailsService {
         if (dto.getMap() != null && StringUtils.hasText(dto.getMap().getCounty())) {
             bo.setCityNo(dto.getMap().getCounty());
         }
+        if (dto.getMap() != null && StringUtils.hasText(dto.getMap().getBuildingAddressNumber())) {
+            bo.setSiteNum(dto.getMap().getBuildingAddressNumber());
+        }
+        if (dto.getMap() != null && StringUtils.hasText(dto.getMap().getBuildingNameAlias())) {
+            bo.setSiteName(dto.getMap().getBuildingNameAlias());
+        }
         if (dto.getMap() != null && dto.getMap().getOrder() != null && dto.getMap().getSidx() != null) {
             if (OrderEnum.asc.equals(dto.getMap().getOrder())) {
                 page.addOrder(OrderItem.asc(dto.getMap().getSidx().getColumnName()));
@@ -410,4 +434,911 @@ public class HouseWzBuildManageDetailsService {
         PageVo<String> pageVo = new PageVo<>(vos, page);
         return Rsp.ok(pageVo);
     }
+
+    public Rsp<PageVo<ListBuildingVo>> listBuilding(ListBuildingDto dto) {
+        Page<HouseBuildingPo> page = new Page<>(dto.getPage().getPageNum(), dto.getPage().getPageSize());
+        List<HouseBuildingPo> list = getBuildingList(dto, page);
+        List<ListBuildingVo> vos = new ArrayList<>();
+        for (HouseBuildingPo po : list) {
+            vos.add(new ListBuildingVo(po));
+        }
+        PageVo<ListBuildingVo> pageVo = new PageVo<>(vos, page);
+        return Rsp.ok(pageVo);
+    }
+
+    /**
+     * 查询不动产建筑
+     */
+    private List<HouseBuildingPo> getBuildingList(ListBuildingDto dto, Page<HouseBuildingPo> page) {
+        ListBuildingBo bo = new ListBuildingBo();
+        if (dto.getMap() != null && dto.getMap().getStatisticalMonth() != null) {
+            bo.setYearMonth(dto.getMap().getStatisticalMonth());
+        }
+        if (dto.getMap() != null && StringUtils.hasText(dto.getMap().getCity()) && !"全省".equals(dto.getMap().getCity())) {
+            bo.setAreaNo(dto.getMap().getCity());
+        }
+        if (dto.getMap() != null && StringUtils.hasText(dto.getMap().getCounty())) {
+            bo.setCityNo(dto.getMap().getCounty());
+        }
+        if (dto.getMap() != null && StringUtils.hasText(dto.getMap().getBuildingAddressNumber())) {
+            bo.setSiteNum(dto.getMap().getBuildingAddressNumber());
+        }
+        if (dto.getMap() != null && StringUtils.hasText(dto.getMap().getBuildingNameAlias())) {
+            bo.setSiteName(dto.getMap().getBuildingNameAlias());
+        }
+        if (dto.getMap() != null && dto.getMap().getOrder() != null && dto.getMap().getSidx() != null) {
+            if (OrderEnum.asc.equals(dto.getMap().getOrder())) {
+                page.addOrder(OrderItem.asc(dto.getMap().getSidx().getColumnName()));
+            } else {
+                page.addOrder(OrderItem.desc(dto.getMap().getSidx().getColumnName()));
+            }
+        } else {
+            page.addOrder(OrderItem.desc(ListBuildingOrderEnum.buildingArea.getColumnName()));
+        }
+        return houseBuildingDao.listBuilding(page, bo);
+    }
+
+    public void listBuildingExport(ListBuildingDto.ListBuildingMapDTO dto) {
+        ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder
+                .getRequestAttributes();
+        if (servletRequestAttributes == null) {
+            return;
+        }
+        HttpServletResponse response = servletRequestAttributes.getResponse();
+        if (response == null) {
+            return;
+        }
+        String filename = "房屋管理_房产记录"
+                + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")) + ".xlsx";
+        response.setHeader("Content-Disposition", "attachment;filename=" + URLEncodeUtil.encode(filename));
+        response.setContentType("application/octet-stream");
+        try (SXSSFWorkbook wb = new SXSSFWorkbook()) {
+            writeListBuilding(new ListBuildingDto(dto), wb);
+            wb.write(response.getOutputStream());
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+        }
+    }
+
+    /**
+     * 写不动产建筑文件
+     */
+    private void writeListBuilding(ListBuildingDto dto, SXSSFWorkbook wb) {
+        Page<HouseBuildingPo> page = new Page<>(1, Long.MAX_VALUE);
+        List<HouseBuildingPo> list = getBuildingList(dto, page);
+        DataFormat dataFormat = wb.createDataFormat();
+        // 数字样式
+        CellStyle numberCellStyle = wb.createCellStyle();
+        numberCellStyle.setDataFormat(dataFormat.getFormat("#,##0.00"));
+        numberCellStyle.setAlignment(HorizontalAlignment.RIGHT);
+        // 默认样式
+        CellStyle baseCellStyle = wb.createCellStyle();
+        baseCellStyle.setAlignment(HorizontalAlignment.CENTER);
+        baseCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
+        // 百分比样式
+        CellStyle percentCellStyle = wb.createCellStyle();
+        percentCellStyle.setDataFormat(dataFormat.getFormat("0.00%"));
+        percentCellStyle.setAlignment(HorizontalAlignment.RIGHT);
+        SXSSFSheet sheet = wb.createSheet();
+        AtomicInteger rowIndex = new AtomicInteger(0);
+        // 表头
+        Row headerRow = sheet.createRow(rowIndex.getAndIncrement());
+        List<String> headers = Stream.of("资产所属单位(一级)", "资产所属单位(二级)", "资产所属单位(三级)", "局址编号",
+                "局址别名", "建筑别名", "地段", "建筑面积(㎡)","建筑面积-出租(㎡)", "建筑面积-闲置(㎡)", "建筑面积-自用(㎡)",
+                "建筑面积-不可使用(㎡)", "上级土地名称", "得房率", "房屋来源", "取得日期", "房龄开始年份", "投资主体", "管理层级",
+                "房屋结构", "楼层总数", "是否临街", "是否有院落", "整栋是否独有", "是否有房产证", "无房产证原因", "未关联资产",
+                "资产编号", "资产标签号", "使用状态", "建筑用途", "权属状态", "建筑占地面积(㎡)", "使用面积(㎡)",
+                "使用面积-自用(㎡)", "使用面积-出租(㎡)", "使用面积-闲置(㎡)", "使用面积-不可使用(㎡)", "楼长姓名",
+                "楼长所在单位", "经度", "纬度", "实际产权人").toList();
+        int headerLength = headers.size();
+        for (int i = 0; i < headerLength; i++) {
+            Cell cell = headerRow.createCell(i);
+            cell.setCellValue(headers.get(i));
+            cell.setCellStyle(baseCellStyle);
+            // 根据内容长度设置列宽
+            int columnWidth = headers.get(i).length() * 256 * 2 + 256;
+            sheet.setColumnWidth(i, columnWidth);
+        }
+        // 数据
+        for (HouseBuildingPo po : list) {
+            AtomicInteger columnIndex = new AtomicInteger(0);
+            Row row = sheet.createRow(rowIndex.getAndIncrement());
+            // 资产所属单位(一级)
+            Cell firstUnitCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getFirstUnit() != null) {
+                firstUnitCell.setCellValue(po.getFirstUnit());
+            }
+            // 二级单位
+            Cell areaNameCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getAreaName() != null) {
+                areaNameCell.setCellValue(po.getAreaName());
+            }
+            // 三级单位
+            Cell cityNameCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getCityName() != null) {
+                cityNameCell.setCellValue(po.getCityName());
+            }
+            // 局址编号
+            Cell siteNumCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getSiteName() != null) {
+                siteNumCell.setCellValue(po.getSiteNum());
+            }
+            // 局址别名
+            Cell siteNameCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getSiteName() != null) {
+                siteNameCell.setCellValue(po.getSiteName());
+            }
+            // 建筑别名
+            Cell buildingNameCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getBuildingName() != null) {
+                buildingNameCell.setCellValue(po.getBuildingName());
+            }
+            // 地段
+            Cell areaSectorCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getAreaSector() != null) {
+                areaSectorCell.setCellValue(po.getAreaSector());
+            }
+            // 建筑面积(㎡)
+            Cell buildingAreaCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getBuildingArea() != null) {
+                buildingAreaCell.setCellValue(po.getBuildingArea().doubleValue());
+            }
+            buildingAreaCell.setCellStyle(numberCellStyle);
+            // 建筑面积-出租(㎡)
+            Cell buildingAreaRentCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getBuildingAreaRent() != null) {
+                buildingAreaRentCell.setCellValue(po.getBuildingAreaRent().doubleValue());
+            }
+            buildingAreaRentCell.setCellStyle(numberCellStyle);
+            // 建筑面积-闲置(㎡)
+            Cell buildingAreaIdleCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getBuildingAreaIdle() != null) {
+                buildingAreaIdleCell.setCellValue(po.getBuildingAreaIdle().doubleValue());
+            }
+            buildingAreaIdleCell.setCellStyle(numberCellStyle);
+            // 建筑面积-自用(㎡)
+            Cell buildingAreaSelfUseCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getBuildingAreaSelfUse() != null) {
+                buildingAreaSelfUseCell.setCellValue(po.getBuildingAreaSelfUse().doubleValue());
+            }
+            buildingAreaSelfUseCell.setCellStyle(numberCellStyle);
+            // 建筑面积-不可使用(㎡)
+            Cell buildingAreaUnusableCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getBuildingAreaUnusable() != null) {
+                buildingAreaUnusableCell.setCellValue(po.getBuildingAreaUnusable().doubleValue());
+            }
+            buildingAreaUnusableCell.setCellStyle(numberCellStyle);
+            // 上级土地名称
+            Cell landNameCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getLandName() != null) {
+                landNameCell.setCellValue(po.getLandName());
+            }
+            // 得房率
+            Cell housingAcquisitionRateCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getHousingAcquisitionRate() != null) {
+                housingAcquisitionRateCell.setCellValue(po.getHousingAcquisitionRate().doubleValue());
+            }
+            housingAcquisitionRateCell.setCellStyle(percentCellStyle);
+            // 房屋来源
+            Cell housingSourceCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getHousingSource() != null) {
+                housingSourceCell.setCellValue(po.getHousingSource());
+            }
+            // 取得日期
+            Cell acquisitionDateCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getAcquisitionDate() != null) {
+                acquisitionDateCell.setCellValue(po.getAcquisitionDate());
+            }
+            // 房龄开始年份
+            Cell houseYearBeganCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getHouseYearBegan() != null) {
+                houseYearBeganCell.setCellValue(po.getHouseYearBegan());
+            }
+            // 投资主体
+            Cell investorCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getInvestor() != null) {
+                investorCell.setCellValue(po.getInvestor());
+            }
+            // 管理层级
+            Cell managementLevelCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getManagementLevel() != null) {
+                managementLevelCell.setCellValue(po.getManagementLevel());
+            }
+            // 房屋结构
+            Cell buildingStructureCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getBuildingStructure() != null) {
+                buildingStructureCell.setCellValue(po.getBuildingStructure());
+            }
+            // 楼层总数
+            Cell totalFloorsCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getTotalFloors() != null) {
+                totalFloorsCell.setCellValue(po.getTotalFloors());
+            }
+            // 是否临街
+            Cell frontageCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getFrontage() != null) {
+                frontageCell.setCellValue(po.getFrontage());
+            }
+            // 是否有院落
+            Cell courtyardCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getCourtyard() != null) {
+                courtyardCell.setCellValue(po.getCourtyard());
+            }
+            // 整栋是否独有
+            Cell wholeBuildingCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getWholeBuilding() != null) {
+                wholeBuildingCell.setCellValue(po.getWholeBuilding());
+            }
+            // 是否有房产证
+            Cell propertyOwnershipCertificateCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getPropertyOwnershipCertificate() != null) {
+                propertyOwnershipCertificateCell.setCellValue(po.getPropertyOwnershipCertificate());
+            }
+            // 无房产证原因
+            Cell noPropertyOwnershipCertificateReasonCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getNoPropertyOwnershipCertificateReason() != null) {
+                noPropertyOwnershipCertificateReasonCell.setCellValue(
+                        po.getNoPropertyOwnershipCertificateReason());
+            }
+            // 未关联资产
+            Cell unrelatedAssetsCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getUnrelatedAssets() != null) {
+                unrelatedAssetsCell.setCellValue(po.getUnrelatedAssets());
+            }
+            // 资产编号
+            Cell assetsNumCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getAssetsNum() != null) {
+                assetsNumCell.setCellValue(po.getAssetsNum());
+            }
+            // 资产标签号
+            Cell assetsTagNumCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getAssetsTagNum() != null) {
+                assetsTagNumCell.setCellValue(po.getAssetsTagNum());
+            }
+            // 使用状态
+            Cell usageStatusCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getUsageStatus() != null) {
+                usageStatusCell.setCellValue(po.getUsageStatus());
+            }
+            // 建筑用途
+            Cell buildingUseCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getBuildingUse() != null) {
+                buildingUseCell.setCellValue(po.getBuildingUse());
+            }
+            // 权属状态
+            Cell ownershipStatusCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getOwnershipStatus() != null) {
+                ownershipStatusCell.setCellValue(po.getOwnershipStatus());
+            }
+            // 建筑占地面积(㎡)
+            Cell floorAreaCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getFloorArea() != null) {
+                floorAreaCell.setCellValue(po.getFloorArea().doubleValue());
+            }
+            floorAreaCell.setCellStyle(numberCellStyle);
+            // 使用面积(㎡)
+            Cell usableAreaCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getUsableArea() != null) {
+                usableAreaCell.setCellValue(po.getUsableArea().doubleValue());
+            }
+            usableAreaCell.setCellStyle(numberCellStyle);
+            // 使用面积-自用(㎡)
+            Cell usableAreaSelfUseCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getUsableAreaSelfUse() != null) {
+                usableAreaSelfUseCell.setCellValue(po.getUsableAreaSelfUse().doubleValue());
+            }
+            usableAreaSelfUseCell.setCellStyle(numberCellStyle);
+            // 使用面积-出租(㎡)
+            Cell usableAreaRentCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getUsableAreaRent() != null) {
+                usableAreaRentCell.setCellValue(po.getUsableAreaRent().doubleValue());
+            }
+            usableAreaRentCell.setCellStyle(numberCellStyle);
+            // 使用面积-闲置(㎡)
+            Cell usableAreaIdleCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getUsableAreaIdle() != null) {
+                usableAreaIdleCell.setCellValue(po.getUsableAreaIdle().doubleValue());
+            }
+            usableAreaIdleCell.setCellStyle(numberCellStyle);
+            // 使用面积-不可使用(㎡)
+            Cell usableAreaUnusableCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getUsableAreaUnusable() != null) {
+                usableAreaUnusableCell.setCellValue(po.getUsableAreaUnusable().doubleValue());
+            }
+            usableAreaUnusableCell.setCellStyle(numberCellStyle);
+            // 楼长姓名
+            Cell communityAssistantNameCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getCommunityAssistantName() != null) {
+                communityAssistantNameCell.setCellValue(po.getCommunityAssistantName());
+            }
+            // 楼长所在单位
+            Cell communityAssistantUnitCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getCommunityAssistantUnit() != null) {
+                communityAssistantUnitCell.setCellValue(po.getCommunityAssistantUnit());
+            }
+            // 经度
+            Cell lngJtCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getLngJt() != null) {
+                lngJtCell.setCellValue(po.getLngJt().toString());
+            }
+            // 纬度
+            Cell latJtCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getLatJt() != null) {
+                latJtCell.setCellValue(po.getLatJt().toString());
+            }
+            // 实际产权人
+            Cell propertyOwnerCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getPropertyOwner() != null) {
+                propertyOwnerCell.setCellValue(po.getPropertyOwner());
+            }
+        }
+    }
+
+    public Rsp<PageVo<HouseAgeStatVo>> houseAgeStat(HouseAgeStatDto dto) {
+        HouseAgeStatPo houseAgeStatPos = getHouseAgeStatPos(dto);
+        if (houseAgeStatPos == null) {
+            return Rsp.ok();
+        }
+        HouseAgeStatVo vo = new HouseAgeStatVo(houseAgeStatPos, false);
+        PageVo<HouseAgeStatVo> pageVo = new PageVo<>(Collections.singletonList(vo));
+        return Rsp.ok(pageVo);
+    }
+
+    /**
+     * 不动产自有房产房龄统计
+     */
+    public HouseAgeStatPo getHouseAgeStatPos(HouseAgeStatDto dto) {
+        HouseAgeStatBo bo = new HouseAgeStatBo();
+        if (dto.getMap() != null && dto.getMap().getStatisticalMonth() != null) {
+            bo.setYearMonth(dto.getMap().getStatisticalMonth());
+        }
+        if (dto.getMap() != null && StringUtils.hasText(dto.getMap().getCity()) && !"全省".equals(dto.getMap().getCity())) {
+            bo.setAreaNo(dto.getMap().getCity());
+        }
+        if (dto.getMap() != null && StringUtils.hasText(dto.getMap().getCounty())) {
+            bo.setCityNo(dto.getMap().getCounty());
+        }
+        // 查询三级单位统计
+        List<HouseAgeStatPo> houseAgeStatPos = houseBuildingDao.houseAgeStat(bo);
+        if (CollectionUtils.isEmpty(houseAgeStatPos)) {
+            return null;
+        }
+        // 一级单位统计
+        HouseAgeStatPo firstUnitPo = new HouseAgeStatPo();
+        firstUnitPo.setAreaName("全省");
+        firstUnitPo.setCityName("全省");
+        LinkedHashMap<String, HouseAgeStatPo> secondUnitPoMap = new LinkedHashMap<>();
+        // 二级单位统计
+        for (HouseAgeStatPo houseAgeStatPo : houseAgeStatPos) {
+            secondUnitPoMap.putIfAbsent(houseAgeStatPo.getAreaNo(),
+                    new HouseAgeStatPo(houseAgeStatPo.getAreaNo(), houseAgeStatPo.getAreaName()));
+            HouseAgeStatPo secondUnitPo = secondUnitPoMap.get(houseAgeStatPo.getAreaNo());
+            secondUnitPo.update(houseAgeStatPo);
+        }
+        for (HouseAgeStatPo value : secondUnitPoMap.values()) {
+            firstUnitPo.update(value);
+        }
+        return firstUnitPo;
+    }
+
+    public void queryHouseYearExport(HouseAgeStatDto.HouseAgeStatMapDTO dto) {
+        ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder
+                .getRequestAttributes();
+        if (servletRequestAttributes == null) {
+            return;
+        }
+        HttpServletResponse response = servletRequestAttributes.getResponse();
+        if (response == null) {
+            return;
+        }
+        String filename = "房屋管理_房龄统计"
+                + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")) + ".xlsx";
+        response.setHeader("Content-Disposition", "attachment;filename=" + URLEncodeUtil.encode(filename));
+        response.setContentType("application/octet-stream");
+        try (SXSSFWorkbook wb = new SXSSFWorkbook()) {
+            writeQueryHouseYear(new HouseAgeStatDto(dto), wb);
+            wb.write(response.getOutputStream());
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+        }
+    }
+
+    /**
+     * 写房龄统计文件
+     */
+    private void writeQueryHouseYear(HouseAgeStatDto dto, SXSSFWorkbook wb) {
+        HouseAgeStatPo firstPo = getHouseAgeStatPos(dto);
+        DataFormat dataFormat = wb.createDataFormat();
+        // 整数样式
+        CellStyle integerCellStyle = wb.createCellStyle();
+        integerCellStyle.setDataFormat(dataFormat.getFormat("#,##0"));
+        integerCellStyle.setAlignment(HorizontalAlignment.RIGHT);
+        // 数字样式
+        CellStyle numberCellStyle = wb.createCellStyle();
+        numberCellStyle.setDataFormat(dataFormat.getFormat("#,##0.00"));
+        numberCellStyle.setAlignment(HorizontalAlignment.RIGHT);
+        // 默认样式
+        CellStyle baseCellStyle = wb.createCellStyle();
+        baseCellStyle.setAlignment(HorizontalAlignment.CENTER);
+        baseCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
+        SXSSFSheet sheet = wb.createSheet();
+        AtomicInteger rowIndex = new AtomicInteger(0);
+        // 表头
+        Row headerRow = sheet.createRow(rowIndex.getAndIncrement());
+        List<String> headers = Stream.of("资产所属单位(一级)", "资产所属单位(二级)", "资产所属单位(三级)",
+                "1-10年", "11-20年", "21-30年", "31-40年", "41-50年", "50年以上", "平均房龄").toList();
+        int headerLength = headers.size();
+        for (int i = 0; i < headerLength; i++) {
+            Cell cell = headerRow.createCell(i);
+            cell.setCellValue(headers.get(i));
+            cell.setCellStyle(baseCellStyle);
+            // 根据内容长度设置列宽
+            int columnWidth = headers.get(i).length() * 256 * 2 + 256;
+            sheet.setColumnWidth(i, columnWidth);
+        }
+        if (firstPo == null) {
+            return;
+        }
+        // 数据
+        AtomicInteger columnIndex1 = new AtomicInteger(0);
+        // 一级单位统计
+        Row row1 = sheet.createRow(rowIndex.getAndIncrement());
+        // 资产所属单位(一级)
+        Cell firstUnitCell1 = row1.createCell(columnIndex1.getAndIncrement());
+        if (firstPo.getAreaName() != null) {
+            firstUnitCell1.setCellValue(firstPo.getAreaName());
+        }
+        // 二级单位
+        Cell areaNameCell1 = row1.createCell(columnIndex1.getAndIncrement());
+//        if (firstPo.getAreaName() != null) {
+//            areaNameCell1.setCellValue(firstPo.getAreaName());
+//        }
+        // 三级单位
+        Cell cityNameCell1 = row1.createCell(columnIndex1.getAndIncrement());
+//        if (firstPo.getCityName() != null) {
+//            cityNameCell1.setCellValue(firstPo.getCityName());
+//        }
+        // 1-10年
+        Cell a1Cell1 = row1.createCell(columnIndex1.getAndIncrement());
+        if (firstPo.getA1() != null) {
+            a1Cell1.setCellValue(firstPo.getA1());
+        }
+        a1Cell1.setCellStyle(integerCellStyle);
+        // 11-20年
+        Cell a2Cell1 = row1.createCell(columnIndex1.getAndIncrement());
+        if (firstPo.getA2() != null) {
+            a2Cell1.setCellValue(firstPo.getA2());
+        }
+        a2Cell1.setCellStyle(integerCellStyle);
+        // 21-30年
+        Cell a3Cell1 = row1.createCell(columnIndex1.getAndIncrement());
+        if (firstPo.getA3() != null) {
+            a3Cell1.setCellValue(firstPo.getA3());
+        }
+        a3Cell1.setCellStyle(integerCellStyle);
+        // 31-40年
+        Cell a4Cell1 = row1.createCell(columnIndex1.getAndIncrement());
+        if (firstPo.getA4() != null) {
+            a4Cell1.setCellValue(firstPo.getA4());
+        }
+        a4Cell1.setCellStyle(integerCellStyle);
+        // 41-50年
+        Cell a5Cell1 = row1.createCell(columnIndex1.getAndIncrement());
+        if (firstPo.getA5() != null) {
+            a5Cell1.setCellValue(firstPo.getA5());
+        }
+        a5Cell1.setCellStyle(integerCellStyle);
+        // 50年以上
+        Cell a6Cell1 = row1.createCell(columnIndex1.getAndIncrement());
+        if (firstPo.getA6() != null) {
+            a6Cell1.setCellValue(firstPo.getA6());
+        }
+        a6Cell1.setCellStyle(integerCellStyle);
+        // 平均房龄
+        Cell houseAgeAvgCell1 = row1.createCell(columnIndex1.getAndIncrement());
+        if (firstPo.getHouseAgeAvg() != null) {
+            houseAgeAvgCell1.setCellValue(firstPo.getHouseAgeAvg().doubleValue());
+        }
+        houseAgeAvgCell1.setCellStyle(numberCellStyle);
+        // 二级单位统计
+        for (HouseAgeStatPo secondPo : firstPo.getChildren()) {
+            AtomicInteger columnIndex2 = new AtomicInteger(0);
+            Row row2 = sheet.createRow(rowIndex.getAndIncrement());
+            // 资产所属单位(一级)
+            Cell firstUnitCell2 = row2.createCell(columnIndex2.getAndIncrement());
+//            if (secondPo.getAreaName() != null) {
+//                firstUnitCell2.setCellValue(secondPo.getAreaName());
+//            }
+            // 二级单位
+            Cell areaNameCell2 = row2.createCell(columnIndex2.getAndIncrement());
+            if (secondPo.getAreaName() != null) {
+                areaNameCell2.setCellValue(secondPo.getAreaName());
+            }
+            // 三级单位
+            Cell cityNameCell2 = row2.createCell(columnIndex2.getAndIncrement());
+//            if (secondPo.getCityName() != null) {
+//                cityNameCell2.setCellValue(secondPo.getCityName());
+//            }
+            // 1-10年
+            Cell a1Cell2 = row2.createCell(columnIndex2.getAndIncrement());
+            if (secondPo.getA1() != null) {
+                a1Cell2.setCellValue(secondPo.getA1());
+            }
+            a1Cell2.setCellStyle(integerCellStyle);
+            // 11-20年
+            Cell a2Cell2 = row2.createCell(columnIndex2.getAndIncrement());
+            if (secondPo.getA2() != null) {
+                a2Cell2.setCellValue(secondPo.getA2());
+            }
+            a2Cell2.setCellStyle(integerCellStyle);
+            // 21-30年
+            Cell a3Cell2 = row2.createCell(columnIndex2.getAndIncrement());
+            if (secondPo.getA3() != null) {
+                a3Cell2.setCellValue(secondPo.getA3());
+            }
+            a3Cell2.setCellStyle(integerCellStyle);
+            // 31-40年
+            Cell a4Cell2 = row2.createCell(columnIndex2.getAndIncrement());
+            if (secondPo.getA4() != null) {
+                a4Cell2.setCellValue(secondPo.getA4());
+            }
+            a4Cell2.setCellStyle(integerCellStyle);
+            // 41-50年
+            Cell a5Cell2 = row2.createCell(columnIndex2.getAndIncrement());
+            if (secondPo.getA5() != null) {
+                a5Cell2.setCellValue(secondPo.getA5());
+            }
+            a5Cell2.setCellStyle(integerCellStyle);
+            // 50年以上
+            Cell a6Cell2 = row2.createCell(columnIndex2.getAndIncrement());
+            if (secondPo.getA6() != null) {
+                a6Cell2.setCellValue(secondPo.getA6());
+            }
+            a6Cell2.setCellStyle(integerCellStyle);
+            // 平均房龄
+            Cell houseAgeAvgCell2 = row2.createCell(columnIndex2.getAndIncrement());
+            if (secondPo.getHouseAgeAvg() != null) {
+                houseAgeAvgCell2.setCellValue(secondPo.getHouseAgeAvg().doubleValue());
+            }
+            houseAgeAvgCell2.setCellStyle(numberCellStyle);
+            // 三级单位统计
+            for (HouseAgeStatPo thirdPo : secondPo.getChildren()) {
+                AtomicInteger columnIndex3 = new AtomicInteger(0);
+                Row row3 = sheet.createRow(rowIndex.getAndIncrement());
+                // 资产所属单位(一级)
+                Cell firstUnitCell3 = row3.createCell(columnIndex3.getAndIncrement());
+//                if (thirdPo.getAreaName() != null) {
+//                    firstUnitCell3.setCellValue(thirdPo.getAreaName());
+//                }
+                // 二级单位
+                Cell areaNameCell3 = row3.createCell(columnIndex3.getAndIncrement());
+//                if (thirdPo.getAreaName() != null) {
+//                    areaNameCell3.setCellValue(thirdPo.getAreaName());
+//                }
+                // 三级单位
+                Cell cityNameCell3 = row3.createCell(columnIndex3.getAndIncrement());
+                if (thirdPo.getCityName() != null) {
+                    cityNameCell3.setCellValue(thirdPo.getCityName());
+                }
+                // 1-10年
+                Cell a1Cell3 = row3.createCell(columnIndex3.getAndIncrement());
+                if (thirdPo.getA1() != null) {
+                    a1Cell3.setCellValue(thirdPo.getA1());
+                }
+                a1Cell3.setCellStyle(integerCellStyle);
+                // 11-20年
+                Cell a2Cell3 = row3.createCell(columnIndex3.getAndIncrement());
+                if (thirdPo.getA2() != null) {
+                    a2Cell3.setCellValue(thirdPo.getA2());
+                }
+                a2Cell3.setCellStyle(integerCellStyle);
+                // 21-30年
+                Cell a3Cell3 = row3.createCell(columnIndex3.getAndIncrement());
+                if (thirdPo.getA3() != null) {
+                    a3Cell3.setCellValue(thirdPo.getA3());
+                }
+                a3Cell3.setCellStyle(integerCellStyle);
+                // 31-40年
+                Cell a4Cell3 = row3.createCell(columnIndex3.getAndIncrement());
+                if (thirdPo.getA4() != null) {
+                    a4Cell3.setCellValue(thirdPo.getA4());
+                }
+                a4Cell3.setCellStyle(integerCellStyle);
+                // 41-50年
+                Cell a5Cell3 = row3.createCell(columnIndex3.getAndIncrement());
+                if (thirdPo.getA5() != null) {
+                    a5Cell3.setCellValue(thirdPo.getA5());
+                }
+                a5Cell3.setCellStyle(integerCellStyle);
+                // 50年以上
+                Cell a6Cell3 = row3.createCell(columnIndex3.getAndIncrement());
+                if (thirdPo.getA6() != null) {
+                    a6Cell3.setCellValue(thirdPo.getA6());
+                }
+                a6Cell3.setCellStyle(integerCellStyle);
+                // 平均房龄
+                Cell houseAgeAvgCell3 = row3.createCell(columnIndex3.getAndIncrement());
+                if (thirdPo.getHouseAgeAvg() != null) {
+                    houseAgeAvgCell3.setCellValue(thirdPo.getHouseAgeAvg().doubleValue());
+                }
+                houseAgeAvgCell3.setCellStyle(numberCellStyle);
+            }
+        }
+    }
+
+    public Rsp<PageVo<BuildingIdleStatVo>> buildingIdleStat(BuildingIdleStatDto dto) {
+        BuildingIdleStatPo buildingIdleStatPos = getBuildingIdleStatPos(dto);
+        if (buildingIdleStatPos == null) {
+            return Rsp.ok();
+        }
+        BuildingIdleStatVo vo = new BuildingIdleStatVo(buildingIdleStatPos, false);
+        PageVo<BuildingIdleStatVo> pageVo = new PageVo<>(Collections.singletonList(vo));
+        return Rsp.ok(pageVo);
+    }
+
+    private BuildingIdleStatPo getBuildingIdleStatPos(BuildingIdleStatDto dto) {
+        BuildingIdleStatBo bo = new BuildingIdleStatBo();
+        if (dto.getMap() != null && dto.getMap().getStatisticalMonth() != null) {
+            bo.setYearMonth(dto.getMap().getStatisticalMonth());
+        }
+        if (dto.getMap() != null && StringUtils.hasText(dto.getMap().getCity()) && !"全省".equals(dto.getMap().getCity())) {
+            bo.setAreaNo(dto.getMap().getCity());
+        }
+        if (dto.getMap() != null && StringUtils.hasText(dto.getMap().getCounty())) {
+            bo.setCityNo(dto.getMap().getCounty());
+        }
+        // 查询三级单位统计
+        List<BuildingIdleStatPo> buildingIdleStatPos = houseBuildingDao.buildingIdleStat(bo);
+        if (CollectionUtils.isEmpty(buildingIdleStatPos)) {
+            return null;
+        }
+        // 一级单位统计
+        BuildingIdleStatPo firstUnitPo = new BuildingIdleStatPo();
+        firstUnitPo.setAreaName("全省");
+        firstUnitPo.setCityName("全省");
+        LinkedHashMap<String, BuildingIdleStatPo> secondUnitPoMap = new LinkedHashMap<>();
+        // 二级单位统计
+        for (BuildingIdleStatPo houseAgeStatPo : buildingIdleStatPos) {
+            secondUnitPoMap.putIfAbsent(houseAgeStatPo.getAreaNo(),
+                    new BuildingIdleStatPo(houseAgeStatPo.getAreaNo(), houseAgeStatPo.getAreaName()));
+            BuildingIdleStatPo secondUnitPo = secondUnitPoMap.get(houseAgeStatPo.getAreaNo());
+            secondUnitPo.update(houseAgeStatPo);
+        }
+        for (BuildingIdleStatPo value : secondUnitPoMap.values()) {
+            firstUnitPo.update(value);
+        }
+        return firstUnitPo;
+    }
+
+    public void buildingIdleStatExport(BuildingIdleStatDto.BuildingIdleStatMapDTO dto) {
+        ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder
+                .getRequestAttributes();
+        if (servletRequestAttributes == null) {
+            return;
+        }
+        HttpServletResponse response = servletRequestAttributes.getResponse();
+        if (response == null) {
+            return;
+        }
+        String filename = "房屋管理_闲置管理"
+                + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")) + ".xlsx";
+        response.setHeader("Content-Disposition", "attachment;filename=" + URLEncodeUtil.encode(filename));
+        response.setContentType("application/octet-stream");
+        try (SXSSFWorkbook wb = new SXSSFWorkbook()) {
+            writeBuildingIdleStat(new BuildingIdleStatDto(dto), wb);
+            wb.write(response.getOutputStream());
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+        }
+    }
+
+    /**
+     * 写闲置管理文件
+     */
+    private void writeBuildingIdleStat(BuildingIdleStatDto dto, SXSSFWorkbook wb) {
+        BuildingIdleStatPo firstPo = getBuildingIdleStatPos(dto);
+        DataFormat dataFormat = wb.createDataFormat();
+        // 整数样式
+        CellStyle integerCellStyle = wb.createCellStyle();
+        integerCellStyle.setDataFormat(dataFormat.getFormat("#,##0"));
+        integerCellStyle.setAlignment(HorizontalAlignment.RIGHT);
+        // 数字样式
+        CellStyle numberCellStyle = wb.createCellStyle();
+        numberCellStyle.setDataFormat(dataFormat.getFormat("#,##0.00"));
+        numberCellStyle.setAlignment(HorizontalAlignment.RIGHT);
+        // 默认样式
+        CellStyle baseCellStyle = wb.createCellStyle();
+        baseCellStyle.setAlignment(HorizontalAlignment.CENTER);
+        baseCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
+        // 百分比样式
+        CellStyle percentCellStyle = wb.createCellStyle();
+        percentCellStyle.setDataFormat(dataFormat.getFormat("0.00%"));
+        percentCellStyle.setAlignment(HorizontalAlignment.RIGHT);
+        SXSSFSheet sheet = wb.createSheet();
+        AtomicInteger rowIndex = new AtomicInteger(0);
+        // 表头
+        Row headerRow = sheet.createRow(rowIndex.getAndIncrement());
+        List<String> headers = Stream.of("资产所属单位(一级)", "资产所属单位(二级)", "资产所属单位(三级)",
+                "建筑面积(㎡)", "闲置建筑数量", "建筑面积-自用(㎡)","建筑面积-出租(㎡)", "建筑面积-闲置(㎡)", "闲置率(%)").toList();
+        int headerLength = headers.size();
+        for (int i = 0; i < headerLength; i++) {
+            Cell cell = headerRow.createCell(i);
+            cell.setCellValue(headers.get(i));
+            cell.setCellStyle(baseCellStyle);
+            // 根据内容长度设置列宽
+            int columnWidth = headers.get(i).length() * 256 * 2 + 256;
+            sheet.setColumnWidth(i, columnWidth);
+        }
+        if (firstPo == null) {
+            return;
+        }
+        // 数据
+        AtomicInteger columnIndex1 = new AtomicInteger(0);
+        // 一级单位统计
+        Row row1 = sheet.createRow(rowIndex.getAndIncrement());
+        // 资产所属单位(一级)
+        Cell firstUnitCell1 = row1.createCell(columnIndex1.getAndIncrement());
+        if (firstPo.getAreaName() != null) {
+            firstUnitCell1.setCellValue(firstPo.getAreaName());
+        }
+        // 二级单位
+        Cell areaNameCell1 = row1.createCell(columnIndex1.getAndIncrement());
+//        if (firstPo.getAreaName() != null) {
+//            areaNameCell1.setCellValue(firstPo.getAreaName());
+//        }
+        // 三级单位
+        Cell cityNameCell1 = row1.createCell(columnIndex1.getAndIncrement());
+//        if (firstPo.getCityName() != null) {
+//            cityNameCell1.setCellValue(firstPo.getCityName());
+//        }
+        // 建筑面积(㎡)
+        Cell buildingAreaSumCell1 = row1.createCell(columnIndex1.getAndIncrement());
+        if (firstPo.getBuildingAreaSum() != null) {
+            buildingAreaSumCell1.setCellValue(firstPo.getBuildingAreaSum().doubleValue());
+        }
+        buildingAreaSumCell1.setCellStyle(numberCellStyle);
+        // 闲置建筑数量
+        Cell idleCountCell1 = row1.createCell(columnIndex1.getAndIncrement());
+        if (firstPo.getIdleCount() != null) {
+            idleCountCell1.setCellValue(firstPo.getIdleCount());
+        }
+        idleCountCell1.setCellStyle(integerCellStyle);
+        // 建筑面积-自用(㎡)
+        Cell buildingAreaSelfUseSumCell1 = row1.createCell(columnIndex1.getAndIncrement());
+        if (firstPo.getBuildingAreaSelfUseSum() != null) {
+            buildingAreaSelfUseSumCell1.setCellValue(firstPo.getBuildingAreaSelfUseSum().doubleValue());
+        }
+        buildingAreaSelfUseSumCell1.setCellStyle(numberCellStyle);
+        // 建筑面积-出租(㎡)
+        Cell buildingAreaRentSumCell1 = row1.createCell(columnIndex1.getAndIncrement());
+        if (firstPo.getBuildingAreaRentSum() != null) {
+            buildingAreaRentSumCell1.setCellValue(firstPo.getBuildingAreaRentSum().doubleValue());
+        }
+        buildingAreaRentSumCell1.setCellStyle(numberCellStyle);
+        // 建筑面积-闲置(㎡)
+        Cell buildingAreaIdleSumCell1 = row1.createCell(columnIndex1.getAndIncrement());
+        if (firstPo.getBuildingAreaIdleSum() != null) {
+            buildingAreaIdleSumCell1.setCellValue(firstPo.getBuildingAreaIdleSum().doubleValue());
+        }
+        buildingAreaIdleSumCell1.setCellStyle(numberCellStyle);
+        // 闲置率
+        Cell idlePercentCell1 = row1.createCell(columnIndex1.getAndIncrement());
+        if (firstPo.getIdlePercent() != null) {
+            idlePercentCell1.setCellValue(firstPo.getIdlePercent().doubleValue());
+        }
+        idlePercentCell1.setCellStyle(percentCellStyle);
+        // 二级单位统计
+        for (BuildingIdleStatPo secondPo : firstPo.getChildren()) {
+            AtomicInteger columnIndex2 = new AtomicInteger(0);
+            // 一级单位统计
+            Row row2 = sheet.createRow(rowIndex.getAndIncrement());
+            // 资产所属单位(一级)
+            Cell firstUnitCell2 = row2.createCell(columnIndex2.getAndIncrement());
+//            if (secondPo.getAreaName() != null) {
+//                firstUnitCell2.setCellValue(secondPo.getAreaName());
+//            }
+            // 二级单位
+            Cell areaNameCell2 = row2.createCell(columnIndex2.getAndIncrement());
+            if (secondPo.getAreaName() != null) {
+                areaNameCell2.setCellValue(secondPo.getAreaName());
+            }
+            // 三级单位
+            Cell cityNameCell2 = row2.createCell(columnIndex2.getAndIncrement());
+//            if (secondPo.getCityName() != null) {
+//                cityNameCell2.setCellValue(secondPo.getCityName());
+//            }
+            // 建筑面积(㎡)
+            Cell buildingAreaSumCell2 = row2.createCell(columnIndex2.getAndIncrement());
+            if (secondPo.getBuildingAreaSum() != null) {
+                buildingAreaSumCell2.setCellValue(secondPo.getBuildingAreaSum().doubleValue());
+            }
+            buildingAreaSumCell2.setCellStyle(numberCellStyle);
+            // 闲置建筑数量
+            Cell idleCountCell2 = row2.createCell(columnIndex2.getAndIncrement());
+            if (secondPo.getIdleCount() != null) {
+                idleCountCell2.setCellValue(secondPo.getIdleCount());
+            }
+            idleCountCell2.setCellStyle(integerCellStyle);
+            // 建筑面积-自用(㎡)
+            Cell buildingAreaSelfUseSumCell2 = row2.createCell(columnIndex2.getAndIncrement());
+            if (secondPo.getBuildingAreaSelfUseSum() != null) {
+                buildingAreaSelfUseSumCell2.setCellValue(secondPo.getBuildingAreaSelfUseSum().doubleValue());
+            }
+            buildingAreaSelfUseSumCell2.setCellStyle(numberCellStyle);
+            // 建筑面积-出租(㎡)
+            Cell buildingAreaRentSumCell2 = row2.createCell(columnIndex2.getAndIncrement());
+            if (secondPo.getBuildingAreaRentSum() != null) {
+                buildingAreaRentSumCell2.setCellValue(secondPo.getBuildingAreaRentSum().doubleValue());
+            }
+            buildingAreaRentSumCell2.setCellStyle(numberCellStyle);
+            // 建筑面积-闲置(㎡)
+            Cell buildingAreaIdleSumCell2 = row2.createCell(columnIndex2.getAndIncrement());
+            if (secondPo.getBuildingAreaIdleSum() != null) {
+                buildingAreaIdleSumCell2.setCellValue(secondPo.getBuildingAreaIdleSum().doubleValue());
+            }
+            buildingAreaIdleSumCell2.setCellStyle(numberCellStyle);
+            // 闲置率
+            Cell idlePercentCell2 = row2.createCell(columnIndex2.getAndIncrement());
+            if (secondPo.getIdlePercent() != null) {
+                idlePercentCell2.setCellValue(secondPo.getIdlePercent().doubleValue());
+            }
+            idlePercentCell2.setCellStyle(percentCellStyle);
+            // 三级单位统计
+            for (BuildingIdleStatPo thirdPo : secondPo.getChildren()) {
+                AtomicInteger columnIndex3 = new AtomicInteger(0);
+                Row row3 = sheet.createRow(rowIndex.getAndIncrement());
+                // 资产所属单位(一级)
+                Cell firstUnitCell3 = row3.createCell(columnIndex3.getAndIncrement());
+//                if (thirdPo.getAreaName() != null) {
+//                    firstUnitCell3.setCellValue(thirdPo.getAreaName());
+//                }
+                // 二级单位
+                Cell areaNameCell3 = row3.createCell(columnIndex3.getAndIncrement());
+//                if (thirdPo.getAreaName() != null) {
+//                    areaNameCell3.setCellValue(thirdPo.getAreaName());
+//                }
+                // 三级单位
+                Cell cityNameCell3 = row3.createCell(columnIndex3.getAndIncrement());
+                if (thirdPo.getCityName() != null) {
+                    cityNameCell3.setCellValue(thirdPo.getCityName());
+                }
+                // 建筑面积(㎡)
+                Cell buildingAreaSumCell3 = row3.createCell(columnIndex3.getAndIncrement());
+                if (thirdPo.getBuildingAreaSum() != null) {
+                    buildingAreaSumCell3.setCellValue(thirdPo.getBuildingAreaSum().doubleValue());
+                }
+                buildingAreaSumCell3.setCellStyle(numberCellStyle);
+                // 闲置建筑数量
+                Cell idleCountCell3 = row3.createCell(columnIndex3.getAndIncrement());
+                if (thirdPo.getIdleCount() != null) {
+                    idleCountCell3.setCellValue(thirdPo.getIdleCount());
+                }
+                idleCountCell3.setCellStyle(integerCellStyle);
+                // 建筑面积-自用(㎡)
+                Cell buildingAreaSelfUseSumCell3 = row3.createCell(columnIndex3.getAndIncrement());
+                if (thirdPo.getBuildingAreaSelfUseSum() != null) {
+                    buildingAreaSelfUseSumCell3.setCellValue(thirdPo.getBuildingAreaSelfUseSum().doubleValue());
+                }
+                buildingAreaSelfUseSumCell3.setCellStyle(numberCellStyle);
+                // 建筑面积-出租(㎡)
+                Cell buildingAreaRentSumCell3 = row3.createCell(columnIndex3.getAndIncrement());
+                if (thirdPo.getBuildingAreaRentSum() != null) {
+                    buildingAreaRentSumCell3.setCellValue(thirdPo.getBuildingAreaRentSum().doubleValue());
+                }
+                buildingAreaRentSumCell3.setCellStyle(numberCellStyle);
+                // 建筑面积-闲置(㎡)
+                Cell buildingAreaIdleSumCell3 = row3.createCell(columnIndex3.getAndIncrement());
+                if (thirdPo.getBuildingAreaIdleSum() != null) {
+                    buildingAreaIdleSumCell3.setCellValue(thirdPo.getBuildingAreaIdleSum().doubleValue());
+                }
+                buildingAreaIdleSumCell3.setCellStyle(numberCellStyle);
+                // 闲置率
+                Cell idlePercentCell3 = row3.createCell(columnIndex3.getAndIncrement());
+                if (thirdPo.getIdlePercent() != null) {
+                    idlePercentCell3.setCellValue(thirdPo.getIdlePercent().doubleValue());
+                }
+                idlePercentCell3.setCellStyle(percentCellStyle);
+            }
+        }
+    }
 }

+ 261 - 0
src/main/java/com/example/service/house/HouseWzBuildmanageAvageareaService.java

@@ -0,0 +1,261 @@
+package com.example.service.house;
+
+import cn.hutool.core.net.URLEncodeUtil;
+import com.example.common.PageVo;
+import com.example.common.Rsp;
+import com.example.dao.house.HouseBuildingDao;
+import com.example.entity.house.BuildingOfficeAreaStatPo;
+import com.example.pojo.bo.BuildingOfficeAreaStatBo;
+import com.example.pojo.dto.BuildingOfficeAreaStatDto;
+import com.example.pojo.vo.BuildingOfficeAreaStatVo;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.CellStyle;
+import org.apache.poi.ss.usermodel.DataFormat;
+import org.apache.poi.ss.usermodel.HorizontalAlignment;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.VerticalAlignment;
+import org.apache.poi.xssf.streaming.SXSSFSheet;
+import org.apache.poi.xssf.streaming.SXSSFWorkbook;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.servlet.http.HttpServletResponse;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Stream;
+
+@Slf4j
+@Service
+public class HouseWzBuildmanageAvageareaService {
+    private final HouseBuildingDao houseBuildingDao;
+
+    public HouseWzBuildmanageAvageareaService(HouseBuildingDao houseBuildingDao) {
+        this.houseBuildingDao = houseBuildingDao;
+    }
+
+    public Rsp<PageVo<BuildingOfficeAreaStatVo>> buildingOfficeAreaStat(BuildingOfficeAreaStatDto dto) {
+        BuildingOfficeAreaStatPo buildingOfficeAreaStatPos = getBuildingOfficeAreaStatPos(dto);
+        if (buildingOfficeAreaStatPos == null) {
+            return Rsp.ok();
+        }
+        BuildingOfficeAreaStatVo vo = new BuildingOfficeAreaStatVo(buildingOfficeAreaStatPos, false);
+        PageVo<BuildingOfficeAreaStatVo> pageVo = new PageVo<>(Collections.singletonList(vo));
+        return Rsp.ok(pageVo);
+    }
+
+    private BuildingOfficeAreaStatPo getBuildingOfficeAreaStatPos(BuildingOfficeAreaStatDto dto) {
+        BuildingOfficeAreaStatBo bo = new BuildingOfficeAreaStatBo();
+        if (dto.getMap() != null && dto.getMap().getStatisticalMonth() != null) {
+            bo.setYearMonth(dto.getMap().getStatisticalMonth());
+        }
+        if (dto.getMap() != null && StringUtils.hasText(dto.getMap().getCity()) && !"全省".equals(dto.getMap().getCity())) {
+            bo.setAreaNo(dto.getMap().getCity());
+        }
+        if (dto.getMap() != null && StringUtils.hasText(dto.getMap().getCounty())) {
+            bo.setCityNo(dto.getMap().getCounty());
+        }
+        // 查询三级单位统计
+        List<BuildingOfficeAreaStatPo> buildingOfficeAreaStatPos = houseBuildingDao.buildingOfficeAreaStat(bo);
+        if (CollectionUtils.isEmpty(buildingOfficeAreaStatPos)) {
+            return null;
+        }
+        // 一级单位统计
+        BuildingOfficeAreaStatPo firstUnitPo = new BuildingOfficeAreaStatPo();
+        firstUnitPo.setAreaName("全省");
+        firstUnitPo.setCityName("全省");
+        LinkedHashMap<String, BuildingOfficeAreaStatPo> secondUnitPoMap = new LinkedHashMap<>();
+        // 二级单位统计
+        for (BuildingOfficeAreaStatPo po : buildingOfficeAreaStatPos) {
+            secondUnitPoMap.putIfAbsent(po.getAreaNo(),
+                    new BuildingOfficeAreaStatPo(po.getAreaNo(), po.getAreaName()));
+            BuildingOfficeAreaStatPo secondUnitPo = secondUnitPoMap.get(po.getAreaNo());
+            secondUnitPo.update(po);
+        }
+        for (BuildingOfficeAreaStatPo value : secondUnitPoMap.values()) {
+            firstUnitPo.update(value);
+        }
+        return firstUnitPo;
+    }
+
+    public void buildingOfficeAreaStatExport(BuildingOfficeAreaStatDto.BuildingOfficeAreaStatMapDTO dto) {
+        ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder
+                .getRequestAttributes();
+        if (servletRequestAttributes == null) {
+            return;
+        }
+        HttpServletResponse response = servletRequestAttributes.getResponse();
+        if (response == null) {
+            return;
+        }
+        String filename = "房屋管理_自有房产人均办公面积"
+                + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")) + ".xlsx";
+        response.setHeader("Content-Disposition", "attachment;filename=" + URLEncodeUtil.encode(filename));
+        response.setContentType("application/octet-stream");
+        try (SXSSFWorkbook wb = new SXSSFWorkbook()) {
+            writeBuildingOfficeAreaStat(new BuildingOfficeAreaStatDto(dto), wb);
+            wb.write(response.getOutputStream());
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+        }
+    }
+
+    /**
+     * 写自有房产人均办公面积统计文件
+     */
+    private void writeBuildingOfficeAreaStat(BuildingOfficeAreaStatDto dto, SXSSFWorkbook wb) {
+        BuildingOfficeAreaStatPo firstPo = getBuildingOfficeAreaStatPos(dto);
+        DataFormat dataFormat = wb.createDataFormat();
+        // 整数样式
+        CellStyle integerCellStyle = wb.createCellStyle();
+        integerCellStyle.setDataFormat(dataFormat.getFormat("#,##0"));
+        integerCellStyle.setAlignment(HorizontalAlignment.RIGHT);
+        // 数字样式
+        CellStyle numberCellStyle = wb.createCellStyle();
+        numberCellStyle.setDataFormat(dataFormat.getFormat("#,##0.00"));
+        numberCellStyle.setAlignment(HorizontalAlignment.RIGHT);
+        // 默认样式
+        CellStyle baseCellStyle = wb.createCellStyle();
+        baseCellStyle.setAlignment(HorizontalAlignment.CENTER);
+        baseCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
+        SXSSFSheet sheet = wb.createSheet();
+        AtomicInteger rowIndex = new AtomicInteger(0);
+        // 表头
+        Row headerRow = sheet.createRow(rowIndex.getAndIncrement());
+        List<String> headers = Stream.of("资产所属单位(一级)", "资产所属单位(二级)", "资产所属单位(三级)",
+                "建筑面积-自有办公面积(平米)", "县市的合同人员+紧密外包人员", "人均办公面积").toList();
+        int headerLength = headers.size();
+        for (int i = 0; i < headerLength; i++) {
+            Cell cell = headerRow.createCell(i);
+            cell.setCellValue(headers.get(i));
+            cell.setCellStyle(baseCellStyle);
+            // 根据内容长度设置列宽
+            int columnWidth = headers.get(i).length() * 256 * 2 + 256;
+            sheet.setColumnWidth(i, columnWidth);
+        }
+        if (firstPo == null) {
+            return;
+        }
+        // 数据
+        AtomicInteger columnIndex1 = new AtomicInteger(0);
+        // 一级单位统计
+        Row row1 = sheet.createRow(rowIndex.getAndIncrement());
+        // 资产所属单位(一级)
+        Cell firstUnitCell1 = row1.createCell(columnIndex1.getAndIncrement());
+        if (firstPo.getAreaName() != null) {
+            firstUnitCell1.setCellValue(firstPo.getAreaName());
+        }
+        // 二级单位
+        Cell areaNameCell1 = row1.createCell(columnIndex1.getAndIncrement());
+//        if (firstPo.getAreaName() != null) {
+//            areaNameCell1.setCellValue(firstPo.getAreaName());
+//        }
+        // 三级单位
+        Cell cityNameCell1 = row1.createCell(columnIndex1.getAndIncrement());
+//        if (firstPo.getCityName() != null) {
+//            cityNameCell1.setCellValue(firstPo.getCityName());
+//        }
+        // 建筑面积-自有办公面积(平米)
+        Cell buildingAreaSelfUseSumCell1 = row1.createCell(columnIndex1.getAndIncrement());
+        if (firstPo.getBuildingAreaSelfUseSum() != null) {
+            buildingAreaSelfUseSumCell1.setCellValue(firstPo.getBuildingAreaSelfUseSum().doubleValue());
+        }
+        buildingAreaSelfUseSumCell1.setCellStyle(numberCellStyle);
+        // 县市的合同人员+紧密外包人员
+        Cell totalCell1 = row1.createCell(columnIndex1.getAndIncrement());
+        if (firstPo.getTotal() != null) {
+            totalCell1.setCellValue(firstPo.getTotal());
+        }
+        totalCell1.setCellStyle(integerCellStyle);
+        // 人均办公面积
+        Cell areaAvgCell1 = row1.createCell(columnIndex1.getAndIncrement());
+        if (firstPo.getAreaAvg() != null) {
+            areaAvgCell1.setCellValue(firstPo.getAreaAvg().doubleValue());
+        }
+        areaAvgCell1.setCellStyle(numberCellStyle);
+        // 二级单位统计
+        for (BuildingOfficeAreaStatPo secondPo : firstPo.getChildren()) {
+            AtomicInteger columnIndex2 = new AtomicInteger(0);
+            // 一级单位统计
+            Row row2 = sheet.createRow(rowIndex.getAndIncrement());
+            // 资产所属单位(一级)
+            Cell firstUnitCell2 = row2.createCell(columnIndex2.getAndIncrement());
+//            if (secondPo.getAreaName() != null) {
+//                firstUnitCell2.setCellValue(secondPo.getAreaName());
+//            }
+            // 二级单位
+            Cell areaNameCell2 = row2.createCell(columnIndex2.getAndIncrement());
+            if (secondPo.getAreaName() != null) {
+                areaNameCell2.setCellValue(secondPo.getAreaName());
+            }
+            // 三级单位
+            Cell cityNameCell2 = row2.createCell(columnIndex2.getAndIncrement());
+//            if (secondPo.getCityName() != null) {
+//                cityNameCell2.setCellValue(secondPo.getCityName());
+//            }
+            // 建筑面积-自有办公面积(平米)
+            Cell buildingAreaSelfUseSumCell2 = row2.createCell(columnIndex2.getAndIncrement());
+            if (secondPo.getBuildingAreaSelfUseSum() != null) {
+                buildingAreaSelfUseSumCell2.setCellValue(secondPo.getBuildingAreaSelfUseSum().doubleValue());
+            }
+            buildingAreaSelfUseSumCell2.setCellStyle(numberCellStyle);
+            // 县市的合同人员+紧密外包人员
+            Cell totalCell2 = row2.createCell(columnIndex2.getAndIncrement());
+            if (secondPo.getTotal() != null) {
+                totalCell2.setCellValue(secondPo.getTotal());
+            }
+            totalCell2.setCellStyle(integerCellStyle);
+            // 人均办公面积
+            Cell areaAvgCell2 = row2.createCell(columnIndex2.getAndIncrement());
+            if (secondPo.getAreaAvg() != null) {
+                areaAvgCell2.setCellValue(secondPo.getAreaAvg().doubleValue());
+            }
+            areaAvgCell2.setCellStyle(numberCellStyle);
+            // 三级单位统计
+            for (BuildingOfficeAreaStatPo thirdPo : secondPo.getChildren()) {
+                AtomicInteger columnIndex3 = new AtomicInteger(0);
+                Row row3 = sheet.createRow(rowIndex.getAndIncrement());
+                // 资产所属单位(一级)
+                Cell firstUnitCell3 = row3.createCell(columnIndex3.getAndIncrement());
+//                if (thirdPo.getAreaName() != null) {
+//                    firstUnitCell3.setCellValue(thirdPo.getAreaName());
+//                }
+                // 二级单位
+                Cell areaNameCell3 = row3.createCell(columnIndex3.getAndIncrement());
+//                if (thirdPo.getAreaName() != null) {
+//                    areaNameCell3.setCellValue(thirdPo.getAreaName());
+//                }
+                // 三级单位
+                Cell cityNameCell3 = row3.createCell(columnIndex3.getAndIncrement());
+                if (thirdPo.getCityName() != null) {
+                    cityNameCell3.setCellValue(thirdPo.getCityName());
+                }
+                // 建筑面积-自有办公面积(平米)
+                Cell buildingAreaSelfUseSumCell3 = row3.createCell(columnIndex3.getAndIncrement());
+                if (thirdPo.getBuildingAreaSelfUseSum() != null) {
+                    buildingAreaSelfUseSumCell3.setCellValue(thirdPo.getBuildingAreaSelfUseSum().doubleValue());
+                }
+                buildingAreaSelfUseSumCell3.setCellStyle(numberCellStyle);
+                // 县市的合同人员+紧密外包人员
+                Cell totalCell3 = row3.createCell(columnIndex3.getAndIncrement());
+                if (thirdPo.getTotal() != null) {
+                    totalCell3.setCellValue(thirdPo.getTotal());
+                }
+                totalCell3.setCellStyle(integerCellStyle);
+                // 人均办公面积
+                Cell areaAvgCell3 = row3.createCell(columnIndex3.getAndIncrement());
+                if (thirdPo.getAreaAvg() != null) {
+                    areaAvgCell3.setCellValue(thirdPo.getAreaAvg().doubleValue());
+                }
+                areaAvgCell3.setCellStyle(numberCellStyle);
+            }
+        }
+    }
+}