|
@@ -106,7 +106,7 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public String bookingOrderSave(BookingOrderSaveDto item, Boolean isTeam) {
|
|
|
|
|
|
|
+ public String bookingOrderSave(BookingOrderSaveDto item, Boolean isTeam,Boolean isLiving) {
|
|
|
isTeam = isTeam != null && isTeam;
|
|
isTeam = isTeam != null && isTeam;
|
|
|
LoginUser user = TokenUtils.getAuthUser();
|
|
LoginUser user = TokenUtils.getAuthUser();
|
|
|
item.getOrderInfo().setCreateTime(new Date());
|
|
item.getOrderInfo().setCreateTime(new Date());
|
|
@@ -185,7 +185,7 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
if(item.getOrderInfo().getBookingOrdersType().equals(BookingOrdersType.NORMAL.getKey())) {
|
|
if(item.getOrderInfo().getBookingOrdersType().equals(BookingOrdersType.NORMAL.getKey())) {
|
|
|
if(item.getOrderInfo().getArrivalTime() == null || item.getOrderInfo().getDueOutTime() == null)
|
|
if(item.getOrderInfo().getArrivalTime() == null || item.getOrderInfo().getDueOutTime() == null)
|
|
|
throw new JeecgBootException("预抵时间和预离时间不能为空");
|
|
throw new JeecgBootException("预抵时间和预离时间不能为空");
|
|
|
- if(item.getOrderInfo().getArrivalTime().getTime() < new Date().getTime())
|
|
|
|
|
|
|
+ if(item.getOrderInfo().getArrivalTime().getTime() < new Date().getTime() && !isLiving)
|
|
|
throw new JeecgBootException("预抵时间不能小于当前时间");
|
|
throw new JeecgBootException("预抵时间不能小于当前时间");
|
|
|
if(item.getOrderInfo().getArrivalTime().getTime() >= item.getOrderInfo().getDueOutTime().getTime())
|
|
if(item.getOrderInfo().getArrivalTime().getTime() >= item.getOrderInfo().getDueOutTime().getTime())
|
|
|
throw new JeecgBootException("预抵时间不能大于或者等于预离时间");
|
|
throw new JeecgBootException("预抵时间不能大于或者等于预离时间");
|
|
@@ -872,7 +872,7 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public String bookingToLive(String bookingRoomId, List<BusLivingCustomer> customers, String hotelId, Boolean bookingLiving) {
|
|
|
|
|
|
|
+ public String bookingToLive(String bookingRoomId, List<BusLivingCustomer> customers, String hotelId, Boolean bookingLiving, BusRoomBookingOrders livingRoomOrderInfo) {
|
|
|
BusBookingRooms bkRoom = bookingRoomsService.getById(bookingRoomId);
|
|
BusBookingRooms bkRoom = bookingRoomsService.getById(bookingRoomId);
|
|
|
if(bkRoom == null) throw new JeecgBootException("关联房间不存在");
|
|
if(bkRoom == null) throw new JeecgBootException("关联房间不存在");
|
|
|
BusRoomBookingOrders bookingOrders = getById(bkRoom.getBookingOrdersId());
|
|
BusRoomBookingOrders bookingOrders = getById(bkRoom.getBookingOrdersId());
|
|
@@ -883,7 +883,12 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
BusRoomsLivingOrder livingOrder = null;
|
|
BusRoomsLivingOrder livingOrder = null;
|
|
|
if(bkRoom.getBookingType().equals(BookingOrdersType.NORMAL.getKey())) {
|
|
if(bkRoom.getBookingType().equals(BookingOrdersType.NORMAL.getKey())) {
|
|
|
//todo other
|
|
//todo other
|
|
|
- livingOrder = copyBookingToAcceptOrder(bookingOrders);
|
|
|
|
|
|
|
+ if(livingRoomOrderInfo != null) {
|
|
|
|
|
+ livingRoomOrderInfo.setId(bookingOrders.getId());
|
|
|
|
|
+ // 设置为当前时间
|
|
|
|
|
+ livingRoomOrderInfo.setArrivalTime(new Date());
|
|
|
|
|
+ }
|
|
|
|
|
+ livingOrder = copyBookingToAcceptOrder(livingRoomOrderInfo);
|
|
|
livingOrder.setBookingRoomId(bookingRoomId);
|
|
livingOrder.setBookingRoomId(bookingRoomId);
|
|
|
} else if(bkRoom.getBookingType().equals(BookingOrdersType.TEAM.getKey())) {
|
|
} else if(bkRoom.getBookingType().equals(BookingOrdersType.TEAM.getKey())) {
|
|
|
BusBookingBatch batch = bookingBatchService.getById(bkRoom.getBookingBatchId());
|
|
BusBookingBatch batch = bookingBatchService.getById(bkRoom.getBookingBatchId());
|
|
@@ -974,7 +979,7 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public String customerLiving(BookingOrderSaveDto livingData, Boolean isTeam, String hotelId) {
|
|
public String customerLiving(BookingOrderSaveDto livingData, Boolean isTeam, String hotelId) {
|
|
|
- String bookingOrderNo = bookingOrderSave(livingData,isTeam);
|
|
|
|
|
|
|
+ String bookingOrderNo = bookingOrderSave(livingData,isTeam,true);
|
|
|
if(bookingOrderNo != null && !bookingOrderNo.isEmpty()){
|
|
if(bookingOrderNo != null && !bookingOrderNo.isEmpty()){
|
|
|
BookingOrderEditVo bookingOrderVo = getBookingInfoById(null,bookingOrderNo);
|
|
BookingOrderEditVo bookingOrderVo = getBookingInfoById(null,bookingOrderNo);
|
|
|
// 散客取roomIds
|
|
// 散客取roomIds
|
|
@@ -1476,7 +1481,7 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
livingCustomer.setId(null);
|
|
livingCustomer.setId(null);
|
|
|
livingCustomer.setLivingOrderId(null);
|
|
livingCustomer.setLivingOrderId(null);
|
|
|
customers.add(livingCustomer);
|
|
customers.add(livingCustomer);
|
|
|
- String livingOrderId = bookingToLive(bookingRooms.getId(), customers,hotelId,null);
|
|
|
|
|
|
|
+ String livingOrderId = bookingToLive(bookingRooms.getId(), customers,hotelId,null,null);
|
|
|
|
|
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
@@ -1998,10 +2003,10 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
roomIds.forEach(bkRoom-> {
|
|
roomIds.forEach(bkRoom-> {
|
|
|
if(livingData.getRoomIds().stream().filter(s->s.getRoomId().equals(bkRoom.getRoomId())).count() == 0)
|
|
if(livingData.getRoomIds().stream().filter(s->s.getRoomId().equals(bkRoom.getRoomId())).count() == 0)
|
|
|
throw new JeecgBootException("房间信息未找到");
|
|
throw new JeecgBootException("房间信息未找到");
|
|
|
-
|
|
|
|
|
- List<BusLivingCustomer> customers = livingData.getRoomIds().stream().filter(s->s.getRoomId().equals(bkRoom.getRoomId())).findFirst().get().getLivingCustomers();
|
|
|
|
|
|
|
+ BookingLayoutRoomsDto bkRoomItem = livingData.getRoomIds().stream().filter(s->s.getRoomId().equals(bkRoom.getRoomId())).findFirst().get();
|
|
|
|
|
+ List<BusLivingCustomer> customers = bkRoomItem.getLivingCustomers();
|
|
|
if(customers == null || customers.size() == 0) throw new JeecgBootException("请添加客户信息");
|
|
if(customers == null || customers.size() == 0) throw new JeecgBootException("请添加客户信息");
|
|
|
- String livingOrderId = bookingToLive(bkRoom.getId(), customers,hotelId,null);
|
|
|
|
|
|
|
+ String livingOrderId = bookingToLive(bkRoom.getId(), customers,hotelId,null, bkRoomItem.getRoomOrderInfo());
|
|
|
// 费用关联到主房
|
|
// 费用关联到主房
|
|
|
if(livingData.getOrderFees()!=null && livingData.getOrderFees().size() > 0 ) {
|
|
if(livingData.getOrderFees()!=null && livingData.getOrderFees().size() > 0 ) {
|
|
|
List<BusOrderFee> findRoomFees = livingData.getOrderFees().stream().filter(t->t.getRoomId().equals(bkRoom.getRoomId())).collect(Collectors.toList());
|
|
List<BusOrderFee> findRoomFees = livingData.getOrderFees().stream().filter(t->t.getRoomId().equals(bkRoom.getRoomId())).collect(Collectors.toList());
|