From a25ac3f9b6c5927f9e95fe2647f089bafc4074a2 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Wed, 28 Aug 2024 14:18:02 +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/OrderRefundSuccessService.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/service/src/main/java/com/hfkj/service/order/OrderRefundSuccessService.java b/service/src/main/java/com/hfkj/service/order/OrderRefundSuccessService.java index 202e742..0e53f11 100644 --- a/service/src/main/java/com/hfkj/service/order/OrderRefundSuccessService.java +++ b/service/src/main/java/com/hfkj/service/order/OrderRefundSuccessService.java @@ -7,10 +7,12 @@ import com.hfkj.common.exception.SysCode; import com.hfkj.config.CommonSysConst; import com.hfkj.entity.BsOrderChild; import com.hfkj.entity.BsOrderCinema; +import com.hfkj.entity.BsOrderCoupon; import com.hfkj.entity.BsOrderGoods; import com.hfkj.model.order.OrderChildModel; import com.hfkj.model.order.OrderModel; import com.hfkj.qianzhu.channel.CinemaService; +import com.hfkj.service.coupon.BsOrderCouponService; import com.hfkj.service.goods.BsOrderCinemaService; import com.hfkj.service.goods.impl.BsOrderGoodsServiceImpl; import com.hfkj.sysenum.order.OrderChildProductTypeEnum; @@ -19,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import javax.annotation.Resource; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -37,6 +40,8 @@ public class OrderRefundSuccessService { private BsOrderCinemaService bsOrderCinemaService; @Autowired private BsOrderGoodsServiceImpl bsOrderGoodsService; + @Resource + private BsOrderCouponService orderCouponService; /** * 订单业务处理 @@ -49,7 +54,8 @@ public class OrderRefundSuccessService { // 实物产品退款业务 goods(orderChild); } else if (orderChild.getProductType().equals(OrderChildProductTypeEnum.type2.getCode())) { - // todo 虚拟产品退款业务 + // 虚拟产品退款业务 + orderCoupon(orderChild); } else if (orderChild.getProductType().equals(OrderChildProductTypeEnum.type3.getCode())) { // 电影票退款业务 cinema(orderChild); @@ -82,9 +88,20 @@ public class OrderRefundSuccessService { orderGoods.setExceptionMsg(e.getMessage()); bsOrderGoodsService.update(orderGoods); } + } + + public void orderCoupon(BsOrderChild childOrder) { + // 查询虚拟订单 + BsOrderCoupon orderCoupon = orderCouponService.getDetailByChildOrderNo(childOrder.getChildOrderNo()); + if (orderCoupon != null) { + orderCoupon.setRefundTime(new Date()); + orderCoupon.setStatus(OrderChildStatusEnum.status4.getCode()); + orderCouponService.editData(orderCoupon); + } } + public void cinema(BsOrderChild childOrder) { // 查询电影票订单 BsOrderCinema orderCinema = bsOrderCinemaService.findGoodsOrder(childOrder.getOrderNo());