|
|
@@ -84,7 +84,17 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
|
|
|
item.getOrderInfo().setBookingOrdersNo("YD"+sdf.format(System.currentTimeMillis()));
|
|
|
-// if(item.getOrderInfo().getBookingType() == null)
|
|
|
+ // 检测是否时间安排上有冲突
|
|
|
+ List<String> roomIds = item.getRoomIds().stream().map(s->s.getRoomId()).collect(Collectors.toList());
|
|
|
+ if(item.getConfirm() == null || !item.getConfirm()){
|
|
|
+ if(roomIds.size() > 0) {
|
|
|
+ List<BusBookingRooms> bookingRooms = baseMapper.conflictBookingTime(item.getOrderInfo().getArrivalTime(),item.getOrderInfo().getDueOutTime(),roomIds);
|
|
|
+ if(bookingRooms.size() > 0) {
|
|
|
+ String roomNames = bookingRooms.stream().map(p->p.getRoomId()).collect(Collectors.joining("|"));
|
|
|
+ throw new JeecgBootException("房间["+roomNames+"]与预约时间有冲突");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
if(item.getOrderInfo().getCustomerSource() == null || item.getOrderInfo().getCustomerSource().isEmpty())
|
|
|
throw new JeecgBootException("客人来源不能为空");
|