|
@@ -6,26 +6,41 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.example.common.PageVo;
|
|
|
import com.example.common.Rsp;
|
|
|
import com.example.dao.WzOtnAreaDao;
|
|
|
+import com.example.dao.house.HouseBuildingRepairDao;
|
|
|
import com.example.dao.house.HouseRepairExceptionDao;
|
|
|
+import com.example.entity.house.BuildingRepairMonthPo;
|
|
|
+import com.example.entity.house.BuildingRepairStatPo;
|
|
|
import com.example.entity.house.HouseBuildingHighRepairPo;
|
|
|
import com.example.entity.house.HouseBuildingHighSporadicRepairPo;
|
|
|
+import com.example.entity.house.HouseBuildingIdleRepairPo;
|
|
|
import com.example.entity.house.HouseBuildingSameRepairFrequencyPo;
|
|
|
import com.example.entity.house.HouseSitePo;
|
|
|
import com.example.enums.ListBuildingHighRepairOrderEnum;
|
|
|
import com.example.enums.ListBuildingHighSporadicRepairOrderEnum;
|
|
|
+import com.example.enums.ListBuildingIdleRepairOrderEnum;
|
|
|
+import com.example.enums.ListBuildingRepairMonthOrderEnum;
|
|
|
import com.example.enums.ListBuildingSameRepairFrequencyOrderEnum;
|
|
|
import com.example.enums.OrderEnum;
|
|
|
+import com.example.pojo.bo.BuildingRepairStatBo;
|
|
|
import com.example.pojo.bo.ListBuildingHighRepairBo;
|
|
|
import com.example.pojo.bo.ListBuildingHighSporadicRepairBo;
|
|
|
+import com.example.pojo.bo.ListBuildingIdleRepairBo;
|
|
|
+import com.example.pojo.bo.ListBuildingRepairMonthBo;
|
|
|
import com.example.pojo.bo.ListBuildingSameRepairFrequencyBo;
|
|
|
import com.example.pojo.bo.ListHouseSiteBo;
|
|
|
+import com.example.pojo.dto.BuildingRepairStatDto;
|
|
|
import com.example.pojo.dto.ListBuildingHighRepairDto;
|
|
|
import com.example.pojo.dto.ListBuildingHighSporadicRepairDto;
|
|
|
+import com.example.pojo.dto.ListBuildingIdleRepairDto;
|
|
|
+import com.example.pojo.dto.ListBuildingRepairMonthDto;
|
|
|
import com.example.pojo.dto.ListBuildingSameRepairFrequencyDto;
|
|
|
import com.example.pojo.dto.ListSiteNameDto;
|
|
|
import com.example.pojo.dto.ListSiteNumDto;
|
|
|
+import com.example.pojo.vo.BuildingRepairStatVo;
|
|
|
import com.example.pojo.vo.ListBuildingHighRepairVo;
|
|
|
import com.example.pojo.vo.ListBuildingHighSporadicRepairVo;
|
|
|
+import com.example.pojo.vo.ListBuildingIdleRepairVo;
|
|
|
+import com.example.pojo.vo.ListBuildingRepairMonthVo;
|
|
|
import com.example.pojo.vo.ListBuildingSameRepairFrequencyVo;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.poi.ss.usermodel.Cell;
|
|
@@ -37,14 +52,18 @@ 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.LocalDate;
|
|
|
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;
|
|
@@ -54,10 +73,13 @@ import java.util.stream.Stream;
|
|
|
public class HouseWzHouseMaintenaCostService {
|
|
|
private final HouseRepairExceptionDao houseRepairExceptionDao;
|
|
|
private final WzOtnAreaDao wzOtnAreaDao;
|
|
|
+ private final HouseBuildingRepairDao houseBuildingRepairDao;
|
|
|
|
|
|
- public HouseWzHouseMaintenaCostService(HouseRepairExceptionDao houseRepairExceptionDao, WzOtnAreaDao wzOtnAreaDao) {
|
|
|
+ public HouseWzHouseMaintenaCostService(HouseRepairExceptionDao houseRepairExceptionDao, WzOtnAreaDao wzOtnAreaDao,
|
|
|
+ HouseBuildingRepairDao houseBuildingRepairDao) {
|
|
|
this.houseRepairExceptionDao = houseRepairExceptionDao;
|
|
|
this.wzOtnAreaDao = wzOtnAreaDao;
|
|
|
+ this.houseBuildingRepairDao = houseBuildingRepairDao;
|
|
|
}
|
|
|
|
|
|
public Rsp<PageVo<ListBuildingHighRepairVo>> queryHighPrice(ListBuildingHighRepairDto dto) {
|
|
@@ -71,7 +93,7 @@ public class HouseWzHouseMaintenaCostService {
|
|
|
return Rsp.ok(pageVo);
|
|
|
}
|
|
|
|
|
|
- public void queryHighPriceExport(ListBuildingHighRepairDto dto) {
|
|
|
+ public void queryHighPriceExport(ListBuildingHighRepairDto.ListBuildingHighRepairMapDTO dto) {
|
|
|
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder
|
|
|
.getRequestAttributes();
|
|
|
if (servletRequestAttributes == null) {
|
|
@@ -82,11 +104,11 @@ public class HouseWzHouseMaintenaCostService {
|
|
|
return;
|
|
|
}
|
|
|
String filename = "维修异常监控_高总价统计"
|
|
|
- + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")) + ".xlsx";
|
|
|
+ + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")) + ".xlsx";
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncodeUtil.encode(filename));
|
|
|
response.setContentType("application/octet-stream");
|
|
|
try (SXSSFWorkbook wb = new SXSSFWorkbook()) {
|
|
|
- writeQueryHighPrice(dto, wb);
|
|
|
+ writeQueryHighPrice(new ListBuildingHighRepairDto(dto), wb);
|
|
|
wb.write(response.getOutputStream());
|
|
|
} catch (Exception e) {
|
|
|
log.error(e.getMessage(), e);
|
|
@@ -295,7 +317,7 @@ public class HouseWzHouseMaintenaCostService {
|
|
|
return houseRepairExceptionDao.listBuildingSameRepairFrequency(page, bo);
|
|
|
}
|
|
|
|
|
|
- public void queryHighFrequencyExport(ListBuildingSameRepairFrequencyDto dto) {
|
|
|
+ public void queryHighFrequencyExport(ListBuildingSameRepairFrequencyDto.ListBuildingSameRepairFrequencyMapDTO dto) {
|
|
|
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder
|
|
|
.getRequestAttributes();
|
|
|
if (servletRequestAttributes == null) {
|
|
@@ -306,11 +328,11 @@ public class HouseWzHouseMaintenaCostService {
|
|
|
return;
|
|
|
}
|
|
|
String filename = "维修异常监控_相同维修频次统计"
|
|
|
- + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")) + ".xlsx";
|
|
|
+ + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")) + ".xlsx";
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncodeUtil.encode(filename));
|
|
|
response.setContentType("application/octet-stream");
|
|
|
try (SXSSFWorkbook wb = new SXSSFWorkbook()) {
|
|
|
- writeQueryHighFrequency(dto, wb);
|
|
|
+ writeQueryHighFrequency(new ListBuildingSameRepairFrequencyDto(dto), wb);
|
|
|
wb.write(response.getOutputStream());
|
|
|
} catch (Exception e) {
|
|
|
log.error(e.getMessage(), e);
|
|
@@ -450,7 +472,7 @@ public class HouseWzHouseMaintenaCostService {
|
|
|
return houseRepairExceptionDao.ListBuildingHighSporadicRepair(page, bo);
|
|
|
}
|
|
|
|
|
|
- public void queryDailyModifyExport(ListBuildingHighSporadicRepairDto dto) {
|
|
|
+ public void queryDailyModifyExport(ListBuildingHighSporadicRepairDto.ListBuildingHighSporadicRepairMapDTO dto) {
|
|
|
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder
|
|
|
.getRequestAttributes();
|
|
|
if (servletRequestAttributes == null) {
|
|
@@ -461,11 +483,11 @@ public class HouseWzHouseMaintenaCostService {
|
|
|
return;
|
|
|
}
|
|
|
String filename = "维修异常监控_高额日常零星维修"
|
|
|
- + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")) + ".xlsx";
|
|
|
+ + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")) + ".xlsx";
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncodeUtil.encode(filename));
|
|
|
response.setContentType("application/octet-stream");
|
|
|
try (SXSSFWorkbook wb = new SXSSFWorkbook()) {
|
|
|
- writeQueryDailyModify(dto, wb);
|
|
|
+ writeQueryDailyModify(new ListBuildingHighSporadicRepairDto(dto), wb);
|
|
|
wb.write(response.getOutputStream());
|
|
|
} catch (Exception e) {
|
|
|
log.error(e.getMessage(), e);
|
|
@@ -586,4 +608,779 @@ public class HouseWzHouseMaintenaCostService {
|
|
|
PageVo<String> pageVo = new PageVo<>(vos, page);
|
|
|
return Rsp.ok(pageVo);
|
|
|
}
|
|
|
+
|
|
|
+ public Rsp<PageVo<ListBuildingIdleRepairVo>> listBuildingIdleRepair(ListBuildingIdleRepairDto dto) {
|
|
|
+ Page<HouseBuildingIdleRepairPo> page = new Page<>(dto.getPage().getPageNum(), dto.getPage().getPageSize());
|
|
|
+ List<HouseBuildingIdleRepairPo> list = getHouseBuildingIdleRepairPos(dto, page);
|
|
|
+ List<ListBuildingIdleRepairVo> vos = new ArrayList<>();
|
|
|
+ for (HouseBuildingIdleRepairPo po : list) {
|
|
|
+ vos.add(new ListBuildingIdleRepairVo(po));
|
|
|
+ }
|
|
|
+ PageVo<ListBuildingIdleRepairVo> pageVo = new PageVo<>(vos, page);
|
|
|
+ return Rsp.ok(pageVo);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询不动产自有房产闲置不可用发生维修费
|
|
|
+ */
|
|
|
+ private List<HouseBuildingIdleRepairPo> getHouseBuildingIdleRepairPos(ListBuildingIdleRepairDto dto,
|
|
|
+ Page<HouseBuildingIdleRepairPo> page) {
|
|
|
+ ListBuildingIdleRepairBo bo = new ListBuildingIdleRepairBo();
|
|
|
+ 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(ListBuildingIdleRepairOrderEnum.erpCreditedAmount.getColumnName()));
|
|
|
+ }
|
|
|
+ return houseRepairExceptionDao.listBuildingIdleRepair(page, bo);
|
|
|
+ }
|
|
|
+
|
|
|
+ public void buildingIdleRepairExport(ListBuildingIdleRepairDto.ListBuildingIdleRepairDTO 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("yyyyMMddHHmmss")) + ".xlsx";
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename=" + URLEncodeUtil.encode(filename));
|
|
|
+ response.setContentType("application/octet-stream");
|
|
|
+ try (SXSSFWorkbook wb = new SXSSFWorkbook()) {
|
|
|
+ writeBuildingIdleRepair(new ListBuildingIdleRepairDto(dto), wb);
|
|
|
+ wb.write(response.getOutputStream());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 写闲置不可用发生维修费文件
|
|
|
+ */
|
|
|
+ private void writeBuildingIdleRepair(ListBuildingIdleRepairDto dto, SXSSFWorkbook wb) {
|
|
|
+ Page<HouseBuildingIdleRepairPo> page = new Page<>(1, Long.MAX_VALUE);
|
|
|
+ List<HouseBuildingIdleRepairPo> list = getHouseBuildingIdleRepairPos(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("入账日期", "二级单位", "三级单位", "局址编号", "局址别名", "建筑别名",
|
|
|
+ "维修类型", "维修内容", "erp入账金额元", "标准地址", "使用状态", "建筑面积㎡", "建筑面积自用㎡", "建筑面积出租㎡",
|
|
|
+ "建筑面积闲置㎡", "建筑面积不可使用㎡").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 (HouseBuildingIdleRepairPo po : list) {
|
|
|
+ AtomicInteger columnIndex = new AtomicInteger(0);
|
|
|
+ Row row = sheet.createRow(rowIndex.getAndIncrement());
|
|
|
+ // 入账日期
|
|
|
+ Cell yearMonthCell = row.createCell(columnIndex.getAndIncrement());
|
|
|
+ if (po.getYearMonth() != null) {
|
|
|
+ yearMonthCell.setCellValue(po.getYearMonth());
|
|
|
+ }
|
|
|
+ // 二级单位
|
|
|
+ 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 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());
|
|
|
+ }
|
|
|
+ // erp入账金额元
|
|
|
+ Cell amountCell = row.createCell(columnIndex.getAndIncrement());
|
|
|
+ if (po.getAmount() != null) {
|
|
|
+ amountCell.setCellValue(po.getAmount().doubleValue());
|
|
|
+ }
|
|
|
+ amountCell.setCellStyle(numberCellStyle);
|
|
|
+ // 标准地址
|
|
|
+ Cell addressCell = row.createCell(columnIndex.getAndIncrement());
|
|
|
+ if (po.getAddress() != null) {
|
|
|
+ addressCell.setCellValue(po.getAddress());
|
|
|
+ }
|
|
|
+ // 使用状态
|
|
|
+ Cell usageStatusCell = row.createCell(columnIndex.getAndIncrement());
|
|
|
+ if (po.getUsageStatus() != null) {
|
|
|
+ usageStatusCell.setCellValue(po.getUsageStatus());
|
|
|
+ }
|
|
|
+ // 建筑面积㎡
|
|
|
+ Cell buildingAreaCell = row.createCell(columnIndex.getAndIncrement());
|
|
|
+ if (po.getBuildingArea() != null) {
|
|
|
+ buildingAreaCell.setCellValue(po.getBuildingArea().doubleValue());
|
|
|
+ }
|
|
|
+ buildingAreaCell.setCellStyle(numberCellStyle);
|
|
|
+ // 建筑面积自用㎡
|
|
|
+ Cell buildingAreaSelfUseCell = row.createCell(columnIndex.getAndIncrement());
|
|
|
+ if (po.getBuildingAreaSelfUse() != null) {
|
|
|
+ buildingAreaSelfUseCell.setCellValue(po.getBuildingAreaSelfUse().doubleValue());
|
|
|
+ }
|
|
|
+ buildingAreaSelfUseCell.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 buildingAreaUnusableCell = row.createCell(columnIndex.getAndIncrement());
|
|
|
+ if (po.getBuildingAreaUnusable() != null) {
|
|
|
+ buildingAreaUnusableCell.setCellValue(po.getBuildingAreaUnusable().doubleValue());
|
|
|
+ }
|
|
|
+ buildingAreaUnusableCell.setCellStyle(numberCellStyle);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public Rsp<PageVo<BuildingRepairStatVo>> buildingRepairStat(BuildingRepairStatDto dto) {
|
|
|
+ BuildingRepairStatPo pos = getBuildingRepairStatPos(dto);
|
|
|
+ if (pos == null) {
|
|
|
+ return Rsp.ok();
|
|
|
+ }
|
|
|
+ BuildingRepairStatVo vo = new BuildingRepairStatVo(pos, false);
|
|
|
+ PageVo<BuildingRepairStatVo> pageVo = new PageVo<>(Collections.singletonList(vo));
|
|
|
+ return Rsp.ok(pageVo);
|
|
|
+ }
|
|
|
+
|
|
|
+ private BuildingRepairStatPo getBuildingRepairStatPos(BuildingRepairStatDto dto) {
|
|
|
+ Integer endYearMonth = dto.getMap().getStatisticalMonth1();
|
|
|
+ LocalDate endLocalDate = LocalDate.parse(endYearMonth + "01", DateTimeFormatter.ofPattern("yyyyMMdd"));
|
|
|
+ LocalDate startLocalDate = endLocalDate.withDayOfYear(1);
|
|
|
+ Integer startYearMonth = Integer.valueOf(startLocalDate.format(DateTimeFormatter.ofPattern("yyyyMM")));
|
|
|
+ BuildingRepairStatBo bo = new BuildingRepairStatBo();
|
|
|
+ bo.setStartYearMonth(startYearMonth);
|
|
|
+ bo.setEndYearMonth(endYearMonth);
|
|
|
+ if (StringUtils.hasText(dto.getMap().getCity()) && !"全省".equals(dto.getMap().getCity())) {
|
|
|
+ bo.setAreaNo(dto.getMap().getCity());
|
|
|
+ }
|
|
|
+ if (StringUtils.hasText(dto.getMap().getCounty())) {
|
|
|
+ bo.setCityNo(dto.getMap().getCounty());
|
|
|
+ }
|
|
|
+ if ("上市".equals(dto.getMap().getInvestmentEntity())) {
|
|
|
+ bo.setInvestorName("上市");
|
|
|
+ } else if ("存续".equals(dto.getMap().getInvestmentEntity())) {
|
|
|
+ bo.setInvestorName("存续");
|
|
|
+ }
|
|
|
+ // 查询三级单位统计
|
|
|
+ List<BuildingRepairStatPo> pos = houseBuildingRepairDao.buildingRepairStat(bo);
|
|
|
+ if (CollectionUtils.isEmpty(pos)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ // 一级单位统计
|
|
|
+ BuildingRepairStatPo firstUnitPo = new BuildingRepairStatPo();
|
|
|
+ firstUnitPo.setAreaName("全省");
|
|
|
+ firstUnitPo.setCityName("全省");
|
|
|
+ LinkedHashMap<String, BuildingRepairStatPo> secondUnitPoMap = new LinkedHashMap<>();
|
|
|
+ // 二级单位统计
|
|
|
+ for (BuildingRepairStatPo po : pos) {
|
|
|
+ secondUnitPoMap.putIfAbsent(po.getAreaNo(),
|
|
|
+ new BuildingRepairStatPo(po.getAreaNo(), po.getAreaName()));
|
|
|
+ BuildingRepairStatPo secondUnitPo = secondUnitPoMap.get(po.getAreaNo());
|
|
|
+ secondUnitPo.update(po);
|
|
|
+ }
|
|
|
+ for (BuildingRepairStatPo value : secondUnitPoMap.values()) {
|
|
|
+ firstUnitPo.update(value);
|
|
|
+ }
|
|
|
+ return firstUnitPo;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void buildingRepairStatExport(BuildingRepairStatDto.BuildingRepairStatMapDTO 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("yyyyMMddHHmmss")) + ".xlsx";
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename=" + URLEncodeUtil.encode(filename));
|
|
|
+ response.setContentType("application/octet-stream");
|
|
|
+ try (SXSSFWorkbook wb = new SXSSFWorkbook()) {
|
|
|
+ writeBuildingRepairStat(new BuildingRepairStatDto(dto), wb);
|
|
|
+ wb.write(response.getOutputStream());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 写维修费统计文件
|
|
|
+ */
|
|
|
+ private void writeBuildingRepairStat(BuildingRepairStatDto dto, SXSSFWorkbook wb) {
|
|
|
+ BuildingRepairStatPo firstPo = getBuildingRepairStatPos(dto);
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ 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 xmzCell1 = row1.createCell(columnIndex1.getAndIncrement());
|
|
|
+ if (firstPo.getXmz() != null) {
|
|
|
+ xmzCell1.setCellValue(firstPo.getXmz().doubleValue());
|
|
|
+ }
|
|
|
+ xmzCell1.setCellStyle(numberCellStyle);
|
|
|
+ // 零星维修
|
|
|
+ Cell lxCell1 = row1.createCell(columnIndex1.getAndIncrement());
|
|
|
+ if (firstPo.getLx() != null) {
|
|
|
+ lxCell1.setCellValue(firstPo.getLx().doubleValue());
|
|
|
+ }
|
|
|
+ lxCell1.setCellStyle(numberCellStyle);
|
|
|
+ // 应急维修
|
|
|
+ Cell yjCell1 = row1.createCell(columnIndex1.getAndIncrement());
|
|
|
+ if (firstPo.getYj() != null) {
|
|
|
+ yjCell1.setCellValue(firstPo.getYj().doubleValue());
|
|
|
+ }
|
|
|
+ yjCell1.setCellStyle(numberCellStyle);
|
|
|
+ // 总计
|
|
|
+ Cell hjCell1 = row1.createCell(columnIndex1.getAndIncrement());
|
|
|
+ if (firstPo.getHj() != null) {
|
|
|
+ hjCell1.setCellValue(firstPo.getHj().doubleValue());
|
|
|
+ }
|
|
|
+ hjCell1.setCellStyle(numberCellStyle);
|
|
|
+ // 二级单位统计
|
|
|
+ for (BuildingRepairStatPo 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 xmzCell2 = row2.createCell(columnIndex2.getAndIncrement());
|
|
|
+ if (secondPo.getXmz() != null) {
|
|
|
+ xmzCell2.setCellValue(secondPo.getXmz().doubleValue());
|
|
|
+ }
|
|
|
+ xmzCell2.setCellStyle(numberCellStyle);
|
|
|
+ // 零星维修
|
|
|
+ Cell lxCell2 = row2.createCell(columnIndex2.getAndIncrement());
|
|
|
+ if (secondPo.getLx() != null) {
|
|
|
+ lxCell2.setCellValue(secondPo.getLx().doubleValue());
|
|
|
+ }
|
|
|
+ lxCell2.setCellStyle(numberCellStyle);
|
|
|
+ // 应急维修
|
|
|
+ Cell yjCell2 = row2.createCell(columnIndex2.getAndIncrement());
|
|
|
+ if (secondPo.getYj() != null) {
|
|
|
+ yjCell2.setCellValue(secondPo.getYj().doubleValue());
|
|
|
+ }
|
|
|
+ yjCell2.setCellStyle(numberCellStyle);
|
|
|
+ // 总计
|
|
|
+ Cell hjCell2 = row2.createCell(columnIndex2.getAndIncrement());
|
|
|
+ if (secondPo.getHj() != null) {
|
|
|
+ hjCell2.setCellValue(secondPo.getHj().doubleValue());
|
|
|
+ }
|
|
|
+ hjCell2.setCellStyle(numberCellStyle);
|
|
|
+ // 三级单位统计
|
|
|
+ for (BuildingRepairStatPo 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 xmzCell3 = row3.createCell(columnIndex3.getAndIncrement());
|
|
|
+ if (thirdPo.getXmz() != null) {
|
|
|
+ xmzCell3.setCellValue(thirdPo.getXmz().doubleValue());
|
|
|
+ }
|
|
|
+ xmzCell3.setCellStyle(numberCellStyle);
|
|
|
+ // 零星维修
|
|
|
+ Cell lxCell3 = row3.createCell(columnIndex3.getAndIncrement());
|
|
|
+ if (thirdPo.getLx() != null) {
|
|
|
+ lxCell3.setCellValue(thirdPo.getLx().doubleValue());
|
|
|
+ }
|
|
|
+ lxCell3.setCellStyle(numberCellStyle);
|
|
|
+ // 应急维修
|
|
|
+ Cell yjCell3 = row3.createCell(columnIndex3.getAndIncrement());
|
|
|
+ if (thirdPo.getYj() != null) {
|
|
|
+ yjCell3.setCellValue(thirdPo.getYj().doubleValue());
|
|
|
+ }
|
|
|
+ yjCell3.setCellStyle(numberCellStyle);
|
|
|
+ // 总计
|
|
|
+ Cell hjCell3 = row3.createCell(columnIndex3.getAndIncrement());
|
|
|
+ if (thirdPo.getHj() != null) {
|
|
|
+ hjCell3.setCellValue(thirdPo.getHj().doubleValue());
|
|
|
+ }
|
|
|
+ hjCell3.setCellStyle(numberCellStyle);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public Rsp<PageVo<ListBuildingRepairMonthVo>> listBuildingRepairMonth(ListBuildingRepairMonthDto dto) {
|
|
|
+ Page<BuildingRepairMonthPo> page = new Page<>(dto.getPage().getPageNum(), dto.getPage().getPageSize());
|
|
|
+ List<BuildingRepairMonthPo> list = getBuildingRepairMonthList(dto, page);
|
|
|
+ List<ListBuildingRepairMonthVo> vos = new ArrayList<>();
|
|
|
+ for (BuildingRepairMonthPo po : list) {
|
|
|
+ vos.add(new ListBuildingRepairMonthVo(po));
|
|
|
+ }
|
|
|
+ PageVo<ListBuildingRepairMonthVo> pageVo = new PageVo<>(vos, page);
|
|
|
+ return Rsp.ok(pageVo);
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<BuildingRepairMonthPo> getBuildingRepairMonthList(ListBuildingRepairMonthDto dto,
|
|
|
+ Page<BuildingRepairMonthPo> page) {
|
|
|
+ ListBuildingRepairMonthBo bo = new ListBuildingRepairMonthBo();
|
|
|
+ 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().getCode())) {
|
|
|
+ bo.setSiteNum(dto.getMap().getCode());
|
|
|
+ }
|
|
|
+ if (dto.getMap() != null && StringUtils.hasText(dto.getMap().getAlias())) {
|
|
|
+ bo.setSiteName(dto.getMap().getAlias());
|
|
|
+ }
|
|
|
+ if (dto.getMap() != null && "上市".equals(dto.getMap().getInvestmentEntity())) {
|
|
|
+ bo.setInvestorName("上市");
|
|
|
+ } else if (dto.getMap() != null && "存续".equals(dto.getMap().getInvestmentEntity())) {
|
|
|
+ bo.setInvestorName("存续");
|
|
|
+ }
|
|
|
+ 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(ListBuildingRepairMonthOrderEnum.erpCreditedAmount.getColumnName()));
|
|
|
+ }
|
|
|
+ return houseBuildingRepairDao.listBuildingRepairMonth(page, bo);
|
|
|
+ }
|
|
|
+
|
|
|
+ public void listBuildingRepairMonthExport(ListBuildingRepairMonthDto.ListBuildingRepairMonthMapDTO 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("yyyyMMddHHmmss")) + ".xlsx";
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename=" + URLEncodeUtil.encode(filename));
|
|
|
+ response.setContentType("application/octet-stream");
|
|
|
+ try (SXSSFWorkbook wb = new SXSSFWorkbook()) {
|
|
|
+ writeListBuildingRepairMonth(new ListBuildingRepairMonthDto(dto), wb);
|
|
|
+ wb.write(response.getOutputStream());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void writeListBuildingRepairMonth(ListBuildingRepairMonthDto dto, SXSSFWorkbook wb) {
|
|
|
+ Page<BuildingRepairMonthPo> page = new Page<>(1, Long.MAX_VALUE);
|
|
|
+ List<BuildingRepairMonthPo> list = getBuildingRepairMonthList(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("建筑id基本信息", "建筑id维修", "入账日期", "维修类型", "维修内容",
|
|
|
+ "erp入账金额元", "每平米维修单价", "资产所属单位(一级)", "资产所属单位(二级)", "资产所属单位(三级)", "局址编号",
|
|
|
+ "局址别名", "标准地址", "城市等级", "城市区域", "地段", "是否有土地资产", "局址id", "建筑别名", "得房率",
|
|
|
+ "房屋来源", "取得日期", "房龄开始年份", "房龄", "投资主体", "管理层级", "房屋结构", "楼层总数", "资产编号",
|
|
|
+ "资产标签号", "使用状态", "建筑用途", "权属状态", "建筑占地面积(㎡)", "建筑面积(㎡)", "建筑面积-自用(㎡)",
|
|
|
+ "建筑面积-出租(㎡)", "建筑面积-闲置(㎡)", "建筑面积-不可使用(㎡)", "使用面积(㎡)", "使用面积-自用(㎡)",
|
|
|
+ "使用面积-出租(㎡)", "使用面积-闲置(㎡)", "使用面积-不可使用(㎡)").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 (BuildingRepairMonthPo po : list) {
|
|
|
+ AtomicInteger columnIndex = new AtomicInteger(0);
|
|
|
+ Row row = sheet.createRow(rowIndex.getAndIncrement());
|
|
|
+ // 建筑id基本信息
|
|
|
+ Cell buildingIdCell = row.createCell(columnIndex.getAndIncrement());
|
|
|
+ if (po.getBuildingId() != null) {
|
|
|
+ buildingIdCell.setCellValue(po.getBuildingId());
|
|
|
+ }
|
|
|
+ // 建筑id维修
|
|
|
+ Cell jzJzidCell = row.createCell(columnIndex.getAndIncrement());
|
|
|
+ if (po.getJzJzid() != null) {
|
|
|
+ jzJzidCell.setCellValue(po.getJzJzid());
|
|
|
+ }
|
|
|
+ // 入账日期
|
|
|
+ Cell yearMonthCell = row.createCell(columnIndex.getAndIncrement());
|
|
|
+ if (po.getYearMonth() != null) {
|
|
|
+ yearMonthCell.setCellValue(po.getYearMonth());
|
|
|
+ }
|
|
|
+ // 维修类型
|
|
|
+ Cell repairTypeCell = row.createCell(columnIndex.getAndIncrement());
|
|
|
+ if (po.getRepairType() != null) {
|
|
|
+ repairTypeCell.setCellValue(po.getRepairType());
|
|
|
+ }
|
|
|
+ // 维修内容
|
|
|
+ Cell contentCategoryCell = row.createCell(columnIndex.getAndIncrement());
|
|
|
+ if (po.getContentCategory() != null) {
|
|
|
+ contentCategoryCell.setCellValue(po.getContentCategory());
|
|
|
+ }
|
|
|
+ // erp入账金额元
|
|
|
+ Cell finalCostCell = row.createCell(columnIndex.getAndIncrement());
|
|
|
+ if (po.getFinalCost() != null) {
|
|
|
+ finalCostCell.setCellValue(po.getFinalCost().doubleValue());
|
|
|
+ }
|
|
|
+ finalCostCell.setCellStyle(numberCellStyle);
|
|
|
+ // 每平米维修单价
|
|
|
+ Cell repairUnitPrice = row.createCell(columnIndex.getAndIncrement());
|
|
|
+ if (po.getRepairUnitPrice() != null) {
|
|
|
+ repairUnitPrice.setCellValue(po.getRepairUnitPrice().doubleValue());
|
|
|
+ }
|
|
|
+ repairUnitPrice.setCellStyle(numberCellStyle);
|
|
|
+ // 资产所属单位(一级)
|
|
|
+ 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 addressCell = row.createCell(columnIndex.getAndIncrement());
|
|
|
+ if (po.getAddress() != null) {
|
|
|
+ addressCell.setCellValue(po.getAddress());
|
|
|
+ }
|
|
|
+ // 城市等级
|
|
|
+ Cell cityLevel = row.createCell(columnIndex.getAndIncrement());
|
|
|
+ if (po.getCityLevel() != null) {
|
|
|
+ cityLevel.setCellValue(po.getCityLevel());
|
|
|
+ }
|
|
|
+ // 城市区域
|
|
|
+ Cell cityRegionCell = row.createCell(columnIndex.getAndIncrement());
|
|
|
+ if (po.getCityRegion() != null) {
|
|
|
+ cityRegionCell.setCellValue(po.getCityRegion());
|
|
|
+ }
|
|
|
+ // 地段
|
|
|
+ Cell areaSectorCell = row.createCell(columnIndex.getAndIncrement());
|
|
|
+ if (po.getAreaSector() != null) {
|
|
|
+ areaSectorCell.setCellValue(po.getAreaSector());
|
|
|
+ }
|
|
|
+ // 是否有土地资产
|
|
|
+ Cell hasLandCell = row.createCell(columnIndex.getAndIncrement());
|
|
|
+ if (po.getHasLand() != null) {
|
|
|
+ hasLandCell.setCellValue(po.getHasLand());
|
|
|
+ }
|
|
|
+ // 局址id
|
|
|
+ Cell siteIdCell = row.createCell(columnIndex.getAndIncrement());
|
|
|
+ if (po.getSiteId() != null) {
|
|
|
+ siteIdCell.setCellValue(po.getSiteId());
|
|
|
+ }
|
|
|
+ // 建筑别名
|
|
|
+ Cell buildingNameCell = row.createCell(columnIndex.getAndIncrement());
|
|
|
+ if (po.getBuildingName() != null) {
|
|
|
+ buildingNameCell.setCellValue(po.getBuildingName());
|
|
|
+ }
|
|
|
+ // 得房率
|
|
|
+ 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 houseAgeCell = row.createCell(columnIndex.getAndIncrement());
|
|
|
+ if (po.getHouseAge() != null) {
|
|
|
+ houseAgeCell.setCellValue(po.getHouseAge());
|
|
|
+ }
|
|
|
+ // 投资主体
|
|
|
+ Cell investorNameCell = row.createCell(columnIndex.getAndIncrement());
|
|
|
+ if (po.getInvestorName() != null) {
|
|
|
+ investorNameCell.setCellValue(po.getInvestorName());
|
|
|
+ }
|
|
|
+ // 管理层级
|
|
|
+ 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 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 buildingAreaCell = row.createCell(columnIndex.getAndIncrement());
|
|
|
+ if (po.getBuildingArea() != null) {
|
|
|
+ buildingAreaCell.setCellValue(po.getBuildingArea().doubleValue());
|
|
|
+ }
|
|
|
+ buildingAreaCell.setCellStyle(numberCellStyle);
|
|
|
+ // 建筑面积-自用(㎡)
|
|
|
+ Cell buildingAreaSelfUseCell = row.createCell(columnIndex.getAndIncrement());
|
|
|
+ if (po.getBuildingAreaSelfUse() != null) {
|
|
|
+ buildingAreaSelfUseCell.setCellValue(po.getBuildingAreaSelfUse().doubleValue());
|
|
|
+ }
|
|
|
+ buildingAreaSelfUseCell.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 buildingAreaUnusableCell = row.createCell(columnIndex.getAndIncrement());
|
|
|
+ if (po.getBuildingAreaUnusable() != null) {
|
|
|
+ buildingAreaUnusableCell.setCellValue(po.getBuildingAreaUnusable().doubleValue());
|
|
|
+ }
|
|
|
+ buildingAreaUnusableCell.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);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|