diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/TbPayServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/TbPayServiceImpl.java index 807ca6d3..f004ce74 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/TbPayServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/TbPayServiceImpl.java @@ -29,6 +29,7 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import lombok.extern.slf4j.Slf4j; +import org.hibernate.Hibernate; import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.ResponseEntity; @@ -128,13 +129,8 @@ public class TbPayServiceImpl implements TbPayService { for (TbCashierCart cashierCart : cashierCarts) { body.append(cashierCart.getName()); } - - - TbMerchantThirdApply thirdApply = merchantThirdApplyRepository.getById(merchantId); - if (ObjectUtil.isEmpty(thirdApply) || ObjectUtil.isNull(thirdApply)) { - throw new BadRequestException("三方支付信息不存在"); - } - + TbMerchantThirdApply thirdApply = merchantThirdApplyRepository.findById(merchantId) + .orElseThrow(() -> new BadRequestException("三方支付信息不存在")); String payType; String payName; String qpay;