| | |
| | | |
| | | long originalAmount = MoneyUtils.yuanToCent(personalizedPrice.originalPrice()); |
| | | long basePayAmount = MoneyUtils.yuanToCent(personalizedPrice.salePrice()); |
| | | long subsidyAmount = MoneyUtils.yuanToCent(decimal(product.get("subsidyAmount"))); |
| | | long couponAmount = coupon == null ? 0 : Math.min(MoneyUtils.yuanToCent(decimal(coupon.get("couponAmount"))), basePayAmount); |
| | | long payAmount = Math.max(0, basePayAmount - couponAmount); |
| | | // 订单补贴金额需与待支付页保持一致:人才折扣与优惠券抵扣的合计。 |
| | | long subsidyAmount = Math.max(0, originalAmount - payAmount); |
| | | String orderNo = BusinessIdGenerator.next("P"); |
| | | LocalDateTime expiresAt = payAmount == 0 ? null : LocalDateTime.now().plusMinutes(15); |
| | | |