(1)域名通用页面页面标题替换

(2)Ip配置导入增加来函,分类性质标签验证
This commit is contained in:
wangxin
2018-07-03 17:16:54 +08:00
parent 0c64250fa4
commit 7c70417d4c
6 changed files with 88 additions and 9 deletions

View File

@@ -661,15 +661,88 @@ public class BaseController {
errInfo.append(String.format(prop.getProperty("can_not_null"), prop.getProperty("direction"))+";");
}
//protocol check end
// requestId check start
Integer requestId=value.getRequestId();
if(requestId==null){
errInfo.append(String.format(prop.getProperty("can_not_null"), prop.getProperty("letter"))+";");
}else{//查询数据库是否存在ID
RequestInfo info=requestInfoService.getRequestInfoById((long)requestId.intValue());
if(info==null){
errInfo.append(String.format(prop.getProperty("id_not_exists"),requestId, prop.getProperty("letter"))+";");
}else if(info.getIsValid()==Constants.VALID_NO||info.getIsValid()==Constants.VALID_DEL){
errInfo.append(String.format(prop.getProperty("id_not_valid"),requestId, prop.getProperty("letter"))+";");
}
}
// requestId check end
//classification check start
String classification=value.getClassify();
if(StringUtils.isNotBlank(classification)){
try{
for(String classify:classification.split(",")){
if(StringUtils.isNotBlank(classify)){
int c=Integer.parseInt(classify);
ServiceDictInfo dict=serviceDictInfoService.getDictById(c);
if(dict==null){
errInfo.append(String.format(prop.getProperty("id_not_exists"),classify, prop.getProperty("classification"))+";");
}else if(dict.getIsValid()==Constants.VALID_NO||dict.getIsValid()==Constants.VALID_DEL){
errInfo.append(String.format(prop.getProperty("id_not_valid"),classify, prop.getProperty("classification"))+";");
}
}
}
}catch (Exception e) {
// TODO: handle exception
errInfo.append(String.format(prop.getProperty("num_split_by_comma"), prop.getProperty("classification"))+";");
}
}
//classification check end
//attribute check start
String attributes=value.getAttribute();
if(StringUtils.isNotBlank(attributes)){
try{
for(String attribute:attributes.split(",")){
if(StringUtils.isNotBlank(attribute)){
int c=Integer.parseInt(attribute);
ServiceDictInfo dict=serviceDictInfoService.getDictById(c);
if(dict==null){
errInfo.append(String.format(prop.getProperty("id_not_exists"),attribute, prop.getProperty("attribute"))+";");
}else if(dict.getIsValid()==Constants.VALID_NO||dict.getIsValid()==Constants.VALID_DEL){
errInfo.append(String.format(prop.getProperty("id_not_valid"),attribute, prop.getProperty("attribute"))+";");
}
}
}
}catch (Exception e) {
// TODO: handle exception
errInfo.append(String.format(prop.getProperty("num_split_by_comma"), prop.getProperty("attribute"))+";");
}
}
//attribute check end
//attribute check start
String labels=value.getLable();
if(StringUtils.isNotBlank(labels)){
try{
for(String label:labels.split(",")){
if(StringUtils.isNotBlank(label)){
int c=Integer.parseInt(label);
ServiceDictInfo dict=serviceDictInfoService.getDictById(c);
if(dict==null){
errInfo.append(String.format(prop.getProperty("id_not_exists"),label, prop.getProperty("label"))+";");
}else if(dict.getIsValid()==Constants.VALID_NO||dict.getIsValid()==Constants.VALID_DEL){
errInfo.append(String.format(prop.getProperty("id_not_valid"),label, prop.getProperty("label"))+";");
}
}
}
}catch (Exception e) {
// TODO: handle exception
errInfo.append(String.format(prop.getProperty("num_split_by_comma"), prop.getProperty("label"))+";");
}
}
//attribute check end
if(StringUtils.isNotBlank(errInfo.toString())){
msg.append(lineStart).append(errInfo);
if(line<list.size()){
msg.append("<br/>");
}
}
// requestId check start
Integer requestId=value.getRequestId();
// requestId check end
line++;
}
if(StringUtils.isNotBlank(msg.toString())){

View File

@@ -716,4 +716,6 @@ are_the_same=%s and %s are the same
is_in_wrong_format=%s is in wrong format
must_between=must between %s and %s
not_number=%s is not a number
id_not_exists=the id %s of %s is not valid
num_split_by_comma=%s must be numbers split by comma
#=============some validation===========

View File

@@ -700,4 +700,6 @@ are_the_same=%s and %s are the same
is_in_wrong_format=%s is in wrong format
must_between=must between %s and %s
not_number=%s is not a number
id_not_exists=the id %s of %s is not valid
num_split_by_comma=%s must be numbers split by comma
#=============some validation===========

View File

@@ -808,4 +808,7 @@ NTC_MAIL_BODY=\u5185\u5BB9\u5173\u952E\u5B57\u914D\u7F6E
NTC_FILE_DIGEST=\u6587\u4EF6\u6458\u8981\u914D\u7F6E
NTC_FTP_URL=URL\u914D\u7F6E
FTP_CONTENT=\u5185\u5BB9\u5173\u952E\u5B57\u914D\u7F6E
id_not_exists=id\u4E3A%s\u7684%s\u4E0D\u5B58\u5728
id_not_valid=id\u4E3A%s\u7684%s\u65E0\u6548
num_split_by_comma=%s\u4E3A\u9017\u53F7\u5206\u9694\u7684\u6570\u5B57
#=============region_value,config form title=================

View File

@@ -2,7 +2,7 @@
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<title><spring:message code="domain_intercept"></spring:message></title>
<title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript">
$(function() {
if ($("input[name='action']:checked").val() == 0x20
@@ -45,7 +45,7 @@
loading('onloading...');
form.submit();
},
errorContainer: "#messageBox",
errorContainer: "#messageBox"
});
});
@@ -60,7 +60,7 @@
<div class="page-content">
<h3 class="page-title">
<spring:message code="domain_intercept"></spring:message>
<spring:message code="${cfgName}"></spring:message>
</h3>
<div class="row">
@@ -79,8 +79,7 @@
</div>
<div class="portlet-body form">
<!-- BEGIN FORM-->
<form id="cfgFrom"
action="${ctx}${urlPrefix}/saveOrUpdate" method="post"
<form id="cfgFrom" action="${ctx}${urlPrefix}/saveOrUpdate" method="post"
class="form-horizontal">
<input type="hidden" name="cfgName" value="${cfgName}">
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">

View File

@@ -48,7 +48,7 @@ $(function(){
loading('onloading...');
form.submit();
},
errorContainer: "#messageBox",
errorContainer: "#messageBox"
});
});
</script>