merge limo to daylight
This commit is contained in:
@@ -183,9 +183,11 @@ public class TodoService {
|
||||
|
||||
if (StringUtils.isNotBlank(confNum)) {
|
||||
if ("Inhouse".equalsIgnoreCase(todoCategory) || "Arrival".equalsIgnoreCase(todoCategory)) {
|
||||
List<CfgProperties> daylightProperties = propertyDao.findByCategory("DAYLIGHT");
|
||||
if (CollectionUtils.isNotEmpty(daylightProperties)) {
|
||||
CfgProperties property = daylightProperties.get(0);
|
||||
Bookings bookings = bookingDao.findFirstByConfirmationNoAndPropertyIdIsNotNull(confNum);
|
||||
|
||||
CfgProperties property = propertyDao.findById(bookings.getPropertyId()).orElse(null);
|
||||
|
||||
if (Objects.nonNull(property)) {
|
||||
|
||||
if ("Inhouse".equalsIgnoreCase(todoCategory)) {
|
||||
// Parse checkinDate from recordDesc (e.g., "Jun 25 – Jul 1 ...")
|
||||
@@ -504,81 +506,81 @@ public class TodoService {
|
||||
List<TodoDateListRecord> dateList = new ArrayList<>(dateMap.values());
|
||||
|
||||
// TODO daylight专用,后面要改 by Mauve
|
||||
if (1 == 1) {
|
||||
for (TodoDateListRecord todoDateListRecord : dateList) {
|
||||
|
||||
List<TodoListRecord> dateRecords = todoDateListRecord.getDateRecords();
|
||||
for (TodoDateListRecord todoDateListRecord : dateList) {
|
||||
|
||||
for (TodoListRecord record : dateRecords) {
|
||||
List<String> descriptions = record.getDescriptions();
|
||||
if (CollectionUtils.isEmpty(descriptions)) {
|
||||
continue;
|
||||
}
|
||||
List<TodoListRecord> dateRecords = todoDateListRecord.getDateRecords();
|
||||
|
||||
try {
|
||||
for (String description : descriptions) {
|
||||
if (StringUtils.isBlank(description)) {
|
||||
continue;
|
||||
}
|
||||
for (TodoListRecord record : dateRecords) {
|
||||
List<String> descriptions = record.getDescriptions();
|
||||
if (CollectionUtils.isEmpty(descriptions)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int confIndex = description.indexOf("Conf#");
|
||||
if (confIndex == -1) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
for (String description : descriptions) {
|
||||
if (StringUtils.isBlank(description)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String confPart = description.substring(confIndex + 5);
|
||||
int pipeIndex = confPart.indexOf("|");
|
||||
String confNum = (pipeIndex == -1 ? confPart : confPart.substring(0, pipeIndex)).trim();
|
||||
int confIndex = description.indexOf("Conf#");
|
||||
if (confIndex == -1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(confNum)) {
|
||||
if ("Inhouse".equalsIgnoreCase(category) || "Arrival".equalsIgnoreCase(category)) {
|
||||
List<CfgProperties> daylightProperties = propertyDao.findByCategory("DAYLIGHT");
|
||||
if (CollectionUtils.isNotEmpty(daylightProperties)) {
|
||||
CfgProperties property = daylightProperties.get(0);
|
||||
if ("Inhouse".equalsIgnoreCase(category)) {
|
||||
BaseApiResponse<ReservationDoorKeyResponse> doorKeyResult =
|
||||
dlService.getReservationDoorKeyByConfirmationNumber(property.getDlPropertyId(), confNum);
|
||||
ReservationDoorKeyResponse doorKeyData = doorKeyResult.getData();
|
||||
boolean isRoomReady = doorKeyResult.isSuccess()
|
||||
&& doorKeyData != null
|
||||
&& StringUtils.isNotBlank(doorKeyData.getId())
|
||||
&& !doorKeyData.isHasKey();
|
||||
if (isRoomReady) {
|
||||
record.setRoomReady(true);
|
||||
updateTodoRecordDescription(record, confNum, "[Rm Ready]");
|
||||
}
|
||||
} else {
|
||||
BaseApiResponse<ReservationQueueResponse> queueResult =
|
||||
dlService.getReservationQueueByConfirmationNumber(property.getDlPropertyId(), confNum);
|
||||
ReservationQueueResponse queueData = queueResult.getData();
|
||||
boolean isQueue = queueResult.isSuccess()
|
||||
&& queueData != null
|
||||
&& queueData.isQueue();
|
||||
if (isQueue) {
|
||||
record.setIsQueue(true);
|
||||
updateTodoRecordDescription(record, confNum, "[In Queue]");
|
||||
}
|
||||
String confPart = description.substring(confIndex + 5);
|
||||
int pipeIndex = confPart.indexOf("|");
|
||||
String confNum = (pipeIndex == -1 ? confPart : confPart.substring(0, pipeIndex)).trim();
|
||||
|
||||
if (StringUtils.isNotBlank(confNum)) {
|
||||
if ("Inhouse".equalsIgnoreCase(category) || "Arrival".equalsIgnoreCase(category)) {
|
||||
List<CfgProperties> daylightProperties = propertyDao.findByCategory("DAYLIGHT");
|
||||
if (CollectionUtils.isNotEmpty(daylightProperties)) {
|
||||
CfgProperties property = daylightProperties.get(0);
|
||||
if ("Inhouse".equalsIgnoreCase(category)) {
|
||||
BaseApiResponse<ReservationDoorKeyResponse> doorKeyResult =
|
||||
dlService.getReservationDoorKeyByConfirmationNumber(property.getDlPropertyId(), confNum);
|
||||
ReservationDoorKeyResponse doorKeyData = doorKeyResult.getData();
|
||||
boolean isRoomReady = doorKeyResult.isSuccess()
|
||||
&& doorKeyData != null
|
||||
&& StringUtils.isNotBlank(doorKeyData.getId())
|
||||
&& !doorKeyData.isHasKey();
|
||||
if (isRoomReady) {
|
||||
record.setRoomReady(true);
|
||||
updateTodoRecordDescription(record, confNum, "[Rm Ready]");
|
||||
}
|
||||
} else {
|
||||
BaseApiResponse<ReservationQueueResponse> queueResult =
|
||||
dlService.getReservationQueueByConfirmationNumber(property.getDlPropertyId(), confNum);
|
||||
ReservationQueueResponse queueData = queueResult.getData();
|
||||
boolean isQueue = queueResult.isSuccess()
|
||||
&& queueData != null
|
||||
&& queueData.isQueue();
|
||||
if (isQueue) {
|
||||
record.setIsQueue(true);
|
||||
updateTodoRecordDescription(record, confNum, "[In Queue]");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<BookingsView> bookingByConfirmationNo = bookingService.getBookingByDaylightConf(confNum);
|
||||
List<BookingsView> bookingByConfirmationNo = bookingService.getBookingByDaylightConf(confNum);
|
||||
|
||||
for (BookingsView bookingsView : bookingByConfirmationNo) {
|
||||
if (StringUtils.isNotBlank(bookingsView.getEta())) {
|
||||
String[] split2 = bookingsView.getEta().split(":");
|
||||
record.setETA(split2[0] + ":" + split2[1]);
|
||||
}
|
||||
for (BookingsView bookingsView : bookingByConfirmationNo) {
|
||||
if (StringUtils.isNotBlank(bookingsView.getEta())) {
|
||||
String[] split2 = bookingsView.getEta().split(":");
|
||||
record.setETA(split2[0] + ":" + split2[1]);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("Failed to process todo descriptions={}", descriptions, e);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("Failed to process todo descriptions={}", descriptions, e);
|
||||
}
|
||||
}
|
||||
dateResult.setRecords(dateList);
|
||||
}
|
||||
dateResult.setRecords(dateList);
|
||||
|
||||
|
||||
result.setSuccess(true);
|
||||
result.setData(dateResult);
|
||||
|
||||
Reference in New Issue
Block a user