| | |
| | | long payAmount = number(order.get("payAmount")) == null ? 0 : number(order.get("payAmount")); |
| | | long basePayAmount = number(order.get("basePayAmount")) == null ? orderAmount : number(order.get("basePayAmount")); |
| | | long couponAmount = number(order.get("couponAmount")) == null ? 0 : number(order.get("couponAmount")); |
| | | long configuredSubsidyAmount = number(order.get("subsidyAmount")) == null ? 0 : number(order.get("subsidyAmount")); |
| | | long totalDiscount = Math.max(0, orderAmount - payAmount); |
| | | long talentDiscountAmount = Math.max(0, orderAmount - basePayAmount); |
| | | if ("GROUP_BUY".equals(orderType)) { |
| | |
| | | } |
| | | result.put("talentDiscountAmount", talentDiscountAmount); |
| | | result.put("couponAmount", couponAmount); |
| | | result.put("subsidyAmount", totalDiscount); |
| | | // 免费入住没有 benefit_order 金额,补贴来自核销记录中的后台配置,不能按原价减实付覆盖为 0。 |
| | | result.put("subsidyAmount", "FREE_STAY".equals(orderType) ? configuredSubsidyAmount : totalDiscount); |
| | | boolean canRevoke = "GROUP_BUY".equals(orderType) && verifyTime != null && Duration.between(verifyTime, LocalDateTime.now()).toHours() < REVOCATION_HOURS && verifyStatus != null && verifyStatus == 1; |
| | | result.put("canRevoke", canRevoke); |
| | | result.put("revokeDeadline", verifyTime == null ? null : verifyTime.plusHours(REVOCATION_HOURS).toString()); |