...
|
...
|
@@ -47,12 +47,14 @@ public class BasicDataCacheService { |
|
|
private static final String TBL_SITE_CACHE_KEY = "tblSite";
|
|
|
private static final String TBL_SORT_RELATION_CACHE_KEY = "tblSortRelation";
|
|
|
private static final String TBL_BRAND_RELATION_CACHE_KEY = "tblBrandRelation";
|
|
|
private static final String TBL_BRAND_RELATION_REVERSE_CACHE_KEY = "tblBrandRelationReverse";
|
|
|
//UFO
|
|
|
private static final String UFO_BRAND_CACHE_KEY = "ufoBrand";
|
|
|
private static final String UFO_BRAND_SERIES_CACHE_KEY = "ufoBrandSeries";
|
|
|
private static final String UFO_SIZE_CACHE_KEY = "ufoSize";
|
|
|
private static final String UFO_BRAND_RELATION_CACHE_KEY = "ufoBrandRelation";
|
|
|
private static final String UFO_SORT_RELATION_CACHE_KEY = "ufoSortRelation";
|
|
|
private static final String UFO_SORT_RELATION_REVERSE_CACHE_KEY = "ufoSortRelationReverse";
|
|
|
|
|
|
//有货品牌
|
|
|
LoadingCache<String, Map<Integer, Brand>> brandCache = CacheBuilder.newBuilder()
|
...
|
...
|
@@ -398,6 +400,28 @@ public class BasicDataCacheService { |
|
|
}
|
|
|
|
|
|
|
|
|
//TBL品牌映射-反向
|
|
|
LoadingCache<String, Map<Integer, Integer>> tblBrandRelationReverseCache = CacheBuilder.newBuilder()
|
|
|
.expireAfterWrite(10, TimeUnit.MINUTES)
|
|
|
.build(new CacheLoader<String, Map<Integer, Integer>>() {
|
|
|
public Map<Integer, Integer> load(String key) {
|
|
|
return basicDataLogicService.getTblRelationMapReverse();
|
|
|
}
|
|
|
});
|
|
|
|
|
|
public Map<Integer, Integer> getTblBrandRelationReverseMap() {
|
|
|
try {
|
|
|
return tblBrandRelationReverseCache.get(TBL_BRAND_RELATION_REVERSE_CACHE_KEY);
|
|
|
} catch (Exception e) {
|
|
|
logger.error(e.getMessage());
|
|
|
return new HashMap<>();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void clearTblBrandRelationReverse() {
|
|
|
tblBrandRelationReverseCache.invalidateAll();
|
|
|
}
|
|
|
|
|
|
//UFO品牌
|
|
|
LoadingCache<String, Map<Short, UfoBrand>> ufoBrandCache = CacheBuilder.newBuilder()
|
|
|
.expireAfterWrite(10, TimeUnit.MINUTES)
|
...
|
...
|
@@ -488,6 +512,28 @@ public class BasicDataCacheService { |
|
|
ufoBrandRelationCache.invalidateAll();
|
|
|
}
|
|
|
|
|
|
//UFO品牌映射-反向
|
|
|
LoadingCache<String, Map<Integer, Integer>> ufoBrandRelationReverseCache = CacheBuilder.newBuilder()
|
|
|
.expireAfterWrite(10, TimeUnit.MINUTES)
|
|
|
.build(new CacheLoader<String, Map<Integer, Integer>>() {
|
|
|
public Map<Integer, Integer> load(String key) {
|
|
|
return basicDataLogicService.getUfoRelationMap();
|
|
|
}
|
|
|
});
|
|
|
|
|
|
public Map<Integer, Integer> getUfoRelationMapReverseMap() {
|
|
|
try {
|
|
|
return ufoBrandRelationReverseCache.get(UFO_SORT_RELATION_REVERSE_CACHE_KEY);
|
|
|
} catch (Exception e) {
|
|
|
logger.error(e.getMessage());
|
|
|
return new HashMap<>();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void clearUfoBrandRelationReverse() {
|
|
|
ufoBrandRelationReverseCache.invalidateAll();
|
|
|
}
|
|
|
|
|
|
//UFO品类映射
|
|
|
LoadingCache<String, Map<Integer, UfoSearchSortRelation>> ufoSortRelationCache = CacheBuilder.newBuilder()
|
|
|
.expireAfterWrite(10, TimeUnit.MINUTES)
|
...
|
...
|
|