From a389258e644cf415e696c6ee8cebe003867de7d0 Mon Sep 17 00:00:00 2001 From: wangxin Date: Mon, 22 Oct 2018 19:06:43 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=EF=BC=881=EF=BC=89=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC=E7=9A=84=E5=A4=84=E7=90=86=20?= =?UTF-8?q?=EF=BC=882=EF=BC=89=E4=BF=AE=E5=A4=8DIPV6=E5=B8=B8=E9=87=8F=20?= =?UTF-8?q?=EF=BC=883=EF=BC=89=E4=BF=AE=E5=A4=8DIPv4=E7=BD=91=E6=AE=B5?= =?UTF-8?q?=E9=99=90=E5=88=B6ABC=20=EF=BC=884=EF=BC=89can=5Fnot=5Fbe?= =?UTF-8?q?=E5=AD=97=E5=85=B8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/nis/util/Constants.java | 2 +- .../nis/web/controller/BaseController.java | 237 ++++++++++-------- .../resources/messages/message_en.properties | 2 +- .../1.11.0/jquery.validate.method.js | 20 +- 4 files changed, 151 insertions(+), 110 deletions(-) diff --git a/src/main/java/com/nis/util/Constants.java b/src/main/java/com/nis/util/Constants.java index 63365e51f..fcd86fde5 100644 --- a/src/main/java/com/nis/util/Constants.java +++ b/src/main/java/com/nis/util/Constants.java @@ -22,7 +22,7 @@ public final class Constants { * iP默认值 */ public static String IPV4_DEFAULT_IP_VALUE=Configurations.getStringProperty("ipv4_default_ip_value", "0.0.0.0"); - public static String IPV6_DEFAULT_IP_VALUE=Configurations.getStringProperty("ipv4_default_ip_value", "::"); + public static String IPV6_DEFAULT_IP_VALUE=Configurations.getStringProperty("ipv6_default_ip_value", "::"); public static String IPV4_DEFAULT_IP_SUBNET_VALUE=Configurations.getStringProperty("ipv4_default_ip_subnet_value", "0.0.0.0/32"); public static String IPV6_DEFAULT_IP_SUBNET_VALUE=Configurations.getStringProperty("ipv6_default_ip_subnet_value", "::/128"); public static String IPV4_DEFAULT_IP_RANGE_VALUE=Configurations.getStringProperty("ipv4_default_ip_range_value", "0.0.0.0-0.0.0.0"); diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index 758f467e7..2194ee230 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -1142,7 +1142,7 @@ public class BaseController { } if (regionDict.getRegionType().equals(1)) { // 校验必填的IP,端口 - for (String code : configIpPortShow.split(",")) { + /*for (String code : configIpPortShow.split(",")) { if ("1".equals(code)) {// 源IP if (StringUtil.isEmpty(baseIpCfg.getSrcIpAddress())) { errInfo.append(String.format(prop.getProperty("can_not_null"), @@ -1164,48 +1164,58 @@ public class BaseController { prop.getProperty("server_port", "Server Port")) + ";"); } } - } + }*/ boolean srcIpEmpty = false; + boolean destIpEmpty = false; boolean srcPortEmpty = false; + boolean destPortEmpty = false; if (StringUtil.isEmpty(baseIpCfg.getSrcIpAddress())) { srcIpEmpty = true; } if (StringUtil.isEmpty(baseIpCfg.getDestIpAddress())) { - if (srcIpEmpty) {// 全部为空,填值 - if (canIPv4 && canIPFormat) { - baseIpCfg.setSrcIpAddress(Constants.IPV4_DEFAULT_IP_VALUE); - baseIpCfg.setDestIpAddress(Constants.IPV4_DEFAULT_IP_VALUE); - baseIpCfg.setIpType(4); - baseIpCfg.setIpPattern(3); - } else if (canIPv6 && canIPFormat) { - baseIpCfg.setSrcIpAddress(Constants.IPV6_DEFAULT_IP_VALUE); - baseIpCfg.setDestIpAddress(Constants.IPV6_DEFAULT_IP_VALUE); - baseIpCfg.setIpType(6); - baseIpCfg.setIpPattern(3); - } else if (canIPv4 && canIPSubnetFormat) { - baseIpCfg.setSrcIpAddress(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE); - baseIpCfg.setDestIpAddress(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE); - baseIpCfg.setIpType(4); - baseIpCfg.setIpPattern(3); - } else if (canIPv6 && canIPSubnetFormat) { - baseIpCfg.setSrcIpAddress(Constants.IPV6_DEFAULT_IP_SUBNET_VALUE); - baseIpCfg.setDestIpAddress(Constants.IPV6_DEFAULT_IP_SUBNET_VALUE); - baseIpCfg.setIpType(6); - baseIpCfg.setIpPattern(3); - } else if (canIPv4 && canIPRangeFormat) { - baseIpCfg.setSrcIpAddress(Constants.IPV4_DEFAULT_IP_RANGE_VALUE); - baseIpCfg.setDestIpAddress(Constants.IPV4_DEFAULT_IP_RANGE_VALUE); - baseIpCfg.setIpType(4); - baseIpCfg.setIpPattern(3); - } else if (canIPv6 && canIPRangeFormat) { - baseIpCfg.setSrcIpAddress(Constants.IPV6_DEFAULT_IP_RANGE_VALUE); - baseIpCfg.setDestIpAddress(Constants.IPV6_DEFAULT_IP_RANGE_VALUE); - baseIpCfg.setIpType(6); - baseIpCfg.setIpPattern(3); - } - - } else { - // 目的IP为空 + destIpEmpty = true; + } + if (StringUtil.isEmpty(baseIpCfg.getSrcPort())) { + srcPortEmpty = true; + } + if (StringUtil.isEmpty(baseIpCfg.getDestPort())) { + destPortEmpty = true; + } + if(srcIpEmpty&&destIpEmpty) { + if(configIpPortShow.indexOf("1")>-1&&configIpPortShow.indexOf("3")>-1) { + errInfo.append(String.format(prop.getProperty("can_not_null"), + prop.getProperty("client_ip", "Client IP")) + ";"); + }else if(configIpPortShow.indexOf("1")>-1) { + errInfo.append(String.format(prop.getProperty("can_not_null"), + prop.getProperty("client_ip", "Client IP")) + ";"); + }else if(configIpPortShow.indexOf("3")>-1) { + errInfo.append(String.format(prop.getProperty("can_not_null"), + prop.getProperty("server_ip", "Server IP")) + ";"); + } + }else if (destIpEmpty) {// 目的IP为空 + if(configIpPortShow.indexOf("3")>-1&&configIpPortShow.indexOf("1")==-1) {//目的IP必填 + errInfo.append(String.format(prop.getProperty("can_not_null"), + prop.getProperty("server_ip", "Server IP")) + ";"); + }else if(configIpPortShow.indexOf("1")>-1){ + /*if(Constants.IPV6_DEFAULT_IP_RANGE_VALUE.equals(baseIpCfg.getSrcIpAddress())) { + errInfo.append(prop.getProperty("client_ip") + String.format(prop.getProperty("can_not_be"), + "'"+Constants.IPV6_DEFAULT_IP_RANGE_VALUE+"'")+";"); + }else if(Constants.IPV6_DEFAULT_IP_SUBNET_VALUE.equals(baseIpCfg.getSrcIpAddress())) { + errInfo.append(prop.getProperty("client_ip") + String.format(prop.getProperty("can_not_be"), + "'"+Constants.IPV6_DEFAULT_IP_SUBNET_VALUE+"'")+";"); + }else if(Constants.IPV6_DEFAULT_IP_VALUE.equals(baseIpCfg.getSrcIpAddress())) { + errInfo.append(prop.getProperty("client_ip") + String.format(prop.getProperty("can_not_be"), + "'"+Constants.IPV6_DEFAULT_IP_VALUE+"'")+";"); + }else if(Constants.IPV4_DEFAULT_IP_RANGE_VALUE.equals(baseIpCfg.getSrcIpAddress())) { + errInfo.append(prop.getProperty("client_ip") + String.format(prop.getProperty("can_not_be"), + "'"+Constants.IPV4_DEFAULT_IP_RANGE_VALUE+"'")+";"); + }else if(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE.equals(baseIpCfg.getSrcIpAddress())) { + errInfo.append(prop.getProperty("client_ip") + String.format(prop.getProperty("can_not_be"), + "'"+Constants.IPV4_DEFAULT_IP_SUBNET_VALUE+"'")+";"); + }else if(Constants.IPV4_DEFAULT_IP_VALUE.equals(baseIpCfg.getSrcIpAddress())) { + errInfo.append(prop.getProperty("client_ip") + String.format(prop.getProperty("can_not_be"), + "'"+Constants.IPV4_DEFAULT_IP_VALUE+"'")+";"); + }*/ String matchType = this.validIPAddress("client_ip", errInfo, baseIpCfg.getSrcIpAddress(), ipType, ipPattern); if (matchType.startsWith("IPV6")) { @@ -1215,8 +1225,8 @@ public class BaseController { baseIpCfg.setIpPattern(2); if (baseIpCfg.getSrcIpAddress() .startsWith(Constants.IPV6_DEFAULT_IP_RANGE_VALUE.split("-")[0])) { - errInfo.append(prop.getProperty("client_ip") + String.format("can_not_be", - Constants.IPV6_DEFAULT_IP_RANGE_VALUE.split("-")[0])); + errInfo.append(prop.getProperty("client_ip") + String.format(prop.getProperty("can_not_be"), + Constants.IPV6_DEFAULT_IP_RANGE_VALUE.split("-")[0])+";"); } } else if (matchType.endsWith("SUBNET")) { // baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress()); @@ -1224,8 +1234,8 @@ public class BaseController { baseIpCfg.setIpPattern(1); if (baseIpCfg.getSrcIpAddress() .startsWith(Constants.IPV6_DEFAULT_IP_SUBNET_VALUE.split("/")[0])) { - errInfo.append(prop.getProperty("client_ip") + String.format("can_not_be", - Constants.IPV6_DEFAULT_IP_SUBNET_VALUE.split("/")[0])); + errInfo.append(prop.getProperty("client_ip") + String.format(prop.getProperty("can_not_be"), + Constants.IPV6_DEFAULT_IP_SUBNET_VALUE.split("/")[0])+";"); } } else { // baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress()); @@ -1233,7 +1243,7 @@ public class BaseController { baseIpCfg.setIpPattern(3); if (baseIpCfg.getSrcIpAddress().equals(Constants.IPV6_DEFAULT_IP_VALUE)) { errInfo.append(prop.getProperty("client_ip") - + String.format("can_not_be", Constants.IPV6_DEFAULT_IP_VALUE)); + + String.format(prop.getProperty("can_not_be"), Constants.IPV6_DEFAULT_IP_VALUE)+";"); } } baseIpCfg.setIpType(6); @@ -1245,8 +1255,8 @@ public class BaseController { baseIpCfg.setIpPattern(2); if (baseIpCfg.getSrcIpAddress() .startsWith(Constants.IPV4_DEFAULT_IP_RANGE_VALUE.split("-")[0])) { - errInfo.append(prop.getProperty("client_ip") + String.format("can_not_be", - Constants.IPV4_DEFAULT_IP_RANGE_VALUE.split("-")[0])); + errInfo.append(prop.getProperty("client_ip") + String.format(prop.getProperty("can_not_be"), + Constants.IPV4_DEFAULT_IP_RANGE_VALUE.split("-")[0])+";"); } } else if (matchType.endsWith("SUBNET")) { // baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress()); @@ -1254,8 +1264,8 @@ public class BaseController { baseIpCfg.setIpPattern(1); if (baseIpCfg.getSrcIpAddress() .startsWith(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE.split("/")[0])) { - errInfo.append(prop.getProperty("client_ip") + String.format("can_not_be", - Constants.IPV4_DEFAULT_IP_SUBNET_VALUE.split("/")[0])); + errInfo.append(prop.getProperty("client_ip") + String.format(prop.getProperty("can_not_be"), + Constants.IPV4_DEFAULT_IP_SUBNET_VALUE.split("/")[0])+";"); } } else { baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress()); @@ -1263,14 +1273,37 @@ public class BaseController { baseIpCfg.setIpPattern(3); if (baseIpCfg.getSrcIpAddress().equals(Constants.IPV4_DEFAULT_IP_VALUE)) { errInfo.append(prop.getProperty("client_ip") - + String.format("can_not_be", Constants.IPV4_DEFAULT_IP_VALUE)); + + String.format(prop.getProperty("can_not_be"), Constants.IPV4_DEFAULT_IP_VALUE)+";"); } } baseIpCfg.setIpType(4); } } - } else { - if (srcIpEmpty) {// 源IP为空 + + } else if (srcIpEmpty) {// 源IP为空 + if(configIpPortShow.indexOf("1")>-1&&configIpPortShow.indexOf("3")==-1) {//源IP必填 + errInfo.append(String.format(prop.getProperty("can_not_null"), + prop.getProperty("client_ip", "Client IP")) + ";"); + }else if(configIpPortShow.indexOf("3")>-1){ + /*if(Constants.IPV6_DEFAULT_IP_RANGE_VALUE.equals(baseIpCfg.getDestIpAddress())) { + errInfo.append(prop.getProperty("server_ip") + String.format(prop.getProperty("can_not_be"), + "'"+Constants.IPV6_DEFAULT_IP_RANGE_VALUE+"'")+";"); + }else if(Constants.IPV6_DEFAULT_IP_SUBNET_VALUE.equals(baseIpCfg.getDestIpAddress())) { + errInfo.append(prop.getProperty("server_ip") + String.format(prop.getProperty("can_not_be"), + "'"+Constants.IPV6_DEFAULT_IP_SUBNET_VALUE+"'")+";"); + }else if(Constants.IPV6_DEFAULT_IP_VALUE.equals(baseIpCfg.getDestIpAddress())) { + errInfo.append(prop.getProperty("server_ip") + String.format(prop.getProperty("can_not_be"), + "'"+Constants.IPV6_DEFAULT_IP_VALUE+"'")+";"); + }else if(Constants.IPV4_DEFAULT_IP_RANGE_VALUE.equals(baseIpCfg.getDestIpAddress())) { + errInfo.append(prop.getProperty("server_ip") + String.format(prop.getProperty("can_not_be"), + "'"+Constants.IPV4_DEFAULT_IP_RANGE_VALUE+"'")+";"); + }else if(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE.equals(baseIpCfg.getDestIpAddress())) { + errInfo.append(prop.getProperty("server_ip") + String.format(prop.getProperty("can_not_be"), + "'"+Constants.IPV4_DEFAULT_IP_SUBNET_VALUE+"'")+";"); + }else if(Constants.IPV4_DEFAULT_IP_VALUE.equals(baseIpCfg.getDestIpAddress())) { + errInfo.append(prop.getProperty("server_ip") + String.format(prop.getProperty("can_not_be"), + "'"+Constants.IPV4_DEFAULT_IP_VALUE+"'")+";"); + }*/ String matchType = this.validIPAddress("server_ip", errInfo, baseIpCfg.getDestIpAddress(), ipType, ipPattern); if (matchType.startsWith("IPV6")) { @@ -1280,8 +1313,8 @@ public class BaseController { baseIpCfg.setIpPattern(2); if (baseIpCfg.getDestIpAddress() .startsWith(Constants.IPV6_DEFAULT_IP_RANGE_VALUE.split("-")[0])) { - errInfo.append(prop.getProperty("server_ip") + String.format("can_not_be", - Constants.IPV6_DEFAULT_IP_RANGE_VALUE.split("-")[0])); + errInfo.append(prop.getProperty("server_ip") + String.format(prop.getProperty("can_not_be"), + Constants.IPV6_DEFAULT_IP_RANGE_VALUE.split("-")[0])+";"); } } else if (matchType.endsWith("SUBNET")) { // baseIpCfg.setDestIpAddress(baseIpCfg.getDestIpAddress()); @@ -1289,8 +1322,8 @@ public class BaseController { baseIpCfg.setIpPattern(1); if (baseIpCfg.getDestIpAddress() .startsWith(Constants.IPV6_DEFAULT_IP_SUBNET_VALUE.split("/")[0])) { - errInfo.append(prop.getProperty("server_ip") + String.format("can_not_be", - Constants.IPV6_DEFAULT_IP_SUBNET_VALUE.split("/")[0])); + errInfo.append(prop.getProperty("server_ip") + String.format(prop.getProperty("can_not_be"), + Constants.IPV6_DEFAULT_IP_SUBNET_VALUE.split("/")[0])+";"); } } else { // baseIpCfg.setDestIpAddress(baseIpCfg.getDestIpAddress()); @@ -1298,7 +1331,7 @@ public class BaseController { baseIpCfg.setIpPattern(3); if (baseIpCfg.getDestIpAddress().equals(Constants.IPV6_DEFAULT_IP_VALUE)) { errInfo.append(prop.getProperty("server_ip") - + String.format("can_not_be", Constants.IPV6_DEFAULT_IP_VALUE)); + + String.format(prop.getProperty("can_not_be"), Constants.IPV6_DEFAULT_IP_VALUE)+";"); } } baseIpCfg.setIpType(6); @@ -1312,8 +1345,8 @@ public class BaseController { baseIpCfg.setIpPattern(2); if (baseIpCfg.getDestIpAddress() .startsWith(Constants.IPV4_DEFAULT_IP_RANGE_VALUE.split("-")[0])) { - errInfo.append(prop.getProperty("server_ip") + String.format("can_not_be", - Constants.IPV4_DEFAULT_IP_RANGE_VALUE.split("-")[0])); + errInfo.append(prop.getProperty("server_ip") + String.format(prop.getProperty("can_not_be"), + Constants.IPV4_DEFAULT_IP_RANGE_VALUE.split("-")[0])+";"); } } else if (matchType.endsWith("SUBNET")) { // baseIpCfg.setDestIpAddress(baseIpCfg.getDestIpAddress()); @@ -1321,8 +1354,8 @@ public class BaseController { baseIpCfg.setIpPattern(1); if (baseIpCfg.getDestIpAddress() .startsWith(Constants.IPV4_DEFAULT_IP_SUBNET_VALUE.split("/")[0])) { - errInfo.append(prop.getProperty("server_ip") + String.format("can_not_be", - Constants.IPV4_DEFAULT_IP_SUBNET_VALUE.split("/")[0])); + errInfo.append(prop.getProperty("server_ip") + String.format(prop.getProperty("can_not_be"), + Constants.IPV4_DEFAULT_IP_SUBNET_VALUE.split("/")[0])+";"); } } else { // baseIpCfg.setDestIpAddress(baseIpCfg.getDestIpAddress()); @@ -1330,65 +1363,61 @@ public class BaseController { baseIpCfg.setIpPattern(3); if (baseIpCfg.getDestIpAddress().equals(Constants.IPV4_DEFAULT_IP_VALUE)) { errInfo.append(prop.getProperty("server_ip") - + String.format("can_not_be", Constants.IPV4_DEFAULT_IP_VALUE)); + + String.format(prop.getProperty("can_not_be"), Constants.IPV4_DEFAULT_IP_VALUE)+";"); } } baseIpCfg.setIpType(4); } + } + } else {//全不为空 + String matchType = this.validIPAddress("client_ip", errInfo, baseIpCfg.getSrcIpAddress(), + ipType, ipPattern); + String matchType1 = this.validIPAddress("server_ip", errInfo, baseIpCfg.getDestIpAddress(), + ipType, ipPattern); + if (StringUtils.isNotBlank(matchType)&&StringUtils.isNotBlank(matchType1)&& + !matchType.equals(matchType1)) { + errInfo.append(prop.get("the_same_ip_type_pattern") + ";"); + } + // baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress()); + // baseIpCfg.setDestIpAddress(baseIpCfg.getDestIpAddress()); + if (matchType.startsWith("IPV6")) { + baseIpCfg.setIpType(6); } else { - String matchType = this.validIPAddress("client_ip", errInfo, baseIpCfg.getSrcIpAddress(), - ipType, ipPattern); - String matchType1 = this.validIPAddress("server_ip", errInfo, baseIpCfg.getDestIpAddress(), - ipType, ipPattern); - if (StringUtils.isNotBlank(matchType)&&StringUtils.isNotBlank(matchType1)&& - !matchType.equals(matchType1)) { - errInfo.append(prop.get("the_same_ip_type_pattern") + ";"); + baseIpCfg.setIpType(4); + } + if (matchType.endsWith("RANGE")) { + if (matchType.startsWith("IPV4")) { + this.validIPv4Range("client_ip", errInfo, baseIpCfg.getSrcIpAddress()); + this.validIPv4Range("server_ip", errInfo, baseIpCfg.getDestIpAddress()); } - // baseIpCfg.setSrcIpAddress(baseIpCfg.getSrcIpAddress()); - // baseIpCfg.setDestIpAddress(baseIpCfg.getDestIpAddress()); - if (matchType.startsWith("IPV6")) { - baseIpCfg.setIpType(6); - } else { - baseIpCfg.setIpType(4); - } - if (matchType.endsWith("RANGE")) { - if (matchType.startsWith("IPV4")) { - this.validIPv4Range("client_ip", errInfo, baseIpCfg.getSrcIpAddress()); - this.validIPv4Range("server_ip", errInfo, baseIpCfg.getDestIpAddress()); - } - if (baseIpCfg.getSrcIpAddress().split("-")[0] - .equals(baseIpCfg.getDestIpAddress().split("-")[0])) { - errInfo.append(String.format(prop.getProperty("are_the_same"), - baseIpCfg.getSrcIpAddress().split("-")[0], - baseIpCfg.getDestIpAddress().split("-")[0]) + ";"); - } - baseIpCfg.setIpPattern(2); - } else if (matchType.endsWith("SUBNET")) { - if (baseIpCfg.getSrcIpAddress().split("/")[0] - .equals(baseIpCfg.getDestIpAddress().split("/")[0])) { - errInfo.append(String.format(prop.getProperty("are_the_same"), - baseIpCfg.getSrcIpAddress().split("/")[0], - baseIpCfg.getDestIpAddress().split("/")[0]) + ";"); - } - baseIpCfg.setIpPattern(1); - } else { - if (baseIpCfg.getSrcIpAddress().equals(baseIpCfg.getDestIpAddress())) { - errInfo.append(String.format(prop.getProperty("are_the_same"), - prop.getProperty("client_ip"), prop.getProperty("server_ip")) + ";"); - } - baseIpCfg.setIpPattern(3); + if (baseIpCfg.getSrcIpAddress().split("-")[0] + .equals(baseIpCfg.getDestIpAddress().split("-")[0])) { + errInfo.append(String.format(prop.getProperty("are_the_same"), + baseIpCfg.getSrcIpAddress().split("-")[0], + baseIpCfg.getDestIpAddress().split("-")[0]) + ";"); } + baseIpCfg.setIpPattern(2); + } else if (matchType.endsWith("SUBNET")) { + if (baseIpCfg.getSrcIpAddress().split("/")[0] + .equals(baseIpCfg.getDestIpAddress().split("/")[0])) { + errInfo.append(String.format(prop.getProperty("are_the_same"), + baseIpCfg.getSrcIpAddress().split("/")[0], + baseIpCfg.getDestIpAddress().split("/")[0]) + ";"); + } + baseIpCfg.setIpPattern(1); + } else { + if (baseIpCfg.getSrcIpAddress().equals(baseIpCfg.getDestIpAddress())) { + errInfo.append(String.format(prop.getProperty("are_the_same"), + prop.getProperty("client_ip"), prop.getProperty("server_ip")) + ";"); + } + baseIpCfg.setIpPattern(3); } } // TODO 判断源IP和目的IP的值 // TODO 判断源IP和目的IP格式 - - if (StringUtil.isEmpty(baseIpCfg.getSrcPort())) { - srcPortEmpty = true; - } - if (StringUtil.isEmpty(baseIpCfg.getDestPort())) { + if (destPortEmpty) { if (srcPortEmpty) { baseIpCfg.setSrcPort("0"); baseIpCfg.setDestPort("0"); diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 8ffdd5143..9e6bd8d6b 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1256,7 +1256,7 @@ antiddos_protocol=DDOS Protocol bps_threadshold=Traffic Threshold(bps) pps_threadshold=Traffic Threshold(pps) one_more_greater_zero=At Least One Threshold Is Not 0. -can_not_be=Can not be %s +can_not_be= can not be %s the_same_ip_type_pattern=Client IP and Server IP must have the same IP type and the same IP pattern protocol_and_port=Only when TCP protocol or UDP protocol is chosen can port greater than 0,ALL protocol has no limit the_same_port_pattern=Client port and server port must in the same port pattern diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js index dc52afcad..7c1fea269 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js @@ -338,7 +338,10 @@ jQuery.validator.addMethod("ipCheck",function(value, element) { if(value==IPv4RangeDefault){ return true; } - if(startPart0>191&&startPart1>191&&startPart0<224&&startPart1<224){//仅允许C段IP + if((startPart0<128&&startPart1<128)||(startPart0>127&&startPart1>127&&startPart0<192&&startPart1<192) + ||(startPart0>191&&startPart1>191&&startPart0<224&&startPart1<224) + ||(startPart0>223&&startPart1>223&&startPart0<240&&startPart1<240) + ||(startPart0>239&&startPart1>239&&startPart0<256&&startPart1<256)){//仅允许C段IP if(ipToNumber(startIp)<=ipToNumber(endIp)){//比较IP大小 if((startIp.split(".")[0]!=endIp.split(".")[0])|| (startIp.split(".")[1]!=endIp.split(".")[1])|| @@ -459,7 +462,10 @@ jQuery.validator.addMethod("ipCheck",function(value, element) { if(value==IPv4RangeDefault){ return true; } - if(startPart0>191&&startPart1>191&&startPart0<224&&startPart1<224){//仅允许C段IP + if((startPart0<128&&startPart1<128)||(startPart0>127&&startPart1>127&&startPart0<192&&startPart1<192) + ||(startPart0>191&&startPart1>191&&startPart0<224&&startPart1<224) + ||(startPart0>223&&startPart1>223&&startPart0<240&&startPart1<240) + ||(startPart0>239&&startPart1>239&&startPart0<256&&startPart1<256)){//仅允许C段IP if(ipToNumber(startIp)<=ipToNumber(endIp)){//比较IP大小 if((startIp.split(".")[0]!=endIp.split(".")[0])|| (startIp.split(".")[1]!=endIp.split(".")[1])|| @@ -627,7 +633,10 @@ jQuery.validator.addMethod("ipCheck",function(value, element) { if(value==IPv4RangeDefault){ return true; } - if(startPart0>191&&startPart1>191&&startPart0<224&&startPart1<224){//仅允许C段IP + if((startPart0<128&&startPart1<128)||(startPart0>127&&startPart1>127&&startPart0<192&&startPart1<192) + ||(startPart0>191&&startPart1>191&&startPart0<224&&startPart1<224) + ||(startPart0>223&&startPart1>223&&startPart0<240&&startPart1<240) + ||(startPart0>239&&startPart1>239&&startPart0<256&&startPart1<256)){//仅允许C段IP if(ipToNumber(startIp)<=ipToNumber(endIp)){//比较IP大小 if((startIp.split(".")[0]!=endIp.split(".")[0])|| (startIp.split(".")[1]!=endIp.split(".")[1])|| @@ -680,7 +689,10 @@ jQuery.validator.addMethod("ipCheck",function(value, element) { if(value==IPv4RangeDefault){ return true; } - if(startPart0>191&&startPart1>191&&startPart0<224&&startPart1<224){//仅允许C段IP + if((startPart0<128&&startPart1<128)||(startPart0>127&&startPart1>127&&startPart0<192&&startPart1<192) + ||(startPart0>191&&startPart1>191&&startPart0<224&&startPart1<224) + ||(startPart0>223&&startPart1>223&&startPart0<240&&startPart1<240) + ||(startPart0>239&&startPart1>239&&startPart0<256&&startPart1<256)){//仅允许C段IP if(ipToNumber(startIp)<=ipToNumber(endIp)){//比较IP大小 if((startIp.split(".")[0]!=endIp.split(".")[0])|| (startIp.split(".")[1]!=endIp.split(".")[1])|| From 1e10aeb14f71d7d55e4fcc1550c5044ad0b3e58f Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Mon, 22 Oct 2018 19:15:21 +0800 Subject: [PATCH 2/7] =?UTF-8?q?IP=E5=9C=B0=E5=9D=80=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E6=9D=A5=E5=87=BD=E5=A2=9E=E5=8A=A0=E5=8F=96=E6=B6=88=E6=9D=A5?= =?UTF-8?q?=E5=87=BD=E4=BF=A1=E6=81=AF=E6=B7=BB=E5=8A=A0=EF=BC=8C=E5=B1=95?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/nis/domain/configuration/BaseCfg.java | 10 ++ .../domain/configuration/CfgIndexInfo.java | 8 ++ .../basics/ServiceDictInfoController.java | 63 +++++++++++ .../web/dao/basics/ServiceDictInfoDao.java | 3 + .../nis/web/dao/basics/ServiceDictInfoDao.xml | 9 +- .../web/dao/configuration/RequestInfoDao.java | 2 + .../web/dao/configuration/RequestInfoDao.xml | 4 + .../basics/ServiceDictInfoService.java | 17 +++ .../configuration/RequestInfoService.java | 5 + .../resources/messages/message_en.properties | 7 +- .../resources/messages/message_ru.properties | 7 +- .../messages/message_zh_CN.properties | 7 +- src/main/webapp/WEB-INF/tags/sys/delRow.tag | 104 +++++++++++++++++- .../views/basics/requestSelectInfo.jsp | 32 ++++++ .../WEB-INF/views/cfg/ipaddr/ipList.jsp | 4 +- .../webapp/static/global/scripts/common.js | 29 +++++ 16 files changed, 296 insertions(+), 15 deletions(-) create mode 100644 src/main/webapp/WEB-INF/views/basics/requestSelectInfo.jsp diff --git a/src/main/java/com/nis/domain/configuration/BaseCfg.java b/src/main/java/com/nis/domain/configuration/BaseCfg.java index 962c6fe22..3e339c2c9 100644 --- a/src/main/java/com/nis/domain/configuration/BaseCfg.java +++ b/src/main/java/com/nis/domain/configuration/BaseCfg.java @@ -139,6 +139,10 @@ public class BaseCfg extends BaseEntity implements Cloneable{ * 来函id */ protected Integer requestId; + /** + * 取消审核来函id + */ + protected Integer cancelRequestId; /** * 来函 */ @@ -884,5 +888,11 @@ public class BaseCfg extends BaseEntity implements Cloneable{ public void setUserRegion5(String userRegion5) { this.userRegion5 = userRegion5; } + public Integer getCancelRequestId() { + return cancelRequestId; + } + public void setCancelRequestId(Integer cancelRequestId) { + this.cancelRequestId = cancelRequestId; + } } diff --git a/src/main/java/com/nis/domain/configuration/CfgIndexInfo.java b/src/main/java/com/nis/domain/configuration/CfgIndexInfo.java index caf00fc58..b56b5acde 100644 --- a/src/main/java/com/nis/domain/configuration/CfgIndexInfo.java +++ b/src/main/java/com/nis/domain/configuration/CfgIndexInfo.java @@ -28,6 +28,7 @@ public class CfgIndexInfo extends BaseCfg { */ private static final long serialVersionUID = 2796500715438264119L; private static final String tableName="cfg_index_info"; + private String indexTable="cfg_index_info"; private List voipAccounts;//Add表单使用 private List asnIpCfgs;//Add表单使用 private List voipIps; //Add表单使用 @@ -308,4 +309,11 @@ public class CfgIndexInfo extends BaseCfg { public static String getTablename() { return tableName; } + public String getIndexTable() { + return indexTable; + } + public void setIndexTable(String indexTable) { + this.indexTable = indexTable; + } + } diff --git a/src/main/java/com/nis/web/controller/basics/ServiceDictInfoController.java b/src/main/java/com/nis/web/controller/basics/ServiceDictInfoController.java index 351396a5e..03b161717 100644 --- a/src/main/java/com/nis/web/controller/basics/ServiceDictInfoController.java +++ b/src/main/java/com/nis/web/controller/basics/ServiceDictInfoController.java @@ -3,6 +3,8 @@ package com.nis.web.controller.basics; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.Date; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -15,7 +17,9 @@ import org.apache.zookeeper.ZooDefs.Ids; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.mvc.support.RedirectAttributes; @@ -24,6 +28,8 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.nis.domain.Page; import com.nis.domain.basics.ServiceDictInfo; +import com.nis.domain.configuration.RequestInfo; +import com.nis.exceptions.MaatConvertException; import com.nis.util.ConfigDictUtils; import com.nis.util.Configurations; import com.nis.util.StringUtil; @@ -46,6 +52,63 @@ public class ServiceDictInfoController extends BaseController { } + @RequestMapping(value="requestSelectInfo") + public String requestSelectInfo(Model model){ + List requestInfos=requestInfoService.getValidRequestInfo(); + model.addAttribute("requestInfos", requestInfos); + return "/basics/requestSelectInfo"; + } + @ResponseBody + @RequestMapping(value="requestCancleInfoAjax", method = RequestMethod.POST) + public String requestCancleInfoAjax(Integer cancelRequestId,String ids,String indexTable){ + if(!StringUtil.isEmpty(ids)){ + String[] idArray = ids.split(","); + for(String id :idArray){ + try { + serviceDictInfoService.auditCancleRequestInfo(cancelRequestId,indexTable,id); + } catch (Exception e) { + e.printStackTrace(); + logger.error("审核添加取消来函信息失败",e); + return "false"; + } + } + } + return "true"; + } + /** + * + * 根据id获取取消审核时的来函号信息 + * @param ids + * @param indexTable + * @return + */ + @ResponseBody + @RequestMapping(value="requestCancleInfoNumber") + public Map requestCancleInfoNumber(String ids,String indexTable){ + List list = new ArrayList(); + String requestTitle=""; + Map map=new HashMap(); + if(!StringUtil.isEmpty(ids)){ + String[] idArray = ids.split(","); +// for(String id :idArray){ + try { + Integer cancelRequestId= serviceDictInfoService.requestCancleInfoNumber(indexTable.trim(),Long.parseLong(ids)); + if(cancelRequestId!=null) { + requestTitle = requestInfoService.getRequestTitleById(cancelRequestId.longValue()); + if(StringUtils.isBlank(requestTitle)) { + return map; + } + } + } catch (Exception e) { + e.printStackTrace(); + logger.error("查询取消审核来函信息失败",e); + return map; + } +// } + } + map.put("requestTitle", requestTitle); + return map; + } /** * 查询业务辅助表-业务字典信息列表(无条件分页查询) diff --git a/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.java b/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.java index 1a2f9cc20..8e7e3ae07 100644 --- a/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.java +++ b/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.java @@ -76,6 +76,9 @@ public interface ServiceDictInfoDao extends CrudDao { List findItemDict(@Param("itemType")int itemType,@Param("isValid")int isValid,@Param("isLeaf")Integer isLeaf); List findAllItemDictByItemType(@Param("itemType")int itemType,@Param("isLeaf")Integer isLeaf); + void auditCancleRequestInfo(@Param("cancelRequestId")Integer cancelRequestId, @Param("indexTable")String indexTable,@Param("id") String id); + Integer requestCancleInfoNumber(@Param("indexTable")String indexTable,@Param("id")Long id); + diff --git a/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.xml b/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.xml index 356c031e8..5a656754d 100644 --- a/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.xml +++ b/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.xml @@ -306,9 +306,12 @@ LEFT JOIN service_dict_info p ON p.service_dict_id = s.parent_id - - - + + UPDATE ${indexTable} SET cancel_request_id = #{cancelRequestId} WHERE cfg_id = #{id} + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/configuration/RequestInfoDao.java b/src/main/java/com/nis/web/dao/configuration/RequestInfoDao.java index 4394f9dae..205854335 100644 --- a/src/main/java/com/nis/web/dao/configuration/RequestInfoDao.java +++ b/src/main/java/com/nis/web/dao/configuration/RequestInfoDao.java @@ -24,6 +24,8 @@ public interface RequestInfoDao extends CrudDao { List showTask(TaskInfo taskInfo); void delete(@Param("id") Long id); + + String getRequestTitleById(@Param("id")Long id); } \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/configuration/RequestInfoDao.xml b/src/main/java/com/nis/web/dao/configuration/RequestInfoDao.xml index c08b6396b..875a2d6f4 100644 --- a/src/main/java/com/nis/web/dao/configuration/RequestInfoDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/RequestInfoDao.xml @@ -217,4 +217,8 @@ from request_info + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/service/basics/ServiceDictInfoService.java b/src/main/java/com/nis/web/service/basics/ServiceDictInfoService.java index 6c1e0c5fa..7605fdca9 100644 --- a/src/main/java/com/nis/web/service/basics/ServiceDictInfoService.java +++ b/src/main/java/com/nis/web/service/basics/ServiceDictInfoService.java @@ -300,6 +300,23 @@ public class ServiceDictInfoService extends BaseService{ public List findAllLableDict() { return serviceDictInfoDao.findAllItemDictByItemType(Constants.ITEM_TYPE_LABEL,null); } + + + /** + * + * 取消审核的时候增加取消来函 + * @param cancelRequestId + * @param indexTable + * @param id + */ + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void auditCancleRequestInfo(Integer cancelRequestId, String indexTable, String id) { + serviceDictInfoDao.auditCancleRequestInfo(cancelRequestId, indexTable, id); + } + public Integer requestCancleInfoNumber(String indexTable, Long id) { + Integer cancleRequestId = serviceDictInfoDao.requestCancleInfoNumber( indexTable, id); + return cancleRequestId; + } diff --git a/src/main/java/com/nis/web/service/configuration/RequestInfoService.java b/src/main/java/com/nis/web/service/configuration/RequestInfoService.java index 42279a193..c922de8f1 100644 --- a/src/main/java/com/nis/web/service/configuration/RequestInfoService.java +++ b/src/main/java/com/nis/web/service/configuration/RequestInfoService.java @@ -118,4 +118,9 @@ public class RequestInfoService extends BaseService{ public List showTask(TaskInfo taskInfo) { return taskInfoDao.findList(taskInfo); } + + public String getRequestTitleById(Long id) { + return requestInfoDao.getRequestTitleById(id); + + } } diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 9e6bd8d6b..fcce7861b 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1223,8 +1223,8 @@ area_group_manage=Grouping Area Manage stream_media_protocol=Stream Media Protocol new_link=New Link active_link=Active Link -traffic_ipactive_hour_trend=Active IPTOP10 Trend In Nearly One Hour -traffic_ipactive_hour_max=Active IPTOP10 Maximum In Nearly One Hour +traffic_ipactive_hour_trend=Active IP TOP10 Trend In Nearly One Hour +traffic_ipactive_hour_max=Active IP TOP10 Maximum In Nearly One Hour ip_addr=IP area_id=Area link_num=Link Number @@ -1272,4 +1272,5 @@ ipv4_range=IPv4 Range ipv4_subnet=IPv4/Subnet Mask ipv6_range=IPv6 Range ipv6_subnet=IPv6/Subnet Mask -example=For Example \ No newline at end of file +example=For Example +letter_cancel_info=Cancel Letter Info \ No newline at end of file diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index 72e58d2d8..401a12250 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1224,8 +1224,8 @@ area_group_manage=Group Area Manage stream_media_protocol=Stream Media Protocol new_link=New Link active_link=Active Link -traffic_ipactive_hour_trend=Active IPTOP10 Trend In Nearly One Hour -traffic_ipactive_hour_max=Active IPTOP10 Maximum In Nearly One Hour +traffic_ipactive_hour_trend=Active IP TOP10 Trend In Nearly One Hour +traffic_ipactive_hour_max=Active IP TOP10 Maximum In Nearly One Hour ip_addr=IP area_id=Area link_num=Link Number @@ -1292,4 +1292,5 @@ ipv4_range=IPv4 Range ipv4_subnet=IPv4/Subnet mask ipv6_range=IPv6 Range ipv6_subnet=IPv6/Subnet mask -example=For Example \ No newline at end of file +example=For Example +letter_cancel_info=Cancel Letter Info \ No newline at end of file diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index a43e0e008..c624f2b14 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1217,8 +1217,8 @@ area_group_manage=\u5206\u7EC4\u5730\u7406\u4FE1\u606F\u7BA1\u7406 stream_media_protocol=\u6D41\u5A92\u4F53\u534F\u8BAE new_link=\u65B0\u5EFA active_link=\u6D3B\u8DC3 -traffic_ipactive_hour_trend=\u6D3B\u8DC3IPTOP10\u8FD1\u4E00\u5C0F\u65F6\u5185\u8D8B\u52BF -traffic_ipactive_hour_max=\u6D3B\u8DC3IPTOP10\u8FD1\u4E00\u5C0F\u65F6\u5185\u6700\u5927\u503C +traffic_ipactive_hour_trend=\u6D3B\u8DC3IP TOP10\u8FD1\u4E00\u5C0F\u65F6\u5185\u8D8B\u52BF +traffic_ipactive_hour_max=\u6D3B\u8DC3IP TOP10\u8FD1\u4E00\u5C0F\u65F6\u5185\u6700\u5927\u503C ip_addr=IP\u5730\u5740 area_id=\u5730\u57DF link_num=\u8FDE\u63A5\u6B21\u6570 @@ -1267,4 +1267,5 @@ ipv4_range=IPv4 Range ipv4_subnet=IPv4/Subnet mask ipv6_range=IPv6 Range ipv6_subnet=IPv6/Subnet mask -example=\u4F8B\u5982 \ No newline at end of file +example=\u4F8B\u5982 +letter_cancel_info=\u53D6\u6D88\u5BA1\u6838\u6765\u51FD \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/sys/delRow.tag b/src/main/webapp/WEB-INF/tags/sys/delRow.tag index 8b1d10746..f127aaea2 100644 --- a/src/main/webapp/WEB-INF/tags/sys/delRow.tag +++ b/src/main/webapp/WEB-INF/tags/sys/delRow.tag @@ -199,7 +199,107 @@ var checkboxes=$("#${id} ${value} tbody tr td input.i-checks:checkbox"); top.$.jBox.tip("", ""); return; } - top.$.jBox.confirm("","",function(v,h,f){ + + if((url.indexOf("?isAudit=3") > 1)){ + // 审核中区分是否有添加取消来函 + + var reobj=JSON.parse(JSON.stringify("${page.list[0]}")); + var indexTableNameArr=reobj.match(/indexTable=(\w*),/); + var requestNameArr=reobj.match(/requestName=(\w*),/); + // 有来函业务的取消审核 + if(reobj!=null&&reobj.indexOf("requestName")!=-1&&requestNameArr!=null&&requestNameArr.length>1&&indexTableNameArr!=null&&indexTableNameArr.length>1){ + var indexTableName =indexTableNameArr[1]; + var requestName =requestNameArr[1]; + + if(requestName.indexOf("null")==-1&&typeof(indexTableName)!="undefined"&&indexTableName!=null&&indexTableName!=''&&indexTableName.indexOf("null")==-1){ + $.jBox.open("iframe:${ctx}/basics/serviceDictInfo/requestSelectInfo", "取消审核通过", 400, 500, { buttons: { '确定': 1, '取消': 0 }, + submit: function (v, h, f) { + if (v == 0) { + return true; // close the window + } else { + h.find('.errorBlock').hide('fast', function () { $(this).remove(); }); + var cancelRequestId = h.find("iframe")[0].contentWindow.requestIsAudit.value; + if (!cancelRequestId) { + $('').prependTo(h).show('fast'); + return false; + } + if(url.indexOf("?")>0){ + $.ajax({ + type:'post', + url:'${ctx}/basics/serviceDictInfo/requestCancleInfoAjax', + data:{"cancelRequestId":cancelRequestId,"ids":ids,"indexTable":indexTableName}, + async:false, + success:function(data,textStatus){//处理返回结果 + window.location = url+"&ids="+ids+"&compileIds="+compileIds; + } + }); + }else{ + window.location = url+"?ids="+ids+"&compileIds="+compileIds; + } + if(url.indexOf("?isAudit") > 1){ + loading(''); + }else if(url.indexOf("export") > 1){ + closeTip(); + } + //$("#searchForm").submit(); + + top.$.jBox.tip("审核---"+(cancelRequestId), ""); + } + + return true; + }, + loaded:function(h){ + $(".jbox-content,top.document").css("overflow-y","hidden") + $(".jbox-content,top.document.children").css("clear","both") + $(".jbox-content,top.document.children").css("z-index","999999") + $(".jbox-content,top.document.children").css("overflow;","auto") + $(".jbox-content,top.document").css("width","90%") + } + }); + }else{ + // 防止有来函无表名的取消审核操作 + top.$.jBox.confirm("","",function(v,h,f){ + + if(v=="ok"){ + if(url.indexOf("?")>0){ + window.location = url+"&ids="+ids+"&compileIds="+compileIds; + }else{ + window.location = url+"?ids="+ids+"&compileIds="+compileIds; + } + if(url.indexOf("?isAudit") > 1){ + loading(''); + }else if(url.indexOf("export") > 1){ + closeTip(); + } + //$("#searchForm").submit(); + } + },{buttonsFocus:1}); + top.$('.jbox-body .jbox-icon').css('top','55px'); + } + }else{ + // 无来函选项的取消审核操作 + top.$.jBox.confirm("","",function(v,h,f){ + + if(v=="ok"){ + if(url.indexOf("?")>0){ + window.location = url+"&ids="+ids+"&compileIds="+compileIds; + }else{ + window.location = url+"?ids="+ids+"&compileIds="+compileIds; + } + if(url.indexOf("?isAudit") > 1){ + loading(''); + }else if(url.indexOf("export") > 1){ + closeTip(); + } + //$("#searchForm").submit(); + } + },{buttonsFocus:1}); + top.$('.jbox-body .jbox-icon').css('top','55px'); + } + //除取消审核之外的业务 + }else{ + + top.$.jBox.confirm("","",function(v,h,f){ if(v=="ok"){ if(url.indexOf("?")>0){ @@ -216,7 +316,7 @@ var checkboxes=$("#${id} ${value} tbody tr td input.i-checks:checkbox"); } },{buttonsFocus:1}); top.$('.jbox-body .jbox-icon').css('top','55px'); - + } } //验证选择的配置,是否可删除或者审核未通过或者审核通过,只有未审核的配置可删除或审核未通过或审核通过 function validateAllNoAudit(checkboxes){ diff --git a/src/main/webapp/WEB-INF/views/basics/requestSelectInfo.jsp b/src/main/webapp/WEB-INF/views/basics/requestSelectInfo.jsp new file mode 100644 index 000000000..65c9b47d8 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/basics/requestSelectInfo.jsp @@ -0,0 +1,32 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + +
+
+
+ +
+ + +
+ +
+
+
+ \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipList.jsp b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipList.jsp index 7c28b292a..9a52fa3fe 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipList.jsp @@ -465,7 +465,9 @@ - + + +
diff --git a/src/main/webapp/static/global/scripts/common.js b/src/main/webapp/static/global/scripts/common.js index a75c96988..f3ad73883 100644 --- a/src/main/webapp/static/global/scripts/common.js +++ b/src/main/webapp/static/global/scripts/common.js @@ -1,4 +1,33 @@ $(function(){ + var leff =$("span[class~='le-ca-fo']").attr("data-original-title") + + $("#contentTable").not(".logTb").find("tbody tr").each(function(i){ + if($(this).find("input[type='checkbox']").attr("value")==3){ + var ids = $(this).find("span").attr("cfgId"); + var resetLeff =$(this).find("span[class~='le-ca-fo']"); + var indexTableName = $("#contentTable tbody tr td span[class~='le-ca-fo']").attr("indexTable"); + var pathName=window.document.location.pathname.substring(0,window.document.location.pathname.lastIndexOf("/nis")+4); + if(ids!=null&&indexTableName!=null){ + $.ajax({ + type:'post', + url:pathName+'/basics/serviceDictInfo/requestCancleInfoNumber', + data:{"ids":ids,"indexTable":indexTableName}, + dataType:'json', + success:function(data){//处理返回结果 + //根据表名跟cfgid获取 requestNumber; + if(data.requestTitle!=null){ + resetLeff.attr("data-original-title",leff+data.requestTitle) + }else{ + resetLeff.attr("data-original-title",leff+"") + } + } + }); + } + } + }) + + + //增加描述新增时的文字长度限制 $("form input[name='cfgDesc']").attr("maxlength","128"); $("form input[name$='cfgKeywords']").attr("maxlength","1024"); From 12720ad2a8ac36e59501d8d135ffdaa43a6b9590 Mon Sep 17 00:00:00 2001 From: wangxin Date: Mon, 22 Oct 2018 20:02:59 +0800 Subject: [PATCH 3/7] =?UTF-8?q?ratelimit=E9=AA=8C=E8=AF=81=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E5=AD=97=E5=85=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/nis/web/controller/BaseController.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index 2194ee230..ec21da70b 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -1097,8 +1097,16 @@ public class BaseController { if(serviceDict.getFunctionId().intValue()==5&&serviceDict.getAction().intValue()==64) { String userRegion1=baseIpCfg.getUserRegion1(); try { - Double ratelimt= Double.parseDouble(userRegion1); - if(ratelimt>0.009||ratelimt<0.001) { +// Double ratelimt= Double.parseDouble(userRegion1); + List ratelimtList=DictUtils.getDictList("RATE_LIMIT"); + boolean has=false; + for(SysDataDictionaryItem ratelimit:ratelimtList) { + if(ratelimit.getItemCode().equals(userRegion1)) { + has=true; + break; + } + } + if(!has) { errInfo.append(prop.getProperty("ratelimit")+"."+String.format(prop.getProperty("must_between"),0.001,0.009)+";"); } } catch (Exception e) { From 03b63b1709f14b8d6c8f62b8744f0870e004be79 Mon Sep 17 00:00:00 2001 From: wangxin Date: Mon, 22 Oct 2018 20:19:06 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/messages/message_en.properties | 3 ++- src/main/resources/messages/message_zh_CN.properties | 3 ++- src/main/webapp/WEB-INF/include/excel/importModal.jsp | 2 +- src/main/webapp/static/pages/scripts/importExcel.js | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index fcce7861b..aae4424a9 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1273,4 +1273,5 @@ ipv4_subnet=IPv4/Subnet Mask ipv6_range=IPv6 Range ipv6_subnet=IPv6/Subnet Mask example=For Example -letter_cancel_info=Cancel Letter Info \ No newline at end of file +letter_cancel_info=Cancel Letter Info +import_tip_excel=Please choose a valid Excel file with which it's subfix is .xls or .xlsx to import. \ No newline at end of file diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index c624f2b14..c9a9feeff 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1268,4 +1268,5 @@ ipv4_subnet=IPv4/Subnet mask ipv6_range=IPv6 Range ipv6_subnet=IPv6/Subnet mask example=\u4F8B\u5982 -letter_cancel_info=\u53D6\u6D88\u5BA1\u6838\u6765\u51FD \ No newline at end of file +letter_cancel_info=\u53D6\u6D88\u5BA1\u6838\u6765\u51FD +import_tip_excel=\u8BF7\u9009\u62E9\u6587\u4EF6\u7ED3\u5C3E\u4E3A.xls\u6216\u8005.xlsx\u7684\u6709\u6548Excel\u6587\u4EF6\u5BFC\u5165 \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/include/excel/importModal.jsp b/src/main/webapp/WEB-INF/include/excel/importModal.jsp index 8ebaa3c89..2b3fe6593 100644 --- a/src/main/webapp/WEB-INF/include/excel/importModal.jsp +++ b/src/main/webapp/WEB-INF/include/excel/importModal.jsp @@ -4,7 +4,7 @@