|
|
@@ -32,14 +32,8 @@ import org.jeecg.modules.rooms.Enum.RoomStatusEnum;
|
|
|
import org.jeecg.modules.rooms.Vo.BookingRealtimeVo;
|
|
|
import org.jeecg.modules.rooms.Vo.FloorBuildingRoomVo;
|
|
|
import org.jeecg.modules.rooms.Vo.LivingRealtimeVo;
|
|
|
-import org.jeecg.modules.rooms.entity.CesAllDayPriceRule;
|
|
|
-import org.jeecg.modules.rooms.entity.CesRoomBuildingFloor;
|
|
|
-import org.jeecg.modules.rooms.entity.CesRoomLayout;
|
|
|
-import org.jeecg.modules.rooms.entity.CesRooms;
|
|
|
-import org.jeecg.modules.rooms.service.CesAllDayPriceRuleServiceImpl;
|
|
|
-import org.jeecg.modules.rooms.service.CesRoomBuildingFloorServiceImpl;
|
|
|
-import org.jeecg.modules.rooms.service.CesRoomLayoutServiceImpl;
|
|
|
-import org.jeecg.modules.rooms.service.CesRoomsServiceImpl;
|
|
|
+import org.jeecg.modules.rooms.entity.*;
|
|
|
+import org.jeecg.modules.rooms.service.*;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -131,6 +125,10 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
|
|
|
@Resource
|
|
|
private IFwRoomExamineService fwRoomExamineService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private CesHourRoomRuleServiceImpl hourRoomRuleService;
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public String bookingOrderSave(BookingOrderSaveDto item, Boolean isTeam,Boolean isLiving,String hotelId) {
|
|
|
@@ -1693,6 +1691,37 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
updateById(order);
|
|
|
return true;
|
|
|
}
|
|
|
+
|
|
|
+ if(info.getLiveType() != null && info.getLiveType().equals(2)){
|
|
|
+ if(info.getFangAnId() != null && !info.getFangAnId().isEmpty()) {
|
|
|
+ CesHourRoomRule hourRoomRule = hourRoomRuleService.getById(info.getFangAnId());
|
|
|
+ Integer timeMins = hourRoomRule.getAfterOpenRoom();// 分钟
|
|
|
+ Date targetTime = DateUtils.formatAddDateMin(order.getArrivalTime(),timeMins);
|
|
|
+ if(targetTime.getTime() > new Date().getTime()) throw new JeecgBootException("方案时间超时");
|
|
|
+ order.setBookingType(2);
|
|
|
+ order.setHourRoomId(info.getFangAnId());
|
|
|
+ updateById(order);
|
|
|
+ } else throw new JeecgBootException("请选择时租房规则");
|
|
|
+ }
|
|
|
+
|
|
|
+ if(info.getBrkfstNum() != null && info.getBrkfstNum() >= 0) {
|
|
|
+ order.setBreakfastNum(info.getBrkfstNum());
|
|
|
+ updateById(order);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(info.getLchNum() != null && info.getLchNum() >= 0) {
|
|
|
+ order.setLunchNum(info.getLchNum());
|
|
|
+ updateById(order);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(info.getDnrNum() != null && info.getDnrNum() >= 0) {
|
|
|
+ order.setDinnerNum(info.getDnrNum());
|
|
|
+ updateById(order);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
return false;
|
|
|
}
|
|
|
if(type.equals(2)) {
|
|
|
@@ -1712,10 +1741,20 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
newCustomer.setPhone(info.getCusPhone());
|
|
|
newCustomer.setCertType(1); // 身份证
|
|
|
customerService.save(newCustomer);
|
|
|
+ customer = newCustomer;
|
|
|
order.setContactId(newCustomer.getId());
|
|
|
} else {
|
|
|
order.setContactId(customer.getId());
|
|
|
}
|
|
|
+ List<BusLivingCustomer> customers = livingCustomerService.list(Wrappers.<BusLivingCustomer>query().eq("living_order_id",order.getId()));
|
|
|
+ if(customers.size() > 0) {
|
|
|
+ BusLivingCustomer firstCustomer = customers.get(0);
|
|
|
+ firstCustomer.setCustomerId(customer.getId());
|
|
|
+ firstCustomer.setCustomerName(customer.getName());
|
|
|
+ firstCustomer.setPhone(customer.getPhone());
|
|
|
+ firstCustomer.setCertNo(customer.getCertNo());
|
|
|
+ livingCustomerService.updateById(firstCustomer);
|
|
|
+ }
|
|
|
roomsLivingOrderService.updateById(order);
|
|
|
return true;
|
|
|
}
|
|
|
@@ -1742,6 +1781,40 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
roomsLivingOrderService.updateById(order);
|
|
|
return true;
|
|
|
}
|
|
|
+ if(info.getLiveType() != null && info.getLiveType().equals(2)){
|
|
|
+ if(info.getFangAnId() != null && !info.getFangAnId().isEmpty()) {
|
|
|
+ CesHourRoomRule hourRoomRule = hourRoomRuleService.getById(info.getFangAnId());
|
|
|
+ Integer timeMins = hourRoomRule.getAfterOpenRoom();// 分钟
|
|
|
+ Date targetTime = DateUtils.formatAddDateMin(order.getArrivalTime(),timeMins);
|
|
|
+ if(targetTime.getTime() > new Date().getTime()) throw new JeecgBootException("方案时间超时");
|
|
|
+ order.setLivingType(2);
|
|
|
+ order.setHourRoomId(info.getFangAnId());
|
|
|
+
|
|
|
+ } else throw new JeecgBootException("请选择时租房规则");
|
|
|
+ if(info.getPrices() != null && info.getPrices().getDayPrices().size() > 0) {
|
|
|
+ updateOrderPrice(info.getPrices());
|
|
|
+ }
|
|
|
+ roomsLivingOrderService.updateById(order);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(info.getBrkfstNum() != null && info.getBrkfstNum() >= 0) {
|
|
|
+ order.setBreakfastNum(info.getBrkfstNum());
|
|
|
+ roomsLivingOrderService.updateById(order);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(info.getLchNum() != null && info.getLchNum() >= 0) {
|
|
|
+ order.setLunchNum(info.getLchNum());
|
|
|
+ roomsLivingOrderService.updateById(order);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(info.getDnrNum() != null && info.getDnrNum() >= 0) {
|
|
|
+ order.setDinnerNum(info.getDnrNum());
|
|
|
+ roomsLivingOrderService.updateById(order);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
return false;
|
|
|
}
|
|
|
return false;
|