From 84e16d4ba18832ac0c6142d759b5341b0838f750 Mon Sep 17 00:00:00 2001 From: eric <465889110@qq.com> Date: Thu, 30 Oct 2025 01:23:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/RentCarThirdPlatformOrderReq.java | 5 +++-- .../impl/GroupBuyCouponServiceImpl.java | 10 +++++----- .../order/service/impl/OrderServiceImpl.java | 18 +++++++++--------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/sczx/order/dto/RentCarThirdPlatformOrderReq.java b/src/main/java/com/sczx/order/dto/RentCarThirdPlatformOrderReq.java index a25bb33..d45bd62 100644 --- a/src/main/java/com/sczx/order/dto/RentCarThirdPlatformOrderReq.java +++ b/src/main/java/com/sczx/order/dto/RentCarThirdPlatformOrderReq.java @@ -36,10 +36,10 @@ public class RentCarThirdPlatformOrderReq { private String customerPhone; @ApiModelProperty(value = "第三方订单号") - private String thirdOrderNo; + private String transactionId; @ApiModelProperty(value = "第三方团购码") - private String couponCode; + private String paymentId; @ApiModelProperty(value = "订单来源") private String orderSource; @@ -62,4 +62,5 @@ public class RentCarThirdPlatformOrderReq { @ApiModelProperty("是否开通免押") private Boolean isDepositFree = false; + } diff --git a/src/main/java/com/sczx/order/service/impl/GroupBuyCouponServiceImpl.java b/src/main/java/com/sczx/order/service/impl/GroupBuyCouponServiceImpl.java index 6e469d7..0482530 100644 --- a/src/main/java/com/sczx/order/service/impl/GroupBuyCouponServiceImpl.java +++ b/src/main/java/com/sczx/order/service/impl/GroupBuyCouponServiceImpl.java @@ -107,8 +107,8 @@ public class GroupBuyCouponServiceImpl implements GroupBuyCouponService { thirdRentCarOrder.setOrderSource(CouponTypeEnum.MT.getCode()); thirdRentCarOrder.setCustomerName(userInfoDTO.getUserName()); thirdRentCarOrder.setCustomerPhone(userInfoDTO.getPhoneNumber()); - thirdRentCarOrder.setThirdOrderNo(productIdMap.get("mtOrderId")); - thirdRentCarOrder.setCouponCode(req.getCouponCode()); + thirdRentCarOrder.setTransactionId(productIdMap.get("mtOrderId")); + thirdRentCarOrder.setPaymentId(req.getCouponCode()); thirdRentCarOrder.setRentBatteyRuleId(carModelPackageDTO.getBatteryRuleId()); }else if (CouponTypeEnum.DY.getCode().equalsIgnoreCase(req.getCouponType())){ @@ -178,8 +178,8 @@ public class GroupBuyCouponServiceImpl implements GroupBuyCouponService { thirdRentCarOrder.setOrderSource(CouponTypeEnum.DY.getCode()); thirdRentCarOrder.setCustomerName(userInfoDTO.getUserName()); thirdRentCarOrder.setCustomerPhone(userInfoDTO.getPhoneNumber()); - thirdRentCarOrder.setThirdOrderNo(productIdMap.get("dyCertificateId")); - thirdRentCarOrder.setCouponCode(productIdMap.get("dyVerifyId")); + thirdRentCarOrder.setTransactionId(productIdMap.get("dyCertificateId")); + thirdRentCarOrder.setPaymentId(productIdMap.get("dyVerifyId")); thirdRentCarOrder.setRentBatteyRuleId(carModelPackageDTO.getBatteryRuleId()); } return thirdRentCarOrder; @@ -191,7 +191,7 @@ public class GroupBuyCouponServiceImpl implements GroupBuyCouponService { if(paymentType.equals(PaymentTypeEnum.MT.getCode())){ meiTuanService.reverseconsume(storeId, paymentId, transactionId); } else if (paymentType.equals(PaymentTypeEnum.DY.getCode())){ - douyinService.cancel(transactionId, paymentId); + douyinService.cancel(paymentId,transactionId); } else { log.info("非团购支付,无需退券"); } diff --git a/src/main/java/com/sczx/order/service/impl/OrderServiceImpl.java b/src/main/java/com/sczx/order/service/impl/OrderServiceImpl.java index 234046d..5d146a9 100644 --- a/src/main/java/com/sczx/order/service/impl/OrderServiceImpl.java +++ b/src/main/java/com/sczx/order/service/impl/OrderServiceImpl.java @@ -493,7 +493,7 @@ public class OrderServiceImpl implements OrderService { List currentOrderList = orderMainRepo.list(currentOrderWrapper); OrderMainPO waitPayOrder = currentOrderList.stream().filter(order -> order.getOrderStatus().equals(OrderStatusEnum.WAIT_PAY.getCode())).findFirst().orElse(null); if(!currentOrderList.isEmpty() && waitPayOrder==null){ - groupBuyCouponService.cancelVerifyCoupon(rentCarOrderReq.getOrderSource(),rentCarOrderReq.getStoreId().intValue(),rentCarOrderReq.getThirdOrderNo(),rentCarOrderReq.getCouponCode()); + groupBuyCouponService.cancelVerifyCoupon(rentCarOrderReq.getOrderSource(),rentCarOrderReq.getStoreId().intValue(),rentCarOrderReq.getPaymentId(),rentCarOrderReq.getTransactionId()); throw new BizException("您有未完成的订单,请先完成订单"); } if(waitPayOrder!=null){ @@ -511,14 +511,14 @@ public class OrderServiceImpl implements OrderService { .eq(CarPO::getStoreId, rentCarOrderReq.getStoreId()); List carPOList = carRepo.list(carWrapper); if(CollectionUtils.isEmpty(carPOList)){ - groupBuyCouponService.cancelVerifyCoupon(rentCarOrderReq.getOrderSource(),rentCarOrderReq.getStoreId().intValue(),rentCarOrderReq.getThirdOrderNo(),rentCarOrderReq.getCouponCode()); + groupBuyCouponService.cancelVerifyCoupon(rentCarOrderReq.getOrderSource(),rentCarOrderReq.getStoreId().intValue(),rentCarOrderReq.getPaymentId(),rentCarOrderReq.getTransactionId()); throw new BizException("门店没有该车型的车辆可租"); } //获取门店信息 CompanyStoreDTO companyStoreDTO = storeInteg.getStoreById(Integer.valueOf(rentCarOrderReq.getStoreId().toString())); if(Objects.isNull(companyStoreDTO)){ - groupBuyCouponService.cancelVerifyCoupon(rentCarOrderReq.getOrderSource(),rentCarOrderReq.getStoreId().intValue(),rentCarOrderReq.getThirdOrderNo(),rentCarOrderReq.getCouponCode()); + groupBuyCouponService.cancelVerifyCoupon(rentCarOrderReq.getOrderSource(),rentCarOrderReq.getStoreId().intValue(),rentCarOrderReq.getPaymentId(),rentCarOrderReq.getTransactionId()); throw new BizException("运营商或门店已下架"); } @@ -570,7 +570,7 @@ public class OrderServiceImpl implements OrderService { depositOrder.setAmount(orderMainPO.getDepositPrice()); depositOrder.setCreatedAt(LocalDateTime.now()); depositOrder.setPaymentMethod(paymentType); - depositOrder.setTransactionId(rentCarOrderReq.getThirdOrderNo()); + depositOrder.setTransactionId(rentCarOrderReq.getTransactionId()); orderSubPOList.add(depositOrder); } //如果选择了租电套餐,则还需要生成租电子订单 @@ -583,7 +583,7 @@ public class OrderServiceImpl implements OrderService { depositOrder.setCreatedAt(LocalDateTime.now()); depositOrder.setPaymentMethod(paymentType); depositOrder.setReturnTime(endRentTime); - depositOrder.setTransactionId(rentCarOrderReq.getThirdOrderNo()); + depositOrder.setTransactionId(rentCarOrderReq.getTransactionId()); orderSubPOList.add(depositOrder); } //生成租车订单 @@ -595,14 +595,14 @@ public class OrderServiceImpl implements OrderService { rentOrder.setCreatedAt(LocalDateTime.now()); rentOrder.setPaymentMethod(paymentType); rentOrder.setReturnTime(endRentTime); - rentOrder.setTransactionId(rentCarOrderReq.getThirdOrderNo()); + rentOrder.setTransactionId(rentCarOrderReq.getTransactionId()); orderSubPOList.add(rentOrder); BigDecimal orderAmount = orderSubPOList.stream().map(OrderSubPO::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add); orderMainPO.setOrderAmount(orderAmount); //支付号为团购码 - String paymentId = rentCarOrderReq.getCouponCode(); + String paymentId = rentCarOrderReq.getPaymentId(); for(OrderSubPO orderSubPO : orderSubPOList){ @@ -630,14 +630,14 @@ public class OrderServiceImpl implements OrderService { return rentCarOrderResultDTO; }catch (Exception e){ - groupBuyCouponService.cancelVerifyCoupon(rentCarOrderReq.getOrderSource(),rentCarOrderReq.getStoreId().intValue(),rentCarOrderReq.getThirdOrderNo(),rentCarOrderReq.getCouponCode()); + groupBuyCouponService.cancelVerifyCoupon(rentCarOrderReq.getOrderSource(),rentCarOrderReq.getStoreId().intValue(),rentCarOrderReq.getPaymentId(),rentCarOrderReq.getTransactionId()); log.warn("下单失败", e); throw e; } finally { redisUtil.deleteRedisLock(redisLockKey); } } else { - groupBuyCouponService.cancelVerifyCoupon(rentCarOrderReq.getOrderSource(),rentCarOrderReq.getStoreId().intValue(),rentCarOrderReq.getThirdOrderNo(),rentCarOrderReq.getCouponCode()); + groupBuyCouponService.cancelVerifyCoupon(rentCarOrderReq.getOrderSource(),rentCarOrderReq.getStoreId().intValue(),rentCarOrderReq.getPaymentId(),rentCarOrderReq.getTransactionId()); log.warn("下单失败,锁已被占用"); throw new InnerException("服务器正在处理,请稍后再试"); }