添加清理asn号缓存的方法

This commit is contained in:
wangxin
2018-11-21 17:22:59 +08:00
parent 52c2f490cd
commit 3cf0ac91b3
3 changed files with 16 additions and 2 deletions

View File

@@ -48,6 +48,7 @@ public class AsnCacheUtils{
return (Map<Long,ConfigGroupInfo>)element.getObjectValue();
}
public static void clearCache() {
logger.warn("clear cache!");
CacheUtils.getCacheManager().removeCache(ASN_NO_CACHE);
}
/**
@@ -147,4 +148,9 @@ public class AsnCacheUtils{
}
return cache;
}
public static String getCacheName() {
return ASN_NO_CACHE;
}
}

View File

@@ -14,6 +14,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.nis.domain.Page;
import com.nis.domain.SysDataDictionaryName;
import com.nis.util.AsnCacheUtils;
import com.nis.util.CacheUtils;
import com.nis.util.Constants;
import com.nis.util.StringUtil;
@@ -104,8 +105,12 @@ public class DictController extends BaseController {
@ResponseBody
@RequestMapping(value = {"refreshCache"})
public String refreshCache(String cacheName){
//删除字典缓存
CacheUtils.remove(cacheName);
if(cacheName.equals(AsnCacheUtils.getCacheName())) {
AsnCacheUtils.clearCache();
}else {
//删除字典缓存
CacheUtils.remove(cacheName);
}
return "success";
}

View File

@@ -329,6 +329,9 @@ background:#3d3d3d;
<li>
<a href="javascript:refreshCache('functionRegionDict')">refresh function region</a>
</li>
<li>
<a href="javascript:refreshCache('asnNoCache')">refresh ASN no</a>
</li>
</ul>
</li>
</c:if>