Selaa lähdekoodia

fix: 修复不动产高额日常零星维修统计错误、高总价统计、相同维修频次统计接口添加局址编号、局址别名字段

weijianghai 11 kuukautta sitten
vanhempi
commit
fe0eadb506
18 muutettua tiedostoa jossa 757 lisäystä ja 217 poistoa
  1. 22 23
      src/main/java/com/example/controller/WzHouseMaintenaCostController.java
  2. 13 0
      src/main/java/com/example/controller/house/HouseWzHouseMaintenaCostController.java
  3. 49 0
      src/main/java/com/example/dao/house/HouseRepairExceptionDao.java
  4. 12 0
      src/main/java/com/example/entity/house/HouseBuildingHighRepairPo.java
  5. 71 0
      src/main/java/com/example/entity/house/HouseBuildingHighSporadicRepairPo.java
  6. 12 0
      src/main/java/com/example/entity/house/HouseBuildingSameRepairFrequencyPo.java
  7. 51 0
      src/main/java/com/example/enums/ListBuildingHighSporadicRepairOrderEnum.java
  8. 8 0
      src/main/java/com/example/pojo/bo/ListBuildingHighRepairBo.java
  9. 27 0
      src/main/java/com/example/pojo/bo/ListBuildingHighSporadicRepairBo.java
  10. 8 0
      src/main/java/com/example/pojo/bo/ListBuildingSameRepairFrequencyBo.java
  11. 4 0
      src/main/java/com/example/pojo/dto/ListBuildingHighRepairDto.java
  12. 38 0
      src/main/java/com/example/pojo/dto/ListBuildingHighSporadicRepairDto.java
  13. 4 0
      src/main/java/com/example/pojo/dto/ListBuildingSameRepairFrequencyDto.java
  14. 21 15
      src/main/java/com/example/pojo/vo/ListBuildingHighRepairVo.java
  15. 41 0
      src/main/java/com/example/pojo/vo/ListBuildingHighSporadicRepairVo.java
  16. 6 0
      src/main/java/com/example/pojo/vo/ListBuildingSameRepairFrequencyVo.java
  17. 90 87
      src/main/java/com/example/service/house/HouseWzBuildManageDetailsService.java
  18. 280 92
      src/main/java/com/example/service/house/HouseWzHouseMaintenaCostService.java

+ 22 - 23
src/main/java/com/example/controller/WzHouseMaintenaCostController.java

@@ -4,7 +4,6 @@ import com.example.config.annotation.IgnoreAuth;
 import com.example.entity.OtnAreaEntity;
 import com.example.entity.WzHouseMaintEntity;
 import com.example.entity.WzHouseMaintenaCostEntity;
-import com.example.entity.WzStrategyEntity;
 import com.example.entity.vo.DailyModifyVo;
 import com.example.entity.vo.HighFrequencyVo;
 import com.example.entity.vo.housecost.HouseCostVo;
@@ -651,28 +650,28 @@ public class WzHouseMaintenaCostController {
     /**
      * 日常零星维修
      */
-    @RequestMapping("/queryDailyModify")
-    @IgnoreAuth
-    public R queryDailyModify(@RequestBody PageMap pageMap) {
-        Query query = new Query(pageMap);
-        Query query1 = new Query(pageMap);
-        //获取配置参数
-        int value=10000;
-        WzStrategyEntity objectByType = wzStrategyService.getObjectByType();
-        if(objectByType!=null){
-            String[] values=objectByType.getValue().split(",");
-            value=Integer.valueOf(values[3]);
-            query.put("erpCreditedAmount", value);
-            query1.put("erpCreditedAmount", value);
-        }
-        query.put("repairType", "零星维修");
-        List<DailyModifyVo> highPriceList = wzHouseMaintenaCostService.queryDailyModify(query);
-        query1.put("repairType", "零星维修");
-
-        int total = wzHouseMaintenaCostService.queryDailyModifyTotal(query1);
-        PageUtils pageUtil = new PageUtils(highPriceList, total, 10, 10);
-        return R.ok().put("page", pageUtil);
-    }
+//    @RequestMapping("/queryDailyModify")
+//    @IgnoreAuth
+//    public R queryDailyModify(@RequestBody PageMap pageMap) {
+//        Query query = new Query(pageMap);
+//        Query query1 = new Query(pageMap);
+//        //获取配置参数
+//        int value=10000;
+//        WzStrategyEntity objectByType = wzStrategyService.getObjectByType();
+//        if(objectByType!=null){
+//            String[] values=objectByType.getValue().split(",");
+//            value=Integer.valueOf(values[3]);
+//            query.put("erpCreditedAmount", value);
+//            query1.put("erpCreditedAmount", value);
+//        }
+//        query.put("repairType", "零星维修");
+//        List<DailyModifyVo> highPriceList = wzHouseMaintenaCostService.queryDailyModify(query);
+//        query1.put("repairType", "零星维修");
+//
+//        int total = wzHouseMaintenaCostService.queryDailyModifyTotal(query1);
+//        PageUtils pageUtil = new PageUtils(highPriceList, total, 10, 10);
+//        return R.ok().put("page", pageUtil);
+//    }
 
     /**
      * 闲置+不可用发生维修费

+ 13 - 0
src/main/java/com/example/controller/house/HouseWzHouseMaintenaCostController.java

@@ -1,6 +1,7 @@
 package com.example.controller.house;
 
 import com.example.pojo.dto.ListBuildingHighRepairDto;
+import com.example.pojo.dto.ListBuildingHighSporadicRepairDto;
 import com.example.pojo.dto.ListBuildingSameRepairFrequencyDto;
 import com.example.service.house.HouseWzHouseMaintenaCostService;
 import com.example.utils.R;
@@ -49,4 +50,16 @@ public class HouseWzHouseMaintenaCostController {
     public void queryHighFrequencyExport(@Valid ListBuildingSameRepairFrequencyDto dto) {
         houseWzHouseMaintenaCostService.queryHighFrequencyExport(dto);
     }
+
+    @Operation(summary = "高额日常零星维修")
+    @PostMapping("/queryDailyModify")
+    public R queryDailyModify(@Valid @RequestBody ListBuildingHighSporadicRepairDto dto) {
+        return houseWzHouseMaintenaCostService.queryDailyModify(dto);
+    }
+
+    @Operation(summary = "高额日常零星维修导出")
+    @GetMapping("/queryDailyModifyExport")
+    public void queryDailyModifyExport(@Valid ListBuildingHighSporadicRepairDto dto) {
+        houseWzHouseMaintenaCostService.queryDailyModifyExport(dto);
+    }
 }

+ 49 - 0
src/main/java/com/example/dao/house/HouseRepairExceptionDao.java

@@ -2,8 +2,10 @@ package com.example.dao.house;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.example.entity.house.HouseBuildingHighRepairPo;
+import com.example.entity.house.HouseBuildingHighSporadicRepairPo;
 import com.example.entity.house.HouseBuildingSameRepairFrequencyPo;
 import com.example.pojo.bo.ListBuildingHighRepairBo;
+import com.example.pojo.bo.ListBuildingHighSporadicRepairBo;
 import com.example.pojo.bo.ListBuildingSameRepairFrequencyBo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -36,6 +38,12 @@ from house.building_high_repair
   <if test="dto.cityNo != null and dto.cityNo != ''">
     and city_no = #{dto.cityNo}
   </if>
+  <if test="dto.siteNum != null and dto.siteNum != ''">
+    and site_num = #{dto.siteNum}
+  </if>
+  <if test="dto.siteName != null and dto.siteName != ''">
+    and site_name = #{dto.siteName}
+  </if>
 </where>
 </script>
 """)
@@ -65,10 +73,51 @@ from house.building_same_repair_frequency
   <if test="dto.cityNo != null and dto.cityNo != ''">
     and city_no = #{dto.cityNo}
   </if>
+  <if test="dto.siteNum != null and dto.siteNum != ''">
+    and site_num = #{dto.siteNum}
+  </if>
+  <if test="dto.siteName != null and dto.siteName != ''">
+    and site_name = #{dto.siteName}
+  </if>
 </where>
 </script>
 """)
     List<HouseBuildingSameRepairFrequencyPo> listBuildingSameRepairFrequency(
             Page<HouseBuildingSameRepairFrequencyPo> page,
             @Param("dto") ListBuildingSameRepairFrequencyBo dto);
+
+    /**
+     * 查询不动产自有房产高额零星维修统计
+     */
+    @Select("""
+<script>
+select
+*
+from house.building_high_sporadic_repair
+<where>
+  <choose>
+    <when test="dto.yearMonth != null">
+      year_month = #{dto.yearMonth}
+    </when>
+    <otherwise>
+      year_month = (select max(year_month) from house.building_high_sporadic_repair)
+    </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.siteNum != null and dto.siteNum != ''">
+    and site_num = #{dto.siteNum}
+  </if>
+  <if test="dto.siteName != null and dto.siteName != ''">
+    and site_name = #{dto.siteName}
+  </if>
+</where>
+</script>
+""")
+    List<HouseBuildingHighSporadicRepairPo> ListBuildingHighSporadicRepair(
+            Page<HouseBuildingHighSporadicRepairPo> page, @Param("dto") ListBuildingHighSporadicRepairBo dto);
 }

+ 12 - 0
src/main/java/com/example/entity/house/HouseBuildingHighRepairPo.java

@@ -80,4 +80,16 @@ public class HouseBuildingHighRepairPo {
      * 建筑面积-不可使用(㎡)
      */
     private BigDecimal buildingAreaUnusable;
+    /**
+     * 局址id
+     */
+    private String siteId;
+    /**
+     * 局址编号
+     */
+    private String siteNum;
+    /**
+     * 局址别名
+     */
+    private String siteName;
 }

+ 71 - 0
src/main/java/com/example/entity/house/HouseBuildingHighSporadicRepairPo.java

@@ -0,0 +1,71 @@
+package com.example.entity.house;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+
+@NoArgsConstructor
+@Data
+public class HouseBuildingHighSporadicRepairPo {
+    /**
+     * 账期
+     */
+    private Integer yearMonth;
+    /**
+     * 建筑id
+     */
+    private String buildingId;
+    /**
+     * 建筑别名
+     */
+    private String buildingName;
+    /**
+     * 维修年月
+     */
+    private Integer repairYearMonth;
+    /**
+     * 维修类型
+     */
+    private String repairType;
+    /**
+     * 维修内容
+     */
+    private String repairContent;
+    /**
+     * 维修金额
+     */
+    private BigDecimal amount;
+    /**
+     * 本年超1万元次数
+     */
+    private Integer total;
+    /**
+     * 二级组织机构编码
+     */
+    private String areaNo;
+    /**
+     * 二级组织机构名称
+     */
+    private String areaName;
+    /**
+     * 三级组织机构编码
+     */
+    private String cityNo;
+    /**
+     * 三级组织机构名称
+     */
+    private String cityName;
+    /**
+     * 局址id
+     */
+    private String siteId;
+    /**
+     * 局址编号
+     */
+    private String siteNum;
+    /**
+     * 局址别名
+     */
+    private String siteName;
+}

+ 12 - 0
src/main/java/com/example/entity/house/HouseBuildingSameRepairFrequencyPo.java

@@ -54,4 +54,16 @@ public class HouseBuildingSameRepairFrequencyPo {
      * 历史累计维修频率
      */
     private Integer historyTotal;
+    /**
+     * 局址id
+     */
+    private String siteId;
+    /**
+     * 局址编号
+     */
+    private String siteNum;
+    /**
+     * 局址别名
+     */
+    private String siteName;
 }

+ 51 - 0
src/main/java/com/example/enums/ListBuildingHighSporadicRepairOrderEnum.java

@@ -0,0 +1,51 @@
+package com.example.enums;
+
+public enum ListBuildingHighSporadicRepairOrderEnum {
+    /**
+     * 二级单位
+     */
+    city("area_name"),
+    /**
+     * 建筑别名
+     */
+    buildingAlias("building_name"),
+    /**
+     * 维修时间
+     */
+    date("repair_year_month"),
+    /**
+     * 维修类型
+     */
+    repairType("repair_type"),
+    /**
+     * 维修内容
+     */
+    repairContent("repair_content"),
+    /**
+     * 维修金额
+     */
+    erpMoney("amount"),
+    /**
+     * 本年超1万元次数
+     */
+    num("total"),
+    /**
+     * 局址编号
+     */
+    siteNum("site_num"),
+    /**
+     * 局址别名
+     */
+    siteName("site_name"),
+    ;
+
+    private final String columnName;
+
+    ListBuildingHighSporadicRepairOrderEnum(String columnName) {
+        this.columnName = columnName;
+    }
+
+    public String getColumnName() {
+        return columnName;
+    }
+}

+ 8 - 0
src/main/java/com/example/pojo/bo/ListBuildingHighRepairBo.java

@@ -16,4 +16,12 @@ public class ListBuildingHighRepairBo {
      * 三级组织机构编码
      */
     private String cityNo;
+    /**
+     * 局址编号
+     */
+    private String siteNum;
+    /**
+     * 局址别名
+     */
+    private String siteName;
 }

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

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

+ 8 - 0
src/main/java/com/example/pojo/bo/ListBuildingSameRepairFrequencyBo.java

@@ -16,4 +16,12 @@ public class ListBuildingSameRepairFrequencyBo {
      * 三级组织机构编码
      */
     private String cityNo;
+    /**
+     * 局址编号
+     */
+    private String siteNum;
+    /**
+     * 局址别名
+     */
+    private String siteName;
 }

+ 4 - 0
src/main/java/com/example/pojo/dto/ListBuildingHighRepairDto.java

@@ -30,5 +30,9 @@ public class ListBuildingHighRepairDto {
         private ListBuildingHighRepairOrderEnum sidx;
         @Schema(description = "排序方式")
         private OrderEnum order;
+        @Schema(description = "局址别名")
+        private String buildingNameAlias;
+        @Schema(description = "局址编号")
+        private String buildingAddressNumber;
     }
 }

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

@@ -0,0 +1,38 @@
+package com.example.pojo.dto;
+
+import com.example.enums.ListBuildingHighSporadicRepairOrderEnum;
+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 javax.validation.Valid;
+
+@NoArgsConstructor
+@Data
+public class ListBuildingHighSporadicRepairDto {
+    @Valid
+    private Page page;
+    @Valid
+    private MapDTO map;
+
+    @NoArgsConstructor
+    @Data
+    public static class MapDTO {
+        @Schema(description = "账期")
+        private Integer statisticalMonth;
+        @Schema(description = "二级组织机构id")
+        private String city;
+        @Schema(description = "三级级组织机构id")
+        private String county;
+        @Schema(description = "排序字段")
+        private ListBuildingHighSporadicRepairOrderEnum sidx;
+        @Schema(description = "排序方式")
+        private OrderEnum order;
+        @Schema(description = "局址别名")
+        private String buildingNameAlias;
+        @Schema(description = "局址编号")
+        private String buildingAddressNumber;
+    }
+}

+ 4 - 0
src/main/java/com/example/pojo/dto/ListBuildingSameRepairFrequencyDto.java

@@ -30,5 +30,9 @@ public class ListBuildingSameRepairFrequencyDto {
         private ListBuildingSameRepairFrequencyOrderEnum sidx;
         @Schema(description = "排序方式")
         private OrderEnum order;
+        @Schema(description = "局址别名")
+        private String buildingNameAlias;
+        @Schema(description = "局址编号")
+        private String buildingAddressNumber;
     }
 }

+ 21 - 15
src/main/java/com/example/pojo/vo/ListBuildingHighRepairVo.java

@@ -36,21 +36,27 @@ public class ListBuildingHighRepairVo {
     private BigDecimal buildingAreaUnavailable;
     @Schema(description = "最近入账日期")
     private Integer statisticalMonth;
+    @Schema(description = "局址编号")
+    private String siteNum;
+    @Schema(description = "局址别名")
+    private String siteName;
 
-    public ListBuildingHighRepairVo(HouseBuildingHighRepairPo bo) {
-        this.repairType = bo.getRepairType();
-        this.repairContent = bo.getContentCategory();
-        this.erpCreditedAmount = bo.getFinalCostSum();
-        this.city = bo.getAreaName();
-        this.county = bo.getCityName();
-        this.standardAddress = bo.getAddress();
-        this.buildingAlias = bo.getBuildingName();
-        this.buildingUse = bo.getBuildingUse();
-        this.buildingArea = bo.getBuildingArea();
-        this.buildingAreaUseArea = bo.getBuildingAreaSelfUse();
-        this.buildingAreaRentArea = bo.getBuildingAreaRent();
-        this.buildingAreaIdelArea = bo.getBuildingAreaIdle();
-        this.buildingAreaUnavailable = bo.getBuildingAreaUnusable();
-        this.statisticalMonth = bo.getLatestRepairMonth();
+    public ListBuildingHighRepairVo(HouseBuildingHighRepairPo po) {
+        this.repairType = po.getRepairType();
+        this.repairContent = po.getContentCategory();
+        this.erpCreditedAmount = po.getFinalCostSum();
+        this.city = po.getAreaName();
+        this.county = po.getCityName();
+        this.standardAddress = po.getAddress();
+        this.buildingAlias = po.getBuildingName();
+        this.buildingUse = po.getBuildingUse();
+        this.buildingArea = po.getBuildingArea();
+        this.buildingAreaUseArea = po.getBuildingAreaSelfUse();
+        this.buildingAreaRentArea = po.getBuildingAreaRent();
+        this.buildingAreaIdelArea = po.getBuildingAreaIdle();
+        this.buildingAreaUnavailable = po.getBuildingAreaUnusable();
+        this.statisticalMonth = po.getLatestRepairMonth();
+        this.siteNum = po.getSiteNum();
+        this.siteName = po.getSiteName();
     }
 }

+ 41 - 0
src/main/java/com/example/pojo/vo/ListBuildingHighSporadicRepairVo.java

@@ -0,0 +1,41 @@
+package com.example.pojo.vo;
+
+import com.example.entity.house.HouseBuildingHighSporadicRepairPo;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class ListBuildingHighSporadicRepairVo {
+    @Schema(description = "二级单位")
+    private String city;
+    @Schema(description = "维修内容")
+    private String repairContent;
+    @Schema(description = "维修类型")
+    private String repairType;
+    @Schema(description = "维修金额")
+    private BigDecimal erpMoney;
+    @Schema(description = "本年超1万元次数")
+    private Integer num;
+    @Schema(description = "维修年月")
+    private Integer date;
+    @Schema(description = "建筑别名")
+    private String buildingAlias;
+    @Schema(description = "局址编号")
+    private String siteNum;
+    @Schema(description = "局址别名")
+    private String siteName;
+
+    public ListBuildingHighSporadicRepairVo(HouseBuildingHighSporadicRepairPo po) {
+        this.city = po.getAreaName();
+        this.repairContent = po.getRepairContent();
+        this.repairType = po.getRepairType();
+        this.erpMoney = po.getAmount();
+        this.num = po.getTotal();
+        this.date = po.getRepairYearMonth();
+        this.buildingAlias = po.getBuildingName();
+        this.siteNum = po.getSiteNum();
+        this.siteName = po.getSiteName();
+    }
+}

+ 6 - 0
src/main/java/com/example/pojo/vo/ListBuildingSameRepairFrequencyVo.java

@@ -24,6 +24,10 @@ public class ListBuildingSameRepairFrequencyVo {
     private String contentCategory;
     @Schema(description = "历史累计维修频率")
     private Integer historyTotal;
+    @Schema(description = "局址编号")
+    private String siteNum;
+    @Schema(description = "局址别名")
+    private String siteName;
 
     public ListBuildingSameRepairFrequencyVo(HouseBuildingSameRepairFrequencyPo po) {
         this.buildingId = po.getBuildingId();
@@ -35,5 +39,7 @@ public class ListBuildingSameRepairFrequencyVo {
         this.num = po.getTyTotal();
         this.order = po.getTyTotalRank();
         this.historyTotal = po.getHistoryTotal();
+        this.siteNum = po.getSiteNum();
+        this.siteName = po.getSiteName();
     }
 }

+ 90 - 87
src/main/java/com/example/service/house/HouseWzBuildManageDetailsService.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.OrderItem;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.example.dao.house.HouseBuildingDao;
 import com.example.entity.house.HouseBuildingPo;
+import com.example.enums.ListBuildingIdleOrderEnum;
 import com.example.enums.OrderEnum;
 import com.example.pojo.bo.ListBuildingIdleBo;
 import com.example.pojo.dto.ListBuildingIdleDto;
@@ -92,6 +93,8 @@ public class HouseWzBuildManageDetailsService {
             } else {
                 page.addOrder(OrderItem.desc(dto.getMap().getSidx().getColumnName()));
             }
+        } else {
+            page.addOrder(OrderItem.desc(ListBuildingIdleOrderEnum.buildingAreaIdelArea.getColumnName()));
         }
         return houseBuildingDao.listBuildingIdle(page, bo);
     }
@@ -135,236 +138,236 @@ public class HouseWzBuildManageDetailsService {
             sheet.setColumnWidth(i, columnWidth);
         }
         // 数据
-        for (HouseBuildingPo houseBuildingPo : list) {
+        for (HouseBuildingPo po : list) {
             AtomicInteger columnIndex = new AtomicInteger(0);
             Row row = sheet.createRow(rowIndex.getAndIncrement());
             // 资产所属单位(一级)
             Cell firstUnitCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getFirstUnit() != null) {
-                firstUnitCell.setCellValue(houseBuildingPo.getFirstUnit());
+            if (po.getFirstUnit() != null) {
+                firstUnitCell.setCellValue(po.getFirstUnit());
             }
             // 二级单位
             Cell areaNameCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getAreaName() != null) {
-                areaNameCell.setCellValue(houseBuildingPo.getAreaName());
+            if (po.getAreaName() != null) {
+                areaNameCell.setCellValue(po.getAreaName());
             }
             // 三级单位
             Cell cityNameCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getCityName() != null) {
-                cityNameCell.setCellValue(houseBuildingPo.getCityName());
+            if (po.getCityName() != null) {
+                cityNameCell.setCellValue(po.getCityName());
             }
             // 局址编号
             Cell siteNumCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getSiteName() != null) {
-                siteNumCell.setCellValue(houseBuildingPo.getSiteNum());
+            if (po.getSiteName() != null) {
+                siteNumCell.setCellValue(po.getSiteNum());
             }
             // 局址别名
             Cell siteNameCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getSiteName() != null) {
-                siteNameCell.setCellValue(houseBuildingPo.getSiteName());
+            if (po.getSiteName() != null) {
+                siteNameCell.setCellValue(po.getSiteName());
             }
             // 建筑别名
             Cell buildingNameCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getBuildingName() != null) {
-                buildingNameCell.setCellValue(houseBuildingPo.getBuildingName());
+            if (po.getBuildingName() != null) {
+                buildingNameCell.setCellValue(po.getBuildingName());
             }
             // 地段
             Cell areaSectorCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getAreaSector() != null) {
-                areaSectorCell.setCellValue(houseBuildingPo.getAreaSector());
+            if (po.getAreaSector() != null) {
+                areaSectorCell.setCellValue(po.getAreaSector());
             }
             // 建筑面积(㎡)
             Cell buildingAreaCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getBuildingArea() != null) {
-                buildingAreaCell.setCellValue(houseBuildingPo.getBuildingArea().doubleValue());
+            if (po.getBuildingArea() != null) {
+                buildingAreaCell.setCellValue(po.getBuildingArea().doubleValue());
             }
             buildingAreaCell.setCellStyle(numberCellStyle);
             // 建筑面积-出租(㎡)
             Cell buildingAreaRentCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getBuildingAreaRent() != null) {
-                buildingAreaRentCell.setCellValue(houseBuildingPo.getBuildingAreaRent().doubleValue());
+            if (po.getBuildingAreaRent() != null) {
+                buildingAreaRentCell.setCellValue(po.getBuildingAreaRent().doubleValue());
             }
             buildingAreaRentCell.setCellStyle(numberCellStyle);
             // 建筑面积-闲置(㎡)
             Cell buildingAreaIdleCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getBuildingAreaIdle() != null) {
-                buildingAreaIdleCell.setCellValue(houseBuildingPo.getBuildingAreaIdle().doubleValue());
+            if (po.getBuildingAreaIdle() != null) {
+                buildingAreaIdleCell.setCellValue(po.getBuildingAreaIdle().doubleValue());
             }
             buildingAreaIdleCell.setCellStyle(numberCellStyle);
             // 建筑面积-自用(㎡)
             Cell buildingAreaSelfUseCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getBuildingAreaSelfUse() != null) {
-                buildingAreaSelfUseCell.setCellValue(houseBuildingPo.getBuildingAreaSelfUse().doubleValue());
+            if (po.getBuildingAreaSelfUse() != null) {
+                buildingAreaSelfUseCell.setCellValue(po.getBuildingAreaSelfUse().doubleValue());
             }
             buildingAreaSelfUseCell.setCellStyle(numberCellStyle);
             // 建筑面积-不可使用(㎡)
             Cell buildingAreaUnusableCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getBuildingAreaUnusable() != null) {
-                buildingAreaUnusableCell.setCellValue(houseBuildingPo.getBuildingAreaUnusable().doubleValue());
+            if (po.getBuildingAreaUnusable() != null) {
+                buildingAreaUnusableCell.setCellValue(po.getBuildingAreaUnusable().doubleValue());
             }
             buildingAreaUnusableCell.setCellStyle(numberCellStyle);
             // 上级土地名称
             Cell landNameCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getLandName() != null) {
-                landNameCell.setCellValue(houseBuildingPo.getLandName());
+            if (po.getLandName() != null) {
+                landNameCell.setCellValue(po.getLandName());
             }
             // 得房率
             Cell housingAcquisitionRateCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getHousingAcquisitionRate() != null) {
-                housingAcquisitionRateCell.setCellValue(houseBuildingPo.getHousingAcquisitionRate().doubleValue());
+            if (po.getHousingAcquisitionRate() != null) {
+                housingAcquisitionRateCell.setCellValue(po.getHousingAcquisitionRate().doubleValue());
             }
             housingAcquisitionRateCell.setCellStyle(percentCellStyle);
             // 房屋来源
             Cell housingSourceCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getHousingSource() != null) {
-                housingSourceCell.setCellValue(houseBuildingPo.getHousingSource());
+            if (po.getHousingSource() != null) {
+                housingSourceCell.setCellValue(po.getHousingSource());
             }
             // 取得日期
             Cell acquisitionDateCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getAcquisitionDate() != null) {
-                acquisitionDateCell.setCellValue(houseBuildingPo.getAcquisitionDate());
+            if (po.getAcquisitionDate() != null) {
+                acquisitionDateCell.setCellValue(po.getAcquisitionDate());
             }
             // 房龄开始年份
             Cell houseYearBeganCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getHouseYearBegan() != null) {
-                houseYearBeganCell.setCellValue(houseBuildingPo.getHouseYearBegan());
+            if (po.getHouseYearBegan() != null) {
+                houseYearBeganCell.setCellValue(po.getHouseYearBegan());
             }
             // 投资主体
             Cell investorCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getInvestor() != null) {
-                investorCell.setCellValue(houseBuildingPo.getInvestor());
+            if (po.getInvestor() != null) {
+                investorCell.setCellValue(po.getInvestor());
             }
             // 管理层级
             Cell managementLevelCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getManagementLevel() != null) {
-                managementLevelCell.setCellValue(houseBuildingPo.getManagementLevel());
+            if (po.getManagementLevel() != null) {
+                managementLevelCell.setCellValue(po.getManagementLevel());
             }
             // 房屋结构
             Cell buildingStructureCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getBuildingStructure() != null) {
-                buildingStructureCell.setCellValue(houseBuildingPo.getBuildingStructure());
+            if (po.getBuildingStructure() != null) {
+                buildingStructureCell.setCellValue(po.getBuildingStructure());
             }
             // 楼层总数
             Cell totalFloorsCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getTotalFloors() != null) {
-                totalFloorsCell.setCellValue(houseBuildingPo.getTotalFloors());
+            if (po.getTotalFloors() != null) {
+                totalFloorsCell.setCellValue(po.getTotalFloors());
             }
             // 是否临街
             Cell frontageCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getFrontage() != null) {
-                frontageCell.setCellValue(houseBuildingPo.getFrontage());
+            if (po.getFrontage() != null) {
+                frontageCell.setCellValue(po.getFrontage());
             }
             // 是否有院落
             Cell courtyardCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getCourtyard() != null) {
-                courtyardCell.setCellValue(houseBuildingPo.getCourtyard());
+            if (po.getCourtyard() != null) {
+                courtyardCell.setCellValue(po.getCourtyard());
             }
             // 整栋是否独有
             Cell wholeBuildingCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getWholeBuilding() != null) {
-                wholeBuildingCell.setCellValue(houseBuildingPo.getWholeBuilding());
+            if (po.getWholeBuilding() != null) {
+                wholeBuildingCell.setCellValue(po.getWholeBuilding());
             }
             // 是否有房产证
             Cell propertyOwnershipCertificateCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getPropertyOwnershipCertificate() != null) {
-                propertyOwnershipCertificateCell.setCellValue(houseBuildingPo.getPropertyOwnershipCertificate());
+            if (po.getPropertyOwnershipCertificate() != null) {
+                propertyOwnershipCertificateCell.setCellValue(po.getPropertyOwnershipCertificate());
             }
             // 无房产证原因
             Cell noPropertyOwnershipCertificateReasonCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getNoPropertyOwnershipCertificateReason() != null) {
+            if (po.getNoPropertyOwnershipCertificateReason() != null) {
                 noPropertyOwnershipCertificateReasonCell.setCellValue(
-                        houseBuildingPo.getNoPropertyOwnershipCertificateReason());
+                        po.getNoPropertyOwnershipCertificateReason());
             }
             // 未关联资产
             Cell unrelatedAssetsCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getUnrelatedAssets() != null) {
-                unrelatedAssetsCell.setCellValue(houseBuildingPo.getUnrelatedAssets());
+            if (po.getUnrelatedAssets() != null) {
+                unrelatedAssetsCell.setCellValue(po.getUnrelatedAssets());
             }
             // 资产编号
             Cell assetsNumCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getAssetsNum() != null) {
-                assetsNumCell.setCellValue(houseBuildingPo.getAssetsNum());
+            if (po.getAssetsNum() != null) {
+                assetsNumCell.setCellValue(po.getAssetsNum());
             }
             // 资产标签号
             Cell assetsTagNumCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getAssetsTagNum() != null) {
-                assetsTagNumCell.setCellValue(houseBuildingPo.getAssetsTagNum());
+            if (po.getAssetsTagNum() != null) {
+                assetsTagNumCell.setCellValue(po.getAssetsTagNum());
             }
             // 使用状态
             Cell usageStatusCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getUsageStatus() != null) {
-                usageStatusCell.setCellValue(houseBuildingPo.getUsageStatus());
+            if (po.getUsageStatus() != null) {
+                usageStatusCell.setCellValue(po.getUsageStatus());
             }
             // 建筑用途
             Cell buildingUseCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getBuildingUse() != null) {
-                buildingUseCell.setCellValue(houseBuildingPo.getBuildingUse());
+            if (po.getBuildingUse() != null) {
+                buildingUseCell.setCellValue(po.getBuildingUse());
             }
             // 权属状态
             Cell ownershipStatusCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getOwnershipStatus() != null) {
-                ownershipStatusCell.setCellValue(houseBuildingPo.getOwnershipStatus());
+            if (po.getOwnershipStatus() != null) {
+                ownershipStatusCell.setCellValue(po.getOwnershipStatus());
             }
             // 建筑占地面积(㎡)
             Cell floorAreaCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getFloorArea() != null) {
-                floorAreaCell.setCellValue(houseBuildingPo.getFloorArea().doubleValue());
+            if (po.getFloorArea() != null) {
+                floorAreaCell.setCellValue(po.getFloorArea().doubleValue());
             }
             floorAreaCell.setCellStyle(numberCellStyle);
             // 使用面积(㎡)
             Cell usableAreaCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getUsableArea() != null) {
-                usableAreaCell.setCellValue(houseBuildingPo.getUsableArea().doubleValue());
+            if (po.getUsableArea() != null) {
+                usableAreaCell.setCellValue(po.getUsableArea().doubleValue());
             }
             usableAreaCell.setCellStyle(numberCellStyle);
             // 使用面积-自用(㎡)
             Cell usableAreaSelfUseCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getUsableAreaSelfUse() != null) {
-                usableAreaSelfUseCell.setCellValue(houseBuildingPo.getUsableAreaSelfUse().doubleValue());
+            if (po.getUsableAreaSelfUse() != null) {
+                usableAreaSelfUseCell.setCellValue(po.getUsableAreaSelfUse().doubleValue());
             }
             usableAreaSelfUseCell.setCellStyle(numberCellStyle);
             // 使用面积-出租(㎡)
             Cell usableAreaRentCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getUsableAreaRent() != null) {
-                usableAreaRentCell.setCellValue(houseBuildingPo.getUsableAreaRent().doubleValue());
+            if (po.getUsableAreaRent() != null) {
+                usableAreaRentCell.setCellValue(po.getUsableAreaRent().doubleValue());
             }
             usableAreaRentCell.setCellStyle(numberCellStyle);
             // 使用面积-闲置(㎡)
             Cell usableAreaIdleCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getUsableAreaIdle() != null) {
-                usableAreaIdleCell.setCellValue(houseBuildingPo.getUsableAreaIdle().doubleValue());
+            if (po.getUsableAreaIdle() != null) {
+                usableAreaIdleCell.setCellValue(po.getUsableAreaIdle().doubleValue());
             }
             usableAreaIdleCell.setCellStyle(numberCellStyle);
             // 使用面积-不可使用(㎡)
             Cell usableAreaUnusableCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getUsableAreaUnusable() != null) {
-                usableAreaUnusableCell.setCellValue(houseBuildingPo.getUsableAreaUnusable().doubleValue());
+            if (po.getUsableAreaUnusable() != null) {
+                usableAreaUnusableCell.setCellValue(po.getUsableAreaUnusable().doubleValue());
             }
             usableAreaUnusableCell.setCellStyle(numberCellStyle);
             // 楼长姓名
             Cell communityAssistantNameCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getCommunityAssistantName() != null) {
-                communityAssistantNameCell.setCellValue(houseBuildingPo.getCommunityAssistantName());
+            if (po.getCommunityAssistantName() != null) {
+                communityAssistantNameCell.setCellValue(po.getCommunityAssistantName());
             }
             // 楼长所在单位
             Cell communityAssistantUnitCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getCommunityAssistantUnit() != null) {
-                communityAssistantUnitCell.setCellValue(houseBuildingPo.getCommunityAssistantUnit());
+            if (po.getCommunityAssistantUnit() != null) {
+                communityAssistantUnitCell.setCellValue(po.getCommunityAssistantUnit());
             }
             // 经度
             Cell lngJtCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getLngJt() != null) {
-                lngJtCell.setCellValue(houseBuildingPo.getLngJt().toString());
+            if (po.getLngJt() != null) {
+                lngJtCell.setCellValue(po.getLngJt().toString());
             }
             // 纬度
             Cell latJtCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getLatJt() != null) {
-                latJtCell.setCellValue(houseBuildingPo.getLatJt().toString());
+            if (po.getLatJt() != null) {
+                latJtCell.setCellValue(po.getLatJt().toString());
             }
             // 实际产权人
             Cell propertyOwnerCell = row.createCell(columnIndex.getAndIncrement());
-            if (houseBuildingPo.getPropertyOwner() != null) {
-                propertyOwnerCell.setCellValue(houseBuildingPo.getPropertyOwner());
+            if (po.getPropertyOwner() != null) {
+                propertyOwnerCell.setCellValue(po.getPropertyOwner());
             }
         }
     }

+ 280 - 92
src/main/java/com/example/service/house/HouseWzHouseMaintenaCostService.java

@@ -5,13 +5,20 @@ import com.baomidou.mybatisplus.core.metadata.OrderItem;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.example.dao.house.HouseRepairExceptionDao;
 import com.example.entity.house.HouseBuildingHighRepairPo;
+import com.example.entity.house.HouseBuildingHighSporadicRepairPo;
 import com.example.entity.house.HouseBuildingSameRepairFrequencyPo;
+import com.example.enums.ListBuildingHighRepairOrderEnum;
+import com.example.enums.ListBuildingHighSporadicRepairOrderEnum;
+import com.example.enums.ListBuildingSameRepairFrequencyOrderEnum;
 import com.example.enums.OrderEnum;
 import com.example.pojo.bo.ListBuildingHighRepairBo;
+import com.example.pojo.bo.ListBuildingHighSporadicRepairBo;
 import com.example.pojo.bo.ListBuildingSameRepairFrequencyBo;
 import com.example.pojo.dto.ListBuildingHighRepairDto;
+import com.example.pojo.dto.ListBuildingHighSporadicRepairDto;
 import com.example.pojo.dto.ListBuildingSameRepairFrequencyDto;
 import com.example.pojo.vo.ListBuildingHighRepairVo;
+import com.example.pojo.vo.ListBuildingHighSporadicRepairVo;
 import com.example.pojo.vo.ListBuildingSameRepairFrequencyVo;
 import com.example.utils.PageUtils;
 import com.example.utils.R;
@@ -22,7 +29,6 @@ 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.ss.util.CellReference;
 import org.apache.poi.xssf.streaming.SXSSFSheet;
 import org.apache.poi.xssf.streaming.SXSSFWorkbook;
 import org.springframework.stereotype.Service;
@@ -95,12 +101,20 @@ public class HouseWzHouseMaintenaCostService {
         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(ListBuildingHighRepairOrderEnum.erpCreditedAmount.getColumnName()));
         }
         return houseRepairExceptionDao.listBuildingHighRepair(page, bo);
     }
@@ -121,12 +135,12 @@ public class HouseWzHouseMaintenaCostService {
         baseCellStyle.setAlignment(HorizontalAlignment.CENTER);
         baseCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
         SXSSFSheet sheet = wb.createSheet();
-        AtomicInteger columnIndex = new AtomicInteger(0);
+        AtomicInteger rowIndex = new AtomicInteger(0);
         // 表头
-        Row headerRow = sheet.createRow(columnIndex.getAndIncrement());
-        List<String> headers = Stream.of("入账日期", "二级单位", "三级单位", "建筑别名", "维修类型", "维修内容",
-                "erp入账金额元", "标准地址", "建筑用途", "建筑面积㎡", "建筑面积自用㎡", "建筑面积出租㎡", "建筑面积闲置㎡",
-                        "建筑面积不可使用㎡").toList();
+        Row headerRow = sheet.createRow(rowIndex.getAndIncrement());
+        List<String> headers = Stream.of("入账日期", "二级单位", "三级单位", "局址编号", "局址别名", "建筑别名",
+                "维修类型", "维修内容", "erp入账金额元", "标准地址", "建筑用途", "建筑面积㎡", "建筑面积自用㎡", "建筑面积出租㎡",
+                "建筑面积闲置㎡", "建筑面积不可使用㎡").toList();
         int headerLength = headers.size();
         for (int i = 0; i < headerLength; i++) {
             Cell cell = headerRow.createCell(i);
@@ -137,84 +151,95 @@ public class HouseWzHouseMaintenaCostService {
             sheet.setColumnWidth(i, columnWidth);
         }
         // 数据
-        for (HouseBuildingHighRepairPo houseBuildingHighRepairPo : list) {
-            Row row = sheet.createRow(columnIndex.getAndIncrement());
+        for (HouseBuildingHighRepairPo po : list) {
+            AtomicInteger columnIndex = new AtomicInteger(0);
+            Row row = sheet.createRow(rowIndex.getAndIncrement());
             // 入账日期
-            Cell a = row.createCell(CellReference.convertColStringToIndex("a"));
-            if (houseBuildingHighRepairPo.getLatestRepairMonth() != null) {
-                a.setCellValue(houseBuildingHighRepairPo.getLatestRepairMonth());
+            Cell latestRepairMonthCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getLatestRepairMonth() != null) {
+                latestRepairMonthCell.setCellValue(po.getLatestRepairMonth());
             }
             // 二级单位
-            Cell b = row.createCell(CellReference.convertColStringToIndex("b"));
-            if (houseBuildingHighRepairPo.getAreaName() != null) {
-                b.setCellValue(houseBuildingHighRepairPo.getAreaName());
+            Cell areaNameCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getAreaName() != null) {
+                areaNameCell.setCellValue(po.getAreaName());
             }
             // 三级单位
-            Cell c = row.createCell(CellReference.convertColStringToIndex("c"));
-            if (houseBuildingHighRepairPo.getCityName() != null) {
-                c.setCellValue(houseBuildingHighRepairPo.getCityName());
+            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 d = row.createCell(CellReference.convertColStringToIndex("d"));
-            if (houseBuildingHighRepairPo.getBuildingName() != null) {
-                d.setCellValue(houseBuildingHighRepairPo.getBuildingName());
+            Cell buildingNameCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getBuildingName() != null) {
+                buildingNameCell.setCellValue(po.getBuildingName());
             }
             // 维修类型
-            Cell e = row.createCell(CellReference.convertColStringToIndex("e"));
-            if (houseBuildingHighRepairPo.getRepairType() != null) {
-                e.setCellValue(houseBuildingHighRepairPo.getRepairType());
+            Cell repairTypeCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getRepairType() != null) {
+                repairTypeCell.setCellValue(po.getRepairType());
             }
             // 维修内容
-            Cell f = row.createCell(CellReference.convertColStringToIndex("f"));
-            if (houseBuildingHighRepairPo.getContentCategory() != null) {
-                f.setCellValue(houseBuildingHighRepairPo.getContentCategory());
+            Cell contentCategoryCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getContentCategory() != null) {
+                contentCategoryCell.setCellValue(po.getContentCategory());
             }
             // erp入账金额元
-            Cell g = row.createCell(CellReference.convertColStringToIndex("g"));
-            if (houseBuildingHighRepairPo.getFinalCostSum() != null) {
-                g.setCellValue(houseBuildingHighRepairPo.getFinalCostSum().doubleValue());
+            Cell finalCostSumCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getFinalCostSum() != null) {
+                finalCostSumCell.setCellValue(po.getFinalCostSum().doubleValue());
             }
-            g.setCellStyle(numberCellStyle);
+            finalCostSumCell.setCellStyle(numberCellStyle);
             // 标准地址
-            Cell h = row.createCell(CellReference.convertColStringToIndex("h"));
-            if (houseBuildingHighRepairPo.getAddress() != null) {
-                h.setCellValue(houseBuildingHighRepairPo.getAddress());
+            Cell addressCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getAddress() != null) {
+                addressCell.setCellValue(po.getAddress());
             }
             // 建筑用途
-            Cell i = row.createCell(CellReference.convertColStringToIndex("i"));
-            if (houseBuildingHighRepairPo.getBuildingUse() != null) {
-                i.setCellValue(houseBuildingHighRepairPo.getBuildingUse());
+            Cell buildingUseCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getBuildingUse() != null) {
+                buildingUseCell.setCellValue(po.getBuildingUse());
             }
             // 建筑面积㎡
-            Cell j = row.createCell(CellReference.convertColStringToIndex("j"));
-            if (houseBuildingHighRepairPo.getBuildingArea() != null) {
-                j.setCellValue(houseBuildingHighRepairPo.getBuildingArea().doubleValue());
+            Cell buildingAreaCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getBuildingArea() != null) {
+                buildingAreaCell.setCellValue(po.getBuildingArea().doubleValue());
             }
-            j.setCellStyle(numberCellStyle);
+            buildingAreaCell.setCellStyle(numberCellStyle);
             // 建筑面积自用㎡
-            Cell k = row.createCell(CellReference.convertColStringToIndex("k"));
-            if (houseBuildingHighRepairPo.getBuildingAreaSelfUse() != null) {
-                k.setCellValue(houseBuildingHighRepairPo.getBuildingAreaSelfUse().doubleValue());
+            Cell buildingAreaSelfUseCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getBuildingAreaSelfUse() != null) {
+                buildingAreaSelfUseCell.setCellValue(po.getBuildingAreaSelfUse().doubleValue());
             }
-            k.setCellStyle(numberCellStyle);
+            buildingAreaSelfUseCell.setCellStyle(numberCellStyle);
             // 建筑面积出租㎡
-            Cell l = row.createCell(CellReference.convertColStringToIndex("l"));
-            if (houseBuildingHighRepairPo.getBuildingAreaRent() != null) {
-                l.setCellValue(houseBuildingHighRepairPo.getBuildingAreaRent().doubleValue());
+            Cell buildingAreaRentCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getBuildingAreaRent() != null) {
+                buildingAreaRentCell.setCellValue(po.getBuildingAreaRent().doubleValue());
             }
-            l.setCellStyle(numberCellStyle);
+            buildingAreaRentCell.setCellStyle(numberCellStyle);
             // 建筑面积闲置㎡
-            Cell m = row.createCell(CellReference.convertColStringToIndex("m"));
-            if (houseBuildingHighRepairPo.getBuildingAreaIdle() != null) {
-                m.setCellValue(houseBuildingHighRepairPo.getBuildingAreaIdle().doubleValue());
+            Cell buildingAreaIdleCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getBuildingAreaIdle() != null) {
+                buildingAreaIdleCell.setCellValue(po.getBuildingAreaIdle().doubleValue());
             }
-            m.setCellStyle(numberCellStyle);
+            buildingAreaIdleCell.setCellStyle(numberCellStyle);
             // 建筑面积不可使用㎡
-            Cell n = row.createCell(CellReference.convertColStringToIndex("n"));
-            if (houseBuildingHighRepairPo.getBuildingAreaUnusable() != null) {
-                n.setCellValue(houseBuildingHighRepairPo.getBuildingAreaUnusable().doubleValue());
+            Cell buildingAreaUnusableCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getBuildingAreaUnusable() != null) {
+                buildingAreaUnusableCell.setCellValue(po.getBuildingAreaUnusable().doubleValue());
             }
-            n.setCellStyle(numberCellStyle);
+            buildingAreaUnusableCell.setCellStyle(numberCellStyle);
         }
     }
 
@@ -245,12 +270,20 @@ public class HouseWzHouseMaintenaCostService {
         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.asc(ListBuildingSameRepairFrequencyOrderEnum.tyTotalRank.getColumnName()));
         }
         return houseRepairExceptionDao.listBuildingSameRepairFrequency(page, bo);
     }
@@ -293,11 +326,11 @@ public class HouseWzHouseMaintenaCostService {
         baseCellStyle.setAlignment(HorizontalAlignment.CENTER);
         baseCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
         SXSSFSheet sheet = wb.createSheet();
-        AtomicInteger columnIndex = new AtomicInteger(0);
+        AtomicInteger rowIndex = new AtomicInteger(0);
         // 表头
-        Row headerRow = sheet.createRow(columnIndex.getAndIncrement());
-        List<String> headers = Stream.of("建筑id", "单位", "维修建筑", "维修类别", "维修内容", "账期时间",
-                "本年累计发生频率", "排名", "202301至今累计发生频率").toList();
+        Row headerRow = sheet.createRow(rowIndex.getAndIncrement());
+        List<String> headers = Stream.of("局址编号", "局址别名", "单位", "维修建筑", "维修类别", "维修内容",
+                "账期时间", "本年累计发生频率", "排名", "202301至今累计发生频率").toList();
         int headerLength = headers.size();
         for (int i = 0; i < headerLength; i++) {
             Cell cell = headerRow.createCell(i);
@@ -308,55 +341,210 @@ public class HouseWzHouseMaintenaCostService {
             sheet.setColumnWidth(i, columnWidth);
         }
         // 数据
-        for (HouseBuildingSameRepairFrequencyPo houseBuildingSameRepairFrequencyPo : list) {
-            Row row = sheet.createRow(columnIndex.getAndIncrement());
-            // 建筑id
-            Cell a = row.createCell(CellReference.convertColStringToIndex("a"));
-            if (houseBuildingSameRepairFrequencyPo.getBuildingId() != null) {
-                a.setCellValue(houseBuildingSameRepairFrequencyPo.getBuildingId());
+        for (HouseBuildingSameRepairFrequencyPo po : list) {
+            AtomicInteger columnIndex = new AtomicInteger(0);
+            Row row = sheet.createRow(rowIndex.getAndIncrement());
+            // 局址编号
+            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 b = row.createCell(CellReference.convertColStringToIndex("b"));
-            if (houseBuildingSameRepairFrequencyPo.getAreaName() != null) {
-                b.setCellValue(houseBuildingSameRepairFrequencyPo.getAreaName());
+            Cell areaNameCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getAreaName() != null) {
+                areaNameCell.setCellValue(po.getAreaName());
             }
             // 维修建筑
-            Cell c = row.createCell(CellReference.convertColStringToIndex("c"));
-            if (houseBuildingSameRepairFrequencyPo.getBuildingName() != null) {
-                c.setCellValue(houseBuildingSameRepairFrequencyPo.getBuildingName());
+            Cell buildingNameCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getBuildingName() != null) {
+                buildingNameCell.setCellValue(po.getBuildingName());
             }
             // 维修类别
-            Cell d = row.createCell(CellReference.convertColStringToIndex("d"));
-            if (houseBuildingSameRepairFrequencyPo.getRepairType() != null) {
-                d.setCellValue(houseBuildingSameRepairFrequencyPo.getRepairType());
+            Cell repairTypeCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getRepairType() != null) {
+                repairTypeCell.setCellValue(po.getRepairType());
             }
             // 维修内容
-            Cell e = row.createCell(CellReference.convertColStringToIndex("e"));
-            if (houseBuildingSameRepairFrequencyPo.getContentCategory() != null) {
-                e.setCellValue(houseBuildingSameRepairFrequencyPo.getContentCategory());
+            Cell contentCategoryCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getContentCategory() != null) {
+                contentCategoryCell.setCellValue(po.getContentCategory());
             }
             // 账期时间
-            Cell f = row.createCell(CellReference.convertColStringToIndex("f"));
-            if (houseBuildingSameRepairFrequencyPo.getYearMonth() != null) {
-                f.setCellValue(houseBuildingSameRepairFrequencyPo.getYearMonth());
+            Cell yearMonthCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getYearMonth() != null) {
+                yearMonthCell.setCellValue(po.getYearMonth());
             }
             // 本年累计发生频率
-            Cell g = row.createCell(CellReference.convertColStringToIndex("g"));
-            if (houseBuildingSameRepairFrequencyPo.getTyTotal() != null) {
-                g.setCellValue(houseBuildingSameRepairFrequencyPo.getTyTotal());
+            Cell tyTotalCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getTyTotal() != null) {
+                tyTotalCell.setCellValue(po.getTyTotal());
             }
-            g.setCellStyle(numberCellStyle);
+            tyTotalCell.setCellStyle(numberCellStyle);
             // 排名
-            Cell h = row.createCell(CellReference.convertColStringToIndex("h"));
-            if (houseBuildingSameRepairFrequencyPo.getTyTotalRank() != null) {
-                h.setCellValue(houseBuildingSameRepairFrequencyPo.getTyTotalRank());
+            Cell tyTotalRankCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getTyTotalRank() != null) {
+                tyTotalRankCell.setCellValue(po.getTyTotalRank());
             }
             // 202301至今累计发生频率
-            Cell i = row.createCell(CellReference.convertColStringToIndex("i"));
-            if (houseBuildingSameRepairFrequencyPo.getHistoryTotal() != null) {
-                i.setCellValue(houseBuildingSameRepairFrequencyPo.getHistoryTotal());
+            Cell historyTotalCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getHistoryTotal() != null) {
+                historyTotalCell.setCellValue(po.getHistoryTotal());
+            }
+            historyTotalCell.setCellStyle(numberCellStyle);
+        }
+    }
+
+    public R queryDailyModify(ListBuildingHighSporadicRepairDto dto) {
+        Page<HouseBuildingHighSporadicRepairPo> page = new Page<>(dto.getPage().getPageNum(), dto.getPage().getPageSize());
+        List<HouseBuildingHighSporadicRepairPo> list = getHouseBuildingHighSporadicRepairPos(dto, page);
+        List<ListBuildingHighSporadicRepairVo> vos = new ArrayList<>();
+        for (HouseBuildingHighSporadicRepairPo po : list) {
+            vos.add(new ListBuildingHighSporadicRepairVo(po));
+        }
+        PageUtils pageUtil = new PageUtils(vos, page);
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查询不动产自有房产高额零星维修统计
+     */
+    private List<HouseBuildingHighSporadicRepairPo> getHouseBuildingHighSporadicRepairPos(
+            ListBuildingHighSporadicRepairDto dto, Page<HouseBuildingHighSporadicRepairPo> page) {
+        ListBuildingHighSporadicRepairBo bo = new ListBuildingHighSporadicRepairBo();
+        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(ListBuildingHighSporadicRepairOrderEnum.erpMoney.getColumnName()));
+        }
+        return houseRepairExceptionDao.ListBuildingHighSporadicRepair(page, bo);
+    }
+
+    public void queryDailyModifyExport(ListBuildingHighSporadicRepairDto 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()) {
+            writeQueryDailyModify(dto, wb);
+            wb.write(response.getOutputStream());
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+        }
+    }
+
+    /**
+     * 写高额日常零星维修文件
+     */
+    private void writeQueryDailyModify(ListBuildingHighSporadicRepairDto dto, SXSSFWorkbook wb) {
+        Page<HouseBuildingHighSporadicRepairPo> page = new Page<>(1, Long.MAX_VALUE);
+        List<HouseBuildingHighSporadicRepairPo> list = getHouseBuildingHighSporadicRepairPos(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);
+        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 (HouseBuildingHighSporadicRepairPo po : list) {
+            AtomicInteger columnIndex = new AtomicInteger(0);
+            Row row = sheet.createRow(rowIndex.getAndIncrement());
+            // 二级单位
+            Cell areaNameCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getAreaName() != null) {
+                areaNameCell.setCellValue(po.getAreaName());
+            }
+            // 维修建筑
+            Cell buildingNameCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getBuildingName() != null) {
+                buildingNameCell.setCellValue(po.getBuildingName());
+            }
+            // 维修时间
+            Cell repairYearMonthCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getRepairYearMonth() != null) {
+                repairYearMonthCell.setCellValue(po.getRepairYearMonth());
+            }
+            // 局址编号
+            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 repairTypeCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getRepairType() != null) {
+                repairTypeCell.setCellValue(po.getRepairType());
+            }
+            // 维修内容
+            Cell repairContentCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getRepairContent() != null) {
+                repairContentCell.setCellValue(po.getRepairContent());
+            }
+            // 维修金额
+            Cell amountCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getAmount() != null) {
+                amountCell.setCellValue(po.getAmount().doubleValue());
+            }
+            amountCell.setCellStyle(numberCellStyle);
+            // 本年超万元次数
+            Cell totalCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getTotal() != null) {
+                totalCell.setCellValue(po.getTotal());
             }
-            i.setCellStyle(numberCellStyle);
         }
     }
 }