p2p导入逻辑验证

This commit is contained in:
wangxin
2018-10-23 20:31:29 +08:00
parent 131314d2fd
commit affa66f09e

View File

@@ -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<SysDataDictionaryItem> 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<SysDataDictionaryItem> 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(",")) {