Merge branch 'develop' of http://10.0.6.99/gwall/gwall.git into develop

This commit is contained in:
zhangwenqing
2018-07-03 18:37:02 +08:00
8 changed files with 95 additions and 13 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

@@ -20,6 +20,7 @@ edit=edit
hi=hi
exit=exit
choose=choose
onloading=onloading...
#============menu begin======================
requestInfo=requestInfo
configuration_manage=configuration manage
@@ -716,4 +717,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

@@ -20,6 +20,7 @@ edit=edit
hi=hi
exit=exit
choose=choose
onloading=onloading...
#============menu begin======================
requestInfo=requestInfo
configuration_manage=configuration manage
@@ -700,4 +701,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

@@ -20,6 +20,7 @@ edit=\u4FEE\u6539
hi=\u4F60\u597D
exit=\u9000\u51FA
choose=\u9009\u62E9
onloading=\u52A0\u8F7D\u4E2D...
#==========menu begin=====================
requestInfo=\u6765\u51FD\u4FE1\u606F
configuration_manage=\u914D\u7F6E\u7BA1\u7406
@@ -808,4 +809,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
@@ -42,10 +42,10 @@
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
},
submitHandler: function(form){
loading('onloading...');
loading('<spring:message code="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

@@ -45,10 +45,10 @@ $(function(){
$("#cfgRegionCode").val($("#cfgRegionCodeMaat").val());
$("#cfgType").val($("#cfgTypeMaat").val());
}
loading('onloading...');
loading('<spring:message code="onloading"/>');
form.submit();
},
errorContainer: "#messageBox",
errorContainer: "#messageBox"
});
});
</script>

View File

@@ -45,7 +45,7 @@ $(function(){
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
},
submitHandler: function(form){
loading('onloading...');
loading('<spring:message code="onloading"/>');
form.submit();
},
errorContainer: "#messageBox",

View File

@@ -56,7 +56,7 @@ $(function(){
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
},
submitHandler: function(form){
loading('onloading...');
loading('<spring:message code="onloading"/>');
form.submit();
},
errorContainer: "#messageBox",