From 476984c120919a388b4f6c669e34f4b3c3b755ad Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期一, 09 十二月 2024 10:36:13 +0800
Subject: [PATCH] 合并代码
---
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java | 30 +++++++++++++++++-------------
1 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
index 9bfd041..1d08221 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
@@ -21,11 +21,9 @@
import com.ruoyi.order.vo.OrderDetailVO;
import com.ruoyi.order.vo.OrderGoodsVO;
import com.ruoyi.order.vo.OrderVO;
-import com.ruoyi.other.api.domain.CouponInfo;
-import com.ruoyi.other.api.domain.Goods;
-import com.ruoyi.other.api.domain.OrderActivityInfo;
-import com.ruoyi.other.api.domain.Technician;
+import com.ruoyi.other.api.domain.*;
import com.ruoyi.other.api.feignClient.GoodsClient;
+import com.ruoyi.other.api.feignClient.ShopClient;
import com.ruoyi.other.api.feignClient.TechnicianClient;
import com.ruoyi.system.api.model.LoginUser;
import org.springframework.stereotype.Service;
@@ -57,7 +55,7 @@
@Resource
private TechnicianClient technicianClient;
@Resource
- private GoodsClient goodsClient;
+ private ShopClient shopClient;
@Override
@@ -74,6 +72,10 @@
if (order == null){
throw new ServiceException("订单不存在");
}
+ R<Shop> shopR = shopClient.getShopById(order.getShopId());
+ if (!R.isSuccess(shopR)){
+ throw new ServiceException("获取门店信息失败");
+ }
// 商品
List<OrderGood> orderGoods = orderGoodMapper.selectList(new LambdaQueryWrapper<OrderGood>()
@@ -83,17 +85,14 @@
for (OrderGood orderGood : orderGoods) {
String goodJson = orderGood.getGoodJson();
Goods goods = JSONObject.parseObject(goodJson, Goods.class);
-
OrderGoodsVO orderGoodsVO = new OrderGoodsVO();
orderGoodsVO.setGoodsId(orderGood.getGoodsId());
orderGoodsVO.setNum(orderGood.getNum());
- if (goods != null){
- orderGoodsVO.setGoodsName(goods.getName());
- orderGoodsVO.setType(goods.getType());
- orderGoodsVO.setGoodsPic(goods.getHomePagePicture());
- orderGoodsVO.setSellingPrice(goods.getSellingPrice());
- orderGoodsVO.setOriginalPrice(goods.getOriginalPrice());
- }
+ orderGoodsVO.setGoodsName(goods.getName());
+ orderGoodsVO.setType(goods.getType());
+ orderGoodsVO.setGoodsPic(goods.getHomePagePicture());
+ orderGoodsVO.setSellingPrice(goods.getSellingPrice());
+ orderGoodsVO.setOriginalPrice(goods.getOriginalPrice());
goodsList.add(orderGoodsVO);
}
@@ -129,6 +128,7 @@
orderDetailVO.setDistributionMode(goods.getDistributionMode());
}
+ Shop shop = shopR.getData();
orderDetailVO.setId(order.getId());
@@ -148,6 +148,10 @@
orderDetailVO.setPointAmount(order.getGetPoint());
orderDetailVO.setPaymentAmount(order.getPaymentAmount());
orderDetailVO.setGoodsList(goodsList);
+ orderDetailVO.setShopName(shop.getName());
+ orderDetailVO.setShopAddress(shop.getAddress());
+ orderDetailVO.setLongitude(shop.getLongitude());
+ orderDetailVO.setLatitude(shop.getLatitude());
return orderDetailVO;
}
--
Gitblit v1.7.1