...
|
...
|
@@ -74,6 +74,24 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde |
|
|
@Autowired
|
|
|
private SellerOrderPrepareProcessor sellerOrderPrepareProcessor;
|
|
|
|
|
|
public List<OrderListInfo> buildOrderList(List<SellerOrderGoods> sogList, SellerType sellerType){
|
|
|
sogList.stream().forEach(item -> {
|
|
|
item.setImageUrl(ImageUrlAssist.getAllProductPicUrl(item.getImageUrl(), "goodsimg", "center", "d2hpdGU="));
|
|
|
});
|
|
|
Map<String, String> overPriceTipsMap = buildOverPriceTipsMap(sogList);
|
|
|
Map<Integer, SellerOrderGoods> skupSellerOrderGoodsMap = sogList.parallelStream()
|
|
|
.collect(Collectors.toMap(SellerOrderGoods::getId, (SellerOrderGoods sog) -> sog));
|
|
|
List<Integer> skupList = sogList.parallelStream().map(SellerOrderGoods::getId).collect(Collectors.toList());
|
|
|
List<SellerOrder> sellerOrders = sellerOrderMapper.selectBySkups(skupList);
|
|
|
List<OrderListInfo> data ;
|
|
|
data = sellerOrders.parallelStream()
|
|
|
.map(sellerOrder -> buildOrderListInfo(skupSellerOrderGoodsMap.get(sellerOrder.getSkup()),
|
|
|
sellerOrder, sellerType, overPriceTipsMap))
|
|
|
.filter(oli -> Objects.nonNull(oli))
|
|
|
.collect(Collectors.toList());
|
|
|
return data;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public PageResp<OrderListInfo> getOrderList(OrderListRequest request){
|
|
|
OrderListVo orderListVo = orderCacheService.getOrderListInfos(request);
|
...
|
...
|
@@ -92,8 +110,7 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde |
|
|
int type;
|
|
|
if ((type=request.getType()) == SellerOrderListType.IN_SALE.getType()){
|
|
|
List<Integer> statusList = initOrderListRequest(request);
|
|
|
boolean isEntry = userProxyService.isEntryShop(request.getUid());
|
|
|
final SellerType sellerType = isEntry ? SellerType.ENTRY : SellerType.COMMON;
|
|
|
|
|
|
int total = sellerOrderGoodsMapper.selectCntByUidStatusGBBNList(request.getUid(), statusList);
|
|
|
int limit = request.getLimit();
|
|
|
respBuilder = PageResp.builder()
|
...
|
...
|
@@ -112,23 +129,10 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde |
|
|
log.warn("seller get order list SellerOrderGoods is empty,req {}", request);
|
|
|
return respBuilder.build();
|
|
|
}
|
|
|
sogList.stream().forEach(item -> {
|
|
|
item.setImageUrl(ImageUrlAssist.getAllProductPicUrl(item.getImageUrl(), "goodsimg", "center", "d2hpdGU="));
|
|
|
});
|
|
|
Map<String, String> overPriceTipsMap = buildOverPriceTipsMap(sogList);
|
|
|
Map<Integer, SellerOrderGoods> skupSellerOrderGoodsMap = sogList.parallelStream()
|
|
|
.collect(Collectors.toMap(SellerOrderGoods::getId, (SellerOrderGoods sog) -> sog));
|
|
|
List<Integer> skupList = sogList.parallelStream().map(SellerOrderGoods::getId).collect(Collectors.toList());
|
|
|
List<SellerOrder> sellerOrders = sellerOrderMapper.selectBySkups(skupList);
|
|
|
List<OrderListInfo> data ;
|
|
|
data = sellerOrders.parallelStream()
|
|
|
.map(sellerOrder -> buildOrderListInfo(skupSellerOrderGoodsMap.get(sellerOrder.getSkup()),
|
|
|
sellerOrder, sellerType, overPriceTipsMap))
|
|
|
.filter(oli -> Objects.nonNull(oli))
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
boolean isEntry = userProxyService.isEntryShop(request.getUid());
|
|
|
final SellerType sellerType = isEntry ? SellerType.ENTRY : SellerType.COMMON;
|
|
|
List<OrderListInfo> data = buildOrderList(sogList, sellerType);
|
|
|
orderListInfoRsp = respBuilder.data(data).build();
|
|
|
|
|
|
}else{
|
|
|
orderListInfoRsp = super.getOrderList(request);
|
|
|
}
|
...
|
...
|
|