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 { ...@@ -408,21 +408,24 @@ public class EnterpriseService {
if (body.isValidateCid()) { if (body.isValidateCid()) {
return R.ok(); return R.ok();
} }
String redisKey = CacheConstants.DATA_FINANCIAL + body.getCid(); // TODO 缓存需要
List cacheMap = RedisUtils.getCacheList(redisKey); // String redisKey = CacheConstants.DATA_FINANCIAL + body.getCid();
if (ObjectUtil.isNotEmpty(cacheMap)) { // List cacheMap = RedisUtils.getCacheList(redisKey);
return R.ok(cacheMap); // if (ObjectUtil.isNotEmpty(cacheMap)) {
} // return R.ok(cacheMap);
// }
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterprise/financialData", BeanUtil.beanToMap(body, false, false)); Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterprise/financialData", BeanUtil.beanToMap(body, false, false));
Integer code = MapUtils.getInteger(map, "code", 300); Integer code = MapUtils.getInteger(map, "code", 300);
if (!code.equals(HttpStatus.OK.value())) { if (!code.equals(HttpStatus.OK.value())) {
throw new RuntimeException(); throw new RuntimeException();
} }
Object data = map.get("data");
if (ObjectUtil.isNotEmpty(data)) { // Object data = map.get("data");
RedisUtils.setCacheList(redisKey, (List) data); // if (ObjectUtil.isNotEmpty(data)) {
RedisUtils.expire(redisKey, Duration.ofHours(24)); // RedisUtils.setCacheList(redisKey, (List) data);
} // RedisUtils.expire(redisKey, Duration.ofHours(24));
// }
return BeanUtil.toBean(map, R.class); 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