From 9a6b4b2e7da47e28d3625f65c3e8743492538cee Mon Sep 17 00:00:00 2001 From: "kuang.yifei@iwhalecloud.com" Date: Tue, 7 Jun 2022 15:55:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E8=B4=B9=E8=80=85=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/order/OrderMasterController.java | 10 ++++++++-- .../resources/mapper/goods/GoodsStandardMapper.xml | 6 +++--- .../src/main/java/com/ghy/order/domain/OrderGoods.java | 2 ++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderMasterController.java b/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderMasterController.java index abe5dbc7..91f28695 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderMasterController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderMasterController.java @@ -12,6 +12,8 @@ import com.ghy.customer.domain.Customer; import com.ghy.customer.domain.CustomerAddress; import com.ghy.customer.service.CustomerAddressService; import com.ghy.customer.service.CustomerService; +import com.ghy.goods.domain.GoodsStandard; +import com.ghy.goods.service.GoodsService; import com.ghy.goods.service.GoodsStandardService; import com.ghy.order.domain.OrderDetail; import com.ghy.order.domain.OrderGoods; @@ -63,6 +65,8 @@ public class OrderMasterController extends BaseController { @Autowired private OrderGoodsService orderGoodsService; @Autowired + private GoodsService goodsService; + @Autowired private CustomerAddressService customerAddressService; @Autowired private FinancialDetailService financialDetailService; @@ -89,8 +93,10 @@ public class OrderMasterController extends BaseController { OrderGoods orderGoods = orderGoodsService.selectByOrderMasterId(master.getId()); // 添加商品信息 - if(!CollectionUtils.isEmpty(goodsStandardService.selectByGoodsId(orderGoods.getGoodsId()))){ - orderGoods.setGoodsStandard(goodsStandardService.selectByGoodsId(orderGoods.getGoodsId()).get(0)); + List goodsStandardList = goodsStandardService.selectByGoodsId(orderGoods.getGoodsId()); + if(!CollectionUtils.isEmpty(goodsStandardList)){ + orderGoods.setGoodsStandard(goodsStandardList.get(0)); + orderGoods.setGoodsLogoUrl(goodsService.selectById(goodsStandardList.get(0).getGoodsId()).getGoodsImgUrl()); } // 添加订单商品信息 diff --git a/ghy-goods/src/main/resources/mapper/goods/GoodsStandardMapper.xml b/ghy-goods/src/main/resources/mapper/goods/GoodsStandardMapper.xml index 611c7e43..7c55cb8a 100644 --- a/ghy-goods/src/main/resources/mapper/goods/GoodsStandardMapper.xml +++ b/ghy-goods/src/main/resources/mapper/goods/GoodsStandardMapper.xml @@ -57,11 +57,11 @@ - - - AND goods_id = #{goodsId} + + AND goods_standard_id = #{goodsId} diff --git a/ghy-order/src/main/java/com/ghy/order/domain/OrderGoods.java b/ghy-order/src/main/java/com/ghy/order/domain/OrderGoods.java index 203d3e9c..e777ca38 100644 --- a/ghy-order/src/main/java/com/ghy/order/domain/OrderGoods.java +++ b/ghy-order/src/main/java/com/ghy/order/domain/OrderGoods.java @@ -41,6 +41,8 @@ public class OrderGoods extends BaseEntity { private GoodsStandard goodsStandard; + private String goodsLogoUrl; + public OrderGoods() { }