Authored by chenchao

fix price in push

... ... @@ -154,7 +154,7 @@ public class MsgService {
Product product){
logger.info(logTitle + " ready 2 send push, uid {} sku {} prdName {} sceneKey {} securityKey {}",
uid, sellerOrderGoods.getStorageId(), product.getProductName(), sceneKey, securityKey);
MessageCenterEvent centerEvent = buildCommonPrdMsg(uid, sellerOrderGoods, product);
MessageCenterEvent centerEvent = buildCommonPrdMsg(uid, tabType, sellerOrderGoods, product);
centerEvent.setSendScene(sceneKey);
centerEvent.setSecurityKey(securityKey);
msgCenterHandler.send(centerEvent);
... ... @@ -168,7 +168,8 @@ public class MsgService {
}
private static MessageCenterEvent buildCommonPrdMsg(Integer uid, SellerOrderGoods sellerOrderGoods, Product product){
private static MessageCenterEvent buildCommonPrdMsg(Integer uid, TabType tabType,
SellerOrderGoods sellerOrderGoods, Product product){
MessageCenterEvent centerEvent = new MessageCenterEvent();
centerEvent.setUserType("UID"); //根据userList的类型可选:UID,MOBILE,TOKEM,OPENID
centerEvent.setUserList(Lists.newArrayList(String.valueOf(uid)));
... ...
... ... @@ -59,18 +59,19 @@ public class SellerDecrPriceTaskHandler extends AbstractSellerAdjustPriceTaskHan
notifyProductToUpdatePrice(uid, taskId,result.successSkups, cppDto.getSalePrice());
//push buyer of biding order if necessary
pushBuyerOfBidOrderIfPresent(successOrderGoods);
pushBuyerOfBidOrderIfPresent(successOrderGoods,cppDto);
//清理缓存
cleanCache(uid, successOrderGoods);
}
}
private void pushBuyerOfBidOrderIfPresent(List<SellerOrderGoods> successOrderGoods){
private void pushBuyerOfBidOrderIfPresent(List<SellerOrderGoods> successOrderGoods, ChangePricePrepareDTO cpp){
if (CollectionUtils.isEmpty(successOrderGoods)){
return;
}
SellerOrderGoods sog = successOrderGoods.get(0);
sog.setGoodsPrice(cpp.getSalePrice());
log.info("pushBuyerOfBidOrderIfPresent {}",sog);
sellerNoticeFacade.pushMsg2BuyerWhenSellerChangePrice(sog);
}
... ...
... ... @@ -169,11 +169,11 @@ public class SellerNoticeFacade extends BaseNoticeFacade {
List<Integer> statusList = Lists.newArrayList(SkupStatus.CAN_SELL.getCode());
Set<Integer> skupTypes = Sets.newHashSet(skupType.getCode());
Integer sku = soldProduct.getStorageId();
BigDecimal leastPrice;
BigDecimal leastPrice = null;
//卖家的现货出价是否是全网最低价
boolean pushEnable = skupType.equals(SkupType.IN_STOCK)
&& Objects.nonNull(leastPrice=skupService.getLeastPriceOfSku(sku , statusList, skupTypes))
&& leastPrice.compareTo(soldProduct.getPrice())<=0;
&& leastPrice.compareTo(soldProduct.getPrice())>=0;
Supplier<SendMessageRspBo> pushSupplier = null;
if (pushEnable){
List<Integer> uids = bidProductProxyService.getAllUidBySku(sku);
... ... @@ -201,11 +201,11 @@ public class SellerNoticeFacade extends BaseNoticeFacade {
List<Integer> statusList = Lists.newArrayList(SkupStatus.CAN_SELL.getCode());
Set<Integer> skupTypes = Sets.newHashSet(skupType.getCode());
Integer sku = tsog.getStorageId();
BigDecimal leastPrice;
BigDecimal leastPrice = null;
//卖家的现货出价是否是全网最低价
boolean pushEnable = skupType.equals(SkupType.IN_STOCK)
&& Objects.nonNull(leastPrice=skupService.getLeastPriceOfSku(sku , statusList, skupTypes))
&& leastPrice.compareTo(tsog.getGoodsPrice())<=0;
&& leastPrice.compareTo(tsog.getGoodsPrice())>=0;
Supplier pushSupplier = null;
if (pushEnable){
List<Integer> uids = bidProductProxyService.getAllUidBySku(sku);
... ...