(1)特定服务管理UL修改

(2)特定服务管理加入协议号重复验证,有上级配置则上级配置的所有下级配置ID不能重复,无上级配置一级配置ID不能重复
(3)取消jBox的Cookie打印
This commit is contained in:
wangxin
2018-07-30 09:15:36 +08:00
parent 78e47ac599
commit 32b67d31f3
10 changed files with 228 additions and 111 deletions

View File

@@ -250,21 +250,32 @@ public class SpecificServiceCfgController extends BaseController {
* @return * @return
*/ */
@ResponseBody @ResponseBody
@RequestMapping(value = "isIdRepeat") @RequestMapping(value = "isCodeNotRepeat")
public boolean isIdRepeat(String specServiceId,String oldId){ public boolean isIdRepeat(@RequestParam(required=false,value="parentId")Integer parentId,@RequestParam(required=false,value="specServiceId")Integer specServiceId,@RequestParam(required=true,value="specServiceCode")Integer specServiceCode,@RequestParam(required=true,value="cfgType")Integer cfgType){
if(oldId!=null){ if(parentId!=null&&parentId.intValue()!=0) {
if(oldId.trim().equals(specServiceId)){ Integer parentCode=specificServiceCfgService.getParentCode(parentId);
return true; if(parentCode!=null&&parentCode.intValue()==specServiceCode) {
return false;
} }
} }
if(specServiceId!=null){ if(specServiceId!=null){
SpecificServiceCfg ss = specificServiceCfgService.getBySpecServiceId(Integer.valueOf(specServiceId)); SpecificServiceCfg ss = specificServiceCfgService.getBySpecServiceId(Integer.valueOf(specServiceId));
if(ss!=null){
if(ss.getSpecServiceCode().intValue()==specServiceCode.intValue()&&cfgType.intValue()==ss.getCfgType().intValue()) {
return true;
}else {
ss=specificServiceCfgService.getRepeat(specServiceCode, cfgType,parentId);
if(ss==null) {
return true;
}
}
}
}else {
SpecificServiceCfg ss=specificServiceCfgService.getRepeat(specServiceCode, cfgType,parentId);
if(ss==null) { if(ss==null) {
return true; return true;
} }
} }
return false; return false;
} }

View File

@@ -48,5 +48,7 @@ public interface SpecificServiceCfgDao extends CrudDao<SpecificServiceCfg> {
Integer updateConfigGroupInfobyGroupId(ConfigGroupInfo entity); Integer updateConfigGroupInfobyGroupId(ConfigGroupInfo entity);
Integer getParentType(Integer specServiceId); Integer getParentType(Integer specServiceId);
Integer getParentCode(Integer specServiceId);
SpecificServiceCfg getRepeat(@Param("specServiceCode")Integer code, @Param("cfgType")Integer cfgType,@Param("parentId")Integer parentId);
} }

View File

@@ -37,10 +37,21 @@
select <include refid="specificServiceCfgColumns" /> select <include refid="specificServiceCfgColumns" />
from specific_service_cfg s where s.spec_service_id = #{specServiceId} from specific_service_cfg s where s.spec_service_id = #{specServiceId}
</select> </select>
<select id="getRepeat" resultType="com.nis.domain.specific.SpecificServiceCfg" >
select <include refid="specificServiceCfgColumns" />
from specific_service_cfg s where s.spec_service_code = #{specServiceCode} and s.cfg_type=#{cfgType} and s.is_valid=1
<if test="parentId != null and parentId !=''">
and parent_id= #{parentId}
</if>
</select>
<select id="getParentType" resultType="java.lang.Integer" parameterType="java.lang.Integer"> <select id="getParentType" resultType="java.lang.Integer" parameterType="java.lang.Integer">
select cfg_type select cfg_type
from specific_service_cfg s where s.spec_service_id = #{specServiceId} from specific_service_cfg s where s.spec_service_id = #{specServiceId}
</select> </select>
<select id="getParentCode" resultType="java.lang.Integer" parameterType="java.lang.Integer">
select spec_service_code
from specific_service_cfg s where s.spec_service_id = #{specServiceId}
</select>
<!-- 查出所有符合条件的顶层数据 --> <!-- 查出所有符合条件的顶层数据 -->

View File

@@ -143,5 +143,11 @@ public class SpecificServiceCfgService extends BaseService{
public Integer getParentType(Integer specServiceId) { public Integer getParentType(Integer specServiceId) {
return specificServiceCfgDao.getParentType(specServiceId); return specificServiceCfgDao.getParentType(specServiceId);
} }
public Integer getParentCode(Integer specServiceId) {
return specificServiceCfgDao.getParentCode(specServiceId);
}
public SpecificServiceCfg getRepeat (Integer code,Integer cfgType,Integer parentId) {
return specificServiceCfgDao.getRepeat(code,cfgType,parentId);
}
} }

View File

@@ -3,6 +3,11 @@
<html> <html>
<head> <head>
<title></title> <title></title>
<style type="text/css">
.tabbable-custom > .tab-content {
margin-top:-121px;
}
</style>
<script type="text/javascript"> <script type="text/javascript">
var validateForm; var validateForm;
$(document).ready(function() { $(document).ready(function() {
@@ -23,16 +28,34 @@
$("#name").focus(); $("#name").focus();
validateForm = $("#inputForm").validate({ validateForm = $("#inputForm").validate({
/* rules:{ rules:{
specServiceId:{ /* specServiceCode:{
remote:'${ctx}/specific/specificServiceCfg/isIdRepeat?oldId=${specificServiceCfg.specServiceId}' remote:{
url:"${ctx}/specific/specificServiceCfg/isCodeNotRepeat",
type:"post",
//dataType:"json",
//contentType:"application/json; charset=utf-8",
data:{
parentId:function(){
return $("[name='parent.specServiceId']").val();
},
specServiceCode:function(){
return $("#specServiceCode").val();
},
cfgType:function(){
return $("[name='cfgType']").val();
},
specServiceId:'${specificServiceCfg.specServiceId}'
} }
}
} */
}, },
messages: { messages: {
specServiceId:{ /* specServiceCode:{
remote:'<spring:message code="repeat"/>' remote:'<spring:message code="repeat"/>'
} } */
}, */
},
submitHandler: function(form){ submitHandler: function(form){
if(!validateForm.form()) { if(!validateForm.form()) {
@@ -51,42 +74,61 @@
} }
} }
}); });
if("${specificServiceCfg.parentType}"){ //if("${specificServiceCfg.parentType}"){
$("[name=cfgType]").each(function(){ // $("[name=cfgType]").each(function(){
$(this).attr("parent-type","${specificServiceCfg.parentType}"); // $(this).attr("parent-type","${specificServiceCfg.parentType}");
// });
//}
if(!$("[name='cfgType']").val()){
$("[name='cfgType']").val(1);
$(".cfgType").each(function(){
if($(this).attr("cfgType")!=1){
$(this).addClass("hidden");
$(this).find("[name='parent.specServiceId']").removeAttr("name");
$(this).find("[name='parent.specServiceName']").removeAttr("name");
}
if($(this).attr("cfgType")==3){
$(this).find("input").unbind("click");
}
});
}else{
$(".cfgType").each(function(){
if($(this).attr("cfgType")!=$("[name='cfgType']").val()){
$(this).addClass("hidden");
$(this).find("[name='parent.specServiceId']").removeAttr("name");
$(this).find("[name='parent.specServiceName']").removeAttr("name");
}
if($(this).attr("cfgType")==3){
$(this).find("input").unbind("click");
}
}); });
} }
$("#specificServiceCfgId").on("change",function(){ $(".tabs-left li").on("click",function(){
var data=$(this).attr("cfgtype"); var cfgType=$(this).attr("cfgType");
if(data!=0){ $("[name=cfgType]").val(cfgType);
$("[name=cfgType]").each(function(){ $(".cfgType").each(function(){
$(this).attr("parent-type",data); if($(this).attr("cfgType")==cfgType){
if($(this).val()==data){ $(this).removeClass("hidden");
$(this).click(); $("#specificServiceCfg"+cfgType+"Id").attr("name","parent.specServiceId");
} }else{
}) $(this).addClass("hidden").addClass("disable");
$(this).find("[name='parent.specServiceId']").removeAttr("name");
$(this).find("[name='parent.specServiceName']").removeAttr("name");
} }
}); });
}); });
});
</script> </script>
</head> </head>
<body> <body>
<div class="page-content"> <div class="page-content">
<div class="theme-panel hidden-xs hidden-sm"> <div class="theme-panel hidden-xs hidden-sm">
<button type="button" class="btn btn-default" onclick="history.go(-1)"><spring:message code="back"/></button> <button type="button" class="btn btn-default" onclick="history.go(-1)"><spring:message code="back"/></button>
</div> </div>
<h3 class="page-title"> <h3 class="page-title">
<spring:message code="specific_service_cfg"/> <spring:message code="specific_service_cfg"/>
</h3> </h3>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="portlet box blue"> <div class="portlet box blue">
@@ -100,29 +142,47 @@
<a href="javascript:;" class="remove"> </a> --> <a href="javascript:;" class="remove"> </a> -->
</div> </div>
</div> </div>
<div class="portlet-body form"> <div class="portlet-body form">
<div class="form-body">
<!-- BEGIN FORM--> <!-- BEGIN FORM-->
<form:form id="inputForm" modelAttribute="specificServiceCfg" action="${ctx}/specific/specificServiceCfg/saveOrUpdate" method="post" class="form-horizontal"> <form:form id="inputForm" modelAttribute="specificServiceCfg" action="${ctx}/specific/specificServiceCfg/saveOrUpdate" method="post" class="form-horizontal">
<input name="specServiceId" type="hidden" value="${specificServiceCfg.specServiceId}"/> <input name="specServiceId" type="hidden" value="${specificServiceCfg.specServiceId}"/>
<input name="cfgType" type="hidden" value="${specificServiceCfg.cfgType}"/>
<form:hidden path="isValid" class="form-control"/> <form:hidden path="isValid" class="form-control"/>
<sys:message content="${message}"/> <div class="form-body">
<div class="form-group"> <div class="portlet-body flip-scroll">
<div class="row-fluid">
<div class="span12">
<div class="tabbable tabbable-custom tabs-left">
<ul class="nav nav-tabs tabs-left">
<c:forEach items="${fns:getDictList('SPECIFIC_SERVICE_CFG_TYPE') }" var="dict">
<li class="<c:if test="${(specificServiceCfg.specServiceId ==null and dict.itemCode==1) or specificServiceCfg.cfgType eq dict.itemCode}">active</c:if>" cfgType="${dict.itemCode}" >
<a data-toggle="tab" href="#">
<spring:message code="${dict.itemValue}"/>
</a>
</li>
</c:forEach>
</ul>
<div class="tab-content">
<c:set var="fatherName"><spring:message code="root_node"/></c:set>
<c:forEach items="${fns:getDictList('SPECIFIC_SERVICE_CFG_TYPE') }" var="dict">
<div class="form-group cfgType" cfgType="${dict.itemCode}">
<label class="col-md-3 control-label"><spring:message code="superior_config"/>:</label> <label class="col-md-3 control-label"><spring:message code="superior_config"/>:</label>
<div class="col-md-4"> <div class="col-md-4">
<c:set var="fatherName"><spring:message code="root_node"/></c:set> <c:if test="${empty specificServiceCfg.specServiceId}">
<sys:treeselect id="specificServiceCfg" name="parent.specServiceId" value="${specificServiceCfg.parent.specServiceId}" labelName="parent.specServiceName" labelValue="${specificServiceCfg.parent.specServiceId eq '0'?fatherName:fns:getBySpecServiceId(specificServiceCfg.parent.specServiceId).specServiceName}" <sys:treeselect id="${'specificServiceCfg'.concat(dict.itemCode)}" name="parent.specServiceId" value="${specificServiceCfg.parent.specServiceId}" labelName="parent.specServiceName" labelValue="${fatherName}"
title="" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=0" extId="${specificServiceCfg.specServiceId}" cssClass="required form-control"/> title="" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${dict.itemCode}" extId="${specificServiceCfg.specServiceId}" cssClass="required form-control"/>
</c:if>
<c:if test="${not empty specificServiceCfg.specServiceId}">
<sys:treeselect id="${'specificServiceCfg'.concat(dict.itemCode)}" name="parent.specServiceId" value="${specificServiceCfg.cfgType eq dict.itemCode?specificServiceCfg.parent.specServiceId:0}" labelName="parent.specServiceName" labelValue="${(specificServiceCfg.cfgType eq dict.itemCode and specificServiceCfg.parent.specServiceId ne '0')?fns:getBySpecServiceId(specificServiceCfg.parent.specServiceId).specServiceName:fatherName}"
title="" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${dict.itemCode}" extId="${specificServiceCfg.specServiceId}" cssClass="required form-control"/>
</c:if>
</div> </div>
</div> </div>
</c:forEach>
<div class="form-group"> <div class="form-group">
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="protocol_code"/>:</label> <label class="col-md-3 control-label"><font color="red">*</font><spring:message code="protocol_code"/>:</label>
<div class="col-md-4"> <div class="col-md-4">
<input id="specServiceCode" name="specServiceCode" maxlength="50" range="[0,2147483647]" class="form-control required digits" value="${specificServiceCfg.specServiceCode}"/> <input id="specServiceCode" name="specServiceCode" maxlength="50" range="[0,2147483647]" class="form-control required digits specServiceCodeCheck" value="${specificServiceCfg.specServiceCode}" ctx="${ctx}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@@ -147,14 +207,14 @@
</form:select> </form:select>
</div> </div>
</div> --%> </div> --%>
<div class="form-group"> <%-- <div class="form-group">
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="cfg_type"/>:</label> <label class="col-md-3 control-label"><font color="red">*</font><spring:message code="cfg_type"/>:</label>
<div class="col-md-4"> <div class="col-md-4">
<c:forEach items="${fns:getDictList('SPECIFIC_SERVICE_CFG_TYPE') }" var="dict"> <c:forEach items="${fns:getDictList('SPECIFIC_SERVICE_CFG_TYPE') }" var="dict">
<label class="radio-inline"><form:radiobutton path="cfgType" class="required checkParent" value="${dict.itemCode}"/><spring:message code="${dict.itemValue}"/></label> <label class="radio-inline"><form:radiobutton path="cfgType" class="required checkParent" value="${dict.itemCode}"/><spring:message code="${dict.itemValue}"/></label>
</c:forEach> </c:forEach>
</div> </div>
</div> </div> --%>
<div class="form-group"> <div class="form-group">
<label class="col-md-3 control-label"><spring:message code="protocol_desc"/>:</label> <label class="col-md-3 control-label"><spring:message code="protocol_desc"/>:</label>
<div class="col-md-4"> <div class="col-md-4">
@@ -169,18 +229,18 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</form:form> </form:form>
<!-- END FORM--> <!-- END FORM-->
</div> </div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -606,7 +606,7 @@
var lang = navigator.userLanguage;//支持IE var lang = navigator.userLanguage;//支持IE
}*/ }*/
var arrCookie = document.cookie.toLowerCase().split(";"); var arrCookie = document.cookie.toLowerCase().split(";");
console.log(document.cookie); //console.log(document.cookie);
for(i=0;i<arrCookie.length;i++){ for(i=0;i<arrCookie.length;i++){
var key=arrCookie[i].split("=")[0]; var key=arrCookie[i].split("=")[0];
var value=arrCookie[i].split("=")[1]; var value=arrCookie[i].split("=")[1];

View File

@@ -601,6 +601,30 @@ jQuery.validator.addMethod("checkParent",function(value, element) {
} }
return true; return true;
}); });
jQuery.validator.addMethod("specServiceCodeCheck",function(value, element) {
var ctx=$(element).attr("ctx");
var parentId= $("[name='parent.specServiceId']").val();
var specServiceCode= $("#specServiceCode").val();
var cfgType= $("[name='cfgType']").val();
var specServiceId= $("[name='specServiceId']").val();
var url=ctx+"/specific/specificServiceCfg/isCodeNotRepeat";
var val=true;
$.ajax({
url:url,
type:"post",
async:false,
data:{
parentId:parentId,
specServiceCode:specServiceCode,
cfgType:cfgType,
specServiceId:specServiceId
},
success:function(data){
val=data;
}
});
return val;
});
//ip v4转数字 //ip v4转数字
var ipToNumber=function (ip){ var ipToNumber=function (ip){
var num =0; var num =0;

View File

@@ -57,6 +57,7 @@
timeout:"timeout", timeout:"timeout",
areaIpPrefix:"Forbiden value: ", areaIpPrefix:"Forbiden value: ",
domainCheck:"Please enter a valid domain.", domainCheck:"Please enter a valid domain.",
checkParent:"Configuration Type must match it's parent." checkParent:"Configuration Type must match it's parent.",
specServiceCodeCheck:"Protocol No is repeat."
}); });
}(jQuery)); }(jQuery));

View File

@@ -55,6 +55,7 @@
timeout:"timeout", timeout:"timeout",
areaIpPrefix:"Forbiden value: ", areaIpPrefix:"Forbiden value: ",
domainCheck:"Please enter a valid domain.", domainCheck:"Please enter a valid domain.",
checkParent:"Configuration Type must match it's parent." checkParent:"Configuration Type must match it's parent.",
specServiceCodeCheck:"Protocol No is repeat."
}); });
}(jQuery)); }(jQuery));

View File

@@ -59,6 +59,7 @@
timeout:"超时", timeout:"超时",
areaIpPrefix:"禁止使用的值: ", areaIpPrefix:"禁止使用的值: ",
domainCheck:"请输入有效的域名", domainCheck:"请输入有效的域名",
checkParent:"配置类型必须与上级配置一致!" checkParent:"配置类型必须与上级配置一致!",
specServiceCodeCheck:"协议号重复"
}); });
}(jQuery)); }(jQuery));