Authored by wujiexiang

判空

@@ -123,6 +123,9 @@ public class BuyerOrderListServiceImpl extends AbsOrderListService implements IO @@ -123,6 +123,9 @@ public class BuyerOrderListServiceImpl extends AbsOrderListService implements IO
123 @Override 123 @Override
124 List<BuyerOrderMeta> getBuyerOrderMetas(int uid, List<BuyerOrder> buyerOrders) { 124 List<BuyerOrderMeta> getBuyerOrderMetas(int uid, List<BuyerOrder> buyerOrders) {
125 List<Long> orderCodeList = buyerOrders.stream().filter(BuyerOrder::isBidOrder).map(BuyerOrder::getOrderCode).collect(Collectors.toList()); 125 List<Long> orderCodeList = buyerOrders.stream().filter(BuyerOrder::isBidOrder).map(BuyerOrder::getOrderCode).collect(Collectors.toList());
  126 + if (CollectionUtils.isEmpty(orderCodeList)) {
  127 + return Lists.newArrayList();
  128 + }
126 return buyerOrderMetaMapper.selectByOrderCodesAndMetaKeys(uid, orderCodeList, Lists.newArrayList(MetaKey.BID_KEY)); 129 return buyerOrderMetaMapper.selectByOrderCodesAndMetaKeys(uid, orderCodeList, Lists.newArrayList(MetaKey.BID_KEY));
127 } 130 }
128 131
@@ -8,6 +8,7 @@ import com.yohoufo.common.ApiResponse; @@ -8,6 +8,7 @@ import com.yohoufo.common.ApiResponse;
8 import com.yohoufo.common.exception.UfoServiceException; 8 import com.yohoufo.common.exception.UfoServiceException;
9 import com.yohoufo.dal.order.model.SellerOrderGoods; 9 import com.yohoufo.dal.order.model.SellerOrderGoods;
10 import com.yohoufo.order.common.Operator; 10 import com.yohoufo.order.common.Operator;
  11 +import org.apache.commons.collections.CollectionUtils;
11 import org.apache.commons.lang3.ArrayUtils; 12 import org.apache.commons.lang3.ArrayUtils;
12 import org.slf4j.Logger; 13 import org.slf4j.Logger;
13 import org.slf4j.LoggerFactory; 14 import org.slf4j.LoggerFactory;
@@ -111,6 +112,9 @@ public class BidProductProxyService extends AbsProxyService { @@ -111,6 +112,9 @@ public class BidProductProxyService extends AbsProxyService {
111 112
112 public Map<Integer, BidStoragePriceResp> getStatisticalPrice(Set<Integer> storageIds) { 113 public Map<Integer, BidStoragePriceResp> getStatisticalPrice(Set<Integer> storageIds) {
113 logger.info("getStatisticalPrice,storageIds:{}", storageIds); 114 logger.info("getStatisticalPrice,storageIds:{}", storageIds);
  115 + if (CollectionUtils.isEmpty(storageIds)) {
  116 + return Collections.EMPTY_MAP;
  117 + }
114 try { 118 try {
115 BidStoragePriceResp[] resps = getResultFromApiResponse(ufoServiceCaller.call(GET_STATISTICAL_PRICE_API, storageIds), BidStoragePriceResp[].class); 119 BidStoragePriceResp[] resps = getResultFromApiResponse(ufoServiceCaller.call(GET_STATISTICAL_PRICE_API, storageIds), BidStoragePriceResp[].class);
116 if (ArrayUtils.isEmpty(resps)) { 120 if (ArrayUtils.isEmpty(resps)) {