Commit 4eb6a013 by 吕明尚

修改保洁记录为空的问题

parent ee78c786
...@@ -72,10 +72,14 @@ public class RoomStatusServiceImpl implements RoomStatusService { ...@@ -72,10 +72,14 @@ public class RoomStatusServiceImpl implements RoomStatusService {
List<SOrder> orderList = orderService.listByRoomInfo(storeId,roomIds,day); List<SOrder> orderList = orderService.listByRoomInfo(storeId,roomIds,day);
Map<Long,List<SOrder>> orderMap = Optional.ofNullable(orderList).orElse(new ArrayList<>()).parallelStream().collect(Collectors.groupingBy(SOrder::getRoomId)); Map<Long,List<SOrder>> orderMap = Optional.ofNullable(orderList).orElse(new ArrayList<>()).parallelStream().collect(Collectors.groupingBy(SOrder::getRoomId));
Map<Long,SCleanRecords> cleanRecordMap = cleanRecordsService.lastCleanRoomByRoomIds(roomIds); Map<Long,SCleanRecords> cleanRecordMap = cleanRecordsService.lastCleanRoomByRoomIds(roomIds);
if (Objects.isNull(cleanRecordMap)) {
cleanRecordMap = new HashMap<>();
}
List<RoomStatusVo> voList = new ArrayList<>(); List<RoomStatusVo> voList = new ArrayList<>();
Map<Long, SCleanRecords> finalCleanRecordMap = cleanRecordMap;
roomIds.stream().forEach(roomId -> { roomIds.stream().forEach(roomId -> {
voList.addAll(generatorRoomStatusList(store,roomId,orderMap.get(roomId),cleanRecordMap.get(roomId),day,OrderTypeEnum.RESERVER.getCode())); voList.addAll(generatorRoomStatusList(store, roomId, orderMap.get(roomId), finalCleanRecordMap.get(roomId), day, OrderTypeEnum.RESERVER.getCode()));
voList.addAll(generatorRoomStatusList(store,roomId,orderMap.get(roomId),cleanRecordMap.get(roomId),DateUtils.addDays(day,1),OrderTypeEnum.RESERVER.getCode())); voList.addAll(generatorRoomStatusList(store, roomId, orderMap.get(roomId), finalCleanRecordMap.get(roomId), DateUtils.addDays(day, 1), OrderTypeEnum.RESERVER.getCode()));
}); });
return voList; return voList;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment