Commit b0c44123 by 吕明尚

保洁房间显示增加后面的预约订单

parent 412e8cf5
......@@ -9,6 +9,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import share.common.annotation.Excel;
import share.common.core.domain.BaseEntity;
import share.system.domain.Device;
import share.system.domain.SOrder;
import share.system.domain.SPack;
import java.math.BigDecimal;
......@@ -108,6 +109,8 @@ public class SRoomVo extends BaseEntity
private List<Device> deviceList;
private List<SOrder> orderList;
/**
* 美团点评店铺id
*/
......
......@@ -490,7 +490,7 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
LambdaQueryWrapper<SOrder> wrapper = new LambdaQueryWrapper<>();
wrapper.in(SOrder::getStoreId, storeIdList);
wrapper.in(SOrder::getRoomId, roomIdList);
wrapper.eq(SOrder::getStatus, OrderStatusEnum.INUSE.getCode());
wrapper.in(SOrder::getStatus, OrderStatusEnum.getUnfinishOrderStatus());
//正序
wrapper.orderByAsc(SOrder::getEndDate);
List<SOrder> list = orderService.list(wrapper);
......@@ -512,8 +512,19 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
}
if (CollectionUtils.isNotEmpty(list)) {
List<SOrder> orderList = list.stream().filter(order ->
order.getRoomId().compareTo(room.getId()) == 0
&& order.getStatus().equals(OrderStatusEnum.UNUSED.getCode())
//预约开始时间是今天的
&& DateUtil.isSameDay(order.getPreStartDate(), DateUtil.date())
).collect(Collectors.toList());
//按照预约开始时间排序
orderList.sort(Comparator.comparing(SOrder::getPreStartDate));
//只取3条
orderList = orderList.stream().limit(3).collect(Collectors.toList());
room.setOrderList(orderList);
list.forEach(order -> {
if (order.getRoomId().compareTo(room.getId()) == 0) {
if (order.getRoomId().compareTo(room.getId()) == 0 && order.getStatus().equals(OrderStatusEnum.INUSE.getCode())) {
room.setRecordsTime(order.getEndDate());
}
});
......
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