Authored by chenchao

fix

@@ -90,7 +90,7 @@ public class ChangePricePrepareProcessor { @@ -90,7 +90,7 @@ public class ChangePricePrepareProcessor {
90 //若needChangePriceSkupList中有skup出现不存在于skupOfSalingMap keys中,说明该skup走到了其他状态中 90 //若needChangePriceSkupList中有skup出现不存在于skupOfSalingMap keys中,说明该skup走到了其他状态中
91 Map<Integer, SkupDto> skupMap = checkNeedProcessSkups(needChangePriceSkupList,skupOfSalingMap); 91 Map<Integer, SkupDto> skupMap = checkNeedProcessSkups(needChangePriceSkupList,skupOfSalingMap);
92 // 92 //
93 - SkupDto sampleSkupDto = skupMap.get(0); 93 + SkupDto sampleSkupDto = skupMap.values().iterator().next();
94 int sampleSkup = sampleSkupDto.getSkup(); 94 int sampleSkup = sampleSkupDto.getSkup();
95 SellerOrderGoods sampleSog = sampleSkupDto.getSellerOrderGoods(); 95 SellerOrderGoods sampleSog = sampleSkupDto.getSellerOrderGoods();
96 SellerOrder sellerOrder = sellerOrderMapper.selectBySkup(sampleSkup); 96 SellerOrder sellerOrder = sellerOrderMapper.selectBySkup(sampleSkup);
@@ -157,6 +157,10 @@ public class ChangePricePrepareProcessor { @@ -157,6 +157,10 @@ public class ChangePricePrepareProcessor {
157 SellerOrderGoods condition = new SellerOrderGoods(); 157 SellerOrderGoods condition = new SellerOrderGoods();
158 condition.setBatchNo(batchNo); 158 condition.setBatchNo(batchNo);
159 List<SellerOrderGoods> sellerOrderGoodList = sellerOrderGoodsMapper.selectByBatchNo(condition, Arrays.asList(SkupStatus.CAN_SELL.getCode(), SkupStatus.SELL_OUT.getCode())); 159 List<SellerOrderGoods> sellerOrderGoodList = sellerOrderGoodsMapper.selectByBatchNo(condition, Arrays.asList(SkupStatus.CAN_SELL.getCode(), SkupStatus.SELL_OUT.getCode()));
  160 + if (CollectionUtils.isEmpty(sellerOrderGoodList)){
  161 + logger.warn("ChangePrice checkAndAcquire not find skups by batchNo, req {}", req);
  162 + throw new UfoServiceException(501, "商品不能变价");
  163 + }
160 List<Integer> skups = sellerOrderGoodList.parallelStream().map(SellerOrderGoods::getId).collect(Collectors.toList()); 164 List<Integer> skups = sellerOrderGoodList.parallelStream().map(SellerOrderGoods::getId).collect(Collectors.toList());
161 logger.info("batch change price checkExistWaitingBuyerPay req {} skups {}", req, skups); 165 logger.info("batch change price checkExistWaitingBuyerPay req {} skups {}", req, skups);
162 List<BuyerOrderGoods> buyerOrderGoodsList = buyerOrderGoodsMapper.selectBySkups(skups); 166 List<BuyerOrderGoods> buyerOrderGoodsList = buyerOrderGoodsMapper.selectBySkups(skups);
@@ -167,7 +171,8 @@ public class ChangePricePrepareProcessor { @@ -167,7 +171,8 @@ public class ChangePricePrepareProcessor {
167 buyerOrderList = buyerOrderMapper.selectByOrderCodes(orderCodeList, Arrays.asList(OrderStatus.WAITING_PAY.getCode())); 171 buyerOrderList = buyerOrderMapper.selectByOrderCodes(orderCodeList, Arrays.asList(OrderStatus.WAITING_PAY.getCode()));
168 } 172 }
169 if (CollectionUtils.isNotEmpty(buyerOrderList)){ 173 if (CollectionUtils.isNotEmpty(buyerOrderList)){
170 - logger.warn("ChangePrice checkAndAcquire storageId illegal , req {}", req); 174 + List<Long> waitingPayOrderCodes = buyerOrderList.parallelStream().map(BuyerOrder::getOrderCode).collect(Collectors.toList());
  175 + logger.warn("ChangePrice checkAndAcquire exist waiting pay skup , req {} waitingPayOrderCodes {}", req, waitingPayOrderCodes);
171 throw new UfoServiceException(400, "部分商品正在等待买家支付"); 176 throw new UfoServiceException(400, "部分商品正在等待买家支付");
172 } 177 }
173 return sellerOrderGoodList.parallelStream().collect(Collectors.toMap(SellerOrderGoods::getId, 178 return sellerOrderGoodList.parallelStream().collect(Collectors.toMap(SellerOrderGoods::getId,