|
@@ -1,6 +1,7 @@
|
1
|
1
|
package cn.lili.modules.order.order.serviceimpl;
|
2
|
2
|
|
3
|
3
|
import cn.hutool.core.bean.BeanUtil;
|
|
4
|
+import cn.hutool.core.collection.CollectionUtil;
|
4
|
5
|
import cn.hutool.core.date.DateUtil;
|
5
|
6
|
import cn.hutool.core.io.IoUtil;
|
6
|
7
|
import cn.hutool.core.text.CharSequenceUtil;
|
|
@@ -16,7 +17,11 @@ import cn.lili.common.security.OperationalJudgment;
|
16
|
17
|
import cn.lili.common.security.context.UserContext;
|
17
|
18
|
import cn.lili.common.security.enums.UserEnums;
|
18
|
19
|
import cn.lili.common.utils.SnowFlake;
|
|
20
|
+import cn.lili.modules.goods.entity.dos.Goods;
|
19
|
21
|
import cn.lili.modules.goods.entity.dto.GoodsCompleteMessage;
|
|
22
|
+import cn.lili.modules.goods.mapper.GoodsMapper;
|
|
23
|
+import cn.lili.modules.goods.service.GoodsService;
|
|
24
|
+import cn.lili.modules.goods.serviceimpl.GoodsServiceImpl;
|
20
|
25
|
import cn.lili.modules.member.entity.dto.MemberAddressDTO;
|
21
|
26
|
import cn.lili.modules.order.cart.entity.dto.TradeDTO;
|
22
|
27
|
import cn.lili.modules.order.customs.JiangyinServiceManager;
|
|
@@ -121,6 +126,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
121
|
126
|
*/
|
122
|
127
|
@Autowired
|
123
|
128
|
private OrderLogService orderLogService;
|
|
129
|
+
|
|
130
|
+ @Autowired
|
|
131
|
+ private GoodsMapper goodsMapper;
|
124
|
132
|
/**
|
125
|
133
|
* RocketMQ
|
126
|
134
|
*/
|
|
@@ -284,6 +292,14 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
284
|
292
|
orderItemWrapper.eq(ORDER_SN_COLUMN, orderSn);
|
285
|
293
|
//查询订单项信息
|
286
|
294
|
List<OrderItem> orderItems = orderItemMapper.selectList(orderItemWrapper);
|
|
295
|
+ if (!CollectionUtil.isEmpty(orderItems)){
|
|
296
|
+ List<String> goodsIds = orderItems.stream().map(OrderItem::getGoodsId).collect(Collectors.toList());
|
|
297
|
+ List<Goods> goods = goodsMapper.selectList(new QueryWrapper<Goods>().lambda().in(Goods::getId, goodsIds));
|
|
298
|
+ Map<String, String> id2Unit = goods.stream().collect(Collectors.toMap(Goods::getId, Goods::getGoodsUnit));
|
|
299
|
+ for (OrderItem orderItem : orderItems) {
|
|
300
|
+ orderItem.setUnit(id2Unit.get(orderItem.getGoodsId()));
|
|
301
|
+ }
|
|
302
|
+ }
|
287
|
303
|
//查询订单日志信息
|
288
|
304
|
List<OrderLog> orderLogs = orderLogService.getOrderLog(orderSn);
|
289
|
305
|
//查询发票信息
|