diff --git a/agileboot-domain/src/main/java/com/agileboot/domain/cabinet/cell/CabinetCellApplicationService.java b/agileboot-domain/src/main/java/com/agileboot/domain/cabinet/cell/CabinetCellApplicationService.java index 86144ec..95ffa98 100644 --- a/agileboot-domain/src/main/java/com/agileboot/domain/cabinet/cell/CabinetCellApplicationService.java +++ b/agileboot-domain/src/main/java/com/agileboot/domain/cabinet/cell/CabinetCellApplicationService.java @@ -41,16 +41,18 @@ public class CabinetCellApplicationService { .filter(cell -> cell.getIsRented().equals(1)) .collect(Collectors.toList()); - List cellLatestOrderDTOS = cabinetCellService.selectLatestOrderInfoByCell(rentingCells.stream() - .map(CabinetCellWithOrderCountDTO::getCellId).collect(Collectors.toList())); + if (!rentingCells.isEmpty()) { + List cellLatestOrderDTOS = cabinetCellService.selectLatestOrderInfoByCell(rentingCells.stream() + .map(CabinetCellWithOrderCountDTO::getCellId).collect(Collectors.toList())); - for (CabinetCellWithOrderCountDTO cell : rentingCells) { - cellLatestOrderDTOS.stream() - .filter(order -> order.getCellId().equals(cell.getCellId())) - .findFirst() - .ifPresent(order -> { - BeanUtils.copyProperties(order, cell); - }); + for (CabinetCellWithOrderCountDTO cell : rentingCells) { + cellLatestOrderDTOS.stream() + .filter(order -> order.getCellId().equals(cell.getCellId())) + .findFirst() + .ifPresent(order -> { + BeanUtils.copyProperties(order, cell); + }); + } } return new PageDTO<>(list, page.getTotal());