This commit is contained in:
Mauve
2026-10-26 09:31:05 +08:00
parent 3a8a438668
commit 90cc47b14b
20 changed files with 576 additions and 233 deletions
@@ -828,19 +828,46 @@ public class ApprovalService {
if ("DAYLIGHT".equalsIgnoreCase(bookingView.getPropertyCategory())) {
isOverBook = false;
} else {
isOverBook = this.checkIsOverbook(bookingView.getRoomId(), bookingView.getCheckinDate(),
bookingView.getCheckoutDate(), bookingView.getPropertyId(), bookingView.getBlockId());
isOverBook = this.checkIsOverbook(bookingView.getRoomId(), originBooking.getCheckinDate(),
originBooking.getCheckoutDate(), bookingView.getPropertyId(), bookingView.getBlockId());
}
Boolean isOtherOverBook = this.checkOtherIsOverbook(Math.toIntExact(originBooking.getRoomId()), originBooking.getCheckoutDate(),
originBooking.getCheckinDate(), originBooking.getPropertyId(), originBooking.getSegmentId());
if (bookingView != null) {
bookingView.setCheckinDate(originBooking.getCheckinDate());
bookingView.setCheckoutDate(originBooking.getCheckoutDate());
Integer numOfNight = Integer.valueOf(DateTimeUtil.getDiffDate(
bookingView.getCheckinDate(), bookingView.getCheckoutDate(), "day"));
List<String> dates = new ArrayList<>();
List<JSONObject> dateList = new ArrayList<>();
JSONObject obj = new JSONObject();
for (int j = 0; j < numOfNight + 1; j++) {
dates.add(DateTimeUtil.getDateByFormat(DateTimeUtil.addDay(bookingView.getCheckinDate(), j), "yyyy-MM-dd"));
}
obj.put("date", dates);
obj.put("numOfNight", numOfNight);
obj.put("numOfRoom", 1);
obj.put("checked", true);
dateList.add(obj);
bookingView.setDateList(dateList);
bookingView.setNumOfNight(numOfNight);
originBooking.setDateList(JSONArray.toJSONString(dateList));
originBooking.setNumOfNight(numOfNight);
bookingView.setApproveStatus(originBooking.getApproveStatus());
bookingView.setApprovedAt(originBooking.getApprovedAt());
bookingView.setApprovedBy(originBooking.getApprovedBy());
bookingView.setApprovedId(originBooking.getApprovedId());
}
bookingDao.saveAndFlush(originBooking);
LogUtil.info(ApprovalService.class,"Submitting Approval.BookingID:"+bookingId+"|Save CheckinDate = "+originBooking.getCheckinDate()+" Save CheckoutDate = "+originBooking.getCheckoutDate());
if (Strings.CS.equals(originBooking.getBookType(),"0")){
//create 的情况
LogUtil.info(ApprovalService.class,"Submitting Approval.BookingID:"+bookingId+"|bookingType:Create");
bookingDao.save(originBooking);
BookingsView originBookingView = bookingViewDao.findById(Long.parseLong(bookingId));
BookingsView originBookingView = bookingView;
originBookingView = this.getEmailInfo(originBookingView,originBookingView.getCreatedBy()).getData();
// 判断是OPETA或OTHER Property