...
|
...
|
@@ -12,6 +12,7 @@ import com.yohoufo.dal.order.SellerOrderGoodsViewMapper; |
|
|
import com.yohoufo.dal.order.model.SellerOrderGoods;
|
|
|
import com.yohoufo.order.event.SellerOrderPriceChangeEvent;
|
|
|
import com.yohoufo.order.service.proxy.InBoxFacade;
|
|
|
import com.yohoufo.order.utils.OrderAssist;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
...
|
...
|
@@ -58,8 +59,9 @@ public class SellerOrderPriceChangeHandler implements IEventHandler<SellerOrderP |
|
|
logger.warn("Subscribe SellerOrderPriceChangeEvent msg return SellerOrderGoods is null, event {}", event);
|
|
|
return ;
|
|
|
}
|
|
|
if(SkupStatus.CAN_SELL.getCode()!=sog.getStatus()){
|
|
|
logger.warn("Subscribe SellerOrderPriceChangeEvent msg return SellerOrderGoods status is not can sell , event {} ,sog {}", event,sog);
|
|
|
boolean isAdvance = OrderAssist.skupIsAdvance(sog.getAttributes());
|
|
|
if(SkupStatus.CAN_SELL.getCode()!=sog.getStatus()||isAdvance){
|
|
|
logger.warn("Subscribe SellerOrderPriceChangeEvent msg return SellerOrderGoods status is not can sell or is Advance , event {} ,isAdvance {}, sog {}", event,isAdvance,sog);
|
|
|
return ;
|
|
|
}
|
|
|
int changedSellerUid = sog.getUid();
|
...
|
...
|
@@ -68,9 +70,10 @@ public class SellerOrderPriceChangeHandler implements IEventHandler<SellerOrderP |
|
|
//根据storageId获取所有在售的卖家的订单
|
|
|
List<SellerOrderGoods> noticeList= sellerOrderGoodsViewMapper.selectCanSellByStorageId(storageId);
|
|
|
//把自己过滤掉,只保留价格高于当前价格
|
|
|
noticeList = noticeList.stream().filter(r->r.getGoodsPrice().compareTo(changedPrice)>0&&changedSellerUid!=r.getUid().intValue()).collect(Collectors.toList());
|
|
|
//非预售的订单才push
|
|
|
noticeList = noticeList.stream().filter(r-> !OrderAssist.skupIsAdvance(r.getAttributes())&&r.getGoodsPrice().compareTo(changedPrice)>0&&changedSellerUid!=r.getUid().intValue()).collect(Collectors.toList());
|
|
|
if(CollectionUtils.isEmpty(noticeList)){
|
|
|
logger.warn("Subscribe SellerOrderPriceChangeEvent msg return SellerOrderGoods with empty same storage id , event {} ,sog {}", event,sog);
|
|
|
logger.warn("Subscribe SellerOrderPriceChangeEvent msg return because of empty non advance SellerOrderGoods list with same storage id , event {} ,sog {}", event,sog);
|
|
|
return ;
|
|
|
}
|
|
|
//从redis过滤uid+storgeid+date
|
...
|
...
|
|