Authored by chenchao

fix some bug

... ... @@ -14,6 +14,7 @@ import com.yohoufo.dal.order.model.BuyerOrderGoods;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.order.model.request.OrderListRequest;
import com.yohoufo.order.service.IOrderListService;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -68,7 +69,10 @@ public abstract class AbsOrderListService extends AbsOrderViewService implements
List<BuyerOrder> buyerOrderList = getOrderList(request.getUid(), statusQuery, offset, limit);
List<Long> orderCodeList = buyerOrderList.stream().map(BuyerOrder::getOrderCode).collect(Collectors.toList());
//TODO 可以提前计算 total offset limit三者之间的关系,减少一次网络I
if (CollectionUtils.isEmpty(orderCodeList)){
return respBuilder.build();
}
// buyer_order_goods ===> skup+商品成交价 1:1
List<BuyerOrderGoods> buyerOrderGoodsList = getOrderGoodsList(request.getUid(), orderCodeList);
Map<Long, BuyerOrderGoods> buyerOrderGoodsMap = buyerOrderGoodsList.stream()
... ...
... ... @@ -100,7 +100,11 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde
int offset = (request.getPage() - 1) * limit;
List<SellerOrderGoods> sogList = sellerOrderGoodsMapper.selectByUidStatusGBBNList(request.getUid(),
statusList, offset, limit);
//TODO 可以提前计算 total offset limit三者之间的关系,减少一次网络I
if (CollectionUtils.isEmpty(sogList)){
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="));
});
... ...