Commit ee78c786 by wuwenlong

小程序端房间接口

parent 56c7fa19
......@@ -19,6 +19,7 @@ import share.system.domain.vo.RoomStatusVo;
import share.system.service.*;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Author wwl
......@@ -69,11 +70,12 @@ public class RoomStatusServiceImpl implements RoomStatusService {
SStore store = storeService.getById(storeId);
// 通过门店及房间查询指定日期T+1的订单
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,SCleanRecords> cleanRecordMap = cleanRecordsService.lastCleanRoomByRoomIds(roomIds);
List<RoomStatusVo> voList = new ArrayList<>();
roomIds.stream().forEach(roomId -> {
voList.addAll(generatorRoomStatusList(store,roomId,orderList,cleanRecordMap.get(roomId),day,OrderTypeEnum.RESERVER.getCode()));
voList.addAll(generatorRoomStatusList(store,roomId,orderList,cleanRecordMap.get(roomId),DateUtils.addDays(day,1),OrderTypeEnum.RESERVER.getCode()));
voList.addAll(generatorRoomStatusList(store,roomId,orderMap.get(roomId),cleanRecordMap.get(roomId),day,OrderTypeEnum.RESERVER.getCode()));
voList.addAll(generatorRoomStatusList(store,roomId,orderMap.get(roomId),cleanRecordMap.get(roomId),DateUtils.addDays(day,1),OrderTypeEnum.RESERVER.getCode()));
});
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