p2p导入逻辑验证
This commit is contained in:
@@ -838,6 +838,22 @@ public class BaseController {
|
|||||||
BaseStringCfg baseStringCfg = new BaseStringCfg();
|
BaseStringCfg baseStringCfg = new BaseStringCfg();
|
||||||
BeanUtils.copyProperties(list.get(i), baseStringCfg);
|
BeanUtils.copyProperties(list.get(i), baseStringCfg);
|
||||||
if (regionDict.getRegionType().equals(2)) {
|
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();
|
String keyword=baseStringCfg.getCfgKeywords();
|
||||||
if(StringUtils.isBlank(keyword)) {
|
if(StringUtils.isBlank(keyword)) {
|
||||||
errInfo.append(String.format(prop.getProperty("can_not_null"), prop.getProperty("key_word")+" ")+";");
|
errInfo.append(String.format(prop.getProperty("can_not_null"), prop.getProperty("key_word")+" ")+";");
|
||||||
@@ -895,7 +911,7 @@ public class BaseController {
|
|||||||
}
|
}
|
||||||
has=false;
|
has=false;
|
||||||
}
|
}
|
||||||
|
exprType=baseStringCfg.getExprType();
|
||||||
Integer matchMethod=baseStringCfg.getMatchMethod();
|
Integer matchMethod=baseStringCfg.getMatchMethod();
|
||||||
if(matchMethod==null) {
|
if(matchMethod==null) {
|
||||||
if(matchMethodP.indexOf(",")==-1) {
|
if(matchMethodP.indexOf(",")==-1) {
|
||||||
@@ -903,7 +919,7 @@ public class BaseController {
|
|||||||
throw new RuntimeException("region dict config error,dict id is "+regionDict.getDictId());
|
throw new RuntimeException("region dict config error,dict id is "+regionDict.getDictId());
|
||||||
}
|
}
|
||||||
baseStringCfg.setMatchMethod(Integer.parseInt(matchMethodP));
|
baseStringCfg.setMatchMethod(Integer.parseInt(matchMethodP));
|
||||||
}else if(exprType.intValue()==1){
|
}else if(exprType!=null&&exprType.intValue()==1){
|
||||||
if(matchMethodP.indexOf("0")>-1) {
|
if(matchMethodP.indexOf("0")>-1) {
|
||||||
baseStringCfg.setMatchMethod(0);
|
baseStringCfg.setMatchMethod(0);
|
||||||
}else {
|
}else {
|
||||||
@@ -1091,6 +1107,7 @@ public class BaseController {
|
|||||||
}
|
}
|
||||||
has=false;
|
has=false;
|
||||||
}
|
}
|
||||||
|
exprType=baseStringCfg.getExprType();
|
||||||
Integer matchMethod=baseStringCfg.getMatchMethod();
|
Integer matchMethod=baseStringCfg.getMatchMethod();
|
||||||
if(matchMethod==null) {
|
if(matchMethod==null) {
|
||||||
if(matchMethodP.indexOf(",")==-1) {
|
if(matchMethodP.indexOf(",")==-1) {
|
||||||
@@ -1098,7 +1115,7 @@ public class BaseController {
|
|||||||
throw new RuntimeException("region dict config error,dict id is "+regionDict.getDictId());
|
throw new RuntimeException("region dict config error,dict id is "+regionDict.getDictId());
|
||||||
}
|
}
|
||||||
baseStringCfg.setMatchMethod(Integer.parseInt(matchMethodP));
|
baseStringCfg.setMatchMethod(Integer.parseInt(matchMethodP));
|
||||||
}else if(exprType.intValue()==1){
|
}else if(exprType!=null&&exprType.intValue()==1){
|
||||||
if(matchMethodP.indexOf("0")>-1) {
|
if(matchMethodP.indexOf("0")>-1) {
|
||||||
baseStringCfg.setMatchMethod(0);
|
baseStringCfg.setMatchMethod(0);
|
||||||
}else {
|
}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)) {
|
if (regionDict.getRegionType().equals(1)) {
|
||||||
// 校验必填的IP,端口
|
// 校验必填的IP,端口
|
||||||
/*for (String code : configIpPortShow.split(",")) {
|
/*for (String code : configIpPortShow.split(",")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user