Browse Source

修改downloadTemplate接口的缓存处理

baihua 2 weeks ago
parent
commit
9fbae33019

+ 14 - 14
blade-service/blade-factory/src/main/java/org/springblade/factory/service/impl/ZcrmViewCustomerSelServiceImpl.java

@@ -47,26 +47,26 @@ public class ZcrmViewCustomerSelServiceImpl extends BaseServiceImpl<ZcrmViewCust
 			return null;
 		}
 
-		String cacheKey = "customer:sel:" + customerId;
-		System.out.println(cacheKey);
-		// 先从缓存获取
-		if (bladeRedis.get(cacheKey) != null) {
-			String viewCustomerSelString = bladeRedis.get(cacheKey);
-			// 将JSON字符串转换为对象
-			return JSON.parseObject(viewCustomerSelString, ViewCustomerSel.class);
-		}
+//		String cacheKey = "customer:sel:" + customerId;
+//		System.out.println(cacheKey);
+//		// 先从缓存获取
+//		if (bladeRedis.get(cacheKey) != null) {
+//			String viewCustomerSelString = bladeRedis.get(cacheKey);
+//			// 将JSON字符串转换为对象
+//			return JSON.parseObject(viewCustomerSelString, ViewCustomerSel.class);
+//		}
 
 		// 缓存未命中则查询数据库
 		QueryWrapper<ViewCustomerSel> queryWrapper = new QueryWrapper<>();
 		queryWrapper.eq("Customer_ID", customerId);
 		ViewCustomerSel customerSel = this.getOne(queryWrapper);
 
-		// 查询结果不为空则存入缓存
-		if (customerSel != null) {
-			// 将对象转换为JSON字符串存储
-			String customerSelJson = JSON.toJSONString(customerSel);
-			bladeRedis.set(cacheKey, customerSelJson);
-		}
+//		// 查询结果不为空则存入缓存
+//		if (customerSel != null) {
+//			// 将对象转换为JSON字符串存储
+//			String customerSelJson = JSON.toJSONString(customerSel);
+//			bladeRedis.set(cacheKey, customerSelJson);
+//		}
 
 		return customerSel;
 	}