Commit c713844a by 吕明尚

修改房间状态接口

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