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; }