Authored by LUOXC

Merge branch 'master' into hotfix-invite-activity

... ... @@ -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
... ...
... ... @@ -117,7 +117,7 @@ public class AssetsService {
return rtnList;
}
List<Long> orderCodeList = detailList.stream().map(TradeBills::getOrderCode).collect(Collectors.toList());
List<BuyerOrderGoods> buyerOrderGoodsList = orderCodeList.isEmpty()?new ArrayList<>(): buyerOrderGoodsMapper.selectByOrderCodeList(uid, orderCodeList);
List<BuyerOrderGoods> buyerOrderGoodsList = orderCodeList.isEmpty()?new ArrayList<>(): buyerOrderGoodsMapper.selectByOrderCodeList(null, orderCodeList);
List<Integer> skups = buyerOrderGoodsList.stream().map(BuyerOrderGoods::getSkup).collect(Collectors.toList());
List<SellerOrderGoods> sellerOrderGoodsList = skups.isEmpty()?new ArrayList<>(): sellerOrderGoodsMapper.selectBySkups(skups);
Map<Long, BuyerOrderGoods> orderSkupMap = buyerOrderGoodsList.stream().collect(Collectors.toMap(BuyerOrderGoods::getOrderCode, Function.identity()));
... ...
... ... @@ -383,6 +383,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
assembleSoldPrdCompute(orderDetailInfo, order.getUid(), sellerOrderGoods.getId());
OrderDetailInfo.StatusDetail statusDetail = getStatusDetail(order, skupStatus);
Integer soga = sellerOrderGoods.getAttributes();
orderDetailInfo.setAttributes(soga);
boolean isAdvance = OrderAssist.skupIsAdvance(soga);
SkupType skupType = SkupType.getSkupType(soga);
... ...