...
|
...
|
@@ -4,7 +4,6 @@ import com.google.common.collect.Lists; |
|
|
import com.google.common.collect.Maps;
|
|
|
import com.yoho.error.ServiceError;
|
|
|
import com.yoho.error.exception.ServiceException;
|
|
|
import com.yohobuy.ufo.model.order.bo.GoodsInfo;
|
|
|
import com.yohobuy.ufo.model.order.bo.TimeoutBo;
|
|
|
import com.yohobuy.ufo.model.order.common.OrderAttributes;
|
|
|
import com.yohobuy.ufo.model.order.common.OrderListType;
|
...
|
...
|
@@ -160,7 +159,7 @@ public class BuyerOrderListServiceImpl extends AbsOrderListService implements IO |
|
|
@Override
|
|
|
protected void resetDynamicProporties(List<OrderListInfo> list, int type) {
|
|
|
if(CollectionUtils.isNotEmpty(list)){
|
|
|
refreshGoodsInfos(list);
|
|
|
refreshGoodsInfosIfNeed(list);
|
|
|
processButtons(list);
|
|
|
list.forEach(oli -> {
|
|
|
|
...
|
...
|
@@ -176,26 +175,22 @@ public class BuyerOrderListServiceImpl extends AbsOrderListService implements IO |
|
|
}
|
|
|
}
|
|
|
|
|
|
public void refreshGoodsInfos(List<OrderListInfo> list) {
|
|
|
public void refreshGoodsInfosIfNeed(List<OrderListInfo> list) {
|
|
|
if (CollectionUtils.isEmpty(list)) {
|
|
|
return;
|
|
|
}
|
|
|
Set<Integer> storageIds = list.stream().filter(item -> item.refreshStatisticalPrice()).map(item -> item.getGoodsInfo().getStorageId()).collect(Collectors.toSet());
|
|
|
//需要刷新的OrderListInfo
|
|
|
List<OrderListInfo> refreshList = list.stream().filter(OrderListInfo::refreshStatisticalPrice).collect(Collectors.toList());
|
|
|
if (CollectionUtils.isEmpty(refreshList)) {
|
|
|
return;
|
|
|
}
|
|
|
Set<Integer> storageIds = refreshList.stream().map(item -> item.getGoodsInfo().getStorageId()).collect(Collectors.toSet());
|
|
|
Map<Integer, BidStoragePriceResp> statisticalPriceMap = bidProductProxyService.getStatisticalPrice(storageIds);
|
|
|
list.forEach(item -> {
|
|
|
refreshGoodsInfo(item, statisticalPriceMap);
|
|
|
refreshList.forEach(item -> {
|
|
|
refreshGoodsInfo(item.getGoodsInfo(), statisticalPriceMap);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
private void refreshGoodsInfo(OrderListInfo orderListInfo, Map<Integer, BidStoragePriceResp> statisticalPriceMap) {
|
|
|
GoodsInfo goodsInfo = orderListInfo.getGoodsInfo();
|
|
|
BidStoragePriceResp bidStoragePriceResp = statisticalPriceMap.get(goodsInfo.getStorageId());
|
|
|
if (bidStoragePriceResp != null) {
|
|
|
goodsInfo.setLeastPrice(bidStoragePriceResp.getLeastPrice());
|
|
|
goodsInfo.setBidHighestPrice(bidStoragePriceResp.getBidHighestPrice());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void setAddressInfo(OrderListInfo orderListInfo) {
|
|
|
orderListInfo.setAddressInfo(getAddressInfo(orderListInfo.getBuyerUid(), orderListInfo.getOrderCode(),
|
...
|
...
|
|