From c0331cd68fbf738b51e5283ed5298b0945a55272 Mon Sep 17 00:00:00 2001 From: liufumingren Date: Tue, 25 Aug 2026 13:09:54 +0800 Subject: [PATCH] =?UTF-8?q?fix(storeWarehouse):=20=E7=AD=96=E7=95=A5?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=E5=90=8E=E5=86=99=E5=85=A5=E5=B9=B6=E5=A4=B1?= =?UTF-8?q?=E6=95=88=E7=AD=BE=E7=BA=A6=E7=AD=96=E7=95=A5=E7=BC=93=E5=AD=98?= =?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8D=E5=A5=87=E9=97=A8=E6=8E=A8=E5=8D=95?= =?UTF-8?q?=E8=AF=BB=E5=8F=96=E6=97=A7=E8=B6=85=E5=8D=96=E5=BF=AB=E7=85=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/systems/store_warehouse.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/service/systems/store_warehouse.js b/app/service/systems/store_warehouse.js index ea24806..7cba590 100644 --- a/app/service/systems/store_warehouse.js +++ b/app/service/systems/store_warehouse.js @@ -407,12 +407,13 @@ class SettingStoreWarehouseService extends Service { transaction, } ); - return; + } else { + await this.app.setCacheAsync(this.getPolicyConfigCacheKey(normalizedId), policyConfig, 86400 * 30); } - await this.app.setCacheAsync(this.getPolicyConfigCacheKey(normalizedId), policyConfig, 86400 * 30); - - // 清除签约策略缓存(sw_policy:{storeId}:{warehouseId}) + // 清除签约策略缓存(sw_policy:{storeId}:{warehouseId}): + // 该缓存内嵌 policy_config 快照与 allowOversell 判定,策略变更(如开启允许超卖)后必须失效, + // 否则奇门推送订单会继续读取旧快照,导致超卖开关生效前仍提示库存不足。 const relation = await this.ctx.model.StoreWarehouse.findByPk(normalizedId, { attributes: [ 'store_id', 'warehouse_id' ], raw: true,