|
|
@@ -26,6 +26,7 @@ public class ReservationOrderPageServiceImpl implements ReservationOrderPageServ
|
|
|
|
|
|
private static final int PAYMENT_DEADLINE_MINUTES = 15;
|
|
|
private static final int ORDER_STATUS_UNPAID = 0;
|
|
|
+ private static final int ORDER_STATUS_TO_USE = 1;
|
|
|
private static final int CANCELLATION_FREE = 0;
|
|
|
private static final int CANCELLATION_NOT_FREE = 1;
|
|
|
private static final int CANCELLATION_CONDITIONAL = 2;
|
|
|
@@ -64,8 +65,22 @@ public class ReservationOrderPageServiceImpl implements ReservationOrderPageServ
|
|
|
vo.setPaymentSecondsLeft(secondsLeft);
|
|
|
vo.setCanContinuePay(Boolean.valueOf(ORDER_STATUS_UNPAID == order.getOrderStatus() && secondsLeft > 0));
|
|
|
|
|
|
- // 页面标题后缀
|
|
|
- vo.setPageTitleSuffix(buildPageTitleSuffix(order.getCancellationPolicyType()));
|
|
|
+ // 页面标题:待支付 / 预订成功(待使用兼容预订成功页)
|
|
|
+ Integer orderStatus = order.getOrderStatus();
|
|
|
+ if (ORDER_STATUS_UNPAID == orderStatus) {
|
|
|
+ vo.setPageTitle("待支付");
|
|
|
+ vo.setPageTitleSuffix(buildPendingPaymentTitleSuffix(order.getCancellationPolicyType()));
|
|
|
+ } else if (ORDER_STATUS_TO_USE == orderStatus) {
|
|
|
+ vo.setPageTitle("预订成功");
|
|
|
+ vo.setPageTitleSuffix(buildSuccessPageTitleSuffix(order.getCancellationPolicyType()));
|
|
|
+ } else {
|
|
|
+ vo.setPageTitle(null);
|
|
|
+ vo.setPageTitleSuffix(buildPendingPaymentTitleSuffix(order.getCancellationPolicyType()));
|
|
|
+ }
|
|
|
+
|
|
|
+ // 操作按钮:取消预订、修改预订
|
|
|
+ vo.setCanCancelReservation(Boolean.valueOf(ORDER_STATUS_UNPAID == orderStatus || ORDER_STATUS_TO_USE == orderStatus));
|
|
|
+ vo.setCanModifyReservation(Boolean.valueOf(ORDER_STATUS_TO_USE == orderStatus));
|
|
|
|
|
|
// 门店
|
|
|
if (storeId != null) {
|
|
|
@@ -115,11 +130,14 @@ public class ReservationOrderPageServiceImpl implements ReservationOrderPageServ
|
|
|
vo.setVerificationCode(order.getVerificationCode());
|
|
|
vo.setVerificationUrl(order.getVerificationUrl());
|
|
|
|
|
|
- // 预订说明
|
|
|
- vo.setLateArrivalGraceMinutes(order.getLateArrivalGraceMinutes() != null ? order.getLateArrivalGraceMinutes() : 0);
|
|
|
- vo.setSeatRetentionText(order.getLateArrivalGraceMinutes() != null && order.getLateArrivalGraceMinutes() > 0
|
|
|
- ? "未按时到店座位保留" + order.getLateArrivalGraceMinutes() + "分钟"
|
|
|
- : null);
|
|
|
+ // 预订说明(待支付与待使用页面共用)
|
|
|
+ Integer graceMinutes = order.getLateArrivalGraceMinutes() != null ? order.getLateArrivalGraceMinutes() : 0;
|
|
|
+ vo.setLateArrivalGraceMinutes(graceMinutes);
|
|
|
+ if (graceMinutes != null && graceMinutes > 0) {
|
|
|
+ vo.setSeatRetentionText("未按时到店座位保留" + graceMinutes + "分钟");
|
|
|
+ } else {
|
|
|
+ vo.setSeatRetentionText("未按时到店座位将不会保留");
|
|
|
+ }
|
|
|
vo.setDepositAmount(order.getDepositAmount());
|
|
|
vo.setDepositText(order.getDepositAmount() != null && order.getDepositAmount().compareTo(BigDecimal.ZERO) > 0
|
|
|
? "需支付¥" + order.getDepositAmount().stripTrailingZeros().toPlainString() + "订金"
|
|
|
@@ -159,19 +177,22 @@ public class ReservationOrderPageServiceImpl implements ReservationOrderPageServ
|
|
|
return diff > 0 ? (int) diff : 0;
|
|
|
}
|
|
|
|
|
|
- private String buildPageTitleSuffix(Integer cancellationPolicyType) {
|
|
|
- if (cancellationPolicyType == null) {
|
|
|
- return "不可免责取消";
|
|
|
- }
|
|
|
- if (cancellationPolicyType == CANCELLATION_FREE) {
|
|
|
- return "免费预订";
|
|
|
- }
|
|
|
- if (cancellationPolicyType == CANCELLATION_CONDITIONAL) {
|
|
|
- return "分情况是否免责";
|
|
|
- }
|
|
|
+ /** 待支付页标题后缀 */
|
|
|
+ private String buildPendingPaymentTitleSuffix(Integer cancellationPolicyType) {
|
|
|
+ if (cancellationPolicyType == null) return "不可免责取消";
|
|
|
+ if (cancellationPolicyType == CANCELLATION_FREE) return "免费预订";
|
|
|
+ if (cancellationPolicyType == CANCELLATION_CONDITIONAL) return "分情况是否免责";
|
|
|
return "不可免责取消";
|
|
|
}
|
|
|
|
|
|
+ /** 预订成功页标题后缀(待使用状态) */
|
|
|
+ private String buildSuccessPageTitleSuffix(Integer cancellationPolicyType) {
|
|
|
+ if (cancellationPolicyType == null) return "不可免责";
|
|
|
+ if (cancellationPolicyType == CANCELLATION_FREE) return "免费预订";
|
|
|
+ if (cancellationPolicyType == CANCELLATION_CONDITIONAL) return "分情况是否免责";
|
|
|
+ return "不可免责";
|
|
|
+ }
|
|
|
+
|
|
|
private String buildDiningTimeSlot(String startTime, String endTime) {
|
|
|
if (startTime == null && endTime == null) return null;
|
|
|
if (startTime != null && endTime != null) return startTime + "-" + endTime;
|