From 71a2b5acb851f7a471e2e899e8bbe323c0e1d9f0 Mon Sep 17 00:00:00 2001 From: liyj <1617420630@qq.com> Date: Mon, 20 Oct 2025 11:20:27 +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?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shop/sync/service/impl/SyncThirdDataServiceImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 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 55006bbf..b36b16dd 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 @@ -780,7 +780,7 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements } //持久化保存数据到数据库队列 String key=RedisKey.STOREDATARELEASE+":"+syncAppO.getStore_id(); - Map redisHash = redisTemplate.opsForHash().entries(key); + Map redisHash = redisTemplate.opsForHash().entries(key); List productQuantityConsumptionList=getProductStockFromRedis(syncAppO.getStore_id(),redisHash); List productQuantityConsumptions=new ArrayList<>(); if (!productQuantityConsumptionList.isEmpty()) { @@ -884,7 +884,7 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements @Override - public List getProductStockFromRedis(String storeId,Map redisHash) { + public List getProductStockFromRedis(String storeId,Map redisHash) { try { // 从 Redis 获取 hash 结构的所有键值对 if (redisHash.isEmpty()) { @@ -894,7 +894,8 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements List productQuantityConsumptionList=new ArrayList<>(); redisHash.forEach((k, v)->{ ProductQuantityConsumption productQuantityConsumption=new ProductQuantityConsumption(); - String[] productKeyArrys=k.split("-"); + String productKey= (String) k; + String[] productKeyArrys=productKey.split("-"); if(productKeyArrys.length!=2){ return; }