Commit bfb5a9d0 authored by Administrator's avatar Administrator

1

Signed-off-by: Administrator's avatarAdministrator <admin@example.com>
parent 48eec525
......@@ -408,21 +408,24 @@ public class EnterpriseService {
if (body.isValidateCid()) {
return R.ok();
}
String redisKey = CacheConstants.DATA_FINANCIAL + body.getCid();
List cacheMap = RedisUtils.getCacheList(redisKey);
if (ObjectUtil.isNotEmpty(cacheMap)) {
return R.ok(cacheMap);
}
// TODO 缓存需要
// String redisKey = CacheConstants.DATA_FINANCIAL + body.getCid();
// List cacheMap = RedisUtils.getCacheList(redisKey);
// if (ObjectUtil.isNotEmpty(cacheMap)) {
// return R.ok(cacheMap);
// }
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterprise/financialData", BeanUtil.beanToMap(body, false, false));
Integer code = MapUtils.getInteger(map, "code", 300);
if (!code.equals(HttpStatus.OK.value())) {
throw new RuntimeException();
}
Object data = map.get("data");
if (ObjectUtil.isNotEmpty(data)) {
RedisUtils.setCacheList(redisKey, (List) data);
RedisUtils.expire(redisKey, Duration.ofHours(24));
}
// Object data = map.get("data");
// if (ObjectUtil.isNotEmpty(data)) {
// RedisUtils.setCacheList(redisKey, (List) data);
// RedisUtils.expire(redisKey, Duration.ofHours(24));
// }
return BeanUtil.toBean(map, R.class);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment