订单列表 返回 店铺名称
This commit is contained in:
@@ -37,6 +37,10 @@ public class OrderInfoVo implements Serializable {
|
|||||||
* 店铺Id
|
* 店铺Id
|
||||||
*/
|
*/
|
||||||
private String shopId;
|
private String shopId;
|
||||||
|
/**
|
||||||
|
* 店铺名称
|
||||||
|
*/
|
||||||
|
private String shopName;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ import java.util.*;
|
|||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static org.apache.dubbo.registry.zookeeper.util.CuratorFrameworkParams.MAX_RETRIES;
|
import static org.apache.dubbo.registry.zookeeper.util.CuratorFrameworkParams.MAX_RETRIES;
|
||||||
|
|
||||||
@@ -119,6 +120,8 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<OrderInfoVo> getOrderByPage(OrderInfoQueryDTO param) {
|
public Page<OrderInfoVo> getOrderByPage(OrderInfoQueryDTO param) {
|
||||||
|
List<ShopInfo> list = shopInfoService.list(QueryWrapper.create().select(ShopInfo::getId, ShopInfo::getShopName));
|
||||||
|
Map<Long, String> shopMap = list.stream().collect(Collectors.toMap(ShopInfo::getId, ShopInfo::getShopName));
|
||||||
String productName = param.getProductName();
|
String productName = param.getProductName();
|
||||||
List<Long> like = null;
|
List<Long> like = null;
|
||||||
if (StrUtil.isNotBlank(productName)) {
|
if (StrUtil.isNotBlank(productName)) {
|
||||||
@@ -151,6 +154,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||||||
.eq(OrderDetail::getOrderId, s.getId())
|
.eq(OrderDetail::getOrderId, s.getId())
|
||||||
.listAs(OrderDetailSmallVO.class);
|
.listAs(OrderDetailSmallVO.class);
|
||||||
s.setGoods(orderDetails);
|
s.setGoods(orderDetails);
|
||||||
|
s.setShopName(shopMap.get(Long.parseLong(s.getShopId())));
|
||||||
});
|
});
|
||||||
return orderInfoVoPage;
|
return orderInfoVoPage;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user