Commit 8427e455 authored by 赵啸非's avatar 赵啸非

添加区域树结构

parent 891b5626
...@@ -36,10 +36,12 @@ public class AreaServiceImpl extends AbstractCRUDCacheServiceImpl<AreaDao, AreaE ...@@ -36,10 +36,12 @@ public class AreaServiceImpl extends AbstractCRUDCacheServiceImpl<AreaDao, AreaE
public void putCache(String key, AreaEntity data) { public void putCache(String key, AreaEntity data) {
super.putCache(key, data); super.putCache(key, data);
//加载孩子关系 //加载孩子关系
List<Long> collect = this.find(new AreaQuery().pid(data.getIid())).stream().map(AreaEntity::getId).collect(Collectors.toList()); if("True".equalsIgnoreCase(data.getHaveSonArea())){
String childKey = super.getCacheName() + ":" + key + ":children"; List<Long> collect = this.find(new AreaQuery().pid(data.getIid())).stream().map(AreaEntity::getId).collect(Collectors.toList());
cacheService.del(childKey); String childKey = super.getCacheName() + ":" + key;
cacheService.lpush(childKey,collect); cacheService.del(childKey);
cacheService.lpush(childKey,collect);
}
} }
@Override @Override
......
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