From affa66f09e4b1870dc593f56d7e5cb0dab78701b Mon Sep 17 00:00:00 2001 From: wangxin Date: Tue, 23 Oct 2018 20:31:29 +0800 Subject: [PATCH] =?UTF-8?q?p2p=E5=AF=BC=E5=85=A5=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nis/web/controller/BaseController.java | 37 +++++++++++++++++-- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index 4ae6569f0..670a7a625 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -838,6 +838,22 @@ public class BaseController { BaseStringCfg baseStringCfg = new BaseStringCfg(); BeanUtils.copyProperties(list.get(i), baseStringCfg); if (regionDict.getRegionType().equals(2)) { + if(regionDict.getFunctionId().equals(510) && "p2p_hash".equals(regionDict.getConfigServiceType())){ + String userRegion1=baseStringCfg.getUserRegion1(); + if(StringUtils.isNotBlank(userRegion1)) { + List hashs=DictUtils.getDictList("P2P_HASH_TYPE"); + boolean has=false; + for(SysDataDictionaryItem hash:hashs) { + if(hash.getItemCode().equals(userRegion1)) { + has=true; + break; + } + } + if(!has) { + errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("p2p_hash_type")+" ")+";"); + } + } + } String keyword=baseStringCfg.getCfgKeywords(); if(StringUtils.isBlank(keyword)) { errInfo.append(String.format(prop.getProperty("can_not_null"), prop.getProperty("key_word")+" ")+";"); @@ -895,7 +911,7 @@ public class BaseController { } has=false; } - + exprType=baseStringCfg.getExprType(); Integer matchMethod=baseStringCfg.getMatchMethod(); if(matchMethod==null) { if(matchMethodP.indexOf(",")==-1) { @@ -903,7 +919,7 @@ public class BaseController { throw new RuntimeException("region dict config error,dict id is "+regionDict.getDictId()); } baseStringCfg.setMatchMethod(Integer.parseInt(matchMethodP)); - }else if(exprType.intValue()==1){ + }else if(exprType!=null&&exprType.intValue()==1){ if(matchMethodP.indexOf("0")>-1) { baseStringCfg.setMatchMethod(0); }else { @@ -1091,6 +1107,7 @@ public class BaseController { } has=false; } + exprType=baseStringCfg.getExprType(); Integer matchMethod=baseStringCfg.getMatchMethod(); if(matchMethod==null) { if(matchMethodP.indexOf(",")==-1) { @@ -1098,7 +1115,7 @@ public class BaseController { throw new RuntimeException("region dict config error,dict id is "+regionDict.getDictId()); } baseStringCfg.setMatchMethod(Integer.parseInt(matchMethodP)); - }else if(exprType.intValue()==1){ + }else if(exprType!=null&&exprType.intValue()==1){ if(matchMethodP.indexOf("0")>-1) { baseStringCfg.setMatchMethod(0); }else { @@ -1268,6 +1285,20 @@ public class BaseController { } } } + if(regionDict.getFunctionId().equals(510) && "p2p_ip".equals(regionDict.getConfigServiceType())){ //P2p IP + String userRegion1=baseIpCfg.getUserRegion1(); + List ipTypes=DictUtils.getDictList("P2P_IP_TYPE"); + boolean has=false; + for(SysDataDictionaryItem type:ipTypes) { + if(type.getItemCode().equals(userRegion1)) { + has=true; + break; + } + } + if(!has) { + errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("p2p_ip_config_type"))+";"); + } + } if (regionDict.getRegionType().equals(1)) { // 校验必填的IP,端口 /*for (String code : configIpPortShow.split(",")) {