|
|
@@ -62,10 +62,7 @@ import com.fs.store.enums.OrderInfoEnum;
|
|
|
import com.fs.store.enums.OrderLogEnum;
|
|
|
import com.fs.store.enums.ShipperCodeEnum;
|
|
|
import com.fs.store.enums.ShippingTempEnum;
|
|
|
-import com.fs.store.mapper.FsStoreDeliversMapper;
|
|
|
-import com.fs.store.mapper.FsStoreProductAttrValueMapper;
|
|
|
-import com.fs.store.mapper.FsUserMapper;
|
|
|
-import com.fs.store.mapper.FsWarehousesMapper;
|
|
|
+import com.fs.store.mapper.*;
|
|
|
import com.fs.store.param.FsStoreOrderAddTuiMoneyParam;
|
|
|
import com.fs.store.param.LiveOrderComputedParam;
|
|
|
import com.fs.store.service.*;
|
|
|
@@ -2053,12 +2050,42 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private FsStoreProductMapper fsStoreProductMapper;
|
|
|
@Override
|
|
|
public List<LiveGoodsVo> selectLiveOrderItemList(String orderId) {
|
|
|
LiveOrder liveOrder = baseMapper.selectLiveOrderByOrderId(orderId);
|
|
|
- return liveGoodsMapper.selectProductListByOrder(liveOrder);
|
|
|
- }
|
|
|
+ Asserts.notNull(liveOrder, String.format("该订单 %s 没有找到!", orderId));
|
|
|
+ List<LiveGoodsVo> liveGoodsVos = liveGoodsMapper.selectProductListByOrder(liveOrder);
|
|
|
+
|
|
|
+ if (CollectionUtils.isEmpty(liveGoodsVos)) {
|
|
|
+ return liveGoodsVos;
|
|
|
+ }
|
|
|
+ List<String> productIds = liveGoodsVos.stream()
|
|
|
+ .map(LiveGoodsVo::getProductId)
|
|
|
+ .filter(Objects::nonNull)
|
|
|
+ .map(String::valueOf)
|
|
|
+ .distinct()
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ if (CollectionUtils.isEmpty(productIds)) {
|
|
|
+ return liveGoodsVos;
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<Long, FsStoreProduct> productWarehouseMap =
|
|
|
+ fsStoreProductMapper.selectWarehouseCodeByProductIds(productIds);
|
|
|
+
|
|
|
+ liveGoodsVos.forEach(goodsVo -> {
|
|
|
+ Long productId = goodsVo.getProductId();
|
|
|
+ if (productId != null) {
|
|
|
+ FsStoreProduct storeProduct = productWarehouseMap.get(productId);
|
|
|
+ if (storeProduct != null) {
|
|
|
+ goodsVo.setWarehouseCode(storeProduct.getWarehouseCode());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return liveGoodsVos;
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
@Override
|