|
@@ -93,6 +93,27 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
|
|
|
|
|
if(item.getOrderInfo().getBookingOrdersType() == null)
|
|
if(item.getOrderInfo().getBookingOrdersType() == null)
|
|
|
throw new JeecgBootException("参数错误");
|
|
throw new JeecgBootException("参数错误");
|
|
|
|
|
+ // 【添加客人信息 Start】
|
|
|
|
|
+ if(item.getContactName() != null && !item.getContactName().isEmpty() && item.getPhone() != null && !item.getPhone().isEmpty()){
|
|
|
|
|
+ BusCustomer customer = customerService.getOne(Wrappers.<BusCustomer>query().eq("name",item.getContactName())
|
|
|
|
|
+ .eq("phone",item.getPhone()));
|
|
|
|
|
+ if(customer == null) {
|
|
|
|
|
+ // save customer
|
|
|
|
|
+ BusCustomer newCustomer = new BusCustomer();
|
|
|
|
|
+ newCustomer.setCreateTime(new Date());
|
|
|
|
|
+ newCustomer.setCreateUser(user.getId());
|
|
|
|
|
+ newCustomer.setHotelId(user.getRelTenantIds());
|
|
|
|
|
+ newCustomer.setTenantId(user.getRelTenantIds());
|
|
|
|
|
+ newCustomer.setName(item.getContactName());
|
|
|
|
|
+ newCustomer.setPhone(item.getPhone());
|
|
|
|
|
+ newCustomer.setCertType(1); // 身份证
|
|
|
|
|
+ customerService.save(newCustomer);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ item.getOrderInfo().setContactId(customer.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+ } else throw new JeecgBootException("客人信息不能为空");
|
|
|
|
|
+
|
|
|
|
|
+ // 【添加客人信息 end】
|
|
|
// 散客预定
|
|
// 散客预定
|
|
|
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)
|
|
@@ -137,21 +158,7 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
dayPriceService.saveBatch(item.getLayoutDayPrices());
|
|
dayPriceService.saveBatch(item.getLayoutDayPrices());
|
|
|
// 处理预定每天的房型价格 End
|
|
// 处理预定每天的房型价格 End
|
|
|
|
|
|
|
|
- // 添加客人信息 Start
|
|
|
|
|
-// if(item.getContactName() != null && !item.getContactName().isEmpty() && item.getPhone() != null && !item.getPhone().isEmpty()){
|
|
|
|
|
-// BusCustomer customer = customerService.getOne(Wrappers.<BusCustomer>query().eq("name",item.getContactName())
|
|
|
|
|
-// .eq("phone",item.getPhone()));
|
|
|
|
|
-//
|
|
|
|
|
-// if(item.getOrderInfo().getContactId() != null && !item.getOrderInfo().getContactId().isEmpty()) {
|
|
|
|
|
-// if(customer == null) {
|
|
|
|
|
-// item.getOrderInfo().setContactId(customer.getId());
|
|
|
|
|
-// } else {
|
|
|
|
|
-// if(customer.getId().equals(item.getOrderInfo().getContactId()))
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
|
|
|
|
|
- // 添加客人信息 end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return item.getOrderInfo().getBookingOrdersNo();
|
|
return item.getOrderInfo().getBookingOrdersNo();
|
|
@@ -290,6 +297,27 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
if(item.getOrderInfo().getHourRoomId() == null || item.getOrderInfo().getHourRoomId().isEmpty())
|
|
if(item.getOrderInfo().getHourRoomId() == null || item.getOrderInfo().getHourRoomId().isEmpty())
|
|
|
throw new JeecgBootException("钟点房计费项目不能为空");
|
|
throw new JeecgBootException("钟点房计费项目不能为空");
|
|
|
}
|
|
}
|
|
|
|
|
+ // 【添加客人信息 Start】
|
|
|
|
|
+ if(item.getContactName() != null && !item.getContactName().isEmpty() && item.getPhone() != null && !item.getPhone().isEmpty()){
|
|
|
|
|
+ BusCustomer customer = customerService.getOne(Wrappers.<BusCustomer>query().eq("name",item.getContactName())
|
|
|
|
|
+ .eq("phone",item.getPhone()));
|
|
|
|
|
+ if(customer == null) {
|
|
|
|
|
+ // save customer
|
|
|
|
|
+ BusCustomer newCustomer = new BusCustomer();
|
|
|
|
|
+ newCustomer.setCreateTime(new Date());
|
|
|
|
|
+ newCustomer.setCreateUser(user.getId());
|
|
|
|
|
+ newCustomer.setHotelId(user.getRelTenantIds());
|
|
|
|
|
+ newCustomer.setTenantId(user.getRelTenantIds());
|
|
|
|
|
+ newCustomer.setName(item.getContactName());
|
|
|
|
|
+ newCustomer.setPhone(item.getPhone());
|
|
|
|
|
+ newCustomer.setCertType(1); // 身份证
|
|
|
|
|
+ customerService.save(newCustomer);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ item.getOrderInfo().setContactId(customer.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+ } else throw new JeecgBootException("客人信息不能为空");
|
|
|
|
|
+
|
|
|
|
|
+ // 【添加客人信息 end】
|
|
|
// 散客预定
|
|
// 散客预定
|
|
|
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)
|