Authored by chenjian

下单防变价锁应放置在seller_order_goods查询之前

... ... @@ -433,11 +433,6 @@ public class ShoppingServiceImpl implements IShoppingService {
}
BusinessClientEnum businessClientEnum = OrderAssist.findBusinessClient(shoppingRequest.getBusinessClient());
shoppingRiskWatchDog.checkWaitingPayCnt(uid, businessClientEnum);
// 检查skup是否可售
SellerOrderGoods psog = checkSkupSellOrNot(uid, shoppingRequest.getSkup());
GoodsPrepareData goodsPrepareData = checkSkupExtraWithlock(uid, psog, true);
checkSkupIsChangePrice(uid, skup); //这个变价检查针对个人卖家
//加锁,针对入驻卖家,变价同时买家下单,并发导致的卖家价格跟买家价格不一致(入驻卖家可利用此点套利)
RedisLock skupPriceLock = redisLockFactory.newLock(CacheKeyBuilder.skupPriceLockKey(skup), ExpiredTime.SKUP_PRICE_LOCK_SECONDS, TimeUnit.SECONDS);
... ... @@ -447,6 +442,12 @@ public class ShoppingServiceImpl implements IShoppingService {
throw new UfoServiceException(400, "卖家正在调整商品价格,请稍后下单");
}
// 检查skup是否可售
SellerOrderGoods psog = checkSkupSellOrNot(uid, shoppingRequest.getSkup());
GoodsPrepareData goodsPrepareData = checkSkupExtraWithlock(uid, psog, true);
checkSkupIsChangePrice(uid, skup); //这个变价检查针对个人卖家
//活动价格
ActivityPrice activityPrice = checkAndGetActivityPrice(shoppingRequest, psog);
... ...