From 2fda56177ac67539eafb5ed33fcbec488d2a1db5 Mon Sep 17 00:00:00 2001
From: mitao <2763622819@qq.com>
Date: 星期二, 03 十二月 2024 17:35:58 +0800
Subject: [PATCH] bug修复

---
 ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/dto/LogisticsDTO.java              |    2 +
 ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/PromotionWishRecommend.java        |   77 ++++++++++++++++++++++++++++++++++++++
 ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feignClient/PromotionClient.java          |    3 +
 ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderReturnRequestServiceImpl.java |    1 
 ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/LogisticsServiceImpl.java          |   10 ++++
 ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java              |   12 ++++-
 6 files changed, 100 insertions(+), 5 deletions(-)

diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/PromotionWishRecommend.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/PromotionWishRecommend.java
new file mode 100644
index 0000000..649d38e
--- /dev/null
+++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/PromotionWishRecommend.java
@@ -0,0 +1,77 @@
+package com.ruoyi.system.api.domain;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 心愿求购平台推荐商品
+ * </p>
+ *
+ * @author mitao
+ * @since 2024-10-29
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("t_promotion_wish_recommend")
+@ApiModel(value="PromotionWishRecommend对象", description="心愿求购平台推荐商品")
+public class PromotionWishRecommend implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "推荐商品id")
+    @TableId(value = "id", type = IdType.ASSIGN_ID)
+    private Long id;
+
+    @ApiModelProperty(value = "心愿求购id")
+    private Long wishId;
+
+    @ApiModelProperty(value = "商品名称")
+    private String goodsName;
+
+    @ApiModelProperty(value = "商品售价")
+    private BigDecimal sellingPrice;
+
+    @ApiModelProperty(value = "可购数量")
+    private Integer availableNum;
+
+    @ApiModelProperty(value = "商品图片")
+    private String goodsImageUrl;
+
+    @ApiModelProperty(value = "失效时间")
+    private LocalDateTime expireTime;
+
+    @ApiModelProperty(value = "购买状态 0用户未购买 1用户已购买")
+    private Integer purchaseStatus;
+
+    @ApiModelProperty(value = "创建者")
+    private String createBy;
+
+    @ApiModelProperty(value = "创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private LocalDateTime createTime;
+
+    @ApiModelProperty(value = "更新者")
+    private String updateBy;
+
+    @ApiModelProperty(value = "更新时间")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private LocalDateTime updateTime;
+
+    @ApiModelProperty(value = "删除标志(0代表存在 1代表删除)")
+    private Integer delFlag;
+
+
+}
diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/dto/LogisticsDTO.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/dto/LogisticsDTO.java
index f268188..6d9e408 100644
--- a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/dto/LogisticsDTO.java
+++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/dto/LogisticsDTO.java
@@ -11,4 +11,6 @@
    private String company ;
     @ApiModelProperty(value = "物流订单号")
     private String postid ;
+    @ApiModelProperty(value = "收货人手机号,顺丰必填")
+    private String receiverPhone;
 }
diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feignClient/PromotionClient.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feignClient/PromotionClient.java
index 440d15c..8924283 100644
--- a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feignClient/PromotionClient.java
+++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feignClient/PromotionClient.java
@@ -10,6 +10,7 @@
 import com.ruoyi.system.api.factory.PromotionFallbackFactory;
 import java.util.List;
 import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -43,7 +44,7 @@
      * @param source
      * @return
      */
-    @PostMapping("/inner/promotion-wish-recommend/{id}")
+    @GetMapping("/inner/promotion-wish-recommend/{id}")
     R<PromotionWishRecommend> getPromotionWishRecommend(@PathVariable("id") Long id,
             @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
 
diff --git a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/LogisticsServiceImpl.java b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/LogisticsServiceImpl.java
index 2d96b53..994ab03 100644
--- a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/LogisticsServiceImpl.java
+++ b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/LogisticsServiceImpl.java
@@ -3,6 +3,7 @@
 
 import com.alibaba.nacos.shaded.com.google.gson.Gson;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.kuaidi100.sdk.api.QueryTrack;
@@ -12,6 +13,7 @@
 import com.kuaidi100.sdk.request.QueryTrackReq;
 import com.kuaidi100.sdk.utils.SignUtils;
 import com.ruoyi.order.mapper.LogisticsMapper;
+import com.ruoyi.order.mapper.OrderMapper;
 import com.ruoyi.order.service.ILogisticsService;
 import com.ruoyi.system.api.domain.Logistics;
 import com.ruoyi.system.api.domain.dto.LogisticsDTO;
@@ -50,7 +52,8 @@
 
     @Autowired
     private RestTemplate restTemplate;
-
+    @Autowired
+    private OrderMapper orderMapper;
 
     @Override
     public Express100VO getLogisticsList(LogisticsDTO logisticsDTO) {
@@ -58,6 +61,11 @@
         QueryTrackParam queryTrackParam = new QueryTrackParam();
         queryTrackParam.setCom(logisticsDTO.getCompany());
         queryTrackParam.setNum(logisticsDTO.getPostid());
+        if ((logisticsDTO.getCompany().equals("shunfeng") || logisticsDTO.getCompany()
+                .equals("shunfengkuaiyun")) && StringUtils.isNotBlank(
+                logisticsDTO.getReceiverPhone())) {
+            queryTrackParam.setPhone(logisticsDTO.getReceiverPhone());
+        }
         String param = new Gson().toJson(queryTrackParam);
 
         queryTrackReq.setParam(param);
diff --git a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderReturnRequestServiceImpl.java b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderReturnRequestServiceImpl.java
index 1b4bfc5..f7fb855 100644
--- a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderReturnRequestServiceImpl.java
+++ b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderReturnRequestServiceImpl.java
@@ -263,6 +263,7 @@
             LogisticsDTO logisticsDTO = new LogisticsDTO();
             logisticsDTO.setCompany(returnRequestVO.getLogisticsNum());
             logisticsDTO.setPostid(returnRequestVO.getCourierNumber());
+            logisticsDTO.setReceiverPhone(returnRequestVO.getRecipientPhone());
             Express100VO logisticsList = logisticsService.getLogisticsList(logisticsDTO);
             if (StringUtils.isNotNull(logisticsList)) {
                 returnRequestVO.setExpress100VO(logisticsList);
diff --git a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
index a6c20d4..e4bd230 100644
--- a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
+++ b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
@@ -493,6 +493,11 @@
             memberOrderVO.setCoverPic(recommend.getGoodsImageUrl());
             memberOrderVO.setSkuName(recommend.getGoodsName());
             pice = recommend.getSellingPrice();
+            order.setSkuName(recommend.getGoodsName());
+            order.setPrice(recommend.getSellingPrice());
+            order.setCoverPic(recommend.getGoodsImageUrl());
+            order.setSjPrice(recommend.getSellingPrice());
+            order.setGoodsId(recommend.getId());
         }
         order.setOrderRemark(memberOrderDTO.getOrderRemark());
         order.setMemberId(memberOrderDTO.getMemberId());
@@ -692,10 +697,10 @@
                     }
                 }
             }
-            if (memberOrderDTO.getOrderFrom() == OrderFromEnum.WISH_ORDER.getCode()) {
+            if (order.getOrderFrom() == OrderFromEnum.WISH_ORDER) {
                 // 远程调用营销服务,获取推荐商品信息
                 PromotionWishRecommend recommend = promotionClient.getPromotionWishRecommend(
-                        memberOrderDTO.getGoodsSkuId(),
+                        order.getGoodsSkuId(),
                         SecurityConstants.INNER).getData();
                 if (Objects.isNull(recommend)) {
                     throw new ServiceException("推荐商品不存在");
@@ -721,7 +726,7 @@
                 order.setTotalAmount(recommend.getSellingPrice()
                         .multiply(new BigDecimal(memberOrderDTO.getGoodsQuantity())));
                 order.setGoodsQuantity(memberOrderDTO.getGoodsQuantity());
-                memberOrderVO.setGoodsSkuId(memberOrderDTO.getGoodsSkuId());
+                memberOrderVO.setGoodsSkuId(order.getGoodsSkuId());
                 memberOrderVO.setPrice(recommend.getSellingPrice());
                 memberOrderVO.setCoverPic(recommend.getGoodsImageUrl());
                 memberOrderVO.setSkuName(recommend.getGoodsName());
@@ -1860,6 +1865,7 @@
             LogisticsDTO logisticsDTO = new LogisticsDTO();
             logisticsDTO.setCompany(order.getLogisticsNum());
             logisticsDTO.setPostid(order.getCourierNumber());
+            logisticsDTO.setReceiverPhone(order.getReceiverPhone());
             Express100VO logisticsList = logisticsService.getLogisticsList(logisticsDTO);
             if (StringUtils.isNotNull(logisticsList)) {
                 mgtOrderVO.setExpress100VO(logisticsList);

--
Gitblit v1.7.1