yeg
2026-09-14 5364ba7487eb7abe0d4adc67f3393f511ed123a7
talent-card-server/src/main/java/com/talentcard/server/business/merchant/MerchantWorkService.java
@@ -16,6 +16,7 @@
import com.talentcard.server.business.PageResult;
import com.talentcard.server.business.merchant.auth.MerchantPrincipal;
import com.talentcard.server.business.order.OrderFundBoundaryService;
import com.talentcard.server.business.payment.PaymentFundConfirmationService;
import com.talentcard.server.business.portal.ProductPriceCalculator;
import com.talentcard.server.common.BusinessException;
import com.talentcard.server.common.ErrorCode;
@@ -34,12 +35,14 @@
   private final JdbcTemplate jdbcTemplate;
   private final ManualConsumptionService manualConsumptionService;
   private final OrderFundBoundaryService orderFundBoundary;
   private final PaymentFundConfirmationService fundConfirmation;
   public MerchantWorkService(JdbcTemplate jdbcTemplate, ManualConsumptionService manualConsumptionService,
         OrderFundBoundaryService orderFundBoundary) {
         OrderFundBoundaryService orderFundBoundary, PaymentFundConfirmationService fundConfirmation) {
      this.jdbcTemplate = jdbcTemplate;
      this.manualConsumptionService = manualConsumptionService;
      this.orderFundBoundary = orderFundBoundary;
      this.fundConfirmation = fundConfirmation;
   }
   @Transactional(readOnly = true)
@@ -202,6 +205,9 @@
      if (updated != 1) {
         throw new BusinessException(ErrorCode.CONFLICT, "订单已核销");
      }
      // 核销通过后把钱放给商户:延迟入账的支付此前停在通道「待确认」,确认成功商户才真正拿到钱。
      // 确认失败不会回滚核销(用户的服务已经核销掉了),资金保持待确认并留下记录供重试。
      fundConfirmation.confirmForOrder(locked.orderId());
      return order(orderNo, principal.merchantId(), principal.storeId());
   }