fix(租柜单元格): 修复查询租用单元格最新订单时的空列表问题
当租用单元格列表为空时,避免执行不必要的查询操作
This commit is contained in:
parent
2bf2494383
commit
a068d54493
|
@ -41,6 +41,7 @@ public class CabinetCellApplicationService {
|
|||
.filter(cell -> cell.getIsRented().equals(1))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (!rentingCells.isEmpty()) {
|
||||
List<CabinetCellLatestOrderDTO> cellLatestOrderDTOS = cabinetCellService.selectLatestOrderInfoByCell(rentingCells.stream()
|
||||
.map(CabinetCellWithOrderCountDTO::getCellId).collect(Collectors.toList()));
|
||||
|
||||
|
@ -52,6 +53,7 @@ public class CabinetCellApplicationService {
|
|||
BeanUtils.copyProperties(order, cell);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return new PageDTO<>(list, page.getTotal());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue