shinnosuke
2026-08-06 286c9d280e7d7a2fe919e6c9e596993ef9a6b4b7
fix(portal): 统一订单补贴金额计算 (bug #24116)
1个文件已修改
3 ■■■■■ 已修改文件
talent-card-server/src/main/java/com/talentcard/server/business/portal/AppOrderPortalService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
talent-card-server/src/main/java/com/talentcard/server/business/portal/AppOrderPortalService.java
@@ -39,9 +39,10 @@
        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);