From a8fce86d84f5a77616d401048c631535680c445c Mon Sep 17 00:00:00 2001 From: liyj <1617420630@qq.com> Date: Mon, 20 Oct 2025 15:19:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=80=9D=E8=BF=85=E5=90=8C=E6=AD=A5=E5=BA=93?= =?UTF-8?q?=E5=AD=98=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9=EF=BC=8C=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E9=97=AE=E9=A2=98=E6=89=A3=E5=87=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shop/sync/service/impl/SyncThirdDataServiceImpl.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/SyncThirdDataServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/SyncThirdDataServiceImpl.java index b36b16dd..5471e585 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/SyncThirdDataServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/SyncThirdDataServiceImpl.java @@ -766,7 +766,9 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements @Override public ThirdApiRes getStoreDataRelease(String appKey, String sign) { - // incrProductStockToRedis(new HashMap<>()); +// Map map=new HashMap<>(); +// map.put("33638-DD_20251020_3",-1); +// incrProductStockToRedis(map); if (StrUtil.isBlank(appKey) || StrUtil.isBlank(sign)) { return new ThirdApiRes().fail(1003, I18nUtil._("缺少必要参数!")); } @@ -781,6 +783,7 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements //持久化保存数据到数据库队列 String key=RedisKey.STOREDATARELEASE+":"+syncAppO.getStore_id(); Map redisHash = redisTemplate.opsForHash().entries(key); + logger.info("获取扣减库存数据redisHash:{}",redisHash); List productQuantityConsumptionList=getProductStockFromRedis(syncAppO.getStore_id(),redisHash); List productQuantityConsumptions=new ArrayList<>(); if (!productQuantityConsumptionList.isEmpty()) { @@ -886,6 +889,7 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements @Override public List getProductStockFromRedis(String storeId,Map redisHash) { try { + logger.info("获取redis的库存扣减redisHash:{}",redisHash); // 从 Redis 获取 hash 结构的所有键值对 if (redisHash.isEmpty()) { return Collections.emptyList(); @@ -896,6 +900,8 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements ProductQuantityConsumption productQuantityConsumption=new ProductQuantityConsumption(); String productKey= (String) k; String[] productKeyArrys=productKey.split("-"); + logger.info("productNumber:{}",productKeyArrys[0]); + logger.info("orderId:{}",productKeyArrys[0]); if(productKeyArrys.length!=2){ return; } @@ -918,7 +924,6 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements @Override public void incrProductStockToRedis(Map stockDeltaMap) { - // stockDeltaMap.put("5458", 1); // 校验参数,避免空指针 if (CollectionUtil.isEmpty(stockDeltaMap)) { return;