From 2ea4be7f820c80310a0e61e3abe742c3535adc79 Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Fri, 7 Mar 2025 15:10:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96shopId=20=E7=8E=B0=E9=87=91?= =?UTF-8?q?=E6=94=AF=E4=BB=98=20=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/czg/controller/OrderPayController.java | 3 +-- .../com/czg/service/order/service/impl/PayServiceImpl.java | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cash-api/order-server/src/main/java/com/czg/controller/OrderPayController.java b/cash-api/order-server/src/main/java/com/czg/controller/OrderPayController.java index 15359ccf..da568b78 100644 --- a/cash-api/order-server/src/main/java/com/czg/controller/OrderPayController.java +++ b/cash-api/order-server/src/main/java/com/czg/controller/OrderPayController.java @@ -146,8 +146,7 @@ public class OrderPayController { * checkOrderPay.orderAmount 必填 */ @PostMapping("/shopPayApi/js2Pay") - public CzgResult> js2PayOrder(@RequestHeader Long shopId, HttpServletRequest request, @RequestBody OrderPayParamDTO payParam) { - payParam.setShopId(shopId); + public CzgResult> js2PayOrder(HttpServletRequest request, @RequestBody OrderPayParamDTO payParam) { return payService.js2PayOrder(ServletUtil.getClientIP(request), payParam); } diff --git a/cash-service/order-service/src/main/java/com/czg/service/order/service/impl/PayServiceImpl.java b/cash-service/order-service/src/main/java/com/czg/service/order/service/impl/PayServiceImpl.java index 367d72fd..ff97cef6 100644 --- a/cash-service/order-service/src/main/java/com/czg/service/order/service/impl/PayServiceImpl.java +++ b/cash-service/order-service/src/main/java/com/czg/service/order/service/impl/PayServiceImpl.java @@ -42,6 +42,7 @@ import com.mybatisflex.core.update.UpdateChain; import jakarta.annotation.Resource; import jakarta.validation.constraints.NotBlank; import lombok.NonNull; +import lombok.extern.slf4j.Slf4j; import org.apache.dubbo.config.annotation.DubboReference; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -56,6 +57,7 @@ import java.util.Map; * @author ww * @description */ +@Slf4j @Service public class PayServiceImpl implements PayService { @@ -99,6 +101,7 @@ public class PayServiceImpl implements PayService { private OrderInfo checkPay(CheckOrderPay checkOrderPay) { OrderInfo orderInfo = orderInfoService.checkOrderPay(checkOrderPay); if (orderInfo.getOrderAmount().compareTo(BigDecimal.ZERO) == 0) { + log.info("订单:{} 金额为0", orderInfo); orderInfoService.upOrderInfo(orderInfo, orderInfo.getOrderAmount(), LocalDateTime.now(), null, PayEnums.CASH_PAY); redisService.del(RedisCst.classKeyExpired.EXPIRED_ORDER + orderInfo.getId()); @@ -152,6 +155,7 @@ public class PayServiceImpl implements PayService { @Transactional public CzgResult cashPayOrder(OrderPayParamDTO payParam) { OrderInfo orderInfo = checkPay(payParam.getCheckOrderPay()); + log.info("现金付款:{}", orderInfo); orderInfoService.upOrderInfo(orderInfo, orderInfo.getOrderAmount(), LocalDateTime.now(), null, PayEnums.CASH_PAY); if (orderInfo.getPointsNum() != null && orderInfo.getPointsNum() > 0) { @@ -473,7 +477,7 @@ public class PayServiceImpl implements PayService { shopUserService.updateMoney(shopUser.getShopId(), shopUserMoneyEditDTO); userFlowService.updateRefund(inFlow.getId(), refPayParam.getRefAmount()); if (giftFlow != null) { - userFlowService.updateRefund( giftFlow.getId(), giftFlow.getAmount()); + userFlowService.updateRefund(giftFlow.getId(), giftFlow.getAmount()); } //移除优惠券 inRecordService.remove(QueryWrapper.create()