diff --git a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/impl/OrderServiceImpl.java b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/impl/OrderServiceImpl.java index 9884f2aff..88fef3ba7 100644 --- a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/impl/OrderServiceImpl.java +++ b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/impl/OrderServiceImpl.java @@ -104,7 +104,7 @@ public class OrderServiceImpl extends ServiceImpl impleme CompletableFuture orderItemsCompletableFuture = CompletableFuture.runAsync(() -> { List orderItems = new ArrayList<>(); Long skuId = orderConfirmDTO.getSkuId(); - if (skuId != null) { // 直接购买商品结算 + if (skuId != null) { // 直接购买商品 Result getSkuInfoResult = skuFeignClient.getSkuInfo(orderConfirmDTO.getSkuId()); Assert.isTrue(Result.isSuccess(getSkuInfoResult), "获取商品信息失败"); SkuInfoDTO skuInfoDTO = getSkuInfoResult.getData(); @@ -116,11 +116,10 @@ public class OrderServiceImpl extends ServiceImpl impleme List items = cartItems.stream() .filter(CartItemDTO::getChecked) .map(cartItem -> { - OrderItemDTO orderItemDTO = new OrderItemDTO(); - BeanUtil.copyProperties(cartItem, orderItemDTO); - return orderItemDTO; - } - ) + OrderItemDTO orderItemDTO = new OrderItemDTO(); + BeanUtil.copyProperties(cartItem, orderItemDTO); + return orderItemDTO; + }) .collect(Collectors.toList()); orderItems.addAll(items); } @@ -163,7 +162,7 @@ public class OrderServiceImpl extends ServiceImpl impleme // 订单验价 Long currentTotalPrice = orderItems.stream().map(item -> { - AppSkuDetailVO sku = goodsFeignClient.getSkuById(item.getSkuId()).getData(); + SkuInfoDTO sku = skuFeignClient.getSkuInfo(item.getSkuId()).getData(); if (sku != null) { return sku.getPrice() * item.getCount(); } @@ -180,9 +179,6 @@ public class OrderServiceImpl extends ServiceImpl impleme .build()) .collect(Collectors.toList()); - Result goodsResult = goodsFeignClient.getSkuById(1l); - System.out.println(goodsResult); - // 锁定库存 Result lockResult = skuFeignClient.lockStock(skuLockList); Assert.isTrue(Result.isSuccess(lockResult), "锁定商品库存失败:{}", lockResult.getMsg());