From 05b91a28c9eb182961094c31e0d76a2f50af5ab5 Mon Sep 17 00:00:00 2001 From: hu177768073 <177768073@qq.com> Date: Wed, 11 Sep 2024 17:12:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order/impl/BsOrderRefundServiceImpl.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/service/src/main/java/com/hfkj/service/order/impl/BsOrderRefundServiceImpl.java b/service/src/main/java/com/hfkj/service/order/impl/BsOrderRefundServiceImpl.java index ed828bd..acbe6b7 100644 --- a/service/src/main/java/com/hfkj/service/order/impl/BsOrderRefundServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/order/impl/BsOrderRefundServiceImpl.java @@ -8,10 +8,7 @@ import com.hfkj.common.exception.SysCode; import com.hfkj.common.utils.DateUtil; import com.hfkj.common.utils.RandomUtils; import com.hfkj.dao.BsOrderRefundMapper; -import com.hfkj.entity.BsMerPayConfig; -import com.hfkj.entity.BsOrder; -import com.hfkj.entity.BsOrderRefund; -import com.hfkj.entity.BsOrderRefundExample; +import com.hfkj.entity.*; import com.hfkj.mer.BsMerPayConfigService; import com.hfkj.model.order.OrderChildModel; import com.hfkj.model.order.OrderModel; @@ -39,6 +36,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.math.BigDecimal; import java.util.*; +import java.util.stream.Collectors; /** * @className: BsOrderRefundServiceImpl @@ -229,8 +227,17 @@ public class BsOrderRefundServiceImpl implements BsOrderRefundService { // 退款业务处理 orderRefundSuccessService.orderRefundHandle(orderChild); - orderChildService.editData(orderChild); + + // 查询子订单已全部退款 + Map map = new HashMap<>(); + map.put("orderNo", orderChild.getOrderNo()); + List orderChildList = orderChildService.getList(map); + if (orderChildList.size() == orderChildList.stream().filter(o->o.getStatus().equals(OrderChildStatusEnum.status4.getCode())).collect(Collectors.toList()).size()) { + order.setOrderStatus(OrderStatusEnum.status4.getCode()); + order.setRefundTime(new Date()); + orderService.editData(order); + } } // 删除缓存