Commit 279c77bd by wuwenlong

finish clean bugfix;

order time check bugfix;
parent fa5a34ab
......@@ -30,7 +30,13 @@ public enum OrderStatusEnum {
}
return null;
}
public static Integer[] getValidOrderStatus(){
return new Integer[]{UNUSED.code, INUSE.code, USED.code};
}
public static Integer[] getUnfinishOrderStatus(){
return new Integer[]{UNUSED.code, INUSE.code};
}
public Integer getCode(){
return code;
......
......@@ -208,8 +208,10 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
//获取List的房间集合
List<Long> roomIds = list.stream().map(SCleanRecords::getRoomId).collect(Collectors.toList());
LambdaQueryWrapper<SOrder> sOrderLambdaQueryWrapper = new LambdaQueryWrapper<>();
sOrderLambdaQueryWrapper.eq(SOrder::getPayStatus, YesNoEnum.yes.getIndex());
sOrderLambdaQueryWrapper.in(SOrder::getRoomId, roomIds);
sOrderLambdaQueryWrapper.eq(SOrder::getOrderType, OrderTypeEnum.RESERVER.getCode());
sOrderLambdaQueryWrapper.notIn(SOrder::getRefundStatus, RefundStatusEnum.getRefundedStatus());
sOrderLambdaQueryWrapper.between(SOrder::getPreStartDate, now, DateUtil.offsetMinute(now, CLEANING));
List<SOrder> orderList = orderService.list(sOrderLambdaQueryWrapper);
......@@ -223,12 +225,12 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
sCleanRecords.setStartDate(now);
sCleanRecords.setEndDate(now);
sCleanRecords.setUpdateTime(now);
List<Long> unusedOrderRoomIds = Optional.ofNullable(orderList).
orElse(new ArrayList<>()).stream().filter(order -> order.getStatus().equals(OrderStatusEnum.UNUSED.getCode()))
.map(SOrder::getRoomId).collect(Collectors.toList());
if (unusedOrderRoomIds.contains(sCleanRecords.getRoomId())) {
deviceOpService.openOrCloseDevice(sCleanRecords.getRoomId(), phone, OpTypeEnum.CUT_ELECTRIC.getCode(), true, FIVE);
}
// List<Long> unusedOrderRoomIds = Optional.ofNullable(orderList).
// orElse(new ArrayList<>()).stream().filter(order -> order.getStatus().equals(OrderStatusEnum.UNUSED.getCode()))
// .map(SOrder::getRoomId).collect(Collectors.toList());
// if (unusedOrderRoomIds.contains(sCleanRecords.getRoomId())) {
// deviceOpService.openOrCloseDevice(sCleanRecords.getRoomId(), phone, OpTypeEnum.CUT_ELECTRIC.getCode(), true, FIVE);
// }
}
return 0 < baseMapper.updateBatch(list);
}
......
......@@ -419,10 +419,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
private void checkOrderDate(CreateOrderRequest request) {
LambdaQueryWrapper<SOrder> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.notIn(SOrder::getRefundStatus, RefundStatusEnum.getRefundedStatus());
queryWrapper.in(SOrder::getStatus, new ArrayList<Integer>(){{
add(OrderStatusEnum.UNUSED.getCode());
add(OrderStatusEnum.INUSE.getCode());
}});
queryWrapper.in(SOrder::getStatus, OrderStatusEnum.getValidOrderStatus());
queryWrapper.eq(SOrder::getPayStatus, YesNoEnum.yes.getIndex());
queryWrapper.eq(SOrder::getStoreId, request.getStoreId());
queryWrapper.eq(SOrder::getRoomId, request.getRoomId());
......
......@@ -119,7 +119,7 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
//判断门店下是否有已支付.待使用,使用中订单
LambdaQueryWrapper<SOrder> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SOrder::getStoreId, sStore.getId());
queryWrapper.in(SOrder::getStatus, OrderStatusEnum.UNUSED.getCode(), OrderStatusEnum.INUSE.getCode());
queryWrapper.in(SOrder::getStatus, OrderStatusEnum.getUnfinishOrderStatus());
queryWrapper.eq(SOrder::getPayStatus, PayStatusEnum.PAID.getCode());
queryWrapper.eq(SOrder::getRefundStatus, RefundStatusEnum.UNREFUND.getCode());
......
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