From e1fd9c69d375b691d83d08f3411124bc3a051a00 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期五, 06 十二月 2024 10:02:16 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java |   15 +++++++++++++++
 ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/vo/OrderDetailVO.java              |    3 +++
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java |    2 +-
 3 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/vo/OrderDetailVO.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/vo/OrderDetailVO.java
index e5764e5..3f9cd36 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/vo/OrderDetailVO.java
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/vo/OrderDetailVO.java
@@ -62,4 +62,7 @@
     @ApiModelProperty(value = "实际支付价格")
     private BigDecimal paymentAmount;
 
+    @ApiModelProperty(value = "配送方式(1=自提,2=快递)")
+    private Integer distributionMode;
+
 }
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 fcbe4ed..f4029b3 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
@@ -1,5 +1,6 @@
 package com.ruoyi.order.service.impl;
 
+import cn.hutool.core.collection.CollectionUtil;
 import com.alibaba.fastjson2.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -24,6 +25,7 @@
 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.feignClient.TechnicianClient;
 import com.ruoyi.system.api.model.LoginUser;
 import org.springframework.stereotype.Service;
@@ -54,6 +56,8 @@
     private TokenService tokenService;
     @Resource
     private TechnicianClient technicianClient;
+    @Resource
+    private GoodsClient goodsClient;
 
 
     @Override
@@ -70,6 +74,7 @@
         if (order == null){
             throw new ServiceException("订单不存在");
         }
+
         // 商品
         List<OrderGood> orderGoods = orderGoodMapper.selectList(new LambdaQueryWrapper<OrderGood>()
                 .eq(OrderGood::getOrderId, orderId));
@@ -89,6 +94,7 @@
             orderGoodsVO.setOriginalPrice(goods.getOriginalPrice());
             goodsList.add(orderGoodsVO);
         }
+
 
 
         // 收货地址
@@ -114,6 +120,15 @@
         }
 
         OrderDetailVO orderDetailVO = new OrderDetailVO();
+
+        if (CollectionUtil.isNotEmpty(orderGoods)){
+            String goodJson = orderGoods.get(0).getGoodJson();
+            Goods goods = JSONObject.parseObject(goodJson, Goods.class);
+            orderDetailVO.setDistributionMode(goods.getDistributionMode());
+        }
+
+
+
         orderDetailVO.setId(order.getId());
         orderDetailVO.setOrderStatus(order.getOrderStatus());
         orderDetailVO.setPoint(order.getPoint());
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java
index 373e980..e5b14a4 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java
@@ -53,7 +53,7 @@
     @Override
     public List<GoodsVO> goodsList(Goods search) {
         List<Goods> goodsList = this.list(new LambdaQueryWrapper<Goods>()
-                .eq(Goods::getStatus, GoodsStatus.UP)
+                .eq(Goods::getStatus, GoodsStatus.UP.getCode())
                 .eq(Objects.nonNull(search.getGoodsCategoryId()), Goods::getGoodsCategoryId, search.getGoodsCategoryId())
                 .like(StringUtils.isNotEmpty(search.getName()), Goods::getName, search.getName()));
 

--
Gitblit v1.7.1