diff --git a/service/src/main/java/com/hfkj/model/order/OrderChildModel.java b/service/src/main/java/com/hfkj/model/order/OrderChildModel.java index 23b17b7..0288590 100644 --- a/service/src/main/java/com/hfkj/model/order/OrderChildModel.java +++ b/service/src/main/java/com/hfkj/model/order/OrderChildModel.java @@ -1,6 +1,7 @@ package com.hfkj.model.order; import com.hfkj.entity.BsOrderChild; +import com.hfkj.entity.BsOrderGoods; import lombok.Data; /** diff --git a/service/src/main/java/com/hfkj/service/order/OrderCreateService.java b/service/src/main/java/com/hfkj/service/order/OrderCreateService.java index 551dcfd..5b614f9 100644 --- a/service/src/main/java/com/hfkj/service/order/OrderCreateService.java +++ b/service/src/main/java/com/hfkj/service/order/OrderCreateService.java @@ -214,10 +214,14 @@ public class OrderCreateService { bsOrderGoodsService.create(orderGoods); + jsonObject.put("orderGoodsId", orderGoods.getId()); + if (object.getLong("shopCartId") != null) { shoppingCartService.delete(object.getLong("shopCartId")); } + + orderChild.setBusiness(jsonObject); return orderChild; diff --git a/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java b/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java index 50d86ef..4a75cd9 100644 --- a/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java @@ -125,11 +125,11 @@ public class BsOrderServiceImpl implements BsOrderService { // 提交订单前实物商品处理 if (child.getProductType().equals(OrderChildProductTypeEnum.type1.getCode())) { child = orderCreateService.goods(order, child); - - } else if (child.getProductType().equals(OrderChildProductTypeEnum.type2.getCode())) { - // 提交订单虚拟商品处理 // todo 1.0阶段暂时需要返回收货地址使用 order.setBusiness(child.getBusiness()); + } else if (child.getProductType().equals(OrderChildProductTypeEnum.type2.getCode())) { + // 提交订单虚拟商品处理 + child = orderCreateService.product(order, child); } // 提交订单前产品处理 if (child.getProductType().equals(OrderChildProductTypeEnum.type2.getCode())) {