From d0e3ffb8fd33304271797538c33c9bb9be914cd6 Mon Sep 17 00:00:00 2001 From: phpcjl <phpcjl@gmail.com> Date: 星期二, 10 十二月 2024 11:08:58 +0800 Subject: [PATCH] 1.管理后台商品分类 --- ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java | 33 +++++++++++++++++++++++---------- 1 files changed, 23 insertions(+), 10 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 f4029b3..022167c 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,8 @@ 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.feignClient.GoodsClient; +import com.ruoyi.other.api.domain.*; +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 +54,7 @@ @Resource private TechnicianClient technicianClient; @Resource - private GoodsClient goodsClient; + private ShopClient shopClient; @Override @@ -74,6 +71,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,12 +84,11 @@ 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()); orderGoodsVO.setGoodsName(goods.getName()); orderGoodsVO.setType(goods.getType()); - orderGoodsVO.setNum(orderGood.getNum()); orderGoodsVO.setGoodsPic(goods.getHomePagePicture()); orderGoodsVO.setSellingPrice(goods.getSellingPrice()); orderGoodsVO.setOriginalPrice(goods.getOriginalPrice()); @@ -127,8 +127,15 @@ orderDetailVO.setDistributionMode(goods.getDistributionMode()); } - - + Technician technician = new Technician(); + if (order.getTechnicianId() != null){ + R<Technician> shopdetail = technicianClient.shopdetail(order.getTechnicianId()); + if (shopdetail.getCode() != R.SUCCESS){ + throw new ServiceException("获取技师信息失败"); + } + technician = shopdetail.getData(); + } + Shop shop = shopR.getData(); orderDetailVO.setId(order.getId()); orderDetailVO.setOrderStatus(order.getOrderStatus()); orderDetailVO.setPoint(order.getPoint()); @@ -146,6 +153,12 @@ 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()); + orderDetailVO.setShopId(shop.getId()); + orderDetailVO.setTechnicianName(technician.getName()); return orderDetailVO; } -- Gitblit v1.7.1