Commit c713844a by 吕明尚

修改房间状态接口

parent 2e0d18b5
......@@ -66,8 +66,8 @@ public class SRoomController extends BaseController {
,@ApiParam(name="roomId",value="房间ID",required = true) @RequestParam("roomId") Long roomId
,@ApiParam(name="day",value="下单选择的日期",required = true) @RequestParam("day") Date day
,@ApiParam(name="orderType",value="订单类型 1:预约;2:续单,默认:1",defaultValue = "1")
@RequestParam(value="orderType",defaultValue = "1") Integer orderType) {
return R.ok(roomStatusService.roomStatus(storeId, roomId, day,orderType));
@RequestParam(value = "orderType", defaultValue = "1") Integer orderType, Long orderId) {
return R.ok(roomStatusService.roomStatus(storeId, roomId, day, orderType, orderId));
}
/**
......
......@@ -352,7 +352,7 @@ public class RedisTask {
//不等于
!item.getOrderNo().equals(sOrder.getOrderNo()) &&
item.getRoomId().equals(sOrder.getRoomId()) &&
item.getConsumerId().equals(sOrder.getConsumerId()) &&
// item.getConsumerId().equals(sOrder.getConsumerId()) &&
item.getOrderType().equals(OrderTypeEnum.RENEW.getCode()) &&
item.getStatus().equals(OrderStatusEnum.INUSE.getCode())).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(sOrders1)) {
......
......@@ -19,13 +19,13 @@ public interface RoomStatusService {
* @param orderType
* @return List<RoomStatusVo>
*/
List<RoomStatusVo> roomStatus(Long storeId, Long roomId, Date day, Integer orderType);
List<RoomStatusVo> roomStatus(Long storeId, Long roomId, Date day, Integer orderType, Long orderId);
/**
* 通过门店ID,房间ID,日期查询房间T+1天时段状态
* @param storeId
* @param roomIds
* @param roomList
* @return List<RoomStatusVo>
*/
List<RoomStatusVo> listRoomStatus(Long storeId, List<SRoom> roomList);
......
......@@ -49,7 +49,7 @@ public class RoomStatusServiceImpl implements RoomStatusService {
private RedisUtil redisUtil;
@Override
public List<RoomStatusVo> roomStatus(Long storeId, Long roomId, Date day, Integer orderType) {
public List<RoomStatusVo> roomStatus(Long storeId, Long roomId, Date day, Integer orderType, Long orderId) {
SConsumer user = consumerService.getInfo();
if(user!=null){
FrontTokenComponent.loginSConsumerEntryThreadLocal.set(user);
......@@ -58,6 +58,10 @@ public class RoomStatusServiceImpl implements RoomStatusService {
SStore store = storeService.getById(storeId);
// 通过门店及房间查询指定日期T+1的订单
List<SOrder> orderList = orderService.listByRoomInfo(storeId,new ArrayList<Long>(){{add(roomId);}},day);
//去掉ID为orderId的订单
if (CollectionUtils.isNotEmpty(orderList) && Objects.nonNull(orderId)) {
orderList = orderList.stream().filter(order -> order.getId().compareTo(orderId) != 0).collect(Collectors.toList());
}
SCleanRecords cleanRecords = cleanRecordsService.lastCleanByRoomId(roomId);
SRoom room = roomService.getById(roomId);
List<RoomStatusVo> voList = generatorRoomStatusList(store,room,orderList,cleanRecords,day,orderType, user);
......
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