Commit 24e8a5a1 authored by 赵啸非's avatar 赵啸非

添加区域树结构

parent 8faad652
......@@ -36,13 +36,19 @@ public class AreaServiceImpl extends AbstractCRUDCacheServiceImpl<AreaDao, AreaE
super.putCache(key, data);
//加载孩子关系
if ("True".equalsIgnoreCase(data.getHaveSonArea())) {
List<AreaEntity> collect = this.find(new AreaQuery().pid(data.getIid())).stream().collect(Collectors.toList());
String childKey = super.getCacheName() + ":" + key;
cacheService.del(childKey);
cacheService.lpush(childKey, collect);
this.find(new AreaQuery().pid(data.getIid())).stream().forEach(item->{
cacheService.lpush(childKey, item);
});
}
}
@Override
public void loadCache() {
super.loadCache();
}
@Override
protected String getExtKey(AreaEntity data) {
return data.getAreaCode();
......
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