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() { }