Merge branch 'develop' of http://192.168.10.125/k18_web/NFS.git into develop
This commit is contained in:
@@ -6,6 +6,7 @@ import java.util.Map.Entry;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.beust.jcommander.internal.Lists;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.web.dao.specific.ConfigGroupInfoDao;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
@@ -48,8 +49,21 @@ public class AsnCacheUtils{
|
||||
return (Map<Long,ConfigGroupInfo>)element.getObjectValue();
|
||||
}
|
||||
public static void clearCache() {
|
||||
logger.warn("clear cache!");
|
||||
CacheUtils.getCacheManager().removeCache(ASN_NO_CACHE);
|
||||
}
|
||||
public static List<ConfigGroupInfo> getAllAsnGroup(){
|
||||
List<ConfigGroupInfo> configGroupInfos=Lists.newArrayList();
|
||||
Cache cache=getCache(ASN_NO_CACHE);
|
||||
for(Object key:cache.getKeys()) {
|
||||
Element element = getCache(ASN_NO_CACHE).get(key);
|
||||
if(element!=null) {
|
||||
Map<Long,ConfigGroupInfo> map=(Map<Long,ConfigGroupInfo>)element.getObjectValue();
|
||||
configGroupInfos.addAll(map.values());
|
||||
}
|
||||
}
|
||||
return configGroupInfos;
|
||||
}
|
||||
/**
|
||||
* 初始化缓存
|
||||
*/
|
||||
@@ -147,4 +161,9 @@ public class AsnCacheUtils{
|
||||
}
|
||||
return cache;
|
||||
}
|
||||
public static String getCacheName() {
|
||||
return ASN_NO_CACHE;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ArrayBlockingQueue;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
|
||||
@@ -76,7 +77,7 @@ public class ImportBigExcel extends XLSXCovertCSVReader{
|
||||
*/
|
||||
public ImportBigExcel(MultipartFile multipartFile, Integer headerNum, int sheetIndex)
|
||||
throws InvalidFormatException, IOException {
|
||||
File upFile=new File(System.currentTimeMillis()+multipartFile.getOriginalFilename());
|
||||
File upFile=new File(UUID.randomUUID()+"_"+multipartFile.getOriginalFilename());
|
||||
upFile.mkdirs();
|
||||
multipartFile.transferTo(upFile);
|
||||
if (!upFile.exists()){
|
||||
|
||||
@@ -116,7 +116,7 @@ public class CheckIpFormatThread implements Callable<String>{
|
||||
}
|
||||
if (!has) {
|
||||
errInfo.append(prop.getProperty("ratelimit") + "."
|
||||
+ String.format(prop.getProperty("must_between"), 0.001, 0.009) + ";");
|
||||
+ String.format(prop.getProperty("must_between"), 0.1, 0.9) + ";");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
@@ -198,11 +198,11 @@ public class CheckIpFormatThread implements Callable<String>{
|
||||
//p2p ip
|
||||
if (regionDict.getFunctionId().equals(510) && "p2p_ip".equals(regionDict.getConfigServiceType())) { // P2p
|
||||
// IP
|
||||
String userRegion1 = baseIpCfg.getUserRegion1();
|
||||
String userRegion2 = baseIpCfg.getUserRegion2();
|
||||
List<SysDataDictionaryItem> ipTypes = DictUtils.getDictList("P2P_IP_TYPE");
|
||||
boolean has = false;
|
||||
for (SysDataDictionaryItem type : ipTypes) {
|
||||
if (type.getItemCode().equals(userRegion1)) {
|
||||
if (type.getItemCode().equals(userRegion2)) {
|
||||
has = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ public class HttpClientUtil {
|
||||
* @param params 参数列表
|
||||
* @return 查询结果数据json
|
||||
*/
|
||||
public static String getMsg(String destUrl, Map<String, Object> params, HttpServletRequest req) {
|
||||
public static String getMsg(String destUrl, Map<String, Object> params, HttpServletRequest req) throws IOException {
|
||||
// RequestContext requestContext = new RequestContext(req);
|
||||
|
||||
// CloseableHttpResponse response = null;
|
||||
@@ -296,7 +296,11 @@ public class HttpClientUtil {
|
||||
logger.error("获取消息失败,相应内容如下: " + result);
|
||||
logger.error("获取消息失败 ", e);
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:");
|
||||
}
|
||||
}finally {
|
||||
if (response != null) {
|
||||
response.close();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user