Authored by LUOXC

Merge branch 'master' into hotfix-invite-activity

@@ -12,6 +12,7 @@ import com.yohoufo.dal.order.SellerOrderGoodsViewMapper; @@ -12,6 +12,7 @@ import com.yohoufo.dal.order.SellerOrderGoodsViewMapper;
12 import com.yohoufo.dal.order.model.SellerOrderGoods; 12 import com.yohoufo.dal.order.model.SellerOrderGoods;
13 import com.yohoufo.order.event.SellerOrderPriceChangeEvent; 13 import com.yohoufo.order.event.SellerOrderPriceChangeEvent;
14 import com.yohoufo.order.service.proxy.InBoxFacade; 14 import com.yohoufo.order.service.proxy.InBoxFacade;
  15 +import com.yohoufo.order.utils.OrderAssist;
15 import org.apache.commons.collections.CollectionUtils; 16 import org.apache.commons.collections.CollectionUtils;
16 import org.slf4j.Logger; 17 import org.slf4j.Logger;
17 import org.slf4j.LoggerFactory; 18 import org.slf4j.LoggerFactory;
@@ -58,8 +59,9 @@ public class SellerOrderPriceChangeHandler implements IEventHandler<SellerOrderP @@ -58,8 +59,9 @@ public class SellerOrderPriceChangeHandler implements IEventHandler<SellerOrderP
58 logger.warn("Subscribe SellerOrderPriceChangeEvent msg return SellerOrderGoods is null, event {}", event); 59 logger.warn("Subscribe SellerOrderPriceChangeEvent msg return SellerOrderGoods is null, event {}", event);
59 return ; 60 return ;
60 } 61 }
61 - if(SkupStatus.CAN_SELL.getCode()!=sog.getStatus()){  
62 - logger.warn("Subscribe SellerOrderPriceChangeEvent msg return SellerOrderGoods status is not can sell , event {} ,sog {}", event,sog); 62 + boolean isAdvance = OrderAssist.skupIsAdvance(sog.getAttributes());
  63 + if(SkupStatus.CAN_SELL.getCode()!=sog.getStatus()||isAdvance){
  64 + logger.warn("Subscribe SellerOrderPriceChangeEvent msg return SellerOrderGoods status is not can sell or is Advance , event {} ,isAdvance {}, sog {}", event,isAdvance,sog);
63 return ; 65 return ;
64 } 66 }
65 int changedSellerUid = sog.getUid(); 67 int changedSellerUid = sog.getUid();
@@ -68,9 +70,10 @@ public class SellerOrderPriceChangeHandler implements IEventHandler<SellerOrderP @@ -68,9 +70,10 @@ public class SellerOrderPriceChangeHandler implements IEventHandler<SellerOrderP
68 //根据storageId获取所有在售的卖家的订单 70 //根据storageId获取所有在售的卖家的订单
69 List<SellerOrderGoods> noticeList= sellerOrderGoodsViewMapper.selectCanSellByStorageId(storageId); 71 List<SellerOrderGoods> noticeList= sellerOrderGoodsViewMapper.selectCanSellByStorageId(storageId);
70 //把自己过滤掉,只保留价格高于当前价格 72 //把自己过滤掉,只保留价格高于当前价格
71 - noticeList = noticeList.stream().filter(r->r.getGoodsPrice().compareTo(changedPrice)>0&&changedSellerUid!=r.getUid().intValue()).collect(Collectors.toList()); 73 + //非预售的订单才push
  74 + noticeList = noticeList.stream().filter(r-> !OrderAssist.skupIsAdvance(r.getAttributes())&&r.getGoodsPrice().compareTo(changedPrice)>0&&changedSellerUid!=r.getUid().intValue()).collect(Collectors.toList());
72 if(CollectionUtils.isEmpty(noticeList)){ 75 if(CollectionUtils.isEmpty(noticeList)){
73 - logger.warn("Subscribe SellerOrderPriceChangeEvent msg return SellerOrderGoods with empty same storage id , event {} ,sog {}", event,sog); 76 + logger.warn("Subscribe SellerOrderPriceChangeEvent msg return because of empty non advance SellerOrderGoods list with same storage id , event {} ,sog {}", event,sog);
74 return ; 77 return ;
75 } 78 }
76 //从redis过滤uid+storgeid+date 79 //从redis过滤uid+storgeid+date
@@ -117,7 +117,7 @@ public class AssetsService { @@ -117,7 +117,7 @@ public class AssetsService {
117 return rtnList; 117 return rtnList;
118 } 118 }
119 List<Long> orderCodeList = detailList.stream().map(TradeBills::getOrderCode).collect(Collectors.toList()); 119 List<Long> orderCodeList = detailList.stream().map(TradeBills::getOrderCode).collect(Collectors.toList());
120 - List<BuyerOrderGoods> buyerOrderGoodsList = orderCodeList.isEmpty()?new ArrayList<>(): buyerOrderGoodsMapper.selectByOrderCodeList(uid, orderCodeList); 120 + List<BuyerOrderGoods> buyerOrderGoodsList = orderCodeList.isEmpty()?new ArrayList<>(): buyerOrderGoodsMapper.selectByOrderCodeList(null, orderCodeList);
121 List<Integer> skups = buyerOrderGoodsList.stream().map(BuyerOrderGoods::getSkup).collect(Collectors.toList()); 121 List<Integer> skups = buyerOrderGoodsList.stream().map(BuyerOrderGoods::getSkup).collect(Collectors.toList());
122 List<SellerOrderGoods> sellerOrderGoodsList = skups.isEmpty()?new ArrayList<>(): sellerOrderGoodsMapper.selectBySkups(skups); 122 List<SellerOrderGoods> sellerOrderGoodsList = skups.isEmpty()?new ArrayList<>(): sellerOrderGoodsMapper.selectBySkups(skups);
123 Map<Long, BuyerOrderGoods> orderSkupMap = buyerOrderGoodsList.stream().collect(Collectors.toMap(BuyerOrderGoods::getOrderCode, Function.identity())); 123 Map<Long, BuyerOrderGoods> orderSkupMap = buyerOrderGoodsList.stream().collect(Collectors.toMap(BuyerOrderGoods::getOrderCode, Function.identity()));
@@ -383,6 +383,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I @@ -383,6 +383,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
383 assembleSoldPrdCompute(orderDetailInfo, order.getUid(), sellerOrderGoods.getId()); 383 assembleSoldPrdCompute(orderDetailInfo, order.getUid(), sellerOrderGoods.getId());
384 OrderDetailInfo.StatusDetail statusDetail = getStatusDetail(order, skupStatus); 384 OrderDetailInfo.StatusDetail statusDetail = getStatusDetail(order, skupStatus);
385 Integer soga = sellerOrderGoods.getAttributes(); 385 Integer soga = sellerOrderGoods.getAttributes();
  386 + orderDetailInfo.setAttributes(soga);
386 boolean isAdvance = OrderAssist.skupIsAdvance(soga); 387 boolean isAdvance = OrderAssist.skupIsAdvance(soga);
387 SkupType skupType = SkupType.getSkupType(soga); 388 SkupType skupType = SkupType.getSkupType(soga);
388 389