|
@@ -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
|