From c6731159f3adabf8502055152398e2f4c6f5b2df Mon Sep 17 00:00:00 2001
From: luodangjia <luodangjia>
Date: 星期五, 27 九月 2024 09:11:19 +0800
Subject: [PATCH] 9.24

---
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TShoppingOrderController.java |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TShoppingOrderController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TShoppingOrderController.java
index 8418b50..5508963 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TShoppingOrderController.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TShoppingOrderController.java
@@ -19,6 +19,8 @@
 import com.ruoyi.order.api.query.ShoppingOrderQuery;
 import com.ruoyi.order.dto.*;
 import com.ruoyi.order.service.TShoppingOrderService;
+import com.ruoyi.other.api.domain.TCoupon;
+import com.ruoyi.other.api.domain.TGoods;
 import com.ruoyi.other.api.feignClient.CouponClient;
 import com.ruoyi.other.api.feignClient.GoodsClient;
 import com.ruoyi.payment.api.feignClient.AliPaymentClient;
@@ -108,6 +110,17 @@
 				byId.setReceivingName(data.getName()+"-"+data.getPhone());
 				byId.setReceivingAddress(data.getAddress());
 			}
+		}
+		if (byId.getOrderType()==1){
+			TGoods data = goodsClient.getGoodsById(byId.getGoodsId()).getData();
+			if (data!=null){
+				byId.setName(data.getName());
+			}
+		}else {
+		 TCoupon data = couponClient.getCouponById1(byId.getCouponId()).getData();
+		 if (data!=null){
+			 byId.setName(data.getName());
+		 }
 		}
 		return AjaxResult.success(byId);
 	}
@@ -280,6 +293,7 @@
 	@PostMapping("/create")
 	public R<TShoppingOrder> shopCreate(@RequestBody ExchangeDto exchangeDto){
 		TShoppingOrder shoppingOrder = new TShoppingOrder();
+		shoppingOrder.setTitle(exchangeDto.getTitle());
 		shoppingOrder.setCode(OrderCodeUtil.getOrderCode("GW"));
 		shoppingOrder.setAppUserId(exchangeDto.getUserId());
 		shoppingOrder.setOrderType(exchangeDto.getGoodType());
@@ -302,6 +316,7 @@
 		shoppingOrder.setPaymentType(exchangeDto.getPayMethod());
 		shoppingOrder.setRemark(exchangeDto.getRemark());
 		shoppingOrder.setStatus(1);
+		shoppingOrder.setPhone(exchangeDto.getPhone());
 		shoppingOrder.setCreateTime(LocalDateTime.now());
 		shoppingOrder.setDelFlag(false);
 		shoppingOrderService.save(shoppingOrder);

--
Gitblit v1.7.1