From e2e6d22948de2c8a2e614df729b4b1cc9572f1c7 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Fri, 3 Feb 2023 17:36:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A42=E3=80=820=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hai/schedule/HighRechargeOrderSchedule.java | 6 ++++++ .../impl/OutRechargeChildOrderServiceImpl.java | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/hai-schedule/src/main/java/com/hai/schedule/HighRechargeOrderSchedule.java b/hai-schedule/src/main/java/com/hai/schedule/HighRechargeOrderSchedule.java index 20d5ffb9..2e89aebc 100644 --- a/hai-schedule/src/main/java/com/hai/schedule/HighRechargeOrderSchedule.java +++ b/hai-schedule/src/main/java/com/hai/schedule/HighRechargeOrderSchedule.java @@ -1,5 +1,6 @@ package com.hai.schedule; +import com.hai.entity.HighChildOrder; import com.hai.entity.OutRechargeChildOrder; import com.hai.entity.OutRechargeOrder; import com.hai.service.OutRechargeChildOrderService; @@ -116,6 +117,11 @@ public class HighRechargeOrderSchedule { if (orderList != null && orderList.size() > 0) { for (OutRechargeOrder order : orderList) { try { + + OutRechargeChildOrder childOrder = rechargeChildOrderService.findByOrderId(order.getId()); + + outRechargeOrderService.refundOrder(order.getId() , childOrder); + outRechargeOrderService.rechargeOrderToRefund(order.getId()); } catch (Exception e) { log.error("HighCouponSchedule --> expiredCoupon() error!", e); diff --git a/hai-service/src/main/java/com/hai/service/impl/OutRechargeChildOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/OutRechargeChildOrderServiceImpl.java index e7a70087..afbcc53c 100644 --- a/hai-service/src/main/java/com/hai/service/impl/OutRechargeChildOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/OutRechargeChildOrderServiceImpl.java @@ -72,6 +72,17 @@ public class OutRechargeChildOrderServiceImpl implements OutRechargeChildOrderSe @Override public OutRechargeChildOrder findByOrderId(Long orderId) { + OutRechargeChildOrderExample example = new OutRechargeChildOrderExample(); + OutRechargeChildOrderExample.Criteria criteria = example.createCriteria(); + + criteria.andParentOrderIdEqualTo(orderId); + + List list = rechargeChildOrderMapper.selectByExample(example); + + if (list.size() > 0 ) { + return list.get(0); + } + return null; }