提交代码

master
胡锐 3 months ago
parent 693eacae3e
commit a25ac3f9b6
  1. 19
      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());

Loading…
Cancel
Save