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; }